@dsh-ray/lark-channel 0.0.1-seed.0 → 0.2.0

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 (344) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +206 -1
  3. package/bin/dsh-lark-setup.js +37 -0
  4. package/bin/dsh-ray-setup.js +34 -0
  5. package/bin/dsh-supervised-growth-setup.js +34 -0
  6. package/cordis.patch.yml +23 -0
  7. package/docs/operations.md +133 -0
  8. package/docs/progress-security.md +125 -0
  9. package/docs/rsi-setup.md +216 -0
  10. package/docs/setup.md +358 -0
  11. package/docs/supervised-growth.md +95 -0
  12. package/lib/adapter.d.ts +185 -0
  13. package/lib/adapter.d.ts.map +1 -0
  14. package/lib/adapter.js +2072 -0
  15. package/lib/adapter.js.map +1 -0
  16. package/lib/answer-card.d.ts +40 -0
  17. package/lib/answer-card.d.ts.map +1 -0
  18. package/lib/answer-card.js +262 -0
  19. package/lib/answer-card.js.map +1 -0
  20. package/lib/approval.d.ts +26 -0
  21. package/lib/approval.d.ts.map +1 -0
  22. package/lib/approval.js +104 -0
  23. package/lib/approval.js.map +1 -0
  24. package/lib/business-cli-install.d.ts +9 -0
  25. package/lib/business-cli-install.d.ts.map +1 -0
  26. package/lib/business-cli-install.js +367 -0
  27. package/lib/business-cli-install.js.map +1 -0
  28. package/lib/business-environment.d.ts +2 -0
  29. package/lib/business-environment.d.ts.map +1 -0
  30. package/lib/business-environment.js +16 -0
  31. package/lib/business-environment.js.map +1 -0
  32. package/lib/business-skill.d.ts +32 -0
  33. package/lib/business-skill.d.ts.map +1 -0
  34. package/lib/business-skill.js +202 -0
  35. package/lib/business-skill.js.map +1 -0
  36. package/lib/command-card.d.ts +3 -0
  37. package/lib/command-card.d.ts.map +1 -0
  38. package/lib/command-card.js +480 -0
  39. package/lib/command-card.js.map +1 -0
  40. package/lib/config.d.ts +32 -0
  41. package/lib/config.d.ts.map +1 -0
  42. package/lib/config.js +115 -0
  43. package/lib/config.js.map +1 -0
  44. package/lib/group-thread.d.ts +20 -0
  45. package/lib/group-thread.d.ts.map +1 -0
  46. package/lib/group-thread.js +36 -0
  47. package/lib/group-thread.js.map +1 -0
  48. package/lib/index.d.ts +34 -0
  49. package/lib/index.d.ts.map +1 -0
  50. package/lib/index.js +53 -0
  51. package/lib/index.js.map +1 -0
  52. package/lib/launchd-control.d.ts +24 -0
  53. package/lib/launchd-control.d.ts.map +1 -0
  54. package/lib/launchd-control.js +68 -0
  55. package/lib/launchd-control.js.map +1 -0
  56. package/lib/launchd-identity.d.ts +34 -0
  57. package/lib/launchd-identity.d.ts.map +1 -0
  58. package/lib/launchd-identity.js +184 -0
  59. package/lib/launchd-identity.js.map +1 -0
  60. package/lib/launchd-target-lock.d.ts +6 -0
  61. package/lib/launchd-target-lock.d.ts.map +1 -0
  62. package/lib/launchd-target-lock.js +48 -0
  63. package/lib/launchd-target-lock.js.map +1 -0
  64. package/lib/launchd.d.ts +62 -0
  65. package/lib/launchd.d.ts.map +1 -0
  66. package/lib/launchd.js +370 -0
  67. package/lib/launchd.js.map +1 -0
  68. package/lib/model-picker.d.ts +24 -0
  69. package/lib/model-picker.d.ts.map +1 -0
  70. package/lib/model-picker.js +95 -0
  71. package/lib/model-picker.js.map +1 -0
  72. package/lib/normalize.d.ts +12 -0
  73. package/lib/normalize.d.ts.map +1 -0
  74. package/lib/normalize.js +85 -0
  75. package/lib/normalize.js.map +1 -0
  76. package/lib/permission-picker.d.ts +29 -0
  77. package/lib/permission-picker.d.ts.map +1 -0
  78. package/lib/permission-picker.js +145 -0
  79. package/lib/permission-picker.js.map +1 -0
  80. package/lib/progress.d.ts +34 -0
  81. package/lib/progress.d.ts.map +1 -0
  82. package/lib/progress.js +354 -0
  83. package/lib/progress.js.map +1 -0
  84. package/lib/resident.d.ts +13 -0
  85. package/lib/resident.d.ts.map +1 -0
  86. package/lib/resident.js +41 -0
  87. package/lib/resident.js.map +1 -0
  88. package/lib/rsi-authority-config.d.ts +29 -0
  89. package/lib/rsi-authority-config.d.ts.map +1 -0
  90. package/lib/rsi-authority-config.js +233 -0
  91. package/lib/rsi-authority-config.js.map +1 -0
  92. package/lib/rsi-authority-resources.d.ts +36 -0
  93. package/lib/rsi-authority-resources.d.ts.map +1 -0
  94. package/lib/rsi-authority-resources.js +139 -0
  95. package/lib/rsi-authority-resources.js.map +1 -0
  96. package/lib/rsi-authority-runtime.d.ts +51 -0
  97. package/lib/rsi-authority-runtime.d.ts.map +1 -0
  98. package/lib/rsi-authority-runtime.js +496 -0
  99. package/lib/rsi-authority-runtime.js.map +1 -0
  100. package/lib/rsi-bootstrap-manifest.d.ts +53 -0
  101. package/lib/rsi-bootstrap-manifest.d.ts.map +1 -0
  102. package/lib/rsi-bootstrap-manifest.js +507 -0
  103. package/lib/rsi-bootstrap-manifest.js.map +1 -0
  104. package/lib/rsi-bootstrap.d.ts +61 -0
  105. package/lib/rsi-bootstrap.d.ts.map +1 -0
  106. package/lib/rsi-bootstrap.js +597 -0
  107. package/lib/rsi-bootstrap.js.map +1 -0
  108. package/lib/rsi-build.d.ts +76 -0
  109. package/lib/rsi-build.d.ts.map +1 -0
  110. package/lib/rsi-build.js +210 -0
  111. package/lib/rsi-build.js.map +1 -0
  112. package/lib/rsi-host-authorities.d.ts +18 -0
  113. package/lib/rsi-host-authorities.d.ts.map +1 -0
  114. package/lib/rsi-host-authorities.js +129 -0
  115. package/lib/rsi-host-authorities.js.map +1 -0
  116. package/lib/rsi-host-update.d.ts +179 -0
  117. package/lib/rsi-host-update.d.ts.map +1 -0
  118. package/lib/rsi-host-update.js +568 -0
  119. package/lib/rsi-host-update.js.map +1 -0
  120. package/lib/rsi-install-inputs.d.ts +45 -0
  121. package/lib/rsi-install-inputs.d.ts.map +1 -0
  122. package/lib/rsi-install-inputs.js +345 -0
  123. package/lib/rsi-install-inputs.js.map +1 -0
  124. package/lib/rsi-install.d.ts +117 -0
  125. package/lib/rsi-install.d.ts.map +1 -0
  126. package/lib/rsi-install.js +791 -0
  127. package/lib/rsi-install.js.map +1 -0
  128. package/lib/rsi-linux-cgroup-roots.d.ts +3 -0
  129. package/lib/rsi-linux-cgroup-roots.d.ts.map +1 -0
  130. package/lib/rsi-linux-cgroup-roots.js +3 -0
  131. package/lib/rsi-linux-cgroup-roots.js.map +1 -0
  132. package/lib/rsi-linux-creation-build.d.ts +36 -0
  133. package/lib/rsi-linux-creation-build.d.ts.map +1 -0
  134. package/lib/rsi-linux-creation-build.js +213 -0
  135. package/lib/rsi-linux-creation-build.js.map +1 -0
  136. package/lib/rsi-linux-native-materialize.d.ts +31 -0
  137. package/lib/rsi-linux-native-materialize.d.ts.map +1 -0
  138. package/lib/rsi-linux-native-materialize.js +162 -0
  139. package/lib/rsi-linux-native-materialize.js.map +1 -0
  140. package/lib/rsi-linux-native-relocation.d.ts +124 -0
  141. package/lib/rsi-linux-native-relocation.d.ts.map +1 -0
  142. package/lib/rsi-linux-native-relocation.js +1571 -0
  143. package/lib/rsi-linux-native-relocation.js.map +1 -0
  144. package/lib/rsi-linux-native-resources.d.ts +97 -0
  145. package/lib/rsi-linux-native-resources.d.ts.map +1 -0
  146. package/lib/rsi-linux-native-resources.js +521 -0
  147. package/lib/rsi-linux-native-resources.js.map +1 -0
  148. package/lib/rsi-linux-repository-bootstrap.d.ts +17 -0
  149. package/lib/rsi-linux-repository-bootstrap.d.ts.map +1 -0
  150. package/lib/rsi-linux-repository-bootstrap.js +317 -0
  151. package/lib/rsi-linux-repository-bootstrap.js.map +1 -0
  152. package/lib/rsi-linux-runner-states.d.ts +20 -0
  153. package/lib/rsi-linux-runner-states.d.ts.map +1 -0
  154. package/lib/rsi-linux-runner-states.js +70 -0
  155. package/lib/rsi-linux-runner-states.js.map +1 -0
  156. package/lib/rsi-linux-runtime-bootstrap.d.ts +10 -0
  157. package/lib/rsi-linux-runtime-bootstrap.d.ts.map +1 -0
  158. package/lib/rsi-linux-runtime-bootstrap.js +38 -0
  159. package/lib/rsi-linux-runtime-bootstrap.js.map +1 -0
  160. package/lib/rsi-linux-source-build.d.ts +28 -0
  161. package/lib/rsi-linux-source-build.d.ts.map +1 -0
  162. package/lib/rsi-linux-source-build.js +43 -0
  163. package/lib/rsi-linux-source-build.js.map +1 -0
  164. package/lib/rsi-local-activation.d.ts +78 -0
  165. package/lib/rsi-local-activation.d.ts.map +1 -0
  166. package/lib/rsi-local-activation.js +486 -0
  167. package/lib/rsi-local-activation.js.map +1 -0
  168. package/lib/rsi-local-cohort.d.ts +70 -0
  169. package/lib/rsi-local-cohort.d.ts.map +1 -0
  170. package/lib/rsi-local-cohort.js +810 -0
  171. package/lib/rsi-local-cohort.js.map +1 -0
  172. package/lib/rsi-local-install.d.ts +70 -0
  173. package/lib/rsi-local-install.d.ts.map +1 -0
  174. package/lib/rsi-local-install.js +363 -0
  175. package/lib/rsi-local-install.js.map +1 -0
  176. package/lib/rsi-local-pair-install.d.ts +53 -0
  177. package/lib/rsi-local-pair-install.d.ts.map +1 -0
  178. package/lib/rsi-local-pair-install.js +215 -0
  179. package/lib/rsi-local-pair-install.js.map +1 -0
  180. package/lib/rsi-local-profile-update.d.ts +25 -0
  181. package/lib/rsi-local-profile-update.d.ts.map +1 -0
  182. package/lib/rsi-local-profile-update.js +226 -0
  183. package/lib/rsi-local-profile-update.js.map +1 -0
  184. package/lib/rsi-local-roots-extension.d.ts +11 -0
  185. package/lib/rsi-local-roots-extension.d.ts.map +1 -0
  186. package/lib/rsi-local-roots-extension.js +31 -0
  187. package/lib/rsi-local-roots-extension.js.map +1 -0
  188. package/lib/rsi-local-update-build.d.ts +37 -0
  189. package/lib/rsi-local-update-build.d.ts.map +1 -0
  190. package/lib/rsi-local-update-build.js +75 -0
  191. package/lib/rsi-local-update-build.js.map +1 -0
  192. package/lib/rsi-local-update.d.ts +39 -0
  193. package/lib/rsi-local-update.d.ts.map +1 -0
  194. package/lib/rsi-local-update.js +205 -0
  195. package/lib/rsi-local-update.js.map +1 -0
  196. package/lib/rsi-memory-learning.d.ts +36 -0
  197. package/lib/rsi-memory-learning.d.ts.map +1 -0
  198. package/lib/rsi-memory-learning.js +111 -0
  199. package/lib/rsi-memory-learning.js.map +1 -0
  200. package/lib/rsi-native-install.d.ts +38 -0
  201. package/lib/rsi-native-install.d.ts.map +1 -0
  202. package/lib/rsi-native-install.js +312 -0
  203. package/lib/rsi-native-install.js.map +1 -0
  204. package/lib/rsi-native-launchd.d.ts +7 -0
  205. package/lib/rsi-native-launchd.d.ts.map +1 -0
  206. package/lib/rsi-native-launchd.js +49 -0
  207. package/lib/rsi-native-launchd.js.map +1 -0
  208. package/lib/rsi-native-profile.d.ts +76 -0
  209. package/lib/rsi-native-profile.d.ts.map +1 -0
  210. package/lib/rsi-native-profile.js +530 -0
  211. package/lib/rsi-native-profile.js.map +1 -0
  212. package/lib/rsi-native-runtime-bootstrap.d.ts +44 -0
  213. package/lib/rsi-native-runtime-bootstrap.d.ts.map +1 -0
  214. package/lib/rsi-native-runtime-bootstrap.js +619 -0
  215. package/lib/rsi-native-runtime-bootstrap.js.map +1 -0
  216. package/lib/rsi-ordinary-use-learning.d.ts +60 -0
  217. package/lib/rsi-ordinary-use-learning.d.ts.map +1 -0
  218. package/lib/rsi-ordinary-use-learning.js +103 -0
  219. package/lib/rsi-ordinary-use-learning.js.map +1 -0
  220. package/lib/rsi-owner-profile.d.ts +37 -0
  221. package/lib/rsi-owner-profile.d.ts.map +1 -0
  222. package/lib/rsi-owner-profile.js +178 -0
  223. package/lib/rsi-owner-profile.js.map +1 -0
  224. package/lib/rsi-plugin-creation.d.ts +46 -0
  225. package/lib/rsi-plugin-creation.d.ts.map +1 -0
  226. package/lib/rsi-plugin-creation.js +227 -0
  227. package/lib/rsi-plugin-creation.js.map +1 -0
  228. package/lib/rsi-plugin-revision.d.ts +38 -0
  229. package/lib/rsi-plugin-revision.d.ts.map +1 -0
  230. package/lib/rsi-plugin-revision.js +221 -0
  231. package/lib/rsi-plugin-revision.js.map +1 -0
  232. package/lib/rsi-profile.d.ts +81 -0
  233. package/lib/rsi-profile.d.ts.map +1 -0
  234. package/lib/rsi-profile.js +551 -0
  235. package/lib/rsi-profile.js.map +1 -0
  236. package/lib/rsi-release-build.d.ts +59 -0
  237. package/lib/rsi-release-build.d.ts.map +1 -0
  238. package/lib/rsi-release-build.js +219 -0
  239. package/lib/rsi-release-build.js.map +1 -0
  240. package/lib/rsi-scanner-retirement-config.d.ts +34 -0
  241. package/lib/rsi-scanner-retirement-config.d.ts.map +1 -0
  242. package/lib/rsi-scanner-retirement-config.js +272 -0
  243. package/lib/rsi-scanner-retirement-config.js.map +1 -0
  244. package/lib/rsi-scanner-retirement-runtime.d.ts +23 -0
  245. package/lib/rsi-scanner-retirement-runtime.d.ts.map +1 -0
  246. package/lib/rsi-scanner-retirement-runtime.js +98 -0
  247. package/lib/rsi-scanner-retirement-runtime.js.map +1 -0
  248. package/lib/rsi-scanner-retirement-stage.d.ts +55 -0
  249. package/lib/rsi-scanner-retirement-stage.d.ts.map +1 -0
  250. package/lib/rsi-scanner-retirement-stage.js +181 -0
  251. package/lib/rsi-scanner-retirement-stage.js.map +1 -0
  252. package/lib/rsi-scanner-retirement-transition.d.ts +57 -0
  253. package/lib/rsi-scanner-retirement-transition.d.ts.map +1 -0
  254. package/lib/rsi-scanner-retirement-transition.js +330 -0
  255. package/lib/rsi-scanner-retirement-transition.js.map +1 -0
  256. package/lib/rsi-service-environment.d.ts +6 -0
  257. package/lib/rsi-service-environment.d.ts.map +1 -0
  258. package/lib/rsi-service-environment.js +113 -0
  259. package/lib/rsi-service-environment.js.map +1 -0
  260. package/lib/rsi-service-setup.d.ts +10 -0
  261. package/lib/rsi-service-setup.d.ts.map +1 -0
  262. package/lib/rsi-service-setup.js +34 -0
  263. package/lib/rsi-service-setup.js.map +1 -0
  264. package/lib/rsi-setup.d.ts +92 -0
  265. package/lib/rsi-setup.d.ts.map +1 -0
  266. package/lib/rsi-setup.js +908 -0
  267. package/lib/rsi-setup.js.map +1 -0
  268. package/lib/rsi-source-maintenance.d.ts +33 -0
  269. package/lib/rsi-source-maintenance.d.ts.map +1 -0
  270. package/lib/rsi-source-maintenance.js +407 -0
  271. package/lib/rsi-source-maintenance.js.map +1 -0
  272. package/lib/rsi-source-update.d.ts +26 -0
  273. package/lib/rsi-source-update.d.ts.map +1 -0
  274. package/lib/rsi-source-update.js +276 -0
  275. package/lib/rsi-source-update.js.map +1 -0
  276. package/lib/rsi-source.d.ts +34 -0
  277. package/lib/rsi-source.d.ts.map +1 -0
  278. package/lib/rsi-source.js +487 -0
  279. package/lib/rsi-source.js.map +1 -0
  280. package/lib/rsi-systemd-bootstrap.d.ts +46 -0
  281. package/lib/rsi-systemd-bootstrap.d.ts.map +1 -0
  282. package/lib/rsi-systemd-bootstrap.js +271 -0
  283. package/lib/rsi-systemd-bootstrap.js.map +1 -0
  284. package/lib/sdk.d.ts +216 -0
  285. package/lib/sdk.d.ts.map +1 -0
  286. package/lib/sdk.js +1990 -0
  287. package/lib/sdk.js.map +1 -0
  288. package/lib/service.d.ts +63 -0
  289. package/lib/service.d.ts.map +1 -0
  290. package/lib/service.js +599 -0
  291. package/lib/service.js.map +1 -0
  292. package/lib/setup-business.d.ts +49 -0
  293. package/lib/setup-business.d.ts.map +1 -0
  294. package/lib/setup-business.js +335 -0
  295. package/lib/setup-business.js.map +1 -0
  296. package/lib/setup-materialization.d.ts +15 -0
  297. package/lib/setup-materialization.d.ts.map +1 -0
  298. package/lib/setup-materialization.js +221 -0
  299. package/lib/setup-materialization.js.map +1 -0
  300. package/lib/setup-profile.d.ts +23 -0
  301. package/lib/setup-profile.d.ts.map +1 -0
  302. package/lib/setup-profile.js +1248 -0
  303. package/lib/setup-profile.js.map +1 -0
  304. package/lib/setup.d.ts +298 -0
  305. package/lib/setup.d.ts.map +1 -0
  306. package/lib/setup.js +3310 -0
  307. package/lib/setup.js.map +1 -0
  308. package/lib/supervised-growth-profile.d.ts +111 -0
  309. package/lib/supervised-growth-profile.d.ts.map +1 -0
  310. package/lib/supervised-growth-profile.js +903 -0
  311. package/lib/supervised-growth-profile.js.map +1 -0
  312. package/lib/supervised-growth-setup.d.ts +201 -0
  313. package/lib/supervised-growth-setup.d.ts.map +1 -0
  314. package/lib/supervised-growth-setup.js +1005 -0
  315. package/lib/supervised-growth-setup.js.map +1 -0
  316. package/lib/systemd.d.ts +70 -0
  317. package/lib/systemd.d.ts.map +1 -0
  318. package/lib/systemd.js +308 -0
  319. package/lib/systemd.js.map +1 -0
  320. package/lib/tool-approval.d.ts +22 -0
  321. package/lib/tool-approval.d.ts.map +1 -0
  322. package/lib/tool-approval.js +107 -0
  323. package/lib/tool-approval.js.map +1 -0
  324. package/lib/types.d.ts +351 -0
  325. package/lib/types.d.ts.map +1 -0
  326. package/lib/types.js +11 -0
  327. package/lib/types.js.map +1 -0
  328. package/lib/user-question.d.ts +31 -0
  329. package/lib/user-question.d.ts.map +1 -0
  330. package/lib/user-question.js +161 -0
  331. package/lib/user-question.js.map +1 -0
  332. package/lib/version.d.ts +2 -0
  333. package/lib/version.d.ts.map +1 -0
  334. package/lib/version.js +2 -0
  335. package/lib/version.js.map +1 -0
  336. package/lib/windows-task.d.ts +42 -0
  337. package/lib/windows-task.d.ts.map +1 -0
  338. package/lib/windows-task.js +143 -0
  339. package/lib/windows-task.js.map +1 -0
  340. package/lib/ws-card-callback.d.ts +7 -0
  341. package/lib/ws-card-callback.d.ts.map +1 -0
  342. package/lib/ws-card-callback.js +51 -0
  343. package/lib/ws-card-callback.js.map +1 -0
  344. package/package.json +162 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-ray contributors
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.
package/README.md CHANGED
@@ -1,3 +1,208 @@
1
1
  # @dsh-ray/lark-channel
2
2
 
3
- Seed placeholder for OIDC Trusted Publishing setup.
3
+ 飞书/Lark 的薄协议适配器:把 WebSocket 长连接消息写入 `assistant-delivery` 的 typed Inbox,并把已经落盘的 Outbox intent 转成飞书发送或回复 API。本包不拥有配对、会话、重试或授权真源。
4
+
5
+ Delivery 的 typed presentation 还可把审批实际生效终态,以及拥有稳定 owner route 的 Host
6
+ Automation incident `open / recovering / resolved` 原位渲染到同一条飞书卡片。本包只渲染 Delivery
7
+ 已经持久化、授权并取得 provider message id 的 projection,不能创建领域终态、伪造 `applied` 或 incident
8
+ revision,也不能绕过 Delivery/Policy。Agent Automation 只持有 exact conversation binding,因此每个持久
9
+ revision 投递一条内容无关的状态更新;两种路径的重试、fence 与 generation 都由 Automations/Delivery
10
+ 账本负责。
11
+
12
+ 插件默认 `enabled: false`,安装后不会立即读取凭据或联网。启用后,合法新消息落盘时可添加 `Get`,最终答复发送成功后可添加 `DONE`;reaction 与原生执行进度都是 best-effort 展示,最终答复仍由 Delivery Outbox 保证。
13
+
14
+ 模型回答被输出上限截断、返回空正文或超过 Delivery 的 `maxTextBytes` 时,Delivery 默认会在后台自动续写、重新生成或压缩,并在恢复完成后只向飞书发送一条完整答复;正常情况不需要用户再回复“继续”。模型恢复次数耗尽或安全调度边界不可用时才展示明确的未完成提示,也不再要求用户发送“继续”这类协议词;持久化无法确认时则不投递结果,任何情况都不会把半句标成“任务已完成”。Delivery 与本插件的 `maxTextBytes` 默认都为 `65536`,手工覆盖时应保持一致。
15
+
16
+ 默认进度策略为 `progressDetails: direct`:经 Delivery 授权的私聊可显示限长、常见凭据已脱敏的工具参数和结果;默认向导只授权 owner。群聊只显示工具名、状态、步骤与待办。`progressDetails: off` 可在所有会话隐藏参数和结果。任何 reasoning/thinking 内容都不外发;飞书 `message_cot` 不可用时只降级展示,不影响任务或最终回复。后台进度(如原生 Goal 续跑轮次)默认不展示、也不新开进度消息,`showBackgroundProgress: true` 才追加到当前前台进度;终态始终关闭前台进度。
17
+
18
+ 已创建的进度消息句柄由 Delivery 私有 SQLite 账本保存;终态在飞书更新前落盘。连接重建或进程重启后,只有原 Inbox 已确认结束、原绑定代次与应用凭证仍一致时才更新同一条进度消息;活动任务不会被误关。终态更新失败按间隔重试,最多八次,不会因此重新运行任务或再建进度消息。创建请求的网络结果未知时保留无句柄状态,不盲目重建;升级前没有保存句柄的历史气泡无法原位恢复。账本只保存句柄、绑定与目标摘要、终态及重试状态,不保存工具参数或思考正文。
19
+
20
+ ## 文档
21
+
22
+ - [安装、凭据与常驻服务](docs/setup.md)
23
+ - [会话命令、卡片、可靠性与排障](docs/operations.md)
24
+ - [分级自治成长激活器](docs/supervised-growth.md)
25
+ - [日常使用自迭代的双 Host 配置](docs/rsi-setup.md)
26
+ - [进度展示、安全与权限边界](docs/progress-security.md)
27
+
28
+ Linux `supervised` 新安装在模型、TraeX、飞书配置与 doctor 后自动取得当前 owner、生成有限授权与 manifest,并部署目标和独立协调器两个 systemd Host。新 owner 安装接通有界新工具创建、任务派生独立验收与动态采用;旧安装重试保留原授权,不自动增加创建通道。未就绪会以非零状态停止安装完成提示;重试不续期授权。全新 `--install-owner` 可显式传入 `--enable-ordinary-use-learning`:从 Delivery `agentProvider`/`agentModel` 或显式 `--intake-provider`/`--intake-model` 生成单规则、ceiling 为 `digest` 的只观察 intake evaluator,打开 WorkItems `intakeLedger.evaluation.enabled`,并在 learning、review、adoption 三份记忆授权上一致开启 `workItemExperiences`;重试保留原 opt-in,拒绝扩展已有安装。全新 `--install-owner` 亦可显式传 `--skip-memory-learning`(仅 Linux supervised;与 `--enable-ordinary-use-learning` 互斥):不生成普通使用/记忆学习授权,也不写 learner、personal-memory 或 verifier 的学习配置,重试保持该决定且不会把 skip 变成 authorize。macOS 原生 owner 部署必须 authorize(原生记忆学习链是必填),跳过会被拒绝。非 LLM 的 agentProvider(如 `traex-agent`)不能用于该 evaluator,需另给 LLM route。当前尚未完成真实普通任务驱动的修复、采用和观察验收,见上述配置指南。
29
+
30
+ Linux 成对升级会在候选 Host 首次启动前,核验旧 manifest 的冻结 owner 来源及 Delivery 撤权记录,并通过原 Policy/Automations 服务停用对应的四类旧扫描。维护只写已停服的私有 Home 副本,使用固定操作标识和原预算账户,保留任务历史与 unknown;来源读取与维护子进程都有有限期限。升级事务保存原配置、身份、数据库及完整迁移证据;切换后不能自动退回会复活旧扫描的状态,成功清理将证据整体保留在事务同级的 `.completed-<事务 ID>` 目录。此路径只处理旧扫描退出,不签发新 owner 授权,也不把旧授权转给其他身份。安装器依赖可信的已安装代码及完整依赖集合;来源摘要不是对任意 JavaScript 依赖的安全证明。
31
+
32
+ ## 兼容性
33
+
34
+ - DeepSeek Harness / Cordis / Node.js 基线见仓库[兼容性说明](../../docs/compatibility.md)(通过 `assistant-delivery` 消费当前基线语义)。
35
+ - `@dsh-ray/assistant-delivery`:同批发布版本;本包的 supervised setup 使用当前发布切片的私有 capability。
36
+ - `@deepseek-ai/dsh-user-questions`:由 DSH 定义 Agent-scoped `user-questions/request` answerer waterfall。Web Host 通过 Remote Events 提供 scoped answerer;飞书通道要承接 `ask_user_question` 时也必须直接注册同一 scope 的 answerer。
37
+ - `@dsh-ray/credentials-keychain`:handle 模式使用同批发布版本;env fallback 不要求其激活。
38
+ - 普通个人助理场景同时安装 `@dsh-ray/preference-learning`。向导会只为完成 owner 对话产生有界偏好证据及读取 active snapshot 的两项能力;它们不依赖广义 Agent 工具开关,也不要求 Health/Heartbeat/Recovery。
39
+ - 分级自治成长激活器要求有效 profile 同时启用 `@dsh-ray/personal-assistant`、`@dsh-ray/assistant-automations`、`@dsh-ray/assistant-heartbeat`、`@dsh-ray/assistant-evaluation`、`@dsh-ray/preference-learning`、`@dsh-ray/assistant-evolution`、`@dsh-ray/assistant-growth-experiments`、`@dsh-ray/assistant-health` 与 `@dsh-ray/assistant-recovery`。Policy、Memory 与 Wiki 由 personal-assistant 这一 profile row 提供。Recovery 仍是无模型 Host runbook;独立的 `supervised-growth-analyst` 每天最多一次,只能 review/propose adoption,preview 强制 paused,active 前逐项证明定义和私有 scratch,且只有审批路由、没有普通结果投递。workflow lane 使用 Delivery 私有、可撤销的 content-free trace sink,以及独立预算、owner-bound approval、prefix-bounded dynamic Automation identity 和 exact binding delivery;Lark 文本、卡片或回调本身不能制造 trace 或 learned workflow。默认不授予 learned workflow 任意工具。旧 `supervised-growth` Heartbeat 只在升级时被安全暂停。
40
+ - 官方 `@larksuiteoapi/node-sdk`:固定 `1.76.0`。该版在握手超时和关闭 socket 时保留错误监听,避免异步错误终止 Host;`type=card` 回调仍由本包的 CardKit 桥处理。
41
+
42
+ ## 安装
43
+
44
+ 先配置 `@dsh-ray/assistant-policy`、`@dsh-ray/assistant-delivery` 与 `@dsh-ray/preference-learning`,再安装本包:
45
+
46
+ ```sh
47
+ dsh plugin --profile web add @dsh-ray/lark-channel
48
+ dsh --profile web --dump-config
49
+ ```
50
+
51
+ 推荐使用跨平台向导完成飞书应用授权、凭据保存、owner 绑定、owner 工具策略 和用户级常驻服务:
52
+
53
+ ```sh
54
+ ~/.dsh/profiles/web/node_modules/.bin/dsh-lark-setup \
55
+ --profile web \
56
+ --create-app
57
+ ```
58
+
59
+ 源码工作区也可运行:
60
+
61
+ ```sh
62
+ pnpm --filter @dsh-ray/lark-channel build
63
+ pnpm --filter @dsh-ray/lark-channel run onboard --profile web --create-app
64
+ ```
65
+
66
+ 向导不会把 App Secret 放进 argv、profile 或日志。macOS 使用 Keychain,Linux 优先 Secret Service、无桌面环境降级为严格权限的 protected-file,Windows 使用 best-effort DPAPI。完整流程、已有应用接入和平台排障见[安装文档](docs/setup.md)。
67
+
68
+ 向导默认还安装或复用官方 `lark-cli`,使用同一应用为绑定的 owner 申请 `--domain all` 用户授权,并生成原生 DSH 业务技能。Agent 按需读取 CLI 内嵌的最新技能说明,通过原生工具操作文档、表格、日历、任务、邮件等;已授权任务无需反复批准。重复安装验证并复用有效用户授权;明确的部分授权也可接入已获批能力,同时显示未获批权限。有完整授权结果的中断收尾可恢复,不把普通错误当作授权成功。只需消息通道时,可用 `--no-business-tools` 跳过该步骤。
69
+
70
+ 业务 CLI 使用 DSH 专用配置目录、显式 profile 和净化后的环境;Linux 另用专用数据目录保存 CLI 加密凭据,macOS/Windows 的系统钥匙环仍可能按应用/用户共享凭据。自动安装只下载并校验官方 npm 包与匹配的 GitHub release(失败时尝试官方安装器镜像,使用相同校验值),不运行 npm lifecycle 或全局安装脚本。此安装步骤需要网络和子进程权限,生成的技能位于 `$DSH_HOME/skills`;具体平台权限仍以飞书实际批准结果为准。
71
+
72
+ ## 最小配置
73
+
74
+ 不使用向导时,可在 profile patch 中配置:
75
+
76
+ ```yaml
77
+ config:
78
+ enabled: true
79
+ account: personal-bot
80
+ tenant: personal
81
+ appId: cli_0123456789abcdef
82
+ credentialHandle: lark-app-secret
83
+ credentialPurpose: connect
84
+ credentialLeaseMs: 86400000
85
+ # Calendar API stays unavailable unless every ID is explicitly listed.
86
+ allowedCalendarIds: []
87
+ domain: feishu
88
+ requireMentionInGroups: true
89
+ # Opt-in: topic-group thread_id is the conversation lane; replies stay in that topic.
90
+ groupTopicThreads: false
91
+ showProgress: true
92
+ progressDetails: direct
93
+ showBackgroundProgress: false
94
+ statusReactions: true
95
+ imageDownloadTimeoutMs: 30000
96
+ userQuestionTtlMs: 86400000
97
+ ```
98
+
99
+ `requireMentionInGroups` 控制群内是否必须直接 @ 机器人。`groupTopicThreads`(默认关)开启后,飞书话题群消息以 `thread_id` + 发送者 principal 作为会话 lane:首条消息与其后续回复落在同一 Delivery conversation,回复通过 `reply_in_thread` 留在同一话题,而不是新开顶层消息;principal 参与 key,owner 与 allowlisted peer bot 在同一话题不会互相占用 binding。限制:没有 `replyToEventId` 的后台通知(例如 WorkItem 报告)仍按顶层发送,会新建一个话题;owner/工作项回复携带 `replyToEventId`,不受影响。关闭时保持按发送者合成的顶层 lane。peer bot 的精确白名单、open_id 取得方法与真实渠道验收见 [peer agent 真实渠道验收与白名单配置](../../docs/peer-agent-verification.md)。
100
+
101
+ `credentialHandle` 应由 `@dsh-ray/credentials-keychain` 提供,并只允许 consumer `dsh-ray-lark-channel`、purpose `connect`。兼容部署可改用 `appSecretEnv`,两者只能选一个;配置不接受 `appSecret` 等明文字段。
102
+
103
+ Calendar v4 读取默认关闭;每页响应上限为 1 MiB,超限请求失败且不推进事件游标。只有同时满足以下条件时,连接器才会读取一个页面:该 ID 位于 `allowedCalendarIds`、应用已被授予并发布 `calendar:calendar:readonly`、调用方已通过自身的 owner/Policy 授权。`event-triggers` 使用此窄桥观察一个预先选定的日历;它不能列出日历,不能取得 app secret 或 tenant token,也不能凭 `credentialPurpose: connect` 自动取得 Calendar 范围。使用官方向导更新应用范围时运行 `dsh-lark-setup --create-app --calendar-readonly`,然后由操作员把实际授权的 exact Calendar ID 填入 `allowedCalendarIds`。
104
+
105
+ `userQuestionTtlMs` 默认 24 小时,范围为 1 分钟至 7 天;它限制当前进程内等待飞书回答的时长。过期、取消、Host 已在其他端结算或 adapter 注销都会撤销这次即时等待,不会把后到消息变成新的问题回答;短暂 WebSocket 重连不会主动丢弃仍有效的卡片。
106
+
107
+ 飞书应用至少需要机器人身份读取、单聊/群内 @ 消息接收、机器人发消息、`im.message.receive_v1`;`Get`/`DONE` 需要 `im:message.reactions:write_only`,图片读取与超长文本附件上传需要 `im:resource`,审批、模型选择和用户问题卡片需要 `card.action.trigger`。事件与回调使用 WebSocket 长连接,不需要公网 callback URL。
108
+
109
+ ## `ask_user_question` 交互
110
+
111
+ `ask_user_question` 由 Host 的 `ctx.userQuestions.ask()` 在 exact live root Agent scope 派发。飞书兼容层必须直接为这个 scope 注册 answerer,只接受仍属于 exact active owner binding、且 adapter 仍具备问题交互能力的请求,再把问题送到原飞书会话;按钮或自由输入的答案直接作为 waterfall 结果返回。Web Remote Events answerer 与飞书 answerer 是同一 scoped waterfall 的组合参与者,按 composition 顺序串联;迟到、撤销和重复交互仍必须由各 answerer 自己拒绝,且不得制造新的 Agent turn。
112
+
113
+ 飞书使用不可转发的 CardKit 2.0 卡片呈现选项。推荐项只显示“推荐”标识,不会自动选择;多选必须点击“提交已选答案”;无选项或需要输入其他答案时会明确要求回复对应问题卡片。未引用卡片的新文字始终作为普通消息处理,即使原会话只有这一条 pending question 也不会被当成答案吞掉。按钮和卡片回调使用签名 capability,且回调或自由文本都必须匹配 exact owner、account/tenant/chat、原会话路由、当前 binding version/generation 与请求 fence。群聊中的普通文字命令仍遵循 @ 机器人门槛,不想输入答案时可直接点击卡片“取消”。问题会发送到原 binding 会话而非强制转为私聊,因此在群聊中问题正文、详情和选项对群成员可见;不要把秘密、凭据或只应由私聊接收的内容放进问题。
114
+
115
+ ## 整体目标结果反馈
116
+
117
+ 外部 event-wait scheduled whole-goal 结果(当前 producer 为 `goal-event-wake-*`;普通 `goal_schedule` 不外发结果)沿用普通 Markdown Outbox 和现有飞书 reply identity;本 adapter 无需新增目标专用卡片、callback 或信任逻辑。结果正文由 Delivery 附加固定反馈说明,owner 必须直接回复那一条已发送消息,再使用 `/feedback status`、`correct` 或 `withdraw`。首次 `status` 已显示 Verifier baseline 的 revision 1;裸 `achieved|partial|not-achieved` 只有与 baseline 相同才幂等,不同判断必须按当前 version/status 使用 `correct`。Lark 只把 `replyToProviderMessageId` 连同 actor/conversation 写入 typed Inbox;Delivery、Goals、Verifier 与 Evaluation 负责核对 schema 20 sidecar、当前 owner/route/binding 和 exact assessment proof。复制正文、回复其它消息、错人或 `/new` 后失效 binding 都不能修订目标。
118
+
119
+ 已发送的历史结果即使原 Verifier freshness 到期仍可由同一 owner 纠正,但不可变 Goal/assessment/receipt identity 仍须由当前 Goals 与 Verifier 重验。发送前过期则失败关闭且不会调用飞书。当前测试是本地 transport/Host fixture,不是一次真实飞书云端、真实模型或生产 cohort 验收。Web `native-session` 没有飞书 provider reply identity,不属于本路径。
120
+
121
+ ## 常用命令
122
+
123
+ 在飞书会话中使用:
124
+
125
+ ```text
126
+ /status # 当前 session 代次与上下文统计;/session 同义
127
+ /stop # 停止当前任务,保留 session
128
+ /new # 停止旧任务并切换到空白 session;/clear 同义
129
+ /compact # 宿主支持时压缩当前上下文
130
+ /version # 查看助手、Host、插件版本与自迭代演进统计;/autonomy version 同义(也支持“查看版本”“自己迭代了多少次?”)
131
+ /autonomy enable # active owner 开启整体助手自迭代能力
132
+ /autonomy disable # active owner 关闭整体助手自迭代能力
133
+ /autonomy upgrade # active owner 升级整体助手并恢复
134
+ /model # 打开 provider/model/effort 选择卡片
135
+ /model use <route> # 文字方式切换模型
136
+ /model reset # 恢复部署默认模型
137
+ /permissions # 查看并选择权限档位
138
+ /permission ask
139
+ /permission auto
140
+ /permission full confirm
141
+ /feedback # 查看固定偏好反馈语法
142
+ /learning status # 查看偏好学习状态
143
+ /learning explain # 查看无历史正文的 key/value、版本与证据计数
144
+ /learning export # 导出无正文、无内部标识的稳定 T1 JSON
145
+ /learning pause # 暂停收集、激活与注入
146
+ /learning resume # 恢复,仅接收此后的新证据
147
+ /learning rollback response.language confirm # 撤回当前 lineage 的一个 exact active T1 key
148
+ /learning forget confirm # 物理删除当前 scope 的学习记录
149
+ ```
150
+
151
+ 未知 slash 命令不会进入模型。模型卡片、权限卡片和会话 lane 语义见[操作文档](docs/operations.md)。
152
+
153
+ 运维常用:
154
+
155
+ ```sh
156
+ # 重新安装或重启用户级常驻服务
157
+ dsh-lark-setup --profile web --install-service
158
+
159
+ # 刷新 setup 托管的 Agent Policy,不重走 onboarding
160
+ dsh-lark-setup --profile web --refresh-agent-policy --allow-agent-tools
161
+ ```
162
+
163
+ ## 权限与数据边界
164
+
165
+ - 首次绑定 owner 默认为本地 `foreground` 与精确 owner Delivery 主体建立已安装 capability/工具可达性,配合默认 Full access 无需逐工具确认。重复配置保留现有规则;可显式 `--allow-agent-tools` 开启、`--disable-agent-tools` 关闭向导规则,或 `--preserve-agent-tools` 连首次配置也保留现状;不授权 `background`,也不绕过显式 deny、紧急停止、身份、预算及插件业务硬门。
166
+ - `ask` 和 `auto` 中真正需要人工确认的工具调用只向 active owner 私聊发送一次性 CardKit 2.0 审批卡;卡片包含“允许一次 / 拒绝”按钮。若租户拒绝该卡片格式,只对 `format_error` 降级成同一私聊的明确文字审批;恰好一个匹配请求时,owner 回复“允许”“允许一次”或“拒绝”可恢复原调用。多请求并存不猜测,网络/连接失败也不自动放行。允许或拒绝后,原卡片立即显示终态并移除按钮;允许只表示本次授权已生效,执行结果由后续任务消息提供。取消、超时或连接结束也尝试替换原卡,更新失败不改变审批结果。异步终态更新最多等待 30 秒,关闭时最多等待 1 秒后取消。`full` 关闭逐次审批并放开 sandbox,应保持 owner 与应用可用范围最小。
167
+ - `ask_user_question` 的卡片是另一条即时交互路径:本包有向原飞书会话发送/原位更新 CardKit 2.0 卡片、并接收 `card.action.trigger` callback 的网络权限。选项仅以签名 callback capability 提交;自由文本只接受 exact owner 对原卡的明确回复。它不把卡片点击或匹配回复写成普通 Inbox/新 turn,且问题内容会在原会话显示,群聊并不保密。
168
+ - 记忆、Wiki 和行为学习提案使用 Card 2.0 审批按钮,签名绑定会话、提案版本与有效期;回调操作人另按 owner 授权校验。行为学习卡会把 scope、情境、guidance、版本、证据和回滚原因逐字段以纯文本展示;提案内容不会作为 Markdown 或卡片组件解释。点击后卡片只确认 Policy 决策已写入持久账本,明确不把“批准”误报成“变更已生效”。投递失败且已经过期的提案需要重新提交,升级不会自动批准或补发旧卡。
169
+ - 消息通道运行时网络仅访问所选飞书/Lark OpenAPI、token 与 WebSocket endpoint;图片读取使用固定消息资源端点,不接受消息或模型提供的 URL,并关闭重定向。
170
+ - 安装阶段的 `dsh-ray-setup --prepare-source` 执行 Git,在 `$DSH_HOME/rsi-sources/<profile>` 写入私有源码与 bare 发布仓库;npm 来源访问固定官方 GitHub 仓库的精确版本 tag,本地来源只复制已提交内容。支持常用代理与 CA 环境变量,不执行安装脚本;此命令不使用飞书凭据或浏览器,详见 [RSI 配置](docs/rsi-setup.md)。
171
+ - `dsh-ray-setup --prepare-local-update` 在 Home 外准备本地上游与现有修复分支合并后的源码和 tarball。Linux 准备摘要固定的原生运行时(schema 3)及离线 bubblewrap 构建,全程不接触 Docker;已移除 `--docker-path` 与旧镜像构建器,历史 Docker 收据仅只读解码用于迁移,两类收据互斥不续跑。它可联网下载固定 Node/pnpm 与冻结依赖,但候选 build/pack 不带网络、凭据或原 Home;不会停服或激活更新,原生候选的停机激活迁移随原生安装事务交付。pre-owner 安装可使用 checkout 维护事务,已有 owner 的完整迁移仍未交付,详见 [RSI 配置](docs/rsi-setup.md)。
172
+ - checkout 的 `local-service-upgrade` 在停服前以无 registry 凭据的私有配置准备旧图和最终候选图,重新校验候选锁与策略,并在空 node_modules 的临时 Home 中实际断网调用原生 DSH 安装。首次服务操作前重核外部候选、原 Home 与缓存;停服后的正式副本继续核对同一依赖图、包清单和配置,失败保留证据。pre-owner 的 Docker→native 和 native→native 可迁移基础 runtime、release 资源及 cohort;正式阶段绑定实际目录身份,恢复拒绝复制产生的新 inode。事务会写入独立缓存及 Home 副本、切换 systemd 服务;它不启用 owner scheduler 或扩大授权,完整活服务升级仍未验收。用法与恢复见[安装器指南](../../scripts/install/README.md#checkout-内的-pre-owner-冻结源码维护)。
173
+ - macOS 安装使用系统 Perl 的内核 `flock` 串行化同一用户、同名 profile 的 LaunchAgent 操作,使用 `plutil`/`launchctl` 核对服务归属并管理当前用户服务;运行检查核对状态与 PID。同名目标属于另一 DSH_HOME 时拒绝修改,替换失败时尝试恢复旧定义与注册状态。原生学习另串行化 Home 配置,写入私有计划、有限授权、恢复日志和 HMAC observer 密钥。新安装从冻结源码清单和锁文件准备私有 Node、pnpm 及依赖,候选构建和行为检查使用本机 Seatbelt;Host 也是原生 Node。支持范围与失败恢复见[原生 macOS 学习](docs/rsi-setup.md#原生-macos-学习)。
174
+ - Linux 安装的 `--prepare-build` 还自动准备私有授权运行时和本地发布资源,也可单独执行 `--prepare-authorities`:从同版本已安装 Control Plane 复制官方程序及模块、固定独立 Node,运行副本做版本/模块检查,并生成 14 个独立 Ed25519 身份和本地 registry/catalog。共享契约从 Control Plane 声明的依赖解析,接受包内依赖边、同一 pnpm 虚拟包目录内的相邻依赖边,以及安装器生成的受管 profile 内经 profile 清单、pnpm 工作区、安装元数据和两份锁文件共同核验的 hoisted 直接依赖边;普通扁平项目或任意祖先目录的同名包不能替代它。核验材料在复制前后保持一致,目录和密钥仅当前用户可读写;重复执行核验固定内容并保留发布/状态进展。此步骤需要文件写入与子进程权限,不需要网络、浏览器或飞书凭据,不执行 npm lifecycle,不签发 owner grant 或启动 Host。
175
+ - Linux 的 `dsh-ray-setup --prepare-build` 准备摘要固定的原生运行时:从 nodejs.org 与 npm registry 下载官方 Node v22.23.2、pnpm 11.7.0,经 bubblewrap 私有命名空间与无凭据环境先 `pnpm fetch` 再离线 `--frozen-lockfile --ignore-scripts` 安装,保存 schema 3 sourceBuild(运行时全树摘要)与 schema 2 `releaseBuild`(工具链/store/cache 三树副本加 `runtimeDigest`),全程不调用 Docker CLI、daemon、socket 或镜像。环境前置(Linux x64/arm64、bwrap/unshare/mount 等)缺失时经 `--optional-build` 报告 `buildUnavailable`/`releaseBuildUnavailable` 并保留源码与已验证运行时;完整性错误始终致命。旧 Docker 镜像构建路径已下线,`--docker-path` 不再是 CLI 选项;历史 Docker 收据只用于只读迁移解码,不能被续跑。随后候选检查使用离线完整仓库 sandbox;安装期间不会读取主机 Docker registry 凭据或启动候选 Host。Mac 则准备受摘要固定的私有 Node、pnpm 与冻结清单依赖,并在候选期用 Seatbelt 离线执行。当前 runtime 支持与资源上限见 [RSI 配置](docs/rsi-setup.md)。
176
+ - Linux 新 `--install-owner` 使用原生完整仓库边界:基础运行时导出发布工具链,repository schema 4 固定双 UID、系统工具快照与已委派 cgroup v1 四控制器或统一 cgroup v2 子树,独立行为运行时支持工具创建、修订、配对回归及有限采用。准备阶段使用固定归档和冻结依赖;候选不读取 owner 凭据、浏览器、验收答案或网络。首次授权前创建五个空 runner 账本,在独立 seal 文件中固定目录/数据库身份,并把引用纳入原授权摘要;读取、安装重试和直接重启都不能补造丢失账本。旧 Docker 安装不再可续跑:安装器会 fail-closed 拒绝,需显式迁移,且不重建资源、不续期或新增创建/修订授权。
177
+ - `requestTimeoutMs`(默认 30 秒)为常规 OpenAPI 请求设置硬 deadline,`imageDownloadTimeoutMs` 独立限制图片下载。SDK 会把可下传的 AbortSignal 交给底层 HTTP;若调用已经被服务端接收后超时,最终消息保留 Delivery 的 `unknown_after_send` 语义,绝不自动重发或假称未发送。
178
+ - App Secret 不写 Delivery 数据库、工具参数、health、route、日志或异常;Linux protected-file 没有额外静态加密,同 UID、root 和可读备份仍能取得内容。
179
+ - Delivery SQLite 保存标准化文本、路由 id 和最多 10 个受限附件描述符;不保存 raw 事件、token 或下载 URL。图片字节只交给 AttachmentStore。
180
+ - 私聊详细进度只使用 Delivery 生成的限长、常见凭据脱敏 preview;它不是秘密扫描器。群聊始终不发送参数或结果,reasoning/thinking 内容在任何会话都不外发。
181
+ - 群消息默认必须直接提及机器人;`@all` 不等于提及。最终授权始终由 Delivery/Policy 决定。
182
+ - 若 Delivery 提供 `observe`(WorkItems `intakeLedger.enabled` 时才有 observer),每条规范化、未过期、非问题/审批答复的消息(含因未 @ 而丢弃的群消息)额外上报一次元数据观察:事件 ID、时间、发送者、会话、是否寄址(私聊/@机器人/命令)、回复目标和正文 SHA-256,不含正文;观察失败不影响接收。`senderIsBot` 取飞书事件 `sender.sender_type`(`app` 为 true),旧 transport 不提供时按 false;它只是观察标签,是否接受仍由 Delivery/Policy 决定。
183
+
184
+ 完整的文件系统、子进程、浏览器、审批签名和 Policy 说明见[进度与安全文档](docs/progress-security.md)。
185
+
186
+ ## 当前限制
187
+
188
+ - Linux 原生准备已接入 `--prepare-build`、本地更新候选构建和全新 `--install-owner` 配置事务。已有 Docker owner 的程序升级支持空业务历史路径,并已在代码层接入非空采用封存(`creation-adoptions.sealed/<digest>.sqlite`)与审查库 v2 grant handoff(详见[维护说明](../../scripts/install/maintenance.md#现有-linux-冻结-owner-程序升级));配置启用但库缺失、sidecar 异常、native→native 或授权不匹配会拒绝,不删库、不刷新额度和期限。完整临时 Home 升级、非空历史迁移、双服务就绪及回滚仍待实机验收,现有生产 Home 尚未迁移。旧 Docker 安装不能以重复安装续跑;迁移须显式进行,且不会借此扩大授权。实施边界见[原生运行时](../../docs/dockerless-runtime.md)。
189
+
190
+ - v0.1 支持文本、受限图片描述符、文本/Markdown-card 出站、WP19 `plain` 超长通知的 UTF-8 `text/plain` / `text/markdown` 附件上传与摘要并发(`capabilities.textAttachments: true`)、durable proposal、owner-DM 一次性工具审批、模型/权限卡片、reaction 和原生进度;模型不能提交任意 card JSON 或任意上传文件路径,也不能直接控制 reaction 或进度载荷。出站文本附件在发送前强校验 SHA-256 摘要及 `maxTextBytes` / 1 MiB 上限,经 `/open-apis/im/v1/files` 上传后再发送 `msg_type: 'file'` 消息和行内摘要;任一步失败均按可重试/不可重试语义 fail closed,绝不会只发截断摘要而丢弃附件。
191
+ - 入站只有图片资源具备受限下载能力,且依赖 AttachmentStore 与模型图片能力;入站文件、音频、视频和 sticker 只进入 metadata quarantine。没有病毒扫描、任意入站文件下载、任意二进制上传或消息编辑(仅 CardKit 卡片支持通过 `updatePresentation` 原位替换)。
192
+ - 单应用长连接是集群竞争消费,不提供广播、多节点 exactly-once 或断线历史补拉;目标部署是受 supervisor 管理的单机进程。
193
+ - setup wizard 正式支持 macOS 与 Linux;Windows 为 best-effort。企业管理员审批和应用可用范围仍由飞书控制。
194
+ - `message_cot` 与 reaction 都可能因租户、应用类型或接口能力而降级;它们失败不会重跑任务,也不会阻断最终回复。
195
+
196
+ 更细的传输可靠性和故障处理见[操作文档](docs/operations.md)。
197
+
198
+ ## License
199
+
200
+ MIT
201
+
202
+ The Linux RSI bootstrap and cgroup modules are compatibility adapters over the
203
+ non-activating `@dsh-ray/assistant-isolation/native-resources` subentry.
204
+ RSI still verifies its own source-workspace receipt before/after shared preparation
205
+ and re-reads the fixed Git manifest objects. Its public exports, schema-3 runtime
206
+ receipt layout and private runtime cache paths remain compatible. Ordinary native
207
+ resource callers do not need an RSI workspace or repairs repository. Cgroup
208
+ discovery stays independent of base preparation and never creates delegation.
@@ -0,0 +1,37 @@
1
+ #!/usr/bin/env node
2
+
3
+ const sqliteWarningFiltered = Symbol.for('dsh-ray.sqlite-warning-filtered')
4
+ if (!Reflect.get(process.emitWarning, sqliteWarningFiltered)) {
5
+ const originalEmitWarning = process.emitWarning
6
+ const filteredEmitWarning = function emitWarning(warning, ...rest) {
7
+ const first = rest[0]
8
+ let warningType
9
+ if (typeof warning === 'object' && warning !== null && typeof warning.name === 'string') {
10
+ warningType = warning.name
11
+ } else if (typeof first === 'string') {
12
+ warningType = first
13
+ } else if (first !== null && typeof first === 'object' && typeof first.type === 'string') {
14
+ warningType = first.type
15
+ }
16
+ const warningMessage = typeof warning === 'object' && warning !== null && typeof warning.message === 'string'
17
+ ? warning.message
18
+ : String(warning ?? '')
19
+ if (warningType === 'ExperimentalWarning' && warningMessage.includes('SQLite is an experimental feature')) {
20
+ return
21
+ }
22
+ return Reflect.apply(originalEmitWarning, this ?? process, [warning, ...rest])
23
+ }
24
+ Reflect.set(filteredEmitWarning, sqliteWarningFiltered, true)
25
+ process.emitWarning = filteredEmitWarning
26
+ }
27
+
28
+ let formatError
29
+ try {
30
+ const { formatLarkSetupError, runLarkSetup } = await import('../lib/setup.js')
31
+ formatError = formatLarkSetupError
32
+ await runLarkSetup()
33
+ } catch (error) {
34
+ const message = formatError ? formatError(error) : (error instanceof Error ? error.message : String(error))
35
+ process.stderr.write(`${message}\n`)
36
+ process.exitCode = 1
37
+ }
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+
3
+ const sqliteWarningFiltered = Symbol.for('dsh-ray.sqlite-warning-filtered')
4
+ if (!Reflect.get(process.emitWarning, sqliteWarningFiltered)) {
5
+ const originalEmitWarning = process.emitWarning
6
+ const filteredEmitWarning = function emitWarning(warning, ...rest) {
7
+ const first = rest[0]
8
+ let warningType
9
+ if (typeof warning === 'object' && warning !== null && typeof warning.name === 'string') {
10
+ warningType = warning.name
11
+ } else if (typeof first === 'string') {
12
+ warningType = first
13
+ } else if (first !== null && typeof first === 'object' && typeof first.type === 'string') {
14
+ warningType = first.type
15
+ }
16
+ const warningMessage = typeof warning === 'object' && warning !== null && typeof warning.message === 'string'
17
+ ? warning.message
18
+ : String(warning ?? '')
19
+ if (warningType === 'ExperimentalWarning' && warningMessage.includes('SQLite is an experimental feature')) {
20
+ return
21
+ }
22
+ return Reflect.apply(originalEmitWarning, this ?? process, [warning, ...rest])
23
+ }
24
+ Reflect.set(filteredEmitWarning, sqliteWarningFiltered, true)
25
+ process.emitWarning = filteredEmitWarning
26
+ }
27
+
28
+ try {
29
+ const { runRsiSetup } = await import('../lib/rsi-setup.js')
30
+ await runRsiSetup()
31
+ } catch (error) {
32
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`)
33
+ process.exitCode = 1
34
+ }
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+
3
+ const sqliteWarningFiltered = Symbol.for('dsh-ray.sqlite-warning-filtered')
4
+ if (!Reflect.get(process.emitWarning, sqliteWarningFiltered)) {
5
+ const originalEmitWarning = process.emitWarning
6
+ const filteredEmitWarning = function emitWarning(warning, ...rest) {
7
+ const first = rest[0]
8
+ let warningType
9
+ if (typeof warning === 'object' && warning !== null && typeof warning.name === 'string') {
10
+ warningType = warning.name
11
+ } else if (typeof first === 'string') {
12
+ warningType = first
13
+ } else if (first !== null && typeof first === 'object' && typeof first.type === 'string') {
14
+ warningType = first.type
15
+ }
16
+ const warningMessage = typeof warning === 'object' && warning !== null && typeof warning.message === 'string'
17
+ ? warning.message
18
+ : String(warning ?? '')
19
+ if (warningType === 'ExperimentalWarning' && warningMessage.includes('SQLite is an experimental feature')) {
20
+ return
21
+ }
22
+ return Reflect.apply(originalEmitWarning, this ?? process, [warning, ...rest])
23
+ }
24
+ Reflect.set(filteredEmitWarning, sqliteWarningFiltered, true)
25
+ process.emitWarning = filteredEmitWarning
26
+ }
27
+
28
+ try {
29
+ const { runSupervisedGrowthSetup } = await import('../lib/supervised-growth-setup.js')
30
+ await runSupervisedGrowthSetup()
31
+ } catch (error) {
32
+ process.stderr.write(`${error instanceof Error ? error.message : String(error)}\n`)
33
+ process.exitCode = 1
34
+ }
@@ -0,0 +1,23 @@
1
+ - insert:
2
+ - id: dsh-ray-lark-channel
3
+ name: '@dsh-ray/lark-channel'
4
+ inject:
5
+ - assistantDelivery
6
+ config:
7
+ enabled: false
8
+ account: primary
9
+ tenant: replace-with-tenant-key
10
+ appId: cli_0000000000000000
11
+ credentialHandle: lark-app-secret
12
+ credentialPurpose: connect
13
+ credentialLeaseMs: 86400000
14
+ domain: feishu
15
+ requireMentionInGroups: true
16
+ showProgress: true
17
+ progressDetails: direct
18
+ showBackgroundProgress: false
19
+ statusReactions: true
20
+ maxTextBytes: 65536
21
+ staleAfterMs: 300000
22
+ handshakeTimeoutMs: 15000
23
+ imageDownloadTimeoutMs: 30000
@@ -0,0 +1,133 @@
1
+ # 会话、卡片、可靠性与排障
2
+
3
+ ## 会话命令
4
+
5
+ 同一私聊或稳定群聊 lane 会持续恢复同一个 DSH session。未知 slash 命令不会进入模型。
6
+
7
+ ```text
8
+ /status # 当前代次与上下文统计;/session 同义
9
+ /stop # 停止正在执行的任务,保留 session
10
+ /new # 停止旧任务并原子切换到空白 session;/clear 同义
11
+ /compact # 宿主提供原生命令时压缩当前上下文
12
+ /version # 查看助手、Host、插件版本与自迭代演进统计;/autonomy version 同义
13
+ /autonomy enable # active owner 开启整体助手自迭代能力(disable / upgrade 同理)
14
+ /model # 打开模型选择卡片
15
+ /model use <route> # 使用 provider/model 文字 route
16
+ /model reset # 恢复部署默认模型
17
+ /permissions # 查看并选择 ask / auto / full
18
+ /permission ask
19
+ /permission auto
20
+ /permission full confirm
21
+ ```
22
+
23
+ `/new` 会轮换 session,但保留该聊天已经选择的模型和 effort。`/stop` 不会清空上下文。
24
+
25
+ ## 整体目标结果反馈
26
+
27
+ 机器人通过外部 event-wait scheduled wake(当前 producer 为 `goal-event-wake-*`)发送整体目标结果时,结果末尾会带固定反馈说明;普通 `goal_schedule` 不外发该结果。请直接回复该条结果消息:`/feedback status` 查看当前版本;`/feedback correct <version> <previous-status> <achieved|partial|not-achieved>` 以 CAS 更正;`/feedback withdraw <version> <previous-status>` 撤回为 `unknown`。Verifier 判断已被采纳为 revision 1;裸 `achieved|partial|not-achieved` 只有与该 baseline 相同才幂等,若要改变判断必须先 `status`,再使用返回的 version/status 显式 `correct`。冲突时也按该流程重试。
28
+
29
+ 这条能力不依赖新的 Lark 卡片或回调。adapter 只提供原消息的 provider id、当前 actor 与 conversation;Delivery 会从 schema 20 typed sidecar 重建 owner/route/binding/Session,Goals 与 Verifier 重验 exact Goal definition、assessment、run、profile、contract 和 receipt,Evaluation v2 再执行版本 CAS/retract。复制文字、回复错误消息、错 owner、绑定换代或当前 provider identity 漂移都会失败关闭。结果发送前还要求 receipt 新鲜以及当前 route/Policy;消息已经发送后可以在 receipt 过期时纠正历史判断,但不能绕过不可变身份重验。
30
+
31
+ 当前工程回归使用本地 Delivery transport/Host fixture,没有真实飞书云端、真实模型或生产 cohort 证据。原生 Web 会话没有外部 provider reply identity,不支持这条 reply-feedback 路径。
32
+
33
+ ## 模型选择
34
+
35
+ 私聊机器人发送 `/model` 后,会收到 schema 2.0 卡片。依次选择“分组 / Provider”“模型”“Effort 程度”,再点击“确认选择”。选择 provider 时,同一卡片立刻刷新为该分组的模型;选择模型时再刷新为该模型真实支持的 effort。没有独立 effort 档位的模型只显示“默认(该模型无 effort 档位)”。
36
+
37
+ 确认后,原卡先进入不可交互的验证态,后台完成校验后原位更新为成功或失败,并保留文字结果通知。成功选择从下一条普通消息生效,原上下文保留。目录来自当前 Host 实际注册的 provider/model,不消耗模型调用。
38
+
39
+ 如果目录字段异常或卡片格式被飞书拒绝,机器人立即降级发送完整纯文本目录;可继续使用 `/model use <provider/model>`,不会静默重试后进入死信。
40
+
41
+ 飞书的静态选择器彼此独立,插件因此分别为 provider、model 与 effort 注册签名 callback,并用长连接响应 `{ card: { type: "raw", data: ... } }` 重绘同一张卡片。固定版官方 SDK 会忽略 `type=card` 长连接帧,transport 在边界完成分片合并、callback 分发和 ACK 兼容桥。
42
+
43
+ 每个级联状态都有持久 revision;旧卡回调只重绘当前权威状态,不能覆盖新选择。目录按 operation 保存在 Delivery SQLite,Host 短暂重启后仍可恢复。最终确认还绑定已经投递卡片的 provider message id:callback ACK 只表示受理,随后以同一 HTTP PATCH 链先锁定只读验证态,再在 durable settlement 完成后更新为只读终态。
44
+
45
+ adapter 与 Delivery 两层都会拒绝分组/模型错配,并校验目标模型的 effort 支持。选择“默认(由模型决定)”不会固定 reasoning effort。`/model` 是渠道无关的 Delivery 控制命令,不会交给当前失效的 LLM;即使旧默认 route 已不存在,也可以先切换后恢复会话。
46
+
47
+ ```text
48
+ /model
49
+ # 在卡片中选择三个下拉框并确认
50
+ 你好,请介绍一下你自己
51
+ ```
52
+
53
+ 三个下拉的当前项通过 `initial_index` 定位。飞书的 `initial_option` 按展示文本而非回传 `value` 匹配,直接写 route 形态的 value 会静默回落到第一项;只有文本能唯一标识选项时才附加 `initial_option`。当前项不在列表中时两者都不下发,不伪造预选。升级后应重新发送 `/model`,旧 v1/v2 卡片不再生效。
54
+
55
+ ## 权限选择卡片
56
+
57
+ `/permissions` 返回 ask、auto、full 三档卡片,当前档位带勾选,full 使用 danger 样式和飞书原生二次确认。卡片关闭转发互动,每个按钮携带独立 HMAC capability;token 绑定 channel/account/tenant/chat、精确 owner、binding/version/session、权限状态指纹、目标档位与 TTL。
58
+
59
+ adapter 先拒绝错人、跨 chat、篡改和过期,Delivery 再核对原 Outbox、provider message id、active owner/binding/session、Policy 与当前权限状态。通过后只把固定 `/permission` 命令写入同一 durable Inbox 串行路径,不在 adapter 内直接修改权限。旧卡、复制卡和晚到的相反选择不能覆盖新状态;卡片 4xx、缺少签名或 settlement 能力时退回完整文字说明。
60
+
61
+ 权限卡只在 active owner 私聊中生效,并绑定原 chat、原卡 message id、binding/session、权限状态和默认 15 分钟 TTL。群聊、过期卡、`/new` 后旧卡或期间已经用文字切档都会失败关闭;请重新发送 `/permissions`。点击 Toast“已受理”后,以机器人随后发送的“已切换”回复为准。
62
+
63
+ ## 入站与会话 lane
64
+
65
+ - 事件处理器等待 `assistant-delivery.acceptInbound()` 完成,即 Inbox 落盘后才向长连接 callback 返回成功。
66
+ - `messageId` 是稳定 inbound event id;Delivery 的 `(channel, account, eventId)` 唯一约束承担跨重启去重。
67
+ - 飞书 SDK 标准化生成的 `![image](image_key)` 等标记会在进入 Delivery 前改写。纯图片正文保持为空,provider image key 只存在于隔离附件描述符,不会伪装成用户 prompt。
68
+ - 单聊按 account/tenant/user/chat 绑定。
69
+ - 群顶层消息没有 provider `root_id`,因此按发送者生成 `dsh-lark-top-sender/<sha256(open_id)>` 合成 thread。同群同发送者连续复用 session,不同发送者不落入同一 owner binding。
70
+ - 飞书提供真实 `root_id` 时直接使用可寻址的根消息 id,让不同回复串隔离。`dsh-lark-top-sender/` 是保留命名空间,provider root 命中该前缀时拒绝入站,避免两种 lane 碰撞。
71
+ - 合成 thread 只用于 Delivery 持久化,不作为飞书回复目标。当前消息仍回复真实 `messageId`;没有原消息可回复的后台发送则发到群顶层。
72
+
73
+ ## 图片资源
74
+
75
+ 图片只在 Delivery 再次确认 binding、Policy、目标模型图片能力和 AttachmentStore 可用后显式下载,不在 WebSocket callback 内下载。
76
+
77
+ adapter 只接受同一入站消息的严格 message ID/image key,并固定请求 `GET /open-apis/im/v1/messages/:message_id/resources/:file_key?type=image`;拒绝 URL、路径片段、重定向和非图片资源。`imageDownloadTimeoutMs` 默认 30 秒,可设为 1–120 秒;总截止时间覆盖 tenant token 与资源 GET,caller 取消、插件卸载或 credential lease 切换在 token cache miss 时也会及时返回。
78
+
79
+ 调用方同时提供逐图 byte 上限;transport 在响应 header、流读取和 PNG/JPEG/GIF/WebP magic/MIME 三层校验。
80
+
81
+ ## 出站与发送可靠性
82
+
83
+ - 只有合法、非重复且状态为 `queued` 的入站才异步添加 `Get`;未授权、死信或 provider 重放不重复 reaction。表情类型是大小写敏感的 `Get` 与 `DONE`。
84
+ - 最终回复携带原始飞书 `messageId`,先成功回复,再异步添加 `DONE`。Delivery 收到有效 provider message id 后立刻记录 `accepted`,不等待 presentation-only reaction。
85
+ - 发送失败、没有最终回复、任务失败或取消都不添加 `DONE`。reaction 失败只降级 channel health;首版保留 `Get`,不会为替换表情申请 reaction 读取权限。
86
+ - plain text 使用飞书文本消息;Markdown 使用 schema 2.0 卡片。请求携带由 Delivery idempotency key 单向哈希得到的 provider UUID。
87
+ - Agent 回答本身是 Markdown;若以 plain 发送会暴露表格分隔符、`**` 等语法。Delivery 只在 adapter 声明 `markdown` 能力时请求该格式,否则降级为 plain,避免 coordinator 以 `unsupported-format` 丢弃整条消息。
88
+ - Markdown 回答卡片不添加 header,避免与飞书气泡已有的机器人名称/头像重复;标题使用带字号的 Markdown 组件,顶级 GFM 表格使用原生 Table,其余正文保持 Markdown。单卡最多使用 5 个原生表格、每表最多 50 列;超限表格转为可读列表。只有飞书明确拒绝卡片格式时才按原始正文精确降级为 plain text,不会把成功卡片重复发送。
89
+ - 权限或格式错误是确定未发送;限流和未连接可以安全重试;网络超时或未知 SDK 错误进入 `unknown_after_send`,不会盲目重发。
90
+ - 飞书目前没有为该发送 UUID 提供可靠查询/对账接口,因此 adapter 声明 `reconcileUnknownSend: false`;也没有 delivered 事实,adapter 不伪造 delivered。
91
+ - **E3a 范围**:飞书侧覆盖假传输下的 read 回执与 deliveryState 状态机;真实飞书事件订阅/WS 联调、群聊 `read_users` 与 `adopted` 事实来源均属后续切片,不在本范围(Web 通道的 notice ack `delivered`/`read` 已另行实现于 `assistant-delivery` / `assistant-web-owner`)。
92
+ - E3a read 回执:adapter 声明 `receipts: ['read']`、`readReceipts: 'best-effort'`,从官方单聊事件 `im.message.message_read_v1` 转发 read receipt(channel/account/provider message id/read_time)。事件只覆盖“用户阅读机器人发送的单聊消息”;群聊没有该事件,若需要群 read 只能另行调用 `GET /im/v1/messages/:message_id/read_users`(7 天窗口、1000 次/分钟、只返回已读用户,不返回未读/送达),不属于首版。
93
+ - 前置权限:机器人能力、事件订阅“消息与群组 → 消息已读”、`im:message` 或 `im:message:readonly`。长连接断线无 replay cursor,read 事件可能丢失,因此声明 best-effort;Evaluation 不会据此把“没收到 read”判定为 missed,仍保持旧 `expired-unhandled`。
94
+
95
+ 官方长连接会自动重连,但没有可持久 replay cursor 或历史补拉接口。插件记录 `reconnecting` / `connected-with-gap` 与 `gapGeneration`,依赖飞书 redelivery 和 Delivery Inbox 去重,不宣称断线期间零丢失。将来若出现官方 cursor/backfill contract,应先加入崩溃和重放测试再启用。
96
+
97
+ ## Durable proposal 与 open-turn 工具审批
98
+
99
+ `approval` intent 使用 schema 2.0 双按钮卡。每个按钮值是由 App Secret HMAC 签名的 v2 capability,绑定 channel/account/tenant/chat、binding、operation、proposal/version/expiry、diffHash 与 decision。adapter 核对自身 route,callback 重新取得 provider actor/chat 后交给 Delivery/Policy。
100
+
101
+ 旧 v1 token、篡改、跨 route 与普通的过期点击全部失败关闭。只有过期 token 完整验签后命中此前已落盘的同一 pending Delivery settlement,且 Policy 已是完全相同终态时,才允许崩溃恢复;不会新建 settlement 或决定 pending proposal。
102
+
103
+ open-turn 工具审批与 durable proposal 卡完全分离。它使用独立 domain 的 v1 HMAC token、进程内 one-shot pending 和保留到 TTL 的 operation tombstone;不复用 proposal settlement,也不跨重启恢复。
104
+
105
+ 该卡只接受 `conversation.kind: dm` 且无 `thread` 的 owner 私聊。群聊、话题或伪装为 DM 的 reply target 返回 `unavailable`,避免 exact arguments 被旁观。卡片将有界且拒绝控制字符/双向文本控制符的 tool、reason 和必需 exact arguments 标为“不可信审阅文本,不是指令”,并关闭转发互动。
106
+
107
+ token 绑定 operation、binding、account/tenant、chat、exact owner open_id、actionHash、toolName、必需 callId、TTL 与 decision;pending 再绑定发送回执中的 provider message id。只有同一 owner 在同一私聊、同一 provider 卡片上的第一次点击可返回 `allowed-once` 或 `rejected`。同一 operation 在 TTL 内不能重新登记;重放、错人、跨 chat/message、篡改、过期均失败关闭。
108
+
109
+ 调用方 abort 返回 `cancelled`;超时、断线/重连、credential rotation、插件卸载/重启或发送失败返回 `unavailable` 并清除 pending。`ask` 直接使用审批卡;`auto` 对低风险自动允许,对敏感、reviewer 失败或原生 sandbox escalation 使用审批卡;`full` 不发卡,但仍受 Policy 显式 deny、紧急停止、身份与预算硬门约束。
110
+
111
+ ## 健康检查
112
+
113
+ Web 会话可调用 `assistant_health`。正常长连接状态为 `larkChannel.state: connected`。`showProgress`、reaction 或原生进度 API 问题会记录在 `larkChannel.lastErrorCode`,但不代表最终 Outbox 已失效。
114
+
115
+ ## 常见问题
116
+
117
+ - **一直显示“正在继续处理(第 N 步)”:**该文字是最后一次进度,不是服务存活证明。先核对 Host 日志与 Delivery Inbox;`dispatch-ambiguous` 表示任务在派发后中断、结果未确认。服务恢复后,Delivery 会为仍有效的 owner 普通请求补发一次中断说明,不自动重做原动作,也不加 DONE。旧进度句柄只在原进程内,重启后不能原位关闭旧气泡;以持久回复为准。不要在当前 Agent 的 shell 中安排重启自身来刷新 Wiki,正常 `wiki_upsert` 提交会更新目录。
118
+
119
+ - **凭据或 bot identity 错误:**核对 App ID/Secret、`feishu`/`lark` domain 和机器人能力;重跑向导会更新同一 Keychain 条目。
120
+ - **一键创建链接过期或被拒绝:**重跑 `dsh-lark-setup --profile web --create-app`。链接只在页面显示的期限内有效,且只能由一位用户确认。
121
+ - **长连接成功但一直等不到短语:**确认事件接收方式是长连接、已经添加 `im.message.receive_v1`、应用版本已发布且你在可用范围内,并在机器人私聊原样发送短语。
122
+ - **`assistant_health` 显示 `disabled`:**向导尚未成功写入 profile,或常驻服务还在运行旧配置;执行 `--install-service`。
123
+ - **`launchd bootstrap failed: Bootstrap failed: 5: Input/output error`:**新版会检查稳定 job 状态并有限重试 macOS 瞬时竞态。先重新 build 本包,再执行 `dsh-lark-setup --profile web --install-service`;仍失败时用 `plutil -lint ~/Library/LaunchAgents/ai.deepseek.dsh.profile.web.plist` 校验,并查看 `~/.dsh/logs/web-host.error.log`。
124
+ - **`caller is not allowlisted for this credential handle`:**旧版默认导出可能丢失稳定 Cordis plugin identity。更新并重新 build,再执行 `--install-service`;不要放宽 credential consumer allowlist。
125
+ - **显示 `connected-with-gap`:**连接曾中断。飞书没有持久 replay cursor,应检查断线期间是否漏处理消息。
126
+ - **收到消息但无回复:**先发送 `/model`,选择目录中可用且已登录的 route,再查看 `assistant_health`。未授权身份会 fail closed,不会自动成为 owner。
127
+ - **工具或技能被拒绝:**先确认对应技能/插件已安装并挂载到 profile,并升级重启 `assistant-delivery`,确认 session 的 preset 在 create/resume 时已挂载。需要执行时运行 `dsh-lark-setup --profile web --refresh-agent-policy --allow-agent-tools`,或手工添加 exact preset/workspace/initiator 的 capability 与工具规则。refresh 不重启服务;`--install-service` 只重启,不改能力规则。
128
+ - **没有审批卡却反复显示 `the user rejected tool`:**旧 native full session 可能只有 `danger-full-access + never`,缺少 reviewer,导致保守回落到 user、工具进入 ask-review,随后被 `approval=never` 自动拒绝。这不表示用户点过拒绝。升级构建并重启 `assistant-policy` 所在 profile;它会为 legacy full 状态持久补齐 `reviewer=none`。非 full 的 never 状态会返回 `[approval-disabled] ... no user approval was requested`。若随后出现 `default-deny`,刷新 Agent Policy。不要在 ask/auto 中无条件允许 `run_code`,它仍是 bash-equivalent 执行面。
129
+ - **权限卡不显示或点击失效:**卡片仅用于 active owner 私聊,并绑定原 chat/card、binding/session、权限状态和 15 分钟默认 TTL。群聊、过期、`/new` 后旧卡或已经文字切档都会失效;重新发送 `/permissions`。
130
+ - **最终回复正常但没有 `Get` / `DONE`:**旧应用通常缺少 `im:message.reactions:write_only`。重跑一键向导,选择当前 App ID,确认权限增量并发布新版本。reaction 失败不会阻断回答。
131
+ - **文字能回复但图片不能处理:**确认应用已有 `im:resource` 且发布新版本,profile 安装了 AttachmentStore,当前 route 声明图片输入。可用 `dsh-lark-setup --profile web --create-app --app-id <App ID>` 增量补权限。路径型 key、重定向、超限、MIME/magic 不一致或非 PNG/JPEG/GIF/WebP 会按预期 fail closed。
132
+ - **看不到进度但能回答:**确认 `showProgress: true`。`message_cot` 是可降级能力;检查 `assistant_health` 的 `larkChannel.lastErrorCode` 和 Host 错误日志。私聊详情还要求 `progressDetails: direct`;群聊始终只显示状态。原生 Goal 续跑等后台轮次的进度默认不显示,需要时设 `showBackgroundProgress: true`。
133
+ - **模型卡片下拉不联动或确认后无回复:**确认订阅 `card.action.trigger` 且回调走长连接;用一键向导锁定当前应用并增量补齐回调,发布、重启后重新发送 `/model`,不要继续使用升级前旧卡。实时目录变化或 effort 不受支持时,机器人会要求重新打开。