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,118 @@
1
+ // src/commands/config/index.ts
2
+ import { getConfigPath, getEffectiveConfig, loadConfig } from "@agor/core/config";
3
+ import { Command } from "@oclif/core";
4
+ import chalk from "chalk";
5
+ var ConfigIndex = class extends Command {
6
+ static description = "Show current configuration and active context";
7
+ static examples = ["<%= config.bin %> <%= command.id %>"];
8
+ async run() {
9
+ try {
10
+ const config = await loadConfig();
11
+ const effective = await getEffectiveConfig(config);
12
+ this.log(chalk.bold("\nCurrent Configuration"));
13
+ this.log(chalk.dim("\u2500".repeat(50)));
14
+ this.log(chalk.bold("\nActive Context:"));
15
+ if (effective.board) {
16
+ this.log(` board: ${chalk.cyan(effective.board)}`);
17
+ }
18
+ if (effective.session) {
19
+ this.log(` session: ${chalk.cyan(effective.session)}`);
20
+ }
21
+ if (effective.repo) {
22
+ this.log(` repo: ${chalk.cyan(effective.repo)}`);
23
+ }
24
+ if (effective.agent) {
25
+ this.log(` agent: ${chalk.cyan(effective.agent)}`);
26
+ }
27
+ if (!effective.board && !effective.session && !effective.repo && !effective.agent) {
28
+ this.log(chalk.dim(" (no active context)"));
29
+ }
30
+ this.log(chalk.bold("\nGlobal Defaults:"));
31
+ if (config.defaults?.board) {
32
+ this.log(` default board: ${chalk.gray(config.defaults.board)}`);
33
+ }
34
+ if (config.defaults?.agent) {
35
+ this.log(` default agent: ${chalk.gray(config.defaults.agent)}`);
36
+ }
37
+ this.log(chalk.bold("\nDisplay Settings:"));
38
+ if (config.display?.tableStyle) {
39
+ this.log(` table style: ${chalk.gray(config.display.tableStyle)}`);
40
+ }
41
+ if (config.display?.colorOutput !== void 0) {
42
+ this.log(
43
+ ` color output: ${chalk.gray(config.display.colorOutput ? "enabled" : "disabled")}`
44
+ );
45
+ }
46
+ if (config.display?.shortIdLength) {
47
+ this.log(` short ID len: ${chalk.gray(String(config.display.shortIdLength))}`);
48
+ }
49
+ if (config.credentials && Object.keys(config.credentials).length > 0) {
50
+ this.log(chalk.bold("\nCredentials:"));
51
+ for (const [key, value] of Object.entries(config.credentials)) {
52
+ if (value) {
53
+ this.log(` ${key.padEnd(20)}: ${chalk.gray(`***${value.slice(-4)}`)}`);
54
+ }
55
+ }
56
+ }
57
+ const { getDefaultConfig } = await import("@agor/core/config");
58
+ const defaults = getDefaultConfig();
59
+ const daemonConfig = { ...defaults.daemon, ...config.daemon };
60
+ if (daemonConfig) {
61
+ this.log(chalk.bold("\nDaemon Settings:"));
62
+ if (daemonConfig.port !== void 0) {
63
+ this.log(` port: ${chalk.gray(String(daemonConfig.port))}`);
64
+ }
65
+ if (daemonConfig.host) {
66
+ this.log(` host: ${chalk.gray(daemonConfig.host)}`);
67
+ }
68
+ if (daemonConfig.jwtSecret) {
69
+ this.log(
70
+ ` JWT secret: ${chalk.gray(`***${daemonConfig.jwtSecret.slice(-8)}`)} ${chalk.dim("(saved)")}`
71
+ );
72
+ }
73
+ if (daemonConfig.allowAnonymous !== void 0) {
74
+ this.log(
75
+ ` allow anon: ${chalk.gray(daemonConfig.allowAnonymous ? "enabled" : "disabled")}`
76
+ );
77
+ }
78
+ if (daemonConfig.requireAuth !== void 0) {
79
+ this.log(
80
+ ` require auth: ${chalk.gray(daemonConfig.requireAuth ? "enabled" : "disabled")}`
81
+ );
82
+ }
83
+ }
84
+ this.log(chalk.bold("\nConfig File:"));
85
+ this.log(` ${chalk.dim(getConfigPath())}`);
86
+ this.log(chalk.bold("\nAvailable Configuration Keys:"));
87
+ this.log(chalk.dim(" Use `agor config set <key> <value>` to set any of these:"));
88
+ this.log("");
89
+ this.log(chalk.cyan(" Context (temporary, cleared with `agor config clear`):"));
90
+ this.log(" board, session, repo, agent");
91
+ this.log("");
92
+ this.log(chalk.cyan(" Defaults:"));
93
+ this.log(" defaults.board, defaults.agent");
94
+ this.log("");
95
+ this.log(chalk.cyan(" Display:"));
96
+ this.log(" display.tableStyle, display.colorOutput, display.shortIdLength");
97
+ this.log("");
98
+ this.log(chalk.cyan(" Credentials:"));
99
+ this.log(" credentials.ANTHROPIC_API_KEY");
100
+ this.log(" credentials.OPENAI_API_KEY");
101
+ this.log(" credentials.CURSOR_API_KEY");
102
+ this.log(" credentials.GOOGLE_API_KEY");
103
+ this.log("");
104
+ this.log(chalk.cyan(" Daemon:"));
105
+ this.log(" daemon.port, daemon.host");
106
+ this.log(" daemon.jwtSecret (auto-generated if not set)");
107
+ this.log(" daemon.allowAnonymous, daemon.requireAuth");
108
+ this.log("");
109
+ } catch (error) {
110
+ this.error(
111
+ `Failed to load config: ${error instanceof Error ? error.message : String(error)}`
112
+ );
113
+ }
114
+ }
115
+ };
116
+ export {
117
+ ConfigIndex as default
118
+ };
@@ -0,0 +1,14 @@
1
+ import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
+ import { Command } from '@oclif/core';
3
+
4
+ declare class ConfigSet extends Command {
5
+ static description: string;
6
+ static examples: string[];
7
+ static args: {
8
+ key: _oclif_core_interfaces.Arg<string, Record<string, unknown>>;
9
+ value: _oclif_core_interfaces.Arg<string, Record<string, unknown>>;
10
+ };
11
+ run(): Promise<void>;
12
+ }
13
+
14
+ export { ConfigSet as default };
@@ -0,0 +1,50 @@
1
+ // src/commands/config/set.ts
2
+ import { setConfigValue } from "@agor/core/config";
3
+ import { Args, Command } from "@oclif/core";
4
+ import chalk from "chalk";
5
+ var ConfigSet = class _ConfigSet extends Command {
6
+ static description = "Set a configuration value";
7
+ static examples = [
8
+ "<%= config.bin %> <%= command.id %> board experiments",
9
+ "<%= config.bin %> <%= command.id %> session 01933e4a",
10
+ "<%= config.bin %> <%= command.id %> repo anthropics/agor:main",
11
+ "<%= config.bin %> <%= command.id %> agent claude-code",
12
+ "<%= config.bin %> <%= command.id %> credentials.ANTHROPIC_API_KEY sk-ant-...",
13
+ "<%= config.bin %> <%= command.id %> defaults.agent cursor"
14
+ ];
15
+ static args = {
16
+ key: Args.string({
17
+ description: "Configuration key (supports dot notation: credentials.ANTHROPIC_API_KEY)",
18
+ required: true
19
+ }),
20
+ value: Args.string({
21
+ description: "Value to set",
22
+ required: true
23
+ })
24
+ };
25
+ async run() {
26
+ const { args } = await this.parse(_ConfigSet);
27
+ const key = args.key;
28
+ const rawValue = args.value;
29
+ let value = rawValue;
30
+ if (rawValue === "true") {
31
+ value = true;
32
+ } else if (rawValue === "false") {
33
+ value = false;
34
+ } else if (/^-?\d+$/.test(rawValue)) {
35
+ value = Number.parseInt(rawValue, 10);
36
+ } else if (/^-?\d+\.\d+$/.test(rawValue)) {
37
+ value = Number.parseFloat(rawValue);
38
+ }
39
+ try {
40
+ await setConfigValue(key, value);
41
+ const displayValue = (key.includes("API_KEY") || key.includes("TOKEN")) && typeof value === "string" ? `${value.substring(0, 10)}...` : String(value);
42
+ this.log(`${chalk.green("\u2713")} Set ${chalk.cyan(key)} = ${chalk.yellow(displayValue)}`);
43
+ } catch (error) {
44
+ this.error(`Failed to set config: ${error instanceof Error ? error.message : String(error)}`);
45
+ }
46
+ }
47
+ };
48
+ export {
49
+ ConfigSet as default
50
+ };
@@ -0,0 +1,13 @@
1
+ import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
+ import { Command } from '@oclif/core';
3
+
4
+ declare class ConfigUnset extends Command {
5
+ static description: string;
6
+ static examples: string[];
7
+ static args: {
8
+ key: _oclif_core_interfaces.Arg<string, Record<string, unknown>>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
12
+
13
+ export { ConfigUnset as default };
@@ -0,0 +1,35 @@
1
+ // src/commands/config/unset.ts
2
+ import { unsetContext } from "@agor/core/config";
3
+ import { Args, Command } from "@oclif/core";
4
+ import chalk from "chalk";
5
+ var ConfigUnset = class _ConfigUnset extends Command {
6
+ static description = "Unset (clear) a configuration value";
7
+ static examples = [
8
+ "<%= config.bin %> <%= command.id %> board",
9
+ "<%= config.bin %> <%= command.id %> session",
10
+ "<%= config.bin %> <%= command.id %> repo",
11
+ "<%= config.bin %> <%= command.id %> agent"
12
+ ];
13
+ static args = {
14
+ key: Args.string({
15
+ description: "Configuration key to unset (board, session, repo, agent)",
16
+ required: true,
17
+ options: ["board", "session", "repo", "agent"]
18
+ })
19
+ };
20
+ async run() {
21
+ const { args } = await this.parse(_ConfigUnset);
22
+ const key = args.key;
23
+ try {
24
+ await unsetContext(key);
25
+ this.log(`${chalk.green("\u2713")} Unset ${chalk.cyan(key)}`);
26
+ } catch (error) {
27
+ this.error(
28
+ `Failed to unset config: ${error instanceof Error ? error.message : String(error)}`
29
+ );
30
+ }
31
+ }
32
+ };
33
+ export {
34
+ ConfigUnset as default
35
+ };
@@ -0,0 +1,13 @@
1
+ import { Command } from '@oclif/core';
2
+
3
+ /**
4
+ * `agor daemon` - Daemon lifecycle management overview
5
+ */
6
+
7
+ declare class DaemonIndex extends Command {
8
+ static description: string;
9
+ static examples: string[];
10
+ run(): Promise<void>;
11
+ }
12
+
13
+ export { DaemonIndex as default };
@@ -0,0 +1,65 @@
1
+ // src/commands/daemon/index.ts
2
+ import { Command } from "@oclif/core";
3
+ import chalk from "chalk";
4
+
5
+ // src/lib/context.ts
6
+ import path from "path";
7
+ import { fileURLToPath } from "url";
8
+ function isInstalledPackage() {
9
+ const dirname = typeof __dirname !== "undefined" ? __dirname : path.dirname(fileURLToPath(import.meta.url));
10
+ const isInMonorepoSource = dirname.includes("/apps/agor-cli/") || dirname.includes("\\apps\\agor-cli\\");
11
+ return !isInMonorepoSource;
12
+ }
13
+
14
+ // src/commands/daemon/index.ts
15
+ var DaemonIndex = class extends Command {
16
+ static description = "Manage the Agor daemon lifecycle";
17
+ static examples = [
18
+ "<%= config.bin %> <%= command.id %> start",
19
+ "<%= config.bin %> <%= command.id %> stop",
20
+ "<%= config.bin %> <%= command.id %> status"
21
+ ];
22
+ async run() {
23
+ if (!isInstalledPackage()) {
24
+ this.log(chalk.yellow("\u26A0 Daemon lifecycle commands only work in production mode."));
25
+ this.log("");
26
+ this.log(chalk.bold("In development, manage the daemon manually:"));
27
+ this.log("");
28
+ this.log(chalk.cyan(" Start daemon:"));
29
+ this.log(" cd apps/agor-daemon && pnpm dev");
30
+ this.log("");
31
+ this.log(chalk.cyan(" Stop daemon:"));
32
+ this.log(" Use Ctrl+C in the daemon terminal");
33
+ this.log("");
34
+ this.exit(1);
35
+ }
36
+ this.log(chalk.bold("\nDaemon Lifecycle Management"));
37
+ this.log(chalk.dim("\u2500".repeat(50)));
38
+ this.log("");
39
+ this.log(chalk.bold("Available Commands:"));
40
+ this.log("");
41
+ this.log(` ${chalk.cyan("agor daemon start")} Start daemon in background`);
42
+ this.log(` ${chalk.cyan("agor daemon stop")} Stop daemon gracefully`);
43
+ this.log(` ${chalk.cyan("agor daemon restart")} Restart daemon`);
44
+ this.log(` ${chalk.cyan("agor daemon status")} Check daemon status`);
45
+ this.log(` ${chalk.cyan("agor daemon logs")} View daemon logs`);
46
+ this.log("");
47
+ this.log(chalk.bold("Examples:"));
48
+ this.log("");
49
+ this.log(" # Start daemon");
50
+ this.log(" $ agor daemon start");
51
+ this.log("");
52
+ this.log(" # Check status");
53
+ this.log(" $ agor daemon status");
54
+ this.log("");
55
+ this.log(" # View recent logs");
56
+ this.log(" $ agor daemon logs");
57
+ this.log("");
58
+ this.log(" # View last 100 log lines");
59
+ this.log(" $ agor daemon logs --lines 100");
60
+ this.log("");
61
+ }
62
+ };
63
+ export {
64
+ DaemonIndex as default
65
+ };
@@ -0,0 +1,13 @@
1
+ import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
+ import { Command } from '@oclif/core';
3
+
4
+ declare class DaemonLogs extends Command {
5
+ static description: string;
6
+ static examples: string[];
7
+ static flags: {
8
+ lines: _oclif_core_interfaces.OptionFlag<number, _oclif_core_interfaces.CustomOptions>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
12
+
13
+ export { DaemonLogs as default };
@@ -0,0 +1,78 @@
1
+ // src/commands/daemon/logs.ts
2
+ import { Command, Flags } from "@oclif/core";
3
+ import chalk from "chalk";
4
+
5
+ // src/lib/context.ts
6
+ import path from "path";
7
+ import { fileURLToPath } from "url";
8
+ function isInstalledPackage() {
9
+ const dirname = typeof __dirname !== "undefined" ? __dirname : path.dirname(fileURLToPath(import.meta.url));
10
+ const isInMonorepoSource = dirname.includes("/apps/agor-cli/") || dirname.includes("\\apps\\agor-cli\\");
11
+ return !isInMonorepoSource;
12
+ }
13
+
14
+ // src/lib/daemon-manager.ts
15
+ import { spawn } from "child_process";
16
+ import fs from "fs";
17
+ import os from "os";
18
+ import path2 from "path";
19
+ function getAgorHome() {
20
+ return path2.join(os.homedir(), ".agor");
21
+ }
22
+ function getLogFilePath() {
23
+ const logsDir = path2.join(getAgorHome(), "logs");
24
+ if (!fs.existsSync(logsDir)) {
25
+ fs.mkdirSync(logsDir, { recursive: true });
26
+ }
27
+ return path2.join(logsDir, "daemon.log");
28
+ }
29
+ function readLogs(lines = 50) {
30
+ const logFile = getLogFilePath();
31
+ if (!fs.existsSync(logFile)) {
32
+ return "No logs found";
33
+ }
34
+ const content = fs.readFileSync(logFile, "utf-8");
35
+ const allLines = content.split("\n").filter((line) => line.trim() !== "");
36
+ const lastLines = allLines.slice(-lines);
37
+ return lastLines.join("\n");
38
+ }
39
+
40
+ // src/commands/daemon/logs.ts
41
+ var DaemonLogs = class _DaemonLogs extends Command {
42
+ static description = "View daemon logs";
43
+ static examples = [
44
+ "<%= config.bin %> <%= command.id %>",
45
+ "<%= config.bin %> <%= command.id %> --lines 100",
46
+ "<%= config.bin %> <%= command.id %> -n 200"
47
+ ];
48
+ static flags = {
49
+ lines: Flags.integer({
50
+ char: "n",
51
+ description: "Number of lines to display",
52
+ default: 50
53
+ })
54
+ };
55
+ async run() {
56
+ const { flags } = await this.parse(_DaemonLogs);
57
+ if (!isInstalledPackage()) {
58
+ this.log(chalk.yellow("\u26A0 Daemon logs are only available in production mode."));
59
+ this.log("");
60
+ this.log(chalk.bold("In development, view daemon output in the terminal where you ran:"));
61
+ this.log(" " + chalk.cyan("cd apps/agor-daemon && pnpm dev"));
62
+ this.log("");
63
+ this.exit(1);
64
+ }
65
+ const logFile = getLogFilePath();
66
+ const logs = readLogs(flags.lines);
67
+ this.log(chalk.bold(`
68
+ Daemon Logs (last ${flags.lines} lines)`));
69
+ this.log(chalk.dim("\u2500".repeat(50)));
70
+ this.log(chalk.dim(`Log file: ${logFile}`));
71
+ this.log("");
72
+ this.log(logs);
73
+ this.log("");
74
+ }
75
+ };
76
+ export {
77
+ DaemonLogs as default
78
+ };
@@ -0,0 +1,13 @@
1
+ import { Command } from '@oclif/core';
2
+
3
+ /**
4
+ * `agor daemon restart` - Restart daemon
5
+ */
6
+
7
+ declare class DaemonRestart extends Command {
8
+ static description: string;
9
+ static examples: string[];
10
+ run(): Promise<void>;
11
+ }
12
+
13
+ export { DaemonRestart as default };
@@ -0,0 +1,177 @@
1
+ // src/commands/daemon/restart.ts
2
+ import { isDaemonRunning } from "@agor/core/api";
3
+ import { getDaemonUrl } from "@agor/core/config";
4
+ import { Command } from "@oclif/core";
5
+ import chalk from "chalk";
6
+
7
+ // src/lib/context.ts
8
+ import path from "path";
9
+ import { fileURLToPath } from "url";
10
+ function isInstalledPackage() {
11
+ const dirname = typeof __dirname !== "undefined" ? __dirname : path.dirname(fileURLToPath(import.meta.url));
12
+ const isInMonorepoSource = dirname.includes("/apps/agor-cli/") || dirname.includes("\\apps\\agor-cli\\");
13
+ return !isInMonorepoSource;
14
+ }
15
+ function getDaemonPath() {
16
+ if (!isInstalledPackage()) {
17
+ return null;
18
+ }
19
+ const dirname = typeof __dirname !== "undefined" ? __dirname : path.dirname(fileURLToPath(import.meta.url));
20
+ const cliDistIndex = dirname.indexOf(path.sep + "dist" + path.sep + "cli");
21
+ if (cliDistIndex === -1) {
22
+ return path.resolve(dirname, "../../daemon/index.js");
23
+ }
24
+ const packageRoot = dirname.substring(0, cliDistIndex);
25
+ return path.join(packageRoot, "dist", "daemon", "index.js");
26
+ }
27
+
28
+ // src/lib/daemon-manager.ts
29
+ import { spawn } from "child_process";
30
+ import fs from "fs";
31
+ import os from "os";
32
+ import path2 from "path";
33
+ function getAgorHome() {
34
+ return path2.join(os.homedir(), ".agor");
35
+ }
36
+ function getPidFilePath() {
37
+ return path2.join(getAgorHome(), "daemon.pid");
38
+ }
39
+ function getLogFilePath() {
40
+ const logsDir = path2.join(getAgorHome(), "logs");
41
+ if (!fs.existsSync(logsDir)) {
42
+ fs.mkdirSync(logsDir, { recursive: true });
43
+ }
44
+ return path2.join(logsDir, "daemon.log");
45
+ }
46
+ function getDaemonPid() {
47
+ const pidFile = getPidFilePath();
48
+ if (!fs.existsSync(pidFile)) {
49
+ return null;
50
+ }
51
+ const pid = parseInt(fs.readFileSync(pidFile, "utf-8").trim(), 10);
52
+ try {
53
+ process.kill(pid, 0);
54
+ return pid;
55
+ } catch {
56
+ fs.unlinkSync(pidFile);
57
+ return null;
58
+ }
59
+ }
60
+ function startDaemon(daemonPath) {
61
+ const existingPid = getDaemonPid();
62
+ if (existingPid !== null) {
63
+ throw new Error(`Daemon already running (PID ${existingPid})`);
64
+ }
65
+ if (!fs.existsSync(daemonPath)) {
66
+ throw new Error(`Daemon binary not found at: ${daemonPath}`);
67
+ }
68
+ const logFile = getLogFilePath();
69
+ const logStream = fs.openSync(logFile, "a");
70
+ const child = spawn("node", [daemonPath], {
71
+ detached: true,
72
+ stdio: ["ignore", logStream, logStream],
73
+ env: {
74
+ ...process.env,
75
+ NODE_ENV: "production"
76
+ }
77
+ });
78
+ child.unref();
79
+ fs.writeFileSync(getPidFilePath(), child.pid.toString());
80
+ fs.closeSync(logStream);
81
+ return child.pid;
82
+ }
83
+ function stopDaemon() {
84
+ const pid = getDaemonPid();
85
+ if (pid === null) {
86
+ return false;
87
+ }
88
+ try {
89
+ process.kill(pid, "SIGTERM");
90
+ let attempts = 0;
91
+ const maxAttempts = 50;
92
+ while (attempts < maxAttempts) {
93
+ try {
94
+ process.kill(pid, 0);
95
+ const waitTime = 100;
96
+ const start = Date.now();
97
+ while (Date.now() - start < waitTime) {
98
+ }
99
+ attempts++;
100
+ } catch {
101
+ break;
102
+ }
103
+ }
104
+ try {
105
+ process.kill(pid, 0);
106
+ process.kill(pid, "SIGKILL");
107
+ } catch {
108
+ }
109
+ const pidFile = getPidFilePath();
110
+ if (fs.existsSync(pidFile)) {
111
+ fs.unlinkSync(pidFile);
112
+ }
113
+ return true;
114
+ } catch (error) {
115
+ throw new Error(`Failed to stop daemon: ${error.message}`);
116
+ }
117
+ }
118
+
119
+ // src/commands/daemon/restart.ts
120
+ var DaemonRestart = class extends Command {
121
+ static description = "Restart daemon";
122
+ static examples = ["<%= config.bin %> <%= command.id %>"];
123
+ async run() {
124
+ if (!isInstalledPackage()) {
125
+ this.log(chalk.red("\u2717 Daemon lifecycle commands only work in production mode."));
126
+ this.log("");
127
+ this.log(chalk.bold("In development, restart the daemon with:"));
128
+ this.log(" 1. " + chalk.cyan("Use Ctrl+C in the daemon terminal"));
129
+ this.log(" 2. " + chalk.cyan("cd apps/agor-daemon && pnpm dev"));
130
+ this.log("");
131
+ this.exit(1);
132
+ }
133
+ const daemonPath = getDaemonPath();
134
+ if (!daemonPath) {
135
+ this.log(chalk.red("\u2717 Daemon binary not found"));
136
+ this.log("");
137
+ this.log("Your installation may be corrupted. Try reinstalling:");
138
+ this.log(" " + chalk.cyan("npm install -g agor-live"));
139
+ this.log("");
140
+ this.exit(1);
141
+ }
142
+ try {
143
+ const stopped = stopDaemon();
144
+ if (stopped) {
145
+ this.log(chalk.green("\u2713 Daemon stopped"));
146
+ }
147
+ await new Promise((resolve) => setTimeout(resolve, 500));
148
+ const pid = startDaemon(daemonPath);
149
+ this.log(chalk.green("\u2713 Daemon restarted successfully"));
150
+ this.log("");
151
+ this.log(` PID: ${chalk.cyan(String(pid))}`);
152
+ this.log("");
153
+ this.log("View logs with:");
154
+ this.log(" " + chalk.cyan("agor daemon logs"));
155
+ this.log("");
156
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
157
+ const daemonUrl = await getDaemonUrl();
158
+ const running = await isDaemonRunning(daemonUrl);
159
+ if (!running) {
160
+ this.log(chalk.yellow("\u26A0 Daemon started but not responding"));
161
+ this.log("");
162
+ this.log("Check logs for errors:");
163
+ this.log(" " + chalk.cyan("agor daemon logs"));
164
+ this.log("");
165
+ }
166
+ } catch (error) {
167
+ this.log(chalk.red("\u2717 Failed to restart daemon"));
168
+ this.log("");
169
+ this.log(`Error: ${error.message}`);
170
+ this.log("");
171
+ this.exit(1);
172
+ }
173
+ }
174
+ };
175
+ export {
176
+ DaemonRestart as default
177
+ };
@@ -0,0 +1,13 @@
1
+ import * as _oclif_core_interfaces from '@oclif/core/interfaces';
2
+ import { Command } from '@oclif/core';
3
+
4
+ declare class DaemonStart extends Command {
5
+ static description: string;
6
+ static examples: string[];
7
+ static flags: {
8
+ foreground: _oclif_core_interfaces.BooleanFlag<boolean>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
12
+
13
+ export { DaemonStart as default };