lobehub/docs/development/database-schema.dbml

2058 lines
59 KiB
Text
Raw Normal View History

table agents {
id text [pk, not null]
slug varchar(100)
title varchar(255)
description varchar(1000)
tags jsonb [default: `[]`]
editor_data jsonb
avatar text
background_color text
market_identifier text
plugins jsonb
client_id text
user_id text [not null]
agency_config jsonb
chat_config jsonb
few_shots jsonb
model text
params jsonb [default: `{}`]
provider text
system_role text
tts jsonb
virtual boolean [default: false]
pinned boolean
2025-04-12 02:29:09 +00:00
opening_message text
opening_questions text[] [default: `[]`]
session_group_id text
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(client_id, user_id) [name: 'client_id_user_id_unique', unique]
(slug, user_id) [name: 'agents_slug_user_id_unique', unique]
user_id [name: 'agents_user_id_idx']
title [name: 'agents_title_idx']
description [name: 'agents_description_idx']
session_group_id [name: 'agents_session_group_id_idx']
}
}
table agents_files {
file_id text [not null]
agent_id text [not null]
enabled boolean [default: true]
user_id text [not null]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(file_id, agent_id, user_id) [pk]
agent_id [name: 'agents_files_agent_id_idx']
file_id [name: 'agents_files_file_id_idx']
user_id [name: 'agents_files_user_id_idx']
}
}
table agents_knowledge_bases {
agent_id text [not null]
knowledge_base_id text [not null]
user_id text [not null]
enabled boolean [default: true]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(agent_id, knowledge_base_id) [pk]
agent_id [name: 'agents_knowledge_bases_agent_id_idx']
knowledge_base_id [name: 'agents_knowledge_bases_knowledge_base_id_idx']
user_id [name: 'agents_knowledge_bases_user_id_idx']
}
}
table agent_bot_providers {
id uuid [pk, not null, default: `gen_random_uuid()`]
agent_id text [not null]
user_id text [not null]
platform varchar(50) [not null]
application_id varchar(255) [not null]
credentials text
settings jsonb [default: `{}`]
enabled boolean [not null, default: true]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(platform, application_id) [name: 'agent_bot_providers_platform_app_id_unique', unique]
platform [name: 'agent_bot_providers_platform_idx']
agent_id [name: 'agent_bot_providers_agent_id_idx']
user_id [name: 'agent_bot_providers_user_id_idx']
}
}
table agent_cron_jobs {
id text [pk, not null]
agent_id text [not null]
group_id text
user_id text [not null]
name text
description text
enabled boolean [default: true]
cron_pattern text [not null]
timezone text [default: 'UTC']
content text [not null]
edit_data jsonb
max_executions integer
remaining_executions integer
execution_conditions jsonb
last_executed_at timestamp
total_executions integer [default: 0]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
agent_id [name: 'agent_cron_jobs_agent_id_idx']
group_id [name: 'agent_cron_jobs_group_id_idx']
user_id [name: 'agent_cron_jobs_user_id_idx']
enabled [name: 'agent_cron_jobs_enabled_idx']
remaining_executions [name: 'agent_cron_jobs_remaining_executions_idx']
last_executed_at [name: 'agent_cron_jobs_last_executed_at_idx']
}
}
table agent_documents {
id uuid [pk, not null, default: `gen_random_uuid()`]
user_id text [not null]
agent_id text [not null]
document_id varchar(255) [not null]
template_id varchar(100)
access_self integer [not null, default: 31]
access_shared integer [not null, default: 0]
access_public integer [not null, default: 0]
policy_load varchar(30) [not null, default: 'always']
policy jsonb
policy_load_position varchar(50) [not null, default: 'before-first-user']
policy_load_format varchar(20) [not null, default: 'raw']
policy_load_rule varchar(50) [not null, default: 'always']
deleted_at "timestamp with time zone"
deleted_by_user_id text
deleted_by_agent_id text
delete_reason text
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'agent_documents_user_id_idx']
agent_id [name: 'agent_documents_agent_id_idx']
access_self [name: 'agent_documents_access_self_idx']
access_shared [name: 'agent_documents_access_shared_idx']
access_public [name: 'agent_documents_access_public_idx']
policy_load [name: 'agent_documents_policy_load_idx']
template_id [name: 'agent_documents_template_id_idx']
policy_load_position [name: 'agent_documents_policy_load_position_idx']
policy_load_format [name: 'agent_documents_policy_load_format_idx']
policy_load_rule [name: 'agent_documents_policy_load_rule_idx']
(agent_id, policy_load_position) [name: 'agent_documents_agent_load_position_idx']
deleted_at [name: 'agent_documents_deleted_at_idx']
(agent_id, deleted_at, policy_load) [name: 'agent_documents_agent_autoload_deleted_idx']
document_id [name: 'agent_documents_document_id_idx']
(agent_id, document_id, user_id) [name: 'agent_documents_agent_document_user_unique', unique]
}
}
✨ feat: support agent benchmark (#12355) * improve total fix page size issue fix error message handler fix eval home page try to fix batch run agent step issue fix run list fix dataset loading fix abort issue improve jump and table column fix error streaming try to fix error output in vercel refactor qstash workflow client improve passK add evals to proxy refactor metrics try to fix build refactor tests improve detail page fix passK issue improve eval-rubric fix types support passK fix type update fix db insert issue improve dataset ui improve run config finish step limit now add step limited 100% coverage to models add failed tests todo support interruptOperation fix lint improve report detail improve pass rate improve sort order issue fix timeout issue Update db schema 完整 case 跑通 update database improve error handling refactor to improve database 优化 test case 的处理流程 优化部分细节体验和实现 基本完成 Benchmark 全流程功能 优化 run case 展示 优化 run case 序号问题 优化 eval test case 页面 新增 eval test 模式 新增 dataset 页面 update schema support finish create test run fix update improve import exp refactor data flow improve import workflow rubric Benchmark detail 页面 improve import ux update schema finish eval home page add eval workflow endpoint implement benchmark run model refactor RAG eval implement backend update db schema update db migration init benchmark * support rerun error test case * fix tests * fix tests
2026-02-21 12:36:40 +00:00
table agent_eval_benchmarks {
id text [pk, not null]
identifier text [not null]
name text [not null]
description text
rubrics jsonb [not null]
reference_url text
metadata jsonb
user_id text
✨ feat: support agent benchmark (#12355) * improve total fix page size issue fix error message handler fix eval home page try to fix batch run agent step issue fix run list fix dataset loading fix abort issue improve jump and table column fix error streaming try to fix error output in vercel refactor qstash workflow client improve passK add evals to proxy refactor metrics try to fix build refactor tests improve detail page fix passK issue improve eval-rubric fix types support passK fix type update fix db insert issue improve dataset ui improve run config finish step limit now add step limited 100% coverage to models add failed tests todo support interruptOperation fix lint improve report detail improve pass rate improve sort order issue fix timeout issue Update db schema 完整 case 跑通 update database improve error handling refactor to improve database 优化 test case 的处理流程 优化部分细节体验和实现 基本完成 Benchmark 全流程功能 优化 run case 展示 优化 run case 序号问题 优化 eval test case 页面 新增 eval test 模式 新增 dataset 页面 update schema support finish create test run fix update improve import exp refactor data flow improve import workflow rubric Benchmark detail 页面 improve import ux update schema finish eval home page add eval workflow endpoint implement benchmark run model refactor RAG eval implement backend update db schema update db migration init benchmark * support rerun error test case * fix tests * fix tests
2026-02-21 12:36:40 +00:00
is_system boolean [not null, default: true]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(identifier, user_id) [name: 'agent_eval_benchmarks_identifier_user_id_unique', unique]
✨ feat: support agent benchmark (#12355) * improve total fix page size issue fix error message handler fix eval home page try to fix batch run agent step issue fix run list fix dataset loading fix abort issue improve jump and table column fix error streaming try to fix error output in vercel refactor qstash workflow client improve passK add evals to proxy refactor metrics try to fix build refactor tests improve detail page fix passK issue improve eval-rubric fix types support passK fix type update fix db insert issue improve dataset ui improve run config finish step limit now add step limited 100% coverage to models add failed tests todo support interruptOperation fix lint improve report detail improve pass rate improve sort order issue fix timeout issue Update db schema 完整 case 跑通 update database improve error handling refactor to improve database 优化 test case 的处理流程 优化部分细节体验和实现 基本完成 Benchmark 全流程功能 优化 run case 展示 优化 run case 序号问题 优化 eval test case 页面 新增 eval test 模式 新增 dataset 页面 update schema support finish create test run fix update improve import exp refactor data flow improve import workflow rubric Benchmark detail 页面 improve import ux update schema finish eval home page add eval workflow endpoint implement benchmark run model refactor RAG eval implement backend update db schema update db migration init benchmark * support rerun error test case * fix tests * fix tests
2026-02-21 12:36:40 +00:00
is_system [name: 'agent_eval_benchmarks_is_system_idx']
user_id [name: 'agent_eval_benchmarks_user_id_idx']
✨ feat: support agent benchmark (#12355) * improve total fix page size issue fix error message handler fix eval home page try to fix batch run agent step issue fix run list fix dataset loading fix abort issue improve jump and table column fix error streaming try to fix error output in vercel refactor qstash workflow client improve passK add evals to proxy refactor metrics try to fix build refactor tests improve detail page fix passK issue improve eval-rubric fix types support passK fix type update fix db insert issue improve dataset ui improve run config finish step limit now add step limited 100% coverage to models add failed tests todo support interruptOperation fix lint improve report detail improve pass rate improve sort order issue fix timeout issue Update db schema 完整 case 跑通 update database improve error handling refactor to improve database 优化 test case 的处理流程 优化部分细节体验和实现 基本完成 Benchmark 全流程功能 优化 run case 展示 优化 run case 序号问题 优化 eval test case 页面 新增 eval test 模式 新增 dataset 页面 update schema support finish create test run fix update improve import exp refactor data flow improve import workflow rubric Benchmark detail 页面 improve import ux update schema finish eval home page add eval workflow endpoint implement benchmark run model refactor RAG eval implement backend update db schema update db migration init benchmark * support rerun error test case * fix tests * fix tests
2026-02-21 12:36:40 +00:00
}
}
table agent_eval_datasets {
id text [pk, not null]
benchmark_id text [not null]
identifier text [not null]
user_id text
name text [not null]
description text
eval_mode text
eval_config jsonb
metadata jsonb
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(identifier, user_id) [name: 'agent_eval_datasets_identifier_user_id_unique', unique]
benchmark_id [name: 'agent_eval_datasets_benchmark_id_idx']
user_id [name: 'agent_eval_datasets_user_id_idx']
}
}
table agent_eval_run_topics {
user_id text [not null]
run_id text [not null]
topic_id text [not null]
test_case_id text [not null]
status text
score real
passed boolean
eval_result jsonb
created_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(run_id, topic_id) [pk]
user_id [name: 'agent_eval_run_topics_user_id_idx']
run_id [name: 'agent_eval_run_topics_run_id_idx']
test_case_id [name: 'agent_eval_run_topics_test_case_id_idx']
}
}
table agent_eval_runs {
id text [pk, not null]
dataset_id text [not null]
target_agent_id text
user_id text [not null]
name text
status text [not null, default: 'idle']
config jsonb
metrics jsonb
started_at "timestamp with time zone"
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
dataset_id [name: 'agent_eval_runs_dataset_id_idx']
user_id [name: 'agent_eval_runs_user_id_idx']
status [name: 'agent_eval_runs_status_idx']
target_agent_id [name: 'agent_eval_runs_target_agent_id_idx']
}
}
table agent_eval_test_cases {
id text [pk, not null]
user_id text [not null]
dataset_id text [not null]
content jsonb [not null]
eval_mode text
eval_config jsonb
metadata jsonb
sort_order integer
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'agent_eval_test_cases_user_id_idx']
dataset_id [name: 'agent_eval_test_cases_dataset_id_idx']
sort_order [name: 'agent_eval_test_cases_sort_order_idx']
}
}
table agent_skills {
id text [pk, not null]
name text [not null]
description text [not null]
identifier text [not null]
source text [not null]
manifest jsonb [not null, default: `{}`]
content text
editor_data jsonb
resources jsonb [default: `{}`]
zip_file_hash varchar(64)
user_id text [not null]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(user_id, name) [name: 'agent_skills_user_name_idx', unique]
identifier [name: 'agent_skills_identifier_idx']
user_id [name: 'agent_skills_user_id_idx']
source [name: 'agent_skills_source_idx']
zip_file_hash [name: 'agent_skills_zip_hash_idx']
}
}
table ai_models {
id varchar(150) [not null]
display_name varchar(200)
description text
organization varchar(100)
enabled boolean
provider_id varchar(64) [not null]
type varchar(20) [not null, default: 'chat']
sort integer
user_id text [not null]
pricing jsonb
parameters jsonb [default: `{}`]
config jsonb
abilities jsonb [default: `{}`]
context_window_tokens integer
source varchar(20)
released_at varchar(10)
settings jsonb [default: `{}`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(id, provider_id, user_id) [pk]
user_id [name: 'ai_models_user_id_idx']
}
}
table ai_providers {
id varchar(64) [not null]
name text
user_id text [not null]
sort integer
enabled boolean
fetch_on_client boolean
check_model text
logo text
description text
key_vaults text
source varchar(20)
settings jsonb
config jsonb
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(id, user_id) [pk]
user_id [name: 'ai_providers_user_id_idx']
}
}
table api_keys {
id text [pk, not null]
name varchar(256) [not null]
key varchar(256) [not null, unique]
key_hash varchar(128) [unique]
enabled boolean [default: true]
expires_at "timestamp with time zone"
last_used_at "timestamp with time zone"
user_id text [not null]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'api_keys_user_id_idx']
}
}
table async_tasks {
id uuid [pk, not null, default: `gen_random_uuid()`]
type text
status text
error jsonb
inference_id text
user_id text [not null]
duration integer
parent_id uuid
metadata jsonb [not null, default: '{}']
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'async_tasks_user_id_idx']
parent_id [name: 'async_tasks_parent_id_idx']
(type, status) [name: 'async_tasks_type_status_idx']
inference_id [name: 'async_tasks_inference_id_idx']
metadata [name: 'async_tasks_metadata_idx']
}
}
2025-11-27 12:10:40 +00:00
table accounts {
access_token text
access_token_expires_at timestamp
account_id text [not null]
created_at timestamp [not null, default: `now()`]
id text [pk, not null]
id_token text
password text
provider_id text [not null]
refresh_token text
refresh_token_expires_at timestamp
scope text
updated_at timestamp [not null]
user_id text [not null]
indexes {
user_id [name: 'account_userId_idx']
}
2025-11-27 12:10:40 +00:00
}
table passkey {
aaguid text
backedUp boolean
counter integer
createdAt timestamp [default: `now()`]
credentialID text [not null]
deviceType text
id text [pk, not null]
name text
publicKey text [not null]
transports text
userId text [not null]
indexes {
credentialID [name: 'passkey_credential_id_unique', unique]
userId [name: 'passkey_user_id_idx']
}
}
2025-11-27 12:10:40 +00:00
table auth_sessions {
created_at timestamp [not null, default: `now()`]
expires_at timestamp [not null]
id text [pk, not null]
impersonated_by text
2025-11-27 12:10:40 +00:00
ip_address text
token text [not null, unique]
updated_at timestamp [not null]
user_agent text
user_id text [not null]
indexes {
user_id [name: 'auth_session_userId_idx']
}
}
table two_factor {
backup_codes text [not null]
id text [pk, not null]
secret text [not null]
user_id text [not null]
indexes {
secret [name: 'two_factor_secret_idx']
user_id [name: 'two_factor_user_id_idx']
}
2025-11-27 12:10:40 +00:00
}
table verifications {
created_at timestamp [not null, default: `now()`]
expires_at timestamp [not null]
id text [pk, not null]
identifier text [not null]
updated_at timestamp [not null, default: `now()`]
value text [not null]
indexes {
identifier [name: 'verification_identifier_idx']
}
2025-11-27 12:10:40 +00:00
}
table chat_groups {
id text [pk, not null]
title text
description text
avatar text
background_color text
market_identifier text
content text
editor_data jsonb
config jsonb
client_id text
user_id text [not null]
group_id text
pinned boolean [default: false]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(client_id, user_id) [name: 'chat_groups_client_id_user_id_unique', unique]
user_id [name: 'chat_groups_user_id_idx']
group_id [name: 'chat_groups_group_id_idx']
}
}
table chat_groups_agents {
chat_group_id text [not null]
agent_id text [not null]
user_id text [not null]
enabled boolean [default: true]
order integer [default: 0]
role text [default: 'participant']
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(chat_group_id, agent_id) [pk]
user_id [name: 'chat_groups_agents_user_id_idx']
}
}
table document_histories {
id varchar(255) [pk, not null]
document_id varchar(255) [not null]
user_id text [not null]
editor_data jsonb [not null]
save_source text [not null]
saved_at "timestamp with time zone" [not null]
indexes {
document_id [name: 'document_histories_document_id_idx']
user_id [name: 'document_histories_user_id_idx']
saved_at [name: 'document_histories_saved_at_idx']
}
}
table documents {
id varchar(255) [pk, not null]
title text
description text
content text
file_type varchar(255) [not null]
filename text
total_char_count integer [not null]
total_line_count integer [not null]
metadata jsonb
pages jsonb
source_type text [not null]
source text [not null]
file_id text
knowledge_base_id text
parent_id varchar(255)
user_id text [not null]
client_id text
editor_data jsonb
slug varchar(255)
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
source [name: 'documents_source_idx']
file_type [name: 'documents_file_type_idx']
source_type [name: 'documents_source_type_idx']
user_id [name: 'documents_user_id_idx']
file_id [name: 'documents_file_id_idx']
parent_id [name: 'documents_parent_id_idx']
knowledge_base_id [name: 'documents_knowledge_base_id_idx']
(client_id, user_id) [name: 'documents_client_id_user_id_unique', unique]
(slug, user_id) [name: 'documents_slug_user_id_unique', unique]
}
}
table files {
id text [pk, not null]
user_id text [not null]
file_type varchar(255) [not null]
file_hash varchar(64)
name text [not null]
size integer [not null]
url text [not null]
source text
parent_id varchar(255)
client_id text
metadata jsonb
chunk_task_id uuid
embedding_task_id uuid
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
file_hash [name: 'file_hash_idx']
user_id [name: 'files_user_id_idx']
parent_id [name: 'files_parent_id_idx']
chunk_task_id [name: 'files_chunk_task_id_idx']
embedding_task_id [name: 'files_embedding_task_id_idx']
(client_id, user_id) [name: 'files_client_id_user_id_unique', unique]
}
}
table global_files {
hash_id varchar(64) [pk, not null]
file_type varchar(255) [not null]
size integer [not null]
url text [not null]
metadata jsonb
creator text [not null]
created_at "timestamp with time zone" [not null, default: `now()`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
indexes {
creator [name: 'global_files_creator_idx']
}
}
table knowledge_base_files {
knowledge_base_id text [not null]
file_id text [not null]
user_id text [not null]
created_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(knowledge_base_id, file_id) [pk]
knowledge_base_id [name: 'knowledge_base_files_kb_id_idx']
user_id [name: 'knowledge_base_files_user_id_idx']
file_id [name: 'knowledge_base_files_file_id_idx']
}
}
table knowledge_bases {
id text [pk, not null]
name text [not null]
description text
avatar text
type text
user_id text [not null]
client_id text
is_public boolean [default: false]
settings jsonb
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(client_id, user_id) [name: 'knowledge_bases_client_id_user_id_unique', unique]
user_id [name: 'knowledge_bases_user_id_idx']
}
}
table generation_batches {
id text [pk, not null]
user_id text [not null]
generation_topic_id text [not null]
provider text [not null]
model text [not null]
prompt text [not null]
width integer
height integer
ratio varchar(64)
config jsonb
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'generation_batches_user_id_idx']
generation_topic_id [name: 'generation_batches_topic_id_idx']
}
}
table generation_topics {
id text [pk, not null]
user_id text [not null]
title text
cover_url text
type varchar(32) [not null, default: 'image']
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'generation_topics_user_id_idx']
}
}
table generations {
id text [pk, not null]
user_id text [not null]
generation_batch_id varchar(64) [not null]
async_task_id uuid
file_id text
seed integer
asset jsonb
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'generations_user_id_idx']
generation_batch_id [name: 'generations_batch_id_idx']
file_id [name: 'generations_file_id_idx']
}
}
table message_chunks {
message_id text
chunk_id uuid
user_id text [not null]
indexes {
(chunk_id, message_id) [pk]
user_id [name: 'message_chunks_user_id_idx']
message_id [name: 'message_chunks_message_id_idx']
}
}
table message_groups {
id varchar(255) [pk, not null]
topic_id text
user_id text [not null]
parent_group_id varchar(255)
parent_message_id text
title varchar(255)
description text
type text
content text
editor_data jsonb
metadata jsonb
client_id varchar(255)
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(client_id, user_id) [name: 'message_groups_client_id_user_id_unique', unique]
user_id [name: 'message_groups_user_id_idx']
topic_id [name: 'message_groups_topic_id_idx']
type [name: 'message_groups_type_idx']
parent_group_id [name: 'message_groups_parent_group_id_idx']
parent_message_id [name: 'message_groups_parent_message_id_idx']
}
}
table message_plugins {
id text [pk, not null]
tool_call_id text
type text [default: 'default']
intervention jsonb
api_name text
arguments text
identifier text
state jsonb
error jsonb
client_id text
user_id text [not null]
indexes {
(client_id, user_id) [name: 'message_plugins_client_id_user_id_unique', unique]
user_id [name: 'message_plugins_user_id_idx']
tool_call_id [name: 'message_plugins_tool_call_id_idx']
}
}
table message_queries {
id uuid [pk, not null, default: `gen_random_uuid()`]
message_id text [not null]
rewrite_query text
user_query text
client_id text
user_id text [not null]
embeddings_id uuid
indexes {
(client_id, user_id) [name: 'message_queries_client_id_user_id_unique', unique]
user_id [name: 'message_queries_user_id_idx']
message_id [name: 'message_queries_message_id_idx']
embeddings_id [name: 'message_queries_embeddings_id_idx']
}
}
table message_query_chunks {
id text
query_id uuid
chunk_id uuid
similarity "numeric(6, 5)"
user_id text [not null]
indexes {
(chunk_id, id, query_id) [pk]
user_id [name: 'message_query_chunks_user_id_idx']
id [name: 'message_query_chunks_message_id_idx']
query_id [name: 'message_query_chunks_query_id_idx']
}
}
table message_tts {
id text [pk, not null]
content_md5 text
file_id text
voice text
client_id text
user_id text [not null]
indexes {
(client_id, user_id) [name: 'message_tts_client_id_user_id_unique', unique]
user_id [name: 'message_tts_user_id_idx']
}
}
table message_translates {
id text [pk, not null]
content text
from text
to text
client_id text
user_id text [not null]
indexes {
(client_id, user_id) [name: 'message_translates_client_id_user_id_unique', unique]
user_id [name: 'message_translates_user_id_idx']
}
}
table messages {
id text [pk, not null]
role varchar(255) [not null]
content text
editor_data jsonb
summary text
reasoning jsonb
search jsonb
metadata jsonb
model text
provider text
favorite boolean [default: false]
error jsonb
tools jsonb
trace_id text
observation_id text
client_id text
user_id text [not null]
session_id text
topic_id text
thread_id text
parent_id text
quota_id text
agent_id text
group_id text
target_id text
message_group_id varchar(255)
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
created_at [name: 'messages_created_at_idx']
(client_id, user_id) [name: 'message_client_id_user_unique', unique]
topic_id [name: 'messages_topic_id_idx']
parent_id [name: 'messages_parent_id_idx']
quota_id [name: 'messages_quota_id_idx']
user_id [name: 'messages_user_id_idx']
session_id [name: 'messages_session_id_idx']
thread_id [name: 'messages_thread_id_idx']
agent_id [name: 'messages_agent_id_idx']
group_id [name: 'messages_group_id_idx']
message_group_id [name: 'messages_message_group_id_idx']
}
}
table messages_files {
file_id text [not null]
message_id text [not null]
user_id text [not null]
indexes {
(file_id, message_id) [pk]
user_id [name: 'messages_files_user_id_idx']
message_id [name: 'messages_files_message_id_idx']
}
}
table nextauth_accounts {
access_token text
expires_at integer
id_token text
provider text [not null]
providerAccountId text [not null]
refresh_token text
scope text
session_state text
token_type text
type text [not null]
user_id text [not null]
indexes {
(provider, providerAccountId) [pk]
user_id [name: 'nextauth_accounts_user_id_idx']
}
}
table nextauth_authenticators {
counter integer [not null]
credentialBackedUp boolean [not null]
credentialDeviceType text [not null]
credentialID text [not null, unique]
credentialPublicKey text [not null]
providerAccountId text [not null]
transports text
user_id text [not null]
indexes {
(user_id, credentialID) [pk]
}
}
table nextauth_sessions {
expires timestamp [not null]
sessionToken text [pk, not null]
user_id text [not null]
indexes {
user_id [name: 'nextauth_sessions_user_id_idx']
}
}
table nextauth_verificationtokens {
expires timestamp [not null]
identifier text [not null]
token text [not null]
indexes {
(identifier, token) [pk]
}
}
table notification_deliveries {
id uuid [pk, not null, default: `gen_random_uuid()`]
notification_id uuid [not null]
channel text [not null]
status text [not null]
provider_message_id text
failed_reason text
sent_at "timestamp with time zone"
created_at "timestamp with time zone" [not null, default: `now()`]
indexes {
notification_id [name: 'idx_deliveries_notification']
channel [name: 'idx_deliveries_channel']
status [name: 'idx_deliveries_status']
}
}
table notifications {
id uuid [pk, not null, default: `gen_random_uuid()`]
user_id text [not null]
category text [not null]
type text [not null]
title text [not null]
content text [not null]
dedupe_key text
action_url text
is_read boolean [not null, default: false]
is_archived boolean [not null, default: false]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'idx_notifications_user']
(user_id, created_at) [name: 'idx_notifications_user_active']
user_id [name: 'idx_notifications_user_unread']
(user_id, dedupe_key) [name: 'idx_notifications_dedupe', unique]
(updated_at, created_at, id) [name: 'idx_notifications_archived_cleanup']
}
}
table oauth_handoffs {
id text [pk, not null]
client varchar(50) [not null]
payload jsonb [not null]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
}
table oidc_access_tokens {
id varchar(255) [pk, not null]
data jsonb [not null]
expires_at "timestamp with time zone" [not null]
consumed_at "timestamp with time zone"
user_id text [not null]
client_id varchar(255) [not null]
grant_id varchar(255)
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'oidc_access_tokens_user_id_idx']
}
}
table oidc_authorization_codes {
id varchar(255) [pk, not null]
data jsonb [not null]
expires_at "timestamp with time zone" [not null]
consumed_at "timestamp with time zone"
user_id text [not null]
client_id varchar(255) [not null]
grant_id varchar(255)
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'oidc_authorization_codes_user_id_idx']
}
}
table oidc_clients {
id varchar(255) [pk, not null]
name text [not null]
description text
client_secret varchar(255)
redirect_uris text[] [not null]
grants text[] [not null]
response_types text[] [not null]
scopes text[] [not null]
token_endpoint_auth_method varchar(20)
application_type varchar(20)
client_uri text
logo_uri text
policy_uri text
tos_uri text
is_first_party boolean [default: false]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
}
table oidc_consents {
user_id text [not null]
client_id varchar(255) [not null]
scopes text[] [not null]
expires_at "timestamp with time zone"
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(user_id, client_id) [pk]
}
}
table oidc_device_codes {
id varchar(255) [pk, not null]
data jsonb [not null]
expires_at "timestamp with time zone" [not null]
consumed_at "timestamp with time zone"
user_id text
client_id varchar(255) [not null]
grant_id varchar(255)
user_code varchar(255)
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'oidc_device_codes_user_id_idx']
}
}
table oidc_grants {
id varchar(255) [pk, not null]
data jsonb [not null]
expires_at "timestamp with time zone" [not null]
consumed_at "timestamp with time zone"
user_id text [not null]
client_id varchar(255) [not null]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'oidc_grants_user_id_idx']
}
}
table oidc_interactions {
id varchar(255) [pk, not null]
data jsonb [not null]
expires_at "timestamp with time zone" [not null]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
}
table oidc_refresh_tokens {
id varchar(255) [pk, not null]
data jsonb [not null]
expires_at "timestamp with time zone" [not null]
consumed_at "timestamp with time zone"
user_id text [not null]
client_id varchar(255) [not null]
grant_id varchar(255)
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'oidc_refresh_tokens_user_id_idx']
}
}
table oidc_sessions {
id varchar(255) [pk, not null]
data jsonb [not null]
expires_at "timestamp with time zone" [not null]
user_id text [not null]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'oidc_sessions_user_id_idx']
}
}
table chunks {
id uuid [pk, not null, default: `gen_random_uuid()`]
text text
abstract text
metadata jsonb
index integer
type varchar
client_id text
user_id text
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(client_id, user_id) [name: 'chunks_client_id_user_id_unique', unique]
user_id [name: 'chunks_user_id_idx']
}
}
table document_chunks {
document_id varchar(30) [not null]
chunk_id uuid [not null]
page_index integer
user_id text [not null]
created_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(document_id, chunk_id) [pk]
document_id [name: 'document_chunks_document_id_idx']
chunk_id [name: 'document_chunks_chunk_id_idx']
user_id [name: 'document_chunks_user_id_idx']
}
}
table embeddings {
id uuid [pk, not null, default: `gen_random_uuid()`]
chunk_id uuid [unique]
embeddings vector(1024)
model text
client_id text
user_id text
indexes {
(client_id, user_id) [name: 'embeddings_client_id_user_id_unique', unique]
chunk_id [name: 'embeddings_chunk_id_idx']
user_id [name: 'embeddings_user_id_idx']
}
}
table unstructured_chunks {
id uuid [pk, not null, default: `gen_random_uuid()`]
text text
metadata jsonb
index integer
type varchar
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
parent_id varchar
composite_id uuid
client_id text
user_id text
file_id varchar
indexes {
(client_id, user_id) [name: 'unstructured_chunks_client_id_user_id_unique', unique]
user_id [name: 'unstructured_chunks_user_id_idx']
composite_id [name: 'unstructured_chunks_composite_id_idx']
file_id [name: 'unstructured_chunks_file_id_idx']
}
}
table rag_eval_dataset_records {
id text [pk, not null]
dataset_id text [not null]
ideal text
question text
reference_files text[]
metadata jsonb
user_id text
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'rag_eval_dataset_records_user_id_idx']
}
}
table rag_eval_datasets {
id text [pk, not null]
description text
name text [not null]
knowledge_base_id text
user_id text
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'rag_eval_datasets_user_id_idx']
}
}
table rag_eval_evaluations {
id text [pk, not null]
name text [not null]
description text
eval_records_url text
status text
error jsonb
dataset_id text [not null]
knowledge_base_id text
language_model text
embedding_model text
user_id text
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'rag_eval_evaluations_user_id_idx']
}
}
table rag_eval_evaluation_records {
id text [pk, not null]
question text [not null]
answer text
context text[]
ideal text
status text
error jsonb
language_model text
embedding_model text
question_embedding_id uuid
duration integer
dataset_record_id text [not null]
evaluation_id text [not null]
user_id text
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'rag_eval_evaluation_records_user_id_idx']
}
}
table rbac_permissions {
id text [pk, not null]
code text [not null, unique]
name text [not null]
description text
category text [not null]
is_active boolean [not null, default: true]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
}
table rbac_role_permissions {
role_id text [not null]
permission_id text [not null]
created_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(role_id, permission_id) [pk]
role_id [name: 'rbac_role_permissions_role_id_idx']
permission_id [name: 'rbac_role_permissions_permission_id_idx']
}
}
table rbac_roles {
id text [pk, not null]
name text [not null, unique]
display_name text [not null]
description text
is_system boolean [not null, default: false]
is_active boolean [not null, default: true]
metadata jsonb [default: `{}`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
}
table rbac_user_roles {
user_id text [not null]
role_id text [not null]
created_at "timestamp with time zone" [not null, default: `now()`]
expires_at "timestamp with time zone"
indexes {
(user_id, role_id) [pk]
user_id [name: 'rbac_user_roles_user_id_idx']
role_id [name: 'rbac_user_roles_role_id_idx']
}
}
table agents_to_sessions {
agent_id text [not null]
session_id text [not null]
user_id text [not null]
indexes {
(agent_id, session_id) [pk]
session_id [name: 'agents_to_sessions_session_id_idx']
agent_id [name: 'agents_to_sessions_agent_id_idx']
user_id [name: 'agents_to_sessions_user_id_idx']
}
}
table file_chunks {
file_id varchar
chunk_id uuid
created_at "timestamp with time zone" [not null, default: `now()`]
user_id text [not null]
indexes {
(file_id, chunk_id) [pk]
user_id [name: 'file_chunks_user_id_idx']
file_id [name: 'file_chunks_file_id_idx']
chunk_id [name: 'file_chunks_chunk_id_idx']
}
}
table files_to_sessions {
file_id text [not null]
session_id text [not null]
user_id text [not null]
indexes {
(file_id, session_id) [pk]
user_id [name: 'files_to_sessions_user_id_idx']
file_id [name: 'files_to_sessions_file_id_idx']
session_id [name: 'files_to_sessions_session_id_idx']
}
}
table session_groups {
id text [pk, not null]
name text [not null]
sort integer
user_id text [not null]
client_id text
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(client_id, user_id) [name: 'session_groups_client_id_user_id_unique', unique]
user_id [name: 'session_groups_user_id_idx']
}
}
table sessions {
id text [pk, not null]
slug varchar(100) [not null]
title text
description text
avatar text
background_color text
type text [default: 'agent']
user_id text [not null]
group_id text
client_id text
pinned boolean [default: false]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(slug, user_id) [name: 'slug_user_id_unique', unique]
(client_id, user_id) [name: 'sessions_client_id_user_id_unique', unique]
user_id [name: 'sessions_user_id_idx']
(id, user_id) [name: 'sessions_id_user_id_idx']
(user_id, updated_at) [name: 'sessions_user_id_updated_at_idx']
group_id [name: 'sessions_group_id_idx']
}
}
👷 build: add agent task system database schema (#13280) * 🗃️ chore: add agent task system database schema Add 6 new tables for the Agent Task System: - tasks: core task with tree structure, heartbeat, scheduling - task_dependencies: inter-task dependency graph (blocks/relates) - task_documents: MVP workspace document pinning - task_topics: topic tracking with handoff (jsonb) and review results - task_comments: user/agent comments with author tracking (text id: cmt_) - briefs: unresolved notification system (text id: brf_) All sub-tables include userId FK for row-level user isolation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add self-referential FK on tasks.parentTaskId (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: use foreignKey() for self-referential parentTaskId to avoid TS circular inference Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on task_topics.topic_id → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: resolve pre-existing TS type-check errors - Fix i18next defaultValue type (string | null → string) - Fix i18next options type mismatches - Fix fieldTags.webhook possibly undefined Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on tasks.currentTopicId → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK constraints for assignee, author, topic, and parent fields - tasks.assigneeUserId → users.id (ON DELETE SET NULL) - tasks.assigneeAgentId → agents.id (ON DELETE SET NULL) - tasks.parentTaskId → tasks.id (ON DELETE SET NULL) - tasks.currentTopicId → topics.id (ON DELETE SET NULL) - task_comments.authorUserId → users.id (ON DELETE SET NULL) - task_comments.authorAgentId → agents.id (ON DELETE SET NULL) - task_topics.topicId → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: change task_topics.topicId FK to ON DELETE CASCADE Topic deleted → task_topic mapping row removed (not just nulled). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: use inline .references() for currentTopicId FK No circular inference issue — only parentTaskId (self-ref) needs foreignKey(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on task_comments.briefId and topicId (ON DELETE SET NULL) - task_comments.briefId → briefs.id (SET NULL) - task_comments.topicId → topics.id (SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: merge briefs table into task.ts to fix circular dependency brief.ts imported task.ts (briefs.taskId FK) and task.ts imported brief.ts (taskComments.briefId FK), causing circular dependency error. Merged briefs into task.ts since briefs are part of the task system. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on tasks.createdByAgentId → agents.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 05:56:01 +00:00
table briefs {
id text [pk, not null]
user_id text [not null]
task_id text
cron_job_id text
topic_id text
agent_id text
type text [not null]
priority text [default: 'info']
title text [not null]
summary text [not null]
artifacts jsonb
actions jsonb
resolved_action text
resolved_comment text
read_at "timestamp with time zone"
resolved_at "timestamp with time zone"
created_at "timestamp with time zone" [not null, default: `now()`]
indexes {
user_id [name: 'briefs_user_id_idx']
task_id [name: 'briefs_task_id_idx']
cron_job_id [name: 'briefs_cron_job_id_idx']
agent_id [name: 'briefs_agent_id_idx']
type [name: 'briefs_type_idx']
priority [name: 'briefs_priority_idx']
(user_id, resolved_at) [name: 'briefs_unresolved_idx']
}
}
table task_comments {
id text [pk, not null]
task_id text [not null]
user_id text [not null]
author_user_id text
author_agent_id text
content text [not null]
editor_data jsonb
brief_id text
topic_id text
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
task_id [name: 'task_comments_task_id_idx']
user_id [name: 'task_comments_user_id_idx']
author_user_id [name: 'task_comments_author_user_id_idx']
author_agent_id [name: 'task_comments_agent_id_idx']
brief_id [name: 'task_comments_brief_id_idx']
topic_id [name: 'task_comments_topic_id_idx']
}
}
table task_dependencies {
id uuid [pk, not null, default: `gen_random_uuid()`]
task_id text [not null]
depends_on_id text [not null]
user_id text [not null]
type text [not null, default: 'blocks']
condition jsonb
created_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(task_id, depends_on_id) [name: 'task_deps_unique_idx', unique]
task_id [name: 'task_deps_task_id_idx']
depends_on_id [name: 'task_deps_depends_on_id_idx']
user_id [name: 'task_deps_user_id_idx']
}
}
table task_documents {
id uuid [pk, not null, default: `gen_random_uuid()`]
task_id text [not null]
document_id text [not null]
user_id text [not null]
pinned_by text [not null, default: 'agent']
created_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(task_id, document_id) [name: 'task_docs_unique_idx', unique]
task_id [name: 'task_docs_task_id_idx']
document_id [name: 'task_docs_document_id_idx']
user_id [name: 'task_docs_user_id_idx']
}
}
table task_topics {
id uuid [pk, not null, default: `gen_random_uuid()`]
task_id text [not null]
topic_id text
user_id text [not null]
seq integer [not null]
operation_id text
status text [not null, default: 'running']
handoff jsonb
review_passed integer
review_score integer
review_scores jsonb
review_iteration integer
reviewed_at "timestamp with time zone"
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(task_id, topic_id) [name: 'task_topics_unique_idx', unique]
task_id [name: 'task_topics_task_id_idx']
topic_id [name: 'task_topics_topic_id_idx']
user_id [name: 'task_topics_user_id_idx']
(task_id, status) [name: 'task_topics_status_idx']
}
}
table tasks {
id text [pk, not null]
identifier text [not null]
seq integer [not null]
created_by_user_id text [not null]
created_by_agent_id text
assignee_user_id text
assignee_agent_id text
parent_task_id text
name text
description varchar(255)
instruction text [not null]
status text [not null, default: 'backlog']
priority integer [default: 0]
sort_order integer [default: 0]
automation_mode text
heartbeat_interval integer
👷 build: add agent task system database schema (#13280) * 🗃️ chore: add agent task system database schema Add 6 new tables for the Agent Task System: - tasks: core task with tree structure, heartbeat, scheduling - task_dependencies: inter-task dependency graph (blocks/relates) - task_documents: MVP workspace document pinning - task_topics: topic tracking with handoff (jsonb) and review results - task_comments: user/agent comments with author tracking (text id: cmt_) - briefs: unresolved notification system (text id: brf_) All sub-tables include userId FK for row-level user isolation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add self-referential FK on tasks.parentTaskId (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: use foreignKey() for self-referential parentTaskId to avoid TS circular inference Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on task_topics.topic_id → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: resolve pre-existing TS type-check errors - Fix i18next defaultValue type (string | null → string) - Fix i18next options type mismatches - Fix fieldTags.webhook possibly undefined Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on tasks.currentTopicId → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK constraints for assignee, author, topic, and parent fields - tasks.assigneeUserId → users.id (ON DELETE SET NULL) - tasks.assigneeAgentId → agents.id (ON DELETE SET NULL) - tasks.parentTaskId → tasks.id (ON DELETE SET NULL) - tasks.currentTopicId → topics.id (ON DELETE SET NULL) - task_comments.authorUserId → users.id (ON DELETE SET NULL) - task_comments.authorAgentId → agents.id (ON DELETE SET NULL) - task_topics.topicId → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: change task_topics.topicId FK to ON DELETE CASCADE Topic deleted → task_topic mapping row removed (not just nulled). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: use inline .references() for currentTopicId FK No circular inference issue — only parentTaskId (self-ref) needs foreignKey(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on task_comments.briefId and topicId (ON DELETE SET NULL) - task_comments.briefId → briefs.id (SET NULL) - task_comments.topicId → topics.id (SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: merge briefs table into task.ts to fix circular dependency brief.ts imported task.ts (briefs.taskId FK) and task.ts imported brief.ts (taskComments.briefId FK), causing circular dependency error. Merged briefs into task.ts since briefs are part of the task system. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on tasks.createdByAgentId → agents.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 05:56:01 +00:00
heartbeat_timeout integer
last_heartbeat_at "timestamp with time zone"
schedule_pattern text
schedule_timezone text [default: 'UTC']
total_topics integer [default: 0]
max_topics integer
current_topic_id text
context jsonb [default: `{}`]
config jsonb [default: `{}`]
error text
started_at "timestamp with time zone"
completed_at "timestamp with time zone"
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(identifier, created_by_user_id) [name: 'tasks_identifier_idx', unique]
created_by_user_id [name: 'tasks_created_by_user_id_idx']
created_by_agent_id [name: 'tasks_created_by_agent_id_idx']
assignee_user_id [name: 'tasks_assignee_user_id_idx']
assignee_agent_id [name: 'tasks_assignee_agent_id_idx']
parent_task_id [name: 'tasks_parent_task_id_idx']
status [name: 'tasks_status_idx']
priority [name: 'tasks_priority_idx']
automation_mode [name: 'tasks_automation_mode_idx']
👷 build: add agent task system database schema (#13280) * 🗃️ chore: add agent task system database schema Add 6 new tables for the Agent Task System: - tasks: core task with tree structure, heartbeat, scheduling - task_dependencies: inter-task dependency graph (blocks/relates) - task_documents: MVP workspace document pinning - task_topics: topic tracking with handoff (jsonb) and review results - task_comments: user/agent comments with author tracking (text id: cmt_) - briefs: unresolved notification system (text id: brf_) All sub-tables include userId FK for row-level user isolation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add self-referential FK on tasks.parentTaskId (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: use foreignKey() for self-referential parentTaskId to avoid TS circular inference Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on task_topics.topic_id → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🐛 fix: resolve pre-existing TS type-check errors - Fix i18next defaultValue type (string | null → string) - Fix i18next options type mismatches - Fix fieldTags.webhook possibly undefined Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on tasks.currentTopicId → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK constraints for assignee, author, topic, and parent fields - tasks.assigneeUserId → users.id (ON DELETE SET NULL) - tasks.assigneeAgentId → agents.id (ON DELETE SET NULL) - tasks.parentTaskId → tasks.id (ON DELETE SET NULL) - tasks.currentTopicId → topics.id (ON DELETE SET NULL) - task_comments.authorUserId → users.id (ON DELETE SET NULL) - task_comments.authorAgentId → agents.id (ON DELETE SET NULL) - task_topics.topicId → topics.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: change task_topics.topicId FK to ON DELETE CASCADE Topic deleted → task_topic mapping row removed (not just nulled). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: use inline .references() for currentTopicId FK No circular inference issue — only parentTaskId (self-ref) needs foreignKey(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on task_comments.briefId and topicId (ON DELETE SET NULL) - task_comments.briefId → briefs.id (SET NULL) - task_comments.topicId → topics.id (SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * ♻️ refactor: merge briefs table into task.ts to fix circular dependency brief.ts imported task.ts (briefs.taskId FK) and task.ts imported brief.ts (taskComments.briefId FK), causing circular dependency error. Merged briefs into task.ts since briefs are part of the task system. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * 🗃️ chore: add FK on tasks.createdByAgentId → agents.id (ON DELETE SET NULL) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-26 05:56:01 +00:00
(status, last_heartbeat_at) [name: 'tasks_heartbeat_idx']
}
}
table threads {
id text [pk, not null]
title text
content text
editor_data jsonb
type text [not null]
status text
topic_id text [not null]
source_message_id text
parent_thread_id text
client_id text
agent_id text
group_id text
metadata jsonb
user_id text [not null]
last_active_at "timestamp with time zone" [default: `now()`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(client_id, user_id) [name: 'threads_client_id_user_id_unique', unique]
user_id [name: 'threads_user_id_idx']
topic_id [name: 'threads_topic_id_idx']
✨ feat: support agent benchmark (#12355) * improve total fix page size issue fix error message handler fix eval home page try to fix batch run agent step issue fix run list fix dataset loading fix abort issue improve jump and table column fix error streaming try to fix error output in vercel refactor qstash workflow client improve passK add evals to proxy refactor metrics try to fix build refactor tests improve detail page fix passK issue improve eval-rubric fix types support passK fix type update fix db insert issue improve dataset ui improve run config finish step limit now add step limited 100% coverage to models add failed tests todo support interruptOperation fix lint improve report detail improve pass rate improve sort order issue fix timeout issue Update db schema 完整 case 跑通 update database improve error handling refactor to improve database 优化 test case 的处理流程 优化部分细节体验和实现 基本完成 Benchmark 全流程功能 优化 run case 展示 优化 run case 序号问题 优化 eval test case 页面 新增 eval test 模式 新增 dataset 页面 update schema support finish create test run fix update improve import exp refactor data flow improve import workflow rubric Benchmark detail 页面 improve import ux update schema finish eval home page add eval workflow endpoint implement benchmark run model refactor RAG eval implement backend update db schema update db migration init benchmark * support rerun error test case * fix tests * fix tests
2026-02-21 12:36:40 +00:00
type [name: 'threads_type_idx']
agent_id [name: 'threads_agent_id_idx']
group_id [name: 'threads_group_id_idx']
parent_thread_id [name: 'threads_parent_thread_id_idx']
}
}
table topic_documents {
document_id text [not null]
topic_id text [not null]
user_id text [not null]
created_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(document_id, topic_id) [pk]
user_id [name: 'topic_documents_user_id_idx']
topic_id [name: 'topic_documents_topic_id_idx']
document_id [name: 'topic_documents_document_id_idx']
}
}
table topic_shares {
id text [pk, not null]
topic_id text [not null]
user_id text [not null]
visibility text [not null, default: 'private']
page_view_count integer [not null, default: 0]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
topic_id [name: 'topic_shares_topic_id_unique', unique]
user_id [name: 'topic_shares_user_id_idx']
}
}
table topics {
id text [pk, not null]
title text
favorite boolean [default: false]
session_id text
content text
editor_data jsonb
agent_id text
group_id text
user_id text [not null]
client_id text
description text
history_summary text
metadata jsonb
trigger text
mode text
status text
completed_at "timestamp with time zone"
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(client_id, user_id) [name: 'topics_client_id_user_id_unique', unique]
user_id [name: 'topics_user_id_idx']
(id, user_id) [name: 'topics_id_user_id_idx']
session_id [name: 'topics_session_id_idx']
group_id [name: 'topics_group_id_idx']
agent_id [name: 'topics_agent_id_idx']
✨ feat: support agent benchmark (#12355) * improve total fix page size issue fix error message handler fix eval home page try to fix batch run agent step issue fix run list fix dataset loading fix abort issue improve jump and table column fix error streaming try to fix error output in vercel refactor qstash workflow client improve passK add evals to proxy refactor metrics try to fix build refactor tests improve detail page fix passK issue improve eval-rubric fix types support passK fix type update fix db insert issue improve dataset ui improve run config finish step limit now add step limited 100% coverage to models add failed tests todo support interruptOperation fix lint improve report detail improve pass rate improve sort order issue fix timeout issue Update db schema 完整 case 跑通 update database improve error handling refactor to improve database 优化 test case 的处理流程 优化部分细节体验和实现 基本完成 Benchmark 全流程功能 优化 run case 展示 优化 run case 序号问题 优化 eval test case 页面 新增 eval test 模式 新增 dataset 页面 update schema support finish create test run fix update improve import exp refactor data flow improve import workflow rubric Benchmark detail 页面 improve import ux update schema finish eval home page add eval workflow endpoint implement benchmark run model refactor RAG eval implement backend update db schema update db migration init benchmark * support rerun error test case * fix tests * fix tests
2026-02-21 12:36:40 +00:00
trigger [name: 'topics_trigger_idx']
status [name: 'topics_status_idx']
(user_id, completed_at) [name: 'topics_user_id_completed_at_idx']
() [name: 'topics_extract_status_gin_idx']
}
}
table user_installed_plugins {
user_id text [not null]
identifier text [not null]
type text [not null]
manifest jsonb
settings jsonb
custom_params jsonb
source varchar(255)
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(user_id, identifier) [pk]
}
}
table user_settings {
id text [pk, not null]
tts jsonb
hotkey jsonb
key_vaults text
general jsonb
language_model jsonb
system_agent jsonb
default_agent jsonb
market jsonb
memory jsonb
tool jsonb
image jsonb
notification jsonb
}
table users {
id text [pk, not null]
username text [unique]
email text [unique]
normalized_email text [unique]
avatar text
phone text [unique]
first_name text
last_name text
full_name text
interests "varchar(64)[]"
is_onboarded boolean [default: false]
✨ feat(onboarding): agent web onboarding, feature toggle, and lifecycle sync (#13139) * ✨ feat(onboarding): add agent-guided web onboarding flow Made-with: Cursor * Update onboarding prompts Co-authored-by: Codex <noreply@openai.com> * 🐛 fix web onboarding builtin tool flow * ✨ feat(onboarding): enhance agent onboarding flow with new dimensions and refined rules - Updated onboarding structure to include new nodes: agentIdentity, userIdentity, workStyle, workContext, and painPoints. - Revised system role instructions to emphasize a conversational approach and concise interactions. - Adjusted manifest and type definitions to reflect the new onboarding schema. - Implemented tests to ensure proper functionality of the onboarding context and flow. This update aims to improve user experience during onboarding by making it more engaging and structured. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): enhance onboarding experience with localized welcome messages and interaction hints - Added localized welcome messages for onboarding in English and Chinese. - Refactored system role handling to support dynamic interaction hints based on user locale. - Updated onboarding context to include interaction hints for improved user engagement. - Implemented tests to validate the new interaction hint functionality. This update aims to create a more personalized and engaging onboarding experience for users across different languages. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): overhaul onboarding flow with new question structure and refined interaction rules - Replaced existing interaction hints with a focused question structure to enhance user engagement. - Updated system role instructions to clarify onboarding protocols and improve conversational flow. - Refactored type definitions and manifest to align with the new onboarding schema. - Removed deprecated interaction hint components and tests to streamline the codebase. This update aims to create a more structured and engaging onboarding experience for users, ensuring clarity and efficiency in interactions. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): introduce builtin agent onboarding package with structured roles and prompts - Added a new package for agent onboarding, including a package.json configuration and initial TypeScript files. - Implemented system role templates and tool prompts to guide the onboarding process. - Established a client interface for rendering questions and handling user interactions. - Updated dependencies in related packages to integrate the new onboarding functionality. This update aims to enhance the onboarding experience by providing a structured approach for agents, ensuring clarity and efficiency in user interactions. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): enhance agent onboarding with new question renderer and refined interaction logic - Introduced a new `QuestionRendererView` component to streamline the rendering of onboarding questions. - Refactored the `QuestionRenderer` to utilize a runtime hook for improved state management and separation of concerns. - Updated the onboarding context to fallback to stored questions when the current question is empty, enhancing user experience. - Simplified the onboarding API by removing unnecessary read token requirements from various endpoints. - Added tests to validate the new question rendering logic and ensure proper functionality. This update aims to create a more efficient and user-friendly onboarding experience by improving the question handling and rendering process. Signed-off-by: Innei <tukon479@gmail.com> * Add dev history view for onboarding * remove: prosetting Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): inline response language step in agent conversation - Add ResponseLanguageInlineStep and wire into Conversation flow - Extend agent onboarding context and update ResponseLanguageStep route - Add tests and onboarding agent document design spec Made-with: Cursor * ✨ feat(onboarding): enhance onboarding flow with inbox integration and schema refactor - Updated onboarding process to migrate conversation topics to the inbox upon completion, ensuring users can revisit their onboarding discussions. - Introduced a new schema-driven normalizer and node handler registry to streamline onboarding data handling, reducing code duplication and improving maintainability. - Added comprehensive tests for new document builders and onboarding service methods to ensure functionality and reliability. - Refactored existing components to support the new onboarding structure and improve user experience. This update aims to create a more cohesive onboarding experience by integrating user identity data into the inbox and simplifying the underlying code structure. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(agent-documents): add listDocuments, readDocumentByFilename, upsertDocumentByFilename APIs * ✨ feat(onboarding): add generic user interaction builtin tool * ✨ feat(onboarding): wire generic tool interaction semantics Register user-interaction tool in builtin-tools registry with manifest, intervention components, client executor, and server runtime. Extend BuiltinInterventionProps with interactionMode and onInteractionAction to support custom (non-approval) interaction UIs. Add submit/skip/cancel actions to conversation store with full operation lifecycle management. * 🔧 fix: add builtin-tool-user-interaction to root workspace dependencies * ♻️ refactor(onboarding): remove onboarding-owned question persistence Drop askUserQuestion from the web-onboarding tool and remove questionSurface from persisted state. Question presentation is now delegated to the generic lobe-user-interaction tool. * ♻️ refactor(onboarding): switch UI to generic interaction tool Enable UserInteraction and AgentDocuments tools in web-onboarding and inbox agent configs. Remove obsolete inline question renderers (QuestionRenderer, QuestionRendererView, questionRendererRuntime, questionRendererSchema, ResponseLanguageInlineStep) and simplify Conversation component to only render summary CTA. * 🔥 refactor(onboarding): remove identity doc and rewrite soul sync * 🐛 fix(user-interaction): add humanIntervention to manifest and implement form UI * 🐛 fix(onboarding): create user message on interaction submit instead of re-executing tool * ♻️ refactor(onboarding): rebuild generic interaction flow Align agent/tool roles and onboarding UI/runtime around the generic interaction rebuild. Made-with: Cursor * ✨ feat(onboarding): implement onboarding document and persona management Introduce a new onboarding document structure that separates agent identity and user persona data. Replace existing `readSoulDocument` and `updateSoulDocument` APIs with `readDocument` and `updateDocument` to handle both SOUL.md and user persona documents. Update related services, client executors, and localization keys to reflect these changes. Ensure document updates are driven by the agent, allowing for incremental updates and improved content management. Signed-off-by: Innei <tukon479@gmail.com> * refactor Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(workflow): introduce unified tool call collapse UI and supporting components Add a new workflow collapse feature that groups tool calls and reasoning into a single collapsible unit, enhancing the user interface for tool call progress. This includes the creation of several components: `WorkflowCollapse`, `WorkflowSummary`, `WorkflowExpandedList`, `WorkflowToolLine`, and `WorkflowReasoningLine`. Update the design specifications and implementation plans to reflect this new structure, aiming for a more cohesive and user-friendly experience. Signed-off-by: Innei <tukon479@gmail.com> * feat(types): add discovery pacing types and constant * feat(onboarding): add countTopicUserMessages and pacing gate to derivePhase * feat(onboarding): capture discovery baseline and return pacing data in getState * ✨ feat(onboarding): add pacing hints to discovery phase tool result * test(onboarding): add discovery pacing gate tests * ♻️ refactor(onboarding): soften discovery pacing gate and add early exit exception - MIN_DISCOVERY_USER_MESSAGES lowered from 4 to 2 (hard floor) - RECOMMENDED_DISCOVERY_USER_MESSAGES = 4 (advisory hint) - Tool protocol rule 2 now has explicit early exit exception - Pacing hint text changed from imperative to advisory * ✨ feat(onboarding): update .gitignore and remove outdated onboarding plans - Added `docs/superpowers` to .gitignore to exclude documentation files from version control. - Deleted several outdated onboarding implementation plans, including those for onboarding inbox integration, generic interaction rebuild, and user question simplification, to streamline project documentation. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): refine agent onboarding, streaming, and AskUserQuestion Made-with: Cursor * ✨ feat(store): add pending interventions selector * 🐛 fix(store): handle standalone tool messages and structural children traversal in pending interventions selector * ✨ feat(conversation): create InterventionBar component Add InterventionBar UI component with tab bar for multiple pending interventions, reusing the existing Intervention detail component. * 🐛 fix(conversation): use stable toolCallId for active tab state and add min-height: 0 Track active intervention by toolCallId instead of array index to prevent stale selection when interventions are resolved. Add min-height: 0 to scrollable content for correct overflow in flex column layout. * feat(chatinput): show InterventionBar when pending interventions exist * feat(tool): collapse inline intervention to one-line summary with scroll-to-bottom * feat(i18n): add intervention bar translation keys * 🐛 fix(chatinput): prevent infinite render loop from pendingInterventions selector * 🐛 fix(chatinput): use equality function for pendingInterventions to break render loop * refactor(tool): remove CollapsedIntervention, return null for pending inline * feat(i18n): add form.other translation key * feat(tool): add styles for select field with Other option * feat(tool): add SelectFieldInput with Other option row * feat(tool): wire SelectFieldInput and update validation in AskUserQuestion * fix(tool): add keyboard handler to Other row, fix label flex * refactor(tool): restore Select dropdown, add Other toggle row below * refactor(tool): change Other to form-level escape hatch, restore antd Select * refactor(tool): replace checkbox toggle with minimal text link escape hatch * feat(tool): use lucide icons, auto-focus on escape toggle, createStaticStyles * refactor(onboarding): update onboarding model references and improve styling in ModeSwitch component Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): add greeting entry animation keyframes and card styles * ✨ feat(onboarding): add LogoThree and entry animations to greeting card * ✨ feat(onboarding): add View Transition morph from greeting to conversation * refactor(onboarding): simplify ModeSwitch component by removing segmentedGlass styling Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): increase maximum onboarding steps to 5 and add ProSettingsStep component Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: enhance user interaction question handling with validation schema - Introduced Zod validation for askUserQuestion arguments to ensure correct structure. - Updated test to reflect new question format with fields. - Added error handling in AskUserQuestion component to log submission errors. This improves the robustness of user interactions by enforcing schema validation and enhancing error reporting. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: enhance agent metadata handling and onboarding synchronization - Updated `useAgentMeta` to prioritize custom titles from the database, falling back to the default Lobe AI title if none exists. - Integrated `refreshBuiltinAgent` into the onboarding process to ensure the latest agent data is reflected during user interactions. - Adjusted the `InboxItem` component to display the correct agent title and avatar based on the updated metadata. - Refactored optimistic update actions to improve message handling and synchronization across components. This improves the user experience by ensuring that the most relevant agent information is displayed and updated in real-time during onboarding and conversation flows. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: enhance conversation lifecycle and onboarding agent synchronization - Updated `ConversationLifecycleActionImpl` to include additional context parameters (agentId, groupId, threadId, topicId) when updating message plugins for aborted interactions. - Integrated `refreshBuiltinAgent` for the inbox during the onboarding process to ensure the latest agent data is synchronized. These changes improve the handling of conversation lifecycle events and ensure that onboarding reflects the most current agent information, enhancing user experience during interactions. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: implement agent onboarding feature toggle and enhance ModeSwitch component - Introduced `AGENT_ONBOARDING_ENABLED` configuration to control the visibility of the agent onboarding options. - Updated `ModeSwitch` component to conditionally render onboarding options based on the feature toggle. - Enhanced tests for `ModeSwitch` to cover scenarios for both enabled and disabled states of agent onboarding. - Refactored `AgentOnboardingRoute` to navigate to the classic onboarding if the agent onboarding feature is disabled. These changes improve the onboarding experience by allowing dynamic control over the agent onboarding feature, ensuring that users only see relevant options based on the configuration. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: update agent onboarding feature toggle to include development mode - Modified `AGENT_ONBOARDING_ENABLED` to also activate in development mode using `isDev`. - This change allows for easier testing and development of the agent onboarding feature without needing to alter production configurations. Signed-off-by: Innei <tukon479@gmail.com> * Prevent welcome message when onboard * 🐛 fix: satisfy ToolExecutionContext and updateMessageTools typings Made-with: Cursor * 🐛 fix: update tests for custom builtin agent title and discovery phase constants * 🐛 fix: use custom inbox agent title and avatar in InboxWelcome * 🧹 chore(onboarding): remove HistoryPanel unit test Made-with: Cursor * 🐛 fix: add missing onboarding/agent and onboarding/classic routes to desktop config * ✅ test: fix failing tests for onboarding container, document helpers, and executor * ✅ test: mock LogoThree to prevent Spline runtime fetch errors in CI --------- Signed-off-by: Innei <tukon479@gmail.com> Co-authored-by: Codex <noreply@openai.com>
2026-03-30 12:28:54 +00:00
agent_onboarding jsonb
onboarding jsonb
clerk_created_at "timestamp with time zone"
2025-11-27 12:10:40 +00:00
email_verified boolean [not null, default: false]
email_verified_at "timestamp with time zone"
preference jsonb
role text
banned boolean [default: false]
ban_reason text
ban_expires "timestamp with time zone"
two_factor_enabled boolean [default: false]
phone_number_verified boolean
last_active_at "timestamp with time zone" [not null, default: `now()`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
email [name: 'users_email_idx']
username [name: 'users_username_idx']
created_at [name: 'users_created_at_idx']
created_at [name: 'users_banned_true_created_at_idx']
}
}
table user_memories {
id varchar(255) [pk, not null]
user_id text
memory_category varchar(255)
memory_layer varchar(255)
memory_type varchar(255)
metadata jsonb
tags text[]
title varchar(255)
summary text
summary_vector_1024 vector(1024)
details text
details_vector_1024 vector(1024)
status varchar(255)
accessed_count bigint [default: 0]
last_accessed_at "timestamp with time zone" [not null]
captured_at "timestamp with time zone" [not null, default: `now()`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
summary_vector_1024 [name: 'user_memories_summary_vector_1024_index']
details_vector_1024 [name: 'user_memories_details_vector_1024_index']
user_id [name: 'user_memories_user_id_index']
}
}
table user_memories_activities {
id varchar(255) [pk, not null]
user_id text
user_memory_id varchar(255)
metadata jsonb
tags text[]
type varchar(255) [not null]
status varchar(255) [not null, default: 'pending']
timezone varchar(255)
starts_at "timestamp with time zone"
ends_at "timestamp with time zone"
associated_objects jsonb
associated_subjects jsonb
associated_locations jsonb
notes text
narrative text
narrative_vector vector(1024)
feedback text
feedback_vector vector(1024)
captured_at "timestamp with time zone" [not null, default: `now()`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
narrative_vector [name: 'user_memories_activities_narrative_vector_index']
feedback_vector [name: 'user_memories_activities_feedback_vector_index']
type [name: 'user_memories_activities_type_index']
user_id [name: 'user_memories_activities_user_id_index']
user_memory_id [name: 'user_memories_activities_user_memory_id_index']
status [name: 'user_memories_activities_status_index']
}
}
table user_memories_contexts {
id varchar(255) [pk, not null]
user_id text
user_memory_ids jsonb
metadata jsonb
tags text[]
associated_objects jsonb
associated_subjects jsonb
title text
description text
description_vector vector(1024)
type varchar(255)
current_status text
score_impact numeric [default: 0]
score_urgency numeric [default: 0]
captured_at "timestamp with time zone" [not null, default: `now()`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
description_vector [name: 'user_memories_contexts_description_vector_index']
type [name: 'user_memories_contexts_type_index']
user_id [name: 'user_memories_contexts_user_id_index']
}
}
table user_memories_experiences {
id varchar(255) [pk, not null]
user_id text
user_memory_id varchar(255)
metadata jsonb
tags text[]
type varchar(255)
situation text
situation_vector vector(1024)
reasoning text
possible_outcome text
action text
action_vector vector(1024)
key_learning text
key_learning_vector vector(1024)
score_confidence real [default: 0]
captured_at "timestamp with time zone" [not null, default: `now()`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
situation_vector [name: 'user_memories_experiences_situation_vector_index']
action_vector [name: 'user_memories_experiences_action_vector_index']
key_learning_vector [name: 'user_memories_experiences_key_learning_vector_index']
type [name: 'user_memories_experiences_type_index']
user_id [name: 'user_memories_experiences_user_id_index']
user_memory_id [name: 'user_memories_experiences_user_memory_id_index']
}
}
table user_memories_identities {
id varchar(255) [pk, not null]
user_id text
user_memory_id varchar(255)
metadata jsonb
tags text[]
type varchar(255)
description text
description_vector vector(1024)
episodic_date "timestamp with time zone"
relationship varchar(255)
role text
captured_at "timestamp with time zone" [not null, default: `now()`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
description_vector [name: 'user_memories_identities_description_vector_index']
type [name: 'user_memories_identities_type_index']
user_id [name: 'user_memories_identities_user_id_index']
user_memory_id [name: 'user_memories_identities_user_memory_id_index']
}
}
table user_memories_preferences {
id varchar(255) [pk, not null]
user_id text
user_memory_id varchar(255)
metadata jsonb
tags text[]
conclusion_directives text
conclusion_directives_vector vector(1024)
type varchar(255)
suggestions text
score_priority numeric [default: 0]
captured_at "timestamp with time zone" [not null, default: `now()`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
conclusion_directives_vector [name: 'user_memories_preferences_conclusion_directives_vector_index']
user_id [name: 'user_memories_preferences_user_id_index']
user_memory_id [name: 'user_memories_preferences_user_memory_id_index']
}
}
table user_memory_persona_document_histories {
id varchar(255) [pk, not null]
user_id text
persona_id varchar(255)
profile varchar(255) [not null, default: 'default']
snapshot_persona text
snapshot_tagline text
reasoning text
diff_persona text
diff_tagline text
snapshot text
summary text
edited_by varchar(255) [default: 'agent']
memory_ids jsonb
source_ids jsonb
metadata jsonb
previous_version integer
next_version integer
captured_at "timestamp with time zone" [not null, default: `now()`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
persona_id [name: 'user_persona_document_histories_persona_id_index']
user_id [name: 'user_persona_document_histories_user_id_index']
profile [name: 'user_persona_document_histories_profile_index']
}
}
table user_memory_persona_documents {
id varchar(255) [pk, not null]
user_id text
profile varchar(255) [not null, default: 'default']
tagline text
persona text
memory_ids jsonb
source_ids jsonb
metadata jsonb
version integer [not null, default: 1]
captured_at "timestamp with time zone" [not null, default: `now()`]
accessed_at "timestamp with time zone" [not null, default: `now()`]
created_at "timestamp with time zone" [not null, default: `now()`]
updated_at "timestamp with time zone" [not null, default: `now()`]
indexes {
(user_id, profile) [name: 'user_persona_documents_user_id_profile_unique', unique]
user_id [name: 'user_persona_documents_user_id_index']
}
}
ref: agent_skills.user_id - users.id
ref: agent_skills.zip_file_hash - global_files.hash_id
ref: accounts.user_id > users.id
ref: passkey.userId > users.id
ref: auth_sessions.user_id > users.id
ref: two_factor.user_id > users.id
✨ feat: support agent benchmark (#12355) * improve total fix page size issue fix error message handler fix eval home page try to fix batch run agent step issue fix run list fix dataset loading fix abort issue improve jump and table column fix error streaming try to fix error output in vercel refactor qstash workflow client improve passK add evals to proxy refactor metrics try to fix build refactor tests improve detail page fix passK issue improve eval-rubric fix types support passK fix type update fix db insert issue improve dataset ui improve run config finish step limit now add step limited 100% coverage to models add failed tests todo support interruptOperation fix lint improve report detail improve pass rate improve sort order issue fix timeout issue Update db schema 完整 case 跑通 update database improve error handling refactor to improve database 优化 test case 的处理流程 优化部分细节体验和实现 基本完成 Benchmark 全流程功能 优化 run case 展示 优化 run case 序号问题 优化 eval test case 页面 新增 eval test 模式 新增 dataset 页面 update schema support finish create test run fix update improve import exp refactor data flow improve import workflow rubric Benchmark detail 页面 improve import ux update schema finish eval home page add eval workflow endpoint implement benchmark run model refactor RAG eval implement backend update db schema update db migration init benchmark * support rerun error test case * fix tests * fix tests
2026-02-21 12:36:40 +00:00
ref: agent_eval_datasets.benchmark_id > agent_eval_benchmarks.id
ref: agent_eval_datasets.user_id - users.id
ref: agent_eval_run_topics.run_id > agent_eval_runs.id
ref: agent_eval_run_topics.topic_id - topics.id
ref: agent_eval_run_topics.test_case_id > agent_eval_test_cases.id
ref: agent_eval_runs.dataset_id > agent_eval_datasets.id
ref: agent_eval_runs.target_agent_id - agents.id
ref: agent_eval_runs.user_id - users.id
ref: agent_eval_test_cases.dataset_id > agent_eval_datasets.id
ref: agents_files.file_id > files.id
ref: agents_files.agent_id > agents.id
ref: agents_knowledge_bases.knowledge_base_id - knowledge_bases.id
ref: agents_knowledge_bases.agent_id > agents.id
ref: agents_to_sessions.session_id > sessions.id
ref: agents_to_sessions.agent_id > agents.id
ref: chat_groups_agents.chat_group_id > chat_groups.id
ref: chat_groups_agents.agent_id > agents.id
ref: chat_groups_agents.user_id - users.id
ref: chat_groups.user_id - users.id
ref: unstructured_chunks.file_id - files.id
ref: document_chunks.document_id > documents.id
ref: document_histories.document_id > documents.id
ref: document_histories.user_id - users.id
ref: documents.file_id > files.id
ref: file_chunks.file_id - files.id
ref: file_chunks.chunk_id - chunks.id
ref: generations.file_id - files.id
ref: files.embedding_task_id - async_tasks.id
ref: files_to_sessions.file_id > files.id
ref: files_to_sessions.session_id > sessions.id
ref: generation_batches.user_id - users.id
ref: generation_batches.generation_topic_id > generation_topics.id
ref: generation_topics.user_id - users.id
ref: generations.user_id - users.id
ref: generations.generation_batch_id > generation_batches.id
ref: generations.async_task_id - async_tasks.id
ref: message_groups.user_id - users.id
ref: message_groups.topic_id - topics.id
ref: message_groups.parent_group_id > message_groups.id
ref: messages_files.file_id > files.id
ref: messages_files.message_id > messages.id
ref: messages.id - message_translates.id
ref: messages.session_id - sessions.id
ref: messages.parent_id - messages.id
ref: messages.topic_id - topics.id
ref: threads.source_message_id - messages.id
ref: messages.message_group_id > message_groups.id
ref: sessions.group_id - session_groups.id
ref: topic_documents.document_id > documents.id
ref: topic_documents.topic_id > topics.id
✨ feat(onboarding): agent web onboarding, feature toggle, and lifecycle sync (#13139) * ✨ feat(onboarding): add agent-guided web onboarding flow Made-with: Cursor * Update onboarding prompts Co-authored-by: Codex <noreply@openai.com> * 🐛 fix web onboarding builtin tool flow * ✨ feat(onboarding): enhance agent onboarding flow with new dimensions and refined rules - Updated onboarding structure to include new nodes: agentIdentity, userIdentity, workStyle, workContext, and painPoints. - Revised system role instructions to emphasize a conversational approach and concise interactions. - Adjusted manifest and type definitions to reflect the new onboarding schema. - Implemented tests to ensure proper functionality of the onboarding context and flow. This update aims to improve user experience during onboarding by making it more engaging and structured. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): enhance onboarding experience with localized welcome messages and interaction hints - Added localized welcome messages for onboarding in English and Chinese. - Refactored system role handling to support dynamic interaction hints based on user locale. - Updated onboarding context to include interaction hints for improved user engagement. - Implemented tests to validate the new interaction hint functionality. This update aims to create a more personalized and engaging onboarding experience for users across different languages. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): overhaul onboarding flow with new question structure and refined interaction rules - Replaced existing interaction hints with a focused question structure to enhance user engagement. - Updated system role instructions to clarify onboarding protocols and improve conversational flow. - Refactored type definitions and manifest to align with the new onboarding schema. - Removed deprecated interaction hint components and tests to streamline the codebase. This update aims to create a more structured and engaging onboarding experience for users, ensuring clarity and efficiency in interactions. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): introduce builtin agent onboarding package with structured roles and prompts - Added a new package for agent onboarding, including a package.json configuration and initial TypeScript files. - Implemented system role templates and tool prompts to guide the onboarding process. - Established a client interface for rendering questions and handling user interactions. - Updated dependencies in related packages to integrate the new onboarding functionality. This update aims to enhance the onboarding experience by providing a structured approach for agents, ensuring clarity and efficiency in user interactions. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): enhance agent onboarding with new question renderer and refined interaction logic - Introduced a new `QuestionRendererView` component to streamline the rendering of onboarding questions. - Refactored the `QuestionRenderer` to utilize a runtime hook for improved state management and separation of concerns. - Updated the onboarding context to fallback to stored questions when the current question is empty, enhancing user experience. - Simplified the onboarding API by removing unnecessary read token requirements from various endpoints. - Added tests to validate the new question rendering logic and ensure proper functionality. This update aims to create a more efficient and user-friendly onboarding experience by improving the question handling and rendering process. Signed-off-by: Innei <tukon479@gmail.com> * Add dev history view for onboarding * remove: prosetting Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): inline response language step in agent conversation - Add ResponseLanguageInlineStep and wire into Conversation flow - Extend agent onboarding context and update ResponseLanguageStep route - Add tests and onboarding agent document design spec Made-with: Cursor * ✨ feat(onboarding): enhance onboarding flow with inbox integration and schema refactor - Updated onboarding process to migrate conversation topics to the inbox upon completion, ensuring users can revisit their onboarding discussions. - Introduced a new schema-driven normalizer and node handler registry to streamline onboarding data handling, reducing code duplication and improving maintainability. - Added comprehensive tests for new document builders and onboarding service methods to ensure functionality and reliability. - Refactored existing components to support the new onboarding structure and improve user experience. This update aims to create a more cohesive onboarding experience by integrating user identity data into the inbox and simplifying the underlying code structure. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(agent-documents): add listDocuments, readDocumentByFilename, upsertDocumentByFilename APIs * ✨ feat(onboarding): add generic user interaction builtin tool * ✨ feat(onboarding): wire generic tool interaction semantics Register user-interaction tool in builtin-tools registry with manifest, intervention components, client executor, and server runtime. Extend BuiltinInterventionProps with interactionMode and onInteractionAction to support custom (non-approval) interaction UIs. Add submit/skip/cancel actions to conversation store with full operation lifecycle management. * 🔧 fix: add builtin-tool-user-interaction to root workspace dependencies * ♻️ refactor(onboarding): remove onboarding-owned question persistence Drop askUserQuestion from the web-onboarding tool and remove questionSurface from persisted state. Question presentation is now delegated to the generic lobe-user-interaction tool. * ♻️ refactor(onboarding): switch UI to generic interaction tool Enable UserInteraction and AgentDocuments tools in web-onboarding and inbox agent configs. Remove obsolete inline question renderers (QuestionRenderer, QuestionRendererView, questionRendererRuntime, questionRendererSchema, ResponseLanguageInlineStep) and simplify Conversation component to only render summary CTA. * 🔥 refactor(onboarding): remove identity doc and rewrite soul sync * 🐛 fix(user-interaction): add humanIntervention to manifest and implement form UI * 🐛 fix(onboarding): create user message on interaction submit instead of re-executing tool * ♻️ refactor(onboarding): rebuild generic interaction flow Align agent/tool roles and onboarding UI/runtime around the generic interaction rebuild. Made-with: Cursor * ✨ feat(onboarding): implement onboarding document and persona management Introduce a new onboarding document structure that separates agent identity and user persona data. Replace existing `readSoulDocument` and `updateSoulDocument` APIs with `readDocument` and `updateDocument` to handle both SOUL.md and user persona documents. Update related services, client executors, and localization keys to reflect these changes. Ensure document updates are driven by the agent, allowing for incremental updates and improved content management. Signed-off-by: Innei <tukon479@gmail.com> * refactor Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(workflow): introduce unified tool call collapse UI and supporting components Add a new workflow collapse feature that groups tool calls and reasoning into a single collapsible unit, enhancing the user interface for tool call progress. This includes the creation of several components: `WorkflowCollapse`, `WorkflowSummary`, `WorkflowExpandedList`, `WorkflowToolLine`, and `WorkflowReasoningLine`. Update the design specifications and implementation plans to reflect this new structure, aiming for a more cohesive and user-friendly experience. Signed-off-by: Innei <tukon479@gmail.com> * feat(types): add discovery pacing types and constant * feat(onboarding): add countTopicUserMessages and pacing gate to derivePhase * feat(onboarding): capture discovery baseline and return pacing data in getState * ✨ feat(onboarding): add pacing hints to discovery phase tool result * test(onboarding): add discovery pacing gate tests * ♻️ refactor(onboarding): soften discovery pacing gate and add early exit exception - MIN_DISCOVERY_USER_MESSAGES lowered from 4 to 2 (hard floor) - RECOMMENDED_DISCOVERY_USER_MESSAGES = 4 (advisory hint) - Tool protocol rule 2 now has explicit early exit exception - Pacing hint text changed from imperative to advisory * ✨ feat(onboarding): update .gitignore and remove outdated onboarding plans - Added `docs/superpowers` to .gitignore to exclude documentation files from version control. - Deleted several outdated onboarding implementation plans, including those for onboarding inbox integration, generic interaction rebuild, and user question simplification, to streamline project documentation. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): refine agent onboarding, streaming, and AskUserQuestion Made-with: Cursor * ✨ feat(store): add pending interventions selector * 🐛 fix(store): handle standalone tool messages and structural children traversal in pending interventions selector * ✨ feat(conversation): create InterventionBar component Add InterventionBar UI component with tab bar for multiple pending interventions, reusing the existing Intervention detail component. * 🐛 fix(conversation): use stable toolCallId for active tab state and add min-height: 0 Track active intervention by toolCallId instead of array index to prevent stale selection when interventions are resolved. Add min-height: 0 to scrollable content for correct overflow in flex column layout. * feat(chatinput): show InterventionBar when pending interventions exist * feat(tool): collapse inline intervention to one-line summary with scroll-to-bottom * feat(i18n): add intervention bar translation keys * 🐛 fix(chatinput): prevent infinite render loop from pendingInterventions selector * 🐛 fix(chatinput): use equality function for pendingInterventions to break render loop * refactor(tool): remove CollapsedIntervention, return null for pending inline * feat(i18n): add form.other translation key * feat(tool): add styles for select field with Other option * feat(tool): add SelectFieldInput with Other option row * feat(tool): wire SelectFieldInput and update validation in AskUserQuestion * fix(tool): add keyboard handler to Other row, fix label flex * refactor(tool): restore Select dropdown, add Other toggle row below * refactor(tool): change Other to form-level escape hatch, restore antd Select * refactor(tool): replace checkbox toggle with minimal text link escape hatch * feat(tool): use lucide icons, auto-focus on escape toggle, createStaticStyles * refactor(onboarding): update onboarding model references and improve styling in ModeSwitch component Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): add greeting entry animation keyframes and card styles * ✨ feat(onboarding): add LogoThree and entry animations to greeting card * ✨ feat(onboarding): add View Transition morph from greeting to conversation * refactor(onboarding): simplify ModeSwitch component by removing segmentedGlass styling Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat(onboarding): increase maximum onboarding steps to 5 and add ProSettingsStep component Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: enhance user interaction question handling with validation schema - Introduced Zod validation for askUserQuestion arguments to ensure correct structure. - Updated test to reflect new question format with fields. - Added error handling in AskUserQuestion component to log submission errors. This improves the robustness of user interactions by enforcing schema validation and enhancing error reporting. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: enhance agent metadata handling and onboarding synchronization - Updated `useAgentMeta` to prioritize custom titles from the database, falling back to the default Lobe AI title if none exists. - Integrated `refreshBuiltinAgent` into the onboarding process to ensure the latest agent data is reflected during user interactions. - Adjusted the `InboxItem` component to display the correct agent title and avatar based on the updated metadata. - Refactored optimistic update actions to improve message handling and synchronization across components. This improves the user experience by ensuring that the most relevant agent information is displayed and updated in real-time during onboarding and conversation flows. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: enhance conversation lifecycle and onboarding agent synchronization - Updated `ConversationLifecycleActionImpl` to include additional context parameters (agentId, groupId, threadId, topicId) when updating message plugins for aborted interactions. - Integrated `refreshBuiltinAgent` for the inbox during the onboarding process to ensure the latest agent data is synchronized. These changes improve the handling of conversation lifecycle events and ensure that onboarding reflects the most current agent information, enhancing user experience during interactions. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: implement agent onboarding feature toggle and enhance ModeSwitch component - Introduced `AGENT_ONBOARDING_ENABLED` configuration to control the visibility of the agent onboarding options. - Updated `ModeSwitch` component to conditionally render onboarding options based on the feature toggle. - Enhanced tests for `ModeSwitch` to cover scenarios for both enabled and disabled states of agent onboarding. - Refactored `AgentOnboardingRoute` to navigate to the classic onboarding if the agent onboarding feature is disabled. These changes improve the onboarding experience by allowing dynamic control over the agent onboarding feature, ensuring that users only see relevant options based on the configuration. Signed-off-by: Innei <tukon479@gmail.com> * ✨ feat: update agent onboarding feature toggle to include development mode - Modified `AGENT_ONBOARDING_ENABLED` to also activate in development mode using `isDev`. - This change allows for easier testing and development of the agent onboarding feature without needing to alter production configurations. Signed-off-by: Innei <tukon479@gmail.com> * Prevent welcome message when onboard * 🐛 fix: satisfy ToolExecutionContext and updateMessageTools typings Made-with: Cursor * 🐛 fix: update tests for custom builtin agent title and discovery phase constants * 🐛 fix: use custom inbox agent title and avatar in InboxWelcome * 🧹 chore(onboarding): remove HistoryPanel unit test Made-with: Cursor * 🐛 fix: add missing onboarding/agent and onboarding/classic routes to desktop config * ✅ test: fix failing tests for onboarding container, document helpers, and executor * ✅ test: mock LogoThree to prevent Spline runtime fetch errors in CI --------- Signed-off-by: Innei <tukon479@gmail.com> Co-authored-by: Codex <noreply@openai.com>
2026-03-30 12:28:54 +00:00
ref: topics.session_id - sessions.id