@bpinhosilva/agent-orchestrator 1.0.0-alpha.27 → 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.
- package/CHANGELOG.md +8 -0
- package/README.md +18 -5
- package/dist/cli/index.js +4 -13
- package/dist/database/migration-state.d.ts +0 -1
- package/dist/database/migration-state.js +14 -27
- package/dist/main.js +1 -1
- package/dist/migrations/{1775260737095-BaselineSchema.d.ts → 1775266979821-InitialSchema.d.ts} +1 -1
- package/dist/migrations/{1775260737095-BaselineSchema.js → 1775266979821-InitialSchema.js} +20 -20
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
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
|
+
|
|
1
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)
|
|
2
10
|
|
|
3
11
|
|
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Agent Orchestrator
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<img src="docs/assets/lupy-mascot.webp" alt="Lupy, the Agent Orchestrator mascot" width="500" />
|
|
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
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center"><em>Lupy, the project mascot, inspired by Bruno's dog and companion of 10 years.</em></p>
|
|
@@ -66,7 +66,7 @@ agent-orchestrator run
|
|
|
66
66
|
agent-orchestrator status
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
`setup` can create the runtime `.env`, run migrations,
|
|
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.
|
|
70
70
|
|
|
71
71
|
For deeper CLI usage, see [docs/CLI.md](docs/CLI.md).
|
|
72
72
|
|
|
@@ -188,11 +188,13 @@ When running the packaged app or a production build with static UI enabled, the
|
|
|
188
188
|
|
|
189
189
|
The repository ships three Compose entrypoints:
|
|
190
190
|
|
|
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.
|
|
192
|
+
|
|
191
193
|
| File | Purpose |
|
|
192
194
|
| --- | --- |
|
|
193
195
|
| `docker-compose.yml` | Production-style stack with PostgreSQL, API, and Caddy-served UI |
|
|
194
196
|
| `docker-compose.dev.yml` | Development stack with API hot reload and Vite UI dev server |
|
|
195
|
-
| `docker-compose
|
|
197
|
+
| `docker-compose.test.yml` | Integration stack for migration, CLI/runtime, API, and UI checks |
|
|
196
198
|
|
|
197
199
|
### Production-style stack
|
|
198
200
|
|
|
@@ -204,7 +206,7 @@ docker compose run --rm api dist/cli/index.js migrate --yes
|
|
|
204
206
|
Endpoints:
|
|
205
207
|
|
|
206
208
|
- UI: `https://localhost` or `https://agent-orchestrator.localhost`
|
|
207
|
-
- API: `
|
|
209
|
+
- API: `https://localhost/api/v1` or `https://agent-orchestrator.localhost/api/v1`
|
|
208
210
|
|
|
209
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.
|
|
210
212
|
|
|
@@ -222,7 +224,18 @@ Endpoints:
|
|
|
222
224
|
|
|
223
225
|
### Integration stack
|
|
224
226
|
|
|
225
|
-
Use `docker-compose
|
|
227
|
+
Use `docker-compose.test.yml` when you want to exercise migration behavior, packaged CLI/runtime flows, API startup, and UI reachability together.
|
|
228
|
+
|
|
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
|
+
```
|
|
234
|
+
|
|
235
|
+
Endpoints:
|
|
236
|
+
|
|
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`
|
|
226
239
|
|
|
227
240
|
## Development workflow
|
|
228
241
|
|
package/dist/cli/index.js
CHANGED
|
@@ -473,6 +473,7 @@ function buildEnvContent(currentEnv, basicConfig, databaseUrl, geminiKey, anthro
|
|
|
473
473
|
PORT: basicConfig.port,
|
|
474
474
|
DB_TYPE: basicConfig.dbType,
|
|
475
475
|
DB_LOGGING: `${basicConfig.dbLogging}`,
|
|
476
|
+
CHECK_PENDING_MIGRATIONS_ON_STARTUP: currentEnv.CHECK_PENDING_MIGRATIONS_ON_STARTUP || 'true',
|
|
476
477
|
JWT_SECRET: jwtSecret,
|
|
477
478
|
};
|
|
478
479
|
if (databaseUrl) {
|
|
@@ -492,6 +493,7 @@ function buildEnvContent(currentEnv, basicConfig, databaseUrl, geminiKey, anthro
|
|
|
492
493
|
'PORT',
|
|
493
494
|
'DB_TYPE',
|
|
494
495
|
'DB_LOGGING',
|
|
496
|
+
'CHECK_PENDING_MIGRATIONS_ON_STARTUP',
|
|
495
497
|
'DATABASE_URL',
|
|
496
498
|
'GEMINI_API_KEY',
|
|
497
499
|
'ANTHROPIC_API_KEY',
|
|
@@ -617,7 +619,7 @@ async function handleSetup(options) {
|
|
|
617
619
|
const envContent = buildEnvContent(currentEnv, basicConfig, databaseUrl, geminiKey, anthropicKey, jwtSecret);
|
|
618
620
|
writePrivateFile(exports.ENV_PATH, envContent);
|
|
619
621
|
console.log(`Configuration saved to ${exports.ENV_PATH} with mode 600.`);
|
|
620
|
-
const { hasPending, isEmpty
|
|
622
|
+
const { hasPending, isEmpty } = await (0, migration_state_1.checkPendingMigrations)({
|
|
621
623
|
assumePendingOnError: true,
|
|
622
624
|
});
|
|
623
625
|
if (isEmpty) {
|
|
@@ -626,12 +628,6 @@ async function handleSetup(options) {
|
|
|
626
628
|
await maybeSetupAdmin(options, interactive);
|
|
627
629
|
return;
|
|
628
630
|
}
|
|
629
|
-
if (requiresBaselineBootstrap) {
|
|
630
|
-
console.log('Existing database detected without recorded baseline migration. Recording the baseline migration metadata...');
|
|
631
|
-
await (0, migration_state_1.runMigrations)();
|
|
632
|
-
await maybeSetupAdmin(options, interactive);
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
631
|
if (hasPending) {
|
|
636
632
|
const confirmMigration = await confirmAction('Pending migrations detected on an existing database. Do you want to run them?', options.yes);
|
|
637
633
|
if (confirmMigration) {
|
|
@@ -838,7 +834,7 @@ function defineCommands() {
|
|
|
838
834
|
}
|
|
839
835
|
return;
|
|
840
836
|
}
|
|
841
|
-
const { hasPending, isEmpty
|
|
837
|
+
const { hasPending, isEmpty } = await (0, migration_state_1.checkPendingMigrations)({
|
|
842
838
|
assumePendingOnError: true,
|
|
843
839
|
});
|
|
844
840
|
if (isEmpty) {
|
|
@@ -846,11 +842,6 @@ function defineCommands() {
|
|
|
846
842
|
await (0, migration_state_1.runMigrations)();
|
|
847
843
|
return;
|
|
848
844
|
}
|
|
849
|
-
if (requiresBaselineBootstrap) {
|
|
850
|
-
console.log('Existing database detected without recorded baseline migration. Recording the baseline migration metadata...');
|
|
851
|
-
await (0, migration_state_1.runMigrations)();
|
|
852
|
-
return;
|
|
853
|
-
}
|
|
854
845
|
if (!hasPending) {
|
|
855
846
|
console.log('Database is already up to date.');
|
|
856
847
|
return;
|
|
@@ -3,22 +3,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.checkPendingMigrations = checkPendingMigrations;
|
|
4
4
|
exports.runMigrations = runMigrations;
|
|
5
5
|
const typeorm_1 = require("../config/typeorm");
|
|
6
|
+
async function getMigrationContext(dataSource) {
|
|
7
|
+
const hasPending = await dataSource.showMigrations();
|
|
8
|
+
const tables = await dataSource.query((0, typeorm_1.isSqliteDriver)(dataSource.options.type)
|
|
9
|
+
? "SELECT name FROM sqlite_master WHERE type='table' AND name NOT IN ('migrations', 'sqlite_sequence')"
|
|
10
|
+
: "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' AND table_name != 'migrations'");
|
|
11
|
+
return {
|
|
12
|
+
hasPending,
|
|
13
|
+
isEmpty: tables.length === 0,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
6
16
|
async function checkPendingMigrations(options = {}) {
|
|
7
17
|
const dataSource = (0, typeorm_1.createDataSource)();
|
|
8
18
|
try {
|
|
9
19
|
await dataSource.initialize();
|
|
10
|
-
const hasPending = await dataSource
|
|
11
|
-
const tables = await dataSource.query((0, typeorm_1.isSqliteDriver)(dataSource.options.type)
|
|
12
|
-
? "SELECT name FROM sqlite_master WHERE type='table' AND name NOT IN ('migrations', 'sqlite_sequence')"
|
|
13
|
-
: "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' AND table_name != 'migrations'");
|
|
14
|
-
const isEmpty = tables.length === 0;
|
|
15
|
-
const registeredMigrationNames = dataSource.migrations.map((migration) => migration.name || migration.constructor.name);
|
|
16
|
-
const requiresBaselineBootstrap = !isEmpty &&
|
|
17
|
-
hasPending &&
|
|
18
|
-
registeredMigrationNames.length === 1 &&
|
|
19
|
-
registeredMigrationNames[0]?.startsWith('BaselineSchema') === true;
|
|
20
|
+
const { hasPending, isEmpty } = await getMigrationContext(dataSource);
|
|
20
21
|
await dataSource.destroy();
|
|
21
|
-
return { hasPending, isEmpty
|
|
22
|
+
return { hasPending, isEmpty };
|
|
22
23
|
}
|
|
23
24
|
catch (err) {
|
|
24
25
|
if (dataSource.isInitialized) {
|
|
@@ -28,7 +29,6 @@ async function checkPendingMigrations(options = {}) {
|
|
|
28
29
|
return {
|
|
29
30
|
hasPending: true,
|
|
30
31
|
isEmpty: true,
|
|
31
|
-
requiresBaselineBootstrap: false,
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
const errorMessage = err instanceof Error ? err.message : String(err);
|
|
@@ -44,22 +44,9 @@ async function runMigrations(force = false) {
|
|
|
44
44
|
await dataSource.dropDatabase();
|
|
45
45
|
console.log('Schema dropped successfully.');
|
|
46
46
|
}
|
|
47
|
-
|
|
48
|
-
const tables = await dataSource.query((0, typeorm_1.isSqliteDriver)(dataSource.options.type)
|
|
49
|
-
? "SELECT name FROM sqlite_master WHERE type='table' AND name NOT IN ('migrations', 'sqlite_sequence')"
|
|
50
|
-
: "SELECT table_name FROM information_schema.tables WHERE table_schema = 'public' AND table_name != 'migrations'");
|
|
51
|
-
const isEmpty = tables.length === 0;
|
|
52
|
-
const registeredMigrationNames = dataSource.migrations.map((migration) => migration.name || migration.constructor.name);
|
|
53
|
-
const shouldBootstrapBaseline = !force &&
|
|
54
|
-
!isEmpty &&
|
|
55
|
-
hasPending &&
|
|
56
|
-
registeredMigrationNames.length === 1 &&
|
|
57
|
-
registeredMigrationNames[0]?.startsWith('BaselineSchema') === true;
|
|
47
|
+
await getMigrationContext(dataSource);
|
|
58
48
|
console.log('Running database migrations...');
|
|
59
|
-
const result = await dataSource.runMigrations(
|
|
60
|
-
if (shouldBootstrapBaseline) {
|
|
61
|
-
console.log('Existing database schema detected without recorded baseline migration. Recorded the baseline migration without changing the schema.');
|
|
62
|
-
}
|
|
49
|
+
const result = await dataSource.runMigrations();
|
|
63
50
|
if (result.length > 0) {
|
|
64
51
|
console.log(`Successfully executed ${result.length} migrations.`);
|
|
65
52
|
}
|
package/dist/main.js
CHANGED
|
@@ -26,7 +26,7 @@ async function ensureDatabaseIsReadyForStartup() {
|
|
|
26
26
|
}
|
|
27
27
|
throw new Error([
|
|
28
28
|
'Pending database migrations were detected.',
|
|
29
|
-
'Run `npm run migration:run`
|
|
29
|
+
'Run `agent-orchestrator setup` or `agent-orchestrator migrate --yes` for packaged installs, `npm run migration:run` for local source development, or `docker compose run --rm api dist/cli/index.js migrate --yes` in the Docker stack, then start the server again.',
|
|
30
30
|
].join(' '));
|
|
31
31
|
}
|
|
32
32
|
async function bootstrap() {
|
package/dist/migrations/{1775260737095-BaselineSchema.d.ts → 1775266979821-InitialSchema.d.ts}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class InitialSchema1775266979821 implements MigrationInterface {
|
|
3
3
|
name: string;
|
|
4
4
|
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
5
|
down(queryRunner: QueryRunner): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
class
|
|
5
|
-
name = '
|
|
3
|
+
exports.InitialSchema1775266979821 = void 0;
|
|
4
|
+
class InitialSchema1775266979821 {
|
|
5
|
+
name = 'InitialSchema1775266979821';
|
|
6
6
|
async up(queryRunner) {
|
|
7
7
|
await queryRunner.query(`CREATE TABLE "users" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "last_name" varchar NOT NULL, "email" varchar NOT NULL, "password" varchar, "role" varchar NOT NULL DEFAULT ('user'), "avatar" varchar NOT NULL DEFAULT ('avatar-01'), "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "UQ_97672ac88f789774dd47f7c8be3" UNIQUE ("email"))`);
|
|
8
8
|
await queryRunner.query(`CREATE TABLE "providers" ("id" varchar PRIMARY KEY NOT NULL, "name" varchar NOT NULL, "description" text, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), CONSTRAINT "UQ_d735474e539e674ba3702eddc44" UNIQUE ("name"))`);
|
|
@@ -25,11 +25,11 @@ class BaselineSchema1775260737095 {
|
|
|
25
25
|
await queryRunner.query(`CREATE INDEX "IDX_9a16d2c86252529f622fa53f1e" ON "tasks" ("assigneeId") `);
|
|
26
26
|
await queryRunner.query(`CREATE INDEX "IDX_7a097552fe4fba313996835706" ON "tasks" ("projectId", "updatedAt") `);
|
|
27
27
|
await queryRunner.query(`CREATE INDEX "IDX_4105de371d2c7ca094a830e5cd" ON "tasks" ("projectId", "status", "updatedAt") `);
|
|
28
|
-
await queryRunner.query(`CREATE TABLE "recurrent_task_execs" ("id" varchar PRIMARY KEY NOT NULL, "status" varchar CHECK( "status" IN ('running','success','failure','canceled') ) NOT NULL DEFAULT ('running'), "result" text, "latencyMs" integer, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "recurrentTaskId" varchar NOT NULL)`);
|
|
29
|
-
await queryRunner.query(`CREATE INDEX "IDX_f5bb7be33ddb87ac0f04807b4a" ON "recurrent_task_execs" ("recurrentTaskId") `);
|
|
30
28
|
await queryRunner.query(`CREATE TABLE "recurrent_tasks" ("id" varchar PRIMARY KEY NOT NULL, "title" varchar NOT NULL, "description" text NOT NULL, "status" varchar CHECK( "status" IN ('active','paused','error') ) NOT NULL DEFAULT ('active'), "priority" varchar CHECK( "priority" IN ('0','1','2','3') ) NOT NULL DEFAULT (2), "cronExpression" varchar NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "assigneeId" varchar NOT NULL, "projectId" varchar)`);
|
|
31
29
|
await queryRunner.query(`CREATE INDEX "IDX_0f9f543bd40419122e69aeff00" ON "recurrent_tasks" ("projectId") `);
|
|
32
30
|
await queryRunner.query(`CREATE INDEX "IDX_a03520bcf60ada1a46bf548e22" ON "recurrent_tasks" ("status") `);
|
|
31
|
+
await queryRunner.query(`CREATE TABLE "recurrent_task_execs" ("id" varchar PRIMARY KEY NOT NULL, "status" varchar CHECK( "status" IN ('running','success','failure','canceled') ) NOT NULL DEFAULT ('running'), "result" text, "latencyMs" integer, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "recurrentTaskId" varchar NOT NULL)`);
|
|
32
|
+
await queryRunner.query(`CREATE INDEX "IDX_f5bb7be33ddb87ac0f04807b4a" ON "recurrent_task_execs" ("recurrentTaskId") `);
|
|
33
33
|
await queryRunner.query(`CREATE TABLE "artifacts" ("id" varchar PRIMARY KEY NOT NULL, "originalName" varchar NOT NULL, "mimeType" varchar NOT NULL, "filePath" varchar NOT NULL, "metadata" text)`);
|
|
34
34
|
await queryRunner.query(`CREATE TABLE "refresh_tokens" ("id" varchar PRIMARY KEY NOT NULL, "userId" varchar NOT NULL, "token" text NOT NULL, "issuedAt" datetime NOT NULL DEFAULT (datetime('now')), "expiresAt" datetime NOT NULL, "absoluteExpiry" datetime NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "revokedAt" datetime)`);
|
|
35
35
|
await queryRunner.query(`CREATE INDEX "IDX_070d648bde98d061fd6e9d176d" ON "refresh_tokens" ("userId", "revokedAt") `);
|
|
@@ -84,12 +84,6 @@ class BaselineSchema1775260737095 {
|
|
|
84
84
|
await queryRunner.query(`CREATE INDEX "IDX_9a16d2c86252529f622fa53f1e" ON "tasks" ("assigneeId") `);
|
|
85
85
|
await queryRunner.query(`CREATE INDEX "IDX_7a097552fe4fba313996835706" ON "tasks" ("projectId", "updatedAt") `);
|
|
86
86
|
await queryRunner.query(`CREATE INDEX "IDX_4105de371d2c7ca094a830e5cd" ON "tasks" ("projectId", "status", "updatedAt") `);
|
|
87
|
-
await queryRunner.query(`DROP INDEX "IDX_f5bb7be33ddb87ac0f04807b4a"`);
|
|
88
|
-
await queryRunner.query(`CREATE TABLE "temporary_recurrent_task_execs" ("id" varchar PRIMARY KEY NOT NULL, "status" varchar CHECK( "status" IN ('running','success','failure','canceled') ) NOT NULL DEFAULT ('running'), "result" text, "latencyMs" integer, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "recurrentTaskId" varchar NOT NULL, CONSTRAINT "FK_f5bb7be33ddb87ac0f04807b4ab" FOREIGN KEY ("recurrentTaskId") REFERENCES "recurrent_tasks" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
89
|
-
await queryRunner.query(`INSERT INTO "temporary_recurrent_task_execs"("id", "status", "result", "latencyMs", "createdAt", "updatedAt", "recurrentTaskId") SELECT "id", "status", "result", "latencyMs", "createdAt", "updatedAt", "recurrentTaskId" FROM "recurrent_task_execs"`);
|
|
90
|
-
await queryRunner.query(`DROP TABLE "recurrent_task_execs"`);
|
|
91
|
-
await queryRunner.query(`ALTER TABLE "temporary_recurrent_task_execs" RENAME TO "recurrent_task_execs"`);
|
|
92
|
-
await queryRunner.query(`CREATE INDEX "IDX_f5bb7be33ddb87ac0f04807b4a" ON "recurrent_task_execs" ("recurrentTaskId") `);
|
|
93
87
|
await queryRunner.query(`DROP INDEX "IDX_0f9f543bd40419122e69aeff00"`);
|
|
94
88
|
await queryRunner.query(`DROP INDEX "IDX_a03520bcf60ada1a46bf548e22"`);
|
|
95
89
|
await queryRunner.query(`CREATE TABLE "temporary_recurrent_tasks" ("id" varchar PRIMARY KEY NOT NULL, "title" varchar NOT NULL, "description" text NOT NULL, "status" varchar CHECK( "status" IN ('active','paused','error') ) NOT NULL DEFAULT ('active'), "priority" varchar CHECK( "priority" IN ('0','1','2','3') ) NOT NULL DEFAULT (2), "cronExpression" varchar NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "assigneeId" varchar NOT NULL, "projectId" varchar, CONSTRAINT "FK_9ec101b70a5f9612b0757d87c83" FOREIGN KEY ("assigneeId") REFERENCES "agents" ("id") ON DELETE CASCADE ON UPDATE NO ACTION, CONSTRAINT "FK_0f9f543bd40419122e69aeff006" FOREIGN KEY ("projectId") REFERENCES "projects" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
@@ -98,6 +92,12 @@ class BaselineSchema1775260737095 {
|
|
|
98
92
|
await queryRunner.query(`ALTER TABLE "temporary_recurrent_tasks" RENAME TO "recurrent_tasks"`);
|
|
99
93
|
await queryRunner.query(`CREATE INDEX "IDX_0f9f543bd40419122e69aeff00" ON "recurrent_tasks" ("projectId") `);
|
|
100
94
|
await queryRunner.query(`CREATE INDEX "IDX_a03520bcf60ada1a46bf548e22" ON "recurrent_tasks" ("status") `);
|
|
95
|
+
await queryRunner.query(`DROP INDEX "IDX_f5bb7be33ddb87ac0f04807b4a"`);
|
|
96
|
+
await queryRunner.query(`CREATE TABLE "temporary_recurrent_task_execs" ("id" varchar PRIMARY KEY NOT NULL, "status" varchar CHECK( "status" IN ('running','success','failure','canceled') ) NOT NULL DEFAULT ('running'), "result" text, "latencyMs" integer, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "recurrentTaskId" varchar NOT NULL, CONSTRAINT "FK_f5bb7be33ddb87ac0f04807b4ab" FOREIGN KEY ("recurrentTaskId") REFERENCES "recurrent_tasks" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
97
|
+
await queryRunner.query(`INSERT INTO "temporary_recurrent_task_execs"("id", "status", "result", "latencyMs", "createdAt", "updatedAt", "recurrentTaskId") SELECT "id", "status", "result", "latencyMs", "createdAt", "updatedAt", "recurrentTaskId" FROM "recurrent_task_execs"`);
|
|
98
|
+
await queryRunner.query(`DROP TABLE "recurrent_task_execs"`);
|
|
99
|
+
await queryRunner.query(`ALTER TABLE "temporary_recurrent_task_execs" RENAME TO "recurrent_task_execs"`);
|
|
100
|
+
await queryRunner.query(`CREATE INDEX "IDX_f5bb7be33ddb87ac0f04807b4a" ON "recurrent_task_execs" ("recurrentTaskId") `);
|
|
101
101
|
await queryRunner.query(`DROP INDEX "IDX_070d648bde98d061fd6e9d176d"`);
|
|
102
102
|
await queryRunner.query(`DROP INDEX "IDX_ec511b89bba27b211e32a2a12f"`);
|
|
103
103
|
await queryRunner.query(`CREATE TABLE "temporary_refresh_tokens" ("id" varchar PRIMARY KEY NOT NULL, "userId" varchar NOT NULL, "token" text NOT NULL, "issuedAt" datetime NOT NULL DEFAULT (datetime('now')), "expiresAt" datetime NOT NULL, "absoluteExpiry" datetime NOT NULL, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "revokedAt" datetime, CONSTRAINT "FK_610102b60fea1455310ccd299de" FOREIGN KEY ("userId") REFERENCES "users" ("id") ON DELETE CASCADE ON UPDATE NO ACTION)`);
|
|
@@ -116,6 +116,12 @@ class BaselineSchema1775260737095 {
|
|
|
116
116
|
await queryRunner.query(`DROP TABLE "temporary_refresh_tokens"`);
|
|
117
117
|
await queryRunner.query(`CREATE INDEX "IDX_ec511b89bba27b211e32a2a12f" ON "refresh_tokens" ("userId", "expiresAt") `);
|
|
118
118
|
await queryRunner.query(`CREATE INDEX "IDX_070d648bde98d061fd6e9d176d" ON "refresh_tokens" ("userId", "revokedAt") `);
|
|
119
|
+
await queryRunner.query(`DROP INDEX "IDX_f5bb7be33ddb87ac0f04807b4a"`);
|
|
120
|
+
await queryRunner.query(`ALTER TABLE "recurrent_task_execs" RENAME TO "temporary_recurrent_task_execs"`);
|
|
121
|
+
await queryRunner.query(`CREATE TABLE "recurrent_task_execs" ("id" varchar PRIMARY KEY NOT NULL, "status" varchar CHECK( "status" IN ('running','success','failure','canceled') ) NOT NULL DEFAULT ('running'), "result" text, "latencyMs" integer, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "recurrentTaskId" varchar NOT NULL)`);
|
|
122
|
+
await queryRunner.query(`INSERT INTO "recurrent_task_execs"("id", "status", "result", "latencyMs", "createdAt", "updatedAt", "recurrentTaskId") SELECT "id", "status", "result", "latencyMs", "createdAt", "updatedAt", "recurrentTaskId" FROM "temporary_recurrent_task_execs"`);
|
|
123
|
+
await queryRunner.query(`DROP TABLE "temporary_recurrent_task_execs"`);
|
|
124
|
+
await queryRunner.query(`CREATE INDEX "IDX_f5bb7be33ddb87ac0f04807b4a" ON "recurrent_task_execs" ("recurrentTaskId") `);
|
|
119
125
|
await queryRunner.query(`DROP INDEX "IDX_a03520bcf60ada1a46bf548e22"`);
|
|
120
126
|
await queryRunner.query(`DROP INDEX "IDX_0f9f543bd40419122e69aeff00"`);
|
|
121
127
|
await queryRunner.query(`ALTER TABLE "recurrent_tasks" RENAME TO "temporary_recurrent_tasks"`);
|
|
@@ -124,12 +130,6 @@ class BaselineSchema1775260737095 {
|
|
|
124
130
|
await queryRunner.query(`DROP TABLE "temporary_recurrent_tasks"`);
|
|
125
131
|
await queryRunner.query(`CREATE INDEX "IDX_a03520bcf60ada1a46bf548e22" ON "recurrent_tasks" ("status") `);
|
|
126
132
|
await queryRunner.query(`CREATE INDEX "IDX_0f9f543bd40419122e69aeff00" ON "recurrent_tasks" ("projectId") `);
|
|
127
|
-
await queryRunner.query(`DROP INDEX "IDX_f5bb7be33ddb87ac0f04807b4a"`);
|
|
128
|
-
await queryRunner.query(`ALTER TABLE "recurrent_task_execs" RENAME TO "temporary_recurrent_task_execs"`);
|
|
129
|
-
await queryRunner.query(`CREATE TABLE "recurrent_task_execs" ("id" varchar PRIMARY KEY NOT NULL, "status" varchar CHECK( "status" IN ('running','success','failure','canceled') ) NOT NULL DEFAULT ('running'), "result" text, "latencyMs" integer, "createdAt" datetime NOT NULL DEFAULT (datetime('now')), "updatedAt" datetime NOT NULL DEFAULT (datetime('now')), "recurrentTaskId" varchar NOT NULL)`);
|
|
130
|
-
await queryRunner.query(`INSERT INTO "recurrent_task_execs"("id", "status", "result", "latencyMs", "createdAt", "updatedAt", "recurrentTaskId") SELECT "id", "status", "result", "latencyMs", "createdAt", "updatedAt", "recurrentTaskId" FROM "temporary_recurrent_task_execs"`);
|
|
131
|
-
await queryRunner.query(`DROP TABLE "temporary_recurrent_task_execs"`);
|
|
132
|
-
await queryRunner.query(`CREATE INDEX "IDX_f5bb7be33ddb87ac0f04807b4a" ON "recurrent_task_execs" ("recurrentTaskId") `);
|
|
133
133
|
await queryRunner.query(`DROP INDEX "IDX_4105de371d2c7ca094a830e5cd"`);
|
|
134
134
|
await queryRunner.query(`DROP INDEX "IDX_7a097552fe4fba313996835706"`);
|
|
135
135
|
await queryRunner.query(`DROP INDEX "IDX_9a16d2c86252529f622fa53f1e"`);
|
|
@@ -184,11 +184,11 @@ class BaselineSchema1775260737095 {
|
|
|
184
184
|
await queryRunner.query(`DROP INDEX "IDX_070d648bde98d061fd6e9d176d"`);
|
|
185
185
|
await queryRunner.query(`DROP TABLE "refresh_tokens"`);
|
|
186
186
|
await queryRunner.query(`DROP TABLE "artifacts"`);
|
|
187
|
+
await queryRunner.query(`DROP INDEX "IDX_f5bb7be33ddb87ac0f04807b4a"`);
|
|
188
|
+
await queryRunner.query(`DROP TABLE "recurrent_task_execs"`);
|
|
187
189
|
await queryRunner.query(`DROP INDEX "IDX_a03520bcf60ada1a46bf548e22"`);
|
|
188
190
|
await queryRunner.query(`DROP INDEX "IDX_0f9f543bd40419122e69aeff00"`);
|
|
189
191
|
await queryRunner.query(`DROP TABLE "recurrent_tasks"`);
|
|
190
|
-
await queryRunner.query(`DROP INDEX "IDX_f5bb7be33ddb87ac0f04807b4a"`);
|
|
191
|
-
await queryRunner.query(`DROP TABLE "recurrent_task_execs"`);
|
|
192
192
|
await queryRunner.query(`DROP INDEX "IDX_4105de371d2c7ca094a830e5cd"`);
|
|
193
193
|
await queryRunner.query(`DROP INDEX "IDX_7a097552fe4fba313996835706"`);
|
|
194
194
|
await queryRunner.query(`DROP INDEX "IDX_9a16d2c86252529f622fa53f1e"`);
|
|
@@ -212,4 +212,4 @@ class BaselineSchema1775260737095 {
|
|
|
212
212
|
await queryRunner.query(`DROP TABLE "users"`);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
exports.
|
|
215
|
+
exports.InitialSchema1775266979821 = InitialSchema1775266979821;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bpinhosilva/agent-orchestrator",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.28",
|
|
4
4
|
"description": "An open-source AI agent orchestrator platform built with NestJS.",
|
|
5
5
|
"author": "bpinhosilva",
|
|
6
6
|
"license": "MIT",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"docker:up": "docker compose up --build",
|
|
66
66
|
"docker:down": "docker compose down",
|
|
67
67
|
"docker:dev": "docker compose -f docker-compose.dev.yml up --build",
|
|
68
|
-
"docker:test": "docker compose -f docker-compose
|
|
68
|
+
"docker:test": "docker compose -f docker-compose.test.yml up --build"
|
|
69
69
|
},
|
|
70
70
|
"bin": {
|
|
71
71
|
"agent-orchestrator": "dist/cli/index.js"
|