sqlseed 0.1.12__tar.gz → 0.1.14__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. {sqlseed-0.1.12 → sqlseed-0.1.14}/.gitignore +5 -1
  2. sqlseed-0.1.14/CHANGELOG.md +126 -0
  3. sqlseed-0.1.14/CHANGELOG.zh-CN.md +126 -0
  4. sqlseed-0.1.14/PKG-INFO +1048 -0
  5. sqlseed-0.1.14/README.md +995 -0
  6. sqlseed-0.1.12/README.md → sqlseed-0.1.14/README.zh-CN.md +204 -296
  7. sqlseed-0.1.14/examples/ai_generation_demo.py +177 -0
  8. {sqlseed-0.1.12 → sqlseed-0.1.14}/pyproject.toml +14 -6
  9. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/__init__.py +36 -6
  10. sqlseed-0.1.14/src/sqlseed/_utils/progress.py +23 -0
  11. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/cli/main.py +164 -40
  12. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/config/loader.py +13 -0
  13. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/config/models.py +1 -0
  14. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/enrichment.py +1 -1
  15. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/expression.py +23 -2
  16. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/mapper.py +19 -10
  17. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/orchestrator.py +148 -60
  18. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/plugin_mediator.py +65 -25
  19. sqlseed-0.1.14/src/sqlseed/core/relation.py +348 -0
  20. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/schema.py +1 -1
  21. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/unique_adjuster.py +1 -1
  22. sqlseed-0.1.14/src/sqlseed/database/_compat.py +35 -0
  23. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/database/optimizer.py +6 -2
  24. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/database/raw_sqlite_adapter.py +3 -1
  25. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/database/sqlite_utils_adapter.py +8 -1
  26. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/generators/_dispatch.py +7 -0
  27. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/generators/base_provider.py +322 -0
  28. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/generators/faker_provider.py +18 -0
  29. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/generators/mimesis_provider.py +18 -0
  30. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/generators/stream.py +47 -0
  31. sqlseed-0.1.12/CHANGELOG.md +0 -86
  32. sqlseed-0.1.12/PKG-INFO +0 -952
  33. sqlseed-0.1.12/plugins/mcp-server-sqlseed/README.md +0 -49
  34. sqlseed-0.1.12/plugins/mcp-server-sqlseed/pyproject.toml +0 -47
  35. sqlseed-0.1.12/plugins/mcp-server-sqlseed/src/mcp_server_sqlseed/__init__.py +0 -7
  36. sqlseed-0.1.12/plugins/mcp-server-sqlseed/src/mcp_server_sqlseed/__main__.py +0 -6
  37. sqlseed-0.1.12/plugins/mcp-server-sqlseed/src/mcp_server_sqlseed/config.py +0 -9
  38. sqlseed-0.1.12/plugins/mcp-server-sqlseed/src/mcp_server_sqlseed/server.py +0 -176
  39. sqlseed-0.1.12/plugins/sqlseed-ai/README.md +0 -38
  40. sqlseed-0.1.12/plugins/sqlseed-ai/pyproject.toml +0 -44
  41. sqlseed-0.1.12/plugins/sqlseed-ai/src/sqlseed_ai/__init__.py +0 -73
  42. sqlseed-0.1.12/plugins/sqlseed-ai/src/sqlseed_ai/_client.py +0 -23
  43. sqlseed-0.1.12/plugins/sqlseed-ai/src/sqlseed_ai/_json_utils.py +0 -24
  44. sqlseed-0.1.12/plugins/sqlseed-ai/src/sqlseed_ai/analyzer.py +0 -278
  45. sqlseed-0.1.12/plugins/sqlseed-ai/src/sqlseed_ai/config.py +0 -20
  46. sqlseed-0.1.12/plugins/sqlseed-ai/src/sqlseed_ai/errors.py +0 -151
  47. sqlseed-0.1.12/plugins/sqlseed-ai/src/sqlseed_ai/examples.py +0 -183
  48. sqlseed-0.1.12/plugins/sqlseed-ai/src/sqlseed_ai/provider.py +0 -63
  49. sqlseed-0.1.12/plugins/sqlseed-ai/src/sqlseed_ai/refiner.py +0 -261
  50. sqlseed-0.1.12/src/sqlseed/_utils/progress.py +0 -14
  51. sqlseed-0.1.12/src/sqlseed/core/relation.py +0 -215
  52. sqlseed-0.1.12/src/sqlseed/database/_compat.py +0 -14
  53. sqlseed-0.1.12/src/sqlseed/plugins/__init__.py +0 -12
  54. sqlseed-0.1.12/src/sqlseed/plugins/hookspecs.py +0 -119
  55. sqlseed-0.1.12/src/sqlseed/plugins/manager.py +0 -37
  56. {sqlseed-0.1.12 → sqlseed-0.1.14}/LICENSE +0 -0
  57. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/_utils/__init__.py +0 -0
  58. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/_utils/logger.py +0 -0
  59. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/_utils/metrics.py +0 -0
  60. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/_utils/schema_helpers.py +0 -0
  61. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/_utils/sql_safe.py +0 -0
  62. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/_version.py +0 -0
  63. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/cli/__init__.py +0 -0
  64. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/config/__init__.py +0 -0
  65. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/config/snapshot.py +0 -0
  66. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/__init__.py +0 -0
  67. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/column_dag.py +0 -0
  68. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/constraints.py +0 -0
  69. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/result.py +0 -0
  70. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/core/transform.py +0 -0
  71. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/database/__init__.py +0 -0
  72. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/database/_base_adapter.py +0 -0
  73. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/database/_helpers.py +0 -0
  74. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/database/_protocol.py +0 -0
  75. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/generators/__init__.py +0 -0
  76. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/generators/_json_helpers.py +0 -0
  77. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/generators/_protocol.py +0 -0
  78. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/generators/_string_helpers.py +0 -0
  79. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/generators/registry.py +0 -0
  80. {sqlseed-0.1.12 → sqlseed-0.1.14}/src/sqlseed/py.typed +0 -0
@@ -22,6 +22,7 @@ wheels/
22
22
 
23
23
  # Virtual Environment
24
24
  .venv/
25
+ venv/
25
26
  env/
26
27
  ENV/
27
28
 
@@ -34,6 +35,7 @@ ENV/
34
35
 
35
36
  # Testing
36
37
  .pytest_cache/
38
+ .benchmarks/
37
39
  .coverage
38
40
  coverage.xml
39
41
  htmlcov/
@@ -62,9 +64,11 @@ snapshots/
62
64
  .trae/
63
65
 
64
66
  # Build artifacts
65
- dist/
66
67
  *.whl
67
68
  *.tar.gz
68
69
 
69
70
  # Local git worktrees
70
71
  .worktrees/
72
+
73
+ # IDE - SonarLint
74
+ .sonarlint/
@@ -0,0 +1,126 @@
1
+ # Changelog
2
+
3
+ **[English](CHANGELOG.md)** | [中文](CHANGELOG.zh-CN.md)
4
+
5
+ All notable changes to this project will be documented in this file.
6
+
7
+ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
8
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
9
+
10
+ ## [v0.1.14]
11
+
12
+ ### Fixed
13
+ - CI: resolve ruff SIM114/SIM102 lint errors in `test_doc_sync.py`
14
+ - CI: eliminate all regex from `test_doc_sync.py` to fix SonarCloud S5852 security hotspots
15
+ - CI: reduce cognitive complexity of `_extract_number_before_keyword` helper
16
+
17
+ ### Added
18
+ - Doc Sync Rules mapping table in CLAUDE.md
19
+ - Documentation sync validation tests (`tests/test_doc_sync.py`)
20
+
21
+ ## [v0.1.13]
22
+
23
+ ### Added
24
+
25
+ #### Core Engine
26
+ - Cross-table association support: `ColumnAssociation` config model for explicit source table/column mapping
27
+ - Implicit association: `SharedPool` auto-matches cross-table FK references by shared column names
28
+ - `EnrichmentEngine` data distribution inference — detects enum columns and value ranges from existing data
29
+ - `UniqueAdjuster` auto-tunes unique column parameters to satisfy UNIQUE constraints
30
+ - `database/_compat.py` adds `HAS_SQLITE_UTILS` flag for runtime sqlite-utils detection
31
+
32
+ #### Generators
33
+ - 7 new generator types: `username`, `city`, `country`, `state`, `zip_code`, `job_title`, `country_code`
34
+ - `ColumnMapper` exact match rules expanded from 68 to 74
35
+
36
+ #### AI Plugin (sqlseed-ai)
37
+ - Auto model selection: `_model_selector` picks the best free model from OpenRouter by priority
38
+ - Structured output: `response_format: json_object` forces LLM to return JSON
39
+ - Few-shot example library: 4 typical scenarios (users, bank cards, orders, employees)
40
+ - `AiConfigRefiner` self-correction loop: auto-detects and fixes invalid configs, up to 3 retries
41
+ - File caching: `.sqlseed_cache/ai_configs/` with schema hash validation, `--no-cache` to skip
42
+ - Pre-computed template pool: `sqlseed_pre_generate_templates` hook pre-generates candidate values for complex columns
43
+ - Error summary system: `errors.py` smart error classification
44
+ - Environment variables: `SQLSEED_AI_API_KEY`, `SQLSEED_AI_BASE_URL`, `SQLSEED_AI_MODEL`, `SQLSEED_AI_TIMEOUT`
45
+
46
+ #### MCP Server (mcp-server-sqlseed)
47
+ - `sqlseed_execute_fill` adds `enrich` parameter for data distribution inference
48
+ - `sqlseed_inspect_schema` returns `schema_hash` field
49
+
50
+ #### CLI
51
+ - `fill` command adds `--enrich` flag
52
+ - `fill` command adds `--no-ai` flag to skip AI suggestions and template generation
53
+ - `ai-suggest` command adds `--verify/--no-verify` and `--timeout` parameters
54
+ - `fill` command makes `db_path` optional when using `--config`
55
+
56
+ #### Tests & Examples
57
+ - Add `test_cli_yaml_priority.py` covering CLI YAML priority scenarios
58
+ - Add `examples/ai_generation_demo.py` usage example
59
+
60
+ ### Changed
61
+
62
+ - Simplify `ExpressionEngine` regex patterns
63
+ - Optimize code structure and type annotations, remove unnecessary lazy imports
64
+ - CI workflows expanded: ruff check covers `plugins/` directory, add concurrency control
65
+ - Update dependency version constraints
66
+ - Rewrite all project documentation: CLAUDE.md, README.md, GEMINI.md, AGENTS.md, architecture.md
67
+ - Rewrite `plugins/sqlseed-ai/README.md` and `plugins/mcp-server-sqlseed/README.md`
68
+
69
+ ### Fixed
70
+
71
+ - ruff lint cleanup, allow Chinese fullwidth characters (`:`, `(`, `)`)
72
+ - Remove unnecessary `sqlite3.OperationalError` catch
73
+ - `ProviderRegistry.register_from_entry_points()` fixes non-provider entry point detection
74
+
75
+ ### Removed
76
+
77
+ - Remove `docs/superpowers/` directory (outdated design specs)
78
+ - Remove `suggest.py` and `nl_config.py`, replaced by `SchemaAnalyzer` + `AiConfigRefiner`
79
+
80
+ ## [v0.1.12]
81
+
82
+ ### Added
83
+
84
+ #### Core Engine
85
+ - Core orchestrator `DataOrchestrator` with streaming batch generation
86
+ - `ColumnMapper` 9-level strategy chain (exact match → pattern match → type fallback → default)
87
+ - `DatabaseAdapter` Protocol with `SQLiteUtilsAdapter` and `RawSQLiteAdapter`
88
+ - `PragmaOptimizer` 3-tier optimization (LIGHT / MODERATE / AGGRESSIVE)
89
+ - `DataProvider` Protocol with `BaseProvider`, `FakerProvider`, `MimesisProvider`
90
+ - `DataStream` memory-efficient streaming data generator
91
+ - `RelationResolver` foreign key dependency topological sort
92
+ - Plugin system based on `pluggy` with 11 hook points
93
+ - CLI commands: `fill`, `preview`, `inspect`, `init`, `replay`, `ai-suggest`
94
+ - Python API: `sqlseed.fill()`, `sqlseed.connect()`, `sqlseed.fill_from_config()`, `sqlseed.preview()`
95
+ - YAML/JSON config file support
96
+ - Config snapshot save and replay
97
+ - SQL injection protection (`quote_identifier()` utility)
98
+
99
+ #### v2.0 — Column DAG & Expression Engine
100
+ - `ColumnDAG` column dependency resolution via topological sort
101
+ - `ExpressionEngine` safe expression evaluation via `simpleeval` with thread-based timeout protection
102
+ - `ConstraintSolver` unique constraint solving with retry and backtracking
103
+ - `TransformLoader` dynamic Python script loading (`importlib`)
104
+ - `SharedPool` cross-table value sharing for referential integrity
105
+ - `IndexInfo` dataclass and `get_index_info()` added to `DatabaseAdapter` Protocol
106
+ - `get_sample_rows()` method added to `DatabaseAdapter` Protocol for context sniffing
107
+ - `sqlseed_ai_analyze_table` hook (firstresult) for AI-driven schema analysis
108
+ - `sqlseed_shared_pool_loaded` hook for cross-table association tracking
109
+
110
+ #### AI Plugin (sqlseed-ai)
111
+ - `SchemaAnalyzer` LLM integration (OpenAI-compatible API)
112
+ - Context sniffing: extracts columns, indexes, sample data, foreign keys for LLM analysis
113
+ - `AIConfig` configurable model, API key, and base URL
114
+ - CLI `ai-suggest` command for AI-driven YAML generation
115
+
116
+ #### MCP Server (mcp-server-sqlseed)
117
+ - `sqlseed_inspect_schema` tool — inspect database schema
118
+ - `sqlseed_generate_yaml` tool — AI-driven YAML config generation
119
+ - `sqlseed_execute_fill` tool — execute data generation
120
+ - FastMCP-based server
121
+
122
+ ### Fixed
123
+ - Hook `firstresult` semantics aligned with design docs
124
+ - `validate_table_name` adds regex validation
125
+ - Expression engine adds timeout protection (default 5 seconds)
126
+ - `fill_from_config` correctly passes transform attribute
@@ -0,0 +1,126 @@
1
+ # 变更日志
2
+
3
+ [English](CHANGELOG.md) | **[中文](CHANGELOG.zh-CN.md)**
4
+
5
+ 本项目所有重要变更将记录在此文件中。
6
+
7
+ 格式基于 [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
8
+ 本项目遵循[语义化版本](https://semver.org/spec/v2.0.0.html)。
9
+
10
+ ## [v0.1.14]
11
+
12
+ ### 修复
13
+ - CI: 修复 `test_doc_sync.py` 中的 ruff SIM114/SIM102 lint 错误
14
+ - CI: 移除 `test_doc_sync.py` 中所有正则表达式,解决 SonarCloud S5852 安全热点
15
+ - CI: 降低 `_extract_number_before_keyword` 辅助函数的认知复杂度
16
+
17
+ ### 新增
18
+ - CLAUDE.md 中添加文档同步规则映射表
19
+ - 文档同步验证测试 (`tests/test_doc_sync.py`)
20
+
21
+ ## [v0.1.13]
22
+
23
+ ### 新增
24
+
25
+ #### 核心引擎
26
+ - 跨表关联支持:`ColumnAssociation` 配置模型,支持显式声明源表/源列映射
27
+ - 隐式关联:`SharedPool` 通过同名列自动匹配跨表 FK 引用
28
+ - `EnrichmentEngine` 数据分布推断,从现有表数据推断枚举列和值范围
29
+ - `UniqueAdjuster` 唯一列参数自动调整,确保生成数据满足 UNIQUE 约束
30
+ - `database/_compat.py` 新增 `HAS_SQLITE_UTILS` 标志,运行时检测 sqlite-utils 可用性
31
+
32
+ #### 数据生成器
33
+ - 新增 7 个生成器类型:`username`、`city`、`country`、`state`、`zip_code`、`job_title`、`country_code`
34
+ - `ColumnMapper` 精确匹配规则从 68 扩展到 74 条
35
+
36
+ #### AI 插件(sqlseed-ai)
37
+ - 自动模型选择:`_model_selector` 从 OpenRouter 免费模型列表中按优先级自动选择
38
+ - 结构化输出:`response_format: json_object` 强制 LLM 返回 JSON
39
+ - Few-shot 示例库:4 个典型场景(用户表、银行卡表、订单表、员工表)
40
+ - `AiConfigRefiner` 自纠正闭环:自动检测并修复无效配置,最多 3 轮重试
41
+ - 文件缓存:`.sqlseed_cache/ai_configs/` 带 schema hash 校验,`--no-cache` 跳过
42
+ - 预计算模板池:`sqlseed_pre_generate_templates` Hook,AI 为复杂列预生成候选值
43
+ - 错误摘要系统:`errors.py` 智能分类错误类型
44
+ - 环境变量:`SQLSEED_AI_API_KEY`、`SQLSEED_AI_BASE_URL`、`SQLSEED_AI_MODEL`、`SQLSEED_AI_TIMEOUT`
45
+
46
+ #### MCP 服务器(mcp-server-sqlseed)
47
+ - `sqlseed_execute_fill` 新增 `enrich` 参数,支持数据分布推断
48
+ - `sqlseed_inspect_schema` 返回 `schema_hash` 字段
49
+
50
+ #### CLI
51
+ - `fill` 命令新增 `--enrich` 标志
52
+ - `fill` 命令新增 `--no-ai` 标志,跳过 AI 建议和模板生成
53
+ - `ai-suggest` 命令新增 `--verify/--no-verify`、`--timeout` 参数
54
+ - `fill` 命令使用 `--config` 时 `db_path` 改为可选
55
+
56
+ #### 测试与示例
57
+ - 新增 `test_cli_yaml_priority.py`,覆盖 CLI YAML 优先级场景
58
+ - 新增 `examples/ai_generation_demo.py` 使用示例
59
+
60
+ ### 变更
61
+
62
+ - `ExpressionEngine` 正则表达式模式简化
63
+ - 代码结构和类型注解优化,移除不必要的延迟导入
64
+ - CI 工作流扩展:ruff 检查覆盖 `plugins/` 目录,添加并发控制
65
+ - 更新依赖版本限制
66
+ - 全面重写项目文档:CLAUDE.md、README.md、GEMINI.md、AGENTS.md、architecture.md
67
+ - 重写 `plugins/sqlseed-ai/README.md` 和 `plugins/mcp-server-sqlseed/README.md`
68
+
69
+ ### 修复
70
+
71
+ - ruff lint 清理,允许中文全角字符(`:`、`(`、`)`)
72
+ - 移除 `sqlite3.OperationalError` 不必要的捕获
73
+ - `ProviderRegistry.register_from_entry_points()` 修正非 provider 入口点的区分逻辑
74
+
75
+ ### 移除
76
+
77
+ - 移除 `docs/superpowers/` 目录(过时的设计文档)
78
+ - 移除 `suggest.py` 和 `nl_config.py`,功能由 `SchemaAnalyzer` + `AiConfigRefiner` 替代
79
+
80
+ ## [v0.1.12]
81
+
82
+ ### 新增
83
+
84
+ #### 核心引擎
85
+ - 核心编排引擎 `DataOrchestrator`,支持流式批量生成
86
+ - `ColumnMapper` 9 级策略链(精确匹配 → 模式匹配 → 类型回退 → 默认)
87
+ - `DatabaseAdapter` Protocol,含 `SQLiteUtilsAdapter` 和 `RawSQLiteAdapter`
88
+ - `PragmaOptimizer` 三级优化(LIGHT / MODERATE / AGGRESSIVE)
89
+ - `DataProvider` Protocol,含 `BaseProvider`、`FakerProvider`、`MimesisProvider`
90
+ - `DataStream` 流式数据生成器,内存高效的批量处理
91
+ - `RelationResolver` 外键依赖拓扑排序
92
+ - 基于 `pluggy` 的插件系统,11 个 Hook 点
93
+ - CLI 命令:`fill`、`preview`、`inspect`、`init`、`replay`、`ai-suggest`
94
+ - Python API:`sqlseed.fill()`、`sqlseed.connect()`、`sqlseed.fill_from_config()`、`sqlseed.preview()`
95
+ - YAML/JSON 配置文件支持
96
+ - 配置快照保存与回放
97
+ - SQL 注入防护(`quote_identifier()` 工具)
98
+
99
+ #### v2.0 — 列 DAG 与表达式引擎
100
+ - `ColumnDAG` 列依赖解析,基于拓扑排序
101
+ - `ExpressionEngine` 基于 `simpleeval` 的安全表达式求值,带基于线程的超时保护
102
+ - `ConstraintSolver` 唯一性约束求解,支持重试和回溯
103
+ - `TransformLoader` 用户 Python 脚本动态加载(`importlib`)
104
+ - `SharedPool` 跨表值共享,维持引用完整性
105
+ - `IndexInfo` 数据类和 `get_index_info()` 加入 `DatabaseAdapter` Protocol
106
+ - `get_sample_rows()` 方法加入 `DatabaseAdapter` Protocol,用于上下文嗅探
107
+ - `sqlseed_ai_analyze_table` Hook(firstresult),AI 驱动的 Schema 分析
108
+ - `sqlseed_shared_pool_loaded` Hook,跨表关联追踪
109
+
110
+ #### AI 插件(sqlseed-ai)
111
+ - `SchemaAnalyzer` LLM 集成(OpenAI 兼容 API)
112
+ - 上下文嗅探:提取列、索引、样本数据、外键供 LLM 分析
113
+ - `AIConfig` 可配置模型、API Key 和 Base URL
114
+ - CLI `ai-suggest` 命令,AI 驱动的 YAML 生成
115
+
116
+ #### MCP 服务器(mcp-server-sqlseed)
117
+ - `sqlseed_inspect_schema` 工具 — 检查数据库 Schema
118
+ - `sqlseed_generate_yaml` 工具 — AI 驱动的 YAML 配置生成
119
+ - `sqlseed_execute_fill` 工具 — 执行数据生成
120
+ - 基于 FastMCP 的服务器
121
+
122
+ ### 修复
123
+ - Hook `firstresult` 语义与设计文档对齐
124
+ - `validate_table_name` 增加正则验证
125
+ - 表达式引擎增加超时保护(默认 5 秒)
126
+ - `fill_from_config` 中 transform 属性正确传递