feat(M4-009,M4-010,M4-011): routing rules CRUD, per-user overrides, agent capabilities (#320)
Some checks failed
ci/woodpecker/push/ci Pipeline failed
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 #320.
This commit is contained in:
@@ -11,6 +11,51 @@ import {
|
||||
|
||||
const agentStatuses = ['idle', 'active', 'error', 'offline'] as const;
|
||||
|
||||
// ─── Agent Capability Declarations (M4-011) ───────────────────────────────────
|
||||
|
||||
/**
|
||||
* Agent specialization capability fields.
|
||||
* Stored inside the agent's `config` JSON as `capabilities`.
|
||||
*/
|
||||
export class AgentCapabilitiesDto {
|
||||
/**
|
||||
* Domains this agent specializes in, e.g. ['frontend', 'backend', 'devops'].
|
||||
* Used by the routing engine to bias toward this agent for matching domains.
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
domains?: string[];
|
||||
|
||||
/**
|
||||
* Default model identifier for this agent.
|
||||
* Influences routing when no explicit rule overrides the choice.
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(255)
|
||||
preferredModel?: string;
|
||||
|
||||
/**
|
||||
* Default provider for this agent.
|
||||
* Influences routing when no explicit rule overrides the choice.
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(255)
|
||||
preferredProvider?: string;
|
||||
|
||||
/**
|
||||
* Tool categories this agent has access to, e.g. ['web-search', 'code-exec'].
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
toolSets?: string[];
|
||||
}
|
||||
|
||||
// ─── Create DTO ───────────────────────────────────────────────────────────────
|
||||
|
||||
export class CreateAgentConfigDto {
|
||||
@IsString()
|
||||
@MaxLength(255)
|
||||
@@ -49,11 +94,40 @@ export class CreateAgentConfigDto {
|
||||
@IsBoolean()
|
||||
isSystem?: boolean;
|
||||
|
||||
/**
|
||||
* General config blob. May include `capabilities` (AgentCapabilitiesDto)
|
||||
* for agent specialization declarations (M4-011).
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
config?: Record<string, unknown>;
|
||||
|
||||
// ─── Capability shorthand fields (M4-011) ──────────────────────────────────
|
||||
// These are convenience top-level fields that get merged into config.capabilities.
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
domains?: string[];
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(255)
|
||||
preferredModel?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(255)
|
||||
preferredProvider?: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
toolSets?: string[];
|
||||
}
|
||||
|
||||
// ─── Update DTO ───────────────────────────────────────────────────────────────
|
||||
|
||||
export class UpdateAgentConfigDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@@ -91,7 +165,33 @@ export class UpdateAgentConfigDto {
|
||||
@IsArray()
|
||||
skills?: string[] | null;
|
||||
|
||||
/**
|
||||
* General config blob. May include `capabilities` (AgentCapabilitiesDto)
|
||||
* for agent specialization declarations (M4-011).
|
||||
*/
|
||||
@IsOptional()
|
||||
@IsObject()
|
||||
config?: Record<string, unknown> | null;
|
||||
|
||||
// ─── Capability shorthand fields (M4-011) ──────────────────────────────────
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
domains?: string[] | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(255)
|
||||
preferredModel?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MaxLength(255)
|
||||
preferredProvider?: string | null;
|
||||
|
||||
@IsOptional()
|
||||
@IsArray()
|
||||
@IsString({ each: true })
|
||||
toolSets?: string[] | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user