feat(cli): command architecture — agents, missions, gateway-aware prdy (#158)
Some checks failed
ci/woodpecker/push/ci Pipeline failed

Co-authored-by: Jason Woltje <jason@diversecanvas.com>
Co-committed-by: Jason Woltje <jason@diversecanvas.com>
This commit was merged in pull request #158.
This commit is contained in:
2026-03-15 23:10:23 +00:00
committed by jason.woltje
parent 82c10a7b33
commit 4da255bf04
28 changed files with 1747 additions and 394 deletions

View File

@@ -190,18 +190,32 @@ export const events = pgTable(
(t) => [index('events_type_idx').on(t.type), index('events_date_idx').on(t.date)],
);
export const agents = pgTable('agents', {
id: uuid('id').primaryKey().defaultRandom(),
name: text('name').notNull(),
provider: text('provider').notNull(),
model: text('model').notNull(),
status: text('status', { enum: ['idle', 'active', 'error', 'offline'] })
.notNull()
.default('idle'),
config: jsonb('config'),
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(),
});
export const agents = pgTable(
'agents',
{
id: uuid('id').primaryKey().defaultRandom(),
name: text('name').notNull(),
provider: text('provider').notNull(),
model: text('model').notNull(),
status: text('status', { enum: ['idle', 'active', 'error', 'offline'] })
.notNull()
.default('idle'),
projectId: uuid('project_id').references(() => projects.id, { onDelete: 'set null' }),
ownerId: text('owner_id').references(() => users.id, { onDelete: 'set null' }),
systemPrompt: text('system_prompt'),
allowedTools: jsonb('allowed_tools').$type<string[]>(),
skills: jsonb('skills').$type<string[]>(),
isSystem: boolean('is_system').notNull().default(false),
config: jsonb('config'),
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(),
},
(t) => [
index('agents_project_id_idx').on(t.projectId),
index('agents_owner_id_idx').on(t.ownerId),
index('agents_is_system_idx').on(t.isSystem),
],
);
export const tickets = pgTable(
'tickets',
@@ -243,6 +257,7 @@ export const conversations = pgTable(
.notNull()
.references(() => users.id, { onDelete: 'cascade' }),
projectId: uuid('project_id').references(() => projects.id, { onDelete: 'set null' }),
agentId: uuid('agent_id').references(() => agents.id, { onDelete: 'set null' }),
archived: boolean('archived').notNull().default(false),
createdAt: timestamp('created_at', { withTimezone: true }).notNull().defaultNow(),
updatedAt: timestamp('updated_at', { withTimezone: true }).notNull().defaultNow(),
@@ -250,6 +265,7 @@ export const conversations = pgTable(
(t) => [
index('conversations_user_id_idx').on(t.userId),
index('conversations_project_id_idx').on(t.projectId),
index('conversations_agent_id_idx').on(t.agentId),
index('conversations_archived_idx').on(t.archived),
],
);