agor-live 0.3.7

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 (297) hide show
  1. package/LICENSE +94 -0
  2. package/README.md +163 -0
  3. package/bin/agor-daemon.js +20 -0
  4. package/bin/agor.js +14 -0
  5. package/dist/cli/base-command.d.ts +29 -0
  6. package/dist/cli/base-command.js +41 -0
  7. package/dist/cli/commands/board/add-session.d.ts +15 -0
  8. package/dist/cli/commands/board/add-session.js +102 -0
  9. package/dist/cli/commands/board/list.d.ts +14 -0
  10. package/dist/cli/commands/board/list.js +74 -0
  11. package/dist/cli/commands/config/clear.d.ts +13 -0
  12. package/dist/cli/commands/config/clear.js +21 -0
  13. package/dist/cli/commands/config/get.d.ts +13 -0
  14. package/dist/cli/commands/config/get.js +41 -0
  15. package/dist/cli/commands/config/index.d.ts +13 -0
  16. package/dist/cli/commands/config/index.js +118 -0
  17. package/dist/cli/commands/config/set.d.ts +14 -0
  18. package/dist/cli/commands/config/set.js +50 -0
  19. package/dist/cli/commands/config/unset.d.ts +13 -0
  20. package/dist/cli/commands/config/unset.js +35 -0
  21. package/dist/cli/commands/daemon/index.d.ts +13 -0
  22. package/dist/cli/commands/daemon/index.js +65 -0
  23. package/dist/cli/commands/daemon/logs.d.ts +13 -0
  24. package/dist/cli/commands/daemon/logs.js +78 -0
  25. package/dist/cli/commands/daemon/restart.d.ts +13 -0
  26. package/dist/cli/commands/daemon/restart.js +177 -0
  27. package/dist/cli/commands/daemon/start.d.ts +13 -0
  28. package/dist/cli/commands/daemon/start.js +193 -0
  29. package/dist/cli/commands/daemon/status.d.ts +13 -0
  30. package/dist/cli/commands/daemon/status.js +93 -0
  31. package/dist/cli/commands/daemon/stop.d.ts +13 -0
  32. package/dist/cli/commands/daemon/stop.js +108 -0
  33. package/dist/cli/commands/init.d.ts +44 -0
  34. package/dist/cli/commands/init.js +459 -0
  35. package/dist/cli/commands/mcp/add.d.ts +26 -0
  36. package/dist/cli/commands/mcp/add.js +162 -0
  37. package/dist/cli/commands/mcp/list.d.ts +16 -0
  38. package/dist/cli/commands/mcp/list.js +89 -0
  39. package/dist/cli/commands/mcp/remove.d.ts +17 -0
  40. package/dist/cli/commands/mcp/remove.js +86 -0
  41. package/dist/cli/commands/mcp/show.d.ts +14 -0
  42. package/dist/cli/commands/mcp/show.js +131 -0
  43. package/dist/cli/commands/repo/add.d.ts +16 -0
  44. package/dist/cli/commands/repo/add.js +105 -0
  45. package/dist/cli/commands/repo/list.d.ts +17 -0
  46. package/dist/cli/commands/repo/list.js +99 -0
  47. package/dist/cli/commands/repo/rm.d.ts +17 -0
  48. package/dist/cli/commands/repo/rm.js +126 -0
  49. package/dist/cli/commands/repo/worktree/add.d.ts +21 -0
  50. package/dist/cli/commands/repo/worktree/add.js +145 -0
  51. package/dist/cli/commands/repo/worktree/list.d.ts +21 -0
  52. package/dist/cli/commands/repo/worktree/list.js +136 -0
  53. package/dist/cli/commands/session/list.d.ts +30 -0
  54. package/dist/cli/commands/session/list.js +204 -0
  55. package/dist/cli/commands/session/load-claude.d.ts +16 -0
  56. package/dist/cli/commands/session/load-claude.js +211 -0
  57. package/dist/cli/commands/user/create-admin.d.ts +13 -0
  58. package/dist/cli/commands/user/create-admin.js +65 -0
  59. package/dist/cli/commands/user/create.d.ts +16 -0
  60. package/dist/cli/commands/user/create.js +126 -0
  61. package/dist/cli/commands/user/delete.d.ts +16 -0
  62. package/dist/cli/commands/user/delete.js +77 -0
  63. package/dist/cli/commands/user/list.d.ts +13 -0
  64. package/dist/cli/commands/user/list.js +78 -0
  65. package/dist/cli/commands/user/update.d.ts +19 -0
  66. package/dist/cli/commands/user/update.js +149 -0
  67. package/dist/cli/hooks/command-not-found.d.ts +9 -0
  68. package/dist/cli/hooks/command-not-found.js +14 -0
  69. package/dist/cli/lib/banner.d.ts +25 -0
  70. package/dist/cli/lib/banner.js +25 -0
  71. package/dist/cli/lib/context.d.ts +27 -0
  72. package/dist/cli/lib/context.js +32 -0
  73. package/dist/cli/lib/daemon-manager.d.ts +48 -0
  74. package/dist/cli/lib/daemon-manager.js +109 -0
  75. package/dist/cli/lib/help.d.ts +13 -0
  76. package/dist/cli/lib/help.js +46 -0
  77. package/dist/core/agentic-tool-B_gFNpk5.d.ts +33 -0
  78. package/dist/core/agentic-tool-DsyX8diw.d.cts +33 -0
  79. package/dist/core/api/index.cjs +98 -0
  80. package/dist/core/api/index.d.cts +174 -0
  81. package/dist/core/api/index.d.ts +174 -0
  82. package/dist/core/api/index.js +62 -0
  83. package/dist/core/board-comment-BUm0fpmD.d.cts +134 -0
  84. package/dist/core/board-comment-gC_-twPx.d.ts +134 -0
  85. package/dist/core/claude/index.cjs +673 -0
  86. package/dist/core/claude/index.d.cts +124 -0
  87. package/dist/core/claude/index.d.ts +124 -0
  88. package/dist/core/claude/index.js +629 -0
  89. package/dist/core/config/browser.cjs +165 -0
  90. package/dist/core/config/browser.d.cts +289 -0
  91. package/dist/core/config/browser.d.ts +289 -0
  92. package/dist/core/config/browser.js +131 -0
  93. package/dist/core/config/index.cjs +518 -0
  94. package/dist/core/config/index.d.cts +246 -0
  95. package/dist/core/config/index.d.ts +246 -0
  96. package/dist/core/config/index.js +451 -0
  97. package/dist/core/db/index.cjs +3726 -0
  98. package/dist/core/db/index.d.cts +631 -0
  99. package/dist/core/db/index.d.ts +631 -0
  100. package/dist/core/db/index.js +3649 -0
  101. package/dist/core/dist/agentic-tool-B_gFNpk5.d.ts +33 -0
  102. package/dist/core/dist/agentic-tool-DsyX8diw.d.cts +33 -0
  103. package/dist/core/dist/api/index.cjs +98 -0
  104. package/dist/core/dist/api/index.d.cts +174 -0
  105. package/dist/core/dist/api/index.d.ts +174 -0
  106. package/dist/core/dist/api/index.js +62 -0
  107. package/dist/core/dist/board-comment-BUm0fpmD.d.cts +134 -0
  108. package/dist/core/dist/board-comment-gC_-twPx.d.ts +134 -0
  109. package/dist/core/dist/claude/index.cjs +673 -0
  110. package/dist/core/dist/claude/index.d.cts +124 -0
  111. package/dist/core/dist/claude/index.d.ts +124 -0
  112. package/dist/core/dist/claude/index.js +629 -0
  113. package/dist/core/dist/config/browser.cjs +165 -0
  114. package/dist/core/dist/config/browser.d.cts +289 -0
  115. package/dist/core/dist/config/browser.d.ts +289 -0
  116. package/dist/core/dist/config/browser.js +131 -0
  117. package/dist/core/dist/config/index.cjs +518 -0
  118. package/dist/core/dist/config/index.d.cts +246 -0
  119. package/dist/core/dist/config/index.d.ts +246 -0
  120. package/dist/core/dist/config/index.js +451 -0
  121. package/dist/core/dist/db/index.cjs +3726 -0
  122. package/dist/core/dist/db/index.d.cts +631 -0
  123. package/dist/core/dist/db/index.d.ts +631 -0
  124. package/dist/core/dist/db/index.js +3649 -0
  125. package/dist/core/dist/environment/variable-resolver.cjs +92 -0
  126. package/dist/core/dist/environment/variable-resolver.d.cts +52 -0
  127. package/dist/core/dist/environment/variable-resolver.d.ts +52 -0
  128. package/dist/core/dist/environment/variable-resolver.js +53 -0
  129. package/dist/core/dist/feathers/index.cjs +66 -0
  130. package/dist/core/dist/feathers/index.d.cts +7 -0
  131. package/dist/core/dist/feathers/index.d.ts +7 -0
  132. package/dist/core/dist/feathers/index.js +25 -0
  133. package/dist/core/dist/feathers-BzHEPnpl.d.cts +228 -0
  134. package/dist/core/dist/feathers-BzHEPnpl.d.ts +228 -0
  135. package/dist/core/dist/git/index.cjs +302 -0
  136. package/dist/core/dist/git/index.d.cts +137 -0
  137. package/dist/core/dist/git/index.d.ts +137 -0
  138. package/dist/core/dist/git/index.js +260 -0
  139. package/dist/core/dist/id-DMqyogFB.d.cts +131 -0
  140. package/dist/core/dist/id-DMqyogFB.d.ts +131 -0
  141. package/dist/core/dist/index.cjs +4653 -0
  142. package/dist/core/dist/index.d.cts +23 -0
  143. package/dist/core/dist/index.d.ts +23 -0
  144. package/dist/core/dist/index.js +4509 -0
  145. package/dist/core/dist/message-BoxZISHg.d.cts +120 -0
  146. package/dist/core/dist/message-DvBzHu7V.d.ts +120 -0
  147. package/dist/core/dist/permissions/index.cjs +112 -0
  148. package/dist/core/dist/permissions/index.d.cts +81 -0
  149. package/dist/core/dist/permissions/index.d.ts +81 -0
  150. package/dist/core/dist/permissions/index.js +85 -0
  151. package/dist/core/dist/repo-3CUrCRbq.d.cts +405 -0
  152. package/dist/core/dist/repo-CnvJ0B6-.d.ts +405 -0
  153. package/dist/core/dist/session-BPjJlVdZ.d.cts +429 -0
  154. package/dist/core/dist/session-wAzjHatv.d.ts +429 -0
  155. package/dist/core/dist/task-BIEgT1DK.d.cts +163 -0
  156. package/dist/core/dist/task-DuIfiUbW.d.ts +163 -0
  157. package/dist/core/dist/templates/handlebars-helpers.cjs +156 -0
  158. package/dist/core/dist/templates/handlebars-helpers.d.cts +45 -0
  159. package/dist/core/dist/templates/handlebars-helpers.d.ts +45 -0
  160. package/dist/core/dist/templates/handlebars-helpers.js +119 -0
  161. package/dist/core/dist/tools/claude/models.cjs +70 -0
  162. package/dist/core/dist/tools/claude/models.d.cts +27 -0
  163. package/dist/core/dist/tools/claude/models.d.ts +27 -0
  164. package/dist/core/dist/tools/claude/models.js +44 -0
  165. package/dist/core/dist/tools/index.cjs +3367 -0
  166. package/dist/core/dist/tools/index.d.cts +967 -0
  167. package/dist/core/dist/tools/index.d.ts +967 -0
  168. package/dist/core/dist/tools/index.js +3314 -0
  169. package/dist/core/dist/tools/models.cjs +119 -0
  170. package/dist/core/dist/tools/models.d.cts +47 -0
  171. package/dist/core/dist/tools/models.d.ts +47 -0
  172. package/dist/core/dist/tools/models.js +86 -0
  173. package/dist/core/dist/types/index.cjs +152 -0
  174. package/dist/core/dist/types/index.d.cts +214 -0
  175. package/dist/core/dist/types/index.d.ts +214 -0
  176. package/dist/core/dist/types/index.js +112 -0
  177. package/dist/core/dist/user-BmL3kFol.d.ts +50 -0
  178. package/dist/core/dist/user-eUuKj7yM.d.cts +50 -0
  179. package/dist/core/dist/utils/pricing.cjs +102 -0
  180. package/dist/core/dist/utils/pricing.d.cts +43 -0
  181. package/dist/core/dist/utils/pricing.d.ts +43 -0
  182. package/dist/core/dist/utils/pricing.js +75 -0
  183. package/dist/core/dist/worktrees-BzIxB1U6.d.cts +2745 -0
  184. package/dist/core/dist/worktrees-CYem1ya2.d.ts +2745 -0
  185. package/dist/core/environment/variable-resolver.cjs +92 -0
  186. package/dist/core/environment/variable-resolver.d.cts +52 -0
  187. package/dist/core/environment/variable-resolver.d.ts +52 -0
  188. package/dist/core/environment/variable-resolver.js +53 -0
  189. package/dist/core/feathers/index.cjs +66 -0
  190. package/dist/core/feathers/index.d.cts +7 -0
  191. package/dist/core/feathers/index.d.ts +7 -0
  192. package/dist/core/feathers/index.js +25 -0
  193. package/dist/core/feathers-BzHEPnpl.d.cts +228 -0
  194. package/dist/core/feathers-BzHEPnpl.d.ts +228 -0
  195. package/dist/core/git/index.cjs +302 -0
  196. package/dist/core/git/index.d.cts +137 -0
  197. package/dist/core/git/index.d.ts +137 -0
  198. package/dist/core/git/index.js +260 -0
  199. package/dist/core/id-DMqyogFB.d.cts +131 -0
  200. package/dist/core/id-DMqyogFB.d.ts +131 -0
  201. package/dist/core/index.cjs +4653 -0
  202. package/dist/core/index.d.cts +23 -0
  203. package/dist/core/index.d.ts +23 -0
  204. package/dist/core/index.js +4509 -0
  205. package/dist/core/message-BoxZISHg.d.cts +120 -0
  206. package/dist/core/message-DvBzHu7V.d.ts +120 -0
  207. package/dist/core/package.json +133 -0
  208. package/dist/core/permissions/index.cjs +112 -0
  209. package/dist/core/permissions/index.d.cts +81 -0
  210. package/dist/core/permissions/index.d.ts +81 -0
  211. package/dist/core/permissions/index.js +85 -0
  212. package/dist/core/repo-3CUrCRbq.d.cts +405 -0
  213. package/dist/core/repo-CnvJ0B6-.d.ts +405 -0
  214. package/dist/core/session-BPjJlVdZ.d.cts +429 -0
  215. package/dist/core/session-wAzjHatv.d.ts +429 -0
  216. package/dist/core/task-BIEgT1DK.d.cts +163 -0
  217. package/dist/core/task-DuIfiUbW.d.ts +163 -0
  218. package/dist/core/templates/handlebars-helpers.cjs +156 -0
  219. package/dist/core/templates/handlebars-helpers.d.cts +45 -0
  220. package/dist/core/templates/handlebars-helpers.d.ts +45 -0
  221. package/dist/core/templates/handlebars-helpers.js +119 -0
  222. package/dist/core/tools/claude/models.cjs +70 -0
  223. package/dist/core/tools/claude/models.d.cts +27 -0
  224. package/dist/core/tools/claude/models.d.ts +27 -0
  225. package/dist/core/tools/claude/models.js +44 -0
  226. package/dist/core/tools/index.cjs +3367 -0
  227. package/dist/core/tools/index.d.cts +967 -0
  228. package/dist/core/tools/index.d.ts +967 -0
  229. package/dist/core/tools/index.js +3314 -0
  230. package/dist/core/tools/models.cjs +119 -0
  231. package/dist/core/tools/models.d.cts +47 -0
  232. package/dist/core/tools/models.d.ts +47 -0
  233. package/dist/core/tools/models.js +86 -0
  234. package/dist/core/types/index.cjs +152 -0
  235. package/dist/core/types/index.d.cts +214 -0
  236. package/dist/core/types/index.d.ts +214 -0
  237. package/dist/core/types/index.js +112 -0
  238. package/dist/core/user-BmL3kFol.d.ts +50 -0
  239. package/dist/core/user-eUuKj7yM.d.cts +50 -0
  240. package/dist/core/utils/pricing.cjs +102 -0
  241. package/dist/core/utils/pricing.d.cts +43 -0
  242. package/dist/core/utils/pricing.d.ts +43 -0
  243. package/dist/core/utils/pricing.js +75 -0
  244. package/dist/core/worktrees-BzIxB1U6.d.cts +2745 -0
  245. package/dist/core/worktrees-CYem1ya2.d.ts +2745 -0
  246. package/dist/daemon/adapters/drizzle.d.ts +114 -0
  247. package/dist/daemon/adapters/drizzle.js +219 -0
  248. package/dist/daemon/declarations.d.ts +101 -0
  249. package/dist/daemon/declarations.js +0 -0
  250. package/dist/daemon/index.d.ts +2 -0
  251. package/dist/daemon/index.js +4093 -0
  252. package/dist/daemon/mcp/routes.d.ts +15 -0
  253. package/dist/daemon/mcp/routes.js +641 -0
  254. package/dist/daemon/mcp/tokens.d.ts +50 -0
  255. package/dist/daemon/mcp/tokens.js +85 -0
  256. package/dist/daemon/services/board-comments.d.ts +97 -0
  257. package/dist/daemon/services/board-comments.js +326 -0
  258. package/dist/daemon/services/board-objects.d.ts +71 -0
  259. package/dist/daemon/services/board-objects.js +117 -0
  260. package/dist/daemon/services/boards.d.ts +64 -0
  261. package/dist/daemon/services/boards.js +286 -0
  262. package/dist/daemon/services/config.d.ts +35 -0
  263. package/dist/daemon/services/config.js +68 -0
  264. package/dist/daemon/services/context.d.ts +55 -0
  265. package/dist/daemon/services/context.js +113 -0
  266. package/dist/daemon/services/health-monitor.d.ts +58 -0
  267. package/dist/daemon/services/health-monitor.js +158 -0
  268. package/dist/daemon/services/mcp-servers.d.ts +42 -0
  269. package/dist/daemon/services/mcp-servers.js +275 -0
  270. package/dist/daemon/services/messages.d.ts +49 -0
  271. package/dist/daemon/services/messages.js +269 -0
  272. package/dist/daemon/services/repos.d.ts +61 -0
  273. package/dist/daemon/services/repos.js +350 -0
  274. package/dist/daemon/services/session-mcp-servers.d.ts +56 -0
  275. package/dist/daemon/services/session-mcp-servers.js +51 -0
  276. package/dist/daemon/services/sessions.d.ts +64 -0
  277. package/dist/daemon/services/sessions.js +398 -0
  278. package/dist/daemon/services/tasks.d.ts +55 -0
  279. package/dist/daemon/services/tasks.js +318 -0
  280. package/dist/daemon/services/terminals.d.ts +75 -0
  281. package/dist/daemon/services/terminals.js +110 -0
  282. package/dist/daemon/services/users.d.ts +98 -0
  283. package/dist/daemon/services/users.js +177 -0
  284. package/dist/daemon/services/worktrees.d.ts +98 -0
  285. package/dist/daemon/services/worktrees.js +719 -0
  286. package/dist/daemon/strategies/anonymous.d.ts +20 -0
  287. package/dist/daemon/strategies/anonymous.js +32 -0
  288. package/dist/ui/assets/cc-CYmbalCD.png +0 -0
  289. package/dist/ui/assets/codex-4sLD1mVS.png +0 -0
  290. package/dist/ui/assets/cursor-BUy5pFVL.png +0 -0
  291. package/dist/ui/assets/gemini-ajOb7iAl.png +0 -0
  292. package/dist/ui/assets/index-Dc4ELxry.css +32 -0
  293. package/dist/ui/assets/index-KfIu8v4V.js +578 -0
  294. package/dist/ui/favicon.png +0 -0
  295. package/dist/ui/index.html +26 -0
  296. package/dist/ui/vite.svg +1 -0
  297. package/package.json +90 -0
@@ -0,0 +1,89 @@
1
+ // src/commands/mcp/list.ts
2
+ import { createClient } from "@agor/core/api";
3
+ import { Command, Flags } from "@oclif/core";
4
+ import chalk from "chalk";
5
+ import Table from "cli-table3";
6
+ var McpList = class _McpList extends Command {
7
+ static description = "List all MCP servers";
8
+ static examples = [
9
+ "<%= config.bin %> <%= command.id %>",
10
+ "<%= config.bin %> <%= command.id %> --scope global",
11
+ "<%= config.bin %> <%= command.id %> --enabled"
12
+ ];
13
+ static flags = {
14
+ scope: Flags.string({
15
+ char: "s",
16
+ description: "Filter by scope (global, team, repo, session)",
17
+ options: ["global", "team", "repo", "session"]
18
+ }),
19
+ transport: Flags.string({
20
+ char: "t",
21
+ description: "Filter by transport (stdio, http, sse)",
22
+ options: ["stdio", "http", "sse"]
23
+ }),
24
+ enabled: Flags.boolean({
25
+ char: "e",
26
+ description: "Show only enabled servers"
27
+ })
28
+ };
29
+ async run() {
30
+ const { flags } = await this.parse(_McpList);
31
+ const client = createClient();
32
+ try {
33
+ const query = {};
34
+ if (flags.scope) query.scope = flags.scope;
35
+ if (flags.transport) query.transport = flags.transport;
36
+ if (flags.enabled) query.enabled = true;
37
+ const result = await client.service("mcp-servers").find({ query });
38
+ const servers = Array.isArray(result) ? result : result.data;
39
+ if (servers.length === 0) {
40
+ this.log(chalk.yellow("No MCP servers found."));
41
+ await this.cleanup(client);
42
+ return;
43
+ }
44
+ const table = new Table({
45
+ head: [
46
+ chalk.cyan("ID"),
47
+ chalk.cyan("Name"),
48
+ chalk.cyan("Transport"),
49
+ chalk.cyan("Scope"),
50
+ chalk.cyan("Enabled"),
51
+ chalk.cyan("Source")
52
+ ],
53
+ colWidths: [12, 20, 12, 12, 10, 12],
54
+ wordWrap: true
55
+ });
56
+ for (const server of servers) {
57
+ table.push([
58
+ String(server.mcp_server_id).substring(0, 8),
59
+ server.display_name || server.name,
60
+ server.transport,
61
+ server.scope,
62
+ server.enabled ? chalk.green("\u2713") : chalk.gray("\u2717"),
63
+ server.source
64
+ ]);
65
+ }
66
+ this.log(table.toString());
67
+ this.log(chalk.gray(`
68
+ Total: ${servers.length} server(s)`));
69
+ } catch (error) {
70
+ this.log(chalk.red("\u2717 Failed to fetch MCP servers"));
71
+ if (error instanceof Error) {
72
+ this.log(chalk.red(error.message));
73
+ }
74
+ await this.cleanup(client);
75
+ process.exit(1);
76
+ }
77
+ await this.cleanup(client);
78
+ }
79
+ async cleanup(client) {
80
+ await new Promise((resolve) => {
81
+ client.io.once("disconnect", () => resolve());
82
+ client.io.close();
83
+ setTimeout(() => resolve(), 1e3);
84
+ });
85
+ }
86
+ };
87
+ export {
88
+ McpList as default
89
+ };
@@ -0,0 +1,17 @@
1
+ import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
+ import { Command } from '@oclif/core';
3
+
4
+ declare class McpRemove extends Command {
5
+ static description: string;
6
+ static examples: string[];
7
+ static args: {
8
+ id: _oclif_core_interfaces.Arg<string, Record<string, unknown>>;
9
+ };
10
+ static flags: {
11
+ force: _oclif_core_interfaces.BooleanFlag<boolean>;
12
+ };
13
+ run(): Promise<void>;
14
+ private cleanup;
15
+ }
16
+
17
+ export { McpRemove as default };
@@ -0,0 +1,86 @@
1
+ // src/commands/mcp/remove.ts
2
+ import { createClient, isDaemonRunning } from "@agor/core/api";
3
+ import { getDaemonUrl } from "@agor/core/config";
4
+ import { Args, Command, Flags } from "@oclif/core";
5
+ import chalk from "chalk";
6
+ var McpRemove = class _McpRemove extends Command {
7
+ static description = "Remove an MCP server";
8
+ static examples = [
9
+ "<%= config.bin %> <%= command.id %> 0199b856",
10
+ "<%= config.bin %> <%= command.id %> filesystem --force"
11
+ ];
12
+ static args = {
13
+ id: Args.string({
14
+ description: "MCP server ID or name",
15
+ required: true
16
+ })
17
+ };
18
+ static flags = {
19
+ force: Flags.boolean({
20
+ char: "f",
21
+ description: "Skip confirmation prompt",
22
+ default: false
23
+ })
24
+ };
25
+ async run() {
26
+ const { args, flags } = await this.parse(_McpRemove);
27
+ const daemonUrl = await getDaemonUrl();
28
+ const running = await isDaemonRunning(daemonUrl);
29
+ if (!running) {
30
+ this.error(
31
+ `Daemon not running. Start it with: ${chalk.cyan("cd apps/agor-daemon && pnpm dev")}`
32
+ );
33
+ }
34
+ const client = createClient(daemonUrl);
35
+ try {
36
+ let serverId = args.id;
37
+ if (!args.id.match(/^[0-9a-f]{8}/i)) {
38
+ const result = await client.service("mcp-servers").find({
39
+ query: { $limit: 100 }
40
+ });
41
+ const servers = Array.isArray(result) ? result : result.data;
42
+ const server = servers.find((s) => s.name === args.id);
43
+ if (!server) {
44
+ this.log(chalk.red(`\u2717 MCP server not found: ${args.id}`));
45
+ await this.cleanup(client);
46
+ process.exit(1);
47
+ }
48
+ serverId = server.mcp_server_id;
49
+ }
50
+ if (!flags.force) {
51
+ this.log("");
52
+ this.log(chalk.yellow(`\u26A0\uFE0F This will permanently remove the MCP server: ${args.id}`));
53
+ this.log("");
54
+ this.log(chalk.gray("Use --force to skip this confirmation"));
55
+ this.log("");
56
+ await this.cleanup(client);
57
+ process.exit(1);
58
+ }
59
+ await client.service("mcp-servers").remove(serverId);
60
+ this.log("");
61
+ this.log(`${chalk.green("\u2713")} MCP server removed: ${args.id}`);
62
+ this.log("");
63
+ await this.cleanup(client);
64
+ process.exit(0);
65
+ } catch (error) {
66
+ const message = error instanceof Error ? error.message : String(error);
67
+ this.log("");
68
+ this.log(chalk.red("\u2717 Failed to remove MCP server"));
69
+ this.log("");
70
+ this.log(chalk.dim(message));
71
+ this.log("");
72
+ await this.cleanup(client);
73
+ process.exit(1);
74
+ }
75
+ }
76
+ async cleanup(client) {
77
+ await new Promise((resolve) => {
78
+ client.io.once("disconnect", () => resolve());
79
+ client.io.close();
80
+ setTimeout(() => resolve(), 1e3);
81
+ });
82
+ }
83
+ };
84
+ export {
85
+ McpRemove as default
86
+ };
@@ -0,0 +1,14 @@
1
+ import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
+ import { Command } from '@oclif/core';
3
+
4
+ declare class McpShow extends Command {
5
+ static description: string;
6
+ static examples: string[];
7
+ static args: {
8
+ id: _oclif_core_interfaces.Arg<string, Record<string, unknown>>;
9
+ };
10
+ run(): Promise<void>;
11
+ private cleanup;
12
+ }
13
+
14
+ export { McpShow as default };
@@ -0,0 +1,131 @@
1
+ // src/commands/mcp/show.ts
2
+ import { createClient } from "@agor/core/api";
3
+ import { Args, Command } from "@oclif/core";
4
+ import chalk from "chalk";
5
+ var McpShow = class _McpShow extends Command {
6
+ static description = "Show MCP server details";
7
+ static examples = [
8
+ "<%= config.bin %> <%= command.id %> 0199b856",
9
+ "<%= config.bin %> <%= command.id %> filesystem"
10
+ ];
11
+ static args = {
12
+ id: Args.string({
13
+ description: "MCP server ID or name",
14
+ required: true
15
+ })
16
+ };
17
+ async run() {
18
+ const { args } = await this.parse(_McpShow);
19
+ const client = createClient();
20
+ try {
21
+ let server = null;
22
+ try {
23
+ server = await client.service("mcp-servers").get(args.id);
24
+ } catch {
25
+ const result = await client.service("mcp-servers").find({
26
+ query: { $limit: 1 }
27
+ });
28
+ const servers = Array.isArray(result) ? result : result.data;
29
+ server = servers.find((s) => s.name === args.id) || null;
30
+ }
31
+ if (!server) {
32
+ this.log(chalk.red(`\u2717 MCP server not found: ${args.id}`));
33
+ await this.cleanup(client);
34
+ process.exit(1);
35
+ }
36
+ this.log("");
37
+ this.log(chalk.bold(chalk.cyan("MCP Server Details")));
38
+ this.log("");
39
+ this.log(`${chalk.cyan("ID")}: ${server.mcp_server_id}`);
40
+ this.log(`${chalk.cyan("Short ID")}: ${String(server.mcp_server_id).substring(0, 8)}`);
41
+ this.log(`${chalk.cyan("Name")}: ${server.name}`);
42
+ if (server.display_name) {
43
+ this.log(`${chalk.cyan("Display Name")}: ${server.display_name}`);
44
+ }
45
+ if (server.description) {
46
+ this.log(`${chalk.cyan("Description")}: ${server.description}`);
47
+ }
48
+ this.log("");
49
+ this.log(chalk.bold("Configuration"));
50
+ this.log(`${chalk.cyan("Transport")}: ${server.transport}`);
51
+ this.log(`${chalk.cyan("Scope")}: ${server.scope}`);
52
+ this.log(`${chalk.cyan("Source")}: ${server.source}`);
53
+ this.log(
54
+ `${chalk.cyan("Enabled")}: ${server.enabled ? chalk.green("\u2713 Yes") : chalk.gray("\u2717 No")}`
55
+ );
56
+ if (server.command) {
57
+ this.log(`${chalk.cyan("Command")}: ${server.command}`);
58
+ }
59
+ if (server.args && server.args.length > 0) {
60
+ this.log(`${chalk.cyan("Arguments")}:`);
61
+ for (const arg of server.args) {
62
+ this.log(` - ${arg}`);
63
+ }
64
+ }
65
+ if (server.url) {
66
+ this.log(`${chalk.cyan("URL")}: ${server.url}`);
67
+ }
68
+ if (server.env && Object.keys(server.env).length > 0) {
69
+ this.log(`${chalk.cyan("Environment Variables")}:`);
70
+ for (const [key, value] of Object.entries(server.env)) {
71
+ this.log(` ${key}=${value}`);
72
+ }
73
+ }
74
+ if (server.tools || server.resources || server.prompts) {
75
+ this.log("");
76
+ this.log(chalk.bold("Capabilities"));
77
+ if (server.tools && server.tools.length > 0) {
78
+ this.log(`${chalk.cyan("Tools")}: ${server.tools.length}`);
79
+ for (const tool of server.tools.slice(0, 5)) {
80
+ this.log(` - ${tool.name}: ${tool.description}`);
81
+ }
82
+ if (server.tools.length > 5) {
83
+ this.log(chalk.gray(` ... and ${server.tools.length - 5} more`));
84
+ }
85
+ }
86
+ if (server.resources && server.resources.length > 0) {
87
+ this.log(`${chalk.cyan("Resources")}: ${server.resources.length}`);
88
+ for (const resource of server.resources.slice(0, 5)) {
89
+ this.log(` - ${resource.name} (${resource.uri})`);
90
+ }
91
+ if (server.resources.length > 5) {
92
+ this.log(chalk.gray(` ... and ${server.resources.length - 5} more`));
93
+ }
94
+ }
95
+ if (server.prompts && server.prompts.length > 0) {
96
+ this.log(`${chalk.cyan("Prompts")}: ${server.prompts.length}`);
97
+ for (const prompt of server.prompts.slice(0, 5)) {
98
+ this.log(` - /${prompt.name}: ${prompt.description}`);
99
+ }
100
+ if (server.prompts.length > 5) {
101
+ this.log(chalk.gray(` ... and ${server.prompts.length - 5} more`));
102
+ }
103
+ }
104
+ }
105
+ this.log("");
106
+ this.log(chalk.gray(`Created: ${new Date(server.created_at).toLocaleString()}`));
107
+ if (server.updated_at) {
108
+ this.log(chalk.gray(`Updated: ${new Date(server.updated_at).toLocaleString()}`));
109
+ }
110
+ this.log("");
111
+ } catch (error) {
112
+ this.log(chalk.red("\u2717 Failed to fetch MCP server"));
113
+ if (error instanceof Error) {
114
+ this.log(chalk.red(error.message));
115
+ }
116
+ await this.cleanup(client);
117
+ process.exit(1);
118
+ }
119
+ await this.cleanup(client);
120
+ }
121
+ async cleanup(client) {
122
+ await new Promise((resolve) => {
123
+ client.io.once("disconnect", () => resolve());
124
+ client.io.close();
125
+ setTimeout(() => resolve(), 1e3);
126
+ });
127
+ }
128
+ };
129
+ export {
130
+ McpShow as default
131
+ };
@@ -0,0 +1,16 @@
1
+ import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
+ import { Command } from '@oclif/core';
3
+
4
+ declare class RepoAdd extends Command {
5
+ static description: string;
6
+ static examples: string[];
7
+ static args: {
8
+ url: _oclif_core_interfaces.Arg<string, Record<string, unknown>>;
9
+ };
10
+ static flags: {
11
+ slug: _oclif_core_interfaces.OptionFlag<string | undefined, _oclif_core_interfaces.CustomOptions>;
12
+ };
13
+ run(): Promise<void>;
14
+ }
15
+
16
+ export { RepoAdd as default };
@@ -0,0 +1,105 @@
1
+ // src/commands/repo/add.ts
2
+ import { createClient, isDaemonRunning } from "@agor/core/api";
3
+ import { extractSlugFromUrl, getDaemonUrl, isValidSlug } from "@agor/core/config";
4
+ import { Args, Command, Flags } from "@oclif/core";
5
+ import chalk from "chalk";
6
+ var RepoAdd = class _RepoAdd extends Command {
7
+ static description = "Clone and register a Git repository";
8
+ static examples = [
9
+ "<%= config.bin %> <%= command.id %> git@github.com:apache/superset.git",
10
+ "<%= config.bin %> <%= command.id %> https://github.com/facebook/react.git",
11
+ "<%= config.bin %> <%= command.id %> https://github.com/apache/superset.git --slug my-org/custom-name"
12
+ ];
13
+ static args = {
14
+ url: Args.string({
15
+ description: "Git repository URL (SSH or HTTPS)",
16
+ required: true
17
+ })
18
+ };
19
+ static flags = {
20
+ slug: Flags.string({
21
+ char: "s",
22
+ description: "Custom slug (org/name) for the repository (auto-extracted if not provided)"
23
+ })
24
+ };
25
+ async run() {
26
+ const { args, flags } = await this.parse(_RepoAdd);
27
+ const daemonUrl = await getDaemonUrl();
28
+ const running = await isDaemonRunning(daemonUrl);
29
+ if (!running) {
30
+ this.error(
31
+ `Daemon not running. Start it with: ${chalk.cyan("cd apps/agor-daemon && pnpm dev")}`
32
+ );
33
+ }
34
+ try {
35
+ let slug = flags.slug;
36
+ if (!slug) {
37
+ slug = extractSlugFromUrl(args.url);
38
+ this.log("");
39
+ this.log(chalk.dim(`Auto-detected slug: ${chalk.cyan(slug)}`));
40
+ }
41
+ if (!isValidSlug(slug)) {
42
+ this.error(
43
+ `Invalid slug format: ${slug}
44
+ Slug must be in format "org/name" (e.g., "apache/superset")
45
+ Use --slug to specify a custom slug.`
46
+ );
47
+ }
48
+ this.log("");
49
+ this.log(chalk.bold(`Cloning ${chalk.cyan(slug)}...`));
50
+ this.log(chalk.dim(`URL: ${args.url}`));
51
+ this.log("");
52
+ const client = createClient(daemonUrl);
53
+ const repo = await client.service("repos").clone({
54
+ url: args.url,
55
+ name: slug
56
+ });
57
+ this.log(`${chalk.green("\u2713")} Repository cloned and registered`);
58
+ this.log(chalk.dim(` Path: ${repo.local_path}`));
59
+ this.log(chalk.dim(` Default branch: ${repo.default_branch}`));
60
+ this.log("");
61
+ this.log(chalk.bold("Repository Details:"));
62
+ this.log(` ${chalk.cyan("ID")}: ${repo.repo_id}`);
63
+ this.log(` ${chalk.cyan("Name")}: ${repo.name}`);
64
+ this.log(` ${chalk.cyan("Path")}: ${repo.local_path}`);
65
+ this.log(` ${chalk.cyan("Default Branch")}: ${repo.default_branch}`);
66
+ this.log("");
67
+ await new Promise((resolve) => {
68
+ client.io.once("disconnect", () => resolve());
69
+ client.io.close();
70
+ setTimeout(() => resolve(), 1e3);
71
+ });
72
+ process.exit(0);
73
+ } catch (error) {
74
+ const message = error instanceof Error ? error.message : String(error);
75
+ this.log("");
76
+ if (message.includes("already exists")) {
77
+ this.log(chalk.red("\u2717 Repository already exists"));
78
+ this.log("");
79
+ this.log(`Use ${chalk.cyan("agor repo list")} to see registered repos.`);
80
+ this.log("");
81
+ process.exit(1);
82
+ } else if (message.includes("Permission denied")) {
83
+ this.log(chalk.red("\u2717 Permission denied"));
84
+ this.log("");
85
+ this.log("Make sure you have SSH keys configured or use HTTPS URL.");
86
+ this.log("");
87
+ process.exit(1);
88
+ } else if (message.includes("Could not resolve host")) {
89
+ this.log(chalk.red("\u2717 Network error"));
90
+ this.log("");
91
+ this.log("Check your internet connection and try again.");
92
+ this.log("");
93
+ process.exit(1);
94
+ }
95
+ this.log(chalk.red("\u2717 Failed to add repository"));
96
+ this.log("");
97
+ this.log(chalk.dim(message));
98
+ this.log("");
99
+ process.exit(1);
100
+ }
101
+ }
102
+ };
103
+ export {
104
+ RepoAdd as default
105
+ };
@@ -0,0 +1,17 @@
1
+ import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
+ import { Command } from '@oclif/core';
3
+
4
+ declare class RepoList extends Command {
5
+ static description: string;
6
+ static examples: string[];
7
+ static flags: {
8
+ limit: _oclif_core_interfaces.OptionFlag<number, _oclif_core_interfaces.CustomOptions>;
9
+ };
10
+ /**
11
+ * Truncate text to max length
12
+ */
13
+ private truncate;
14
+ run(): Promise<void>;
15
+ }
16
+
17
+ export { RepoList as default };
@@ -0,0 +1,99 @@
1
+ // src/commands/repo/list.ts
2
+ import { createClient, isDaemonRunning } from "@agor/core/api";
3
+ import { getDaemonUrl } from "@agor/core/config";
4
+ import { formatShortId } from "@agor/core/db";
5
+ import { Command, Flags } from "@oclif/core";
6
+ import chalk from "chalk";
7
+ import Table from "cli-table3";
8
+ var RepoList = class _RepoList extends Command {
9
+ static description = "List all registered repositories";
10
+ static examples = ["<%= config.bin %> <%= command.id %>"];
11
+ static flags = {
12
+ limit: Flags.integer({
13
+ char: "l",
14
+ description: "Maximum number of repos to show",
15
+ default: 50
16
+ })
17
+ };
18
+ /**
19
+ * Truncate text to max length
20
+ */
21
+ truncate(text, maxLength) {
22
+ if (text.length <= maxLength) return text;
23
+ return `${text.slice(0, maxLength - 3)}...`;
24
+ }
25
+ async run() {
26
+ const { flags } = await this.parse(_RepoList);
27
+ const daemonUrl = await getDaemonUrl();
28
+ const running = await isDaemonRunning(daemonUrl);
29
+ if (!running) {
30
+ this.error(
31
+ `Daemon not running. Start it with: ${chalk.cyan("cd apps/agor-daemon && pnpm dev")}`
32
+ );
33
+ }
34
+ try {
35
+ const client = createClient(daemonUrl);
36
+ const query = {
37
+ $limit: flags.limit,
38
+ $sort: { created_at: -1 }
39
+ // Most recent first
40
+ };
41
+ const reposService = client.service("repos");
42
+ const result = await reposService.find({ query });
43
+ const isPaginated = !Array.isArray(result);
44
+ const repos = Array.isArray(result) ? result : result.data;
45
+ const total = isPaginated ? result.total : repos.length;
46
+ if (!Array.isArray(repos) || repos.length === 0) {
47
+ this.log(chalk.dim("No repositories found."));
48
+ this.log("");
49
+ this.log(`Add one with: ${chalk.cyan("agor repo add <git-url>")}`);
50
+ this.log("");
51
+ client.io.close();
52
+ process.exit(0);
53
+ return;
54
+ }
55
+ const table = new Table({
56
+ head: [
57
+ chalk.cyan("ID"),
58
+ chalk.cyan("Slug"),
59
+ chalk.cyan("Remote URL"),
60
+ chalk.cyan("Path"),
61
+ chalk.cyan("Default Branch")
62
+ ],
63
+ style: {
64
+ head: [],
65
+ border: ["dim"]
66
+ },
67
+ colWidths: [10, 20, 45, 30, 15]
68
+ });
69
+ for (const repo of repos) {
70
+ const shortId = formatShortId(repo.repo_id);
71
+ table.push([
72
+ chalk.dim(shortId),
73
+ repo.slug,
74
+ this.truncate(repo.remote_url || "(no remote)", 42),
75
+ chalk.dim(this.truncate(repo.local_path, 27)),
76
+ chalk.dim(repo.default_branch || "-")
77
+ ]);
78
+ }
79
+ this.log("");
80
+ this.log(table.toString());
81
+ this.log("");
82
+ if (isPaginated && total > repos.length) {
83
+ this.log(chalk.dim(`Showing ${repos.length} of ${total} repo(s)`));
84
+ } else {
85
+ this.log(chalk.dim(`Showing ${repos.length} repo(s)`));
86
+ }
87
+ this.log("");
88
+ client.io.close();
89
+ process.exit(0);
90
+ } catch (error) {
91
+ this.error(
92
+ `Failed to fetch repos: ${error instanceof Error ? error.message : String(error)}`
93
+ );
94
+ }
95
+ }
96
+ };
97
+ export {
98
+ RepoList as default
99
+ };
@@ -0,0 +1,17 @@
1
+ import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
+ import { Command } from '@oclif/core';
3
+
4
+ declare class RepoRm extends Command {
5
+ static description: string;
6
+ static examples: string[];
7
+ static args: {
8
+ id: _oclif_core_interfaces.Arg<string, Record<string, unknown>>;
9
+ };
10
+ static flags: {
11
+ 'delete-files': _oclif_core_interfaces.BooleanFlag<boolean>;
12
+ force: _oclif_core_interfaces.BooleanFlag<boolean>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
16
+
17
+ export { RepoRm as default };