Merge remote-tracking branch 'origin/main' into canary

This commit is contained in:
lobehubbot
2026-03-18 04:29:39 +00:00
8 changed files with 12979 additions and 3 deletions

View File

@@ -2,6 +2,33 @@
# Changelog
### [Version 2.1.43](https://github.com/lobehub/lobe-chat/compare/v2.1.42...v2.1.43)
<sup>Released on **2026-03-16**</sup>
#### 👷 Build System
- **misc**: add BM25 indexes with ICU tokenizer for search optimization.
- **misc**: add `agent_documents` table.
<br/>
<details>
<summary><kbd>Improvements and Fixes</kbd></summary>
#### Build System
- **misc**: add BM25 indexes with ICU tokenizer for search optimization, closes [#13032](https://github.com/lobehub/lobe-chat/issues/13032) ([70a74f4](https://github.com/lobehub/lobe-chat/commit/70a74f4))
- **misc**: add `agent_documents` table, closes [#12944](https://github.com/lobehub/lobe-chat/issues/12944) ([93ee1e3](https://github.com/lobehub/lobe-chat/commit/93ee1e3))
</details>
<div align="right">
[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)
</div>
### [Version 2.1.42](https://github.com/lobehub/lobe-chat/compare/v2.1.41...v2.1.42)
<sup>Released on **2026-03-14**</sup>

View File

@@ -1,4 +1,14 @@
[
{
"children": {
"improvements": [
"add BM25 indexes with ICU tokenizer for search optimization.",
"add agent_documents table."
]
},
"date": "2026-03-16",
"version": "2.1.43"
},
{
"children": {},
"date": "2026-03-14",

View File

@@ -79,6 +79,7 @@ table agent_bot_providers {
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()`]
@@ -123,6 +124,46 @@ table agent_cron_jobs {
}
}
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]
}
}
table agent_eval_benchmarks {
id text [pk, not null]
identifier text [not null]

View File

@@ -1,6 +1,6 @@
{
"name": "@lobehub/lobehub",
"version": "2.1.42",
"version": "2.1.43",
"description": "LobeHub - an open-source,comprehensive AI Agent framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.",
"keywords": [
"framework",

View File

@@ -0,0 +1 @@
ALTER TABLE "agent_bot_providers" ADD COLUMN IF NOT EXISTS "settings" jsonb DEFAULT '{}'::jsonb;

File diff suppressed because it is too large Load Diff

View File

@@ -658,6 +658,13 @@
"when": 1773653550268,
"tag": "0093_add_bm25_indexes_with_icu",
"breakpoints": true
},
{
"idx": 94,
"version": "7",
"when": 1773764776073,
"tag": "0094_agent_bot_providers_add_settings",
"breakpoints": true
}
],
"version": "6"

View File

@@ -1,4 +1,13 @@
import { boolean, index, pgTable, text, uniqueIndex, uuid, varchar } from 'drizzle-orm/pg-core';
import {
boolean,
index,
jsonb,
pgTable,
text,
uniqueIndex,
uuid,
varchar,
} from 'drizzle-orm/pg-core';
import { createInsertSchema } from 'drizzle-zod';
import { timestamps } from './_helpers';
@@ -33,12 +42,15 @@ export const agentBotProviders = pgTable(
/** Encrypted credentials string (decrypted to JSON with botToken, publicKey, etc.) */
credentials: text('credentials'),
/** User-configurable settings (dm policy, charLimit, debounce, etc.) */
settings: jsonb('settings').$type<Record<string, unknown>>().default({}),
enabled: boolean('enabled').default(true).notNull(),
...timestamps,
},
(t) => [
// Fast webhook lookup: platform + applicationId → agent
// Fast lookup: platform + applicationId → agent
uniqueIndex('agent_bot_providers_platform_app_id_unique').on(t.platform, t.applicationId),
index('agent_bot_providers_platform_idx').on(t.platform),
index('agent_bot_providers_agent_id_idx').on(t.agentId),