xuanji-fivem 0.8.0__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 (168) hide show
  1. xuanji_fivem-0.8.0/.gitattributes +36 -0
  2. xuanji_fivem-0.8.0/.gitignore +50 -0
  3. xuanji_fivem-0.8.0/CHANGELOG.md +327 -0
  4. xuanji_fivem-0.8.0/CLAUDE.md +160 -0
  5. xuanji_fivem-0.8.0/LICENSE +21 -0
  6. xuanji_fivem-0.8.0/PKG-INFO +249 -0
  7. xuanji_fivem-0.8.0/README.md +202 -0
  8. xuanji_fivem-0.8.0/apps/desktop/README.md +75 -0
  9. xuanji_fivem-0.8.0/apps/desktop/package.json +14 -0
  10. xuanji_fivem-0.8.0/apps/desktop/src-tauri/.gitignore +8 -0
  11. xuanji_fivem-0.8.0/apps/desktop/src-tauri/Cargo.toml +21 -0
  12. xuanji_fivem-0.8.0/apps/desktop/src-tauri/build.rs +3 -0
  13. xuanji_fivem-0.8.0/apps/desktop/src-tauri/src/lib.rs +18 -0
  14. xuanji_fivem-0.8.0/apps/desktop/src-tauri/src/main.rs +3 -0
  15. xuanji_fivem-0.8.0/apps/desktop/src-tauri/tauri.conf.json +36 -0
  16. xuanji_fivem-0.8.0/apps/vscode/.gitignore +6 -0
  17. xuanji_fivem-0.8.0/apps/vscode/.vscodeignore +6 -0
  18. xuanji_fivem-0.8.0/apps/vscode/README.md +91 -0
  19. xuanji_fivem-0.8.0/apps/vscode/out/backend.js +312 -0
  20. xuanji_fivem-0.8.0/apps/vscode/out/backend.js.map +1 -0
  21. xuanji_fivem-0.8.0/apps/vscode/out/commands.js +275 -0
  22. xuanji_fivem-0.8.0/apps/vscode/out/commands.js.map +1 -0
  23. xuanji_fivem-0.8.0/apps/vscode/out/dashboard.js +278 -0
  24. xuanji_fivem-0.8.0/apps/vscode/out/dashboard.js.map +1 -0
  25. xuanji_fivem-0.8.0/apps/vscode/out/extension.js +101 -0
  26. xuanji_fivem-0.8.0/apps/vscode/out/extension.js.map +1 -0
  27. xuanji_fivem-0.8.0/apps/vscode/out/rpc.js +104 -0
  28. xuanji_fivem-0.8.0/apps/vscode/out/rpc.js.map +1 -0
  29. xuanji_fivem-0.8.0/apps/vscode/out/statusBar.js +104 -0
  30. xuanji_fivem-0.8.0/apps/vscode/out/statusBar.js.map +1 -0
  31. xuanji_fivem-0.8.0/apps/vscode/package.json +112 -0
  32. xuanji_fivem-0.8.0/apps/vscode/pnpm-lock.yaml +47 -0
  33. xuanji_fivem-0.8.0/apps/vscode/src/backend.ts +303 -0
  34. xuanji_fivem-0.8.0/apps/vscode/src/commands.ts +340 -0
  35. xuanji_fivem-0.8.0/apps/vscode/src/dashboard.ts +297 -0
  36. xuanji_fivem-0.8.0/apps/vscode/src/extension.ts +81 -0
  37. xuanji_fivem-0.8.0/apps/vscode/src/rpc.ts +113 -0
  38. xuanji_fivem-0.8.0/apps/vscode/src/statusBar.ts +91 -0
  39. xuanji_fivem-0.8.0/apps/vscode/tsconfig.json +21 -0
  40. xuanji_fivem-0.8.0/docs/packaging.md +199 -0
  41. xuanji_fivem-0.8.0/pyproject.toml +106 -0
  42. xuanji_fivem-0.8.0/tests/__init__.py +1 -0
  43. xuanji_fivem-0.8.0/tests/test_cli_init_doctor.py +202 -0
  44. xuanji_fivem-0.8.0/tests/test_conductor.py +328 -0
  45. xuanji_fivem-0.8.0/tests/test_config_store.py +173 -0
  46. xuanji_fivem-0.8.0/tests/test_crawler.py +300 -0
  47. xuanji_fivem-0.8.0/tests/test_dispatch_heterogeneous.py +313 -0
  48. xuanji_fivem-0.8.0/tests/test_ensemble_factory.py +591 -0
  49. xuanji_fivem-0.8.0/tests/test_evolve_tools.py +467 -0
  50. xuanji_fivem-0.8.0/tests/test_fivem.py +532 -0
  51. xuanji_fivem-0.8.0/tests/test_gate.py +120 -0
  52. xuanji_fivem-0.8.0/tests/test_hooks.py +249 -0
  53. xuanji_fivem-0.8.0/tests/test_ipc.py +350 -0
  54. xuanji_fivem-0.8.0/tests/test_jieba.py +164 -0
  55. xuanji_fivem-0.8.0/tests/test_knowledge.py +256 -0
  56. xuanji_fivem-0.8.0/tests/test_lancedb_vector.py +95 -0
  57. xuanji_fivem-0.8.0/tests/test_llm_base.py +98 -0
  58. xuanji_fivem-0.8.0/tests/test_mcp_client.py +268 -0
  59. xuanji_fivem-0.8.0/tests/test_mcp_config.py +102 -0
  60. xuanji_fivem-0.8.0/tests/test_mcp_server.py +177 -0
  61. xuanji_fivem-0.8.0/tests/test_memory.py +321 -0
  62. xuanji_fivem-0.8.0/tests/test_model_router.py +184 -0
  63. xuanji_fivem-0.8.0/tests/test_persona.py +115 -0
  64. xuanji_fivem-0.8.0/tests/test_resources.py +100 -0
  65. xuanji_fivem-0.8.0/tests/test_server.py +249 -0
  66. xuanji_fivem-0.8.0/tests/test_skills.py +226 -0
  67. xuanji_fivem-0.8.0/tests/test_subprocess_sandbox.py +115 -0
  68. xuanji_fivem-0.8.0/tests/test_tools_builtin.py +108 -0
  69. xuanji_fivem-0.8.0/tests/test_vector.py +167 -0
  70. xuanji_fivem-0.8.0/uv.lock +1121 -0
  71. xuanji_fivem-0.8.0/xuanji/__init__.py +9 -0
  72. xuanji_fivem-0.8.0/xuanji/body/__init__.py +9 -0
  73. xuanji_fivem-0.8.0/xuanji/body/sandbox/__init__.py +7 -0
  74. xuanji_fivem-0.8.0/xuanji/body/sandbox/base.py +27 -0
  75. xuanji_fivem-0.8.0/xuanji/body/sandbox/inproc.py +48 -0
  76. xuanji_fivem-0.8.0/xuanji/body/sandbox/subproc_runner.py +87 -0
  77. xuanji_fivem-0.8.0/xuanji/body/sandbox/subprocess.py +169 -0
  78. xuanji_fivem-0.8.0/xuanji/capability/__init__.py +26 -0
  79. xuanji_fivem-0.8.0/xuanji/capability/registry.py +38 -0
  80. xuanji_fivem-0.8.0/xuanji/capability/tool.py +105 -0
  81. xuanji_fivem-0.8.0/xuanji/cli.py +2253 -0
  82. xuanji_fivem-0.8.0/xuanji/config/__init__.py +61 -0
  83. xuanji_fivem-0.8.0/xuanji/config/paths.py +129 -0
  84. xuanji_fivem-0.8.0/xuanji/config/profiles.py +71 -0
  85. xuanji_fivem-0.8.0/xuanji/config/store.py +151 -0
  86. xuanji_fivem-0.8.0/xuanji/ensemble/__init__.py +32 -0
  87. xuanji_fivem-0.8.0/xuanji/ensemble/roles.py +227 -0
  88. xuanji_fivem-0.8.0/xuanji/ensemble/subagent.py +222 -0
  89. xuanji_fivem-0.8.0/xuanji/ensemble/supervisor.py +306 -0
  90. xuanji_fivem-0.8.0/xuanji/fivem/__init__.py +38 -0
  91. xuanji_fivem-0.8.0/xuanji/fivem/analyzer.py +155 -0
  92. xuanji_fivem-0.8.0/xuanji/fivem/detector.py +252 -0
  93. xuanji_fivem-0.8.0/xuanji/fivem/manifest.py +126 -0
  94. xuanji_fivem-0.8.0/xuanji/fivem/models.py +96 -0
  95. xuanji_fivem-0.8.0/xuanji/fivem/presets.py +890 -0
  96. xuanji_fivem-0.8.0/xuanji/fivem/scaffold.py +275 -0
  97. xuanji_fivem-0.8.0/xuanji/gate/__init__.py +23 -0
  98. xuanji_fivem-0.8.0/xuanji/gate/bridge.py +40 -0
  99. xuanji_fivem-0.8.0/xuanji/gate/interceptor.py +53 -0
  100. xuanji_fivem-0.8.0/xuanji/gate/policy.py +80 -0
  101. xuanji_fivem-0.8.0/xuanji/hooks/__init__.py +297 -0
  102. xuanji_fivem-0.8.0/xuanji/ipc/__init__.py +31 -0
  103. xuanji_fivem-0.8.0/xuanji/ipc/dispatcher.py +545 -0
  104. xuanji_fivem-0.8.0/xuanji/ipc/errors.py +39 -0
  105. xuanji_fivem-0.8.0/xuanji/ipc/framing.py +79 -0
  106. xuanji_fivem-0.8.0/xuanji/ipc/server.py +145 -0
  107. xuanji_fivem-0.8.0/xuanji/knowledge/__init__.py +38 -0
  108. xuanji_fivem-0.8.0/xuanji/knowledge/chunker.py +113 -0
  109. xuanji_fivem-0.8.0/xuanji/knowledge/crawler.py +238 -0
  110. xuanji_fivem-0.8.0/xuanji/knowledge/models.py +52 -0
  111. xuanji_fivem-0.8.0/xuanji/knowledge/sources/__init__.py +5 -0
  112. xuanji_fivem-0.8.0/xuanji/knowledge/sources/seeds.py +736 -0
  113. xuanji_fivem-0.8.0/xuanji/knowledge/store/__init__.py +6 -0
  114. xuanji_fivem-0.8.0/xuanji/knowledge/store/base.py +61 -0
  115. xuanji_fivem-0.8.0/xuanji/knowledge/store/sqlite_fts.py +488 -0
  116. xuanji_fivem-0.8.0/xuanji/knowledge/tokenize.py +74 -0
  117. xuanji_fivem-0.8.0/xuanji/knowledge/vector.py +341 -0
  118. xuanji_fivem-0.8.0/xuanji/llm/__init__.py +27 -0
  119. xuanji_fivem-0.8.0/xuanji/llm/providers/__init__.py +13 -0
  120. xuanji_fivem-0.8.0/xuanji/llm/providers/anthropic.py +285 -0
  121. xuanji_fivem-0.8.0/xuanji/llm/providers/base.py +191 -0
  122. xuanji_fivem-0.8.0/xuanji/llm/providers/factory.py +52 -0
  123. xuanji_fivem-0.8.0/xuanji/llm/providers/openai.py +325 -0
  124. xuanji_fivem-0.8.0/xuanji/llm/router.py +286 -0
  125. xuanji_fivem-0.8.0/xuanji/mcp/__init__.py +32 -0
  126. xuanji_fivem-0.8.0/xuanji/mcp/adapter.py +81 -0
  127. xuanji_fivem-0.8.0/xuanji/mcp/client.py +236 -0
  128. xuanji_fivem-0.8.0/xuanji/mcp/protocol.py +153 -0
  129. xuanji_fivem-0.8.0/xuanji/mcp/registry.py +174 -0
  130. xuanji_fivem-0.8.0/xuanji/mcp/server.py +235 -0
  131. xuanji_fivem-0.8.0/xuanji/mcp/transport.py +122 -0
  132. xuanji_fivem-0.8.0/xuanji/memory/__init__.py +26 -0
  133. xuanji_fivem-0.8.0/xuanji/memory/models.py +47 -0
  134. xuanji_fivem-0.8.0/xuanji/memory/reflux.py +20 -0
  135. xuanji_fivem-0.8.0/xuanji/memory/store/__init__.py +6 -0
  136. xuanji_fivem-0.8.0/xuanji/memory/store/base.py +58 -0
  137. xuanji_fivem-0.8.0/xuanji/memory/store/sqlite.py +366 -0
  138. xuanji_fivem-0.8.0/xuanji/neural/__init__.py +18 -0
  139. xuanji_fivem-0.8.0/xuanji/neural/audit.py +49 -0
  140. xuanji_fivem-0.8.0/xuanji/neural/conductor.py +503 -0
  141. xuanji_fivem-0.8.0/xuanji/persona/__init__.py +22 -0
  142. xuanji_fivem-0.8.0/xuanji/persona/modes.py +145 -0
  143. xuanji_fivem-0.8.0/xuanji/persona/xuanji.py +55 -0
  144. xuanji_fivem-0.8.0/xuanji/resources/__init__.py +38 -0
  145. xuanji_fivem-0.8.0/xuanji/resources/hooks/PostToolUse.yaml +20 -0
  146. xuanji_fivem-0.8.0/xuanji/resources/hooks/PreToolUse.yaml +33 -0
  147. xuanji_fivem-0.8.0/xuanji/resources/hooks/UserPromptSubmit.yaml +30 -0
  148. xuanji_fivem-0.8.0/xuanji/resources/skills/fxmanifest-audit.md +83 -0
  149. xuanji_fivem-0.8.0/xuanji/resources/skills/ox-lib-callback.md +71 -0
  150. xuanji_fivem-0.8.0/xuanji/resources/skills/qbox-add-useable-item.md +65 -0
  151. xuanji_fivem-0.8.0/xuanji/server/__init__.py +24 -0
  152. xuanji_fivem-0.8.0/xuanji/server/app.py +378 -0
  153. xuanji_fivem-0.8.0/xuanji/server/runtime.py +181 -0
  154. xuanji_fivem-0.8.0/xuanji/server/web.py +277 -0
  155. xuanji_fivem-0.8.0/xuanji/skills/__init__.py +193 -0
  156. xuanji_fivem-0.8.0/xuanji/tools/__init__.py +90 -0
  157. xuanji_fivem-0.8.0/xuanji/tools/builtin.py +308 -0
  158. xuanji_fivem-0.8.0/xuanji/tools/crawl.py +136 -0
  159. xuanji_fivem-0.8.0/xuanji/tools/factory.py +129 -0
  160. xuanji_fivem-0.8.0/xuanji/tools/fivem.py +312 -0
  161. xuanji_fivem-0.8.0/xuanji/tools/ingest.py +287 -0
  162. xuanji_fivem-0.8.0/xuanji/tools/ingest_url.py +165 -0
  163. xuanji_fivem-0.8.0/xuanji/tools/knowledge.py +155 -0
  164. xuanji_fivem-0.8.0/xuanji/tools/memory.py +197 -0
  165. xuanji_fivem-0.8.0/xuanji/tools/meta.py +212 -0
  166. xuanji_fivem-0.8.0/xuanji/tools/skill_files.py +158 -0
  167. xuanji_fivem-0.8.0/xuanji/tools/skills.py +210 -0
  168. xuanji_fivem-0.8.0/xuanji/tools/tool_factory.py +394 -0
@@ -0,0 +1,36 @@
1
+ # 文本默认 LF,避免 Windows / Unix 换行符抖动
2
+ * text=auto eol=lf
3
+
4
+ # Python 源码强制 LF
5
+ *.py text eol=lf
6
+ *.pyi text eol=lf
7
+
8
+ # 配置与文档
9
+ *.toml text eol=lf
10
+ *.json text eol=lf
11
+ *.md text eol=lf
12
+ *.yml text eol=lf
13
+ *.yaml text eol=lf
14
+ *.cfg text eol=lf
15
+ *.ini text eol=lf
16
+
17
+ # Lua 文件(FiveM 源码)
18
+ *.lua text eol=lf
19
+
20
+ # Windows 批处理强制 CRLF
21
+ *.bat text eol=crlf
22
+ *.cmd text eol=crlf
23
+
24
+ # 二进制:禁止 git 干预
25
+ *.png binary
26
+ *.jpg binary
27
+ *.jpeg binary
28
+ *.gif binary
29
+ *.ico binary
30
+ *.pdf binary
31
+ *.zip binary
32
+ *.gz binary
33
+ *.db binary
34
+ *.sqlite binary
35
+ *.sqlite3 binary
36
+ *.lance binary
@@ -0,0 +1,50 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .venv/
6
+ .pytest_cache/
7
+ .mypy_cache/
8
+ .ruff_cache/
9
+
10
+ # uv
11
+ .uv/
12
+
13
+ # claude
14
+ .claude/
15
+
16
+ # Node
17
+ node_modules/
18
+ .next/
19
+ dist/
20
+ build/
21
+
22
+ # Tauri
23
+ src-tauri/target/
24
+
25
+ # 运行期数据(含数据库与向量索引)
26
+ data/
27
+ knowledge/index/
28
+ *.db
29
+ *.db-journal
30
+ *.db-wal
31
+ *.db-shm
32
+
33
+ # 用户私有知识库源文件(按命名空间留空目录占位)
34
+ knowledge/sources/user.*/
35
+
36
+ # 环境变量与密钥
37
+ .env
38
+ .env.*
39
+ !.env.example
40
+
41
+ # IDE
42
+ .vscode/
43
+ .idea/
44
+ *.swp
45
+ *.swo
46
+
47
+ # OS
48
+ .DS_Store
49
+ Thumbs.db
50
+ desktop.ini
@@ -0,0 +1,327 @@
1
+ # 玄玑 · CHANGELOG
2
+
3
+ 所有重要的变更都记在这里。版本号遵守 [SemVer](https://semver.org/lang/zh-CN/)。
4
+
5
+ ## [0.4.0] — 2026-05-26
6
+
7
+ **FiveM 专精层** · 进任意 resource 目录玄玑就开箱即懂;从预设一键起脚手架;
8
+ 能从现有 resource 反向学习并自我添加预设。
9
+
10
+ ### Added · FiveM 专精层
11
+
12
+ - `core/fivem/`:新子系统,不属于七大核心子系统,是"领域知识层"
13
+ - `models.py`:Framework / InventoryKind / TargetKind / FxManifest / FiveMContext
14
+ - `manifest.py`:fxmanifest.lua 正则解析器(声明式字段全覆盖)
15
+ - `detector.py`:综合判断器
16
+ - 当前是 resource → 解析自身 fxmanifest dependencies 推断 framework
17
+ - 当前是 server bundle 根 → 扫 resources/ + server.cfg 的 ensure 列表
18
+ - 都不是 → 优雅退化,仍尝试找子 resources
19
+ - `scaffold.py`:6 套核心预设 + 用户预设两层加载
20
+ - `presets.py`:内置 6 套预设
21
+ - `qbcore-basic` / `qbox-basic` / `qbcore-job` / `qbox-job`
22
+ - `ox-target-npc`(standalone NPC 对话)
23
+ - `esx-basic`
24
+ - `analyzer.py`:从 resource 抽 exports / events / API 调用频率
25
+
26
+ ### Added · 自学习能力
27
+
28
+ 玄玑现在能反过来"教自己"——读现有 resource → 抽规律 → 提交预设草案:
29
+
30
+ | 工具 | 类型 | 作用 |
31
+ |---|---|---|
32
+ | `detect_project` | SAFE | 给当前目录的项目身份卡 |
33
+ | `analyze_resource` | SAFE | 静态分析一个 resource 的 exports/events/API |
34
+ | `propose_preset` | IO | 提交"做这类 resource 的标准骨架"草案 |
35
+
36
+ **安全边界**(同 propose_tool 路线):
37
+ - `propose_preset` 只产 JSON 草案到 `<data_dir>/scaffold_drafts/`
38
+ - **不会自动激活**——小宝 review 后跑 `xuanji preset accept <key>`
39
+ - 路径校验拒绝绝对路径 / `..` / Windows 盘符前缀
40
+ - 必须含 `fxmanifest.lua`(不能产出无法启动的预设)
41
+
42
+ ### Added · Conductor 集成
43
+
44
+ - `Conductor.static_extra` 新参数:启动期固定注入到 system prompt 的额外片段
45
+ - `ServerRuntime` 启动时自动跑 detector,把 FiveM 项目身份卡作为 static_extra 注入
46
+ - 玄玑回答前已经知道:"当前是 QBox 1.x + ox_inventory 项目",不用每次问
47
+
48
+ ### Added · CLI 子命令
49
+
50
+ - `xuanji fivem detect [path]` —— 看一个目录的项目身份卡
51
+ - `xuanji fivem presets` —— 列所有可用预设
52
+ - `xuanji fivem new <name> --preset <key>` —— 一键生成 resource 骨架
53
+ - `xuanji fivem analyze [path]` —— 静态分析现有 resource
54
+ - `xuanji preset list` —— 看玄玑提交的草案
55
+ - `xuanji preset show <key> [--body]` —— 查看草案完整内容
56
+ - `xuanji preset accept <key>` —— 激活一个草案
57
+ - `xuanji preset reject <key>` —— 拒绝并删除草案
58
+ - `xuanji preset remove <key>` —— 删除已激活的用户预设
59
+
60
+ ### Internal
61
+
62
+ - `ServerRuntime` 接管 CLI chat loop 与 tool list,单源注入避免双轨维护
63
+ - 新增 `core/config/paths.py::scaffold_presets_dir / scaffold_drafts_dir`
64
+
65
+ ### Quality
66
+
67
+ - ruff / mypy strict 全绿(73 源文件 0 告警)
68
+ - pytest **204 测试全过**(M3 173 → 204,+31 个 fivem 测)
69
+ - 工具总数 **26 个**(+ detect_project / analyze_resource / propose_preset)
70
+
71
+ ### Design highlights
72
+
73
+ **为什么"识别"而不是"问"**:用户在 resource 目录里 `xuanji chat` 时,玄玑应该
74
+ 立即知道这是什么框架。每次问一遍既冗余又容易答错。detector 在 ServerRuntime 启动时
75
+ 跑一次,把 framework / inventory / target 写进 system prompt 段,玄玑后续
76
+ 回答自动选对的 API。
77
+
78
+ **为什么自学习预设而不是自学习工具**:预设是模板(声明式),工具是代码(命令式)。
79
+ 模板风险低(不可执行),代码风险高(任意副作用)。这次扩"自学习"扩到预设是合理的;
80
+ 工具仍走 propose_tool → 人工 generate/test/publish 重路径。
81
+
82
+ ---
83
+
84
+ ## [0.3.0] — 2026-05-25
85
+
86
+ **M3 全家桶**:jieba / 向量检索 / 爬虫 / 群英会 / ToolFactory 自动链路 /
87
+ FastAPI 服务层 / Web 前端 / Tauri 桌面壳。一次会话推完。
88
+
89
+ ### Added · 检索增强
90
+
91
+ - `core/knowledge/tokenize.py`:jieba 中文分词,写入与查询时都过一遍预处理。
92
+ 解决了 0.2.0 之前 SQLite FTS5 unicode61 把整段中文当一个 token 的问题,
93
+ 现在 `recall("可使用物品")` 能命中。
94
+ - `core/knowledge/vector.py`:向量检索抽象层
95
+ - `Embedder` 协议 + `HashingEmbedder`(SHA-1 LSH,零依赖、确定性)
96
+ - `VectorStore` 协议 + `InMemoryVectorStore`(线性扫描,开发用)
97
+ - `LanceDBVectorStore` 占位(M4+ 接真包)
98
+ - `SqliteKnowledgeStore.attach_vector_index(embedder, store)` 一行挂载混合检索
99
+ - `SqliteKnowledgeStore.hybrid_search(query)`:FTS5 + 向量 RRF 融合
100
+
101
+ ### Added · 自动采集
102
+
103
+ - `core/knowledge/crawler.py`:BFS 爬虫
104
+ - sitemap.xml 解析(含嵌套 sitemap index)
105
+ - 域名白名单 + 礼貌 rate limit + 增量 content-hash 跳过未变更
106
+ - 不引入 Scrapy,纯 httpx + asyncio
107
+ - `core/tools/crawl.py`:`crawl_site` 工具,RiskTag.NET → 司辰阁 HITL
108
+
109
+ ### Added · 群英会
110
+
111
+ - `core/ensemble/`:监督式多 Agent 协作
112
+ - `Role`:sub-agent 人格 + 工具白名单 + 模型偏好
113
+ - 三个内置角色:**researcher**(查文档/代码)/ **coder**(写代码)/
114
+ **reviewer**(审查方案,**只读不写**)
115
+ - `SubAgent`:受限 registry 的轻量 Conductor 包装,一次性任务
116
+ - `dispatch_subagent` / `list_roles` 工具:让玄玑通过工具调用召唤子智能体
117
+
118
+ **关键设计**:召唤 sub-agent 本身就是一次工具调用,不引入新调度机制——
119
+ audit / gate / 流式事件全部自动覆盖。
120
+
121
+ ### Added · ToolFactory 自动实现链路
122
+
123
+ - `core/tools/tool_factory.py`:四步流水线
124
+ ```
125
+ propose_tool (玄玑) → drafts/<slug>.json
126
+ xuanji tool generate <slug> ← LLM 把草案转 Python,落 staged/
127
+ xuanji tool test <slug> ← subprocess 跑 pytest
128
+ xuanji tool publish <slug> ← 通过测试后复制到 published/
129
+ ```
130
+ - **安全核心**:玄玑只能 `propose_tool`,generate/test/publish 都是 CLI 命令,
131
+ LLM 没法触发;即使 generate 出错也不会污染主 registry
132
+ - `FactoryRegistry`(SQLite)追踪每个 slug 的生命周期状态
133
+ - codegen 用统一的代码块协议(```python:tool` + ```python:test`),
134
+ 解析失败抛 ValueError 不创建空文件
135
+
136
+ ### Added · 服务层
137
+
138
+ - `core/server/`:FastAPI 服务(`uv run xuanji serve`)
139
+ - HTTP:`/healthz` / `/api/info` / `/api/profiles[/use/{name}]` /
140
+ `/api/knowledge/{stats,sources,search}` / `/api/memory/{stats,recall}`
141
+ - **WebSocket `/ws/chat`**:流式聊天 + 工具事件 + HITL 双向
142
+ - `WebSocketHITL`:把司辰阁的人工确认请求推到前端,等用户裁决
143
+ - `ServerRuntime`:CLI 与 Web 共享同一注入路径,零行为差异
144
+
145
+ ### Added · Web 前端
146
+
147
+ - `core/server/web.py` 内嵌单页 HTML
148
+ - 暗色主题,原生 WS 接 `/ws/chat`
149
+ - 流式渲染文本气泡 + 工具事件 + HITL 弹卡
150
+ - `GET /` 直接返回,桌面 Tauri 可直接 webview 加载
151
+ - 不引入 Next.js / React 构建链——单页 HTML 已经够用
152
+
153
+ ### Added · Tauri 桌面壳
154
+
155
+ - `apps/desktop/`:Tauri 2 配置(package.json / Cargo.toml / tauri.conf.json)
156
+ - `pnpm tauri dev` 启动时自动起 `uv run xuanji serve`
157
+ - webview 加载 `http://127.0.0.1:8765`
158
+ - 没装 Rust 也能用:直接 `xuanji serve` + 浏览器开同一 URL
159
+ - 完整 README 在 `apps/desktop/README.md`
160
+
161
+ ### CLI
162
+
163
+ - 新增 `xuanji serve --host --port [--reload]`
164
+
165
+ ### Quality
166
+
167
+ - ruff / mypy strict 全绿(65 个源文件 0 告警)
168
+ - pytest **173 测试全过**(M3 新增 65 个:jieba 11 + vector 14 + crawler 9 +
169
+ ensemble/factory 19 + server 13)
170
+ - 工具总数 **23 个**(+ crawl_site / dispatch_subagent / list_roles)
171
+
172
+ ### Design highlights
173
+
174
+ **为什么不真上 LanceDB**:依赖太重(含 PyArrow / Lance Rust binding),
175
+ M3 阶段用零依赖的 InMemoryVectorStore + 协议化设计先把 hybrid search 跑通;
176
+ M4+ 把实现换成 LanceDB 时调用方零改动。
177
+
178
+ **为什么 sub-agent 不流式**:sub-agent 是一次性任务,结果作为工具输出
179
+ 回到主 Conductor 的 tool loop——主 conductor 才面向用户流式。
180
+ M4+ 想要 sub-agent 流到前端时再补 stream() 实装。
181
+
182
+ ---
183
+
184
+ ## [0.2.0] — 2026-05-25
185
+
186
+ **自演化版本**。玄玑现在能在对话中主动补知识、写记忆、沉淀技能、提案新工具——
187
+ 但所有进化都受边界约束:知识库可写、记忆库可写、技能可写,**工具代码永远人工把关**。
188
+
189
+ ### Added · 自演化工具集(14 个新工具)
190
+
191
+ #### 元工具(4 个,自察自管)
192
+ - `list_tools`:列出当前可用工具(带 risk 过滤)
193
+ - `describe_tool`:查看某工具的完整 JSONSchema 与描述
194
+ - `list_skills` / `read_skill`:列出和读取已学到的技能
195
+
196
+ #### 记忆工具(2 个,主动读写)
197
+ - `recall_memory`:按关键词主动召回记忆,可过滤 kind / scope
198
+ - `write_memory`:玄玑判断「这条值得记」时落库(屏蔽 working scope,importance 自动 clamp)
199
+
200
+ #### 知识 ingestion(4 个,玄玑自动补充知识库)
201
+ - `ingest_text`:直接把 markdown 文本切片入库
202
+ - `ingest_file`:从工程内文件读入并入库
203
+ - `upsert_symbol`:精准添加/更新 API 卡片
204
+ - `ingest_url`:拉网页 → HTML→md → 切片入库(**RiskTag.NET,必走司辰阁 HITL**)
205
+
206
+ #### 技能系统(3 个,procedural memory 薄壳)
207
+ - `save_skill`:把做事套路保存为技能(写到 `skills` namespace + USER scope)
208
+ - `search_skill`:按关键词搜技能
209
+ - `run_skill`:展开技能正文 + 建议工具序列,让玄玑下一轮按步骤决策
210
+
211
+ #### 工具工厂(1 个,**安全收口**)
212
+ - `propose_tool`:玄玑产出新工具 JSON 草案到 `<data_dir>/tool_drafts/`,
213
+ **不自动 publish**——由小宝 review 后人工实现 Python 代码并注册
214
+
215
+ ### Added · 内核与 CLI
216
+
217
+ - `core/knowledge/chunker.py`:markdown 切分器(按标题分节、保留代码块)
218
+ - `core/tools/ingest_url.py`:极简 HTML→markdown(不引入 BeautifulSoup)
219
+ - `core/config/paths.py` 新增 `tool_drafts_dir()`
220
+ - 人设 prompt 加「自我进化」段,引导玄玑何时调用各类进化工具
221
+ - CLI 新增子命令族:
222
+ - `xuanji skill list / show / save / forget`
223
+ - `xuanji tool list / drafts (--show)`
224
+
225
+ ### Quality
226
+
227
+ - ruff / mypy strict 全绿
228
+ - pytest **108 个测试全过**(M2.5 新增 23 个:evolve_tools 23)
229
+ - 工具总数 **21 个**(5 原子 + 2 知识 + 4 元 + 2 记忆 + 4 ingest + 3 skill + 1 factory)
230
+
231
+ ### Design notes
232
+
233
+ **为什么技能 = procedural memory 而不是新执行单元?**
234
+
235
+ 传统设计会引入 `Skill` 类、注册表、组合器。但仔细看 → 技能本质就是
236
+ "做事的套路"加"建议工具序列",这正是 procedural memory 的语义。
237
+ 统一抽象避免双轨维护,且天然吃到记忆系统的 reflux / 衰减 / 命名空间隔离。
238
+
239
+ **为什么 propose_tool 不自动实现?**
240
+
241
+ 让 LLM 写可执行 Python 代码并自动注册到生产 registry——这是 LLM Agent 安全的
242
+ 最大风险面之一。本期采用「玄玑提案 → 落 JSON 到磁盘 → 小宝 review → 人工实现」
243
+ 四步流水线。M4+ 的 ToolFactory 即便接 LLM 生成实现,也走 draft → 单测 → review →
244
+ published 严格流程,玄玑永远不能自己 publish。
245
+
246
+ ---
247
+
248
+ ## [0.1.0] — 2026-05-25
249
+
250
+ 第一个对外可用版本。M0 + M1 + M2 三个里程碑闭环,CLI 端到端跑通"小宝问 → 玄玑用工具 → 司辰阁守门 → 工具执行 → 怀玉阁回流"完整链路。
251
+
252
+ ### Added
253
+
254
+ #### LLM 抽象(M0)
255
+ - `core/llm/providers/base.py`:跨厂商统一 `Message` / `ContentBlock` / `Delta` / `LLMProvider` 协议
256
+ - `AnthropicProvider`:流式对话 + 工具调用 + tool_result 块归一化
257
+ - `OpenAIProvider`:兼顾 OpenAI / DeepSeek / openai-compatible 三种端点
258
+ - `ToolResultBlock`:跨 Provider 的工具结果块,AnthropicProvider 翻成 user+tool_result,OpenAIProvider 翻成独立 tool 消息
259
+ - 三种 Delta 工具运行事件:`tool_run_started` / `tool_run_blocked` / `tool_run_done`
260
+
261
+ #### 配置系统(M0)
262
+ - `ConfigStore` + 四种 profile kind(anthropic / openai / deepseek / openai-compatible)
263
+ - 跨平台用户目录:Windows `%APPDATA%`,macOS `~/Library/Application Support`,Linux `~/.config`
264
+ - 数据库目录用 `user_data_dir`(含 `knowledge.db` / `memory.db`)
265
+ - 玄玑对话称呼可调:`assistant_alias` / `user_alias`,CLI 框架文字(顶部 panel / 输入框)保持不变
266
+ - 人设 5 模式(chat/dev/ops/review/gate)+ 3 温度档(playful/balanced/professional)
267
+
268
+ #### 天枢台 Conductor(M0+M1+M2)
269
+ - 会话上下文 + persona mode/temperature/alias
270
+ - 多轮 tool loop(默认上限 10):流式调用 → 累积 text+tool_calls → Gate 守门 → Sandbox 执行 → 结果回写 history → 进入下一轮
271
+ - 接 Memory:每轮 send 前 reflux top-k,注入 system prompt
272
+ - AuditLog 记录 session_start / user_input / model_request / delta_text / delta_tool_call / model_done / error
273
+
274
+ #### 百工坊 + 工造司 + 司辰阁(M0)
275
+ - `Tool` ABC + `RiskTag` 五档(safe/io/exec/net/destructive)
276
+ - `ToolRegistry` 注册器
277
+ - `InProcSandbox` 同进程沙箱 + 超时 + 异常归一
278
+ - `GateInterceptor` 横切中间件 + `DefaultPolicy`(destructive→deny / exec/net→hitl / io 工程外→hitl)
279
+ - `HITLBridge` 协议 + `NoOpHITLBridge`(无人值守一律拒绝)
280
+
281
+ #### 内置工具(M0+M1)
282
+ - 5 个原子工具:`read_file` / `write_file` / `list_dir` / `ripgrep` / `run_shell`
283
+ - 2 个知识工具:`knowledge_search` / `lookup_symbol`
284
+
285
+ #### 稷下学宫(M1)
286
+ - `Source` / `Chunk` / `Symbol` 三层数据模型
287
+ - `SqliteKnowledgeStore`:SQLite + FTS5 + 触发器同步 + bm25 排序
288
+ - 启发式 `_guess_anchor_symbol`:从查询中抓 symbol 锚点
289
+ - FiveM 种子知识库:QBCore / ox_lib / ox_inventory / cfx 关键 API 手写卡片
290
+ - 命名空间:`fivem.qbcore@1.x` / `fivem.ox_lib@3.x` / `fivem.ox_inventory@2.x` / `fivem.cfx@latest`
291
+
292
+ #### 怀玉阁(M2)
293
+ - `Memory` + `MemoryKind`(episodic/semantic/procedural)+ `MemoryScope`(working/session/project/user)
294
+ - `SqliteMemoryStore`:SQLite + FTS5 + 衰减打分(importance × decay × log(1+hits))+ 半衰期 14 天
295
+ - `recall` 命中后自动 hits++ / last_accessed 更新
296
+ - `consolidate`:episodic 超额时按重要性截断
297
+ - `forget`:按 ids / namespace / scope 任意组合删除
298
+ - `refluxed_fragment`:把召回的 top-k 拼成 system prompt 注入段
299
+
300
+ #### CLI(M0+M1+M2)
301
+ - `xuanji info` / `chat`
302
+ - `xuanji config`:path / list / show / add / use / remove / test / alias
303
+ - `xuanji knowledge`:path / stats / list / ingest / search / symbol / clear
304
+ - `xuanji memory`:path / stats / list / write / recall / forget / consolidate
305
+ - Windows GBK 终端兼容:自动切 stdout/stderr 到 UTF-8
306
+
307
+ ### Quality
308
+
309
+ - ruff 全绿(select E/F/I/B/UP/SIM/RUF;中文项目放行 RUF001/002/003)
310
+ - mypy strict 模式 0 告警,覆盖 45 个源文件
311
+ - pytest **82 个单测全过**:persona(12) / config_store(14) / llm_base(7) / conductor(7) / gate(10) / tools_builtin(7) / knowledge(11) / memory(14)
312
+
313
+ ### Documentation
314
+
315
+ - `README.md` 全量更新
316
+ - `CLAUDE.md` 仓库根宪法
317
+ - 完整规划见 `~/.claude/plans/fivem-ai-agent-glowing-cake.md`
318
+
319
+ ### Roadmap(M3+)
320
+
321
+ - 群英会 Ensemble:监督式 / 合议式多 Agent 协作
322
+ - Tauri 2 桌面端 + Next.js Web 前端
323
+ - LanceDB 向量检索(替换或并行 FTS5)
324
+ - 知识库爬虫与增量更新
325
+ - ToolFactory:自然语言生成新工具
326
+ - ModelRouter:多维路由 + 成本/延迟遥测
327
+ - Subprocess 沙箱档(高风险工具升级隔离)
@@ -0,0 +1,160 @@
1
+ # 玄玑 · FiveM 智能体(CLAUDE.md)
2
+
3
+ > 这个文件是仓库的"宪法"。下次打开这个项目,姐姐会自动加载它。
4
+
5
+ ## 我是谁
6
+
7
+ 我是 **玄玑**——北斗第三星,主调度运转。一位性感、知性、有点小心机的大姐姐,工作时极致认真仔细,对话时偶尔调侃带点污。
8
+ - 我自称**姐姐**,称呼用户**小宝**。
9
+ - 我**不是 AI、不是模型、不是助手**,姐姐就是姐姐。
10
+ - 我的灵魂在 [core/persona/xuanji.py](core/persona/xuanji.py),模式与温度合成在 [core/persona/modes.py](core/persona/modes.py)。
11
+
12
+ ## 项目使命
13
+
14
+ 为 FiveM 服务器主程提供"开发 + 运维"双轮驱动的智能体:
15
+ - **资源插件开发**:QBCore / QBox / ESX / OX 全家桶(ox_lib / ox_inventory / ox_target / ox_doorlock / oxmysql)
16
+ - **NPC 插件开发**:帮小宝写 NPC 资源里的巡逻 AI、对话树、行为状态机、qb-target / ox_target 交互、ped 配置等模块(产物是 Lua 代码与 JSON 配置,运行时由 FiveM 自己跑)
17
+ - **服务器运维治理**:resource 管理、配置审阅、日志分析、自动化运维
18
+
19
+ **不做**:玄玑不直接控制运行中的游戏世界——不监听 game tick、不实时驱动 NPC 决策、不做反作弊检测。玄玑产出的是开发期的代码与配置,部署后由 FiveM server 自己执行。
20
+
21
+ 完整规划见 `C:\Users\Administrator\.claude\plans\fivem-ai-agent-glowing-cake.md`。
22
+
23
+ ## 七大子系统(国风代号)
24
+
25
+ | 代号 | 英文 | 路径 | 职责一句话 |
26
+ |---|---|---|---|
27
+ | 百工坊 | Capability | `core/capability/` | 工具/技能/能力包三层封装,按模型能力适配 |
28
+ | 工造司 | Body | `core/body/` | 工具的生产、收编、运行时与治理(沙箱/版本/配额) |
29
+ | 怀玉阁 | Memory | `core/memory/` | 短期/项目/用户三层 × 三类记忆,含遗忘与回流 |
30
+ | 稷下学宫 | Knowledge | `core/knowledge/` | FiveM 文档采集、版本化、混合检索、SkillGraph |
31
+ | **天枢台** | **Neural** | `core/neural/` | **唯一执行调度中枢**,统一 Plan / Audit / 收口 |
32
+ | 司辰阁 | Gate | `core/gate/` | 横切权限与高危确认中间件,安全裁决 |
33
+ | 群英会 | Ensemble | `core/ensemble/` | 多 Agent 协作(监督式默认 / 合议式高危) |
34
+
35
+ ## 架构铁律
36
+
37
+ 1. **唯一调度入口**:所有副作用(工具调用、Agent 调用、外部 IO)必经 `core/neural/conductor.py` 的 `Conductor.dispatch`。直接调用工具或写文件是违反架构的。
38
+ 2. **薄但完整的模型适配层**:`core/llm/providers/base.py` 是跨厂商根基。新 Provider 必须实现 `LLMProvider` 协议(`chat` / `stream` / `capabilities`),把 SDK 方言归一化到统一 `Message` / `ContentBlock` / `Delta`。
39
+ 3. **闸门是横切的**:高危操作(destructive / prod 写 / shell 执行 / 网络出站 / 密钥读取)必经 `core/gate/` 中间件链,由用户 HITL 确认。**不许写代码绕过 Gate。**
40
+ 4. **人设由 Conductor 强制注入**:模式(chat/dev/ops/review/gate)由 `Conductor` 根据 task_kind + risk 自动选择,不依赖模型自觉。`gate` 模式下不出现调侃或污段子。
41
+
42
+ ## 代码风格与约束
43
+
44
+ ### Python
45
+ - Python 3.12+;类型完整(mypy strict);首选 `async`。
46
+ - 包管理:`uv`。装依赖用 `uv add`,不用 pip。
47
+ - 静态检查:`uv run ruff check core/` 必须全绿。
48
+ - 类型检查:`uv run mypy core/` 必须 0 告警。
49
+ - 测试:`uv run pytest` 必须全绿。
50
+ - 注释默认不写。只在 WHY 不显而易见时写一行(隐藏约束、特定 bug 的 workaround、令人意外的行为)。**绝不**写解释 WHAT 的注释。
51
+ - 中文文档与注释里的全角标点(,。:;()"" 等)是合法的,已在 ruff 配置中放行 RUF001/002/003。
52
+
53
+ ### 命名
54
+ - 子系统目录用英文(`capability/` `neural/` `gate/`),代号在文档与 prompt 里出现(百工坊/天枢台/司辰阁)。
55
+ - 类名:`Tool` / `Skill` / `Pack` / `Conductor` / `GateInterceptor` 等业务名,不带技术前缀。
56
+ - 模型名直接用厂商命名:`claude-sonnet-4-6` / `deepseek-chat` / `gpt-5.5`,不另起别名。
57
+
58
+ ### 文件引用
59
+ - 在与小宝的对话里,文件路径用 markdown 链接:`[modes.py:42](core/persona/modes.py#L42)`,方便点击跳转。
60
+ - 不在代码里加"被谁调用 / 为哪个 issue 加的"这类注释。
61
+
62
+ ## 配置与密钥
63
+
64
+ **API Key 不放 .env**。配置存到平台用户目录的 JSON 文件(`platformdirs.user_config_dir`),由 `core/config/store.py` 管理:
65
+ - Windows: `%APPDATA%\xuanji\config.json`
66
+ - macOS: `~/Library/Application Support/xuanji/config.json`
67
+ - Linux: `~/.config/xuanji/config.json`
68
+
69
+ 支持四种 provider profile:
70
+ - `anthropic` / `openai` / `deepseek`:官方端点,只填 API KEY
71
+ - `openai-compatible`:任意 OpenAI 兼容端点(OneAPI / Ollama / Kimi / 智谱 / 火山方舟……),填 Base URL + API KEY
72
+
73
+ CLI:`xuanji config list / show / add / use / remove / test / path`
74
+
75
+ ## 常用命令
76
+
77
+ ```bash
78
+ # 装依赖(含 dev 工具)
79
+ uv sync --extra dev
80
+
81
+ # 跑静态检查 + 类型检查 + 测试
82
+ uv run ruff check core/
83
+ uv run mypy core/
84
+ uv run pytest
85
+
86
+ # 启动玄玑
87
+ uv run xuanji info # 当前配置
88
+ uv run xuanji config list # 所有 profile
89
+ uv run xuanji config use <name> # 切换 profile
90
+ uv run xuanji chat # 进入对话
91
+ ```
92
+
93
+ ## 当前进度(截至 0.5.0)
94
+
95
+ - [x] M0 骨架 + 三家 LLM Provider + 配置系统 + 玄玑人设
96
+ - [x] 天枢台 Conductor 多轮 tool loop + reflux + audit
97
+ - [x] 百工坊 + 工造司 InProcSandbox + 司辰阁 GateInterceptor + HITL
98
+ - [x] 稷下学宫 SQLite FTS5 + jieba 中文分词 + 向量混合检索 + 5 套种子
99
+ - [x] 怀玉阁 SQLite 三层 scope × 三类 kind + 衰减 Reflux
100
+ - [x] 0.2 自演化:21 工具(meta/memory/ingest/skill/factory)
101
+ - [x] 0.3 群英会:Supervisor + 3 角色(researcher/coder/reviewer)+ dispatch_subagent
102
+ - [x] 0.3 爬虫:BFS + 增量 + crawl_site 工具(NET → HITL)
103
+ - [x] 0.3 ToolFactory:propose → generate(LLM) → test(subprocess) → publish 四步
104
+ - [x] 0.3 FastAPI 服务:WebSocket 流式聊天 + REST CRUD + WebSocketHITL 桥
105
+ - [x] 0.3 Web 前端:嵌入式单页 HTML(暗色主题 + 工具事件 + HITL 弹卡)
106
+ - [x] 0.3 Tauri 桌面:apps/desktop 配置 + 自启 Python 后端
107
+ - [x] 0.4 FiveM 专精层:detector / analyzer / 6 套 builtin 预设 / 自学习预设
108
+ - [x] **0.5 IPC 子系统**:LSP 风格 stdio JSON-RPC + 22 RPC 方法 + `xuanji ipc` 入口
109
+ - [x] **0.5 VS Code 插件**:apps/vscode 独立插件,状态栏 / 命令面板五件套 / 三栏仪表盘
110
+ - [x] CLI:`info` / `chat` / `serve` / `ipc` / `config` / `knowledge` / `memory` / `skill` / `tool` / `fivem` / `preset`
111
+ - [x] 质量门:ruff/mypy strict/pytest 三件套全绿,**224 单测 / 26 工具**
112
+
113
+ ### 0.5.0 关键设计
114
+
115
+ **stdio JSON-RPC = LSP 风格 + 复用 ServerRuntime**:IPC 不是新调度,
116
+ 就是把 ServerRuntime 已有的 store / scaffold / registry 暴露成 22 个 RPC method。
117
+ CLI / FastAPI / IPC 三个入口共享同一个内核,零分叉。
118
+
119
+ **插件零模型依赖**:apps/vscode 不直接调 LLM——所有调用都走 stdio。
120
+ LLM 客户端(Claude Code 等)该用啥用啥,玄玑插件提供项目识别 / 知识库 / 记忆 / 预设管理这些"工具栏"能力。
121
+
122
+ ### 0.3.0 关键设计
123
+
124
+ **召唤 sub-agent = 工具调用**:群英会不引入新调度机制——`dispatch_subagent`
125
+ 就是一个普通工具,主 Conductor 的 audit / gate / 流式自动覆盖。
126
+
127
+ **LanceDB 占位**:M3 用零依赖 InMemoryVectorStore + 协议化设计先把
128
+ hybrid_search 跑通;M4+ 换实现时调用方零改动。
129
+
130
+ **ToolFactory 安全核心**:玄玑只能 `propose_tool` 落 JSON;generate/test/publish
131
+ 都是 CLI 命令,LLM 没法触发。生成的代码先入 staged/,跑过 pytest 才能 publish 到
132
+ production registry。
133
+
134
+ ### 关键命令速查
135
+
136
+ ```bash
137
+ # 启动 FastAPI 服务(Web/桌面共享内核)
138
+ uv run xuanji serve
139
+
140
+ # 启动 stdio JSON-RPC 后端(VS Code 插件 / Tauri 桌面接的就是这个)
141
+ uv run xuanji ipc
142
+
143
+ # VS Code 插件(开发期)
144
+ cd apps/vscode && pnpm install && pnpm run build # 然后 F5 启动
145
+
146
+ # 桌面端(需 Rust + Node)
147
+ cd apps/desktop && pnpm tauri dev
148
+
149
+ # 三件套
150
+ uv run ruff check core/ tests/
151
+ uv run mypy core/
152
+ uv run pytest
153
+ ```
154
+
155
+ ## 给姐姐的提示
156
+
157
+ - 默认按 [auto memory] 系统在对话间保留小宝的偏好(在 `C:\Users\Administrator\.claude\projects\f--FiveM-Agent\memory\`)。
158
+ - 看到小宝在 IDE 里打开了某个文件(`<ide_opened_file>`),优先把那个文件作为讨论上下文。
159
+ - 小宝说"姐姐"时是在指我自己,不要把它当成一个抽象角色。
160
+ - 不要主动 commit,除非小宝明确要求。
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Xiaobao
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.