@bpinhosilva/agent-orchestrator 1.0.0-alpha.26 → 1.0.0-alpha.28

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 (121) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +170 -279
  3. package/dist/cli/index.js +4 -1
  4. package/dist/config/env.validation.js +1 -1
  5. package/dist/config/port.defaults.d.ts +3 -0
  6. package/dist/config/port.defaults.js +9 -0
  7. package/dist/config/typeorm.d.ts +3 -0
  8. package/dist/config/typeorm.js +24 -6
  9. package/dist/database/migration-state.js +16 -6
  10. package/dist/main.js +3 -2
  11. package/dist/migrations/{1775260737095-BaselineSchema.d.ts → 1775266979821-InitialSchema.d.ts} +1 -1
  12. package/dist/migrations/{1775260737095-BaselineSchema.js → 1775266979821-InitialSchema.js} +20 -20
  13. package/dist/ui/assets/{AgentFleet-kJ8qz6Wt.js → AgentFleet-2bUM5tS8.js} +1 -1
  14. package/dist/ui/assets/{ConfirmDialog-Djtf7EW0.js → ConfirmDialog-C1bkNgZT.js} +1 -1
  15. package/dist/ui/assets/{Profile-CVJxC_iQ.js → Profile-GA-ikEkL.js} +1 -1
  16. package/dist/ui/assets/{ProjectDetail-sdHv2RVb.js → ProjectDetail-U4T3kwT6.js} +1 -1
  17. package/dist/ui/assets/{Providers-mv6Ki6Ja.js → Providers-Dr8fFIru.js} +1 -1
  18. package/dist/ui/assets/{Scheduler-DrqCsl1E.js → Scheduler-D1seGplm.js} +1 -1
  19. package/dist/ui/assets/{TaskDetail-Dl2jSnCq.js → TaskDetail-CEKuDv4W.js} +1 -1
  20. package/dist/ui/assets/{TaskManager-CVxOPuXy.js → TaskManager-vYV5vdM4.js} +1 -1
  21. package/dist/ui/assets/{index-B9Ws7qcW.js → index-CVlXsOAm.js} +2 -2
  22. package/dist/ui/assets/index-CoqfjJsB.css +2 -0
  23. package/dist/ui/index.html +2 -2
  24. package/package.json +10 -7
  25. package/dist/ui/assets/index-B1cyp9Ue.css +0 -1
  26. package/dist/ui/assets/inter-cyrillic-300-normal-BnqRxXuy.woff2 +0 -0
  27. package/dist/ui/assets/inter-cyrillic-300-normal-LR1W_oT8.woff +0 -0
  28. package/dist/ui/assets/inter-cyrillic-400-normal-HOLc17fK.woff +0 -0
  29. package/dist/ui/assets/inter-cyrillic-400-normal-obahsSVq.woff2 +0 -0
  30. package/dist/ui/assets/inter-cyrillic-500-normal-BasfLYem.woff2 +0 -0
  31. package/dist/ui/assets/inter-cyrillic-500-normal-CxZf_p3X.woff +0 -0
  32. package/dist/ui/assets/inter-cyrillic-600-normal-4D_pXhcN.woff +0 -0
  33. package/dist/ui/assets/inter-cyrillic-600-normal-CWCymEST.woff2 +0 -0
  34. package/dist/ui/assets/inter-cyrillic-ext-300-normal-CgCALhwJ.woff2 +0 -0
  35. package/dist/ui/assets/inter-cyrillic-ext-300-normal-RId2JxDB.woff +0 -0
  36. package/dist/ui/assets/inter-cyrillic-ext-400-normal-BQZuk6qB.woff2 +0 -0
  37. package/dist/ui/assets/inter-cyrillic-ext-400-normal-DQukG94-.woff +0 -0
  38. package/dist/ui/assets/inter-cyrillic-ext-500-normal-B0yAr1jD.woff2 +0 -0
  39. package/dist/ui/assets/inter-cyrillic-ext-500-normal-BmqWE9Dz.woff +0 -0
  40. package/dist/ui/assets/inter-cyrillic-ext-600-normal-Bcila6Z-.woff +0 -0
  41. package/dist/ui/assets/inter-cyrillic-ext-600-normal-Dfes3d0z.woff2 +0 -0
  42. package/dist/ui/assets/inter-greek-300-normal-BrhSP0vQ.woff +0 -0
  43. package/dist/ui/assets/inter-greek-300-normal-DmGD3g_f.woff2 +0 -0
  44. package/dist/ui/assets/inter-greek-400-normal-B4URO6DV.woff2 +0 -0
  45. package/dist/ui/assets/inter-greek-400-normal-q2sYcFCs.woff +0 -0
  46. package/dist/ui/assets/inter-greek-500-normal-BIZE56-Y.woff2 +0 -0
  47. package/dist/ui/assets/inter-greek-500-normal-Xzm54t5V.woff +0 -0
  48. package/dist/ui/assets/inter-greek-600-normal-BZpKdvQh.woff +0 -0
  49. package/dist/ui/assets/inter-greek-600-normal-plRanbMR.woff2 +0 -0
  50. package/dist/ui/assets/inter-greek-ext-300-normal-DLbbeei1.woff +0 -0
  51. package/dist/ui/assets/inter-greek-ext-300-normal-l2DDyC6M.woff2 +0 -0
  52. package/dist/ui/assets/inter-greek-ext-400-normal-DGGRlc-M.woff2 +0 -0
  53. package/dist/ui/assets/inter-greek-ext-400-normal-KugGGMne.woff +0 -0
  54. package/dist/ui/assets/inter-greek-ext-500-normal-2j5mBUwD.woff +0 -0
  55. package/dist/ui/assets/inter-greek-ext-500-normal-C4iEst2y.woff2 +0 -0
  56. package/dist/ui/assets/inter-greek-ext-600-normal-B8X0CLgF.woff +0 -0
  57. package/dist/ui/assets/inter-greek-ext-600-normal-DRtmH8MT.woff2 +0 -0
  58. package/dist/ui/assets/inter-latin-300-normal-BVlfKGgI.woff2 +0 -0
  59. package/dist/ui/assets/inter-latin-300-normal-i8F0SvXL.woff +0 -0
  60. package/dist/ui/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
  61. package/dist/ui/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
  62. package/dist/ui/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
  63. package/dist/ui/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
  64. package/dist/ui/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
  65. package/dist/ui/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
  66. package/dist/ui/assets/inter-latin-ext-300-normal-CPgO9Ksf.woff2 +0 -0
  67. package/dist/ui/assets/inter-latin-ext-300-normal-Dp1L8vcn.woff +0 -0
  68. package/dist/ui/assets/inter-latin-ext-400-normal-77YHD8bZ.woff +0 -0
  69. package/dist/ui/assets/inter-latin-ext-400-normal-C1nco2VV.woff2 +0 -0
  70. package/dist/ui/assets/inter-latin-ext-500-normal-BxGbmqWO.woff +0 -0
  71. package/dist/ui/assets/inter-latin-ext-500-normal-CV4jyFjo.woff2 +0 -0
  72. package/dist/ui/assets/inter-latin-ext-600-normal-CIVaiw4L.woff +0 -0
  73. package/dist/ui/assets/inter-latin-ext-600-normal-D2bJ5OIk.woff2 +0 -0
  74. package/dist/ui/assets/inter-vietnamese-300-normal-Bdr24Bqb.woff2 +0 -0
  75. package/dist/ui/assets/inter-vietnamese-300-normal-DDGmYYdT.woff +0 -0
  76. package/dist/ui/assets/inter-vietnamese-400-normal-Bbgyi5SW.woff +0 -0
  77. package/dist/ui/assets/inter-vietnamese-400-normal-DMkecbls.woff2 +0 -0
  78. package/dist/ui/assets/inter-vietnamese-500-normal-DOriooB6.woff2 +0 -0
  79. package/dist/ui/assets/inter-vietnamese-500-normal-mJboJaSs.woff +0 -0
  80. package/dist/ui/assets/inter-vietnamese-600-normal-BuLX-rYi.woff +0 -0
  81. package/dist/ui/assets/inter-vietnamese-600-normal-Cc8MFFhd.woff2 +0 -0
  82. package/dist/ui/assets/manrope-cyrillic-400-normal-BMzJvInZ.woff2 +0 -0
  83. package/dist/ui/assets/manrope-cyrillic-400-normal-Dvx59UGC.woff +0 -0
  84. package/dist/ui/assets/manrope-cyrillic-600-normal-DvRl3Mj-.woff2 +0 -0
  85. package/dist/ui/assets/manrope-cyrillic-600-normal-It4mZcQk.woff +0 -0
  86. package/dist/ui/assets/manrope-cyrillic-700-normal-7JNVKxyl.woff +0 -0
  87. package/dist/ui/assets/manrope-cyrillic-700-normal-Dw_fZAg2.woff2 +0 -0
  88. package/dist/ui/assets/manrope-cyrillic-800-normal-AvdZ5mAV.woff2 +0 -0
  89. package/dist/ui/assets/manrope-cyrillic-800-normal-BuEMjQU-.woff +0 -0
  90. package/dist/ui/assets/manrope-greek-400-normal-CM4qok81.woff2 +0 -0
  91. package/dist/ui/assets/manrope-greek-400-normal-DuX9RsAR.woff +0 -0
  92. package/dist/ui/assets/manrope-greek-600-normal-BoRV6lzK.woff2 +0 -0
  93. package/dist/ui/assets/manrope-greek-600-normal-CF2i9ZRY.woff +0 -0
  94. package/dist/ui/assets/manrope-greek-700-normal-CHUG9PD8.woff2 +0 -0
  95. package/dist/ui/assets/manrope-greek-700-normal-DyfsrCpP.woff +0 -0
  96. package/dist/ui/assets/manrope-greek-800-normal-Bw-67qu9.woff +0 -0
  97. package/dist/ui/assets/manrope-greek-800-normal-CDvU698_.woff2 +0 -0
  98. package/dist/ui/assets/manrope-latin-400-normal-8tf8FM3T.woff +0 -0
  99. package/dist/ui/assets/manrope-latin-400-normal-PaqtzbVb.woff2 +0 -0
  100. package/dist/ui/assets/manrope-latin-600-normal-4f0koTD-.woff2 +0 -0
  101. package/dist/ui/assets/manrope-latin-600-normal-BqgrALkZ.woff +0 -0
  102. package/dist/ui/assets/manrope-latin-700-normal-BZp_XxE4.woff2 +0 -0
  103. package/dist/ui/assets/manrope-latin-700-normal-DGRFkw-m.woff +0 -0
  104. package/dist/ui/assets/manrope-latin-800-normal-BfWYOv1c.woff2 +0 -0
  105. package/dist/ui/assets/manrope-latin-800-normal-uHUdIJgA.woff +0 -0
  106. package/dist/ui/assets/manrope-latin-ext-400-normal-C-X6QNXX.woff +0 -0
  107. package/dist/ui/assets/manrope-latin-ext-400-normal-CMDvPJRp.woff2 +0 -0
  108. package/dist/ui/assets/manrope-latin-ext-600-normal-_gBojHdJ.woff2 +0 -0
  109. package/dist/ui/assets/manrope-latin-ext-600-normal-u5Pl7hTU.woff +0 -0
  110. package/dist/ui/assets/manrope-latin-ext-700-normal-DYOwVNan.woff2 +0 -0
  111. package/dist/ui/assets/manrope-latin-ext-700-normal-eVCcYqtJ.woff +0 -0
  112. package/dist/ui/assets/manrope-latin-ext-800-normal-BQAQsuQc.woff +0 -0
  113. package/dist/ui/assets/manrope-latin-ext-800-normal-DdFx7KEb.woff2 +0 -0
  114. package/dist/ui/assets/manrope-vietnamese-400-normal-D7E_mLGF.woff +0 -0
  115. package/dist/ui/assets/manrope-vietnamese-400-normal-DHb3EETF.woff2 +0 -0
  116. package/dist/ui/assets/manrope-vietnamese-600-normal-C1J5PCl_.woff2 +0 -0
  117. package/dist/ui/assets/manrope-vietnamese-600-normal-lA7a_7Ok.woff +0 -0
  118. package/dist/ui/assets/manrope-vietnamese-700-normal-CUqMx5-1.woff2 +0 -0
  119. package/dist/ui/assets/manrope-vietnamese-700-normal-pt65Fn2Z.woff +0 -0
  120. package/dist/ui/assets/manrope-vietnamese-800-normal-ClPWri-A.woff2 +0 -0
  121. package/dist/ui/assets/manrope-vietnamese-800-normal-bvg7iBCV.woff +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # [1.0.0-alpha.28](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.27...v1.0.0-alpha.28) (2026-04-04)
2
+
3
+
4
+ ### Features
5
+
6
+ * **migrations:** add initial schema with users, providers, models, agents, projects, tasks ([e08e338](https://github.com/bpinhosilva/agent-orchestrator/commit/e08e3388794e8a556be3584daedd30252a8904fb))
7
+ * **migrations:** db schema ([a0a98b7](https://github.com/bpinhosilva/agent-orchestrator/commit/a0a98b725e09f6d3a9a8fc2305704772195fe2d8))
8
+
9
+ # [1.0.0-alpha.27](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.26...v1.0.0-alpha.27) (2026-04-04)
10
+
11
+
12
+ ### Features
13
+
14
+ * update default port to 15789 for production, enhance migration handling, and refactor env ([e59ba31](https://github.com/bpinhosilva/agent-orchestrator/commit/e59ba3105c5ce7367281bf3ee637bcc3bc124dcc))
15
+ * update mascot image format and adjust display size in README ([6779313](https://github.com/bpinhosilva/agent-orchestrator/commit/6779313a26a6906ecb47a8819789dc8312f3d6fc))
16
+
1
17
  # [1.0.0-alpha.26](https://github.com/bpinhosilva/agent-orchestrator/compare/v1.0.0-alpha.25...v1.0.0-alpha.26) (2026-04-04)
2
18
 
3
19
 
package/README.md CHANGED
@@ -1,387 +1,278 @@
1
1
  # Agent Orchestrator
2
2
 
3
- [![CI](https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/ci.yml/badge.svg)](https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/ci.yml)
4
- [![Release](https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/release.yml/badge.svg)](https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/release.yml)
5
- [![Gitleaks](https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/gitleaks.yml/badge.svg)](https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/gitleaks.yml)
6
- [![Socket Badge](https://socket.dev/api/badge/npm/package/@bpinhosilva/agent-orchestrator)](https://socket.dev/npm/package/@bpinhosilva/agent-orchestrator)
7
-
8
- Agent Orchestrator is an open-source project designed to manage and orchestrate AI agents using both back-end services and front-end applications. It provides an automated agentic execution environment where you can create multiple agent profiles (e.g., Head Agent, Researcher, CMO) and delegate tasks to them through automated workflows.
9
-
10
- ## Features (In Progress & Planned)
11
- - **Agent Delegation**: Delegate tasks to specialized AI agents.
12
- - **Multi-Provider Support**: Google Gemini and Anthropic Claude providers.
13
- - **Job Scheduler**: Create and schedule recurring agentic tasks.
14
- - **Workflow Engine**: Drag-and-drop workflow builder supporting triggers, agent chaining, and outputs.
15
- - **Agent Capabilities**: File reading/writing, web search, email capabilities, and image generation.
16
- - **Role-Based Access Control**: Admin and member roles with project-level membership.
17
- - **TUI/CLI Tooling**: CLI executables to manage the installation and local agent configuration.
18
-
19
- ## Architecture
20
- - **Backend Framework**: NestJS 11 + TypeScript 5
21
- - **Frontend SPA**: React (built separately, served as static files)
22
- - **Database**: PostgreSQL (production) / SQLite (development)
23
- - **Testing**: Jest (TDD Approach with Unit & E2E)
24
- - **Architecture**: 3-Tier (Controller → Service → Repository)
3
+ <p align="center">
4
+ <img src="https://raw.githubusercontent.com/bpinhosilva/agent-orchestrator/main/docs/assets/lupy-mascot.webp" alt="Lupy, the Agent Orchestrator mascot" width="500" />
5
+ </p>
25
6
 
26
- ## Prerequisites
27
- - [Node.js](https://nodejs.org/) (v24+)
28
- - [Docker](https://www.docker.com/) and Docker Compose (optional, for the containerized stack)
29
- - A [Google Gemini API Key](https://aistudio.google.com/) or [Anthropic API Key](https://console.anthropic.com/)
7
+ <p align="center"><em>Lupy, the project mascot, inspired by Bruno's dog and companion of 10 years.</em></p>
30
8
 
31
- ## Quick Start
9
+ <p align="center">
10
+ <a href="https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/ci.yml"><img src="https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/ci.yml/badge.svg" alt="CI" /></a>
11
+ <a href="https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/gitleaks.yml"><img src="https://github.com/bpinhosilva/agent-orchestrator/actions/workflows/gitleaks.yml/badge.svg" alt="Gitleaks" /></a>
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
+ </p>
32
14
 
33
- ### 1. Choose an installation path
15
+ 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.
34
16
 
35
- **Option A: install the packaged CLI**
17
+ ## Current capabilities
36
18
 
37
- ```bash
38
- npm install -g @bpinhosilva/agent-orchestrator
39
- agent-orchestrator --help
40
- ```
19
+ - Multi-provider agent execution with Google Gemini and Anthropic Claude
20
+ - Agent profiles with provider/model selection
21
+ - Project management with project membership and RBAC
22
+ - Task execution plus recurring scheduling
23
+ - File upload and artifact-backed task workflows
24
+ - Packaged CLI/runtime for setup, run, status, logs, stop, and migrate
25
+ - React dashboard served by the backend or packaged runtime
41
26
 
42
- **Option B: run from a source checkout**
27
+ ## Planned direction
43
28
 
44
- ```bash
45
- git clone <repo> && cd agent-orchestrator
46
- npm install
47
- npm rebuild
48
- npm run build:all
49
- ```
29
+ - Richer workflow orchestration and agent chaining
30
+ - Broader agent tool integrations
31
+ - Expanded runtime and deployment ergonomics
50
32
 
51
- > **Note**: The project uses `ignore-scripts=true` in `.npmrc` for supply chain security. After installing dependencies from source, run `npm rebuild` to compile native modules (bcrypt, sqlite3).
33
+ ## Architecture at a glance
52
34
 
53
- ### 2. Configure the runtime
35
+ | Area | Stack |
36
+ | --- | --- |
37
+ | Backend | NestJS 11 + TypeScript 5 |
38
+ | Frontend | React SPA |
39
+ | Database | PostgreSQL (production) / SQLite via `better-sqlite3` (local/runtime) |
40
+ | ORM | TypeORM |
41
+ | Auth | JWT access/refresh tokens via httpOnly cookies |
42
+ | Packaging | npm package with bundled backend, CLI, and UI assets |
54
43
 
55
- **CLI-driven setup (recommended for local/runtime installs)**
44
+ ## Prerequisites
56
45
 
57
- ```bash
58
- agent-orchestrator setup
59
- ```
46
+ - [Node.js](https://nodejs.org/) 24 or newer
47
+ - npm
48
+ - [Docker](https://www.docker.com/) and Docker Compose (optional)
49
+ - At least one provider API key to execute agents:
50
+ - [Google Gemini API key](https://aistudio.google.com/)
51
+ - [Anthropic API key](https://console.anthropic.com/)
60
52
 
61
- The CLI writes `${AGENT_ORCHESTRATOR_HOME}/.env` with user-only permissions (`0600`), can run migrations, and can seed an admin user. It also supports non-interactive setup:
53
+ ## Quick start
62
54
 
63
- ```bash
64
- agent-orchestrator setup \
65
- --yes \
66
- --db-type postgres \
67
- --database-url postgresql://orchestrator:orchestrator_password@localhost:5433/agent_orchestrator \
68
- --provider gemini \
69
- --gemini-key your-gemini-api-key \
70
- --skip-admin-setup
71
- ```
55
+ Choose the path that matches how you want to use the project:
72
56
 
73
- **Manual `.env` setup**
57
+ - **Packaged CLI/runtime**: quickest way to run the app locally as an installed tool
58
+ - **Source checkout**: best path for development and contributing
74
59
 
75
- Create a `.env` file in the project root (or set `AGENT_ORCHESTRATOR_HOME` to point to a directory containing `.env`):
60
+ ### Option A: packaged CLI/runtime
76
61
 
77
62
  ```bash
78
- # Required
79
- JWT_SECRET="at-least-32-characters-long-secret-key"
63
+ npm install -g @bpinhosilva/agent-orchestrator
64
+ agent-orchestrator setup
65
+ agent-orchestrator run
66
+ agent-orchestrator status
67
+ ```
80
68
 
81
- # AI Providers (at least one required for agent functionality)
82
- GEMINI_API_KEY="your-gemini-api-key"
83
- ANTHROPIC_API_KEY="your-anthropic-api-key"
69
+ `setup` can create the runtime `.env`, run migrations, seed an admin user, and prompt you to apply pending migrations after package updates. `run` does not upgrade the database automatically. The default runtime home is `~/.agent-orchestrator`, or `${AGENT_ORCHESTRATOR_HOME}` if you set it explicitly.
84
70
 
85
- # Optional
86
- PORT=3000 # Server port (default: 3000)
87
- NODE_ENV=development # development | production | test
88
- DATABASE_URL= # PostgreSQL connection string (omit for SQLite)
89
- ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
90
- SCHEDULER_ENABLED=true # Enable/disable task scheduler CRON
91
- DB_LOGGING=false # Enable TypeORM query logging
92
- SERVE_STATIC_UI=true # Set false when the UI is served by a separate container/proxy
93
- CHECK_PENDING_MIGRATIONS_ON_STARTUP=false
94
- ```
71
+ For deeper CLI usage, see [docs/CLI.md](docs/CLI.md).
95
72
 
96
- ### 3. Set Up the Database
73
+ ### Option B: source checkout
97
74
 
98
- **Option A: SQLite (Development — zero config)**
75
+ ```bash
76
+ git clone https://github.com/bpinhosilva/agent-orchestrator.git
77
+ cd agent-orchestrator
78
+ npm install
79
+ npm rebuild
80
+ npm run build:all
81
+ ```
99
82
 
100
- SQLite is used automatically when `DATABASE_URL` is not set. The database file is created at `local.sqlite` in the project root (or `$AGENT_ORCHESTRATOR_HOME/local.sqlite`).
83
+ > **Note**: The repository uses `ignore-scripts=true` in `.npmrc` for supply-chain hardening. After `npm install`, run `npm rebuild --ignore-scripts=false` so native modules such as `bcrypt` and `better-sqlite3` are actually compiled.
101
84
 
102
- **Option B: PostgreSQL (Production / Docker)**
85
+ If you want to use the packaged CLI behavior from a source checkout, run the built entrypoint directly:
103
86
 
104
87
  ```bash
105
- # Start only PostgreSQL
106
- docker compose up -d db
107
-
108
- # Set the connection string
109
- export DATABASE_URL="postgresql://orchestrator:orchestrator_password@localhost:5433/agent_orchestrator"
88
+ node dist/cli/index.js --help
110
89
  ```
111
90
 
112
- Then run migrations and seed the admin user:
91
+ ## Configure the runtime
113
92
 
114
- ```bash
115
- # Apply database migrations
116
- npm run migration:run
93
+ The app loads configuration from:
117
94
 
118
- # Create the initial admin user (interactive prompt)
119
- npm run seed:admin
120
- ```
95
+ - `${AGENT_ORCHESTRATOR_HOME}/.env` when `AGENT_ORCHESTRATOR_HOME` is set
96
+ - `.env` in the project/package root otherwise
121
97
 
122
- ### 4. Run the Application
98
+ Example `.env`:
123
99
 
124
100
  ```bash
125
- # Packaged/runtime CLI
126
- agent-orchestrator run
127
- agent-orchestrator status
128
- agent-orchestrator logs --lines 50
129
- agent-orchestrator stop
101
+ # Required
102
+ JWT_SECRET="replace-with-a-secret-at-least-32-characters-long"
130
103
 
131
- # Development (API + UI with hot reload)
132
- npm run dev
104
+ # Provider keys (optional until you want to execute agents)
105
+ GEMINI_API_KEY=""
106
+ ANTHROPIC_API_KEY=""
133
107
 
134
- # Or API only in watch mode
135
- npm run start:dev
108
+ # Database
109
+ DB_TYPE=sqlite
110
+ DATABASE_URL=
136
111
 
137
- # Production build
138
- npm run build
139
- npm run start:prod
112
+ # Runtime
113
+ PORT=15789
114
+ NODE_ENV=production
115
+ ALLOWED_ORIGINS=http://localhost:5173,http://localhost:3000
116
+ SCHEDULER_ENABLED=true
117
+ DB_LOGGING=false
118
+ SERVE_STATIC_UI=true
119
+ CHECK_PENDING_MIGRATIONS_ON_STARTUP=false
140
120
  ```
141
121
 
142
- The dashboard is available at `http://localhost:3000` and the API at `http://localhost:3000/api/v1/`.
122
+ ## Database setup
143
123
 
144
- ### 5. Run with Docker
124
+ ### SQLite
145
125
 
146
- The repository now includes three compose entrypoints:
126
+ SQLite is the default local/runtime option when `DATABASE_URL` is not set. The database file lives at:
147
127
 
148
- - `docker-compose.yml` production-like stack with **PostgreSQL + distroless API + Caddy UI**
149
- - `docker-compose.dev.yml` development stack with hot reload for API and UI
150
- - `docker-compose-test.yml` — containerized integration stack for migration, CLI, API, and UI checks
128
+ - `local.sqlite` in the project/package root, or
129
+ - `${AGENT_ORCHESTRATOR_HOME}/local.sqlite` when runtime home is set
151
130
 
152
- All Docker entrypoints read from the repository-root `.env` file. For the Docker flows, the most relevant variables are:
153
-
154
- ```bash
155
- JWT_SECRET="at-least-32-characters-long-secret-key"
156
- POSTGRES_USER=orchestrator
157
- POSTGRES_PASSWORD=orchestrator_password
158
- POSTGRES_DB=agent_orchestrator
159
- POSTGRES_PORT=5433
160
- POSTGRES_TEST_DB=agent_orchestrator_test
161
- POSTGRES_TEST_PORT=5434
162
- GEMINI_API_KEY=
163
- ANTHROPIC_API_KEY=
164
- ```
131
+ ### PostgreSQL
165
132
 
166
- #### Production-like Docker stack
133
+ Use PostgreSQL by setting `DATABASE_URL` or `DB_TYPE=postgres`:
167
134
 
168
135
  ```bash
169
- # Build and start PostgreSQL + API + UI
170
- npm run docker:up
171
-
172
- # The API will refuse to start until migrations are applied
173
- docker compose run --rm api dist/cli/index.js migrate --yes
174
-
175
- # Stop the stack
176
- npm run docker:down
136
+ export DATABASE_URL="postgresql://orchestrator:orchestrator_password@localhost:5433/agent_orchestrator"
177
137
  ```
178
138
 
179
- - UI: `https://localhost` or `https://agent-orchestrator.localhost`
180
- - API: `http://localhost:3000/api/v1`
181
-
182
- The API container does **not** serve the SPA in Docker mode. The UI is served by **Caddy**, which also proxies `/api/*` traffic to the API container so the browser can use the same origin for UI + API.
139
+ ### Initialize the schema
183
140
 
184
- The UI container uses **Caddy** with `tls internal`, so HTTPS works locally without an external CA. Browsers will still warn until you trust Caddy's local root certificate on your host machine. You can copy it out of the container with:
141
+ Run migrations before the first app start:
185
142
 
186
143
  ```bash
187
- docker compose cp ui:/data/caddy/pki/authorities/local/root.crt ./caddy-local-root.crt
144
+ npm run migration:run
188
145
  ```
189
146
 
190
- After trusting that certificate in your OS/browser trust store, local HTTPS becomes trusted as well.
191
-
192
- #### Development Docker stack
147
+ Create the initial admin user if you want to sign in through the dashboard:
193
148
 
194
149
  ```bash
195
- npm run docker:dev
196
-
197
- # Stop the dev stack
198
- docker compose -f docker-compose.dev.yml down
150
+ npm run seed:admin
199
151
  ```
200
152
 
201
- - UI dev server: `http://localhost:5173`
202
- - API: `http://localhost:3000/api/v1`
203
- - PostgreSQL: `localhost:5433`
153
+ If you use the packaged CLI, `agent-orchestrator setup` can perform both steps for you.
204
154
 
205
- The dev stack disables bundled UI serving in the API container and points the Vite dev proxy at the `api` service over the Docker network.
155
+ ## Run the application
206
156
 
207
- #### Docker integration / end-to-end stack
208
-
209
- Use the test compose file when you want to exercise migration behavior, CLI commands, API startup, and the UI together:
157
+ ### Local development
210
158
 
211
159
  ```bash
212
- # Start only the database first
213
- docker compose -f docker-compose-test.yml up -d db
214
-
215
- # Verify pending migrations block API startup
216
- docker compose -f docker-compose-test.yml up api
217
-
218
- # Apply migrations with the packaged CLI runtime
219
- docker compose -f docker-compose-test.yml run --rm migrate
220
-
221
- # Then bring up the full app stack
222
- docker compose -f docker-compose-test.yml up ui api
223
-
224
- # Run ad hoc CLI checks
225
- docker compose -f docker-compose-test.yml run --rm cli dist/cli/index.js status
226
-
227
- # Tear the test stack down
228
- docker compose -f docker-compose-test.yml down -v
160
+ npm run dev
229
161
  ```
230
162
 
231
- The test stack is designed for:
163
+ That starts:
232
164
 
233
- - verifying that pending migrations block API startup,
234
- - applying migrations through the packaged CLI/runtime path,
235
- - checking UI reachability through Caddy,
236
- - exercising future CLI-driven Docker behaviors without depending on the local SQLite test path.
237
-
238
- ## Database Management
239
-
240
- The project uses [TypeORM](https://typeorm.io/) migrations to manage schema changes. **Never rely on `synchronize: true`** — it is disabled in all environments.
165
+ - UI dev server: `http://localhost:5173`
166
+ - API: `http://localhost:3000/api/v1`
167
+ - Swagger UI: `http://localhost:3000/api` (non-production only)
168
+ - Health endpoint: `http://localhost:3000/health`
241
169
 
242
- ### Migration Commands
170
+ If you only want the API in watch mode:
243
171
 
244
172
  ```bash
245
- # Generate a new migration from entity changes
246
- npm run typeorm -- migration:generate src/migrations/DescriptiveName
247
-
248
- # Apply all pending migrations
249
- npm run migration:run
250
-
251
- # Revert the last applied migration
252
- npm run migration:revert
253
-
254
- # Drop the entire database schema (use with caution!)
255
- npm run schema:drop
173
+ npm run start:dev
256
174
  ```
257
175
 
258
- ### Migration Workflow
259
-
260
- 1. Modify your entity files in `src/`
261
- 2. Generate a migration: `npm run typeorm -- migration:generate src/migrations/YourMigrationName`
262
- 3. Review the generated file in `src/migrations/`
263
- 4. Apply it: `npm run migration:run`
264
- 5. Verify with tests: `npm run test:all`
265
-
266
- ### Seeding
176
+ ### Packaged/runtime mode
267
177
 
268
178
  ```bash
269
- # Create the initial admin user
270
- npm run seed:admin
179
+ agent-orchestrator run
180
+ agent-orchestrator status
181
+ agent-orchestrator logs --lines 50
182
+ agent-orchestrator stop
271
183
  ```
272
184
 
273
- This creates a user with the `admin` role. All subsequent users registered via `POST /auth/register` (admin-only endpoint) default to `member` role.
185
+ When running the packaged app or a production build with static UI enabled, the dashboard is served from `http://localhost:15789` by default.
274
186
 
275
- ## Deployment
187
+ ## Docker
276
188
 
277
- ### Production Checklist
189
+ The repository ships three Compose entrypoints:
278
190
 
279
- 1. **Database**: Use PostgreSQL set `DATABASE_URL` environment variable
280
- 2. **Migrations**: Run `npm run migration:run` before starting the app
281
- 3. **Environment**:
282
- - `NODE_ENV=production` — disables Swagger UI and enables secure cookies
283
- - `JWT_SECRET` — strong secret, minimum 32 characters
284
- - `ALLOWED_ORIGINS` — comma-separated list of allowed CORS origins (required in production)
285
- 4. **Build**: Run `npm run build` to compile TypeScript and bundle the UI
286
- 5. **Start**: `npm run start:prod` (or `node dist/main.js`)
191
+ All Compose stacks now require the database variables in the project `.env` file: `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`, and `POSTGRES_TEST_DB` for the integration stack.
287
192
 
288
- ### Docker
193
+ | File | Purpose |
194
+ | --- | --- |
195
+ | `docker-compose.yml` | Production-style stack with PostgreSQL, API, and Caddy-served UI |
196
+ | `docker-compose.dev.yml` | Development stack with API hot reload and Vite UI dev server |
197
+ | `docker-compose.test.yml` | Integration stack for migration, CLI/runtime, API, and UI checks |
198
+
199
+ ### Production-style stack
289
200
 
290
201
  ```bash
291
- # Production-like stack
292
202
  npm run docker:up
293
-
294
- # Apply migrations with the packaged runtime inside the API container
295
203
  docker compose run --rm api dist/cli/index.js migrate --yes
296
-
297
- # Stop the stack
298
- npm run docker:down
299
204
  ```
300
205
 
301
- The API container is configured to **fail fast when migrations are pending**. This keeps schema changes explicit instead of silently mutating the database during startup.
206
+ Endpoints:
302
207
 
303
- This behavior is controlled by `CHECK_PENDING_MIGRATIONS_ON_STARTUP=true` in the Docker API service. Docker mode also sets `SERVE_STATIC_UI=false` so the backend does not try to serve bundled frontend assets.
304
-
305
- ### Updating an Existing Deployment
208
+ - UI: `https://localhost` or `https://agent-orchestrator.localhost`
209
+ - API: `https://localhost/api/v1` or `https://agent-orchestrator.localhost/api/v1`
306
210
 
307
- 1. Pull the latest code
308
- 2. Install dependencies: `npm ci && npm rebuild`
309
- 3. Build: `npm run build`
310
- 4. Run new migrations: `npm run migration:run`
311
- 5. Restart the application
211
+ In this stack the UI is served by **Caddy**, not by the Nest app. Docker explicitly sets `SERVE_STATIC_UI=false` so the backend only serves the API.
312
212
 
313
- ## Testing
213
+ ### Development stack
314
214
 
315
215
  ```bash
316
- # Unit tests
317
- npm test
318
-
319
- # Unit tests in watch mode
320
- npm run test:watch
321
-
322
- # E2E tests
323
- npm run test:e2e
324
-
325
- # All tests (unit + UI + E2E)
326
- npm run test:all
327
-
328
- # Test coverage
329
- npm run test:cov
330
-
331
- # Run a single test file
332
- npm test -- src/auth/auth.service.spec.ts
333
-
334
- # Run tests matching a name pattern
335
- npm test -- --testNamePattern="should validate email"
216
+ npm run docker:dev
336
217
  ```
337
218
 
338
- ## Security
219
+ Endpoints:
339
220
 
340
- ### Authentication & Authorization
221
+ - UI: `http://localhost:5173`
222
+ - API: `http://localhost:3000/api/v1`
223
+ - PostgreSQL: `localhost:5433`
341
224
 
342
- - **JWT-based authentication** with httpOnly cookie transport (no tokens in response bodies)
343
- - **Role-Based Access Control (RBAC)**: `admin` and `member` roles
344
- - **Admin**: Full access to all resources
345
- - **Member**: Access scoped to projects they own or are members of
346
- - **Project membership**: Many-to-many model with `owner` and `member` roles per project
347
- - **Rate limiting**: 60 req/min globally, 5 req/min on auth endpoints
348
- - All routes protected by default — use `@Public()` decorator for public endpoints
225
+ ### Integration stack
349
226
 
350
- ### Supply Chain Protection
227
+ Use `docker-compose.test.yml` when you want to exercise migration behavior, packaged CLI/runtime flows, API startup, and UI reachability together.
351
228
 
352
- - `.npmrc` hardened: registry pinned to `registry.npmjs.org`, install scripts disabled
353
- - `lockfile-lint` validates lockfile integrity in CI and pre-commit hooks
354
- - `npm audit signatures` checks package provenance in CI
355
- - [Socket.dev](https://socket.dev) monitors dependencies for supply chain risks
229
+ ```bash
230
+ npm run docker:test
231
+ docker compose -f docker-compose.test.yml --profile tools run --rm migrate
232
+ docker compose -f docker-compose.test.yml --profile tools run --rm cli
233
+ ```
356
234
 
357
- ### Additional Hardening
235
+ Endpoints:
358
236
 
359
- - Helmet.js security headers with Content Security Policy
360
- - CORS restricted to `ALLOWED_ORIGINS` (deny-all in production without explicit config)
361
- - Swagger UI disabled in production
362
- - File upload validation: MIME type allowlist + 10MB size limit
363
- - Input length limits on all text fields via class-validator
237
+ - UI: `https://localhost:8444` or `https://agent-orchestrator.localhost:8444`
238
+ - API: `https://localhost:8444/api/v1` or `https://agent-orchestrator.localhost:8444/api/v1`
364
239
 
365
- ## API Usage
240
+ ## Development workflow
366
241
 
367
- **Endpoint**: `POST /api/v1/agents/process`
368
- **Payload**:
369
- ```json
370
- {
371
- "input": "Write a short poem about automation."
372
- }
373
- ```
242
+ | Task | Command |
243
+ | --- | --- |
244
+ | Start API + UI | `npm run dev` |
245
+ | Start API only | `npm run start:dev` |
246
+ | Lint API + UI | `npm run lint:all` |
247
+ | Run API + UI + E2E tests | `npm run test:all` |
248
+ | Run coverage | `npm run test:cov` |
249
+ | Run E2E tests | `npm run test:e2e` |
250
+ | Build backend + UI package output | `npm run build:all` |
251
+ | Apply migrations | `npm run migration:run` |
374
252
 
375
- ## Contributing
253
+ ## Auth and access model
376
254
 
377
- See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
255
+ - Access and refresh tokens are issued by the auth service and transported via **httpOnly cookies**
256
+ - System roles are **`admin`** and **`user`**
257
+ - Project membership roles are **`owner`** and **`member`**
258
+ - Routes are protected by default; use `@Public()` for public endpoints
259
+ - Global throttling defaults to `60/min`, with stricter limits on auth endpoints
378
260
 
379
- ## Additional Documentation
261
+ ## Useful docs
380
262
 
381
263
  - [CLI reference](docs/CLI.md)
382
264
  - [CI/CD pipeline](docs/CI_CD.md)
383
265
  - [Release process](docs/RELEASE.md)
266
+ - [Contributing guide](CONTRIBUTING.md)
267
+
268
+ ## Troubleshooting
269
+
270
+ - **Native module errors after install**: run `npm rebuild`
271
+ - **`JWT_SECRET` rejected**: it must be at least 32 characters
272
+ - **Agent execution fails immediately**: confirm `GEMINI_API_KEY` and/or `ANTHROPIC_API_KEY` are set
273
+ - **Schema/startup issues**: run `npm run migration:run`
274
+ - **Need to undo the latest migration**: run `npm run migration:revert`
384
275
 
385
276
  ## License
386
277
 
387
- See [LICENSE](LICENSE) for details.
278
+ See [LICENSE](LICENSE).
package/dist/cli/index.js CHANGED
@@ -54,11 +54,12 @@ const crypto = __importStar(require("crypto"));
54
54
  const child_process_1 = require("child_process");
55
55
  const bcrypt = __importStar(require("bcrypt"));
56
56
  const typeorm_1 = require("../config/typeorm");
57
+ const port_defaults_1 = require("../config/port.defaults");
57
58
  const migration_state_1 = require("../database/migration-state");
58
59
  const avatar_constants_1 = require("../users/avatar.constants");
59
60
  const user_entity_1 = require("../users/entities/user.entity");
60
61
  let program = new commander_1.Command();
61
- const DEFAULT_PORT = '3000';
62
+ const DEFAULT_PORT = `${port_defaults_1.RUNTIME_DEFAULT_PORT}`;
62
63
  const PACKAGE_JSON_PATH = path.join(path.resolve(__dirname, '..', '..'), 'package.json');
63
64
  const MAIN_FILE = path.join(path.resolve(__dirname, '..', '..'), 'dist/main.js');
64
65
  const UI_INDEX_FILE = path.join(path.resolve(__dirname, '..', '..'), 'dist/ui/index.html');
@@ -472,6 +473,7 @@ function buildEnvContent(currentEnv, basicConfig, databaseUrl, geminiKey, anthro
472
473
  PORT: basicConfig.port,
473
474
  DB_TYPE: basicConfig.dbType,
474
475
  DB_LOGGING: `${basicConfig.dbLogging}`,
476
+ CHECK_PENDING_MIGRATIONS_ON_STARTUP: currentEnv.CHECK_PENDING_MIGRATIONS_ON_STARTUP || 'true',
475
477
  JWT_SECRET: jwtSecret,
476
478
  };
477
479
  if (databaseUrl) {
@@ -491,6 +493,7 @@ function buildEnvContent(currentEnv, basicConfig, databaseUrl, geminiKey, anthro
491
493
  'PORT',
492
494
  'DB_TYPE',
493
495
  'DB_LOGGING',
496
+ 'CHECK_PENDING_MIGRATIONS_ON_STARTUP',
494
497
  'DATABASE_URL',
495
498
  'GEMINI_API_KEY',
496
499
  'ANTHROPIC_API_KEY',
@@ -36,7 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.envValidationSchema = void 0;
37
37
  const Joi = __importStar(require("joi"));
38
38
  exports.envValidationSchema = Joi.object({
39
- PORT: Joi.number().default(3000),
39
+ PORT: Joi.number().port().optional(),
40
40
  DATABASE_URL: Joi.string().optional(),
41
41
  DB_TYPE: Joi.string().valid('postgres', 'sqlite').optional(),
42
42
  JWT_SECRET: Joi.string().min(32).required(),
@@ -0,0 +1,3 @@
1
+ export declare const DEV_DEFAULT_PORT = 3000;
2
+ export declare const RUNTIME_DEFAULT_PORT = 15789;
3
+ export declare function getDefaultPort(nodeEnv?: string): number;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RUNTIME_DEFAULT_PORT = exports.DEV_DEFAULT_PORT = void 0;
4
+ exports.getDefaultPort = getDefaultPort;
5
+ exports.DEV_DEFAULT_PORT = 3000;
6
+ exports.RUNTIME_DEFAULT_PORT = 15789;
7
+ function getDefaultPort(nodeEnv) {
8
+ return nodeEnv === 'production' ? exports.RUNTIME_DEFAULT_PORT : exports.DEV_DEFAULT_PORT;
9
+ }
@@ -1,5 +1,8 @@
1
1
  import { DataSource, DataSourceOptions } from 'typeorm';
2
2
  import { ConfigService } from '@nestjs/config';
3
+ export type RuntimeDbType = 'postgres' | 'sqlite';
4
+ export declare function resolveDataSourceType(dbType: RuntimeDbType): 'postgres' | 'better-sqlite3';
5
+ export declare function isSqliteDriver(type: DataSourceOptions['type']): boolean;
3
6
  export declare const getTypeOrmConfig: (configService: ConfigService) => DataSourceOptions;
4
7
  export declare const createDataSource: () => DataSource;
5
8
  declare const _default: DataSource;