@dofy/namo 0.0.0-stage → 0.6.2

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 (276) hide show
  1. package/README.md +54 -2
  2. package/README.zh-CN.md +55 -0
  3. package/assets/fonts/Caveat-OFL.txt +93 -0
  4. package/assets/fonts/JetBrainsMono-OFL.txt +93 -0
  5. package/assets/fonts/README.md +29 -0
  6. package/assets/namo-logo.png +0 -0
  7. package/bin/namo.js +13 -0
  8. package/config.example.json +31 -0
  9. package/dist/scripts/changelog.js +104 -0
  10. package/dist/scripts/changelog.js.map +1 -0
  11. package/dist/scripts/smoke-codex.js +25 -0
  12. package/dist/scripts/smoke-codex.js.map +1 -0
  13. package/dist/scripts/smoke-skills.js +62 -0
  14. package/dist/scripts/smoke-skills.js.map +1 -0
  15. package/dist/src/access-contract.js +2 -0
  16. package/dist/src/access-contract.js.map +1 -0
  17. package/dist/src/access.js +53 -0
  18. package/dist/src/access.js.map +1 -0
  19. package/dist/src/agent-registry.js +102 -0
  20. package/dist/src/agent-registry.js.map +1 -0
  21. package/dist/src/agents.js +83 -0
  22. package/dist/src/agents.js.map +1 -0
  23. package/dist/src/approval-service.js +189 -0
  24. package/dist/src/approval-service.js.map +1 -0
  25. package/dist/src/approvals.js +423 -0
  26. package/dist/src/approvals.js.map +1 -0
  27. package/dist/src/artifact-delivery.js +242 -0
  28. package/dist/src/artifact-delivery.js.map +1 -0
  29. package/dist/src/artifacts.js +223 -0
  30. package/dist/src/artifacts.js.map +1 -0
  31. package/dist/src/assistant-setup.js +23 -0
  32. package/dist/src/assistant-setup.js.map +1 -0
  33. package/dist/src/assistant.js +245 -0
  34. package/dist/src/assistant.js.map +1 -0
  35. package/dist/src/auto-memory.js +309 -0
  36. package/dist/src/auto-memory.js.map +1 -0
  37. package/dist/src/background-work.js +16 -0
  38. package/dist/src/background-work.js.map +1 -0
  39. package/dist/src/browse.js +202 -0
  40. package/dist/src/browse.js.map +1 -0
  41. package/dist/src/business-storage.js +54 -0
  42. package/dist/src/business-storage.js.map +1 -0
  43. package/dist/src/cards.js +341 -0
  44. package/dist/src/cards.js.map +1 -0
  45. package/dist/src/changelog-contract.js +2 -0
  46. package/dist/src/changelog-contract.js.map +1 -0
  47. package/dist/src/cli.js +316 -0
  48. package/dist/src/cli.js.map +1 -0
  49. package/dist/src/codex-connection.js +285 -0
  50. package/dist/src/codex-connection.js.map +1 -0
  51. package/dist/src/codex-distribution.js +425 -0
  52. package/dist/src/codex-distribution.js.map +1 -0
  53. package/dist/src/codex-installation.js +65 -0
  54. package/dist/src/codex-installation.js.map +1 -0
  55. package/dist/src/codex-items.js +15 -0
  56. package/dist/src/codex-items.js.map +1 -0
  57. package/dist/src/codex-mcp-import.js +86 -0
  58. package/dist/src/codex-mcp-import.js.map +1 -0
  59. package/dist/src/codex-updates.js +287 -0
  60. package/dist/src/codex-updates.js.map +1 -0
  61. package/dist/src/config-prompts.js +355 -0
  62. package/dist/src/config-prompts.js.map +1 -0
  63. package/dist/src/config-reload.js +144 -0
  64. package/dist/src/config-reload.js.map +1 -0
  65. package/dist/src/config.js +164 -0
  66. package/dist/src/config.js.map +1 -0
  67. package/dist/src/control-classifier.js +86 -0
  68. package/dist/src/control-classifier.js.map +1 -0
  69. package/dist/src/control-display.js +30 -0
  70. package/dist/src/control-display.js.map +1 -0
  71. package/dist/src/conversation-control.js +308 -0
  72. package/dist/src/conversation-control.js.map +1 -0
  73. package/dist/src/directory-approval.js +122 -0
  74. package/dist/src/directory-approval.js.map +1 -0
  75. package/dist/src/docs-site.js +75 -0
  76. package/dist/src/docs-site.js.map +1 -0
  77. package/dist/src/doctor.js +61 -0
  78. package/dist/src/doctor.js.map +1 -0
  79. package/dist/src/ego-browser-prototype.js +105 -0
  80. package/dist/src/ego-browser-prototype.js.map +1 -0
  81. package/dist/src/engine.js +1458 -0
  82. package/dist/src/engine.js.map +1 -0
  83. package/dist/src/evidence.js +237 -0
  84. package/dist/src/evidence.js.map +1 -0
  85. package/dist/src/external-wait-bridge.js +129 -0
  86. package/dist/src/external-wait-bridge.js.map +1 -0
  87. package/dist/src/external-waits.js +666 -0
  88. package/dist/src/external-waits.js.map +1 -0
  89. package/dist/src/feedback.js +351 -0
  90. package/dist/src/feedback.js.map +1 -0
  91. package/dist/src/feishu-setup.js +115 -0
  92. package/dist/src/feishu-setup.js.map +1 -0
  93. package/dist/src/feishu.js +323 -0
  94. package/dist/src/feishu.js.map +1 -0
  95. package/dist/src/generated-images.js +46 -0
  96. package/dist/src/generated-images.js.map +1 -0
  97. package/dist/src/github-access.js +222 -0
  98. package/dist/src/github-access.js.map +1 -0
  99. package/dist/src/github-api.js +246 -0
  100. package/dist/src/github-api.js.map +1 -0
  101. package/dist/src/github-local.js +75 -0
  102. package/dist/src/github-local.js.map +1 -0
  103. package/dist/src/github-review.js +129 -0
  104. package/dist/src/github-review.js.map +1 -0
  105. package/dist/src/i18n.js +27 -0
  106. package/dist/src/i18n.js.map +1 -0
  107. package/dist/src/image-inputs.js +334 -0
  108. package/dist/src/image-inputs.js.map +1 -0
  109. package/dist/src/inbox-retention.js +48 -0
  110. package/dist/src/inbox-retention.js.map +1 -0
  111. package/dist/src/legacy-config.js +28 -0
  112. package/dist/src/legacy-config.js.map +1 -0
  113. package/dist/src/live-runtime.js +37 -0
  114. package/dist/src/live-runtime.js.map +1 -0
  115. package/dist/src/live-upgrade.js +192 -0
  116. package/dist/src/live-upgrade.js.map +1 -0
  117. package/dist/src/locale.js +9 -0
  118. package/dist/src/locale.js.map +1 -0
  119. package/dist/src/locales/en.js +1429 -0
  120. package/dist/src/locales/en.js.map +1 -0
  121. package/dist/src/locales/zh-CN.js +1428 -0
  122. package/dist/src/locales/zh-CN.js.map +1 -0
  123. package/dist/src/management-operations.js +107 -0
  124. package/dist/src/management-operations.js.map +1 -0
  125. package/dist/src/management.js +910 -0
  126. package/dist/src/management.js.map +1 -0
  127. package/dist/src/materials.js +280 -0
  128. package/dist/src/materials.js.map +1 -0
  129. package/dist/src/mcp-connections.js +279 -0
  130. package/dist/src/mcp-connections.js.map +1 -0
  131. package/dist/src/mcp-endpoint-contract.js +17 -0
  132. package/dist/src/mcp-endpoint-contract.js.map +1 -0
  133. package/dist/src/mcp-oauth-flow.js +83 -0
  134. package/dist/src/mcp-oauth-flow.js.map +1 -0
  135. package/dist/src/mcp-oauth.js +322 -0
  136. package/dist/src/mcp-oauth.js.map +1 -0
  137. package/dist/src/mcp-operation.js +27 -0
  138. package/dist/src/mcp-operation.js.map +1 -0
  139. package/dist/src/mcp-public-network.js +58 -0
  140. package/dist/src/mcp-public-network.js.map +1 -0
  141. package/dist/src/mcp-write-approval.js +153 -0
  142. package/dist/src/mcp-write-approval.js.map +1 -0
  143. package/dist/src/memory-access.js +7 -0
  144. package/dist/src/memory-access.js.map +1 -0
  145. package/dist/src/memory-commands.js +52 -0
  146. package/dist/src/memory-commands.js.map +1 -0
  147. package/dist/src/memory-extractor.js +87 -0
  148. package/dist/src/memory-extractor.js.map +1 -0
  149. package/dist/src/memory.js +755 -0
  150. package/dist/src/memory.js.map +1 -0
  151. package/dist/src/messages.js +2 -0
  152. package/dist/src/messages.js.map +1 -0
  153. package/dist/src/migration-cli.js +54 -0
  154. package/dist/src/migration-cli.js.map +1 -0
  155. package/dist/src/migration-memory.js +261 -0
  156. package/dist/src/migration-memory.js.map +1 -0
  157. package/dist/src/migration.js +534 -0
  158. package/dist/src/migration.js.map +1 -0
  159. package/dist/src/model-catalog.js +58 -0
  160. package/dist/src/model-catalog.js.map +1 -0
  161. package/dist/src/model-preferences.js +29 -0
  162. package/dist/src/model-preferences.js.map +1 -0
  163. package/dist/src/onboarding.js +231 -0
  164. package/dist/src/onboarding.js.map +1 -0
  165. package/dist/src/path-policy.js +6 -0
  166. package/dist/src/path-policy.js.map +1 -0
  167. package/dist/src/paths.js +85 -0
  168. package/dist/src/paths.js.map +1 -0
  169. package/dist/src/presentation.js +86 -0
  170. package/dist/src/presentation.js.map +1 -0
  171. package/dist/src/profiles.js +87 -0
  172. package/dist/src/profiles.js.map +1 -0
  173. package/dist/src/prompts.js +51 -0
  174. package/dist/src/prompts.js.map +1 -0
  175. package/dist/src/public-progress.js +71 -0
  176. package/dist/src/public-progress.js.map +1 -0
  177. package/dist/src/record-table.js +48 -0
  178. package/dist/src/record-table.js.map +1 -0
  179. package/dist/src/recovery.js +105 -0
  180. package/dist/src/recovery.js.map +1 -0
  181. package/dist/src/release-check.js +12 -0
  182. package/dist/src/release-check.js.map +1 -0
  183. package/dist/src/release.js +200 -0
  184. package/dist/src/release.js.map +1 -0
  185. package/dist/src/repository.js +4 -0
  186. package/dist/src/repository.js.map +1 -0
  187. package/dist/src/richtext.js +165 -0
  188. package/dist/src/richtext.js.map +1 -0
  189. package/dist/src/runner-store.js +100 -0
  190. package/dist/src/runner-store.js.map +1 -0
  191. package/dist/src/runner-worker.js +326 -0
  192. package/dist/src/runner-worker.js.map +1 -0
  193. package/dist/src/runner.js +130 -0
  194. package/dist/src/runner.js.map +1 -0
  195. package/dist/src/runtime-config.js +40 -0
  196. package/dist/src/runtime-config.js.map +1 -0
  197. package/dist/src/runtime-contract.js +10 -0
  198. package/dist/src/runtime-contract.js.map +1 -0
  199. package/dist/src/runtime-host.js +84 -0
  200. package/dist/src/runtime-host.js.map +1 -0
  201. package/dist/src/runtime-version.js +38 -0
  202. package/dist/src/runtime-version.js.map +1 -0
  203. package/dist/src/runtime.js +593 -0
  204. package/dist/src/runtime.js.map +1 -0
  205. package/dist/src/safety.js +95 -0
  206. package/dist/src/safety.js.map +1 -0
  207. package/dist/src/schedules.js +211 -0
  208. package/dist/src/schedules.js.map +1 -0
  209. package/dist/src/schema-directory-migration.js +75 -0
  210. package/dist/src/schema-directory-migration.js.map +1 -0
  211. package/dist/src/schema-migrations.js +56 -0
  212. package/dist/src/schema-migrations.js.map +1 -0
  213. package/dist/src/schema.js +241 -0
  214. package/dist/src/schema.js.map +1 -0
  215. package/dist/src/service-bootstrap.js +53 -0
  216. package/dist/src/service-bootstrap.js.map +1 -0
  217. package/dist/src/service.js +416 -0
  218. package/dist/src/service.js.map +1 -0
  219. package/dist/src/session-list.js +58 -0
  220. package/dist/src/session-list.js.map +1 -0
  221. package/dist/src/skill-access.js +97 -0
  222. package/dist/src/skill-access.js.map +1 -0
  223. package/dist/src/store.js +172 -0
  224. package/dist/src/store.js.map +1 -0
  225. package/dist/src/task-context.js +40 -0
  226. package/dist/src/task-context.js.map +1 -0
  227. package/dist/src/task-materials.js +197 -0
  228. package/dist/src/task-materials.js.map +1 -0
  229. package/dist/src/task-progress.js +63 -0
  230. package/dist/src/task-progress.js.map +1 -0
  231. package/dist/src/tasks.js +384 -0
  232. package/dist/src/tasks.js.map +1 -0
  233. package/dist/src/terminal-config.js +132 -0
  234. package/dist/src/terminal-config.js.map +1 -0
  235. package/dist/src/terminal-forms.js +252 -0
  236. package/dist/src/terminal-forms.js.map +1 -0
  237. package/dist/src/terminal-mcp.js +123 -0
  238. package/dist/src/terminal-mcp.js.map +1 -0
  239. package/dist/src/terminal-settings.js +106 -0
  240. package/dist/src/terminal-settings.js.map +1 -0
  241. package/dist/src/theme-contract.js +8 -0
  242. package/dist/src/theme-contract.js.map +1 -0
  243. package/dist/src/title-summary.js +96 -0
  244. package/dist/src/title-summary.js.map +1 -0
  245. package/dist/src/ui-contract.js +3 -0
  246. package/dist/src/ui-contract.js.map +1 -0
  247. package/dist/src/ui.js +352 -0
  248. package/dist/src/ui.js.map +1 -0
  249. package/dist/src/upgrade-backup.js +159 -0
  250. package/dist/src/upgrade-backup.js.map +1 -0
  251. package/dist/src/version.js +4 -0
  252. package/dist/src/version.js.map +1 -0
  253. package/dist/src/waits.js +279 -0
  254. package/dist/src/waits.js.map +1 -0
  255. package/dist/ui/assets/caveat-latin-500-WbB_DO0N.woff2 +0 -0
  256. package/dist/ui/assets/index-CJAhDqDy.css +1 -0
  257. package/dist/ui/assets/index-if-v2JVj.js +131 -0
  258. package/dist/ui/assets/jetbrains-mono-latin-D000Msq0.woff2 +0 -0
  259. package/dist/ui/index.html +18 -0
  260. package/docs/README.md +22 -0
  261. package/docs/architecture.md +145 -0
  262. package/docs/development-plan.md +59 -0
  263. package/docs/getting-started.md +86 -0
  264. package/docs/operations.md +128 -0
  265. package/docs/release-notes.md +57 -0
  266. package/docs/technical-guide-zh-cn.md +153 -0
  267. package/docs/technical-guide.md +153 -0
  268. package/docs/ui-design.md +44 -0
  269. package/docs-site/README.md +15 -0
  270. package/docs-site/assets/namo-logo.png +0 -0
  271. package/docs-site/content.js +34 -0
  272. package/docs-site/index.html +27 -0
  273. package/docs-site/main.js +26 -0
  274. package/docs-site/style.css +1 -0
  275. package/docs-site/vite.config.mjs +4 -0
  276. package/package.json +71 -3
@@ -0,0 +1,153 @@
1
+ # Namo 技术指南
2
+
3
+ [English](technical-guide.md) · [产品介绍](../README.zh-CN.md)
4
+
5
+ 本指南介绍安装、功能、运维与执行边界。模块实现和日常维护的更多细节分别见[技术实现](architecture.md)和[运维指南](operations.md)。
6
+
7
+ ## 已有能力
8
+
9
+ - **飞书 / Lark 入口**:长连接、私聊、群 @、文字与基本富文本;按组织身份或指定成员名单接入。
10
+ - **组织接入**:从飞书应用检测组织身份,成员无需逐人配对;所有准入成员共享白名单目录和已授权 MCP,任务默认在独立会话目录运行。
11
+ - **群聊 PR 审查**:通过服务端 GitHub 连接读取固定 base/head 的有界补丁,在获授权会话中回复发现和覆盖限制,不自动发布 GitHub 评论。
12
+ - **目录与会话**:白名单目录统一可读写,对话产物使用独立工作目录,支持带历史摘要刷新会话。
13
+ - **持久化任务**:SQLite 入站与出站、消息去重、输入修订、同聊天及重叠可写目录串行,以及全局并发限制。
14
+ - **提问与回答**:Agent 可暂停等待补充;引用问题回复,或点击与问题对应的选项按钮后继续。
15
+ - **独立运行进程**:任务与接收服务分别运行;中断或结果不明时保留记录供核对,不盲目重跑。
16
+ - **执行证据**:文件补丁、命令退出码、产物检查和 Git HEAD 快照,并明确采集范围与限制。
17
+ - **助手与范围记忆**:可选启用的助手身份和风格,带来源、范围及隐私控制的自动长期记忆,显式纠正、停用、删除及有界交接。记忆不提供操作授权。
18
+ - **材料与产物**:有界读取合并转发文字和直接发送的 UTF-8 文本文件;经授权交付指定任务文件。直接发送的 PNG/JPEG 图片会以有界、不可变的图片输入交给 Codex。
19
+ - **本地工作台**:Dashboard、任务和会话搜索、用户 / 状态 / 日期筛选、分页、详情、用户档案、助手设置、迁移记忆审阅、配置与连接诊断。
20
+ - **简洁聊天回复**:持久化受理表情、原消息 / 话题回复、安全富文本和一张可更新的进度卡片。标题可由小模型后台总结,失败时保留文本截取,并计入模型轮次;按钮需配置飞书回调。
21
+ - **受控继续执行**:固定 HEAD 的 GitHub 检查(公开仓库或显式配置的私有仓库)可在不让模型轮询的情况下恢复原任务;Git push 按请求直接执行,记录确切任务、提交、远端和分支。
22
+ - **MCP**:通过工作台或 `namo config` 接入公网 HTTPS 服务(支持 OAuth 或 Bearer)及可信的本地 stdio 程序。本地进程以 Namo 的系统用户权限运行,所有获准对话的成员可调用其工具。
23
+ - **本地服务管理**:引导式初始化、独立的官方 Codex 登录、诊断、不可变发布目录与 macOS 后台服务命令。
24
+
25
+ 工作台与 CLI 支持**英文、简体中文**,默认跟随系统语言,无法匹配时回退英文。任务内容、用户输入和执行日志保留原文。
26
+
27
+ PDF / Office / 音视频材料解析、自主派工和离线消息补拉仍不支持。定时提醒与任务可在飞书私聊发送 `/schedule` 管理,也可在本地工作台查看列表。已实现能力与待验收项见[开发路线图](development-plan.md),当前服务版本从工作台核对。
28
+
29
+ ## 安装与初始化
30
+
31
+ 需要 **Node.js 24.15+**、官方 Codex CLI,以及已启用机器人能力的飞书或 Lark 企业自建应用。使用官方 Codex 认证和服务入口。
32
+
33
+ 安装 npm 包并开始初始化:
34
+
35
+ ```sh
36
+ npm install -g @dofy/namo
37
+ namo init
38
+ ```
39
+
40
+ 开发时使用 **pnpm 12.15.0** 从源码构建:
41
+
42
+ ```sh
43
+ git clone https://github.com/dofy/namo.git
44
+ cd namo
45
+ pnpm install --frozen-lockfile
46
+ pnpm run build
47
+ pnpm cli init
48
+ ```
49
+
50
+ 可恢复的向导会引导完成 Codex 检测、独立登录、必填目录白名单、应用凭据与用户配对。真实模型和收发验证可选,可能使用账号额度。
51
+
52
+ 也可构建本地 CLI 安装包:
53
+
54
+ ```sh
55
+ pnpm pack
56
+ npm install -g ./dofy-namo-0.6.2.tgz
57
+ namo init
58
+ ```
59
+
60
+ 已有配置可通过 `--config` 指定,也支持 `NAMO_CONFIG` 和当前目录已有的 `config.local.json`。配置与数据不会被自动移动或覆盖。
61
+
62
+ ```sh
63
+ namo --help
64
+ namo ui # 本地工作台,不启动另一接收端
65
+ namo docs # 打开本地文档;按 Ctrl+C 停止服务
66
+ namo config # 交互式终端配置
67
+ namo login --device-auth # 无桌面环境使用官方 Codex 设备登录
68
+ ```
69
+
70
+ 终端菜单支持方向键、逐项编辑草稿及 Esc 放弃编辑,涵盖执行、飞书及组织准入、GitHub、MCP、助手、用户档案和 Codex 更新。Docker、持久存储与 MCP OAuth 操作见[无桌面环境](operations.md#无桌面环境)。
71
+
72
+ ### 语言
73
+
74
+ 在工作台侧栏底部选择 **跟随系统**、**English** 或 **简体中文**。同一浏览器与本机地址会记住选择,重新打开工作台后仍有效。切换时保留当前筛选和未保存的表单输入。
75
+
76
+ CLI 优先级为 `--lang` → `NAMO_LANG` → 系统语言(`LC_ALL`、`LC_MESSAGES`、`LANG`,最后使用运行时语言)。不支持的系统语言回退英文,`system` 可显式恢复自动选择。
77
+
78
+ ```sh
79
+ namo --lang en --help
80
+ namo --lang zh-CN init
81
+ namo --lang system ui
82
+ NAMO_LANG=zh-CN namo ui
83
+ ```
84
+
85
+ `--version`、路径和 JSON 输出保持可供程序读取。项目地址放在帮助信息和工作台侧栏中;外部 Agent 输出和历史记录保留原文。
86
+
87
+ ### 飞书应用与服务配置
88
+
89
+ 创建并发布飞书或 Lark 企业自建应用,启用机器人,并设置目标用户的应用可用范围。配置长连接,订阅 `im.message.receive_v1`;文档列出的消息权限为 `im:message.p2p_msg:readonly`、`im:message.group_at_msg:readonly` 和 `im:message:send_as_bot`,卡片按钮还需订阅 `card.action.trigger`。按向导使用一次性配对码完成用户配对;组织接入可在初始化后通过工作台配置。不要为同一个应用同时运行另一个接收端。
90
+
91
+ 初始化后,如未安装后台服务,使用 `namo start` 前台运行。`namo ui` 打开本地工作台,不启动接收端;使用工作台期间需保持该终端进程运行。源码目录中对应命令为 `pnpm cli start` 和 `pnpm cli ui`。
92
+
93
+ ### 服务维护
94
+
95
+ macOS 上,`namo service install` 安装并启动后台服务;`start`、`stop`、`restart`、`upgrade` 和 `uninstall` 用于管理它,卸载保留配置、数据和登录。源码构建不会自行切换运行中的服务。`namo service upgrade` 会创建并校验发布快照与备份;兼容变更可在接收器在线时应用,新执行版本先试运行五分钟,在确认前接收器重启会回退。接收器、存储或依赖不兼容时,须安排停机,完成空闲检查并验证备份后升级。停止接收器不会自动停止独立 runner;停机升级前应核对任务、等待、runner 和投递状态,不能用旧备份覆盖新数据。
96
+
97
+ 其他平台使用前台模式,完整平台验收尚未完成。恢复与升级细节见[运维指南](operations.md#安装升级与回退)。
98
+
99
+ ## 聊天命令
100
+
101
+ 常用入口:`/directories` 查看目录白名单,`/refresh` 携带有限历史摘录刷新配置,`/task` 查看任务,`/cancel` 停止任务,`/new` 开始新上下文,`/profile` 管理本人档案,私聊 `/model` 查看或设置用户默认模型,`/status` 查看服务状态和版本,`/version` 查看 Namo 与 Codex CLI 版本,`/help` 查看命令。
102
+
103
+ 工作台「设置 → Codex CLI 更新」提供版本检查、手动升级、回退和自动升级开关。自动升级默认关闭;开启后由运行中的服务每天检查官方稳定版,忙碌时延后,失败后至少等待一小时再重试。Namo 将完整安装包下载到独立登录目录内的 `namo-cli/`,校验 SHA-256、CLI 版本、app-server 协议、登录、权限配置及模型目录后,空闲时原子切换;不替换全局 CLI,也不改变模型偏好。回退会关闭自动升级。当前支持 macOS/Linux 的 arm64/x64。飞书模型目录每 5 分钟刷新,CLI 切换后会重新获取;更新失败保留原版本。 历史 CLI 包暂不自动清理。
104
+
105
+
106
+ 完整用法见[用自然语言与 Namo 协作](getting-started.md#用自然语言与-namo-协作);文件交付、记忆与审批分别见[文档索引](README.md)。
107
+
108
+ ## 执行边界
109
+
110
+ - 初始化必须明确填写目录白名单,目录统一开放读写;默认工作目录和数据保存在用户级 Namo 目录,不使用当前项目目录。
111
+ - 服务配置、任务数据和独立 Codex 认证文件始终排除在 Agent 可访问范围之外。不要为解决工具链路径问题而开放整个个人目录。
112
+ - Skills 仅开放已启用技能的具体目录及符号链接真实目标,权限为只读;个人 Codex 中停用的技能在 Namo 中仍保持停用。可用 `pnpm run smoke:skills` 验证实际沙箱边界,见[技能访问](architecture.md#模块与约束)。
113
+ - 写权限也允许删除文件。取消、超时或重置上下文不会撤销已发生的操作。
114
+ - Git push 记录绑定确切任务、用户 / 聊天、明确的仓库目录、预配置远端、分支、HEAD SHA、配置版本和有效期,提交请求后直接执行,无需再次批准。这是**有限保护**,不是完整强制隔离:通用联网 Agent 或其他凭据路径仍可能绕过审批入口。部署没有通用目标实现。
115
+ - OpenClaw 导入必须显式选择来源文件、受支持版本和应用;不继承模型认证、网关、插件或任务,也不会自动接管接收端。切换和回退保留为需验证的人工门槛。
116
+ - GitHub 等待默认匿名读取公开仓库。通过**连接设置 → GitHub** 配置本机 `gh` 登录或独立令牌:已准入成员在私聊和群聊中可按用户请求使用该账号实际拥有的 API 权限,不再设置逐仓库授权或逐次确认。检查等待不会自动执行写操作。见[私有 GitHub 配置](operations.md#github-连接)。
117
+ - 平台发送回执表示平台已接收消息,不代表用户已读。发送结果不明时保留记录供核对。
118
+ - 主机休眠或断网时无法持续服务;当前没有离线历史消息补拉。
119
+ - 禁止提交 `config.local.json`、`data/`、日志、令牌或认证文件。Namo 不会自动接入个人 MCP、插件或第三方模型网关。
120
+
121
+ CLI 提供 `init`、`config`、`login`、`start`、`service`、`ui`。状态、日志、诊断和 Git 推送与记录在工作台中操作;OpenClaw 来源检查在**连接设置 → 运行与维护**,实际导入使用 `namo init --import`。迁移不会自动切换接收端;推送绑定已配置目标,提交请求后直接执行。详见 [OpenClaw 迁移](operations.md#openclaw-导入)与 [Git 推送](operations.md#git-推送)。
122
+
123
+ 后台服务管理当前支持 macOS;其他平台可前台运行,但尚未完成全部平台验收。当前仅接入 Codex;其他 Agent 仅保留未来插件扩展的可能性,不包含对应 SDK 或探测功能。
124
+
125
+ ## 工作原理
126
+
127
+ Namo 在确认收件前先持久化入站消息,再将任务交给独立 runner。同一聊天串行执行,重叠的可写目录互斥,并受全局并发限制。官方 Codex app-server 在 Namo 的文件系统和网络策略下执行模型轮次;宿主管理的 GitHub 和 MCP 工具使用各自配置的凭据,不把凭据交给模型进程。
128
+
129
+ 任务状态、等待、结果和投递记录保存在 SQLite。runner 中断或失联后不会自动重跑,投递结果不明时也不会自动重发。模型完成、平台接受消息和用户实际收到是不同的事实。当前数据库 schema 为 16;兼容的 v13–v15 数据库可迁移,不兼容旧库会被拒绝而不会自动删除。
130
+
131
+ 本地工作台仅绑定 loopback,使用启动授权、HttpOnly 会话、Host / Origin 检查和内容安全策略。模块职责、剩余风险和迁移细节见[技术实现](architecture.md)。
132
+
133
+ ## Ego 浏览器访问
134
+
135
+ 在 macOS 上启用命令网络后,已配对用户可在私聊中使用受限的 Ego Lite 浏览器。首次使用会请求本任务授权;按键操作需要单独确认。启用卡片回调时可点击授权按钮,也可回复 `永久允许 MA-编号` 允许本人未来私聊任务使用当前固定操作,回复 `撤销浏览器永久授权` 可撤销。浏览器使用自身的网络权限和登录状态。群聊和定时任务不能使用此功能。
136
+
137
+ 工具支持在任务专属空间中打开页面、读取快照、点击、填写以及有限的按键操作,不接受任意脚本、原始 CDP、上传或下载。永久授权不自动覆盖新增能力。正常运行结束时关闭空间;中断或结果不明时不自动重试,可能需要手动检查遗留空间。人工等待后的新运行不会恢复原浏览器空间。详见 [Ego 浏览器运维说明](operations.md#ego-浏览器原型)。
138
+
139
+ ## 开发
140
+
141
+ 技术栈为 TypeScript、Node.js 内置 SQLite、飞书官方 Node SDK,以及 stdio Codex app-server。工作台使用 React、Radix Themes 和 Vite,编译资源与字体随 CLI 分发。
142
+
143
+ ```sh
144
+ pnpm test
145
+ pnpm run smoke:codex # 协议握手,不进行推理
146
+ pnpm run smoke:codex -- --run # 显式真实模型测试
147
+ ```
148
+
149
+ 完整文档见[文档索引](README.md),源码构建与验证见[开发指南](architecture.md#开发与验证),待办见[后续计划](development-plan.md)。
150
+
151
+ 项目地址:[github.com/dofy/namo](https://github.com/dofy/namo)。反馈问题时请提供复现步骤,勿附凭据、私有配置或原始会话数据。
152
+
153
+ 组织配置:在工作台的**连接设置**中配置组织准入和 GitHub 连接。旧安装保持原范围,直到管理员明确修改。见[组织接入与权限](operations.md#配置与权限)。
@@ -0,0 +1,153 @@
1
+ # Namo technical guide
2
+
3
+ [简体中文](technical-guide-zh-cn.md) · [Product overview](../README.md)
4
+
5
+ This guide covers setup, capabilities, operation and execution boundaries. For module-level details and maintenance procedures, see the existing [architecture](architecture.md) and [operations](operations.md) references (Chinese).
6
+
7
+ ## What it does
8
+
9
+ - **Feishu / Lark chat:** persistent connection, direct messages, group mentions, text and basic rich text; organization membership or a selected-member allowlist controls admission.
10
+ - **Organization access:** detect the Feishu tenant, admit members without individual pairing, and share authorized MCP connections and read/write directory access with all admitted members. Conversation artifacts use separate workspaces.
11
+ - **Group PR review:** read bounded PR patches with a fixed base/head through a service-side GitHub connection and return findings to the authorized conversation. Missing patches and review limits are explicit; no automatic GitHub comments.
12
+ - **Directories and sessions:** shared read/write directory access, separate conversation workspaces, and session refresh with bounded historical context.
13
+ - **Durable tasks:** SQLite inbox and outbox, message deduplication, input revisions, per-chat and overlapping-directory serialization, and a global concurrency limit.
14
+ - **Questions and answers:** the agent can pause for your input; answer by replying to the question or choosing a matching card option.
15
+ - **Independent runners:** active tasks run separately from the receiver. Uncertain or interrupted work is retained for review instead of blindly rerunning it.
16
+ - **Execution evidence:** file patches, command exit codes, artifact checks and Git HEAD snapshots, with capture limits made explicit.
17
+ - **Assistant and scoped memory:** opt-in assistant identity and style, automatic extraction of sourced long-term facts with scope and privacy controls, explicit correction/disable/delete, and bounded handoffs. Memories never grant operation authority.
18
+ - **Materials and artifacts:** bounded reading of merged-forward text and direct UTF-8 text files, plus authorized delivery of selected task files. Direct PNG/JPEG images are passed to Codex as bounded, immutable image inputs.
19
+ - **Local workbench:** a dashboard, searchable task and session lists, user/status/date filters, pagination, details, profiles, assistant settings, memory review, configuration and connection diagnostics.
20
+ - **Concise chat replies:** durable acceptance reactions, original-message/topic routing, safe rich text and a single updatable progress card. A small model can summarize titles in the background; failures retain text excerpts and model turns count toward the daily limit. Buttons require the Feishu callback subscription.
21
+ - **Controlled continuations:** exact-head GitHub check waits (public, or explicitly configured private repositories) can resume the same task without model polling; requested Git pushes execute directly and record the exact task, commit, remote and branch.
22
+ - **MCP:** Connect public HTTPS services with OAuth or Bearer authorization, or trusted local stdio programs through the workbench or `namo config`. Local processes run with the Namo user’s OS permissions; admitted bot members can invoke their tools.
23
+ - **Local service management:** guided setup, isolated official Codex login, diagnostics, immutable service releases and macOS background service commands.
24
+
25
+ The workbench and CLI support **English and Simplified Chinese**. They follow the system language by default and fall back to English for unsupported languages. Task content, user input and execution logs retain their original language.
26
+
27
+ PDF/Office/audio material interpretation, autonomous delegation and offline message backfill remain unsupported. Send `/schedule` in a private Feishu chat to manage scheduled reminders and tasks, or view their list in the local workbench. See the [roadmap](development-plan.md) for implemented capabilities and remaining acceptance checks; check the workbench for the running service version.
28
+
29
+ Organization setup: open **Connections** in the workbench to configure organization access and a GitHub account. Existing installations retain their access rules until an administrator changes them. See [organization access](operations.md#配置与权限).
30
+
31
+ ## Get started
32
+
33
+ Requirements: **Node.js 24.15+**, the official Codex CLI and a Feishu or Lark internal app with bot capabilities. Use the official Codex authentication and provider.
34
+
35
+ Install the npm package and start setup:
36
+
37
+ ```sh
38
+ npm install -g @dofy/namo
39
+ namo init
40
+ ```
41
+
42
+ For development, build from source with **pnpm 12.15.0**:
43
+
44
+ ```sh
45
+ git clone https://github.com/dofy/namo.git
46
+ cd namo
47
+ pnpm install --frozen-lockfile
48
+ pnpm run build
49
+ pnpm cli init
50
+ ```
51
+
52
+ The resumable wizard guides you through Codex detection, isolated login, a required directory whitelist, app credentials and user pairing. A live model/messaging check is optional and may use account quota.
53
+
54
+ To build a local CLI package:
55
+
56
+ ```sh
57
+ pnpm pack
58
+ npm install -g ./dofy-namo-0.6.2.tgz
59
+ namo init
60
+ ```
61
+
62
+ Existing configuration can be selected with `--config`. Namo also recognizes `NAMO_CONFIG` and an existing `config.local.json` in the current directory. It does not silently move or overwrite existing configuration or data.
63
+
64
+ ```sh
65
+ namo --help
66
+ namo ui # Local workbench; does not start another receiver
67
+ namo docs # Open the local documentation; Ctrl+C stops its server
68
+ namo config # Interactive terminal configuration
69
+ namo login --device-auth # Official Codex device login for headless hosts
70
+ ```
71
+
72
+ The terminal menu supports arrow keys, field-by-field drafts and Esc to discard an edit. It covers execution, Feishu and organization access, GitHub, MCP, assistant, user profiles and Codex updates. See [headless operation](operations.md#无桌面环境) for Docker, persistent storage and MCP OAuth setup.
73
+
74
+ ### Language
75
+
76
+ Use **Language** at the bottom of the workbench sidebar to select **System language**, **English** or **简体中文**. Your choice is remembered across workbench launches on the same browser and loopback host. Switching language preserves current filters and unsaved form input.
77
+
78
+ CLI priority is `--lang` → `NAMO_LANG` → system language (`LC_ALL`, `LC_MESSAGES`, `LANG`, then the runtime locale). Unsupported system languages fall back to English. `system` explicitly restores automatic selection.
79
+
80
+ ```sh
81
+ namo --lang en --help
82
+ namo --lang zh-CN init
83
+ namo --lang system ui
84
+ NAMO_LANG=zh-CN namo ui
85
+ ```
86
+
87
+ `--version`, paths and JSON output remain machine-readable; project links appear in help and the workbench sidebar. External agent output and historical records keep their original text.
88
+
89
+ ### Feishu app and service setup
90
+
91
+ Create and publish an internal Feishu or Lark app with a bot, and set its availability to the intended users. Configure a long connection and subscribe to `im.message.receive_v1`. The documented message scopes are `im:message.p2p_msg:readonly`, `im:message.group_at_msg:readonly` and `im:message:send_as_bot`; card buttons also require `card.action.trigger`. Follow the setup wizard to pair the user with its one-time code. Organization access can be configured later in the workbench. Do not run another receiver for the same app at the same time.
92
+
93
+ After initialization, run `namo start` in the foreground if you did not install the background service. `namo ui` opens the local workbench without starting a receiver; keep that terminal process open while using it. From a source checkout, the equivalent commands are `pnpm cli start` and `pnpm cli ui`.
94
+
95
+ ### Service maintenance
96
+
97
+ On macOS, `namo service install` installs and starts the background service; `start`, `stop`, `restart`, `upgrade` and `uninstall` manage it. Uninstall retains configuration, data and login. A source build alone does not switch the running service. `namo service upgrade` creates and verifies a release snapshot and backup. Compatible changes can be applied while the receiver remains online; a new execution version is provisional for five minutes and rolls back on receiver restart if it has not been confirmed. Incompatible receiver, storage or dependency changes require a planned stop, an idle check and a verified backup before upgrading. Stopping the receiver does not itself stop independent runners. Inspect tasks, waits, runners and delivery state before a stopped upgrade, and never overwrite newer data with an old backup.
98
+
99
+ On other platforms use foreground mode; full platform acceptance remains outstanding. See the [operations guide (Chinese)](operations.md#安装升级与回退) for recovery and upgrade procedures.
100
+
101
+ ## Chat commands
102
+
103
+ Use `/directories` to inspect allowed directories and `/refresh` to refresh with bounded history, `/task` to inspect a task, `/cancel` to stop it, `/new` for a fresh context, `/profile` for your profile, `/status` for service status and versions, `/version` for Namo and Codex CLI versions, and `/help` for available commands. In a private chat, `/model` shows model choices, `/model MODEL_ID` sets your default, and `/model default` follows the service default. The workbench can also set each user's default. Explicit selections are saved with accepted tasks; availability depends on the Codex account.
104
+
105
+ The workbench’s **Settings → Codex CLI updates** panel provides version checks, manual upgrades, rollback and an automatic update toggle. Automatic upgrades are off by default. While the service runs, enabled updates check the official stable channel daily, defer while busy, and back off for at least an hour after failures. Namo keeps complete private packages in `namo-cli/` under its isolated Codex home, verifies SHA-256, version, app-server handshake, login, permissions and model discovery, then atomically selects the candidate when idle. It preserves the global CLI and model preferences. Rollback disables automatic upgrades. macOS/Linux arm64/x64 are supported. Feishu model discovery refreshes every five minutes and after CLI changes; failed updates retain the selected version. Historical CLI packages are currently retained without automatic cleanup.
106
+
107
+
108
+ See the [conversation guide (Chinese)](getting-started.md#用自然语言与-namo-协作) and [documentation index (Chinese)](README.md) for delivery, memory and approvals.
109
+
110
+ ## Execution boundaries
111
+
112
+ - Setup requires an explicit directory whitelist. All admitted bot users share read/write access. Conversation files and new instance data use the user-level Namo directory; the launch directory is never the default workspace.
113
+ - Configuration, runtime data and isolated Codex login files remain excluded from agent access. Do not grant access to your entire home directory to fix a toolchain issue.
114
+ - Skills receive read-only access to individual enabled skill directories and canonical symlink targets. Personal Codex skill opt-outs remain disabled in Namo. Run `pnpm run smoke:skills` to check the actual sandbox boundaries; see [skill access](architecture.md#模块与约束).
115
+ - Write permission also permits file deletion. Cancellation, timeout or context reset does not undo completed actions.
116
+ - Git push records bind an exact task, owner/chat, explicit repository directory, configured remote, branch, HEAD SHA, configuration revision and expiry, then execute directly without another approval step. This is **limited protection**, not complete enforcement: a generally networked agent or another credential path could bypass the approval entrypoint. Deployment is not implemented as a generic target.
117
+ - OpenClaw import requires an explicitly selected source file, supported version and application. It never imports provider authentication, gateways, plugins or tasks, and it cannot automatically take over a receiver; cutover and rollback remain an explicit, verified manual gate.
118
+ - GitHub waits default to anonymous public access. In **Connections → GitHub**, configure a local `gh` login or a dedicated token. Admitted members can use the connected account’s actual API permissions in private and group chats, within the user’s request. No repository grant lists or per-call confirmations apply. CI waits never trigger writes. See [GitHub connection settings (Chinese)](operations.md#github-连接).
119
+ - A platform send receipt means the platform accepted the message, not that the user read it. Ambiguous sends are retained for review.
120
+ - A sleeping or disconnected host cannot provide continuous service. There is no offline history backfill.
121
+ - Never commit `config.local.json`, `data/`, logs, tokens or authentication files. Namo does not automatically import personal MCP servers, plugins or third-party model gateways.
122
+
123
+ The CLI provides `init`, `config`, `login`, `start`, `service`, and `ui`. Status, logs, diagnostics, and Git push records are available in the workbench. Inspect OpenClaw sources under **Connections → Runtime and maintenance**; import with `namo init --import`. Migration never switches receivers automatically. Pushes use configured targets and execute on submission without extra confirmation. See [OpenClaw migration](operations.md#openclaw-导入) and [Git pushes](operations.md#git-推送).
124
+
125
+ Background service management currently supports macOS. Other systems can use foreground mode but have not completed full platform acceptance. Codex is the only execution backend. Other agents are reserved for future plugins; no additional agent SDKs or probes are included.
126
+
127
+ ## How it works
128
+
129
+ Namo persists each incoming message before acknowledging it, then schedules a task in a separate runner. Conversations are serialized per chat, overlapping writable directories are mutually exclusive, and a global concurrency limit applies. The official Codex app-server handles the model turn under Namo's filesystem and network policy. Host-managed GitHub and MCP tools use their configured credentials; those credentials are not passed to the model process.
130
+
131
+ Task state, waits, results and delivery records are stored in SQLite. A runner that is interrupted or lost is not automatically replayed, and an ambiguous delivery is not automatically resent. A model completing, the platform accepting a message and the user receiving it are separate facts. The current database schema is version 16; compatible v13–v15 databases are migrated, while incompatible older databases are rejected rather than deleted.
132
+
133
+ The local workbench binds to loopback and uses startup authorization, an HttpOnly session, Host and Origin checks, and a content security policy. See [architecture (Chinese)](architecture.md) for module responsibilities, remaining risks and migration details.
134
+
135
+ ## Ego browser access
136
+
137
+ On macOS, a paired user can use the restricted Ego Lite browser in a private chat when command networking is enabled. The first browser request asks for task-scoped approval; key presses require separate approval. With card callbacks enabled, use the approval buttons, or reply `/mcp-approve MA-ID --always` to authorize the current fixed browser operations for future tasks in that private chat. Send `/browser-revoke` to revoke the persistent grant. The browser can use its own network access and logged-in sessions. Group chats and scheduled tasks cannot use this integration.
138
+
139
+ The tool supports opening pages, snapshots, clicks, filling fields and a limited set of key presses in a task-owned space. It does not accept arbitrary scripts, raw CDP, uploads or downloads. New capabilities are not automatically covered by the persistent grant. A normal run closes its space; interrupted or uncertain operations are not automatically retried and may leave a space to inspect manually. A new run after a human wait does not resume the old browser space. See [Ego browser operations (Chinese)](operations.md#ego-浏览器原型).
140
+
141
+ ## Development
142
+
143
+ The stack is TypeScript, Node.js built-in SQLite, the official Feishu Node SDK and Codex app-server over stdio. The workbench uses React, Radix Themes and Vite; its compiled assets and fonts are bundled with the CLI.
144
+
145
+ ```sh
146
+ pnpm test
147
+ pnpm run smoke:codex # Protocol handshake; no inference
148
+ pnpm run smoke:codex -- --run # Explicit real inference test
149
+ ```
150
+
151
+ See the [documentation index](README.md), [developer guide](architecture.md#开发与验证), and [remaining work](development-plan.md). The existing implementation and operations references are currently in Chinese.
152
+
153
+ Project: [github.com/dofy/namo](https://github.com/dofy/namo). Report reproducible issues without credentials, private configuration or raw conversation data.
@@ -0,0 +1,44 @@
1
+ # Workbench UI conventions
2
+
3
+ The workbench uses a light gray canvas, white content panels, and orange for
4
+ active choices and primary actions. Keep the existing sidebar and compact record
5
+ tables. Design for both Chinese and English, including 320 px mobile screens.
6
+
7
+ ## Page structure
8
+
9
+ - Use the shared page header in `ui/App.tsx`: icon, title, one sentence explaining
10
+ the page, and refresh status. Align content to the same page edges.
11
+ - Group related settings with `PageSection` and `SectionHeading`. Each section
12
+ should explain a user goal; avoid exposing schema versions or migration terms
13
+ as the main status. Keep troubleshooting metadata available in its own area.
14
+ - Use `SettingToggle` for independent choices. The whole card is a keyboard
15
+ accessible switch with a title, icon, short explanation, and visible state.
16
+ - On mobile, put a small icon, title, and switch on one row, with the explanation
17
+ below. Use compact spacing and hide redundant visual on/off text; keep the
18
+ accessible checked state and the whole-card touch target.
19
+ - Keep tasks and sessions in tables. Separate search filters from results and
20
+ keep pagination beside the results. Use `EmptyState` to explain what to do next.
21
+ - Put optional setup instructions, advanced parameters, source records, and
22
+ history in native disclosures. Do not hide errors or required confirmations.
23
+ - Keep explanatory text within the available panel width. Do not insert manual
24
+ line breaks to fit one screen size. Long identifiers must wrap or scroll locally.
25
+
26
+ ## Interaction and safety
27
+
28
+ - Show save actions with the form they affect. Pin the action bar only while
29
+ there are unsaved changes; it should not obscure an untouched form.
30
+ - Preserve drafts, revision conflicts, disabled states, and confirmation dialogs.
31
+ A visual redesign must not change permissions or bypass an existing confirmation.
32
+ - Keep settings and profile drafts mounted when navigating or changing tabs.
33
+ - Keep independent forms independent, including the per-user model setting.
34
+ - State whether a setting requires saving, applying, or affects only new tasks.
35
+ Use wording supported by actual behavior.
36
+
37
+ ## Verification
38
+
39
+ Use isolated API fixtures to inspect all routes, both memory tabs, and editors.
40
+ Check desktop and narrow screens in both languages, then exercise keyboard
41
+ switches, filtering, failed saves, discarded drafts, tab navigation, and dialog
42
+ closing. Do not change real settings or restart the receiver for visual checks.
43
+ Run `pnpm test` before delivery. Store screenshots and local browser scripts in
44
+ ignored `output/playwright/`, without credentials or production user content.
@@ -0,0 +1,15 @@
1
+ # Namo documentation site
2
+
3
+ [简体中文](#简体中文) · [English](#english)
4
+
5
+ ## 简体中文
6
+
7
+ 在仓库根目录安装依赖并运行 `pnpm run build` 后,执行 `pnpm cli docs`;已安装 CLI 时使用 `namo docs`。命令会启动本地服务并打开浏览器,按 Ctrl+C 停止。开发文档站时也可使用 `pnpm docs:dev`。整个 `docs-site/` 可作为静态网站目录部署;当前未配置托管地址。
8
+
9
+ 内容按章节在 `content.js` 中同时维护中英文,保留一致的章节 ID,以便语言切换和链接定位。项目中更细的 Markdown 实现及运维参考保留在 [`docs/`](../docs/)。
10
+
11
+ ## English
12
+
13
+ After installing dependencies and running `pnpm run build`, use `pnpm cli docs` from the repository root, or `namo docs` with an installed CLI. The command starts a local server and opens your browser; press Ctrl+C to stop it. Use `pnpm docs:dev` when developing the site. The entire `docs-site/` directory can be deployed as a static site. No hosting address is configured yet.
14
+
15
+ Maintain the English and Chinese content together in `content.js` and keep section IDs stable for language switching and deep links. More detailed implementation and operations references remain in [`docs/`](../docs/).
Binary file
@@ -0,0 +1,34 @@
1
+ // Curated from the repository's technical and operations guides. Keep both languages aligned.
2
+ export const groups = [
3
+ { id:'start', zh:'开始使用', en:'Getting started', items:['overview','install','feishu','first-task'] },
4
+ { id:'work', zh:'日常使用', en:'Everyday work', items:['workbench','tasks','memory','materials','schedules'] },
5
+ { id:'connect', zh:'连接与权限', en:'Connections & access', items:['directories','github','mcp','browser'] },
6
+ { id:'maintain', zh:'维护与开发', en:'Operate & develop', items:['service','recovery','architecture','development'] },
7
+ ];
8
+ export const sections = [
9
+ { id:'overview', icon:'compass', zh:{ title:'认识 Namo', body:`<p>Namo 把官方 Codex 连接到飞书或 Lark。私聊发消息,或在群里 @ 机器人,就能让它处理获准目录中的文件、运行测试、审查代码并在原会话回复。</p><p>任务状态保存在你的机器上;模型推理使用 Codex 账号对应的服务。Namo 处于早期可用阶段,需要自行托管和维护。</p><div class="notice"><p><strong>开始之前:</strong>后台服务管理支持 macOS;其他平台可前台运行,但尚未完成完整平台验收。</p></div>`}, en:{ title:'Meet Namo', body:`<p>Namo connects the official Codex agent to Feishu or Lark. Send a direct message or mention the bot in a group to work on files in allowed directories, run tests, review code and receive a reply in the same conversation.</p><p>Task state stays on your machine; model inference uses the service associated with your Codex account. Namo is an early-access project that you host and maintain yourself.</p><div class="notice"><p><strong>Before you begin:</strong> background service management supports macOS. Other platforms can run in the foreground but have not completed full platform acceptance.</p></div>`}},
10
+ { id:'install', icon:'download', zh:{ title:'安装与初始化', body:`<p>准备 Node.js 24.15 或更新版本、官方 Codex CLI,以及启用了机器人的飞书或 Lark 自建应用。安装并初始化:</p><pre><code>npm install -g @dofy/namo
11
+ namo init</code></pre><p>向导会引导你选择可访问目录、配置应用凭据、登录 Namo 独立的 Codex 账号并完成配对。真实模型和消息测试是可选步骤,可能消耗账号额度。</p><h3>启动与工作台</h3><p>如果没有安装 macOS 后台服务,使用 <code>namo start</code> 前台运行。用 <code>namo ui</code> 打开本地工作台;工作台不会启动另一个接收端。</p><div class="notice"><p>不要同时为同一个飞书应用运行另一个接收器。</p></div>`}, en:{ title:'Install & initialize', body:`<p>Prepare Node.js 24.15 or newer, the official Codex CLI, and a Feishu or Lark internal app with a bot. Install and initialize:</p><pre><code>npm install -g @dofy/namo
12
+ namo init</code></pre><p>The wizard guides you through allowed directories, app credentials, Namo’s isolated Codex login and user pairing. Live model and message tests are optional and may use account quota.</p><h3>Start the service and workbench</h3><p>If you did not install the macOS background service, run <code>namo start</code> in the foreground. Open the local workbench with <code>namo ui</code>; it does not start another receiver.</p><div class="notice"><p>Do not run a second receiver for the same Feishu app.</p></div>`}},
13
+ { id:'feishu', icon:'message', zh:{ title:'连接飞书或 Lark', body:`<p>创建并发布企业自建应用,启用机器人并设置应用可用范围。使用长连接接收事件;在初始化向导提示后,在机器人私聊中发送一次性配对码。</p><div class="table-wrap"><table><thead><tr><th>配置</th><th>需要的内容</th></tr></thead><tbody><tr><td>消息事件</td><td><code>im.message.receive_v1</code></td></tr><tr><td>消息权限</td><td><code>im:message.p2p_msg:readonly</code>、<code>im:message.group_at_msg:readonly</code>、<code>im:message:send_as_bot</code></td></tr><tr><td>卡片按钮</td><td>额外订阅 <code>card.action.trigger</code></td></tr></tbody></table></div><p>组织接入可在初始化后从工作台配置。应用可用范围、事件和权限变更需要在飞书后台发布后生效。</p>`}, en:{ title:'Connect Feishu or Lark', body:`<p>Create and publish an internal app, enable its bot, and set the app’s availability. Receive events through a long connection. When the wizard prompts you, send the one-time pairing code in a direct chat with the bot.</p><div class="table-wrap"><table><thead><tr><th>Setting</th><th>Required</th></tr></thead><tbody><tr><td>Message event</td><td><code>im.message.receive_v1</code></td></tr><tr><td>Message scopes</td><td><code>im:message.p2p_msg:readonly</code>, <code>im:message.group_at_msg:readonly</code>, <code>im:message:send_as_bot</code></td></tr><tr><td>Card buttons</td><td>Also subscribe to <code>card.action.trigger</code></td></tr></tbody></table></div><p>Organization access can be configured later in the workbench. Publish changes to app availability, events and permissions in the Feishu console.</p>`}},
14
+ { id:'first-task', icon:'send', zh:{ title:'开始第一个任务', body:`<p>在私聊里直接说出目标;群聊默认需要 @ 机器人。例如:</p><ul><li>“检查这个项目的测试结果,告诉我失败原因。”</li><li>“审查这个 PR,指出需要处理的问题。”</li><li>“把刚完成的报告发给我。”</li></ul><p>Namo 会反馈进度,缺少必要信息时可暂停等待回答。取消任务不会撤销已经发生的文件或外部操作。</p>`}, en:{ title:'Start your first task', body:`<p>State your goal in a direct chat; group chats require a mention by default. For example:</p><ul><li>“Check the project tests and explain any failures.”</li><li>“Review this PR and point out issues to address.”</li><li>“Send me the report you just finished.”</li></ul><p>Namo reports progress and can pause for missing information. Canceling a task does not undo file or external actions that have already happened.</p>`}},
15
+ { id:'workbench', icon:'layout', zh:{ title:'本地工作台', body:`<p>工作台集中管理任务、会话、定时任务、助手、记忆、个人档案和连接设置。它仅监听本机地址,启动时通过一次性授权建立会话。</p><pre><code>namo ui</code></pre><p>启动后保持终端进程运行。侧栏可切换英文和简体中文;历史内容和任务原文不会被翻译。配置保存后,已接受的队列保留原配置,新任务在安全切换后使用新配置。</p>`}, en:{ title:'Local workbench', body:`<p>The workbench brings together tasks, sessions, schedules, assistant settings, memories, profiles and connections. It listens on loopback only and establishes a session through one-time startup authorization.</p><pre><code>namo ui</code></pre><p>Keep the terminal process running while using it. The sidebar switches between English and Simplified Chinese; past task content is not translated. Accepted work keeps its existing configuration; new tasks use the new configuration after a safe switch.</p>`}},
16
+ { id:'tasks', icon:'list', zh:{ title:'任务与会话', body:`<p>同一聊天的任务按顺序处理;可写目录重叠的任务互斥,全局并发也有上限。任务运行在独立 runner 中,接收器重启不会自动重跑它。</p><p>可以用自然语言查看或停止任务,也可以使用 <code>/task</code>、<code>/tasks</code>、<code>/cancel</code>、<code>/status</code> 和 <code>/help</code>。<code>/refresh</code> 会以有限历史摘录刷新会话;<code>/new</code> 开始空上下文。</p><p>等待回答时引用问题回复。等待最长 24 小时;它用于补充信息,不是操作授权。</p>`}, en:{ title:'Tasks & sessions', body:`<p>Tasks in the same chat run in order; overlapping writable directories are mutually exclusive, and a global concurrency limit applies. A task runs in an independent runner and is not automatically replayed when the receiver restarts.</p><p>Ask about or stop tasks in natural language, or use <code>/task</code>, <code>/tasks</code>, <code>/cancel</code>, <code>/status</code> and <code>/help</code>. <code>/refresh</code> starts a refreshed session with bounded history; <code>/new</code> starts an empty context.</p><p>Reply to the question when a task waits for input. Human waits last up to 24 hours; answers provide information, not operation authorization.</p>`}},
17
+ { id:'memory', icon:'brain', zh:{ title:'助手与记忆', body:`<p>工作台可设置助手身份、职责和回答风格,并选择是否使用本人档案。长期记忆从直接对话中提取有来源的信息;隐私与可见范围会在读取时检查,记忆本身不授予操作权限。</p><p>你可以查看、纠正、停用或删除记忆。删除影响后续检索,但不会同时清除既有会话、历史消息或备份;需要干净上下文时使用 <code>/new</code>。</p>`}, en:{ title:'Assistant & memory', body:`<p>Set the assistant’s identity, responsibilities and response style in the workbench, and choose whether it uses your profile. Long-term memory extracts sourced facts from direct conversations; privacy and visibility are checked when reading. Memory does not grant authority to act.</p><p>You can inspect, correct, disable or delete memories. Deletion affects future retrieval but does not erase existing sessions, messages or backups; use <code>/new</code> for a clean context.</p>`}},
18
+ { id:'materials', icon:'file', zh:{ title:'材料与文件交付', body:`<p>可处理直接发送的 UTF-8 文本、Markdown、PNG / JPEG,以及合并转发中的文字。PDF、Office 和音视频内容解析目前不支持;合并转发内的附件也可能不可读取。</p><p>可以明确要求交付任务中的文件。系统校验文件归属与内容后发送;官方图片生成工具产生的图片会在任务完成或等待后进入自动交付。平台接受消息不等于用户已经收到。</p>`}, en:{ title:'Materials & file delivery', body:`<p>Namo can process directly sent UTF-8 text, Markdown, PNG / JPEG images and text in merged forwards. PDF, Office, audio and video interpretation are not supported; attachments inside merged forwards may also be unavailable.</p><p>Explicitly request files from a task for delivery. The service validates ownership and content before sending. Images produced by the official image tool enter automatic delivery when a task finishes or waits. Platform acceptance does not mean the user received the message.</p>`}},
19
+ { id:'schedules', icon:'clock', zh:{ title:'定时任务', body:`<p>在私聊中自然语言创建、查看、暂停或删除提醒与任务,也可在工作台查看状态。请提供时间和时区;每日和每周按固定间隔重复。</p><p>服务停机时不会执行;恢复后错过的多次触发合并为一次。暂停或删除不会撤销已入队或已执行的工作。</p>`}, en:{ title:'Scheduled work', body:`<p>Create, inspect, pause or delete reminders and tasks in a private chat, and review their status in the workbench. Specify a time and time zone; daily and weekly schedules use fixed intervals.</p><p>Nothing runs while the service is stopped. Multiple missed triggers are combined into one after recovery. Pausing or deleting a schedule does not undo work already queued or performed.</p>`}},
20
+ { id:'directories', icon:'folder', zh:{ title:'目录与执行权限', body:`<p>初始化时必须明确选择目录白名单。所有获准与机器人对话的成员及群聊共享这些目录的读写权限;写权限也包括删除文件。新任务有独立的会话工作目录,不默认使用启动目录。</p><div class="notice"><p><strong>授权前请确认范围:</strong>共享目录中的内容可能被所有已准入成员通过任务访问。不要为解决工具路径问题而开放整个用户主目录。</p></div><p>配置、运行数据和隔离的 Codex 登录文件被排除在 Agent 可访问范围之外。已启用 Skills 只读开放各自具体目录;用户停用的技能保持停用。</p>`}, en:{ title:'Directories & permissions', body:`<p>Setup requires an explicit directory allowlist. All admitted members and group chats share read and write access to those directories; write access includes deletion. New tasks get separate conversation workspaces and do not use the launch directory by default.</p><div class="notice"><p><strong>Choose the scope carefully:</strong> all admitted members may request tasks that access shared directories. Do not grant your whole home directory to fix a tool path.</p></div><p>Configuration, runtime data and the isolated Codex login are excluded from agent access. Enabled Skills receive read-only access to their individual directories; personal opt-outs remain disabled.</p>`}},
21
+ { id:'github', icon:'git', zh:{ title:'GitHub', body:`<p>在工作台的<strong>连接设置 → GitHub</strong>中配置本机 <code>gh</code> 登录或独立令牌。已准入成员可在私聊和群聊中按用户请求使用该账号实际拥有的 API 权限,不再设置逐仓库授权。</p><p>PR 审查读取固定 base/head 的有界补丁;GitHub 检查等待不会自动执行写操作。Git push 入口会记录和校验任务、目录、远端、分支与提交,但这只是有限保护,不能约束其他通用联网工具。</p>`}, en:{ title:'GitHub', body:`<p>Configure a local <code>gh</code> login or a dedicated token in <strong>Connections → GitHub</strong>. Admitted members can use the account’s actual API permissions in private and group chats within the user’s request; no repository grant lists apply.</p><p>PR review reads bounded patches at fixed base/head commits; GitHub check waits do not perform writes. The Git push entry records and validates the task, directory, remote, branch and commit. This is limited protection and cannot constrain other general network tools.</p>`}},
22
+ { id:'mcp', icon:'plug', zh:{ title:'MCP 连接', body:`<p>在工作台添加公网 HTTPS Streamable HTTP MCP 连接,使用 OAuth 或 Bearer 令牌授权。已准入成员共享已授权连接,并在外部账号权限范围内执行用户请求的读写操作。</p><p>也可以添加可信的本地 stdio 程序,填写可执行文件绝对路径和 JSON 参数数组;进程以 Namo 系统用户的权限运行,所有获准对话的成员均可调用。本地或内网 HTTP 地址及自定义请求头不支持。结果不明时先核对外部服务,不要盲目重复执行。</p>`}, en:{ title:'MCP connections', body:`<p>Add public HTTPS Streamable HTTP MCP connections in the workbench and authorize them with OAuth or a Bearer token. Admitted members share authorized connections and can carry out requested reads and writes within the external account’s permissions.</p><p>Trusted local stdio programs can also be added using an absolute executable path and a JSON array of arguments; they run with the Namo OS user’s permissions and are available to admitted bot members. Local or private-network HTTP addresses and custom request headers are not supported. Check the external service when an outcome is unknown instead of blindly repeating the operation.</p>`}},
23
+ { id:'browser', icon:'globe', zh:{ title:'Ego 浏览器', body:`<p>macOS 上,已配对用户可在私聊中使用受限的 Ego Lite 浏览器。首次任务会请求授权,单次授权包括打开、快照、点击和填写;按键需单独确认。</p><p>启用卡片回调后可直接点击授权按钮,也可回复 <code>永久允许 MA-编号</code>,允许本人未来私聊任务使用当前固定操作和按键;发送 <code>撤销浏览器永久授权</code> 可撤销。浏览器使用自己的网络权限和登录状态。</p><div class="notice"><p>不支持任意脚本、原始 CDP、上传下载或选择已有空间。群聊、定时任务不能使用;结果不明时不会自动重试。</p></div>`}, en:{ title:'Ego browser', body:`<p>On macOS, paired users can use the restricted Ego Lite browser in private chats. The first task requests authorization for opening pages, snapshots, clicks and filling; key presses require separate approval.</p><p>With card callbacks enabled, use the approval buttons, or reply <code>/mcp-approve MA-ID --always</code> to allow the current fixed actions and keys for your future private-chat tasks. Send <code>/browser-revoke</code> to revoke it. The browser uses its own network permissions and logged-in sessions.</p><div class="notice"><p>Arbitrary scripts, raw CDP, uploads, downloads and selecting existing spaces are unsupported. Group chats and scheduled tasks cannot use it; unknown outcomes are not automatically retried.</p></div>`}},
24
+ { id:'service', icon:'server', zh:{ title:'服务与升级', body:`<p>macOS 后台服务使用固定、经过校验的发布快照。构建源码不会自动切换服务;使用 <code>namo service upgrade</code> 创建并验证快照和备份。</p><div class="table-wrap"><table><thead><tr><th>命令</th><th>用途</th></tr></thead><tbody><tr><td><code>namo service install</code></td><td>首次安装并启动后台服务</td></tr><tr><td><code>namo service upgrade</code></td><td>校验备份并升级已安装的服务</td></tr><tr><td><code>namo service stop</code> / <code>start</code></td><td>停止或启动已有服务</td></tr></tbody></table></div><p>兼容变更可在线切换,新执行版本先观察五分钟。不兼容的接收器、存储或依赖变更需要安排停机窗口,确认任务、等待、runner 和投递均已收口后再升级。停止接收器不会自动停止独立 runner。</p><p>卸载保留配置、数据与登录;不要用旧备份覆盖升级后产生的新消息。</p>`}, en:{ title:'Service & upgrades', body:`<p>The macOS background service uses a verified, pinned release snapshot. Building source does not switch the running service; <code>namo service upgrade</code> creates and verifies a snapshot and backup.</p><div class="table-wrap"><table><thead><tr><th>Command</th><th>Purpose</th></tr></thead><tbody><tr><td><code>namo service install</code></td><td>Install and start the background service</td></tr><tr><td><code>namo service upgrade</code></td><td>Verify a backup and upgrade an installed service</td></tr><tr><td><code>namo service stop</code> / <code>start</code></td><td>Stop or start the existing service</td></tr></tbody></table></div><p>Compatible changes can switch online, with the new execution version observed for five minutes. Incompatible receiver, storage or dependency changes require a planned stop after tasks, waits, runners and deliveries are settled. Stopping the receiver does not automatically stop independent runners.</p><p>Uninstall retains configuration, data and login. Do not overwrite messages created after an upgrade with an old backup.</p>`}},
25
+ { id:'recovery', icon:'life', zh:{ title:'异常与恢复', body:`<div class="table-wrap"><table><thead><tr><th>情况</th><th>下一步</th></tr></thead><tbody><tr><td>无法收消息</td><td>在连接设置运行诊断;核对应用发布、事件、权限和重复接收端。</td></tr><tr><td>Codex 未登录</td><td>运行 <code>namo login</code>,再检查连接。</td></tr><tr><td>runner 失联</td><td>检查进程、后代进程和实际效果,再解除占位;不要重跑。</td></tr><tr><td>投递结果不明</td><td>先在飞书核实,再通过工作台处理已保存的结果。</td></tr></tbody></table></div><p>平台接受、用户收到和模型完成是不同的事实。遇到未知结果时先核对,避免重复执行或发送。</p>`}, en:{ title:'Troubleshooting & recovery', body:`<div class="table-wrap"><table><thead><tr><th>Situation</th><th>Next step</th></tr></thead><tbody><tr><td>No messages received</td><td>Run diagnostics in Connections; check app publication, events, scopes and duplicate receivers.</td></tr><tr><td>Codex is signed out</td><td>Run <code>namo login</code>, then check the connection.</td></tr><tr><td>Runner lost</td><td>Inspect the process, descendants and actual effects before releasing its reservation; do not replay it.</td></tr><tr><td>Delivery unknown</td><td>Check Feishu first, then handle the saved result in the workbench.</td></tr></tbody></table></div><p>Model completion, platform acceptance and user receipt are separate facts. Verify unknown outcomes before repeating an action or send.</p>`}},
26
+ { id:'architecture', icon:'layers', zh:{ title:'工作原理', body:`<p>消息先写入 SQLite,再确认收件。调度器启动独立 runner,由官方 Codex app-server 在文件系统和网络策略下执行。GitHub、MCP 等宿主管理的工具使用配置的凭据;凭据不会交给模型进程。</p><p>任务、等待、结果和投递记录持久保存。中断或失联时不自动重放;工作台只绑定本机地址,并使用启动授权、HttpOnly 会话、Host / Origin 检查和 CSP。</p><p>当前数据库 schema 为 16;兼容的 v13–v15 可迁移,不兼容的旧库会被拒绝,不会自动删除。</p><p><a href="https://github.com/dofy/namo/blob/main/docs/architecture.md" target="_blank" rel="noopener noreferrer">查看模块实现与已知边界(中文)</a></p>`}, en:{ title:'How it works', body:`<p>Messages are written to SQLite before acknowledgment. The scheduler starts an independent runner; the official Codex app-server executes under filesystem and network policy. Host-managed tools such as GitHub and MCP use configured credentials without passing them to the model process.</p><p>Tasks, waits, results and delivery records are durable. Interrupted or lost work is not automatically replayed. The workbench binds to loopback and uses startup authorization, an HttpOnly session, Host and Origin checks, and CSP.</p><p>The current database schema is 16. Compatible v13–v15 databases can migrate; incompatible older databases are rejected rather than deleted.</p><p><a href="https://github.com/dofy/namo/blob/main/docs/architecture.md" target="_blank" rel="noopener noreferrer">Module implementation and known boundaries (Chinese)</a></p>`}},
27
+ { id:'development', icon:'code', zh:{ title:'开发与验证', body:`<p>Namo 使用 TypeScript、Node.js 内置 SQLite、飞书官方 SDK 与 Codex app-server。工作台使用 React、Radix Themes 和 Vite。</p><pre><code>pnpm test
28
+ node scripts/check-package.mjs
29
+ pnpm run smoke:skills
30
+ pnpm run smoke:codex</code></pre><p>测试先构建再运行编译结果。<code>smoke:codex</code> 仅检查协议握手;追加 <code>-- --run</code> 会调用真实模型并消耗账号额度,运行前应取得明确同意。</p><p>反馈问题时请勿附上凭据、私有配置、日志中的敏感信息或原始会话数据。</p>`}, en:{ title:'Development & validation', body:`<p>Namo uses TypeScript, Node.js built-in SQLite, the official Feishu SDK and Codex app-server. The workbench uses React, Radix Themes and Vite.</p><pre><code>pnpm test
31
+ node scripts/check-package.mjs
32
+ pnpm run smoke:skills
33
+ pnpm run smoke:codex</code></pre><p>Tests build first and run compiled output. <code>smoke:codex</code> only checks the protocol handshake; adding <code>-- --run</code> invokes a real model and uses account quota, so obtain explicit consent first.</p><p>Do not include credentials, private configuration, sensitive log data or raw conversation data in issue reports.</p>`}},
34
+ ];
@@ -0,0 +1,27 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1">
6
+ <meta name="description" content="Namo documentation: setup, everyday work, connections, permissions and operations.">
7
+ <title>Namo 文档</title>
8
+ <link rel="icon" type="image/png" href="./assets/namo-logo.png">
9
+ <link rel="stylesheet" href="./style.css">
10
+ <script type="module" src="./main.js"></script>
11
+ </head>
12
+ <body>
13
+ <a class="skip" href="#content">跳转到文档</a>
14
+ <header class="header">
15
+ <a class="brand" href="https://github.com/dofy/namo" aria-label="Namo GitHub"><img src="./assets/namo-logo.png" alt=""><span>Namo<span class="brand-dot">.</span></span></a>
16
+ <nav class="header-links" aria-label="项目链接"><a href="https://github.com/dofy/namo" target="_blank" rel="noopener noreferrer"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M9 19c-4.3 1.4-4.3-2.5-6-3m12 6v-3.9a3.4 3.4 0 0 0-1-2.6c3.3-.4 6.7-1.6 6.7-7a5.4 5.4 0 0 0-1.5-3.8 5 5 0 0 0-.1-3.8S18 0 15 2.4a13 13 0 0 0-7 0C5 0 3.9.9 3.9.9a5 5 0 0 0-.1 3.8A5.4 5.4 0 0 0 2.3 8.5c0 5.4 3.4 6.6 6.7 7a3.4 3.4 0 0 0-1 2.6V22"/></svg><span>GitHub</span></a><a href="https://github.com/dofy/namo/issues" target="_blank" rel="noopener noreferrer" data-label="issues">问题反馈</a></nav>
17
+ <div class="controls"><div class="language" id="language"><button class="language-trigger" type="button" aria-haspopup="listbox" aria-expanded="false" aria-controls="language-menu" aria-label="语言"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18"/></svg><span class="language-current">简体中文</span><svg class="chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m6 9 6 6 6-6"/></svg></button><ul class="language-menu" id="language-menu" role="listbox" tabindex="-1" aria-label="语言" hidden><li role="option" data-value="zh-CN" aria-selected="true">简体中文<svg class="check" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></li><li role="option" data-value="en" aria-selected="false">English<svg class="check" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg></li></ul></div><button class="theme" id="theme" type="button" aria-label="切换深浅色模式" title="切换深浅色模式"><svg class="icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32 1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41"/></svg><svg class="icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20.985 12.486a9 9 0 1 1-9.47-9.47 7 7 0 0 0 9.47 9.47"/></svg></button></div>
18
+ </header>
19
+ <div class="layout">
20
+ <aside class="sidebar"><div class="sidebar-label" data-label="contents">文档目录</div><nav id="desktop-nav" aria-label="文档目录"></nav><div class="sidebar-bottom"><span class="status-dot"></span><span data-label="status">自托管 · 早期可用</span></div></aside>
21
+ <main class="content" id="content" tabindex="-1"><div class="intro"><span class="eyebrow" data-label="guide">NAMO 文档</span><h1 data-label="title">让工作继续向前<span>.</span></h1><p data-label="intro">从连接飞书,到安全地运行任务。这里是你使用和维护 Namo 的完整指南。</p></div>
22
+ <details class="mobile-nav"><summary data-label="contents">文档目录</summary><nav id="mobile-nav" aria-label="文档目录"></nav></details>
23
+ <div id="sections"></div>
24
+ <footer><span data-label="footer">为认真做事而设计。</span><a href="https://github.com/dofy/namo" target="_blank" rel="noopener noreferrer">GitHub</a></footer>
25
+ </main>
26
+ </div>
27
+ </body></html>
@@ -0,0 +1,26 @@
1
+ import { groups, sections } from './content.js';
2
+
3
+ const icons={compass:'<circle cx="12" cy="12" r="9"/><path d="m16 8-2.5 5.5L8 16l2.5-5.5L16 8Z"/>',download:'<path d="M12 3v12m-4-4 4 4 4-4"/><path d="M5 17v3h14v-3"/>',message:'<path d="M21 11.5a8.5 8.5 0 0 1-8.5 8.5 9 9 0 0 1-4-.9L3 21l1.9-5.5a9 9 0 0 1-.9-4A8.5 8.5 0 1 1 21 11.5Z"/>',send:'<path d="m22 2-7 20-4-9-9-4Z"/><path d="M22 2 11 13"/>',layout:'<rect x="3" y="3" width="18" height="18" rx="2"/><path d="M9 3v18"/>',list:'<path d="M9 6h12M9 12h12M9 18h12M4 6h.01M4 12h.01M4 18h.01"/>',brain:'<path d="M12 18V5a3 3 0 0 0-6 0 3.5 3.5 0 0 0-2 6 3.5 3.5 0 0 0 1 6 3.5 3.5 0 0 0 7 1Zm0 0V5a3 3 0 0 1 6 0 3.5 3.5 0 0 1 2 6 3.5 3.5 0 0 1-1 6 3.5 3.5 0 0 1-7 1Z"/>',file:'<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8Z"/><path d="M14 2v6h6"/>',clock:'<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>',folder:'<path d="M3 7a2 2 0 0 1 2-2h5l2 2h7a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z"/>',git:'<circle cx="6" cy="3" r="2"/><path d="M6 5v12"/><circle cx="6" cy="19" r="2"/><circle cx="18" cy="6" r="2"/><path d="M18 8a6 6 0 0 1-6 6H6"/>',plug:'<path d="M12 22v-5m-4-7V3m8 7V3M7 10h10v2a5 5 0 0 1-10 0Z"/>',globe:'<circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18"/>',server:'<rect x="3" y="3" width="18" height="7" rx="2"/><rect x="3" y="14" width="18" height="7" rx="2"/><path d="M7 6.5h.01M7 17.5h.01"/>',life:'<circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="3"/><path d="m5.64 5.64 4.24 4.24m4.24 4.24 4.24 4.24m0-12.72-4.24 4.24m-4.24 4.24-4.24 4.24"/>',layers:'<path d="m12 3 9 5-9 5-9-5 9-5Zm-9 9 9 5 9-5M3 16l9 5 9-5"/>',code:'<path d="m8 8-4 4 4 4m8-8 4 4-4 4m-3-12-2 16"/>'};
4
+ const svg = name => `<svg viewBox="0 0 24 24" fill="none" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${icons[name] || ''}</svg>`;
5
+ const labels={
6
+ 'zh-CN':{issues:'问题反馈',language:'语言',contents:'文档目录',status:'自托管 · 早期可用',guide:'NAMO 文档',title:'让工作继续向前',intro:'从连接飞书,到安全地运行任务。这里是你使用和维护 Namo 的完整指南。',footer:'为认真做事而设计。',theme:'切换深浅色模式',copy:'复制代码',copied:'已复制',failed:'复制失败,请手动选择',skip:'跳转到文档',projectLinks:'项目链接'},
7
+ en:{issues:'Issues',language:'Language',contents:'On this page',status:'Self-hosted · early access',guide:'NAMO DOCUMENTATION',title:'Keep work moving',intro:'From connecting Feishu to running tasks safely, this guide helps you use and maintain Namo.',footer:'Made for work that matters.',theme:'Toggle color theme',copy:'Copy code',copied:'Copied',failed:'Copy failed; select the code manually',skip:'Skip to documentation',projectLinks:'Project links'}
8
+ };
9
+ let lang;try{lang=localStorage.getItem('namo-doc-language')}catch{}if(!['zh-CN','en'].includes(lang))lang=navigator.language.toLowerCase().startsWith('zh')?'zh-CN':'en';
10
+ let theme;try{theme=localStorage.getItem('namo-doc-theme')}catch{}if(!['light','dark'].includes(theme))theme=matchMedia('(prefers-color-scheme: dark)').matches?'dark':'light';
11
+ const languageNames={'zh-CN':'简体中文',en:'English'};
12
+ const $=selector=>document.querySelector(selector);
13
+ const nav=locale=>groups.map(group=>`<div class="nav-group"><div class="nav-group-title">${group[locale==='en'?'en':'zh']}</div>${group.items.map(id=>{const s=sections.find(section=>section.id===id);return `<a class="nav-link" href="#${s.id}">${svg(s.icon)}<span>${s[locale==='en'?'en':'zh'].title}</span></a>`}).join('')}</div>`).join('');
14
+ function active(){const current=sections.filter(s=>{const e=document.getElementById(s.id);return e&&e.getBoundingClientRect().top<=130}).at(-1)?.id||sections[0].id;document.querySelectorAll('.nav-link').forEach(a=>{if(a.getAttribute('href')===`#${current}`)a.setAttribute('aria-current','location');else a.removeAttribute('aria-current')});}
15
+ function render(){const l=labels[lang],key=lang==='en'?'en':'zh';document.documentElement.lang=lang;document.documentElement.dataset.theme=theme;document.title=lang==='en'?'Documentation — Namo':'文档 — Namo';$('.language-current').textContent=languageNames[lang];document.querySelectorAll('#language-menu [role=option]').forEach(o=>o.setAttribute('aria-selected',String(o.dataset.value===lang)));$('.header-links').setAttribute('aria-label',l.projectLinks);$('.language-trigger').setAttribute('aria-label',`${l.language}: ${languageNames[lang]}`);$('#language-menu').setAttribute('aria-label',l.language);$('#desktop-nav').setAttribute('aria-label',l.contents);$('#mobile-nav').setAttribute('aria-label',l.contents);document.querySelectorAll('[data-label]').forEach(e=>{const label=l[e.dataset.label];if(label!==undefined){if(e.dataset.label==='title')e.innerHTML=`${label}<span>.</span>`;else e.textContent=label}});$('.skip').textContent=l.skip;$('#theme').setAttribute('aria-label',l.theme);$('#theme').setAttribute('aria-pressed',String(theme==='dark'));$('#theme').title=l.theme;$('#desktop-nav').innerHTML=nav(lang);$('#mobile-nav').innerHTML=nav(lang);$('#sections').innerHTML=sections.map(s=>`<section id="${s.id}"><div class="section-kicker">${svg(s.icon)}<span>${groups.find(g=>g.items.includes(s.id))[key]}</span></div><h2>${s[key].title}</h2>${s[key].body}</section>`).join('');
16
+ document.querySelectorAll('.content pre').forEach(pre=>{const wrapper=document.createElement('div');wrapper.className='code-block';pre.before(wrapper);wrapper.append(pre);const button=document.createElement('button');button.type='button';button.className='copy';button.setAttribute('aria-label',l.copy);button.title=l.copy;button.innerHTML='<svg viewBox="0 0 24 24" fill="none" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="8" y="8" width="11" height="12" rx="2"/><path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h2"/></svg>';button.addEventListener('click',async()=>{try{await navigator.clipboard.writeText(pre.textContent);button.title=l.copied;button.setAttribute('aria-label',l.copied)}catch{button.title=l.failed;button.setAttribute('aria-label',l.failed)}setTimeout(()=>{button.title=l.copy;button.setAttribute('aria-label',l.copy)},2000)});wrapper.append(button)});active();}
17
+ function setLanguage(value){if(value===lang)return;const current=scrollY>150?document.querySelector('.nav-link[aria-current]')?.getAttribute('href')?.slice(1):null;lang=value;try{localStorage.setItem('namo-doc-language',lang)}catch{}render();if(current)requestAnimationFrame(()=>document.getElementById(current)?.scrollIntoView({behavior:'instant'}))}
18
+ const trigger=$('.language-trigger'),menu=$('#language-menu'),options=[...menu.querySelectorAll('[role=option]')];let highlighted=0;
19
+ function highlight(index){highlighted=(index+options.length)%options.length;options.forEach((o,i)=>o.classList.toggle('highlighted',i===highlighted));menu.setAttribute('aria-activedescendant',options[highlighted].id)}
20
+ function openMenu(){menu.hidden=false;trigger.setAttribute('aria-expanded','true');highlight(Math.max(0,options.findIndex(o=>o.dataset.value===lang)));menu.focus()}
21
+ function closeMenu(focus=true){if(menu.hidden)return;menu.hidden=true;trigger.setAttribute('aria-expanded','false');if(focus)trigger.focus()}
22
+ options.forEach((o,i)=>{o.id=`language-option-${o.dataset.value}`;o.addEventListener('mousemove',()=>highlight(i));o.addEventListener('click',()=>{closeMenu();setLanguage(o.dataset.value)})});
23
+ trigger.addEventListener('click',()=>menu.hidden?openMenu():closeMenu());trigger.addEventListener('keydown',e=>{if(['ArrowDown','ArrowUp'].includes(e.key)){e.preventDefault();openMenu()}});
24
+ menu.addEventListener('keydown',e=>{if(e.key==='ArrowDown'){e.preventDefault();highlight(highlighted+1)}else if(e.key==='ArrowUp'){e.preventDefault();highlight(highlighted-1)}else if(e.key==='Home'){e.preventDefault();highlight(0)}else if(e.key==='End'){e.preventDefault();highlight(options.length-1)}else if(e.key==='Enter'||e.key===' '){e.preventDefault();const value=options[highlighted].dataset.value;closeMenu();setLanguage(value)}else if(e.key==='Escape'){e.preventDefault();closeMenu()}else if(e.key==='Tab')closeMenu(false)});
25
+ document.addEventListener('pointerdown',e=>{if(!e.target.closest('#language'))closeMenu(false)});
26
+ $('#theme').addEventListener('click',()=>{theme=theme==='dark'?'light':'dark';try{localStorage.setItem('namo-doc-theme',theme)}catch{}document.documentElement.dataset.theme=theme;$('#theme').setAttribute('aria-pressed',String(theme==='dark'))});document.addEventListener('click',e=>{if(e.target.closest('.mobile-nav a'))$('.mobile-nav').open=false});addEventListener('scroll',active,{passive:true});render();if(location.hash){let id;try{id=decodeURIComponent(location.hash.slice(1))}catch{id=''}if(id)requestAnimationFrame(()=>document.getElementById(id)?.scrollIntoView())}
@@ -0,0 +1 @@
1
+ :root{font-family:Inter,"Noto Sans SC",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#292b2d;background:#fbfaf8;font-synthesis:none;--ink:#292b2d;--muted:#686b6f;--soft:#73736e;--accent:#b95324;--accent-bg:#fbede2;--rule:#e9e5e0;--code:#252a2d;--page:#fbfaf8;--panel:#f4f2ee;--line:#ddd8d1;color-scheme:light}*{box-sizing:border-box}html{scroll-behavior:smooth;scroll-padding-top:32px}body{margin:0}a{color:var(--accent);text-decoration-thickness:1px;text-underline-offset:4px}a:hover{text-decoration-thickness:2px}button,select{font:inherit}button:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid #d9783f;outline-offset:3px}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}.skip{position:absolute;top:-100px;left:20px;z-index:20;background:var(--page);padding:12px}.skip:focus{top:12px}.header{height:92px;max-width:1450px;margin:auto;padding:0 64px;display:flex;align-items:center;gap:22px;border-bottom:1px solid var(--rule)}.brand{display:flex;align-items:center;gap:10px;text-decoration:none;color:var(--ink);font-weight:750;font-size:22px;letter-spacing:-.05em}.brand img{width:38px;height:38px;object-fit:contain}.brand-dot{color:#ea8050}.version{color:var(--soft);font-size:12px;font-weight:600}.header-links{margin-left:auto;display:flex;align-items:center;gap:26px}.header-links a{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:13px;font-weight:650;text-decoration:none}.header-links svg,.theme svg{width:17px;height:17px}.controls{display:flex;align-items:center;gap:12px;margin-left:8px}.language{position:relative}.language-trigger{display:flex;align-items:center;gap:7px;height:35px;border:1px solid var(--rule);border-radius:7px;padding:0 10px 0 11px;color:var(--ink);background:var(--page);font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap}.language-trigger:hover,.language-trigger[aria-expanded="true"]{background:var(--panel)}.language-trigger svg{width:15px;height:15px;color:var(--muted);flex:none}.language-trigger .chevron{width:13px;height:13px;transition:transform .15s}.language-trigger[aria-expanded="true"] .chevron{transform:rotate(180deg)}.language-menu{position:absolute;right:0;top:calc(100% + 6px);z-index:30;min-width:150px;margin:0;padding:5px;list-style:none;background:var(--page);border:1px solid var(--rule);border-radius:9px;box-shadow:0 10px 30px rgba(0,0,0,.12),0 2px 6px rgba(0,0,0,.06);outline:none}.language-menu[hidden]{display:none}.language-menu li{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:8px 10px;border-radius:6px;font-size:13px;color:var(--muted);cursor:pointer;user-select:none}.language-menu li.highlighted{background:var(--panel);color:var(--ink)}.language-menu li[aria-selected="true"]{color:var(--accent);font-weight:700}.language-menu .check{width:14px;height:14px;visibility:hidden}.language-menu li[aria-selected="true"] .check{visibility:visible}[data-theme="dark"] .language-menu{background:var(--panel);box-shadow:0 10px 30px rgba(0,0,0,.4)}[data-theme="dark"] .language-menu li.highlighted{background:var(--line)}.theme .icon-moon,[data-theme="dark"] .theme .icon-sun{display:none}[data-theme="dark"] .theme .icon-moon{display:block}.theme{width:35px;height:35px;display:grid;place-items:center;background:transparent;color:var(--muted);border:1px solid var(--rule);border-radius:7px;cursor:pointer}.layout{max-width:1322px;margin:0 auto;display:grid;grid-template-columns:220px minmax(0,800px);gap:96px;padding:62px 0 100px}.sidebar{position:sticky;top:28px;align-self:start;max-height:calc(100vh - 56px);overflow:auto}.sidebar-label{padding:0 12px;margin:0 0 17px;font-size:12px;color:var(--soft);font-weight:700}.nav-group{margin-bottom:22px}.nav-group-title{color:var(--soft);font-size:11px;font-weight:700;padding:5px 12px}.nav-link{display:flex;align-items:center;gap:10px;padding:8px 12px;color:var(--muted);text-decoration:none;border-radius:7px;font-size:13px;line-height:20px}.nav-link svg{width:16px;height:16px;flex:none;stroke:currentColor}.nav-link:hover{background:var(--panel);color:var(--ink)}.nav-link[aria-current="location"]{background:var(--accent-bg);color:var(--accent);font-weight:700}.sidebar-bottom{border-top:1px solid var(--rule);padding:20px 12px;display:flex;gap:8px;align-items:center;color:var(--soft);font-size:11px}.status-dot{width:7px;height:7px;border-radius:50%;background:#86a582}.intro{padding:4px 0 31px;border-bottom:1px solid var(--rule)}.eyebrow{font-size:11px;font-weight:750;letter-spacing:.08em;color:var(--accent)}h1{font-size:45px;line-height:1.17;letter-spacing:-.055em;margin:19px 0 17px;font-weight:760}h1 span{color:#e47c4a}.intro p{font-size:17px;line-height:1.8;color:var(--muted);max-width:620px;margin:0}.content{min-width:0}.content section{padding-top:46px;scroll-margin-top:16px}.content section+section{border-top:1px solid var(--rule);margin-top:48px}.section-kicker{display:flex;align-items:center;gap:10px;color:var(--accent);font-size:12px;font-weight:700}.section-kicker svg{width:18px;height:18px;stroke:currentColor}.content h2{font-size:29px;line-height:1.3;letter-spacing:-.035em;margin:12px 0 17px}.content h3{font-size:17px;letter-spacing:-.015em;margin:30px 0 10px}.content p,.content li{font-size:15px;line-height:1.9;color:var(--muted)}.content p{margin:12px 0}.content strong{color:var(--ink);font-weight:700}.content ul,.content ol{padding-left:22px;margin:12px 0}.content li{padding-left:4px;margin:6px 0}.content code:not(pre code){font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.87em;background:var(--panel);border:1px solid var(--rule);border-radius:4px;padding:2px 5px;color:var(--ink);overflow-wrap:anywhere}.code-block{position:relative;background:var(--code);color:#f2ece4;border-radius:9px;margin:20px 0;overflow:hidden}.code-block pre{margin:0;padding:22px 60px 22px 22px;overflow:auto;font:13px/1.8 ui-monospace,SFMono-Regular,Menlo,monospace}.copy{position:absolute;right:12px;top:12px;display:grid;place-items:center;width:32px;height:32px;border:1px solid #575e61;border-radius:6px;background:#343a3d;color:#efebe7;cursor:pointer}.copy svg{width:15px;height:15px;stroke:currentColor}.notice{border-left:3px solid #e3905c;background:var(--accent-bg);padding:14px 18px;margin:20px 0;border-radius:0 7px 7px 0}.notice p{margin:0;font-size:14px}.table-wrap{overflow-x:auto;margin:20px 0;border:1px solid var(--rule);border-radius:8px}table{width:100%;border-collapse:collapse;text-align:left;font-size:14px}th,td{padding:12px 16px;border-bottom:1px solid var(--rule);vertical-align:top;color:var(--muted);line-height:1.6}th{font-weight:700;color:var(--ink);background:var(--panel)}tr:last-child td{border-bottom:0}.mobile-nav{display:none}footer{margin-top:80px;padding-top:22px;border-top:1px solid var(--rule);display:flex;justify-content:space-between;color:var(--soft);font-size:12px}footer a{color:var(--muted)}[data-theme="dark"]{color-scheme:dark;--ink:#eceae6;--muted:#b7b6b2;--soft:#a5a49f;--accent:#f1a579;--accent-bg:#3c2d25;--rule:#343739;--code:#1b1e20;--page:#202325;--panel:#2b2e30;--line:#4b4c4d;background:var(--page);color:var(--ink)}@media(max-width:1450px){.layout{margin-left:64px;margin-right:64px;gap:72px}}@media(max-width:950px){.header{padding:0 32px}.layout{margin:0 32px;grid-template-columns:190px minmax(0,1fr);gap:36px}}@media(max-width:650px){.header{height:auto;min-height:76px;padding:16px 20px;gap:12px;flex-wrap:wrap}.brand{font-size:20px}.brand img{width:32px;height:32px}.version{font-size:11px}.header-links{gap:16px}.header-links a{font-size:12px}.header-links svg{display:none}.controls{margin-left:auto}.layout{display:block;margin:0 22px;padding:38px 0 70px}.sidebar{display:none}.intro{padding-bottom:24px}h1{font-size:34px}.intro p{font-size:15px}.mobile-nav{display:block;margin:24px 0 0;border:1px solid var(--rule);border-radius:8px;padding:13px 15px}.mobile-nav summary{font-size:13px;font-weight:700;cursor:pointer}.mobile-nav nav{padding-top:12px}.mobile-nav .nav-group{margin-bottom:10px}.content h2{font-size:25px}.content p,.content li{font-size:14px}.content section{padding-top:40px}.content section+section{margin-top:40px}footer{margin-top:60px}.table-wrap{overflow-x:auto}table{min-width:460px}}@media(max-width:380px){.header-links a[data-label="issues"]{display:none}.header{gap:10px}.header-links{gap:10px}.controls{gap:6px}.language-trigger{padding:0 8px}.language-trigger>svg:first-child{display:none}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
@@ -0,0 +1,4 @@
1
+ import { fileURLToPath } from 'node:url';
2
+
3
+ // The preview may serve documentation assets only, never the parent workspace.
4
+ export default { server: { fs: { strict: true, allow: [fileURLToPath(new URL('.', import.meta.url))] } } };