heyio 1.13.0 → 3.0.1

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 (380) hide show
  1. package/README.md +162 -278
  2. package/dist/api/middleware/auth.d.ts +14 -0
  3. package/dist/api/middleware/auth.d.ts.map +1 -0
  4. package/dist/api/middleware/auth.js +66 -0
  5. package/dist/api/middleware/auth.js.map +1 -0
  6. package/dist/api/notifications.d.ts +14 -0
  7. package/dist/api/notifications.d.ts.map +1 -0
  8. package/dist/api/notifications.js +112 -0
  9. package/dist/api/notifications.js.map +1 -0
  10. package/dist/api/routes/activity.d.ts +3 -0
  11. package/dist/api/routes/activity.d.ts.map +1 -0
  12. package/dist/api/routes/activity.js +28 -0
  13. package/dist/api/routes/activity.js.map +1 -0
  14. package/dist/api/routes/attachments.d.ts +3 -0
  15. package/dist/api/routes/attachments.d.ts.map +1 -0
  16. package/dist/api/routes/attachments.js +83 -0
  17. package/dist/api/routes/attachments.js.map +1 -0
  18. package/dist/api/routes/config.d.ts +3 -0
  19. package/dist/api/routes/config.d.ts.map +1 -0
  20. package/dist/api/routes/config.js +106 -0
  21. package/dist/api/routes/config.js.map +1 -0
  22. package/dist/api/routes/conversations.d.ts +3 -0
  23. package/dist/api/routes/conversations.d.ts.map +1 -0
  24. package/dist/api/routes/conversations.js +69 -0
  25. package/dist/api/routes/conversations.js.map +1 -0
  26. package/dist/api/routes/health.d.ts +3 -0
  27. package/dist/api/routes/health.d.ts.map +1 -0
  28. package/dist/api/routes/health.js +16 -0
  29. package/dist/api/routes/health.js.map +1 -0
  30. package/dist/api/routes/inbox.d.ts +3 -0
  31. package/dist/api/routes/inbox.d.ts.map +1 -0
  32. package/dist/api/routes/inbox.js +88 -0
  33. package/dist/api/routes/inbox.js.map +1 -0
  34. package/dist/api/routes/schedules.d.ts +3 -0
  35. package/dist/api/routes/schedules.d.ts.map +1 -0
  36. package/dist/api/routes/schedules.js +96 -0
  37. package/dist/api/routes/schedules.js.map +1 -0
  38. package/dist/api/routes/skills.d.ts +2 -0
  39. package/dist/api/routes/skills.d.ts.map +1 -0
  40. package/dist/api/routes/skills.js +85 -0
  41. package/dist/api/routes/skills.js.map +1 -0
  42. package/dist/api/routes/squads.d.ts +3 -0
  43. package/dist/api/routes/squads.d.ts.map +1 -0
  44. package/dist/api/routes/squads.js +129 -0
  45. package/dist/api/routes/squads.js.map +1 -0
  46. package/dist/api/routes/usage.d.ts +3 -0
  47. package/dist/api/routes/usage.d.ts.map +1 -0
  48. package/dist/api/routes/usage.js +55 -0
  49. package/dist/api/routes/usage.js.map +1 -0
  50. package/dist/api/routes/wiki.d.ts +2 -0
  51. package/dist/api/routes/wiki.d.ts.map +1 -0
  52. package/dist/api/routes/wiki.js +43 -0
  53. package/dist/api/routes/wiki.js.map +1 -0
  54. package/dist/api/server.d.ts +7 -0
  55. package/dist/api/server.d.ts.map +1 -0
  56. package/dist/api/server.js +136 -634
  57. package/dist/api/server.js.map +1 -0
  58. package/dist/config.d.ts +3 -0
  59. package/dist/config.d.ts.map +1 -0
  60. package/dist/config.js +2 -91
  61. package/dist/config.js.map +1 -0
  62. package/dist/copilot/client.d.ts +5 -0
  63. package/dist/copilot/client.d.ts.map +1 -0
  64. package/dist/copilot/client.js +19 -11
  65. package/dist/copilot/client.js.map +1 -0
  66. package/dist/copilot/health-monitor.d.ts +14 -0
  67. package/dist/copilot/health-monitor.d.ts.map +1 -0
  68. package/dist/copilot/health-monitor.js +70 -0
  69. package/dist/copilot/health-monitor.js.map +1 -0
  70. package/dist/copilot/orchestrator.d.ts +5 -0
  71. package/dist/copilot/orchestrator.d.ts.map +1 -0
  72. package/dist/copilot/orchestrator.js +127 -123
  73. package/dist/copilot/orchestrator.js.map +1 -0
  74. package/dist/copilot/tools.d.ts +49 -0
  75. package/dist/copilot/tools.d.ts.map +1 -0
  76. package/dist/copilot/tools.js +545 -321
  77. package/dist/copilot/tools.js.map +1 -0
  78. package/dist/index.d.ts +3 -0
  79. package/dist/index.d.ts.map +1 -0
  80. package/dist/index.js +82 -26
  81. package/dist/index.js.map +1 -0
  82. package/dist/logging/logger.d.ts +6 -0
  83. package/dist/logging/logger.d.ts.map +1 -0
  84. package/dist/logging/logger.js +21 -0
  85. package/dist/logging/logger.js.map +1 -0
  86. package/dist/models/index.d.ts +6 -0
  87. package/dist/models/index.d.ts.map +1 -0
  88. package/dist/models/index.js +4 -0
  89. package/dist/models/index.js.map +1 -0
  90. package/dist/models/pricing.d.ts +25 -0
  91. package/dist/models/pricing.d.ts.map +1 -0
  92. package/dist/models/pricing.js +96 -0
  93. package/dist/models/pricing.js.map +1 -0
  94. package/dist/models/registry.d.ts +34 -0
  95. package/dist/models/registry.d.ts.map +1 -0
  96. package/dist/models/registry.js +109 -0
  97. package/dist/models/registry.js.map +1 -0
  98. package/dist/models/token-tracker.d.ts +40 -0
  99. package/dist/models/token-tracker.d.ts.map +1 -0
  100. package/dist/models/token-tracker.js +102 -0
  101. package/dist/models/token-tracker.js.map +1 -0
  102. package/dist/scheduler/engine.d.ts +9 -0
  103. package/dist/scheduler/engine.d.ts.map +1 -0
  104. package/dist/scheduler/engine.js +127 -0
  105. package/dist/scheduler/engine.js.map +1 -0
  106. package/dist/skills/index.d.ts +3 -0
  107. package/dist/skills/index.d.ts.map +1 -0
  108. package/dist/skills/index.js +2 -0
  109. package/dist/skills/index.js.map +1 -0
  110. package/dist/skills/store.d.ts +52 -0
  111. package/dist/skills/store.d.ts.map +1 -0
  112. package/dist/skills/store.js +148 -0
  113. package/dist/skills/store.js.map +1 -0
  114. package/dist/squad/agent.d.ts +46 -0
  115. package/dist/squad/agent.d.ts.map +1 -0
  116. package/dist/squad/agent.js +261 -0
  117. package/dist/squad/agent.js.map +1 -0
  118. package/dist/squad/autonomy.d.ts +16 -0
  119. package/dist/squad/autonomy.d.ts.map +1 -0
  120. package/dist/squad/autonomy.js +63 -0
  121. package/dist/squad/autonomy.js.map +1 -0
  122. package/dist/squad/event-bus.d.ts +22 -0
  123. package/dist/squad/event-bus.d.ts.map +1 -0
  124. package/dist/squad/event-bus.js +56 -0
  125. package/dist/squad/event-bus.js.map +1 -0
  126. package/dist/squad/execution/index.d.ts +12 -0
  127. package/dist/squad/execution/index.d.ts.map +1 -0
  128. package/dist/squad/execution/index.js +7 -0
  129. package/dist/squad/execution/index.js.map +1 -0
  130. package/dist/squad/execution/instance.d.ts +40 -0
  131. package/dist/squad/execution/instance.d.ts.map +1 -0
  132. package/dist/squad/execution/instance.js +138 -0
  133. package/dist/squad/execution/instance.js.map +1 -0
  134. package/dist/squad/execution/meeting.d.ts +25 -0
  135. package/dist/squad/execution/meeting.d.ts.map +1 -0
  136. package/dist/squad/execution/meeting.js +140 -0
  137. package/dist/squad/execution/meeting.js.map +1 -0
  138. package/dist/squad/execution/pr.d.ts +15 -0
  139. package/dist/squad/execution/pr.d.ts.map +1 -0
  140. package/dist/squad/execution/pr.js +93 -0
  141. package/dist/squad/execution/pr.js.map +1 -0
  142. package/dist/squad/execution/runner.d.ts +22 -0
  143. package/dist/squad/execution/runner.d.ts.map +1 -0
  144. package/dist/squad/execution/runner.js +68 -0
  145. package/dist/squad/execution/runner.js.map +1 -0
  146. package/dist/squad/execution/tasks.d.ts +11 -0
  147. package/dist/squad/execution/tasks.d.ts.map +1 -0
  148. package/dist/squad/execution/tasks.js +85 -0
  149. package/dist/squad/execution/tasks.js.map +1 -0
  150. package/dist/squad/execution/worktree.d.ts +26 -0
  151. package/dist/squad/execution/worktree.d.ts.map +1 -0
  152. package/dist/squad/execution/worktree.js +111 -0
  153. package/dist/squad/execution/worktree.js.map +1 -0
  154. package/dist/squad/hiring.d.ts +32 -0
  155. package/dist/squad/hiring.d.ts.map +1 -0
  156. package/dist/squad/hiring.js +200 -0
  157. package/dist/squad/hiring.js.map +1 -0
  158. package/dist/squad/index.d.ts +8 -0
  159. package/dist/squad/index.d.ts.map +1 -0
  160. package/dist/squad/index.js +6 -0
  161. package/dist/squad/index.js.map +1 -0
  162. package/dist/squad/manager.d.ts +48 -0
  163. package/dist/squad/manager.d.ts.map +1 -0
  164. package/dist/squad/manager.js +274 -0
  165. package/dist/squad/manager.js.map +1 -0
  166. package/dist/squad/name-generator.d.ts +16 -0
  167. package/dist/squad/name-generator.d.ts.map +1 -0
  168. package/dist/squad/name-generator.js +113 -0
  169. package/dist/squad/name-generator.js.map +1 -0
  170. package/dist/squad/roles/templates.d.ts +5 -0
  171. package/dist/squad/roles/templates.d.ts.map +1 -0
  172. package/dist/squad/roles/templates.js +102 -0
  173. package/dist/squad/roles/templates.js.map +1 -0
  174. package/dist/squad/skill-parser.d.ts +36 -0
  175. package/dist/squad/skill-parser.d.ts.map +1 -0
  176. package/dist/squad/skill-parser.js +83 -0
  177. package/dist/squad/skill-parser.js.map +1 -0
  178. package/dist/squad/source-resolver.d.ts +20 -0
  179. package/dist/squad/source-resolver.d.ts.map +1 -0
  180. package/dist/squad/source-resolver.js +52 -0
  181. package/dist/squad/source-resolver.js.map +1 -0
  182. package/dist/store/activity.d.ts +43 -0
  183. package/dist/store/activity.d.ts.map +1 -0
  184. package/dist/store/activity.js +131 -0
  185. package/dist/store/activity.js.map +1 -0
  186. package/dist/store/db.d.ts +5 -0
  187. package/dist/store/db.d.ts.map +1 -0
  188. package/dist/store/db.js +209 -248
  189. package/dist/store/db.js.map +1 -0
  190. package/dist/store/inbox.d.ts +53 -0
  191. package/dist/store/inbox.d.ts.map +1 -0
  192. package/dist/store/inbox.js +151 -0
  193. package/dist/store/inbox.js.map +1 -0
  194. package/dist/store/schedules.d.ts +53 -0
  195. package/dist/store/schedules.d.ts.map +1 -0
  196. package/dist/store/schedules.js +149 -54
  197. package/dist/store/schedules.js.map +1 -0
  198. package/dist/wiki/index.d.ts +3 -0
  199. package/dist/wiki/index.d.ts.map +1 -0
  200. package/dist/wiki/index.js +2 -0
  201. package/dist/wiki/index.js.map +1 -0
  202. package/dist/wiki/store.d.ts +49 -0
  203. package/dist/wiki/store.d.ts.map +1 -0
  204. package/dist/wiki/store.js +115 -0
  205. package/dist/wiki/store.js.map +1 -0
  206. package/node_modules/@io/shared/dist/config.d.ts +25 -0
  207. package/node_modules/@io/shared/dist/config.d.ts.map +1 -0
  208. package/node_modules/@io/shared/dist/config.js +47 -0
  209. package/node_modules/@io/shared/dist/config.js.map +1 -0
  210. package/node_modules/@io/shared/dist/constants.d.ts +13 -0
  211. package/node_modules/@io/shared/dist/constants.d.ts.map +1 -0
  212. package/node_modules/@io/shared/dist/constants.js +34 -0
  213. package/node_modules/@io/shared/dist/constants.js.map +1 -0
  214. package/node_modules/@io/shared/dist/index.d.ts +11 -0
  215. package/node_modules/@io/shared/dist/index.d.ts.map +1 -0
  216. package/node_modules/@io/shared/dist/index.js +3 -0
  217. package/node_modules/@io/shared/dist/index.js.map +1 -0
  218. package/node_modules/@io/shared/dist/types/agents.d.ts +3 -0
  219. package/node_modules/@io/shared/dist/types/agents.d.ts.map +1 -0
  220. package/node_modules/@io/shared/dist/types/agents.js +2 -0
  221. package/node_modules/@io/shared/dist/types/agents.js.map +1 -0
  222. package/node_modules/@io/shared/dist/types/api.d.ts +33 -0
  223. package/node_modules/@io/shared/dist/types/api.d.ts.map +1 -0
  224. package/node_modules/@io/shared/dist/types/api.js +2 -0
  225. package/node_modules/@io/shared/dist/types/api.js.map +1 -0
  226. package/node_modules/@io/shared/dist/types/attachments.d.ts +10 -0
  227. package/node_modules/@io/shared/dist/types/attachments.d.ts.map +1 -0
  228. package/node_modules/@io/shared/dist/types/attachments.js +2 -0
  229. package/node_modules/@io/shared/dist/types/attachments.js.map +1 -0
  230. package/node_modules/@io/shared/dist/types/events.d.ts +44 -0
  231. package/node_modules/@io/shared/dist/types/events.d.ts.map +1 -0
  232. package/node_modules/@io/shared/dist/types/events.js +2 -0
  233. package/node_modules/@io/shared/dist/types/events.js.map +1 -0
  234. package/node_modules/@io/shared/dist/types/messages.d.ts +15 -0
  235. package/node_modules/@io/shared/dist/types/messages.d.ts.map +1 -0
  236. package/node_modules/@io/shared/dist/types/messages.js +2 -0
  237. package/node_modules/@io/shared/dist/types/messages.js.map +1 -0
  238. package/node_modules/@io/shared/dist/types/squads.d.ts +43 -0
  239. package/node_modules/@io/shared/dist/types/squads.d.ts.map +1 -0
  240. package/node_modules/@io/shared/dist/types/squads.js +2 -0
  241. package/node_modules/@io/shared/dist/types/squads.js.map +1 -0
  242. package/node_modules/@io/shared/dist/types/tokens.d.ts +19 -0
  243. package/node_modules/@io/shared/dist/types/tokens.d.ts.map +1 -0
  244. package/node_modules/@io/shared/dist/types/tokens.js +2 -0
  245. package/node_modules/@io/shared/dist/types/tokens.js.map +1 -0
  246. package/node_modules/@io/shared/package.json +18 -0
  247. package/node_modules/@io/shared/src/config.ts +74 -0
  248. package/node_modules/@io/shared/src/constants.ts +36 -0
  249. package/node_modules/@io/shared/src/index.ts +37 -0
  250. package/node_modules/@io/shared/src/types/agents.ts +3 -0
  251. package/node_modules/@io/shared/src/types/api.ts +35 -0
  252. package/node_modules/@io/shared/src/types/attachments.ts +9 -0
  253. package/node_modules/@io/shared/src/types/events.ts +81 -0
  254. package/node_modules/@io/shared/src/types/messages.ts +15 -0
  255. package/node_modules/@io/shared/src/types/squads.ts +53 -0
  256. package/node_modules/@io/shared/src/types/tokens.ts +19 -0
  257. package/node_modules/@io/shared/tsconfig.json +9 -0
  258. package/node_modules/@io/shared/tsconfig.tsbuildinfo +1 -0
  259. package/package.json +56 -59
  260. package/src/api/middleware/auth.ts +76 -0
  261. package/src/api/notifications.ts +122 -0
  262. package/src/api/routes/activity.ts +29 -0
  263. package/src/api/routes/attachments.ts +93 -0
  264. package/src/api/routes/config.ts +115 -0
  265. package/src/api/routes/conversations.ts +87 -0
  266. package/src/api/routes/health.ts +18 -0
  267. package/src/api/routes/inbox.ts +98 -0
  268. package/src/api/routes/schedules.ts +121 -0
  269. package/src/api/routes/skills.ts +105 -0
  270. package/src/api/routes/squads.ts +145 -0
  271. package/src/api/routes/usage.ts +57 -0
  272. package/src/api/routes/wiki.ts +49 -0
  273. package/src/api/server.ts +186 -0
  274. package/src/config.ts +3 -0
  275. package/src/copilot/client.ts +42 -0
  276. package/src/copilot/health-monitor.ts +85 -0
  277. package/src/copilot/orchestrator.ts +222 -0
  278. package/src/copilot/tools.ts +707 -0
  279. package/src/index.ts +112 -0
  280. package/src/logging/logger.ts +26 -0
  281. package/src/models/index.ts +11 -0
  282. package/src/models/pricing.ts +121 -0
  283. package/src/models/registry.ts +131 -0
  284. package/src/models/token-tracker.ts +151 -0
  285. package/src/scheduler/engine.ts +146 -0
  286. package/src/skills/index.ts +13 -0
  287. package/src/skills/store.ts +188 -0
  288. package/src/squad/agent.ts +326 -0
  289. package/src/squad/autonomy.ts +78 -0
  290. package/src/squad/event-bus.ts +71 -0
  291. package/src/squad/execution/index.ts +17 -0
  292. package/src/squad/execution/instance.ts +186 -0
  293. package/src/squad/execution/meeting.ts +191 -0
  294. package/src/squad/execution/pr.ts +127 -0
  295. package/src/squad/execution/runner.ts +97 -0
  296. package/src/squad/execution/tasks.ts +111 -0
  297. package/src/squad/execution/worktree.ts +138 -0
  298. package/src/squad/hiring.ts +222 -0
  299. package/src/squad/index.ts +17 -0
  300. package/src/squad/manager.ts +337 -0
  301. package/src/squad/name-generator.ts +135 -0
  302. package/src/squad/roles/templates.ts +104 -0
  303. package/src/squad/skill-parser.ts +120 -0
  304. package/src/squad/source-resolver.ts +57 -0
  305. package/src/store/activity.ts +176 -0
  306. package/src/store/db.ts +237 -0
  307. package/src/store/inbox.ts +199 -0
  308. package/src/store/schedules.ts +199 -0
  309. package/src/wiki/index.ts +12 -0
  310. package/src/wiki/store.ts +139 -0
  311. package/tsconfig.json +9 -0
  312. package/LICENSE +0 -21
  313. package/dist/api/auth.js +0 -46
  314. package/dist/chat/attachments.js +0 -112
  315. package/dist/copilot/agents.js +0 -309
  316. package/dist/copilot/ceremonies.js +0 -174
  317. package/dist/copilot/gh-token.js +0 -64
  318. package/dist/copilot/io-scheduler.js +0 -79
  319. package/dist/copilot/model-router.js +0 -114
  320. package/dist/copilot/scheduler.js +0 -88
  321. package/dist/copilot/skills.js +0 -252
  322. package/dist/copilot/specialist-runner.js +0 -191
  323. package/dist/copilot/squad-tools.js +0 -258
  324. package/dist/copilot/system-message.js +0 -86
  325. package/dist/copilot/token-tracker.js +0 -98
  326. package/dist/copilot/trigger-schedule.js +0 -33
  327. package/dist/daemon.js +0 -67
  328. package/dist/logging.js +0 -27
  329. package/dist/mcp/config.js +0 -29
  330. package/dist/mcp/index.js +0 -3
  331. package/dist/mcp/registry.js +0 -42
  332. package/dist/notify.js +0 -25
  333. package/dist/paths.js +0 -17
  334. package/dist/setup.js +0 -35
  335. package/dist/store/agent-events.js +0 -19
  336. package/dist/store/audit-log.js +0 -71
  337. package/dist/store/conversations.js +0 -164
  338. package/dist/store/feed.js +0 -44
  339. package/dist/store/instances.js +0 -75
  340. package/dist/store/squad-colors.js +0 -23
  341. package/dist/store/squads.js +0 -60
  342. package/dist/store/tasks.js +0 -78
  343. package/dist/store/token-usage.js +0 -94
  344. package/dist/telegram/bot.js +0 -41
  345. package/dist/telegram/handlers.js +0 -42
  346. package/dist/watchdog.js +0 -37
  347. package/dist/wiki/backlinks.js +0 -51
  348. package/dist/wiki/fs.js +0 -108
  349. package/dist/wiki/search.js +0 -47
  350. package/web-dist/assets/AuditLogView-BzfjNXBT.js +0 -6
  351. package/web-dist/assets/ChatView-BdMukPKG.js +0 -1
  352. package/web-dist/assets/FeedView-BfPIabGr.js +0 -6
  353. package/web-dist/assets/HistoryView-BmEEk3Rs.js +0 -1
  354. package/web-dist/assets/LoginView-D7LrkeX7.js +0 -1
  355. package/web-dist/assets/McpView-BAP_ah3T.js +0 -1
  356. package/web-dist/assets/SchedulesView-CAtsUPCZ.js +0 -6
  357. package/web-dist/assets/SettingsView-BovjWZDa.js +0 -1
  358. package/web-dist/assets/SkillsView-DQSMM5LN.js +0 -16
  359. package/web-dist/assets/SquadDetailView-DBscu0m2.js +0 -26
  360. package/web-dist/assets/SquadHealthView-D686BuQo.js +0 -11
  361. package/web-dist/assets/SquadsView-AzMht2NJ.js +0 -6
  362. package/web-dist/assets/ToggleSwitch.vue_vue_type_script_setup_true_lang-DtShZAjW.js +0 -1
  363. package/web-dist/assets/UsageView-DiVn97aI.js +0 -16
  364. package/web-dist/assets/WikiView-Cn7KipkZ.js +0 -26
  365. package/web-dist/assets/api-D4mHJ3u0.js +0 -1
  366. package/web-dist/assets/arrow-left-D_qUNUWW.js +0 -6
  367. package/web-dist/assets/git-branch-DOM-orcl.js +0 -6
  368. package/web-dist/assets/index-Bo83B1LR.css +0 -1
  369. package/web-dist/assets/index-ELvnkQjd.js +0 -273
  370. package/web-dist/assets/pencil-CFsi7ufI.js +0 -6
  371. package/web-dist/assets/plus-BAzlGFd_.js +0 -6
  372. package/web-dist/assets/save-BmgCYJ1g.js +0 -6
  373. package/web-dist/assets/search-CS9zSIeW.js +0 -6
  374. package/web-dist/assets/squad-colors-B8B_Y-lz.js +0 -1
  375. package/web-dist/assets/trash-2-DLveUEsd.js +0 -6
  376. package/web-dist/assets/triangle-alert-lj4I30rL.js +0 -6
  377. package/web-dist/assets/x-CjXR97Fa.js +0 -6
  378. package/web-dist/favicon.svg +0 -10
  379. package/web-dist/index.html +0 -14
  380. package/web-dist/logo.svg +0 -10
@@ -1,94 +0,0 @@
1
- import { randomUUID } from "node:crypto";
2
- import { getDb } from "./db.js";
3
- export function recordTokenUsage(params) {
4
- const db = getDb();
5
- const id = randomUUID();
6
- db.prepare(`INSERT INTO token_usage (id, squad_id, agent_id, task_id, model, input_tokens, output_tokens, cost_usd)
7
- VALUES (?, ?, ?, ?, ?, ?, ?, ?)`).run(id, params.squadId ?? null, params.agentId ?? null, params.taskId ?? null, params.model, params.inputTokens, params.outputTokens, params.costUsd);
8
- return db.prepare("SELECT * FROM token_usage WHERE id = ?").get(id);
9
- }
10
- export function getTokenUsageSummary(opts) {
11
- const db = getDb();
12
- let sql = `SELECT
13
- COUNT(*) as total_records,
14
- COALESCE(SUM(input_tokens), 0) as total_input_tokens,
15
- COALESCE(SUM(output_tokens), 0) as total_output_tokens,
16
- COALESCE(SUM(input_tokens + output_tokens), 0) as total_tokens,
17
- COALESCE(SUM(cost_usd), 0) as total_cost_usd
18
- FROM token_usage WHERE 1=1`;
19
- const params = [];
20
- if (opts?.since) {
21
- sql += " AND created_at >= ?";
22
- params.push(opts.since);
23
- }
24
- return db.prepare(sql).get(...params);
25
- }
26
- export function getTokenUsageBySquad(opts) {
27
- const db = getDb();
28
- let sql = `SELECT
29
- s.id,
30
- s.name,
31
- COALESCE(SUM(t.input_tokens), 0) as total_input_tokens,
32
- COALESCE(SUM(t.output_tokens), 0) as total_output_tokens,
33
- COALESCE(SUM(t.input_tokens + t.output_tokens), 0) as total_tokens,
34
- COALESCE(SUM(t.cost_usd), 0) as total_cost_usd,
35
- COUNT(t.id) as record_count
36
- FROM squads s
37
- LEFT JOIN token_usage t ON t.squad_id = s.id`;
38
- const params = [];
39
- if (opts?.since) {
40
- sql += " AND t.created_at >= ?";
41
- params.push(opts.since);
42
- }
43
- sql += " GROUP BY s.id ORDER BY total_tokens DESC";
44
- return db.prepare(sql).all(...params);
45
- }
46
- export function getTokenUsageByAgent(opts) {
47
- const db = getDb();
48
- let sql = `SELECT
49
- a.id,
50
- a.character_name as name,
51
- COALESCE(SUM(t.input_tokens), 0) as total_input_tokens,
52
- COALESCE(SUM(t.output_tokens), 0) as total_output_tokens,
53
- COALESCE(SUM(t.input_tokens + t.output_tokens), 0) as total_tokens,
54
- COALESCE(SUM(t.cost_usd), 0) as total_cost_usd,
55
- COUNT(t.id) as record_count
56
- FROM agents a
57
- LEFT JOIN token_usage t ON t.agent_id = a.id`;
58
- const params = [];
59
- const conditions = [];
60
- if (opts?.squadId) {
61
- conditions.push("a.squad_id = ?");
62
- params.push(opts.squadId);
63
- }
64
- if (opts?.since) {
65
- conditions.push("(t.created_at >= ? OR t.created_at IS NULL)");
66
- params.push(opts.since);
67
- }
68
- if (conditions.length > 0) {
69
- sql += " WHERE " + conditions.join(" AND ");
70
- }
71
- sql += " GROUP BY a.id ORDER BY total_tokens DESC";
72
- return db.prepare(sql).all(...params);
73
- }
74
- export function getDailyTokenUsage(days = 30) {
75
- const db = getDb();
76
- const sql = `SELECT
77
- date(created_at) as date,
78
- COALESCE(SUM(input_tokens), 0) as total_input_tokens,
79
- COALESCE(SUM(output_tokens), 0) as total_output_tokens,
80
- COALESCE(SUM(input_tokens + output_tokens), 0) as total_tokens,
81
- COALESCE(SUM(cost_usd), 0) as total_cost_usd
82
- FROM token_usage
83
- WHERE created_at >= date('now', '-' || ? || ' days')
84
- GROUP BY date(created_at)
85
- ORDER BY date ASC`;
86
- return db.prepare(sql).all(days);
87
- }
88
- export function getTokenUsageForTask(taskId) {
89
- const db = getDb();
90
- return db
91
- .prepare("SELECT * FROM token_usage WHERE task_id = ? ORDER BY created_at ASC")
92
- .all(taskId);
93
- }
94
- //# sourceMappingURL=token-usage.js.map
@@ -1,41 +0,0 @@
1
- import { Bot } from "grammy";
2
- import { handleMessage } from "./handlers.js";
3
- let bot;
4
- export async function startBot(config) {
5
- if (!config.telegramBotToken) {
6
- throw new Error("Telegram bot token not configured.");
7
- }
8
- bot = new Bot(config.telegramBotToken);
9
- // Only allow the authorized user
10
- bot.use(async (ctx, next) => {
11
- if (ctx.from?.id !== config.authorizedUserId) {
12
- await ctx.reply("Unauthorized.");
13
- return;
14
- }
15
- await next();
16
- });
17
- bot.on("message:text", async (ctx) => {
18
- await handleMessage(ctx, ctx.message.text);
19
- });
20
- bot.on("message:photo", async (ctx) => {
21
- await handleMessage(ctx, "[Image attached]", true);
22
- });
23
- bot.on("message:document", async (ctx) => {
24
- const caption = ctx.message.caption ?? "[Document attached]";
25
- await handleMessage(ctx, caption, true);
26
- });
27
- bot.catch((err) => {
28
- console.error("[telegram] Bot error:", err.message);
29
- });
30
- bot.start();
31
- }
32
- export function getBot() {
33
- return bot;
34
- }
35
- export async function stopBot() {
36
- if (bot) {
37
- await bot.stop();
38
- bot = undefined;
39
- }
40
- }
41
- //# sourceMappingURL=bot.js.map
@@ -1,42 +0,0 @@
1
- import { sendToOrchestrator } from "../copilot/orchestrator.js";
2
- import { logWarn } from "../logging.js";
3
- export async function handleMessage(ctx, text, _hasAttachment) {
4
- // Send typing indicator
5
- await ctx.replyWithChatAction("typing");
6
- let lastSent = "";
7
- let replyMsgId;
8
- await sendToOrchestrator(text, "telegram", async (content, done) => {
9
- if (!done)
10
- return; // Only send final message for Telegram
11
- // Truncate if too long for Telegram (4096 char limit)
12
- const truncated = content.length > 4000 ? content.slice(0, 4000) + "\n\n...(truncated)" : content;
13
- if (truncated === lastSent)
14
- return;
15
- lastSent = truncated;
16
- try {
17
- if (replyMsgId) {
18
- await ctx.api.editMessageText(ctx.chat.id, replyMsgId, truncated, {
19
- parse_mode: "Markdown",
20
- });
21
- }
22
- else {
23
- const msg = await ctx.reply(truncated, { parse_mode: "Markdown" });
24
- replyMsgId = msg.message_id;
25
- }
26
- }
27
- catch (err) {
28
- logWarn("Telegram message edit failed, falling back to plain text", {}, err);
29
- // Fallback: send without markdown parsing
30
- try {
31
- if (!replyMsgId) {
32
- const msg = await ctx.reply(truncated);
33
- replyMsgId = msg.message_id;
34
- }
35
- }
36
- catch (err) {
37
- console.error("[telegram] Failed to send message:", err);
38
- }
39
- }
40
- });
41
- }
42
- //# sourceMappingURL=handlers.js.map
package/dist/watchdog.js DELETED
@@ -1,37 +0,0 @@
1
- import { getStaleInstances, destroyInstance } from "./store/instances.js";
2
- let watchdogInterval;
3
- let lastTick = Date.now();
4
- export function startWatchdog() {
5
- // Event loop stall detection
6
- const STALL_THRESHOLD_MS = 5000;
7
- const stallCheck = setInterval(() => {
8
- const now = Date.now();
9
- const drift = now - lastTick - 1000; // expected 1s interval
10
- if (drift > STALL_THRESHOLD_MS) {
11
- console.warn(`[watchdog] Event loop stall detected: ${drift}ms drift.`);
12
- }
13
- lastTick = now;
14
- }, 1000);
15
- stallCheck.unref();
16
- // Zombie instance detection (every 5 minutes)
17
- watchdogInterval = setInterval(async () => {
18
- const stale = getStaleInstances(30);
19
- for (const instance of stale) {
20
- console.warn(`[watchdog] Zombie instance detected: ${instance.id} (squad: ${instance.squad_id}). Destroying...`);
21
- try {
22
- await destroyInstance(instance.id);
23
- }
24
- catch (err) {
25
- console.error(`[watchdog] Failed to destroy instance ${instance.id}:`, err);
26
- }
27
- }
28
- }, 5 * 60_000);
29
- watchdogInterval.unref();
30
- }
31
- export function stopWatchdog() {
32
- if (watchdogInterval) {
33
- clearInterval(watchdogInterval);
34
- watchdogInterval = undefined;
35
- }
36
- }
37
- //# sourceMappingURL=watchdog.js.map
@@ -1,51 +0,0 @@
1
- import { existsSync, readFileSync } from "node:fs";
2
- import { join, dirname, resolve } from "node:path";
3
- import { PATHS } from "../paths.js";
4
- import { listPages } from "./fs.js";
5
- export async function getBacklinks(targetPath) {
6
- if (!existsSync(PATHS.wikiPages))
7
- return [];
8
- const pages = await listPages();
9
- const backlinks = [];
10
- // Normalize the target path (ensure .md extension)
11
- const normalizedTarget = targetPath.endsWith(".md") ? targetPath : `${targetPath}.md`;
12
- for (const pagePath of pages) {
13
- if (pagePath === normalizedTarget)
14
- continue; // Skip self-references
15
- const fullPath = join(PATHS.wikiPages, pagePath);
16
- const content = readFileSync(fullPath, "utf-8");
17
- if (pageLinksTo(content, pagePath, normalizedTarget)) {
18
- backlinks.push(pagePath);
19
- }
20
- }
21
- return backlinks;
22
- }
23
- function pageLinksTo(content, fromPage, targetPage) {
24
- const fromDir = dirname(fromPage);
25
- const targetWithoutExt = targetPage.replace(/\.md$/, "");
26
- // Check standard markdown links: [text](url)
27
- const markdownLinkRegex = /\[([^\]]*)\]\(([^)]+)\)/g;
28
- let match;
29
- while ((match = markdownLinkRegex.exec(content)) !== null) {
30
- const linkHref = match[2].split("#")[0].trim(); // Strip anchors and whitespace
31
- if (!linkHref || linkHref.startsWith("http://") || linkHref.startsWith("https://"))
32
- continue;
33
- const resolvedLink = resolve("/", fromDir, linkHref).slice(1); // Resolve relative path, strip leading /
34
- const resolvedWithoutExt = resolvedLink.endsWith(".md") ? resolvedLink.slice(0, -3) : resolvedLink;
35
- if (resolvedWithoutExt === targetWithoutExt)
36
- return true;
37
- }
38
- // Check wiki-style links: [[page]] or [[page|display text]]
39
- // Wiki-style links are resolved from the wiki root (absolute), not relative to the current page
40
- const wikiLinkRegex = /\[\[([^\]]+)\]\]/g;
41
- while ((match = wikiLinkRegex.exec(content)) !== null) {
42
- const linkTarget = match[1].split("|")[0].trim(); // Handle [[page|display text]]
43
- if (!linkTarget)
44
- continue;
45
- const resolvedWithoutExt = linkTarget.endsWith(".md") ? linkTarget.slice(0, -3) : linkTarget;
46
- if (resolvedWithoutExt === targetWithoutExt)
47
- return true;
48
- }
49
- return false;
50
- }
51
- //# sourceMappingURL=backlinks.js.map
package/dist/wiki/fs.js DELETED
@@ -1,108 +0,0 @@
1
- import { existsSync, mkdirSync, readFileSync, writeFileSync, rmSync, cpSync } from "node:fs";
2
- import { join, dirname } from "node:path";
3
- import { readdirSync } from "node:fs";
4
- import { PATHS } from "../paths.js";
5
- function safeJoin(base, userPath) {
6
- // Strip path traversal by removing any '..' and absolute path components
7
- const sanitized = userPath
8
- .split(/[/\\]/)
9
- .filter((segment) => segment !== ".." && segment !== ".")
10
- .join("/");
11
- const resolved = join(base, sanitized);
12
- if (!resolved.startsWith(base)) {
13
- throw new Error("Invalid path: traversal outside base directory is not allowed");
14
- }
15
- return resolved;
16
- }
17
- export async function readPage(path) {
18
- const fullPath = join(PATHS.wikiPages, path);
19
- if (!existsSync(fullPath)) {
20
- throw new Error(`Wiki page not found: ${path}`);
21
- }
22
- return readFileSync(fullPath, "utf-8");
23
- }
24
- export async function writePage(path, content) {
25
- const fullPath = join(PATHS.wikiPages, path);
26
- const dir = dirname(fullPath);
27
- if (!existsSync(dir))
28
- mkdirSync(dir, { recursive: true });
29
- writeFileSync(fullPath, content);
30
- }
31
- export async function deletePage(path) {
32
- const fullPath = join(PATHS.wikiPages, path);
33
- if (!existsSync(fullPath)) {
34
- throw new Error(`Wiki page not found: ${path}`);
35
- }
36
- rmSync(fullPath);
37
- }
38
- export async function listPages(dir) {
39
- const root = dir ? join(PATHS.wikiPages, dir) : PATHS.wikiPages;
40
- if (!existsSync(root))
41
- return [];
42
- const results = [];
43
- const walk = (current, prefix) => {
44
- const entries = readdirSync(current, { withFileTypes: true });
45
- for (const entry of entries) {
46
- const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
47
- if (entry.isDirectory()) {
48
- walk(join(current, entry.name), rel);
49
- }
50
- else if (entry.name.endsWith(".md")) {
51
- results.push(rel);
52
- }
53
- }
54
- };
55
- walk(root, "");
56
- return results;
57
- }
58
- export async function listTemplates() {
59
- const root = PATHS.wikiSquadTemplates;
60
- if (!existsSync(root))
61
- return [];
62
- const results = [];
63
- const walk = (current, prefix) => {
64
- const entries = readdirSync(current, { withFileTypes: true });
65
- for (const entry of entries) {
66
- const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
67
- if (entry.isDirectory()) {
68
- walk(join(current, entry.name), rel);
69
- }
70
- else {
71
- results.push(rel);
72
- }
73
- }
74
- };
75
- walk(root, "");
76
- return results;
77
- }
78
- export async function readTemplate(path) {
79
- const fullPath = safeJoin(PATHS.wikiSquadTemplates, path);
80
- if (!existsSync(fullPath)) {
81
- throw new Error(`Template not found: ${path}`);
82
- }
83
- return readFileSync(fullPath, "utf-8");
84
- }
85
- export async function writeTemplate(path, content) {
86
- const fullPath = safeJoin(PATHS.wikiSquadTemplates, path);
87
- const dir = dirname(fullPath);
88
- if (!existsSync(dir))
89
- mkdirSync(dir, { recursive: true });
90
- writeFileSync(fullPath, content);
91
- }
92
- export async function deleteTemplate(path) {
93
- const fullPath = safeJoin(PATHS.wikiSquadTemplates, path);
94
- if (!existsSync(fullPath)) {
95
- throw new Error(`Template not found: ${path}`);
96
- }
97
- rmSync(fullPath);
98
- }
99
- export async function copySquadTemplates(slug) {
100
- const templateDir = PATHS.wikiSquadTemplates;
101
- if (!existsSync(templateDir))
102
- return;
103
- const destDir = join(PATHS.wikiPages, "squads", slug);
104
- if (!existsSync(destDir))
105
- mkdirSync(destDir, { recursive: true });
106
- cpSync(templateDir, destDir, { recursive: true, force: false, errorOnExist: false });
107
- }
108
- //# sourceMappingURL=fs.js.map
@@ -1,47 +0,0 @@
1
- import { existsSync, readFileSync, readdirSync } from "node:fs";
2
- import { join } from "node:path";
3
- import { PATHS } from "../paths.js";
4
- export async function searchPages(query) {
5
- return searchInDirectory(PATHS.wikiPages, query);
6
- }
7
- /**
8
- * Search wiki pages within a specific subfolder (e.g., "squads/my-squad").
9
- * Results have paths relative to the subfolder.
10
- */
11
- export async function searchSquadPages(query, subdir) {
12
- const root = join(PATHS.wikiPages, subdir);
13
- return searchInDirectory(root, query);
14
- }
15
- function searchInDirectory(root, query) {
16
- if (!existsSync(root))
17
- return [];
18
- const results = [];
19
- const lower = query.toLowerCase();
20
- const walk = (dir, prefix) => {
21
- const entries = readdirSync(dir, { withFileTypes: true });
22
- for (const entry of entries) {
23
- const fullPath = join(dir, entry.name);
24
- const rel = prefix ? `${prefix}/${entry.name}` : entry.name;
25
- if (entry.isDirectory()) {
26
- walk(fullPath, rel);
27
- }
28
- else if (entry.name.endsWith(".md")) {
29
- const content = readFileSync(fullPath, "utf-8");
30
- const lines = content.split("\n");
31
- for (let i = 0; i < lines.length; i++) {
32
- if (lines[i].toLowerCase().includes(lower)) {
33
- results.push({
34
- path: rel,
35
- snippet: lines[i].trim().slice(0, 120),
36
- line: i + 1,
37
- });
38
- break; // one result per file
39
- }
40
- }
41
- }
42
- }
43
- };
44
- walk(root, "");
45
- return results;
46
- }
47
- //# sourceMappingURL=search.js.map
@@ -1,6 +0,0 @@
1
- import{r as W,u as X,E as Z,J as a,q as d,n as o,t as A,T as N,b as V,s as S,R as l,a4 as f,$ as T,d as h,L as w,a0 as L,p as b,K as n,m as _,z as ee}from"./index-ELvnkQjd.js";import{b as F}from"./api-D4mHJ3u0.js";/**
2
- * @license lucide-vue-next v0.474.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const te=W("FilterIcon",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]),oe={class:"p-6"},se={class:"flex items-center justify-between mb-6"},ae={class:"text-2xl font-bold flex items-center gap-2"},de={class:"text-sm text-muted-foreground"},le={class:"border border-border rounded-lg p-4 mb-6 space-y-3"},re={class:"flex items-center gap-2 text-sm font-medium text-muted-foreground mb-1"},ne={class:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-3"},ue=["value"],ie=["value"],ce=["value"],pe={key:0,class:"text-muted-foreground"},ve={key:1,class:"text-center py-12 text-muted-foreground"},me={key:2,class:"space-y-1"},ge=["onClick"],xe={class:"flex-1 min-w-0"},fe={class:"flex flex-wrap items-center gap-2 mb-1"},be={key:0,class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},_e={key:1,class:"text-xs bg-secondary text-secondary-foreground px-2 py-0.5 rounded-full"},ye={class:"text-sm truncate"},ke={class:"text-xs text-muted-foreground mt-0.5"},he={class:"text-xs text-muted-foreground mt-1 shrink-0"},we={key:0,class:"border-t border-border px-4 py-3"},qe={key:0,class:"text-xs text-muted-foreground mb-2"},Ce={class:"font-mono"},Pe={class:"text-xs bg-muted rounded p-3 overflow-x-auto whitespace-pre-wrap break-words"},Ae={key:3,class:"flex items-center justify-between mt-4"},Ne=["disabled"],Se={class:"text-xs text-muted-foreground"},Te=["disabled"],u=50,Ie=X({__name:"AuditLogView",setup(Ve){const q=n([]),c=n(0),C=n(!0),y=n(null),P=n([]),k=n([]),i=n(""),p=n(""),v=n(""),m=n(""),g=n(""),r=n(0),M=["message_received","task_delegated","task_completed","task_failed","shell_command","squad_created","squad_meeting"],I={message_received:"bg-blue-500/20 text-blue-400",task_delegated:"bg-purple-500/20 text-purple-400",task_completed:"bg-green-500/20 text-green-400",task_failed:"bg-red-500/20 text-red-400",shell_command:"bg-yellow-500/20 text-yellow-400",squad_created:"bg-indigo-500/20 text-indigo-400",squad_meeting:"bg-teal-500/20 text-teal-400"};function O(s){return I[s]??"bg-secondary text-secondary-foreground"}async function x(){C.value=!0;try{const s=new URLSearchParams;i.value&&s.set("squad_id",i.value),p.value&&s.set("agent_id",p.value),v.value&&s.set("action_type",v.value),m.value&&s.set("from",m.value),g.value&&s.set("to",g.value),s.set("limit",String(u)),s.set("offset",String(r.value));const t=await F(`/audit-log?${s.toString()}`);q.value=t.entries,c.value=t.total}finally{C.value=!1}}async function U(){const s=await F("/squads");P.value=s.squads,k.value=s.agents}function $(){r.value=0,x()}function D(){i.value="",p.value="",v.value="",m.value="",g.value="",r.value=0,x()}function E(){r.value>0&&(r.value=Math.max(0,r.value-u),x())}function R(){r.value+u<c.value&&(r.value=r.value+u,x())}function B(s){y.value=y.value===s?null:s}function J(s){try{return JSON.stringify(JSON.parse(s.payload),null,2)}catch{return s.payload}}function j(s){var t;return s?((t=P.value.find(e=>e.id===s))==null?void 0:t.name)??s.slice(0,8):""}function z(s){if(!s)return"";const t=k.value.find(e=>e.id===s);return t?`${t.character_name} (${t.role_title})`:s.slice(0,8)}const Y=_(()=>r.value+u<c.value),G=_(()=>r.value>0),K=_(()=>Math.floor(r.value/u)+1),H=_(()=>Math.max(1,Math.ceil(c.value/u))),Q=_(()=>i.value?k.value.filter(s=>s.squad_id===i.value):k.value);return Z(async()=>{await Promise.all([x(),U()])}),(s,t)=>(a(),d("div",oe,[o("div",se,[o("h1",ae,[A(N(V),{class:"w-6 h-6"}),t[6]||(t[6]=S(" Audit Log ",-1))]),o("span",de,l(c.value)+" entries",1)]),o("div",le,[o("div",re,[A(N(te),{class:"w-4 h-4"}),t[7]||(t[7]=S(" Filters ",-1))]),o("div",ne,[f(o("select",{"onUpdate:modelValue":t[0]||(t[0]=e=>i.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background",onChange:t[1]||(t[1]=e=>p.value="")},[t[8]||(t[8]=o("option",{value:""},"All squads",-1)),(a(!0),d(h,null,w(P.value,e=>(a(),d("option",{key:e.id,value:e.id},l(e.name),9,ue))),128))],544),[[T,i.value]]),f(o("select",{"onUpdate:modelValue":t[2]||(t[2]=e=>p.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},[t[9]||(t[9]=o("option",{value:""},"All agents",-1)),(a(!0),d(h,null,w(Q.value,e=>(a(),d("option",{key:e.id,value:e.id},l(e.character_name),9,ie))),128))],512),[[T,p.value]]),f(o("select",{"onUpdate:modelValue":t[3]||(t[3]=e=>v.value=e),class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},[t[10]||(t[10]=o("option",{value:""},"All action types",-1)),(a(),d(h,null,w(M,e=>o("option",{key:e,value:e},l(e),9,ce)),64))],512),[[T,v.value]]),f(o("input",{"onUpdate:modelValue":t[4]||(t[4]=e=>m.value=e),type:"datetime-local",placeholder:"From",class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},null,512),[[L,m.value]]),f(o("input",{"onUpdate:modelValue":t[5]||(t[5]=e=>g.value=e),type:"datetime-local",placeholder:"To",class:"px-2 py-1.5 text-sm rounded-md border border-border bg-background"},null,512),[[L,g.value]])]),o("div",{class:"flex gap-2"},[o("button",{onClick:$,class:"px-3 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"}," Apply "),o("button",{onClick:D,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground hover:text-foreground transition-colors"}," Reset ")])]),C.value?(a(),d("div",pe,"Loading...")):q.value.length===0?(a(),d("div",ve,[A(N(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),t[11]||(t[11]=o("p",null,"No audit log entries found.",-1))])):(a(),d("div",me,[(a(!0),d(h,null,w(q.value,e=>(a(),d("div",{key:e.id,class:"border border-border rounded-lg overflow-hidden"},[o("div",{onClick:Le=>B(e.id),class:"flex items-start gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors"},[o("div",xe,[o("div",fe,[o("span",{class:ee(["text-xs px-2 py-0.5 rounded-full font-mono",O(e.action_type)])},l(e.action_type),3),e.squad_id?(a(),d("span",be,l(j(e.squad_id)),1)):b("",!0),e.agent_id?(a(),d("span",_e,l(z(e.agent_id)),1)):b("",!0)]),o("p",ye,l(e.summary),1),o("p",ke,l(e.created_at),1)]),o("span",he,l(y.value===e.id?"▲":"▼"),1)],8,ge),y.value===e.id?(a(),d("div",we,[e.task_id?(a(),d("div",qe,[t[12]||(t[12]=S(" Task ID: ",-1)),o("code",Ce,l(e.task_id),1)])):b("",!0),o("pre",Pe,l(J(e)),1)])):b("",!0)]))),128))])),c.value>u?(a(),d("div",Ae,[o("button",{disabled:!G.value,onClick:E,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground disabled:opacity-40 hover:text-foreground transition-colors"}," ← Previous ",8,Ne),o("span",Se," Page "+l(K.value)+" of "+l(H.value),1),o("button",{disabled:!Y.value,onClick:R,class:"px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground disabled:opacity-40 hover:text-foreground transition-colors"}," Next → ",8,Te)])):b("",!0)]))}});export{Ie as default};
@@ -1 +0,0 @@
1
- import{u as R,W as U,a2 as T,E as X,J as a,q as r,n as o,T as s,t as A,p,d as C,L as S,R as d,w as x,M as W,f as Y,P as J,a4 as Q,a0 as G,o as m,S as Z,j as ee,z as k,K as v,m as I,v as te,a1 as se,_ as ae,x as D,Q as ne,I as j,F as H,l as oe,y as M}from"./index-ELvnkQjd.js";import{X as re}from"./x-CjXR97Fa.js";const le={class:"flex flex-col h-full"},ie={key:0,class:"flex items-center justify-center h-full"},ce={class:"text-center text-muted-foreground"},ue={key:0,class:"mb-2 space-y-2"},de=["src","alt"],fe={class:"flex items-center gap-2 text-xs"},pe={class:"truncate"},me={class:"opacity-70"},ve={key:2,class:"text-muted-foreground"},he={key:3,class:"inline-block w-2 h-4 bg-current animate-pulse ml-1"},ge={key:0,class:"mb-2 space-y-2"},xe={class:"flex flex-wrap gap-2"},ye={class:"max-w-[170px] truncate"},_e={class:"opacity-70"},be=["onClick"],ke={class:"text-xs text-muted-foreground"},we={key:1,class:"text-xs text-destructive mb-2"},Te={class:"flex gap-2 items-end"},Ae=["disabled"],Ce=["disabled"],ze=R({__name:"ChatView",setup(Se){const c=U(),h=v(""),f=v(""),y=v(),_=v(),i=v([]),g=v(),b=v(!1),N=I(()=>i.value.reduce((e,n)=>e+n.size,0)),z=I(()=>!c.isStreaming&&(h.value.trim().length>0||i.value.length>0));async function B(e){if(!e||e.length===0)return;f.value="";const n=[];try{for(const u of Array.from(e))n.push(await te(u))}catch(u){f.value=(u==null?void 0:u.message)??"Unable to read one or more files.";return}const t=[...i.value,...n],l=se(t);if(!l.ok){f.value=l.error;return}i.value=t,_.value&&(_.value.value="")}function P(e){i.value.splice(e,1),f.value=""}function V(){var e;(e=_.value)==null||e.click()}function F(e){const n=e.target;B((n==null?void 0:n.files)??null)}async function E(){if(!z.value)return;const e=h.value.trim(),n=[...i.value],t=e||"Please review the attached file(s).";h.value="",i.value=[],f.value="",await c.sendMessage(t,n)}function w(){y.value&&(y.value.scrollTop=y.value.scrollHeight)}function $(){g.value&&(g.value.style.height="auto",g.value.style.height=`${Math.min(g.value.scrollHeight,120)}px`)}function K(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),E())}function L(e){e.preventDefault(),b.value=!0}function q(e){e.preventDefault(),b.value=!1}async function O(e){var n;e.preventDefault(),b.value=!1,await B(((n=e.dataTransfer)==null?void 0:n.files)??null)}return T(()=>c.messages.map(e=>e.content),async()=>{await M(),w()},{deep:!0}),T(()=>c.messages.length,async()=>{await M(),w()}),T(()=>h.value,async()=>{await M(),$()}),X(()=>{$(),w()}),(e,n)=>(a(),r("div",le,[o("div",{ref_key:"messagesContainer",ref:y,class:"flex-1 overflow-y-auto p-4 space-y-4"},[s(c).messages.length===0?(a(),r("div",ie,[o("div",ce,[A(ae,{size:56,class:"mx-auto mb-4"}),n[1]||(n[1]=o("p",{class:"text-lg font-medium"},"Welcome to IO",-1)),n[2]||(n[2]=o("p",{class:"text-sm mt-1"},"Send a message to get started.",-1))])])):p("",!0),(a(!0),r(C,null,S(s(c).messages,t=>(a(),r("div",{key:t.id,class:k(["flex",t.role==="user"?"justify-end":"justify-start"])},[o("div",{class:k(["max-w-[75%] rounded-lg px-4 py-2 text-sm",t.role==="user"?"bg-primary text-primary-foreground":"bg-muted text-foreground"])},[t.attachments.length>0?(a(),r("div",ue,[(a(!0),r(C,null,S(t.attachments,(l,u)=>(a(),r("div",{key:`${t.id}-${u}`,class:"rounded border border-border/50 p-2 bg-background/70 text-foreground"},[s(D)(l)?(a(),r("img",{key:0,src:s(ne)(l),alt:l.name,class:"max-h-44 rounded mb-1 object-contain"},null,8,de)):p("",!0),o("div",fe,[s(D)(l)?(a(),m(s(j),{key:0,class:"w-3.5 h-3.5"})):(a(),m(s(H),{key:1,class:"w-3.5 h-3.5"})),o("span",pe,d(l.name),1),o("span",me,d(s(x)(l.size)),1)])]))),128))])):p("",!0),t.content?(a(),m(oe,{key:1,content:t.content,class:k(t.role==="user"?"prose-invert":"")},null,8,["content","class"])):t.streaming?p("",!0):(a(),r("span",ve,"...")),t.streaming?(a(),r("div",he)):p("",!0)],2)],2))),128))],512),o("div",{class:k(["border-t border-border p-4",b.value?"bg-accent/40":""]),onDragover:L,onDragleave:q,onDrop:O},[o("input",{ref_key:"fileInput",ref:_,type:"file",multiple:"",class:"hidden",onChange:F},null,544),i.value.length>0?(a(),r("div",ge,[o("div",xe,[(a(!0),r(C,null,S(i.value,(t,l)=>(a(),r("div",{key:`${t.name}-${l}`,class:"flex items-center gap-2 rounded border border-border px-2 py-1 text-xs bg-muted"},[s(D)(t)?(a(),m(s(j),{key:0,class:"w-3.5 h-3.5"})):(a(),m(s(H),{key:1,class:"w-3.5 h-3.5"})),o("span",ye,d(t.name),1),o("span",_e,d(s(x)(t.size)),1),o("button",{class:"hover:text-destructive",onClick:u=>P(l)},[A(s(re),{class:"w-3.5 h-3.5"})],8,be)]))),128))]),o("p",ke,d(s(x)(N.value))+" attached · Max per file "+d(s(x)(s(W)))+" · Max total "+d(s(x)(s(Y))),1)])):p("",!0),f.value?(a(),r("p",we,d(f.value),1)):p("",!0),o("div",Te,[o("button",{class:"rounded-md border border-input p-2 hover:bg-accent disabled:opacity-50",disabled:s(c).isStreaming,onClick:V,title:"Attach files"},[A(s(J),{class:"w-4 h-4"})],8,Ae),Q(o("textarea",{ref_key:"textareaRef",ref:g,"onUpdate:modelValue":n[0]||(n[0]=t=>h.value=t),onKeydown:K,placeholder:"Send a message...",rows:"1",class:"flex-1 resize-none rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring min-h-[40px] max-h-[120px]"},null,544),[[G,h.value]]),o("button",{onClick:E,disabled:!z.value,class:"rounded-md bg-primary text-primary-foreground p-2 hover:bg-primary/90 disabled:opacity-50 transition-colors"},[s(c).isStreaming?(a(),m(s(ee),{key:1,class:"w-4 h-4"})):(a(),m(s(Z),{key:0,class:"w-4 h-4"}))],8,Ce)])],34)]))}});export{ze as default};
@@ -1,6 +0,0 @@
1
- import{r as M,u as D,E as N,J as o,q as n,n as a,d as h,L as b,t as c,T as i,e as V,K as d,m as z,z as f,R as p,D as B,a6 as k,p as q,l as T}from"./index-ELvnkQjd.js";import{b as C,c as E,a as P}from"./api-D4mHJ3u0.js";import{g as R}from"./squad-colors-B8B_Y-lz.js";import{T as j}from"./trash-2-DLveUEsd.js";/**
2
- * @license lucide-vue-next v0.474.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const A=M("CheckIcon",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),G={class:"p-6"},J={class:"flex items-center justify-between mb-6"},K={class:"flex gap-2"},U=["onClick"],W={key:0,class:"text-muted-foreground"},H={key:1,class:"text-center py-12 text-muted-foreground"},O={key:2,class:"space-y-2"},Q=["onClick"],X={class:"flex-1 min-w-0"},Y={class:"flex items-center gap-2"},Z={class:"text-xs text-muted-foreground mt-0.5"},ee={class:"flex gap-1"},te=["onClick"],se=["onClick"],ae={key:0,class:"px-4 pb-3 border-t border-border pt-3"},ue=D({__name:"FeedView",setup(oe){const r=d([]),x=d([]),l=d(0),v=d("all"),m=d(!0),u=d(null);async function g(){m.value=!0;try{const e=await C(`/feed?unread=${v.value==="unread"}`);r.value=e.items,l.value=e.unreadCount}finally{m.value=!1}}async function w(){const e=await C("/squads");x.value=e.squads}async function y(e){await E(`/feed/${e}/read`);const s=r.value.find(t=>t.id===e);s&&(s.read=1,l.value=Math.max(0,l.value-1))}async function $(e){await P(`/feed/${e}`),r.value=r.value.filter(s=>s.id!==e)}function S(e){u.value=u.value===e?null:e,u.value===e&&y(e)}function I(e){if(!e.startsWith("squad-"))return;const s=e.slice(6);return x.value.find(t=>t.id===s)}const L=z(()=>r.value.map(e=>{const s=I(e.source);return{...e,squad:s}}));N(async()=>{await Promise.all([g(),w()])});function F(e){var s;return((s=e.squad)==null?void 0:s.name)??e.source}return(e,s)=>(o(),n("div",G,[a("div",J,[s[0]||(s[0]=a("h1",{class:"text-2xl font-bold"},"Feed",-1)),a("div",K,[(o(),n(h,null,b(["all","unread"],t=>a("button",{key:t,onClick:_=>{v.value=t,g()},class:f(["px-3 py-1.5 text-xs rounded-md border transition-colors",v.value===t?"bg-primary text-primary-foreground border-primary":"border-border text-muted-foreground hover:text-foreground"])},p(t==="all"?"All":`Unread (${l.value})`),11,U)),64))])]),m.value?(o(),n("div",W,"Loading...")):r.value.length===0?(o(),n("div",H,[c(i(V),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),s[1]||(s[1]=a("p",null,"No feed items.",-1))])):(o(),n("div",O,[(o(!0),n(h,null,b(L.value,t=>(o(),n("div",{key:t.id,class:f(["border border-border rounded-lg overflow-hidden",{"border-l-2 border-l-primary":!t.read}])},[a("div",{onClick:_=>S(t.id),class:"flex items-center gap-3 px-4 py-3 cursor-pointer hover:bg-muted/50 transition-colors"},[a("div",X,[a("div",Y,[a("span",{class:f(["text-xs px-2 py-0.5 rounded-full",{"bg-secondary text-secondary-foreground":!t.squad}]),style:B(t.squad?i(R)(t.squad.color):{})},p(F(t)),7),a("span",{class:f(["text-sm font-medium truncate",{"font-bold":!t.read}])},p(t.title),3)]),a("p",Z,p(t.created_at),1)]),a("div",ee,[t.read?q("",!0):(o(),n("button",{key:0,onClick:k(_=>y(t.id),["stop"]),class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Mark as read"},[c(i(A),{class:"w-3.5 h-3.5"})],8,te)),a("button",{onClick:k(_=>$(t.id),["stop"]),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive",title:"Delete"},[c(i(j),{class:"w-3.5 h-3.5"})],8,se)])],8,Q),u.value===t.id?(o(),n("div",ae,[c(T,{content:t.content},null,8,["content"])])):q("",!0)],2))),128))]))]))}});export{ue as default};
@@ -1 +0,0 @@
1
- import{u as q,a2 as F,E as z,J as r,q as n,n as t,t as d,T as c,H as M,a4 as T,a0 as L,g as E,p as x,d as $,L as A,z as p,R as g,K as l,m as P,o as R,l as G}from"./index-ELvnkQjd.js";import{b as B,a as J}from"./api-D4mHJ3u0.js";import{S as K}from"./search-CS9zSIeW.js";import{A as Q}from"./arrow-left-D_qUNUWW.js";import{T as I}from"./trash-2-DLveUEsd.js";const O={class:"flex h-full"},W={class:"p-3 border-b border-border space-y-2"},X={class:"flex items-center gap-2"},Y={class:"relative"},Z={class:"flex gap-2"},ee={class:"flex-1"},te={class:"flex-1"},se={class:"flex-1 overflow-y-auto"},oe={key:0,class:"p-4 text-xs text-muted-foreground"},re={key:1,class:"flex flex-col items-center justify-center h-full p-6 text-center text-muted-foreground"},ne=["onClick"],ae={class:"flex-1 min-w-0"},le={class:"text-xs text-foreground line-clamp-2"},ie={class:"flex items-center gap-2 mt-1"},ue={class:"text-xs text-muted-foreground"},de={class:"text-xs text-muted-foreground"},ce=["onClick"],fe={key:2,class:"p-3 text-center"},ve={key:0,class:"flex-1 flex flex-col"},me={class:"flex items-center gap-2 px-4 py-2 border-b border-border"},xe={class:"text-sm font-medium text-muted-foreground"},pe={class:"flex-1 overflow-y-auto p-4 space-y-4"},ge={key:0,class:"text-center text-xs text-muted-foreground py-8"},he={class:"text-xs mt-1 opacity-60"},ye={key:1,class:"hidden md:flex flex-1 items-center justify-center text-muted-foreground"},be={class:"text-center"},_e=50,De=q({__name:"HistoryView",setup(we){const a=l([]),h=l(0),y=l(!0),f=l(""),v=l(""),m=l(""),u=l(null),b=l([]),_=l(!1),w=l(0);async function k(o=!0){y.value=!0;try{o&&(w.value=0,a.value=[]);const e=new URLSearchParams;f.value&&e.set("q",f.value),v.value&&e.set("from",v.value),m.value&&e.set("to",m.value+"T23:59:59"),e.set("limit",String(_e)),e.set("offset",String(w.value));const i=await B(`/history?${e.toString()}`);a.value=o?i.items:[...a.value,...i.items],h.value=i.total,w.value+=i.items.length}finally{y.value=!1}}async function j(o){u.value=o,_.value=!0;try{b.value=await B(`/history/${o}`)}finally{_.value=!1}}function D(){u.value=null,b.value=[]}async function H(o,e){e.stopPropagation(),confirm("Delete this conversation?")&&(await J(`/history/${o}`),a.value=a.value.filter(i=>i.id!==o),h.value=Math.max(0,h.value-1),u.value===o&&D())}function C(o){return new Date(o).toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function N(o,e=100){return o.length>e?o.slice(0,e)+"…":o}const U=P(()=>a.value.length<h.value);let S=null;return F([f,v,m],()=>{S&&clearTimeout(S),S=setTimeout(()=>k(!0),300)}),z(()=>k(!0)),(o,e)=>{var i;return r(),n("div",O,[t("div",{class:p(["flex flex-col border-r border-border",u.value?"hidden md:flex w-80 shrink-0":"flex-1"])},[t("div",W,[t("div",X,[d(c(M),{class:"w-4 h-4 text-muted-foreground"}),e[4]||(e[4]=t("span",{class:"text-sm font-medium"},"Conversation History",-1))]),t("div",Y,[d(c(K),{class:"absolute left-2.5 top-2.5 w-3.5 h-3.5 text-muted-foreground"}),T(t("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>f.value=s),placeholder:"Search conversations...",class:"w-full rounded-md border border-input bg-background pl-8 pr-3 py-2 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,f.value]])]),t("div",Z,[t("div",ee,[e[5]||(e[5]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"From",-1)),T(t("input",{"onUpdate:modelValue":e[1]||(e[1]=s=>v.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,v.value]])]),t("div",te,[e[6]||(e[6]=t("label",{class:"text-xs text-muted-foreground block mb-1"},"To",-1)),T(t("input",{"onUpdate:modelValue":e[2]||(e[2]=s=>m.value=s),type:"date",class:"w-full rounded-md border border-input bg-background px-2 py-1.5 text-xs focus:outline-none focus:ring-1 focus:ring-ring"},null,512),[[L,m.value]])])])]),t("div",se,[y.value&&a.value.length===0?(r(),n("div",oe," Loading... ")):a.value.length===0?(r(),n("div",re,[d(c(E),{class:"w-10 h-10 mb-3 opacity-40"}),e[7]||(e[7]=t("p",{class:"text-sm"},"No conversations found.",-1)),e[8]||(e[8]=t("p",{class:"text-xs mt-1"},"Start chatting to build up your history.",-1))])):x("",!0),(r(!0),n($,null,A(a.value,s=>(r(),n("div",{key:s.id,class:p(["group flex items-start gap-2 px-3 py-3 border-b border-border cursor-pointer hover:bg-accent/50 transition-colors",u.value===s.id?"bg-accent":""]),onClick:V=>j(s.id)},[t("div",ae,[t("p",le,g(N(s.preview)),1),t("div",ie,[t("span",ue,g(C(s.updatedAt)),1),t("span",de,"· "+g(s.messageCount)+" msgs",1)])]),t("button",{class:"opacity-0 group-hover:opacity-100 p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-all",title:"Delete",onClick:V=>H(s.id,V)},[d(c(I),{class:"w-3.5 h-3.5"})],8,ce)],10,ne))),128)),U.value?(r(),n("div",fe,[t("button",{class:"text-xs text-muted-foreground hover:text-foreground underline",onClick:e[3]||(e[3]=s=>k(!1))}," Load more ")])):x("",!0)])],2),u.value?(r(),n("div",ve,[t("div",me,[t("button",{class:"p-1.5 rounded hover:bg-accent text-muted-foreground",title:"Back",onClick:D},[d(c(Q),{class:"w-4 h-4"})]),t("span",xe,g(C(((i=a.value.find(s=>s.id===u.value))==null?void 0:i.startedAt)??"")),1)]),t("div",pe,[_.value?(r(),n("div",ge," Loading... ")):x("",!0),(r(!0),n($,null,A(b.value,s=>(r(),n("div",{key:s.id,class:p(["flex",s.role==="user"?"justify-end":"justify-start"])},[t("div",{class:p(["max-w-[75%] rounded-lg px-4 py-2 text-sm",s.role==="user"?"bg-blue-600 text-white":"bg-muted text-foreground"])},[s.content?(r(),R(G,{key:0,content:s.content,class:p(s.role==="user"?"prose-invert":"")},null,8,["content","class"])):x("",!0),t("p",he,g(C(s.createdAt)),1)],2)],2))),128))])])):u.value?x("",!0):(r(),n("div",ye,[t("div",be,[d(c(M),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[9]||(e[9]=t("p",null,"Select a conversation to view",-1))])]))])}}});export{De as default};
@@ -1 +0,0 @@
1
- import{u as b,V as v,J as u,q as i,n as t,t as y,a6 as w,a4 as m,a0 as p,R as c,p as V,T as f,K as d,_,Y as h}from"./index-ELvnkQjd.js";const S={class:"min-h-screen flex items-center justify-center bg-background p-4"},k={class:"w-full max-w-sm space-y-8"},q={class:"text-center"},A={key:0,class:"text-sm text-destructive"},B=["disabled"],L=b({__name:"LoginView",setup(D){const o=v(),g=h(),r=d(""),n=d(""),s=d("");async function x(){s.value="";try{await o.login(r.value,n.value),g.push("/")}catch(l){s.value=l.message??"Login failed"}}return(l,e)=>(u(),i("div",S,[t("div",k,[t("div",q,[y(_,{size:56,class:"mx-auto mb-4"}),e[2]||(e[2]=t("h1",{class:"font-display text-4xl font-normal uppercase tracking-[0.18em] bg-gradient-brand bg-clip-text text-transparent"}," IO ",-1)),e[3]||(e[3]=t("p",{class:"text-sm text-muted-foreground mt-1"},"Sign in to your dashboard",-1))]),t("form",{onSubmit:w(x,["prevent"]),class:"space-y-4 bg-card border border-border rounded-lg p-6"},[t("div",null,[e[4]||(e[4]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"email"},"Email",-1)),m(t("input",{id:"email","onUpdate:modelValue":e[0]||(e[0]=a=>r.value=a),type:"email",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"you@example.com"},null,512),[[p,r.value]])]),t("div",null,[e[5]||(e[5]=t("label",{class:"text-sm font-medium text-muted-foreground",for:"password"},"Password",-1)),m(t("input",{id:"password","onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),type:"password",required:"",class:"mt-1 w-full rounded-md border border-border bg-input px-3 py-2 text-sm text-foreground placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring",placeholder:"••••••••"},null,512),[[p,n.value]])]),s.value?(u(),i("div",A,c(s.value),1)):V("",!0),t("button",{type:"submit",disabled:f(o).loading,class:"btn-gradient w-full py-2.5"},c(f(o).loading?"Signing in...":"Sign In"),9,B)],32),e[6]||(e[6]=t("p",{class:"text-center text-xs text-muted-foreground"},"Personal AI Assistant Daemon",-1))])]))}});export{L as default};
@@ -1 +0,0 @@
1
- import{u as E,E as S,J as l,q as a,n as s,t as c,T as b,s as C,a4 as i,a0 as m,$ as M,p as x,i as P,d as $,L as j,K as f,R as p}from"./index-ELvnkQjd.js";import{b as U,c as I,d as N,a as L}from"./api-D4mHJ3u0.js";import{_ as O}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-DtShZAjW.js";import{P as G}from"./plus-BAzlGFd_.js";import{T as K}from"./trash-2-DLveUEsd.js";const F={class:"p-6"},Y={class:"flex items-center justify-between mb-6"},B={key:0,class:"border border-border rounded-lg p-4 mb-6 space-y-3 bg-card"},h={class:"grid grid-cols-2 gap-3"},D={key:0},J={key:1},R={key:1,class:"text-muted-foreground"},q={key:2,class:"text-center py-12 text-muted-foreground"},W={key:3,class:"space-y-2"},z={class:"space-y-1"},H={class:"flex items-center gap-2"},Q={class:"font-medium text-sm"},X={class:"text-xs text-muted-foreground bg-secondary px-1.5 py-0.5 rounded"},Z={key:0,class:"text-xs text-muted-foreground"},ee={key:1,class:"text-xs text-muted-foreground"},te={key:2,class:"text-xs text-muted-foreground"},se={class:"flex items-center gap-3"},oe=["onClick"],ie=E({__name:"McpView",setup(ne){const u=f([]),g=f(!0),v=f(!1),o=f({name:"",type:"stdio",command:"",url:"",argsText:"",envText:""});S(async()=>{try{u.value=await U("/mcp")}finally{g.value=!1}});function k(n){return n.split(/\r?\n|,/).map(e=>e.trim()).filter(Boolean)}function w(n){const e={};try{const t=JSON.parse(n);if(t&&typeof t=="object"&&!Array.isArray(t)){for(const[d,r]of Object.entries(t))e[d]=String(r);return e}}catch{}for(const t of n.split(/\r?\n/)){const d=t.trim();if(!d||d.startsWith("#"))continue;const r=d.indexOf("=");if(r===-1)continue;const y=d.slice(0,r).trim(),A=d.slice(r+1).trim();y&&(e[y]=A)}return e}async function _(n){await N(`/mcp/${n.id}`,{enabled:!n.enabled}),n.enabled=!n.enabled}async function T(n){await L(`/mcp/${n}`),u.value=u.value.filter(e=>e.id!==n)}async function V(){const n={name:o.value.name,type:o.value.type,args:k(o.value.argsText),env:w(o.value.envText)};o.value.type==="stdio"?n.command=o.value.command:n.url=o.value.url;const e=await I("/mcp",n);u.value.push(e),v.value=!1,o.value={name:"",type:"stdio",command:"",url:"",argsText:"",envText:""}}return(n,e)=>(l(),a("div",F,[s("div",Y,[e[8]||(e[8]=s("div",null,[s("p",{class:"text-sm font-medium text-primary"},"MCP configuration"),s("h1",{class:"text-2xl font-bold"},"MCP Servers")],-1)),s("button",{onClick:e[0]||(e[0]=t=>v.value=!v.value),class:"btn-gradient inline-flex items-center gap-1"},[c(b(G),{class:"w-4 h-4"}),e[7]||(e[7]=C(" Add Server ",-1))])]),v.value?(l(),a("div",B,[s("div",h,[s("div",null,[e[9]||(e[9]=s("label",{class:"text-sm font-medium"},"Name",-1)),i(s("input",{"onUpdate:modelValue":e[1]||(e[1]=t=>o.value.name=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.name]])]),s("div",null,[e[11]||(e[11]=s("label",{class:"text-sm font-medium"},"Type",-1)),i(s("select",{"onUpdate:modelValue":e[2]||(e[2]=t=>o.value.type=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[10]||(e[10]=[s("option",{value:"stdio"},"stdio",-1),s("option",{value:"http"},"http",-1)])],512),[[M,o.value.type]])])]),o.value.type==="stdio"?(l(),a("div",D,[e[12]||(e[12]=s("label",{class:"text-sm font-medium"},"Command",-1)),i(s("input",{"onUpdate:modelValue":e[3]||(e[3]=t=>o.value.command=t),placeholder:"npx @my/mcp-server",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.command]])])):(l(),a("div",J,[e[13]||(e[13]=s("label",{class:"text-sm font-medium"},"URL",-1)),i(s("input",{"onUpdate:modelValue":e[4]||(e[4]=t=>o.value.url=t),placeholder:"https://...",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.url]])])),s("div",null,[e[14]||(e[14]=s("label",{class:"text-sm font-medium"},"Command args",-1)),i(s("textarea",{"onUpdate:modelValue":e[5]||(e[5]=t=>o.value.argsText=t),rows:"3",placeholder:"--stdio\n--figma-api-key=${FIGMA_API_KEY}",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[m,o.value.argsText]]),e[15]||(e[15]=s("p",{class:"mt-1 text-xs text-muted-foreground"},"Enter one arg per line or comma-separated.",-1))]),s("div",null,[e[16]||(e[16]=s("label",{class:"text-sm font-medium"},"Environment variables",-1)),i(s("textarea",{"onUpdate:modelValue":e[6]||(e[6]=t=>o.value.envText=t),rows:"4",placeholder:"FIGMA_API_KEY=${FIGMA_API_KEY}\nLOG_LEVEL=debug",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm font-mono"},null,512),[[m,o.value.envText]]),e[17]||(e[17]=s("p",{class:"mt-1 text-xs text-muted-foreground"}," Use KEY=value lines, or paste JSON. Values like ${FIGMA_API_KEY} are preserved. ",-1))]),s("div",{class:"flex justify-end"},[s("button",{onClick:V,class:"btn-gradient"},"Save")])])):x("",!0),g.value?(l(),a("div",R,"Loading...")):u.value.length===0?(l(),a("div",q,[c(b(P),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),e[18]||(e[18]=s("p",null,"No MCP servers configured.",-1))])):(l(),a("div",W,[(l(!0),a($,null,j(u.value,t=>{var d;return l(),a("div",{key:t.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3 bg-card"},[s("div",z,[s("div",H,[s("span",Q,p(t.name),1),s("span",X,p(t.type),1)]),t.command||t.url?(l(),a("div",Z,p(t.command||t.url),1)):x("",!0),(d=t.args)!=null&&d.length?(l(),a("div",ee," Args: "+p(t.args.join(", ")),1)):x("",!0),t.env&&Object.keys(t.env).length>0?(l(),a("div",te," Env: "+p(Object.keys(t.env).join(", ")),1)):x("",!0)]),s("div",se,[c(O,{"model-value":t.enabled,"aria-label":`Toggle ${t.name}`,"onUpdate:modelValue":r=>_(t)},null,8,["model-value","aria-label","onUpdate:modelValue"]),s("button",{onClick:r=>T(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[c(b(K),{class:"w-4 h-4"})],8,oe)])])}),128))]))]))}});export{ie as default};
@@ -1,6 +0,0 @@
1
- import{r as J,u as G,E as H,J as m,q as p,n as s,t as _,T as k,s as V,d as C,L as P,a4 as S,$ as A,a0 as M,p as T,c as K,R as h,K as b,m as D,z as Y,D as Q}from"./index-ELvnkQjd.js";import{b as I,c as O,d as E,a as X}from"./api-D4mHJ3u0.js";import{g as Z}from"./squad-colors-B8B_Y-lz.js";import{_ as ee}from"./ToggleSwitch.vue_vue_type_script_setup_true_lang-DtShZAjW.js";import{P as te}from"./plus-BAzlGFd_.js";import{P as ne}from"./pencil-CFsi7ufI.js";import{T as re}from"./trash-2-DLveUEsd.js";/**
2
- * @license lucide-vue-next v0.474.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const oe=J("PlayIcon",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]),se=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],ae=["January","February","March","April","May","June","July","August","September","October","November","December"];function $(l,r,o){const n=new Set;if(l==="*"){for(let u=r;u<=o;u+=1)n.add(u);return Array.from(n)}if(l.startsWith("*/")){const u=Number.parseInt(l.slice(2),10);if(Number.isNaN(u)||u<=0)return[];for(let d=r;d<=o;d+=u)n.add(d);return Array.from(n)}const i=l.split(",").map(u=>u.trim()).filter(Boolean);for(const u of i){if(u.includes("-")){const[f,c]=u.split("-"),v=Number.parseInt(f,10),g=Number.parseInt(c,10);if(Number.isNaN(v)||Number.isNaN(g))continue;for(let y=Math.min(v,g);y<=Math.max(v,g);y+=1)y>=r&&y<=o&&n.add(y);continue}const d=Number.parseInt(u,10);!Number.isNaN(d)&&d>=r&&d<=o&&n.add(d)}return Array.from(n)}function q(l,r){const o=(l+11)%12+1,n=l<12?"AM":"PM",i=r.toString().padStart(2,"0");return`${o}:${i} ${n}`}function j(l,r){if(l.length===0)return"";if(l.length===1)return r[l[0]];const o=l.map(n=>r[n]);return o.length===2?`${o[0]} and ${o[1]}`:`${o.slice(0,-1).join(", ")}, and ${o[o.length-1]}`}function de(l){const r=$(l,0,6);if(r.length===0)return"";const o=r.map(c=>c===7?0:c),n=Array.from(new Set(o)).sort((c,v)=>c-v);if(n.length===7)return"every day";const i=[1,2,3,4,5],u=[0,6],d=i.every(c=>n.includes(c))&&n.length===i.length,f=u.every(c=>n.includes(c))&&n.length===u.length;return d?"weekdays":f?"weekends":j(n,se)}function ie(l){const r=$(l,1,12);return r.length===0||r.length===12?"":j(r.map(o=>o-1),ae)}function le(l){const r=$(l,1,31);if(r.length===0||r.length===31)return"";const o=r.map(n=>{const i=[11,12,13].includes(n)?"th":[1,21,31].includes(n)?"st":[2,22].includes(n)?"nd":[3,23].includes(n)?"rd":"th";return`${n}${i}`});return o.length===1?`on the ${o[0]} of the month`:`on the ${o.join(", ")}`}function ue(l,r){const o=$(l,0,59),n=$(r,0,23);if(o.length===0||n.length===0)return"custom times";if(l==="*"&&r==="*")return"every minute";if(l==="*"&&r.startsWith("*/")){const i=Number.parseInt(r.slice(2),10);if(!Number.isNaN(i)&&i>0)return`every ${i} hours`}if(l.startsWith("*/")&&r==="*"){const i=Number.parseInt(l.slice(2),10);if(!Number.isNaN(i)&&i>0)return`every ${i} minutes`}return l==="*"&&n.length===24?"every hour":l==="*"&&n.length===1?`once each hour at ${q(n[0],0)}`:o.length===1&&n.length===1?`at ${q(n[0],o[0])}`:o.length>1&&n.length===1?`at ${o.map(i=>q(n[0],i)).join(", ")}`:n.length>1&&o.length===1?`at ${n.map(i=>q(i,o[0])).join(", ")}`:"at matching times"}function ce(l){const r=l.trim().split(/\s+/);if(r.length!==5)return"custom schedule";const[o,n,i,u,d]=r,f=ue(o,n),c=de(d),v=le(i),g=ie(u);if(f==="every minute")return"every minute";const y=d!=="*"&&i==="*"?`on ${c}`:i!=="*"&&d==="*"?v:d==="*"&&i==="*"?"each day":"on matching days",w=[f,y].filter(N=>N&&N!=="custom times"&&N!=="at matching times");return g&&w.push(`in ${g}`),w.length===0?"custom schedule":w.join(" ")}const me={class:"p-6"},pe={class:"flex items-center justify-between mb-6"},fe={class:"flex gap-1 border-b border-border mb-4"},ve=["onClick"],ge={key:0,class:"border border-border rounded-lg p-4 mb-4 space-y-3"},ye={class:"grid grid-cols-2 gap-3"},be=["value"],xe=["disabled"],he={key:1,class:"text-muted-foreground"},_e={key:2,class:"text-center py-12 text-muted-foreground"},ke={key:3,class:"space-y-2"},we={class:"text-sm font-medium font-mono"},Ne={class:"text-xs text-primary/90 mt-1 font-medium"},Se={key:0,class:"mt-1"},$e={class:"text-xs text-muted-foreground mt-0.5"},qe={key:0,class:"mt-2 space-y-2"},Ce={class:"flex gap-2"},Pe=["onClick"],Me={key:1,class:"mt-2 flex items-center justify-between gap-3"},Te=["onClick"],Ve={class:"text-xs text-muted-foreground mt-0.5"},Ae={class:"flex items-center gap-3"},De=["onClick"],Ie={key:0,class:"text-xs text-green-500 font-medium"},Oe=["onClick"],ze=G({__name:"SchedulesView",setup(l){const r=b([]),o=b([]),n=b(!0),i=b("squad"),u=b(!1),d=b({type:"squad",cron:"",squad_id:"",prompt:""}),f=b(null),c=b(""),v=b(null);H(async()=>{try{const a=await I("/squads");o.value=a.squads,o.value.length>0&&(d.value.squad_id=o.value[0].id),r.value=await I("/schedules")}finally{n.value=!1}});const g=D(()=>r.value.filter(a=>a.type===i.value));async function y(){const a={type:d.value.type,cron:d.value.cron,squad_id:d.value.squad_id};if(!d.value.squad_id||!d.value.prompt.trim())return;a.prompt=d.value.prompt;const e=await O("/schedules",a);r.value.push(e),u.value=!1}function w(a){if(a)return o.value.find(e=>e.id===a)}const N=D(()=>g.value.map(a=>({...a,squad:w(a.squad_id),description:ce(a.cron)})));async function U(a){const e=!a.enabled,t=await E(`/schedules/${a.id}`,{enabled:e});a.enabled=t.enabled}function W(a){f.value=a.id,c.value=a.prompt}async function B(a){const e=await E(`/schedules/${a.id}`,{prompt:c.value});a.prompt=e.prompt,f.value=null,c.value=""}function L(){f.value=null,c.value=""}async function R(a){await X(`/schedules/${a}`),r.value=r.value.filter(e=>e.id!==a)}async function z(a){await O(`/schedules/${a.id}/trigger`,{}),v.value=a.id;const e=r.value.findIndex(t=>t.id===a.id);e!==-1&&(r.value[e]={...r.value[e],last_run:new Date().toISOString()}),setTimeout(()=>{v.value=null},3e3)}function F(a){var e;return a?((e=o.value.find(t=>t.id===a))==null?void 0:e.name)??a:"Unknown squad"}return(a,e)=>(m(),p("div",me,[s("div",pe,[e[8]||(e[8]=s("h1",{class:"text-2xl font-bold"},"Schedules",-1)),s("button",{onClick:e[0]||(e[0]=t=>u.value=!u.value),class:"inline-flex items-center gap-1 px-3 py-1.5 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"},[_(k(te),{class:"w-4 h-4"}),e[7]||(e[7]=V(" Add Schedule ",-1))])]),s("div",fe,[(m(),p(C,null,P(["squad","io"],t=>s("button",{key:t,onClick:x=>i.value=t,class:Y(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",i.value===t?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},h(t==="squad"?"Squad Schedules":"IO Schedules"),11,ve)),64))]),u.value?(m(),p("div",ge,[s("div",ye,[s("div",null,[e[10]||(e[10]=s("label",{class:"text-sm font-medium"},"Type",-1)),S(s("select",{"onUpdate:modelValue":e[1]||(e[1]=t=>d.value.type=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[9]||(e[9]=[s("option",{value:"squad"},"Squad",-1),s("option",{value:"io"},"IO",-1)])],512),[[A,d.value.type]])]),s("div",null,[e[11]||(e[11]=s("label",{class:"text-sm font-medium"},"Cron Expression",-1)),S(s("input",{"onUpdate:modelValue":e[2]||(e[2]=t=>d.value.cron=t),placeholder:"0 9 * * 1-5",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[M,d.value.cron]])])]),s("div",null,[e[12]||(e[12]=s("label",{class:"text-sm font-medium"},"Target Squad",-1)),S(s("select",{"onUpdate:modelValue":e[3]||(e[3]=t=>d.value.squad_id=t),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[(m(!0),p(C,null,P(o.value,t=>(m(),p("option",{key:t.id,value:t.id},h(t.name),9,be))),128))],512),[[A,d.value.squad_id]])]),s("div",null,[e[13]||(e[13]=s("label",{class:"text-sm font-medium"},"Prompt",-1)),S(s("textarea",{"onUpdate:modelValue":e[4]||(e[4]=t=>d.value.prompt=t),rows:"3",placeholder:"e.g. Triage issues, review PRs, ideate on features",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[M,d.value.prompt]])]),s("button",{onClick:y,disabled:!d.value.squad_id||!d.value.prompt.trim(),class:"px-4 py-2 text-sm rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed"}," Save ",8,xe)])):T("",!0),n.value?(m(),p("div",he,"Loading...")):g.value.length===0?(m(),p("div",_e,[_(k(K),{class:"w-12 h-12 mx-auto mb-3 opacity-50"}),s("p",null,"No "+h(i.value)+" schedules configured.",1)])):(m(),p("div",ke,[(m(!0),p(C,null,P(N.value,t=>(m(),p("div",{key:t.id,class:"flex items-center justify-between border border-border rounded-lg px-4 py-3"},[s("div",null,[s("div",we,h(t.cron),1),s("div",Ne," Runs "+h(t.description),1),t.squad?(m(),p("div",Se,[s("span",{class:"text-xs px-2 py-0.5 rounded-full",style:Q(k(Z)(t.squad.color))},h(t.squad.name),5)])):T("",!0),s("div",$e,[f.value===t.id?(m(),p("div",qe,[S(s("textarea",{"onUpdate:modelValue":e[5]||(e[5]=x=>c.value=x),rows:"3",class:"w-full rounded-md border border-input bg-background px-3 py-2 text-sm",placeholder:"Schedule prompt"},null,512),[[M,c.value]]),s("div",Ce,[s("button",{onClick:x=>B(t),class:"px-3 py-1.5 text-xs rounded-md bg-primary text-primary-foreground hover:bg-primary/90"}," Save ",8,Pe),s("button",{onClick:e[6]||(e[6]=x=>L()),class:"px-3 py-1.5 text-xs rounded-md border border-border hover:bg-muted/50"}," Cancel ")])])):(m(),p("div",Me,[s("span",null,h(t.prompt?t.prompt:"(no prompt)"),1),s("button",{onClick:x=>W(t),class:"inline-flex items-center gap-1 px-2 py-1 text-xs rounded-md border border-border hover:bg-muted/50"},[_(k(ne),{class:"w-3 h-3"}),e[14]||(e[14]=V(" Edit prompt ",-1))],8,Te)]))]),s("div",Ve," Squad: "+h(F(t.squad_id)),1)]),s("div",Ae,[s("button",{onClick:x=>z(t),class:"p-1.5 rounded hover:bg-primary/10 text-muted-foreground hover:text-primary",title:"Trigger now"},[_(k(oe),{class:"w-4 h-4"})],8,De),v.value===t.id?(m(),p("span",Ie,"Triggered!")):T("",!0),_(ee,{"model-value":!!t.enabled,"aria-label":`Toggle schedule ${t.cron}`,"onUpdate:modelValue":x=>U(t)},null,8,["model-value","aria-label","onUpdate:modelValue"]),s("button",{onClick:x=>R(t.id),class:"p-1.5 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive"},[_(k(re),{class:"w-4 h-4"})],8,Oe)])]))),128))]))]))}});export{ze as default};
@@ -1 +0,0 @@
1
- import{u as w,E,J as d,q as s,n as t,R as g,d as x,L as U,a4 as o,a0 as n,$ as M,Z as p,p as b,K as r,z as T}from"./index-ELvnkQjd.js";import{b as V,d as S}from"./api-D4mHJ3u0.js";const z={class:"p-6"},A={class:"flex items-center justify-between mb-6"},B=["disabled"],N={key:0,class:"text-muted-foreground"},C={class:"flex gap-1 border-b border-border mb-6"},I=["onClick"],K={key:0,class:"space-y-4 max-w-lg"},D={class:"flex items-center gap-3"},L={key:1,class:"space-y-4 max-w-lg"},R={class:"flex items-center gap-3"},j={key:2,class:"space-y-4 max-w-lg"},q={key:3,class:"space-y-4 max-w-lg"},G={class:"flex items-center gap-3"},O={class:"flex items-center gap-3"},W=w({__name:"SettingsView",setup(P){const f=r(!0),i=r(!1),m=r(!1),u=r("general"),y=[{id:"general",label:"General"},{id:"telegram",label:"Telegram"},{id:"auth",label:"Auth"},{id:"advanced",label:"Advanced"}],a=r({defaultModel:"",port:3170,telegramEnabled:!1,telegramBotToken:"",authorizedUserId:null,supabaseUrl:"",supabaseAnonKey:"",authorizedEmail:"",backgroundNotifyMode:"meaningful",backgroundNotifyTelegram:!0,selfEditEnabled:!1,watchdogEnabled:!0});async function k(){f.value=!0;try{const v=await V("/settings");a.value=v}finally{f.value=!1}}async function c(){i.value=!0,m.value=!1;try{await S("/settings",a.value),m.value=!0,setTimeout(()=>m.value=!1,2e3)}finally{i.value=!1}}return E(k),(v,e)=>(d(),s("div",z,[t("div",A,[e[12]||(e[12]=t("h1",{class:"text-2xl font-bold"},"Settings",-1)),t("button",{onClick:c,disabled:i.value,class:"px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm hover:bg-primary/90 disabled:opacity-50"},g(i.value?"Saving...":m.value?"Saved ✓":"Save"),9,B)]),f.value?(d(),s("div",N,"Loading...")):(d(),s(x,{key:1},[t("div",C,[(d(),s(x,null,U(y,l=>t("button",{key:l.id,onClick:$=>u.value=l.id,class:T(["px-4 py-2 text-sm font-medium border-b-2 transition-colors",u.value===l.id?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground"])},g(l.label),11,I)),64))]),u.value==="general"?(d(),s("div",K,[t("div",null,[e[13]||(e[13]=t("label",{class:"text-sm font-medium"},"Default Model",-1)),o(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>a.value.defaultModel=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.defaultModel]])]),t("div",null,[e[14]||(e[14]=t("label",{class:"text-sm font-medium"},"Port",-1)),o(t("input",{"onUpdate:modelValue":e[1]||(e[1]=l=>a.value.port=l),type:"number",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.port,void 0,{number:!0}]]),e[15]||(e[15]=t("p",{class:"text-xs text-muted-foreground mt-1"},"Requires restart to take effect",-1))]),t("div",null,[e[17]||(e[17]=t("label",{class:"text-sm font-medium"},"Background Notify Mode",-1)),o(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>a.value.backgroundNotifyMode=l),class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},[...e[16]||(e[16]=[t("option",{value:"all"},"All",-1),t("option",{value:"meaningful"},"Meaningful",-1),t("option",{value:"off"},"Off",-1)])],512),[[M,a.value.backgroundNotifyMode]])]),t("div",D,[o(t("input",{"onUpdate:modelValue":e[3]||(e[3]=l=>a.value.backgroundNotifyTelegram=l),type:"checkbox",id:"notifyTelegram",class:"rounded"},null,512),[[p,a.value.backgroundNotifyTelegram]]),e[18]||(e[18]=t("label",{for:"notifyTelegram",class:"text-sm font-medium"},"Send notifications via Telegram",-1))])])):b("",!0),u.value==="telegram"?(d(),s("div",L,[t("div",null,[e[19]||(e[19]=t("label",{class:"text-sm font-medium"},"Bot Token",-1)),o(t("input",{"onUpdate:modelValue":e[4]||(e[4]=l=>a.value.telegramBotToken=l),type:"password",placeholder:"Enter new token to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.telegramBotToken]])]),t("div",null,[e[20]||(e[20]=t("label",{class:"text-sm font-medium"},"Authorized User ID",-1)),o(t("input",{"onUpdate:modelValue":e[5]||(e[5]=l=>a.value.authorizedUserId=l),type:"number",placeholder:"123456789",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.authorizedUserId,void 0,{number:!0}]])]),t("div",R,[o(t("input",{"onUpdate:modelValue":e[6]||(e[6]=l=>a.value.telegramEnabled=l),type:"checkbox",id:"telegramEnabled",class:"rounded"},null,512),[[p,a.value.telegramEnabled]]),e[21]||(e[21]=t("label",{for:"telegramEnabled",class:"text-sm font-medium"},"Enable Telegram Bot",-1))])])):b("",!0),u.value==="auth"?(d(),s("div",j,[t("div",null,[e[22]||(e[22]=t("label",{class:"text-sm font-medium"},"Supabase URL",-1)),o(t("input",{"onUpdate:modelValue":e[7]||(e[7]=l=>a.value.supabaseUrl=l),placeholder:"https://your-project.supabase.co",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.supabaseUrl]])]),t("div",null,[e[23]||(e[23]=t("label",{class:"text-sm font-medium"},"Supabase Anon Key",-1)),o(t("input",{"onUpdate:modelValue":e[8]||(e[8]=l=>a.value.supabaseAnonKey=l),type:"password",placeholder:"Enter new key to update",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.supabaseAnonKey]])]),t("div",null,[e[24]||(e[24]=t("label",{class:"text-sm font-medium"},"Authorized Email",-1)),o(t("input",{"onUpdate:modelValue":e[9]||(e[9]=l=>a.value.authorizedEmail=l),type:"email",placeholder:"you@example.com",class:"mt-1 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"},null,512),[[n,a.value.authorizedEmail]])])])):b("",!0),u.value==="advanced"?(d(),s("div",q,[t("div",G,[o(t("input",{"onUpdate:modelValue":e[10]||(e[10]=l=>a.value.selfEditEnabled=l),type:"checkbox",id:"selfEdit",class:"rounded"},null,512),[[p,a.value.selfEditEnabled]]),e[25]||(e[25]=t("div",null,[t("label",{for:"selfEdit",class:"text-sm font-medium"},"Self-Edit Mode"),t("p",{class:"text-xs text-muted-foreground"},"Allow IO to modify its own source code")],-1))]),t("div",O,[o(t("input",{"onUpdate:modelValue":e[11]||(e[11]=l=>a.value.watchdogEnabled=l),type:"checkbox",id:"watchdog",class:"rounded"},null,512),[[p,a.value.watchdogEnabled]]),e[26]||(e[26]=t("div",null,[t("label",{for:"watchdog",class:"text-sm font-medium"},"Watchdog"),t("p",{class:"text-xs text-muted-foreground"},"Monitor event loop and zombie instances")],-1))])])):b("",!0)],64))]))}});export{W as default};