@bpinhosilva/agent-orchestrator 1.0.0-alpha.32 → 1.0.0-alpha.34

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 (200) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +8 -0
  3. package/dist/agents/implementations/claude.agent.js +0 -12
  4. package/dist/agents/implementations/gemini.agent.js +0 -12
  5. package/dist/cli/commands/index.js +19 -0
  6. package/dist/cli/commands/logs.command.js +92 -0
  7. package/dist/cli/commands/migrate.command.js +109 -0
  8. package/dist/cli/commands/restart.command.js +30 -0
  9. package/dist/cli/commands/run.command.js +97 -0
  10. package/dist/cli/commands/setup.command.js +54 -0
  11. package/dist/cli/commands/status.command.js +23 -0
  12. package/dist/cli/commands/stop.command.js +27 -0
  13. package/dist/cli/constants.js +51 -0
  14. package/dist/cli/env.js +119 -0
  15. package/dist/cli/index.js +19 -821
  16. package/dist/cli/process-manager.js +311 -0
  17. package/dist/cli/setup/admin.js +149 -0
  18. package/dist/cli/setup/index.js +83 -0
  19. package/dist/cli/setup/prompts.js +218 -0
  20. package/dist/cli/setup/validators.js +50 -0
  21. package/dist/cli/types.js +4 -0
  22. package/dist/cli/utils.js +71 -0
  23. package/dist/common/interfaces/artifact.interface.js +2 -0
  24. package/dist/common/storage-path.helper.js +1 -0
  25. package/dist/database/migration-sql.utils.js +7 -2
  26. package/dist/database/migration-state.js +1 -1
  27. package/dist/main.js +7 -0
  28. package/dist/migrations/1775487994565-20260406-AddMissingIndexesAndFKActions.js +134 -0
  29. package/dist/migrations/1775495000000-SetPostgresIdDefaults.js +47 -0
  30. package/dist/migrations/1775698253996-AddArtifactsToRecurrentTaskExecs.js +95 -0
  31. package/dist/projects/projects.service.js +2 -0
  32. package/dist/tasks/comments.service.js +1 -13
  33. package/dist/tasks/entities/comment.entity.js +1 -1
  34. package/dist/tasks/entities/recurrent-task-exec.entity.js +6 -1
  35. package/dist/tasks/recurrent-task-scheduler.service.js +34 -2
  36. package/dist/tasks/recurrent-tasks.controller.js +16 -0
  37. package/dist/tasks/recurrent-tasks.service.js +23 -3
  38. package/dist/ui/assets/AgentFleet-BNgsWY2o.js +1 -0
  39. package/dist/ui/assets/AttachmentItem-QhT0YOmu.js +1 -0
  40. package/dist/ui/assets/{ConfirmDialog-BaFe6hWm.js → ConfirmDialog-CIfNuBst.js} +1 -1
  41. package/dist/ui/assets/CreateRecurrentTaskModal-k4iA_ECJ.js +1 -0
  42. package/dist/ui/assets/MarkdownField-DJ12Ejut.js +1 -0
  43. package/dist/ui/assets/{Profile-Dy_gmcSy.js → Profile-CPwg7w-x.js} +1 -1
  44. package/dist/ui/assets/ProjectDetail-bkd8jRYr.js +1 -0
  45. package/dist/ui/assets/Providers-CsLkW8rv.js +1 -0
  46. package/dist/ui/assets/Scheduler-DJ4e83Kr.js +1 -0
  47. package/dist/ui/assets/{Settings-C_xisf8p.js → Settings-Dd6mlxMN.js} +1 -1
  48. package/dist/ui/assets/TaskDetail-DKuMLlM2.js +1 -0
  49. package/dist/ui/assets/TaskExecutions-BeeSmLar.js +1 -0
  50. package/dist/ui/assets/TaskManager-DD3ABMx5.js +8 -0
  51. package/dist/ui/assets/{UserDetail-CYkZ1V6I.js → UserDetail-D3EMlcu7.js} +1 -1
  52. package/dist/ui/assets/{Users-S2ODYJFx.js → Users-BmHfRaGc.js} +1 -1
  53. package/dist/ui/assets/{trending-up-Bh_TRzth.js → database-DC2jO6Si.js} +1 -1
  54. package/dist/ui/assets/index-uV1e3LjR.css +2 -0
  55. package/dist/ui/assets/{index-BImV2VVd.js → index-wA5sKdfn.js} +3 -3
  56. package/dist/ui/assets/paperclip-6x5JJ7A7.js +1 -0
  57. package/dist/ui/assets/{taskFormSchemas--j-EqGsF.js → taskFormSchemas-CKu2m51r.js} +1 -1
  58. package/dist/ui/assets/trending-up-VOBRPers.js +1 -0
  59. package/dist/ui/index.html +3 -3
  60. package/dist/uploads/parse-filepath.pipe.js +3 -3
  61. package/dist/uploads/uploads.controller.js +16 -7
  62. package/dist/uploads/uploads.module.js +2 -0
  63. package/package.json +12 -2
  64. package/dist/agents/agent-emoji.constants.d.ts +0 -5
  65. package/dist/agents/agents.controller.d.ts +0 -16
  66. package/dist/agents/agents.module.d.ts +0 -2
  67. package/dist/agents/agents.service.d.ts +0 -23
  68. package/dist/agents/default-provider-models.d.ts +0 -11
  69. package/dist/agents/dto/agent-attributes.dto.d.ts +0 -14
  70. package/dist/agents/dto/agent-request.dto.d.ts +0 -4
  71. package/dist/agents/dto/create-agent.dto.d.ts +0 -13
  72. package/dist/agents/dto/update-agent.dto.d.ts +0 -5
  73. package/dist/agents/entities/agent.entity.d.ts +0 -18
  74. package/dist/agents/enums/provider.enum.d.ts +0 -4
  75. package/dist/agents/implementations/claude.agent.d.ts +0 -28
  76. package/dist/agents/implementations/gemini.agent.d.ts +0 -31
  77. package/dist/agents/interfaces/agent.interface.d.ts +0 -16
  78. package/dist/agents/personality.util.d.ts +0 -8
  79. package/dist/agents/registry/agent.registry.d.ts +0 -5
  80. package/dist/app.controller.d.ts +0 -9
  81. package/dist/app.module.d.ts +0 -2
  82. package/dist/app.service.d.ts +0 -6
  83. package/dist/auth/auth.controller.d.ts +0 -24
  84. package/dist/auth/auth.module.d.ts +0 -2
  85. package/dist/auth/auth.service.d.ts +0 -41
  86. package/dist/auth/decorators/current-user.decorator.d.ts +0 -1
  87. package/dist/auth/decorators/public.decorator.d.ts +0 -2
  88. package/dist/auth/decorators/roles.decorator.d.ts +0 -3
  89. package/dist/auth/dto/login.dto.d.ts +0 -4
  90. package/dist/auth/dto/register.dto.d.ts +0 -8
  91. package/dist/auth/dto/update-profile.dto.d.ts +0 -9
  92. package/dist/auth/entities/refresh-token.entity.d.ts +0 -12
  93. package/dist/auth/guards/jwt-auth.guard.d.ts +0 -9
  94. package/dist/auth/guards/roles.guard.d.ts +0 -7
  95. package/dist/auth/strategies/jwt.strategy.d.ts +0 -17
  96. package/dist/cli/index.d.ts +0 -26
  97. package/dist/common/common.module.d.ts +0 -2
  98. package/dist/common/entities/artifact.entity.d.ts +0 -7
  99. package/dist/common/entities/artifact.entity.js +0 -48
  100. package/dist/common/filesystem-storage.service.d.ts +0 -17
  101. package/dist/common/filters/http-exception.filter.d.ts +0 -4
  102. package/dist/common/storage-path.helper.d.ts +0 -21
  103. package/dist/common/storage.service.d.ts +0 -7
  104. package/dist/config/env.validation.d.ts +0 -2
  105. package/dist/config/port.defaults.d.ts +0 -3
  106. package/dist/config/runtime-paths.d.ts +0 -6
  107. package/dist/config/typeorm.d.ts +0 -9
  108. package/dist/database/migration-sql.utils.d.ts +0 -2
  109. package/dist/database/migration-state.d.ts +0 -10
  110. package/dist/main.d.ts +0 -1
  111. package/dist/migrations/1775266979821-InitialSchema.d.ts +0 -7
  112. package/dist/migrations/1775268200000-SeedDefaultProvidersAndModels.d.ts +0 -8
  113. package/dist/migrations/1775269500000-BackfillDefaultModelProviderIds.d.ts +0 -9
  114. package/dist/migrations/1775271000000-AddAgentEmoji.d.ts +0 -6
  115. package/dist/migrations/1775272000000-CreateSystemSettings.d.ts +0 -5
  116. package/dist/migrations/1775290000000-AddAgentAttributes.d.ts +0 -6
  117. package/dist/models/dto/create-model.dto.d.ts +0 -4
  118. package/dist/models/dto/update-model.dto.d.ts +0 -5
  119. package/dist/models/entities/model.entity.d.ts +0 -10
  120. package/dist/models/models.controller.d.ts +0 -13
  121. package/dist/models/models.module.d.ts +0 -2
  122. package/dist/models/models.service.d.ts +0 -14
  123. package/dist/projects/dto/add-member.dto.d.ts +0 -5
  124. package/dist/projects/dto/create-project.dto.d.ts +0 -7
  125. package/dist/projects/dto/update-project.dto.d.ts +0 -6
  126. package/dist/projects/entities/project-member.entity.d.ts +0 -13
  127. package/dist/projects/entities/project.entity.d.ts +0 -19
  128. package/dist/projects/projects.controller.d.ts +0 -17
  129. package/dist/projects/projects.module.d.ts +0 -2
  130. package/dist/projects/projects.service.d.ts +0 -22
  131. package/dist/providers/dto/create-provider.dto.d.ts +0 -4
  132. package/dist/providers/dto/update-provider.dto.d.ts +0 -5
  133. package/dist/providers/entities/provider.entity.d.ts +0 -9
  134. package/dist/providers/providers.controller.d.ts +0 -13
  135. package/dist/providers/providers.module.d.ts +0 -2
  136. package/dist/providers/providers.service.d.ts +0 -14
  137. package/dist/system-settings/dto/update-system-settings.dto.d.ts +0 -16
  138. package/dist/system-settings/entities/system-settings.entity.d.ts +0 -17
  139. package/dist/system-settings/system-settings.controller.d.ts +0 -8
  140. package/dist/system-settings/system-settings.module.d.ts +0 -2
  141. package/dist/system-settings/system-settings.service.d.ts +0 -10
  142. package/dist/tasks/comments.controller.d.ts +0 -18
  143. package/dist/tasks/comments.service.d.ts +0 -22
  144. package/dist/tasks/dto/create-comment.dto.d.ts +0 -7
  145. package/dist/tasks/dto/create-recurrent-task.dto.d.ts +0 -10
  146. package/dist/tasks/dto/create-task.dto.d.ts +0 -9
  147. package/dist/tasks/dto/update-comment.dto.d.ts +0 -3
  148. package/dist/tasks/dto/update-recurrent-task.dto.d.ts +0 -5
  149. package/dist/tasks/dto/update-task.dto.d.ts +0 -5
  150. package/dist/tasks/entities/comment.entity.d.ts +0 -23
  151. package/dist/tasks/entities/recurrent-task-exec.entity.d.ts +0 -16
  152. package/dist/tasks/entities/recurrent-task.entity.d.ts +0 -22
  153. package/dist/tasks/entities/task.entity.d.ts +0 -31
  154. package/dist/tasks/recurrent-task-scheduler.service.d.ts +0 -27
  155. package/dist/tasks/recurrent-tasks.controller.d.ts +0 -15
  156. package/dist/tasks/recurrent-tasks.service.d.ts +0 -16
  157. package/dist/tasks/task-scheduler.service.d.ts +0 -35
  158. package/dist/tasks/tasks.controller.d.ts +0 -27
  159. package/dist/tasks/tasks.module.d.ts +0 -2
  160. package/dist/tasks/tasks.service.d.ts +0 -34
  161. package/dist/ui/assets/AgentFleet-B9ZQHHad.js +0 -1
  162. package/dist/ui/assets/MarkdownField-Cth9aFTE.js +0 -1
  163. package/dist/ui/assets/ProjectDetail-CE4h0Hhe.js +0 -1
  164. package/dist/ui/assets/Providers-CJkMiYXs.js +0 -1
  165. package/dist/ui/assets/Scheduler-CsrAlyah.js +0 -1
  166. package/dist/ui/assets/TaskDetail-BQ7gWS-A.js +0 -1
  167. package/dist/ui/assets/TaskManager-DSC1aVcJ.js +0 -8
  168. package/dist/ui/assets/index-C2UQMCHQ.css +0 -2
  169. package/dist/ui/assets/sparkles-BYfDbPNH.js +0 -1
  170. package/dist/uploads/parse-filepath.pipe.d.ts +0 -5
  171. package/dist/uploads/uploads.controller.d.ts +0 -13
  172. package/dist/uploads/uploads.module.d.ts +0 -2
  173. package/dist/users/avatar.constants.d.ts +0 -11
  174. package/dist/users/dto/create-user.dto.d.ts +0 -8
  175. package/dist/users/dto/list-users-query.dto.d.ts +0 -5
  176. package/dist/users/dto/update-user.dto.d.ts +0 -7
  177. package/dist/users/entities/user.entity.d.ts +0 -15
  178. package/dist/users/users.controller.d.ts +0 -16
  179. package/dist/users/users.module.d.ts +0 -2
  180. package/dist/users/users.service.d.ts +0 -23
  181. /package/dist/ui/assets/{cn-CA_aDFCn.js → cn-DqKDUEQs.js} +0 -0
  182. /package/dist/ui/assets/{eye-FxxhkvZm.js → eye-CSLoB6-a.js} +0 -0
  183. /package/dist/ui/assets/{file-text-BIOLTys3.js → file-text-CRyDRJx0.js} +0 -0
  184. /package/dist/ui/assets/{layers-B8HRXy0p.js → layers-CpiP5U5p.js} +0 -0
  185. /package/dist/ui/assets/{loader-circle-DlEV81d2.js → loader-circle-DbVXtlbV.js} +0 -0
  186. /package/dist/ui/assets/{refresh-cw-DDDq6wp6.js → refresh-cw-BGkg-lCf.js} +0 -0
  187. /package/dist/ui/assets/{rocket-Cc0CU430.js → rocket-DzN1Mizs.js} +0 -0
  188. /package/dist/ui/assets/{save-BzJ6U33U.js → save-zLR2Bpx5.js} +0 -0
  189. /package/dist/ui/assets/{search-BgZtnvG9.js → search-FGpO3s2Z.js} +0 -0
  190. /package/dist/ui/assets/{send-u-K1dVSf.js → send-DHRDZ09J.js} +0 -0
  191. /package/dist/ui/assets/{shield-alert-BMQRu-dz.js → shield-alert-DwOWpTph.js} +0 -0
  192. /package/dist/ui/assets/{shield-check-CbBQS6Ds.js → shield-check-5104WjFF.js} +0 -0
  193. /package/dist/ui/assets/{tasks-De5SRWOL.js → tasks-RLY66Qjl.js} +0 -0
  194. /package/dist/ui/assets/{trash-2-DdCnfswe.js → trash-2-BlARVDmE.js} +0 -0
  195. /package/dist/ui/assets/{user-D04GkTX2.js → user-CCOu6zJa.js} +0 -0
  196. /package/dist/ui/assets/{user-plus-QYoMM0_m.js → user-plus-CiJgTJ8j.js} +0 -0
  197. /package/dist/ui/assets/{users-C1voiRNF.js → users-BVNMRlU5.js} +0 -0
  198. /package/dist/ui/assets/{vendor-forms-8omdf67B.js → vendor-forms-Cl5GroiL.js} +0 -0
  199. /package/dist/ui/assets/{vendor-motion-g6T1ev3V.js → vendor-motion-B6xhOm18.js} +0 -0
  200. /package/dist/ui/assets/{zap-DAeeT5Rj.js → zap-kFzU0aZV.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ # [1.0.0-alpha.34](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.33...v1.0.0-alpha.34) (2026-04-09)
2
+
3
+
4
+ ### Features
5
+
6
+ * enhance file path validation and logging in uploads, add ExecLogModal component ([2d9ca31](https://github.com/bpinhosilva/agent-orchestrator/commit/2d9ca31fd67924958f417d113ec974252858782d))
7
+ * **migrations:** add migration to set default UUIDs for ID columns ([ea9289b](https://github.com/bpinhosilva/agent-orchestrator/commit/ea9289b8623d244737dfb7340a58637c8967edf8))
8
+ * refactor task and comment entities to use Artifact interface for artifacts ([806fde7](https://github.com/bpinhosilva/agent-orchestrator/commit/806fde736b734de0cb3cb9a7a05c5c3eb2d7f171))
9
+ * **ui:** integrate MarkdownField for task description input and enhance TaskExecutions ([d4b91e8](https://github.com/bpinhosilva/agent-orchestrator/commit/d4b91e8b9c392f77a2cab3c0a5bcc641110bced2))
10
+
11
+ # [1.0.0-alpha.33](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.32...v1.0.0-alpha.33) (2026-04-06)
12
+
13
+
14
+ ### Features
15
+
16
+ * **cli:** refactor project, split into multiple components ([f18903b](https://github.com/bpinhosilva/agent-orchestrator/commit/f18903be0b1b09a1e651918d081d96267bfe2bc6))
17
+
1
18
  # [1.0.0-alpha.32](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.31...v1.0.0-alpha.32) (2026-04-06)
2
19
 
3
20
 
package/README.md CHANGED
@@ -12,6 +12,10 @@
12
12
  <a href="https://socket.dev/npm/package/@bpinhosilva/agent-orchestrator"><img src="https://socket.dev/api/badge/npm/package/@bpinhosilva/agent-orchestrator" alt="Socket Badge" /></a>
13
13
  </p>
14
14
 
15
+ <p align="center">
16
+ <a href="docs/i18n/pt-br/README.md">🇧🇷 Português (Brasil)</a>
17
+ </p>
18
+
15
19
  Agent Orchestrator is an open-source platform for managing AI agents, tasks, and project-scoped automation across multiple model providers. It combines a NestJS API, a React dashboard, a packaged CLI/runtime, and Docker deployment options for both local use and production-style environments.
16
20
 
17
21
  ## Current capabilities
@@ -63,6 +67,7 @@ Choose the path that matches how you want to use the project:
63
67
  npm install -g @bpinhosilva/agent-orchestrator
64
68
  agent-orchestrator setup
65
69
  agent-orchestrator run
70
+ agent-orchestrator restart
66
71
  agent-orchestrator status
67
72
  ```
68
73
 
@@ -100,6 +105,7 @@ Example `.env`:
100
105
  ```bash
101
106
  # Required
102
107
  JWT_SECRET="replace-with-a-secret-at-least-32-characters-long"
108
+ JWT_REFRESH_SECRET="replace-with-another-secret-at-least-32-characters-long"
103
109
 
104
110
  # Provider keys (optional until you want to execute agents)
105
111
  GEMINI_API_KEY=""
@@ -176,9 +182,11 @@ npm run start:dev
176
182
  ### Packaged/runtime mode
177
183
 
178
184
  ```bash
185
+ agent-orchestrator setup
179
186
  agent-orchestrator run
180
187
  agent-orchestrator status
181
188
  agent-orchestrator logs --lines 50
189
+ agent-orchestrator restart
182
190
  agent-orchestrator stop
183
191
  ```
184
192
 
@@ -131,18 +131,6 @@ let ClaudeAgent = ClaudeAgent_1 = class ClaudeAgent {
131
131
  void feature;
132
132
  return false;
133
133
  }
134
- async performTask(task, project) {
135
- this.logger.debug(`Performing task: ${task.title} for project: ${project.title}`);
136
- const prompt = `
137
- Task: ${task.title}
138
- Description: ${task.description}
139
- Project: ${project.title}
140
- Project Description: ${project.description}
141
-
142
- Please perform the task and provide the output.
143
- `;
144
- return this.processText(prompt);
145
- }
146
134
  };
147
135
  exports.ClaudeAgent = ClaudeAgent;
148
136
  exports.ClaudeAgent = ClaudeAgent = ClaudeAgent_1 = __decorate([
@@ -177,18 +177,6 @@ let GeminiAgent = GeminiAgent_1 = class GeminiAgent {
177
177
  const hasExcludedSuffix = excludedSuffixes.some((s) => modelName.includes(s));
178
178
  return hasSupportedPrefix && !hasExcludedSuffix;
179
179
  }
180
- async performTask(task, project) {
181
- this.logger.debug(`Performing task: ${task.title} for project: ${project.title}`);
182
- const prompt = `
183
- Task: ${task.title}
184
- Description: ${task.description}
185
- Project: ${project.title}
186
- Project Description: ${project.description}
187
-
188
- Please perform the task and provide the output.
189
- `;
190
- return this.processText(prompt);
191
- }
192
180
  };
193
181
  exports.GeminiAgent = GeminiAgent;
194
182
  exports.GeminiAgent = GeminiAgent = GeminiAgent_1 = __decorate([
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerAllCommands = registerAllCommands;
4
+ const setup_command_1 = require("./setup.command");
5
+ const run_command_1 = require("./run.command");
6
+ const stop_command_1 = require("./stop.command");
7
+ const status_command_1 = require("./status.command");
8
+ const logs_command_1 = require("./logs.command");
9
+ const migrate_command_1 = require("./migrate.command");
10
+ const restart_command_1 = require("./restart.command");
11
+ function registerAllCommands(program) {
12
+ (0, setup_command_1.registerSetupCommand)(program);
13
+ (0, run_command_1.registerRunCommand)(program);
14
+ (0, stop_command_1.registerStopCommand)(program);
15
+ (0, restart_command_1.registerRestartCommand)(program);
16
+ (0, status_command_1.registerStatusCommand)(program);
17
+ (0, logs_command_1.registerLogsCommand)(program);
18
+ (0, migrate_command_1.registerMigrateCommand)(program);
19
+ }
@@ -0,0 +1,92 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.registerLogsCommand = registerLogsCommand;
37
+ const fs = __importStar(require("fs"));
38
+ const utils_1 = require("../utils");
39
+ const constants_1 = require("../constants");
40
+ function registerLogsCommand(program) {
41
+ program
42
+ .command('logs')
43
+ .description('Print the most recent orchestrator log lines')
44
+ .option('-n, --lines <count>', 'Number of log lines to print', '50')
45
+ .option('-f, --follow', 'Follow log output (like tail -f)', false)
46
+ .action((...args) => {
47
+ const opts = (0, utils_1.resolveActionOptions)(args);
48
+ try {
49
+ if (!fs.existsSync(constants_1.LOG_FILE)) {
50
+ console.log(`No log file found at ${constants_1.LOG_FILE}.`);
51
+ return;
52
+ }
53
+ const lineCount = Number(opts.lines || '50');
54
+ if (!Number.isInteger(lineCount) || lineCount < 1) {
55
+ throw new Error('The --lines option must be a positive integer.');
56
+ }
57
+ const content = fs.readFileSync(constants_1.LOG_FILE, 'utf8');
58
+ const output = (0, utils_1.tailLogLines)(content, lineCount);
59
+ if (output) {
60
+ console.log(output);
61
+ }
62
+ else if (!opts.follow) {
63
+ console.log('Log file is empty.');
64
+ }
65
+ if (opts.follow) {
66
+ let position = fs.statSync(constants_1.LOG_FILE).size;
67
+ fs.watchFile(constants_1.LOG_FILE, { interval: 200 }, () => {
68
+ try {
69
+ const stat = fs.statSync(constants_1.LOG_FILE);
70
+ if (stat.size > position) {
71
+ const length = stat.size - position;
72
+ const buffer = Buffer.alloc(length);
73
+ const fd = fs.openSync(constants_1.LOG_FILE, 'r');
74
+ fs.readSync(fd, buffer, 0, length, position);
75
+ fs.closeSync(fd);
76
+ position = stat.size;
77
+ process.stdout.write(buffer.toString('utf8'));
78
+ }
79
+ }
80
+ catch {
81
+ // log file may have been rotated; ignore
82
+ }
83
+ });
84
+ }
85
+ }
86
+ catch (err) {
87
+ const errorMessage = err instanceof Error ? err.message : String(err);
88
+ console.error(`Failed to read logs: ${errorMessage}`);
89
+ process.exit(1);
90
+ }
91
+ });
92
+ }
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.registerMigrateCommand = registerMigrateCommand;
37
+ const utils_1 = require("../utils");
38
+ const migration_state_1 = require("../../database/migration-state");
39
+ async function confirmAction(message, autoConfirm = false) {
40
+ if (autoConfirm) {
41
+ return true;
42
+ }
43
+ const enquirer = await Promise.resolve().then(() => __importStar(require('enquirer')));
44
+ const { confirmed } = await enquirer.prompt({
45
+ type: 'confirm',
46
+ name: 'confirmed',
47
+ message,
48
+ initial: false,
49
+ });
50
+ return confirmed;
51
+ }
52
+ async function promptForEnter(message, autoConfirm = false) {
53
+ if (autoConfirm) {
54
+ return;
55
+ }
56
+ const enquirer = await Promise.resolve().then(() => __importStar(require('enquirer')));
57
+ await enquirer.prompt({
58
+ type: 'input',
59
+ name: 'continue',
60
+ message,
61
+ });
62
+ }
63
+ function registerMigrateCommand(program) {
64
+ program
65
+ .command('migrate')
66
+ .description('Run pending database migrations')
67
+ .option('-f, --force', 'Force re-initialization (DROP ALL DATA)')
68
+ .option('-y, --yes', 'Disable confirmation prompts')
69
+ .action(async (...args) => {
70
+ const opts = (0, utils_1.resolveActionOptions)(args);
71
+ try {
72
+ if (opts.force) {
73
+ const confirmForce = await confirmAction('Are you absolutely sure you want to DROP ALL DATA and re-initialize?', opts.yes);
74
+ if (confirmForce) {
75
+ await promptForEnter('Press Enter to confirm and start the destructive initialization...', opts.yes);
76
+ await (0, migration_state_1.runMigrations)(true);
77
+ }
78
+ else {
79
+ console.log('Force migration cancelled.');
80
+ }
81
+ return;
82
+ }
83
+ const { hasPending, isEmpty } = await (0, migration_state_1.checkPendingMigrations)({
84
+ assumePendingOnError: true,
85
+ });
86
+ if (isEmpty) {
87
+ console.log('Database is empty. Initializing...');
88
+ await (0, migration_state_1.runMigrations)();
89
+ return;
90
+ }
91
+ if (!hasPending) {
92
+ console.log('Database is already up to date.');
93
+ return;
94
+ }
95
+ const confirmMigration = await confirmAction('Pending migrations detected. Do you want to run them?', opts.yes);
96
+ if (confirmMigration) {
97
+ await (0, migration_state_1.runMigrations)();
98
+ }
99
+ else {
100
+ console.log('Migration cancelled.');
101
+ }
102
+ }
103
+ catch (err) {
104
+ const errorMessage = err instanceof Error ? err.message : String(err);
105
+ console.error(`Migration failed: ${errorMessage}`);
106
+ process.exit(1);
107
+ }
108
+ });
109
+ }
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerRestartCommand = registerRestartCommand;
4
+ const commander_1 = require("commander");
5
+ const process_manager_1 = require("../process-manager");
6
+ const run_command_1 = require("./run.command");
7
+ const stop_command_1 = require("./stop.command");
8
+ function registerRestartCommand(program) {
9
+ program
10
+ .command('restart')
11
+ .description('Restart the orchestrator server (smart: stop if running, then start)')
12
+ .action(async () => {
13
+ const running = (0, process_manager_1.findManagedProcess)(); // TODO: pass default args if needed
14
+ if (running) {
15
+ // Stop if running
16
+ await new Promise((resolve) => {
17
+ const stopProgram = new commander_1.Command();
18
+ (0, stop_command_1.registerStopCommand)(stopProgram);
19
+ stopProgram.exitOverride();
20
+ stopProgram.parse(['node', 'cli', 'stop'], { from: 'user' });
21
+ setTimeout(resolve, 2000); // Wait for stop
22
+ });
23
+ }
24
+ // Start
25
+ const runProgram = new commander_1.Command();
26
+ (0, run_command_1.registerRunCommand)(runProgram);
27
+ runProgram.exitOverride();
28
+ runProgram.parse(['node', 'cli', 'run'], { from: 'user' });
29
+ });
30
+ }
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.registerRunCommand = registerRunCommand;
37
+ const fs = __importStar(require("fs"));
38
+ const child_process_1 = require("child_process");
39
+ const process_manager_1 = require("../process-manager");
40
+ const env_1 = require("../env");
41
+ const constants_1 = require("../constants");
42
+ function getConfiguredPort() {
43
+ const env = (0, env_1.readEnvFile)(constants_1.ENV_PATH);
44
+ return env.PORT || '15789';
45
+ }
46
+ function registerRunCommand(program) {
47
+ program
48
+ .command('run')
49
+ .description('Start the orchestrator server in detached mode')
50
+ .action(() => {
51
+ try {
52
+ (0, process_manager_1.assertBuildExists)();
53
+ const existingProcess = (0, process_manager_1.findManagedProcess)(); // TODO: pass default args if needed
54
+ if (existingProcess) {
55
+ console.log(`Orchestrator is already running.\n${(0, process_manager_1.formatProcessSummary)(existingProcess)}`);
56
+ return;
57
+ }
58
+ console.log('Starting Agent Orchestrator in background...');
59
+ if (!fs.existsSync(constants_1.PID_DIR)) {
60
+ fs.mkdirSync(constants_1.PID_DIR, { recursive: true, mode: 0o700 });
61
+ }
62
+ const logStream = fs.openSync(constants_1.LOG_FILE, 'a');
63
+ const child = (0, child_process_1.spawn)('node', [constants_1.MAIN_FILE], {
64
+ detached: true,
65
+ stdio: ['ignore', logStream, logStream],
66
+ cwd: constants_1.PACKAGE_ROOT,
67
+ env: (0, process_manager_1.getChildEnvironment)(),
68
+ });
69
+ const pid = child.pid;
70
+ if (!pid) {
71
+ throw new Error('Failed to determine spawned process PID.');
72
+ }
73
+ const port = getConfiguredPort();
74
+ (0, process_manager_1.persistProcessMetadata)({
75
+ pid,
76
+ cwd: constants_1.PACKAGE_ROOT,
77
+ mainPath: constants_1.MAIN_FILE,
78
+ port,
79
+ logFile: constants_1.LOG_FILE,
80
+ startedAt: new Date().toISOString(),
81
+ });
82
+ child.unref();
83
+ console.log(`Orchestrator started in background.\n${(0, process_manager_1.formatProcessSummary)({
84
+ pid,
85
+ source: 'metadata',
86
+ cwd: constants_1.PACKAGE_ROOT,
87
+ mainPath: constants_1.MAIN_FILE,
88
+ port,
89
+ })}`);
90
+ }
91
+ catch (err) {
92
+ const errorMessage = err instanceof Error ? err.message : String(err);
93
+ console.error(`Failed to start orchestrator: ${errorMessage}`);
94
+ process.exit(1);
95
+ }
96
+ });
97
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerSetupCommand = registerSetupCommand;
4
+ const utils_1 = require("../utils");
5
+ const index_1 = require("../setup/index");
6
+ const migration_state_1 = require("../../database/migration-state");
7
+ function registerSetupCommand(program) {
8
+ program
9
+ .command('setup')
10
+ .description('Create or update the local CLI runtime configuration')
11
+ .option('--port <port>', 'Server port for the orchestrator runtime')
12
+ .option('--db-type <type>', 'Database type: sqlite or postgres')
13
+ .option('--database-url <url>', 'PostgreSQL connection string')
14
+ .option('--db-logging', 'Enable database query logging')
15
+ .option('--provider <provider>', 'Configure a provider (gemini, anthropic)', (value, previous = []) => previous.concat(value
16
+ .split(',')
17
+ .map((item) => item.trim().toLowerCase())
18
+ .filter(Boolean)), [])
19
+ .option('--gemini-key <key>', 'Google Gemini API key')
20
+ .option('--anthropic-key <key>', 'Anthropic Claude API key')
21
+ .option('-y, --yes', 'Disable prompts and use supplied flags/defaults')
22
+ .option('--skip-admin-setup', 'Skip creating or updating the admin user')
23
+ .option('--admin-name <name>', 'Admin user name for non-interactive setup')
24
+ .option('--admin-email <email>', 'Admin user email for non-interactive setup')
25
+ .option('--admin-password <password>', 'Admin user password for non-interactive setup')
26
+ .option('--regenerate-jwt-secret', 'Generate a new JWT secret instead of preserving the existing one')
27
+ .action(async (...args) => {
28
+ const opts = (0, utils_1.resolveActionOptions)(args);
29
+ console.log('Starting setup...');
30
+ try {
31
+ await (0, index_1.handleSetup)(opts);
32
+ if (opts.yes) {
33
+ const { hasPending, isEmpty } = await (0, migration_state_1.checkPendingMigrations)({
34
+ assumePendingOnError: true,
35
+ });
36
+ if (isEmpty) {
37
+ console.log('Database is empty. Initializing...');
38
+ await (0, migration_state_1.runMigrations)();
39
+ }
40
+ else if (hasPending) {
41
+ await (0, migration_state_1.runMigrations)();
42
+ }
43
+ else {
44
+ console.log('Database is already up to date.');
45
+ }
46
+ }
47
+ }
48
+ catch (err) {
49
+ const errorMessage = err instanceof Error ? err.message : String(err);
50
+ console.error(`Setup failed: ${errorMessage}`);
51
+ process.exit(1);
52
+ }
53
+ });
54
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerStatusCommand = registerStatusCommand;
4
+ const process_manager_1 = require("../process-manager");
5
+ function registerStatusCommand(program) {
6
+ program
7
+ .command('status')
8
+ .description('Show the currently running orchestrator process, if any')
9
+ .action(() => {
10
+ try {
11
+ const runningProcess = (0, process_manager_1.findManagedProcess)(); // TODO: pass default args if needed
12
+ if (!runningProcess) {
13
+ console.log('Orchestrator is not running.');
14
+ return;
15
+ }
16
+ console.log(`Orchestrator is running.\n${(0, process_manager_1.formatProcessSummary)(runningProcess)}`);
17
+ }
18
+ catch (err) {
19
+ const errorMessage = err instanceof Error ? err.message : String(err);
20
+ console.error(`Failed to inspect orchestrator status: ${errorMessage}`);
21
+ }
22
+ });
23
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.registerStopCommand = registerStopCommand;
4
+ const process_manager_1 = require("../process-manager");
5
+ function registerStopCommand(program) {
6
+ program
7
+ .command('stop')
8
+ .description('Stop the orchestrator server after verifying the running process identity')
9
+ .action(() => {
10
+ try {
11
+ const runningProcess = (0, process_manager_1.findManagedProcess)(); // TODO: pass default args if needed
12
+ if (!runningProcess) {
13
+ console.log('Orchestrator is not running.');
14
+ return;
15
+ }
16
+ console.log(`Stopping Orchestrator after verifying the exact process in ${runningProcess.cwd} (PID: ${runningProcess.pid})...`);
17
+ process.kill(runningProcess.pid, 'SIGTERM');
18
+ (0, process_manager_1.removeRuntimeState)();
19
+ console.log('Orchestrator stop signal sent.');
20
+ }
21
+ catch (err) {
22
+ const errorMessage = err instanceof Error ? err.message : String(err);
23
+ console.error(`Failed to stop orchestrator: ${errorMessage}`);
24
+ process.exit(1);
25
+ }
26
+ });
27
+ }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.PROCESS_FILE = exports.ENV_PATH = exports.LOG_FILE = exports.PID_FILE = exports.PID_DIR = exports.UI_INDEX_FILE = exports.MAIN_FILE = exports.PACKAGE_JSON_PATH = exports.PACKAGE_ROOT = exports.SUPPORTED_PROVIDERS = void 0;
37
+ const os = __importStar(require("os"));
38
+ const path = __importStar(require("path"));
39
+ var types_1 = require("./types");
40
+ Object.defineProperty(exports, "SUPPORTED_PROVIDERS", { enumerable: true, get: function () { return types_1.SUPPORTED_PROVIDERS; } });
41
+ exports.PACKAGE_ROOT = path.resolve(__dirname, '..', '..');
42
+ exports.PACKAGE_JSON_PATH = path.join(exports.PACKAGE_ROOT, 'package.json');
43
+ exports.MAIN_FILE = path.join(exports.PACKAGE_ROOT, 'dist/main.js');
44
+ exports.UI_INDEX_FILE = path.join(exports.PACKAGE_ROOT, 'dist/ui/index.html');
45
+ // These are set at process start before any imports, so the env var is always present
46
+ exports.PID_DIR = process.env.AGENT_ORCHESTRATOR_HOME ??
47
+ path.join(os.homedir(), '.agent-orchestrator');
48
+ exports.PID_FILE = path.join(exports.PID_DIR, 'pid');
49
+ exports.LOG_FILE = path.join(exports.PID_DIR, 'server.log');
50
+ exports.ENV_PATH = path.join(exports.PID_DIR, '.env');
51
+ exports.PROCESS_FILE = path.join(exports.PID_DIR, 'process.json');