Files
amcs/schema/agent_personas.dbml
T
warkanum 196b543bee
CI / build-and-test (push) Successful in 1m47s
feat(ui): add identity management for tenants and users
* Implement tenant and user creation in IdentityPage
* Add API calls for managing tenants and users
* Introduce tenant-scoped API requests
* Update sidebar to include identity navigation
* Create BooleanStatusBadge component for key status
2026-07-20 22:50:55 +02:00

165 lines
5.0 KiB
Plaintext

Table agent_personas {
id bigserial [pk]
guid uuid [unique, not null, default: `gen_random_uuid()`]
name text [not null]
tenant_id text [ref: > tenants.id]
description text [not null, default: '']
summary text [not null]
detail text [not null, default: '']
compiled_summary text [not null, default: '']
compiled_detail text [not null, default: '']
compiled_at timestamptz
tags "text[]" [not null, default: `'{}'`]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz [not null, default: `now()`]
indexes { (tenant_id, name) [unique] tenant_id }
}
Table agent_parts {
id bigserial [pk]
guid uuid [unique, not null, default: `gen_random_uuid()`]
name text [not null]
tenant_id text [ref: > tenants.id]
part_type text [not null]
description text [not null, default: '']
summary text [not null]
content text [not null, default: '']
tags "text[]" [not null, default: `'{}'`]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz [not null, default: `now()`]
indexes { (tenant_id, name) [unique] tenant_id }
}
Table agent_persona_parts {
id bigserial [pk]
persona_id bigint [not null, ref: > agent_personas.id]
part_id bigint [not null, ref: > agent_parts.id]
part_order int [not null, default: 0]
priority int [not null, default: 0]
indexes {
(persona_id, part_id) [uk]
persona_id
}
}
Table agent_persona_skills {
id bigserial [pk]
persona_id bigint [not null, ref: > agent_personas.id]
skill_id bigint [not null, ref: > agent_skills.id]
override boolean [not null, default: false]
indexes {
(persona_id, skill_id) [uk]
persona_id
}
}
Table project_personas {
id bigserial [pk]
project_id bigint [not null, ref: > projects.id]
persona_id bigint [not null, ref: > agent_personas.id]
is_default boolean [not null, default: false]
created_at timestamptz [not null, default: `now()`]
indexes {
(project_id, persona_id) [uk]
project_id
}
}
Table agent_persona_guardrails {
id bigserial [pk]
persona_id bigint [not null, ref: > agent_personas.id]
guardrail_id bigint [not null, ref: > agent_guardrails.id]
indexes {
persona_id
}
}
Table agent_traits {
id bigserial [pk]
guid uuid [unique, not null, default: `gen_random_uuid()`]
name text [not null]
tenant_id text [ref: > tenants.id]
trait_type text [not null]
description text [not null, default: '']
instruction text [not null, default: '']
tags "text[]" [not null, default: `'{}'`]
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz [not null, default: `now()`]
indexes { (tenant_id, name) [unique] tenant_id }
}
Table agent_persona_traits {
id bigserial [pk]
persona_id bigint [not null, ref: > agent_personas.id]
trait_id bigint [not null, ref: > agent_traits.id]
indexes {
persona_id
}
}
Table character_arcs {
id bigserial [pk]
name text [not null]
tenant_id text [ref: > tenants.id]
description text [not null, default: '']
summary text [not null, default: '']
created_at timestamptz [not null, default: `now()`]
updated_at timestamptz [not null, default: `now()`]
indexes { (tenant_id, name) [unique] tenant_id }
}
Table arc_stages {
id bigserial [pk]
arc_id bigint [not null, ref: > character_arcs.id]
name text [not null]
stage_order int [not null, default: 0]
description text [not null, default: '']
condition text [not null, default: '']
created_at timestamptz [not null, default: `now()`]
}
Table arc_stage_parts {
id bigserial [pk]
stage_id bigint [not null, ref: > arc_stages.id]
part_id bigint [not null, ref: > agent_parts.id]
indexes {
(stage_id, part_id)
}
}
Table persona_arc {
id bigserial [pk]
persona_id bigint [unique, not null, ref: > agent_personas.id]
arc_id bigint [not null, ref: > character_arcs.id]
current_stage_id bigint [not null, ref: > arc_stages.id]
updated_at timestamptz [not null, default: `now()`]
}
// Cross-file refs (for relspecgo merge)
Ref: agent_persona_parts.persona_id > agent_personas.id [delete: cascade]
Ref: agent_persona_parts.part_id > agent_parts.id [delete: cascade]
Ref: agent_persona_skills.persona_id > agent_personas.id [delete: cascade]
Ref: agent_persona_skills.skill_id > agent_skills.id [delete: cascade]
Ref: project_personas.project_id > projects.id [delete: cascade]
Ref: project_personas.persona_id > agent_personas.id [delete: cascade]
Ref: agent_persona_guardrails.persona_id > agent_personas.id [delete: cascade]
Ref: agent_persona_guardrails.guardrail_id > agent_guardrails.id [delete: cascade]
Ref: agent_persona_traits.persona_id > agent_personas.id [delete: cascade]
Ref: agent_persona_traits.trait_id > agent_traits.id [delete: cascade]
Ref: arc_stages.arc_id > character_arcs.id [delete: cascade]
Ref: arc_stage_parts.stage_id > arc_stages.id [delete: cascade]
Ref: arc_stage_parts.part_id > agent_parts.id [delete: cascade]
Ref: persona_arc.persona_id > agent_personas.id [delete: cascade]
Ref: persona_arc.arc_id > character_arcs.id
Ref: persona_arc.current_stage_id > arc_stages.id