Merge remote-tracking branch 'origin/master' into ji
# Conflicts: # .gitignore # frontend-web/src/components/workspace/artifacts/context.tsx # frontend-web/src/components/workspace/messages/message-group.tsx # offline-backend-20260512/backend/CLAUDE.md # offline-backend-20260512/backend/README.md # offline-backend-20260512/backend/app/gateway/app.py # offline-backend-20260512/backend/app/gateway/deps.py # offline-backend-20260512/backend/app/gateway/routers/llmwiki.py
This commit is contained in:
commit
e818c24769
262 files changed
+29527
-5236
No files matched your search
+52
@@ -0,0 +1,52 @@
|
||||
"""Add compact_menu_overrides.menu_type (简介模式菜单分套).
|
||||
|
||||
Two website deployments keep independent compact/sidebar-summary left menus.
|
||||
Type ``A`` is the historical default; type ``B`` is stored under a prefixed
|
||||
``node_id`` so it never collides on databases that still use ``node_id`` as
|
||||
the sole primary key.
|
||||
|
||||
ORM: ``CompactMenuOverrideRow.menu_type = String(32), NOT NULL, default A``.
|
||||
``create_all`` gives new DBs the column; existing DBs are patched by this
|
||||
revision and by startup ``_ensure_orm_columns_sync``.
|
||||
|
||||
Revision ID: 20260819_01
|
||||
Revises: 20260816_01
|
||||
Create Date: 2026-08-19
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import inspect
|
||||
|
||||
|
||||
revision = "20260819_01"
|
||||
down_revision = "20260816_01"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _has_table(table_name: str) -> bool:
|
||||
inspector = inspect(op.get_bind())
|
||||
return table_name in inspector.get_table_names()
|
||||
|
||||
|
||||
def _has_column(table_name: str, column_name: str) -> bool:
|
||||
if not _has_table(table_name):
|
||||
return False
|
||||
inspector = inspect(op.get_bind())
|
||||
return any(col["name"] == column_name for col in inspector.get_columns(table_name))
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
if _has_table("compact_menu_overrides") and not _has_column("compact_menu_overrides", "menu_type"):
|
||||
op.add_column(
|
||||
"compact_menu_overrides",
|
||||
sa.Column("menu_type", sa.String(length=32), nullable=False, server_default="A"),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
if _has_column("compact_menu_overrides", "menu_type"):
|
||||
op.drop_column("compact_menu_overrides", "menu_type")
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
"""Add enabled column to roundtable_chains.
|
||||
|
||||
Per-chain 启停 switch: True = 可在选链弹窗 / 公共入口里选用;False = 停用(管理列表
|
||||
仍可见,但不可选入研讨)。Default True → existing chains stay enabled. BOOLEAN NOT
|
||||
NULL DEFAULT 1, matching ``RoundtableChainRow.enabled``.
|
||||
|
||||
``create_all`` adds the column for brand-new DBs; the startup ``_ensure_orm_columns_sync``
|
||||
sweep adds it to already-existing tables (sqlite/mysql/postgres). This revision keeps the
|
||||
alembic graph consistent with the rest of the chain columns and documents the change.
|
||||
|
||||
Revision ID: 20260819_02
|
||||
Revises: 20260819_01
|
||||
Create Date: 2026-08-19
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import inspect
|
||||
|
||||
|
||||
revision = "20260819_02"
|
||||
down_revision = "20260819_01"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _has_table(table_name: str) -> bool:
|
||||
inspector = inspect(op.get_bind())
|
||||
return table_name in inspector.get_table_names()
|
||||
|
||||
|
||||
def _has_column(table_name: str, column_name: str) -> bool:
|
||||
if not _has_table(table_name):
|
||||
return False
|
||||
inspector = inspect(op.get_bind())
|
||||
return any(col["name"] == column_name for col in inspector.get_columns(table_name))
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
if _has_table("roundtable_chains") and not _has_column("roundtable_chains", "enabled"):
|
||||
op.add_column(
|
||||
"roundtable_chains",
|
||||
sa.Column("enabled", sa.Boolean(), nullable=False, server_default="1"),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
if _has_column("roundtable_chains", "enabled"):
|
||||
op.drop_column("roundtable_chains", "enabled")
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
"""Add structure_mode to report_structures.
|
||||
|
||||
Per-structure 结构约束: ``fixed`` (固定大纲) vs ``adaptive`` (弹性大纲).
|
||||
Existing rows stay ``adaptive`` so current writing behaviour is unchanged.
|
||||
|
||||
``create_all`` adds the column for brand-new DBs; the startup
|
||||
``_ensure_orm_columns_sync`` sweep adds it to already-existing tables.
|
||||
|
||||
Revision ID: 20260821_01
|
||||
Revises: 20260819_02
|
||||
Create Date: 2026-08-21
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import inspect
|
||||
|
||||
|
||||
revision = "20260821_01"
|
||||
down_revision = "20260819_02"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _has_table(table_name: str) -> bool:
|
||||
inspector = inspect(op.get_bind())
|
||||
return table_name in inspector.get_table_names()
|
||||
|
||||
|
||||
def _has_column(table_name: str, column_name: str) -> bool:
|
||||
if not _has_table(table_name):
|
||||
return False
|
||||
inspector = inspect(op.get_bind())
|
||||
return any(col["name"] == column_name for col in inspector.get_columns(table_name))
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
if _has_table("report_structures") and not _has_column("report_structures", "structure_mode"):
|
||||
op.add_column(
|
||||
"report_structures",
|
||||
sa.Column("structure_mode", sa.String(length=16), nullable=False, server_default="adaptive"),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
if _has_column("report_structures", "structure_mode"):
|
||||
op.drop_column("report_structures", "structure_mode")
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
"""Add retrieval_directions to report_structures.
|
||||
|
||||
Optional 检索方向 list on each 报告结构. Empty / NULL keeps today's
|
||||
collector query-planning; a non-empty list tells material collection to
|
||||
search along those facets.
|
||||
|
||||
ORM: ``ReportStructureRow.retrieval_directions = PortableJSON()``
|
||||
(SQLite/PG native JSON, MySQL TEXT). ``create_all`` adds the column on
|
||||
brand-new DBs; existing tables are patched by startup
|
||||
``_ensure_orm_columns_sync`` (nullable, no server_default required).
|
||||
|
||||
Revision ID: 20260822_01
|
||||
Revises: 20260821_01
|
||||
Create Date: 2026-08-22
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import inspect
|
||||
|
||||
|
||||
revision = "20260822_01"
|
||||
down_revision = "20260821_01"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _has_table(table_name: str) -> bool:
|
||||
inspector = inspect(op.get_bind())
|
||||
return table_name in inspector.get_table_names()
|
||||
|
||||
|
||||
def _has_column(table_name: str, column_name: str) -> bool:
|
||||
if not _has_table(table_name):
|
||||
return False
|
||||
inspector = inspect(op.get_bind())
|
||||
return any(col["name"] == column_name for col in inspector.get_columns(table_name))
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
if _has_table("report_structures") and not _has_column("report_structures", "retrieval_directions"):
|
||||
op.add_column(
|
||||
"report_structures",
|
||||
sa.Column("retrieval_directions", sa.Text(), nullable=True),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
if _has_column("report_structures", "retrieval_directions"):
|
||||
op.drop_column("report_structures", "retrieval_directions")
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
"""Add retrieval_skills to report_structures.
|
||||
|
||||
Optional 检索来源 list of skill names on each 报告结构. Empty / NULL keeps
|
||||
today's collector tools; a non-empty list tells material collection to
|
||||
call those skills.
|
||||
|
||||
ORM: ``ReportStructureRow.retrieval_skills = PortableJSON()``
|
||||
(SQLite/PG native JSON, MySQL TEXT). ``create_all`` adds the column on
|
||||
brand-new DBs; existing tables are patched by startup
|
||||
``_ensure_orm_columns_sync`` (nullable, no server_default required).
|
||||
|
||||
Revision ID: 20260822_02
|
||||
Revises: 20260822_01
|
||||
Create Date: 2026-08-22
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlalchemy as sa
|
||||
from alembic import op
|
||||
from sqlalchemy import inspect
|
||||
|
||||
|
||||
revision = "20260822_02"
|
||||
down_revision = "20260822_01"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def _has_table(table_name: str) -> bool:
|
||||
inspector = inspect(op.get_bind())
|
||||
return table_name in inspector.get_table_names()
|
||||
|
||||
|
||||
def _has_column(table_name: str, column_name: str) -> bool:
|
||||
if not _has_table(table_name):
|
||||
return False
|
||||
inspector = inspect(op.get_bind())
|
||||
return any(col["name"] == column_name for col in inspector.get_columns(table_name))
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
if _has_table("report_structures") and not _has_column("report_structures", "retrieval_skills"):
|
||||
op.add_column(
|
||||
"report_structures",
|
||||
sa.Column("retrieval_skills", sa.Text(), nullable=True),
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
if _has_column("report_structures", "retrieval_skills"):
|
||||
op.drop_column("report_structures", "retrieval_skills")
|
||||
Reference in new issue
Block a user