agent-trellis 0.7.0 → 0.8.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 (302) hide show
  1. package/README.md +48 -153
  2. package/dist/adapters/claude-code.js +3 -2
  3. package/dist/adapters/codex.js +3 -2
  4. package/dist/adapters/jsonMcp.d.ts +3 -1
  5. package/dist/adapters/jsonMcp.js +18 -4
  6. package/dist/adapters/kimi-code.d.ts +21 -0
  7. package/dist/adapters/kimi-code.js +107 -0
  8. package/dist/adapters/kiro.js +3 -2
  9. package/dist/adapters/mcpPlan.d.ts +6 -1
  10. package/dist/adapters/mcpPlan.js +106 -8
  11. package/dist/adapters/pi.js +22 -3
  12. package/dist/adapters/symlinkPlan.d.ts +7 -0
  13. package/dist/adapters/symlinkPlan.js +16 -7
  14. package/dist/adapters/zcode.d.ts +21 -0
  15. package/dist/adapters/zcode.js +234 -0
  16. package/dist/cli.js +145 -29
  17. package/dist/commands/doctor.d.ts +7 -2
  18. package/dist/commands/doctor.js +40 -2
  19. package/dist/commands/init.d.ts +4 -2
  20. package/dist/commands/init.js +29 -13
  21. package/dist/commands/kimi.d.ts +16 -0
  22. package/dist/commands/kimi.js +64 -0
  23. package/dist/commands/manage.d.ts +39 -0
  24. package/dist/commands/manage.js +126 -0
  25. package/dist/commands/mcp.d.ts +77 -14
  26. package/dist/commands/mcp.js +169 -29
  27. package/dist/commands/mcpGateway.d.ts +6 -0
  28. package/dist/commands/mcpGateway.js +35 -14
  29. package/dist/commands/mcpImport.d.ts +46 -0
  30. package/dist/commands/mcpImport.js +359 -0
  31. package/dist/commands/memory.d.ts +17 -3
  32. package/dist/commands/memory.js +27 -8
  33. package/dist/commands/migrate.d.ts +16 -5
  34. package/dist/commands/migrate.js +93 -17
  35. package/dist/commands/onboard.d.ts +74 -2
  36. package/dist/commands/onboard.js +469 -71
  37. package/dist/commands/rollback.js +28 -2
  38. package/dist/commands/secretsAudit.js +4 -1
  39. package/dist/commands/skill.d.ts +52 -6
  40. package/dist/commands/skill.js +114 -15
  41. package/dist/commands/sync.js +5 -1
  42. package/dist/core/adapter.d.ts +11 -1
  43. package/dist/core/canonical.d.ts +15 -7
  44. package/dist/core/canonical.js +101 -13
  45. package/dist/core/capabilitySelection.d.ts +45 -0
  46. package/dist/core/capabilitySelection.js +124 -0
  47. package/dist/core/types.d.ts +25 -2
  48. package/dist/core/types.js +8 -0
  49. package/dist/lib/agentBridge.d.ts +169 -0
  50. package/dist/lib/agentBridge.js +367 -0
  51. package/dist/lib/agentBridgeProvider.d.ts +14 -0
  52. package/dist/lib/agentBridgeProvider.js +95 -0
  53. package/dist/lib/backup.d.ts +32 -0
  54. package/dist/lib/backup.js +20 -1
  55. package/dist/lib/builtinSkills.d.ts +2 -0
  56. package/dist/lib/builtinSkills.js +4 -0
  57. package/dist/lib/chatAgents.d.ts +42 -0
  58. package/dist/lib/chatAgents.js +59 -0
  59. package/dist/lib/cliMetadata.d.ts +1 -0
  60. package/dist/lib/cliMetadata.js +14 -0
  61. package/dist/lib/envVarNames.d.ts +3 -0
  62. package/dist/lib/envVarNames.js +19 -0
  63. package/dist/lib/gatewayBackend.d.ts +28 -0
  64. package/dist/lib/gatewayBackend.js +72 -1
  65. package/dist/lib/installAgent.d.ts +7 -5
  66. package/dist/lib/installAgent.js +4 -3
  67. package/dist/lib/mcpConnect.js +5 -1
  68. package/dist/lib/mcpMigrateRead.d.ts +2 -0
  69. package/dist/lib/mcpMigrateRead.js +22 -1
  70. package/dist/lib/mcpRuntime.d.ts +46 -0
  71. package/dist/lib/mcpRuntime.js +185 -0
  72. package/dist/lib/mcpStatusProvider.d.ts +10 -0
  73. package/dist/lib/mcpStatusProvider.js +25 -0
  74. package/dist/lib/mcpToolRegistry.d.ts +18 -0
  75. package/dist/lib/mcpToolRegistry.js +107 -14
  76. package/dist/lib/memoryGraph.d.ts +1 -1
  77. package/dist/lib/memoryGraph.js +9 -3
  78. package/dist/lib/memoryProvider.d.ts +58 -0
  79. package/dist/lib/memoryProvider.js +175 -0
  80. package/dist/lib/memoryStatus.d.ts +17 -0
  81. package/dist/lib/memoryStatus.js +88 -0
  82. package/dist/lib/nativeMemory.d.ts +19 -0
  83. package/dist/lib/nativeMemory.js +129 -0
  84. package/dist/lib/realHomeSnapshot.js +5 -0
  85. package/dist/lib/runtimeControlProvider.d.ts +16 -0
  86. package/dist/lib/runtimeControlProvider.js +170 -0
  87. package/dist/lib/secretEnv.d.ts +2 -1
  88. package/dist/lib/secretEnv.js +6 -2
  89. package/dist/lib/skillProvider.d.ts +13 -0
  90. package/dist/lib/skillProvider.js +210 -0
  91. package/dist/lib/taskProvider.d.ts +7 -0
  92. package/dist/lib/taskProvider.js +43 -0
  93. package/dist/lib/taskStore.d.ts +46 -0
  94. package/dist/lib/taskStore.js +156 -0
  95. package/dist/lib/terminalPicker.d.ts +23 -49
  96. package/dist/lib/terminalPicker.js +80 -218
  97. package/dist/lib/zcodeOwnership.d.ts +17 -0
  98. package/dist/lib/zcodeOwnership.js +37 -0
  99. package/dist/pi-bridge/bundle.js +476 -37
  100. package/dist/pi-bridge/index.js +42 -21
  101. package/dist/pi-bridge/schemaTranslate.d.ts +4 -8
  102. package/dist/pi-bridge/schemaTranslate.js +4 -8
  103. package/dist/probes/codex.d.ts +7 -0
  104. package/dist/probes/codex.js +37 -5
  105. package/dist/probes/kimi-code.d.ts +12 -0
  106. package/dist/probes/kimi-code.js +55 -0
  107. package/dist/probes/zcode.d.ts +32 -0
  108. package/dist/probes/zcode.js +140 -0
  109. package/dist/sdk.d.ts +1 -1
  110. package/docs/architecture.md +230 -28
  111. package/docs/assets/brand-v3/trellis-mark-v3-a.png +0 -0
  112. package/docs/assets/brand-v3/trellis-mark-v3-a.svg +10 -0
  113. package/docs/assets/poster-series-v3/README.md +60 -0
  114. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-horizontal-en.png +0 -0
  115. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-horizontal-en.svg +51 -0
  116. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-horizontal-zh.png +0 -0
  117. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-horizontal-zh.svg +51 -0
  118. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-memory-en.png +0 -0
  119. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-memory-en.svg +48 -0
  120. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-memory-zh.png +0 -0
  121. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-memory-zh.svg +48 -0
  122. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-migrate-en.png +0 -0
  123. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-migrate-en.svg +56 -0
  124. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-migrate-zh.png +0 -0
  125. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-migrate-zh.svg +56 -0
  126. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-switch-en.png +0 -0
  127. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-switch-en.svg +47 -0
  128. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-switch-zh.png +0 -0
  129. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-switch-zh.svg +47 -0
  130. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-unified-en.png +0 -0
  131. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-unified-en.svg +51 -0
  132. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-unified-zh.png +0 -0
  133. package/docs/assets/poster-series-v3/agent-trellis-poster-v3-unified-zh.svg +51 -0
  134. package/docs/getting-started.md +496 -42
  135. package/docs/overview.md +134 -0
  136. package/docs/overview.zh-CN.md +102 -0
  137. package/docs/research.md +59 -0
  138. package/docs/roadmap.md +11 -6
  139. package/docs/video/README.md +76 -0
  140. package/docs/video/build/audio/01-opening.aiff +0 -0
  141. package/docs/video/build/audio/01-opening.mp3 +0 -0
  142. package/docs/video/build/audio/02-pain.aiff +0 -0
  143. package/docs/video/build/audio/02-pain.mp3 +0 -0
  144. package/docs/video/build/audio/03-solution.aiff +0 -0
  145. package/docs/video/build/audio/03-solution.mp3 +0 -0
  146. package/docs/video/build/audio/04-install.aiff +0 -0
  147. package/docs/video/build/audio/04-install.mp3 +0 -0
  148. package/docs/video/build/audio/04-setup.mp3 +0 -0
  149. package/docs/video/build/audio/05-dryrun.mp3 +0 -0
  150. package/docs/video/build/audio/05-init.aiff +0 -0
  151. package/docs/video/build/audio/05-init.mp3 +0 -0
  152. package/docs/video/build/audio/05-interactive.mp3 +0 -0
  153. package/docs/video/build/audio/06-dryrun.aiff +0 -0
  154. package/docs/video/build/audio/06-dryrun.mp3 +0 -0
  155. package/docs/video/build/audio/06-onboard.mp3 +0 -0
  156. package/docs/video/build/audio/06-run.mp3 +0 -0
  157. package/docs/video/build/audio/07-onboard.aiff +0 -0
  158. package/docs/video/build/audio/07-onboard.mp3 +0 -0
  159. package/docs/video/build/audio/07-verify.mp3 +0 -0
  160. package/docs/video/build/audio/08-closing.mp3 +0 -0
  161. package/docs/video/build/audio/08-doctor.aiff +0 -0
  162. package/docs/video/build/audio/08-doctor.mp3 +0 -0
  163. package/docs/video/build/audio/09-rollback.aiff +0 -0
  164. package/docs/video/build/audio/09-rollback.mp3 +0 -0
  165. package/docs/video/build/audio/10-principles.aiff +0 -0
  166. package/docs/video/build/audio/10-principles.mp3 +0 -0
  167. package/docs/video/build/audio/11-closing.aiff +0 -0
  168. package/docs/video/build/audio/11-closing.mp3 +0 -0
  169. package/docs/video/build/frames/01-opening-0.png +0 -0
  170. package/docs/video/build/frames/02-pain-1.png +0 -0
  171. package/docs/video/build/frames/02-pain-2.png +0 -0
  172. package/docs/video/build/frames/03-solution-3.png +0 -0
  173. package/docs/video/build/frames/04-install-4.png +0 -0
  174. package/docs/video/build/frames/04-setup-4.png +0 -0
  175. package/docs/video/build/frames/04-setup-5.png +0 -0
  176. package/docs/video/build/frames/05-dryrun-6.png +0 -0
  177. package/docs/video/build/frames/05-init-5.png +0 -0
  178. package/docs/video/build/frames/05-interactive-5.png +0 -0
  179. package/docs/video/build/frames/05-interactive-6.png +0 -0
  180. package/docs/video/build/frames/06-dryrun-6.png +0 -0
  181. package/docs/video/build/frames/06-dryrun-7.png +0 -0
  182. package/docs/video/build/frames/06-onboard-7.png +0 -0
  183. package/docs/video/build/frames/06-onboard-8.png +0 -0
  184. package/docs/video/build/frames/06-run-7.png +0 -0
  185. package/docs/video/build/frames/06-run-8.png +0 -0
  186. package/docs/video/build/frames/07-onboard-10.png +0 -0
  187. package/docs/video/build/frames/07-onboard-7.png +0 -0
  188. package/docs/video/build/frames/07-onboard-8.png +0 -0
  189. package/docs/video/build/frames/07-onboard-9.png +0 -0
  190. package/docs/video/build/frames/07-verify-10.png +0 -0
  191. package/docs/video/build/frames/07-verify-8.png +0 -0
  192. package/docs/video/build/frames/07-verify-9.png +0 -0
  193. package/docs/video/build/frames/08-closing-10.png +0 -0
  194. package/docs/video/build/frames/08-closing-11.png +0 -0
  195. package/docs/video/build/frames/08-doctor-11.png +0 -0
  196. package/docs/video/build/frames/08-doctor-9.png +0 -0
  197. package/docs/video/build/frames/09-rollback-10.png +0 -0
  198. package/docs/video/build/frames/09-rollback-12.png +0 -0
  199. package/docs/video/build/frames/10-principles-11.png +0 -0
  200. package/docs/video/build/frames/10-principles-13.png +0 -0
  201. package/docs/video/build/frames/11-closing-12.png +0 -0
  202. package/docs/video/build/frames/11-closing-14.png +0 -0
  203. package/docs/video/build/segments/01-opening.mp4 +0 -0
  204. package/docs/video/build/segments/01-opening.txt +3 -0
  205. package/docs/video/build/segments/02-pain.mp4 +0 -0
  206. package/docs/video/build/segments/02-pain.txt +5 -0
  207. package/docs/video/build/segments/03-solution.mp4 +0 -0
  208. package/docs/video/build/segments/03-solution.txt +3 -0
  209. package/docs/video/build/segments/04-install.mp4 +0 -0
  210. package/docs/video/build/segments/04-install.txt +3 -0
  211. package/docs/video/build/segments/04-setup.mp4 +0 -0
  212. package/docs/video/build/segments/04-setup.txt +3 -0
  213. package/docs/video/build/segments/05-dryrun.mp4 +0 -0
  214. package/docs/video/build/segments/05-dryrun.txt +3 -0
  215. package/docs/video/build/segments/05-init.mp4 +0 -0
  216. package/docs/video/build/segments/05-init.txt +3 -0
  217. package/docs/video/build/segments/05-interactive.mp4 +0 -0
  218. package/docs/video/build/segments/05-interactive.txt +5 -0
  219. package/docs/video/build/segments/06-dryrun.mp4 +0 -0
  220. package/docs/video/build/segments/06-dryrun.txt +3 -0
  221. package/docs/video/build/segments/06-onboard.mp4 +0 -0
  222. package/docs/video/build/segments/06-onboard.txt +5 -0
  223. package/docs/video/build/segments/06-run.mp4 +0 -0
  224. package/docs/video/build/segments/06-run.txt +3 -0
  225. package/docs/video/build/segments/07-onboard.mp4 +0 -0
  226. package/docs/video/build/segments/07-onboard.txt +5 -0
  227. package/docs/video/build/segments/07-verify.mp4 +0 -0
  228. package/docs/video/build/segments/07-verify.txt +5 -0
  229. package/docs/video/build/segments/08-closing.mp4 +0 -0
  230. package/docs/video/build/segments/08-closing.txt +3 -0
  231. package/docs/video/build/segments/08-doctor.mp4 +0 -0
  232. package/docs/video/build/segments/08-doctor.txt +3 -0
  233. package/docs/video/build/segments/09-rollback.mp4 +0 -0
  234. package/docs/video/build/segments/09-rollback.txt +3 -0
  235. package/docs/video/build/segments/10-principles.mp4 +0 -0
  236. package/docs/video/build/segments/10-principles.txt +3 -0
  237. package/docs/video/build/segments/11-closing.mp4 +0 -0
  238. package/docs/video/build/segments/11-closing.txt +3 -0
  239. package/docs/video/build/segments/final.txt +8 -0
  240. package/docs/video/build-ai/audio/01-hook.mp3 +0 -0
  241. package/docs/video/build-ai/audio/02-pain.mp3 +0 -0
  242. package/docs/video/build-ai/audio/03-solution.mp3 +0 -0
  243. package/docs/video/build-ai/audio/04-how.mp3 +0 -0
  244. package/docs/video/build-ai/audio/05-safe.mp3 +0 -0
  245. package/docs/video/build-ai/audio/06-closing.mp3 +0 -0
  246. package/docs/video/build-ai/clips/01-hook.mp4 +0 -0
  247. package/docs/video/build-ai/clips/02-pain.mp4 +0 -0
  248. package/docs/video/build-ai/clips/03-solution.mp4 +0 -0
  249. package/docs/video/build-ai/clips/04-how.mp4 +0 -0
  250. package/docs/video/build-ai/clips/05-safe.mp4 +0 -0
  251. package/docs/video/build-ai/clips/06-closing.mp4 +0 -0
  252. package/docs/video/build-ai/first-frame-02-pain.png +0 -0
  253. package/docs/video/build-ai/first-frame-03-solution.png +0 -0
  254. package/docs/video/build-ai/first-frame-04-how.png +0 -0
  255. package/docs/video/build-ai/first-frame-05-safe.png +0 -0
  256. package/docs/video/build-ai/segments/01-hook.caption.txt +2 -0
  257. package/docs/video/build-ai/segments/01-hook.mp4 +0 -0
  258. package/docs/video/build-ai/segments/02-pain.mp4 +0 -0
  259. package/docs/video/build-ai/segments/03-solution.mp4 +0 -0
  260. package/docs/video/build-ai/segments/04-how.mp4 +0 -0
  261. package/docs/video/build-ai/segments/05-safe.mp4 +0 -0
  262. package/docs/video/build-ai/segments/06-closing.mp4 +0 -0
  263. package/docs/video/build-ai/segments/cap-01-hook.png +0 -0
  264. package/docs/video/build-ai/segments/cap-02-pain.png +0 -0
  265. package/docs/video/build-ai/segments/cap-03-solution.png +0 -0
  266. package/docs/video/build-ai/segments/cap-04-how.png +0 -0
  267. package/docs/video/build-ai/segments/cap-05-safe.png +0 -0
  268. package/docs/video/build-ai/segments/cap-06-closing.png +0 -0
  269. package/docs/video/build-ai/segments/final.txt +6 -0
  270. package/docs/video/build-posters/audio/01-hook.mp3 +0 -0
  271. package/docs/video/build-posters/audio/02-pain.mp3 +0 -0
  272. package/docs/video/build-posters/audio/03-solution.mp3 +0 -0
  273. package/docs/video/build-posters/audio/04-how.mp3 +0 -0
  274. package/docs/video/build-posters/audio/05-safe.mp3 +0 -0
  275. package/docs/video/build-posters/audio/06-closing.mp3 +0 -0
  276. package/docs/video/build-posters/cap-01-hook.png +0 -0
  277. package/docs/video/build-posters/cap-02-pain.png +0 -0
  278. package/docs/video/build-posters/cap-03-solution.png +0 -0
  279. package/docs/video/build-posters/cap-04-how.png +0 -0
  280. package/docs/video/build-posters/cap-05-safe.png +0 -0
  281. package/docs/video/build-posters/cap-06-closing.png +0 -0
  282. package/docs/video/build-posters/card-01-hook.png +0 -0
  283. package/docs/video/build-posters/card-06-closing.png +0 -0
  284. package/docs/video/build-posters/segments/01-hook.mp4 +0 -0
  285. package/docs/video/build-posters/segments/02-pain.mp4 +0 -0
  286. package/docs/video/build-posters/segments/03-solution.mp4 +0 -0
  287. package/docs/video/build-posters/segments/04-how.mp4 +0 -0
  288. package/docs/video/build-posters/segments/05-safe.mp4 +0 -0
  289. package/docs/video/build-posters/segments/06-closing.mp4 +0 -0
  290. package/docs/video/build-posters/segments/final.txt +6 -0
  291. package/docs/video/generate-video-ai.mjs +334 -0
  292. package/docs/video/generate-video-posters.mjs +204 -0
  293. package/docs/video/generate-video.mjs +426 -0
  294. package/docs/video/outline.zh-CN.md +102 -0
  295. package/docs/video/trellis-demo-video-ai.mp4 +0 -0
  296. package/docs/video/trellis-demo-video.mp4 +0 -0
  297. package/docs/video/voiceover.zh-CN.md +49 -0
  298. package/package.json +6 -2
  299. package/schema/builtin-skills/trellis-runtime/SKILL.md +117 -0
  300. package/schema/capability-selection.example.yaml +23 -0
  301. package/schema/scope.example.yaml +1 -1
  302. package/schema/servers.example.yaml +15 -1
@@ -15,8 +15,8 @@ npm install -g agent-trellis
15
15
  $ trellis onboard
16
16
  ```
17
17
 
18
- Runs `init`, detects which of Claude Code/Codex/Kiro/pi are on this machine,
19
- then resolves two interactive choices and two flag-only ones before running
18
+ Runs `init`, detects which of Claude Code/Codex/Kiro/pi/Kimi Code/ZCode are on this machine,
19
+ then resolves two styled interactive choices and two flag-only ones before running
20
20
  `migrate`, `sync`, `mcp sync`, `memory sync`, `secrets audit`, and a final
21
21
  health scan — the whole onboarding path, no follow-up commands to type by
22
22
  hand, and no need to run `trellis doctor` separately to know whether it
@@ -39,27 +39,43 @@ that.
39
39
  prompt entirely. Which *categories* to bring in from that source
40
40
  (skills, instructions, mcp) is its own checkbox, shown only when the
41
41
  source has real content in two or more of them — with just one, that
42
- one is migrated unprompted.
42
+ one is migrated unprompted. On a real terminal this uses a colored
43
+ selector; it shows aggregate counts, not every skill name.
43
44
  2. **Managed set** — zero or more agents to actually write to. Always an
44
45
  explicit choice: pass `--manage <ids>` (comma-separated, e.g. `--manage
45
46
  pi,codex`) or `--manage none`, or answer the interactive checkbox prompt
46
- (Space to toggle, Enter to confirm — same numbered fallback as above).
47
+ (arrow keys to move, Space to toggle, Enter to confirm — same numbered
48
+ fallback as above when a raw TTY is unavailable).
47
49
  **The source is not included by default** — migrating from Claude Code
48
50
  doesn't mean Trellis starts managing Claude Code too, unless you say so.
49
51
  Selecting an agent that isn't installed yet is itself the authorization to
50
52
  install it (one confirmation, then a real `npm install -g <package>`);
51
53
  Kiro has no CLI package and is refused with its download URL instead.
52
- 3. **MCP mode** — direct (the default), hub, or gateway. Flag-only, never
53
- prompted: pass `--mcp-mode direct|hub|gateway` to change it (`--hub-url
54
- <url>` is required with `hub`; `--gateway-agents <ids>` is optional with
55
- `gateway`, omitted meaning every managed agent). Omitting `--mcp-mode`
54
+ Onboarding is intentionally additive: an agent already managed remains
55
+ managed if a later onboarding run omits it. Use the explicit `trellis
56
+ manage` lifecycle commands below when you intend to detach one.
57
+ 3. **MCP mode** — direct, gateway, or hub. In the interactive route picker,
58
+ **Gateway is recommended for local Trellis hosting**: Trellis runs the
59
+ local MCP entry and manages upstream connections for the Agent session;
60
+ no extra service is needed. Choose **Direct** when each Agent should
61
+ connect to MCP servers independently. Choose **Hub only when an external
62
+ MCP Hub is already running**: each Agent connects to one external HTTP
63
+ endpoint, and the Hub owns the upstream server list. Trellis does not
64
+ deploy the Hub. The non-interactive mode is flag-only: pass
65
+ `--mcp-mode direct|hub|gateway` to change it (`--hub-url <url>` is required
66
+ with `hub`; `--gateway-agents <ids>` is optional with `gateway`, omitted
67
+ meaning every managed agent). Omitting `--mcp-mode`
56
68
  entirely leaves whatever's already configured untouched — on a fresh
57
69
  machine that's direct, on one you've already switched that's whatever
58
70
  you last set — so a plain `trellis onboard` re-run never resets it. This
59
71
  is the only supported way to turn gateway or hub mode on or off; there's
60
72
  no reason to hand-edit `~/.trellis/mcp/servers.yaml`'s `hub`/`gateway`
61
73
  keys directly.
62
- 4. **The shared memory server** — off by default. Pass `--memory on` to add
74
+ 4. **Existing memory migration** — independent from the shared backend. Pass
75
+ `--memory-migrate on` to import supported native Markdown memory, or
76
+ `--memory-migrate off` to skip it. Unsupported Kimi/pi session stores are
77
+ reported and left untouched.
78
+ 5. **The shared memory server** — off by default. Pass `--memory on` to add
63
79
  the default `@modelcontextprotocol/server-memory` definition (refused if
64
80
  a host on this machine already injects a connector named `memory` — see
65
81
  [`trellis memory sync`](#trellis-memory-sync) below) or
@@ -134,6 +150,14 @@ a re-plan against canonical can. If a write somehow didn't hold (a
134
150
  filesystem permission problem, a race), it surfaces in the verdict as its
135
151
  own `blocked` item, separate from whatever the write's own stage reported.
136
152
 
153
+ Onboarding treats a mode change as a route transition, not a reset: canonical
154
+ Skills, MCP definitions, memories, and secrets policy stay in place. When an
155
+ interactive run changes mode, it shows the current mode, target mode, and
156
+ affected managed Agents before asking for confirmation. A blocking failure in
157
+ the transaction automatically restores canonical and native files together;
158
+ the backup remains available in `~/.trellis/backups/` for inspection or a
159
+ later explicit rollback.
160
+
137
161
  **The health scan is `trellis doctor` itself**, run at the end against
138
162
  every agent (not just the ones this run manages) — so a genuinely new
139
163
  problem this run happened to create or reveal shows up without a separate
@@ -151,6 +175,23 @@ happens. It never appears on stdout, so `trellis onboard > report.txt`
151
175
  still captures exactly the report and verdict, nothing else; it's silent
152
176
  entirely under `--json` or when stdout isn't a real terminal.
153
177
 
178
+ Interactive choices use a compact colored prompt UI with clear success,
179
+ warning, and blocking states. The prompt UI is written to stderr, while the
180
+ report and JSON output stay on stdout.
181
+
182
+ For repeatable item-level selection, pass a YAML/JSON file:
183
+
184
+ ```
185
+ $ trellis onboard --agent kiro --manage codex \
186
+ --selection ./schema/capability-selection.example.yaml
187
+ ```
188
+
189
+ The file can select individual `skills`, `mcp_servers`, and `memories`, plus
190
+ per-agent `mcp_routes` with `direct`, `gateway`, or `hub` mode. It can also
191
+ set `runtime_delivery` per agent to `native`, `mcp`, or `both`; omitted agents
192
+ remain native. Existing
193
+ `--mcp-mode` and category flags remain valid shortcuts.
194
+
154
195
  Add `--dry-run` to preview the entire chain — init/migrate/sync/mcp
155
196
  sync/memory sync, including what would be written to
156
197
  `~/.trellis/managed.yaml` and to `servers.yaml`'s mode/memory keys — with
@@ -174,9 +215,142 @@ The rest of this page is the same flow broken into its individual steps —
174
215
  useful if you want more control over any one part, or just want to
175
216
  understand what `onboard` did.
176
217
 
218
+ ## `trellis manage` — change the write boundary explicitly
219
+
220
+ The managed set is Trellis's hard outer authorization boundary. Use the
221
+ standalone lifecycle command when you need to inspect, replace, extend, or
222
+ narrow it without running migration or sync:
223
+
224
+ ```
225
+ trellis manage list
226
+ trellis manage set claude-code,pi --dry-run
227
+ trellis manage set claude-code,pi
228
+ trellis manage add codex
229
+ trellis manage remove kiro
230
+ trellis manage set none
231
+ ```
232
+
233
+ `set` is exact; `add` unions; `remove` subtracts. Every real change to
234
+ `managed.yaml` is recorded under `~/.trellis/backups/` and can be reversed by
235
+ `trellis rollback`. A dry run or no-op creates no backup.
236
+
237
+ Detaching only prevents future Trellis writes. It never deletes or rewrites
238
+ the detached agent's existing skills, instructions, MCP entries, extensions,
239
+ or login state. Cleanup, if desired, is a separate explicit decision.
240
+
241
+ This differs deliberately from `onboard --manage`: onboarding remains
242
+ additive so an omitted checkbox cannot silently revoke management.
243
+
244
+ ## Kimi Code Runtime-first
245
+
246
+ Kimi Code is supported as `kimi-code`. For Runtime-first delivery, configure
247
+ the capability selection with `runtime_delivery: { kimi-code: mcp }`, then
248
+ sync MCP and launch Kimi through Trellis:
249
+
250
+ ```
251
+ trellis manage add kimi-code --dry-run
252
+ trellis mcp sync --dry-run
253
+ trellis kimi -p "search the Trellis skills for the onboarding workflow"
254
+ ```
255
+
256
+ Runtime-only Kimi receives one `trellis` entry in
257
+ `~/.kimi-code/mcp.json`. `trellis kimi` passes an empty `--skills-dir` for
258
+ that mode, so Kimi does not also discover the shared `~/.agents/skills`
259
+ directory. The canonical SkillProvider and RuntimeMemoryProvider remain the
260
+ source of Skill/Memory content, while selected upstream MCP servers are
261
+ mounted through the same Runtime/Gateway edge.
262
+
263
+ Kimi's `deferred` MCP field is enabled on the owned Runtime entry to reduce
264
+ initial tool-list context when Kimi's experimental tool-select capability is
265
+ enabled. Runtime correctness does not depend on that optimization. Native
266
+ Kimi delivery remains available with `native` or `both`; those modes do not
267
+ use the empty Skill-root launcher.
268
+
269
+ ## ZCode Runtime-first
270
+
271
+ ZCode is supported as `zcode`. Trellis selects one native profile before it
272
+ writes anything: the official CLI/Desktop profile uses
273
+ `~/.zcode/cli/config.json`; the locally installed `zcode-app-cli` profile
274
+ uses `~/.zcode/cli/setting.json`. Both store servers under `mcp.servers`.
275
+
276
+ Selecting ZCode during `trellis onboard` defaults it to Runtime delivery.
277
+ `trellis sync` links shared instructions at `~/.zcode/AGENTS.md` and disables
278
+ native ZCode Skill discovery while Runtime-only delivery is active. This keeps
279
+ ZCode's automatic `~/.agents/skills` scan from bypassing canonical Skill
280
+ scope. `trellis mcp sync` writes the single owned `trellis` stdio entry;
281
+ Skill, Memory, and eligible upstream MCP servers are then served through
282
+ `trellis mcp-runtime --agent zcode`.
283
+
284
+ Native or `both` delivery remains available through a capability-selection
285
+ file. When leaving Runtime-only mode, Trellis restores ZCode's previous native
286
+ Skill settings only when they still equal the values it wrote. User edits and
287
+ unrelated ZCode MCP entries remain untouched.
288
+
289
+ For chat or Agent delegation, Trellis uses only a public `zcode` executable
290
+ that advertises `--prompt`, `--resume`, and `--output-format`. A desktop-only
291
+ profile can still receive managed configuration; Trellis never launches the
292
+ desktop application's private helper or bundled runtime path.
293
+
294
+ ## Trellis Runtime Skill
295
+
296
+ `trellis-runtime` is the built-in operating guide that Trellis installs into
297
+ the canonical source. It deliberately has two phases:
298
+
299
+ ### Phase 1: before takeover
300
+
301
+ Use it as a checklist for the operator-assisted migration flow:
302
+
303
+ 1. Run `trellis doctor` and `trellis onboard --dry-run` to inspect the current
304
+ machine without changing Agent files.
305
+ 2. Choose one migration source with `--agent` and an explicit managed boundary
306
+ with `--manage`. Migrating from an Agent does not automatically authorize
307
+ Trellis to write back to that Agent.
308
+ 3. Review the selected Skills, MCP servers, Memory, per-Agent routes, and
309
+ delivery mode. Use `--selection` when the choice must be repeatable.
310
+ 4. Apply only after reviewing the dry-run. `onboard` performs migration,
311
+ native/runtime sync, Memory sync, secrets audit, and health verification in
312
+ one transaction.
313
+ 5. Resolve OAuth interactively with `trellis mcp auth <server>`. Never place a
314
+ token in this Skill, `servers.yaml`, tests, or demonstration configuration.
315
+ 6. If the verdict blocks, follow its remediation. Do not delete an unknown
316
+ file or bypass ownership protection; every real write has a backup and can
317
+ be inspected with `trellis rollback --list`.
318
+
319
+ ### Phase 2: after takeover
320
+
321
+ The Agent consumes the same Skill regardless of its native adapter:
322
+
323
+ | Delivery | How the Skill is consumed |
324
+ | --- | --- |
325
+ | `native` | A Trellis-owned symlink points the Agent's native Skill root at the canonical Skill. |
326
+ | `mcp` | `SkillProvider` exposes the canonical Skill through the `trellis` Runtime; Kimi is launched with `trellis kimi` so its native Skill root does not duplicate the Runtime. |
327
+ | `both` | Native discovery and the Runtime are both available when a deliberate compatibility transition requires it. |
328
+
329
+ Once the Agent is running, start with the current Runtime status, then use
330
+ progressive disclosure:
331
+
332
+ 1. `runtime_status` — Agent identity, delivery mode, provider readiness, and
333
+ counts.
334
+ 2. `skills_search` → `skills_read` — locate and read only the Skill needed for
335
+ the current task.
336
+ 3. `memory_search` → `memory_read` — consume shared canonical Memory.
337
+ 4. `instructions_read` — inspect canonical global instructions when context is
338
+ needed.
339
+ 5. `mcp_status` — diagnose missing, unauthorized, or unavailable MCP servers
340
+ and show the user the supported remediation.
341
+ 6. `agents_list` and `tasks_list`/`tasks_read` — inspect the managed boundary
342
+ and handoff work. Mutating tasks requires explicit confirmation.
343
+
344
+ These are Trellis's portable names. A client may add a namespace such as
345
+ `mcp__trellis__skills_search`; never hardcode that client-generated prefix in a
346
+ Skill. The Runtime's built-in Skill and Memory providers are read-only. Shared
347
+ Memory writes come from the configured Memory MCP backend, and importing graph
348
+ content back into canonical Markdown remains an explicit
349
+ `trellis memory extract` operation.
350
+
177
351
  ## Two starting points
178
352
 
179
- **You already use one or more of Claude Code, Codex, Kiro, or pi** and have
353
+ **You already use one or more of Claude Code, Codex, Kiro, pi, Kimi Code, or ZCode** and have
180
354
  real skills/instructions in them today. Go to
181
355
  [Migrating from an existing agent](#migrating-from-an-existing-agent).
182
356
 
@@ -204,7 +378,7 @@ Creates `~/.trellis/` with:
204
378
  `~/.trellis/` that already exists just fills in whatever's still missing —
205
379
  safe to run again any time, including after you've hand-edited things.
206
380
 
207
- It then prints which of the four supported agents it found on this machine.
381
+ It then prints which of the six supported agents it found on this machine.
208
382
  For each one **not** found, it prints that agent's real install command or
209
383
  download link — `trellis init` never runs an installer itself; a global
210
384
  package install or an IDE download is your call to make, not a silent side
@@ -225,7 +399,7 @@ migrate --from claude-code
225
399
  [conflict] instructions — canonical agents.md already has different real content — resolve by hand
226
400
  ```
227
401
 
228
- `--from` accepts `claude-code`, `codex`, `kiro`, or `pi`. Run it once per
402
+ `--from` accepts `claude-code`, `codex`, `kiro`, `pi`, `kimi-code`, or `zcode`. Run it once per
229
403
  agent you actually use — it's independent per agent, order doesn't matter.
230
404
 
231
405
  Add `--dry-run` to see the plan without writing anything:
@@ -234,7 +408,7 @@ Add `--dry-run` to see the plan without writing anything:
234
408
  $ trellis migrate --from codex --dry-run
235
409
  ```
236
410
 
237
- Add `--only skills`, `--only instructions`, or `--only mcp` to migrate
411
+ Add `--only skills`, `--only instructions`, `--only mcp`, or `--only memory` to migrate
238
412
  just one category — useful when you only want part of it brought in
239
413
  right now. Omit it to migrate all three, exactly as above:
240
414
 
@@ -251,7 +425,7 @@ $ trellis migrate --from codex --only instructions
251
425
  | `conflict` | Canonical already has *different* real content — **left untouched**, resolve by hand. |
252
426
  | `skip-symlink` | That agent's own copy is itself a symlink (already shared in from elsewhere) — nothing of that agent's own to import. |
253
427
  | `skip-case-broken` | Found as `skill.md` instead of `SKILL.md` — fix the case on the source agent first. |
254
- | `skip-unsupported` | MCP servers only — that agent's real definition can't be safely represented (see below); nothing was written for it. |
428
+ | `skip-unsupported` | The source capability can't be safely represented (including native memory without a supported adapter); nothing was written for it. |
255
429
 
256
430
  Migrate never overwrites a genuine conflict, and never scopes a migrated
257
431
  skill (or MCP server) to just the source agent — once in canonical, it's
@@ -259,6 +433,31 @@ visible to every agent by default (see `sync`, below). If migrate reports
259
433
  a `conflict`, open the two files/entries it names and decide by hand
260
434
  which content should actually be canonical, then re-run.
261
435
 
436
+ Memory migration is deliberately separate from enabling the shared Memory
437
+ MCP:
438
+
439
+ ```text
440
+ trellis onboard --memory-migrate on --memory off
441
+ ```
442
+
443
+ The initial native-memory adapter supports Claude Code's exact current-
444
+ workspace Markdown memory directory. Kimi Code and pi session logs are
445
+ reported as unsupported and are not inspected. Imported files receive
446
+ deterministic names and provenance headers under `~/.trellis/memories/`; a
447
+ conflict is left untouched and the onboarding transaction can roll back the
448
+ import.
449
+
450
+ Codex is also supported when its documented local Memory directory contains
451
+ Markdown files:
452
+
453
+ ```text
454
+ trellis migrate --from codex --only memory --dry-run
455
+ ```
456
+
457
+ Trellis resolves `CODEX_HOME` when set, otherwise `~/.codex`, and reads only
458
+ the Memory directory. `AGENTS.md`, `session_index.jsonl`, sessions,
459
+ credentials, and plugin state are never treated as memory.
460
+
262
461
  **MCP servers** (claude-code, kiro, codex — not pi, which has no static
263
462
  MCP config to read at all) migrate the same way, into
264
463
  `~/.trellis/mcp/servers.yaml`:
@@ -373,15 +572,18 @@ to set up before moving on to `sync`.
373
572
  The same applies to MCP servers — `~/.trellis/mcp/servers.yaml` can be
374
573
  hand-authored the same way (see
375
574
  [`schema/servers.example.yaml`](../schema/servers.example.yaml) for the
376
- full shape), or use `trellis mcp add` (below). Either way, move on to
377
- [`trellis mcp sync`](#trellis-mcp-sync) once you've added what you want.
575
+ full shape), or use `trellis mcp add` (below) — the CLI command syncs
576
+ for you; hand-authored edits still need a following
577
+ [`trellis mcp sync`](#trellis-mcp-sync) of their own.
378
578
 
379
579
  ## `trellis skill` / `trellis mcp` — canonical CRUD via the CLI
380
580
 
381
581
  An alternative to hand-editing canonical files directly — useful for
382
582
  scripting, or when you'd rather not open a text editor for a one-line
383
- change. Both commands are canonical-side only: they never touch any
384
- agent's native config (that stays `sync`/`mcp sync`'s job).
583
+ change. `add`/`remove`/`import` mutate the canonical source and then run the
584
+ same sync `sync`/`mcp sync` performs, so one command both edits the list and
585
+ maps it onto the managed agents; `--dry-run` previews the whole thing,
586
+ including the sync plan, with zero writes. `list` is read-only.
385
587
 
386
588
  ```
387
589
  $ trellis skill list
@@ -402,6 +604,16 @@ then auto-removes the now-stale symlink on every agent that had it (skills
402
604
  carry their own ownership marker — the symlink itself — so this
403
605
  propagates automatically, unlike MCP servers below).
404
606
 
607
+ The package-owned Runtime Skill is refreshed explicitly with:
608
+
609
+ ```
610
+ trellis skill update-builtin --dry-run
611
+ trellis skill update-builtin
612
+ ```
613
+
614
+ The update is backed up and updates the canonical file in place; native Agent
615
+ symlinks and Runtime providers then consume the same refreshed content.
616
+
405
617
  ```
406
618
  $ trellis mcp list
407
619
  tanka (http) — codex, pi
@@ -417,16 +629,46 @@ removed MCP server "local-server" from canonical source.
417
629
 
418
630
  `mcp add` takes `--transport stdio|http|sse`; stdio requires `--command`
419
631
  (plus optional `--args a,b`, `--env NAME,...`, `--static-env k=v,...`),
420
- http/sse require `--url` (plus optional `--headers k=v,...`, values
632
+ http/sse require `--url` (plus optional `--auth oauth`, `--headers k=v,...`, values
421
633
  expected as `${VAR}` references, never literal secrets). Both accept
422
634
  `--agents id,...` (scope) and `--enabled true|false`. Same no-overwrite
423
635
  conflict posture as `skill add` — there is no `--force`.
424
636
 
425
- `mcp remove` is **canonical-only** — it does not remove the server from
426
- any agent that already has it from an earlier `mcp sync` (the same
427
- no-automatic-removal gap `mcp sync` itself has — see
428
- [README's Known limitations](../README.md#status)); remove it by hand on
429
- each agent in the meantime.
637
+ For a standard JSON export with a top-level `mcpServers` object, use the
638
+ credential-aware importer instead of repeating `mcp add` by hand:
639
+
640
+ ```
641
+ trellis mcp import ~/Desktop/mcp-servers.json --dry-run
642
+ trellis mcp import ~/Desktop/mcp-servers.json
643
+ ```
644
+
645
+ The source file is read-only. The importer de-duplicates semantically
646
+ identical servers, preserves existing canonical definitions, reports same-name
647
+ conflicts, and skips unavailable absolute paths. A recognized `mcp-remote`
648
+ Basic Authorization export is converted to native HTTP MCP; other credentials
649
+ embedded in command arguments, URLs, or headers are rejected. Credential-like values in an exported
650
+ `env` map are moved to the ignored local file
651
+ `~/.trellis/mcp/servers.local.env`; canonical stores only a prefixed variable
652
+ reference through `env_aliases`:
653
+
654
+ ```yaml
655
+ env_aliases:
656
+ SUPABASE_ACCESS_TOKEN: TRELLIS_SUPABASE_DB_SUPABASE_ACCESS_TOKEN
657
+ ```
658
+
659
+ The actual value is never printed in the plan, JSON report, canonical YAML, or
660
+ shell arguments. Re-importing is idempotent; an existing local secret with a
661
+ different value is a conflict and is never overwritten. OAuth sessions are not
662
+ imported — authorize the resulting remote MCP explicitly with
663
+ `trellis mcp auth <name>`.
664
+
665
+ Use `trellis mcp set <name> --auth oauth` to keep a known OAuth MCP direct
666
+ when its Agent uses gateway mode; use `--auth none` to clear the marker.
667
+ Trellis does not infer OAuth from a URL or an authentication failure.
668
+
669
+ `mcp remove` changes canonical state only. The next `trellis mcp sync` removes
670
+ the old native entry when the ownership ledger proves Trellis still owns it;
671
+ hand-edited native entries are preserved and reported as conflicts.
430
672
 
431
673
  `mcp list` never resolves or prints a secret value: `env` names are shown
432
674
  as bare names (the actual value is never read from your shell), and
@@ -485,10 +727,9 @@ known-host-injected collision avoidance, hub mode, and gateway mode
485
727
  $ trellis mcp sync
486
728
  ```
487
729
 
488
- Create/repair only — if you remove a server from `servers.yaml`, `mcp sync`
489
- does not remove it from any agent's native config yet (see
490
- [README's Known limitations](../README.md#status)). Remove it by hand on
491
- each agent in the meantime.
730
+ `mcp sync` also removes an entry deleted from canonical when the ownership
731
+ ledger proves the current native definition is exactly what Trellis last
732
+ wrote. Hand-edited entries are left untouched and reported as conflicts.
492
733
 
493
734
  Every native-config file this rewrites in place is snapshotted first,
494
735
  automatically — see
@@ -547,8 +788,14 @@ agent spawns it like any other stdio MCP server; it connects out to your
547
788
  servers, and exits when the session ends. There is nothing to start,
548
789
  stop, or monitor.
549
790
 
550
- Your servers' tools appear to the agent as `<server>__<tool>` — the
551
- `gitlab` server's `search` becomes `gitlab__search`.
791
+ Long unambiguous upstream tools stay compact. Generic short names such as
792
+ `search` receive source context even when unique; if both GitHub and GitLab
793
+ expose `search`, they become `github__search` and `gitlab__search`. A tool that
794
+ already contains its source prefix is not repeated. Agent-facing names are
795
+ normalized to `[A-Za-z0-9_-]` and
796
+ bounded to 64 characters; long names receive a deterministic hash suffix.
797
+ Extremely rare normalized-name collisions receive a deterministic suffix
798
+ rather than being dropped, while calls still route to the original MCP name.
552
799
 
553
800
  Add `agents: [claude-code, codex]` under `gateway:` to narrow it, leaving
554
801
  the rest in direct mode. Gateway mode and `hub` are independent; both can
@@ -557,12 +804,14 @@ be set, and gateway wins for any agent it covers.
557
804
  Two things stop being problems in gateway mode. Codex can normally only
558
805
  express a single `Authorization: Bearer ${VAR}` header, so a server
559
806
  needing more than one was refused for Codex — in gateway mode Codex never
560
- sees any server's headers, so it just works. And remote servers requiring
561
- real OAuth become reachable from every agent, including pi.
807
+ sees any ordinary server's headers, so it just works. OAuth-marked servers
808
+ stay direct while ordinary remote servers remain shared through the gateway.
562
809
 
563
810
  ### `trellis mcp auth <server-name>`
564
811
 
565
- For a remote (`http`/`sse`) server that uses OAuth, authorize it once:
812
+ For a remote (`http`/`sse`) server marked `auth: oauth`, native Agents should
813
+ use their own login command. Pi's direct bridge path can be authorized once
814
+ through Trellis:
566
815
 
567
816
  ```
568
817
  $ trellis mcp auth notion-remote
@@ -574,15 +823,22 @@ This opens your browser, completes the flow, and stores the result 0600
574
823
  under `~/.trellis/mcp/oauth/` — never in `servers.yaml`, so canonical
575
824
  stays safe to read, diff, and commit.
576
825
 
577
- Run it once per server. After that the gateway refreshes the token
578
- silently whenever it expires; it never opens a browser and never prompts,
579
- because it is spawned by an agent with no terminal attached. Re-running
826
+ Run it once per server when Pi's direct bridge owns the OAuth connection.
827
+ After that the bridge refreshes the token silently whenever it expires; it
828
+ never opens a browser and never prompts, because it is spawned by an agent
829
+ with no terminal attached. Re-running
580
830
  this command when the stored token is still valid does nothing (`--force`
581
831
  overrides); when it has expired but is renewable, it refreshes without a
582
832
  browser.
583
833
 
584
- If a server has no stored credential, the gateway skips that one server
585
- and keeps serving every other — it does not fail to start.
834
+ If a Pi direct OAuth server has no stored credential, the bridge skips that
835
+ one server and keeps serving every other — it does not fail to start. Native
836
+ Agents report the same direct entry as requiring their own authorization.
837
+
838
+ An Agent can call the read-only `trellis.mcp.status` Runtime tool to explain
839
+ this partial state to the user. It reports unavailable or authorization-
840
+ required servers and gives the next safe action, such as `trellis mcp auth
841
+ figma`, without exposing tokens or opening a browser from the Agent process.
586
842
 
587
843
  This command only applies to `http`/`sse` servers. stdio servers get
588
844
  their credentials from `env`/`env_aliases` as described above; running
@@ -590,6 +846,17 @@ their credentials from `env`/`env_aliases` as described above; running
590
846
 
591
847
  ## `trellis memory sync`
592
848
 
849
+ Canonical memories can also be consumed directly through the Trellis MCP
850
+ Runtime when an agent's runtime delivery is `mcp` or `both`. Runtime exposes
851
+ read-only `trellis.memory.search` and `trellis.memory.read` tools plus
852
+ `trellis://memories/<name>.md` resources. Results are filtered through the
853
+ memory's `scope.yaml` entry and the managed-agent boundary on every request.
854
+
855
+ This Runtime path reads `~/.trellis/memories/*.md` directly. It does not need
856
+ the separate `memory` MCP server below, and it does not expose write/delete
857
+ tools. `memory sync` remains the bridge from canonical Markdown into the
858
+ mutable shared graph used by `@modelcontextprotocol/server-memory`.
859
+
593
860
  Ingests `~/.trellis/memories/*.md` into the actual on-disk file
594
861
  `@modelcontextprotocol/server-memory` reads at its own startup — closing
595
862
  the gap between "memory entries exist in canonical" and "the running
@@ -651,6 +918,24 @@ entities' names would slug to the same filename. Not wired into
651
918
  deliberate, occasional action you run, the same posture `migrate` already
652
919
  has.
653
920
 
921
+ For a shared Kimi Code + pi setup, enable the backend through onboarding
922
+ instead of editing either Agent's config by hand:
923
+
924
+ ```text
925
+ trellis onboard --memory on --mcp-mode gateway --manage pi,kimi-code
926
+ ```
927
+
928
+ This writes one canonical `memory` server, syncs the Gateway route to both
929
+ Agents, and runs `memory sync` in the same transaction. Runtime status reports
930
+ `backendConfigured`, `graphReady`, `canonicalCount`, write authority, and the
931
+ managed Agents receiving the shared route. It distinguishes an unconfigured
932
+ backend from an empty but writable graph.
933
+
934
+ Agent-created graph content is external Memory context. It is not imported
935
+ back into canonical automatically; run `trellis memory extract` explicitly
936
+ when you want durable, reviewable Markdown. Native/private Agent memory
937
+ stores are not scraped or guessed.
938
+
654
939
  **Note:** this is unrelated to any project-level "auto memory" feature an
655
940
  agent may have of its own (e.g. Claude Code's own per-project memory
656
941
  files) — those are a different, agent-specific mechanism entirely, not
@@ -682,7 +967,7 @@ periodically regardless.
682
967
  $ trellis doctor
683
968
  ```
684
969
 
685
- Read-only. Scans all four agents' current state and reports drift —
970
+ Read-only. Scans all six agents' current state and reports drift —
686
971
  mismatched skill content across agents, wrong-case skill files, and (with
687
972
  `--probe-mcp`) whether each configured MCP server actually handshakes.
688
973
  Safe to run any time; nothing here writes anything.
@@ -691,6 +976,42 @@ Safe to run any time; nothing here writes anything.
691
976
  stdio MCP server (some reaching real external services) — not something a
692
977
  "just check my config" command should do by default.
693
978
 
979
+ ## 在 Linux sandbox 中验证真实 agent
980
+
981
+ Trellis 提供一个独立的 agent image,用于安装真实的 Codex、Claude Code、
982
+ Kiro CLI 和 pi,而不是只使用 fake CLI。它使用 `runtime-home` 作为只读
983
+ fixture,并把内容复制到容器内的隔离 `$HOME`;不会挂载宿主机的 agent
984
+ 目录或登录态:
985
+
986
+ ```
987
+ scripts/agent-sandbox.sh
988
+ ```
989
+
990
+ 未登录时,Codex 和 Claude Code 可以验证自己是否识别 Trellis 写入的
991
+ `trellis` MCP entry;Kiro CLI 会在 `mcp list` 前要求登录,这
992
+ 是 Kiro 的真实授权边界。
993
+
994
+ 如需实际授权,使用单独的 Docker volume 保存 sandbox 登录态:
995
+
996
+ ```
997
+ scripts/agent-sandbox.sh --login codex
998
+ scripts/agent-sandbox.sh --login claude
999
+ scripts/agent-sandbox.sh --login kiro
1000
+ ```
1001
+
1002
+ 登录过程在终端中显示设备授权或浏览器流程。登录完成后,可以检查:
1003
+
1004
+ ```
1005
+ scripts/agent-sandbox.sh --status codex
1006
+ scripts/agent-sandbox.sh --status claude
1007
+ scripts/agent-sandbox.sh --status kiro
1008
+ ```
1009
+
1010
+ 默认 volume 名称为 `trellis-agent-auth-home`,可通过
1011
+ `TRELLIS_AGENT_AUTH_VOLUME` 覆盖。它只保存在 OrbStack/Docker 中,不进
1012
+ Git,也不会自动读取或删除宿主机凭据。清理时请明确执行
1013
+ `docker volume rm <volume-name>`。
1014
+
694
1015
  ## `trellis rollback` — undoing a `sync`/`mcp sync`/`onboard` run
695
1016
 
696
1017
  Every real write those three commands perform is recorded, before it
@@ -735,6 +1056,127 @@ created file under `~/.trellis/skills/`.
735
1056
  `~/.trellis/backups/` has no automatic pruning — delete old run
736
1057
  directories by hand once you're done with them.
737
1058
 
1059
+ ## GUI: chat with a managed/CLI Agent (`@trellis/gui`)
1060
+
1061
+ The desktop app (`packages/gui/`) has a "Chat" tab for a real multi-turn
1062
+ conversation with any CLI Agent you configure, streamed live with a
1063
+ typewriter effect and tool-call/tool-result bubbles when the target
1064
+ supports it. This is separate from `agent-bridge.yaml` (used for one-shot
1065
+ cross-Agent delegation via MCP tools): a chat target is identified by an
1066
+ arbitrary string, not one of the five fully-managed Agents, so you can
1067
+ point it at any non-interactive CLI without onboarding it as a full
1068
+ managed Agent.
1069
+
1070
+ Configure targets in `~/.trellis/mcp/chat-agents.yaml` (absent by
1071
+ default — nothing is spawned until you write one):
1072
+
1073
+ ```yaml
1074
+ targets:
1075
+ claude-code:
1076
+ label: "Claude Code"
1077
+ command: claude
1078
+ args: ["-p", "{prompt}", "--output-format", "stream-json"]
1079
+ outputFormat: stream-json
1080
+ qoder:
1081
+ label: "Qoder"
1082
+ command: qoder
1083
+ args: ["-p", "{prompt}", "--output-format", "stream-json"]
1084
+ resumeArgs: ["-p", "{prompt}", "--output-format", "stream-json", "--session-id", "{sessionId}"]
1085
+ outputFormat: stream-json
1086
+ tags: ["domestic"]
1087
+ kimi-code:
1088
+ label: "Kimi Code"
1089
+ command: kimi
1090
+ args: ["-p", "{prompt}", "--output-format", "stream-json"]
1091
+ resumeArgs: ["-p", "{prompt}", "--output-format", "stream-json", "-S", "{sessionId}"]
1092
+ outputFormat: stream-json
1093
+ tags: ["domestic"]
1094
+ minimax-code:
1095
+ label: "MiniMax Code"
1096
+ command: mcode
1097
+ args: ["exec", "{prompt}", "--output-format", "stream-json"]
1098
+ resumeArgs: ["exec", "{prompt}", "--output-format", "stream-json", "--session", "{sessionId}"]
1099
+ outputFormat: stream-json
1100
+ tags: ["domestic"]
1101
+ zcode:
1102
+ label: "ZCode"
1103
+ command: zcode
1104
+ args: ["--prompt", "{prompt}", "--output-format", "stream-json"]
1105
+ resumeArgs: ["--resume", "{sessionId}", "--prompt", "{prompt}", "--output-format", "stream-json"]
1106
+ outputFormat: stream-json
1107
+ streamProtocol: zcode
1108
+ tags: ["z-ai"]
1109
+ ```
1110
+
1111
+ - `outputFormat: stream-json` gets structured tool-call/tool-result
1112
+ bubbles, but only for Claude Code's documented shape (there's no
1113
+ official schema for it — see upstream issue #24612 — so this is a
1114
+ best-effort parse of the community-documented format; other CLIs using
1115
+ the same flag name show their raw output instead of guessing at a
1116
+ format that hasn't been verified against a real install).
1117
+ - Every message requires confirming a one-time-per-session banner showing
1118
+ the exact command that will run — it spawns a real subprocess, possibly
1119
+ a real billed API call.
1120
+ - Chat history is **never written to disk** — it may contain real code or
1121
+ secrets. Closing the app loses it, on purpose.
1122
+
1123
+ ### Domestic CLI status (what's real, what isn't)
1124
+
1125
+ - **Qoder**: installed for real (`npm install -g @qoder-ai/qodercli`) and
1126
+ checked directly against `qoder --help` — `-p`/`--print`, `-o`/
1127
+ `--output-format text|json|stream-json`, and `--session-id <id>` (resume)
1128
+ all confirmed as real flags. Ran `qoder -p "test" -o stream-json` for
1129
+ real, unauthenticated (`qoder status` → "Not logged in"), which failed
1130
+ cleanly and immediately on the auth check (`total_cost_usd: 0`, zero
1131
+ real spend) — and its `stream-json` output turned out to already match
1132
+ Claude Code's documented shape line-for-line (`{"type":"system",
1133
+ "subtype":"init",...}` → `{"type":"assistant","message":{"content":
1134
+ [{"type":"text",...}]}}` → `{"type":"result","subtype":"success",...}`),
1135
+ so this app's existing `tryParseClaudeStreamJsonLine` parser produces
1136
+ real tool-call/tool-result bubbles for Qoder too, not just raw text —
1137
+ confirmed for the `init`/text/`result` shapes; the `tool_use`/
1138
+ `tool_result` shapes specifically weren't independently observed (the
1139
+ call never got far enough to use a tool before failing on auth). The
1140
+ `--session-id` resume combination itself (an actual resumed call) was
1141
+ not exercised — that needs a real logged-in account.
1142
+ - **Kimi Code**: `-p`/`--prompt`, `--output-format text|stream-json`, and
1143
+ `-S`/`--session [id]` are confirmed directly from a real, installed
1144
+ `kimi --help` on the machine this was built on. The `-p` + `-S`
1145
+ combination for resuming a session non-interactively is documented as
1146
+ separate top-level flags but wasn't exercised against a real resumed
1147
+ call (that would be a real, billed API call, and this install has a
1148
+ live authenticated session — `kimi provider list` shows a real
1149
+ `managed:kimi-code` OAuth provider) — verify once before relying on it
1150
+ for anything important.
1151
+ - **MiniMax Code** (`mcode`): installed for real (`npm install -g
1152
+ @minimax-ai/code`) and checked directly against `mcode exec --help`,
1153
+ which — unlike what first-party prose docs implied — does document
1154
+ both `--output-format text|json|stream-json` and a `--session <id>`
1155
+ resume flag (distinct spelling from Qoder's `--session-id`) as real
1156
+ `exec` options. Ran `mcode exec "test" --output-format stream-json` for
1157
+ real, unauthenticated (no `~/.minimax-code` config exists on this
1158
+ machine), which failed cleanly with a plain-text "Sign in to MiniMax…"
1159
+ message before entering the agent loop — so unlike Qoder, no real
1160
+ `stream-json` line was ever actually observed for MiniMax Code; if its
1161
+ JSON shape turns out to differ from Claude Code's, lines simply
1162
+ degrade to the raw-chunk fallback rather than breaking anything, but
1163
+ treat the *existence* of the flags as confirmed and their *exact wire
1164
+ shape* as still unconfirmed. The `--session` resume combination was
1165
+ not exercised for the same reason as Qoder's.
1166
+ - **ZCode** (Z.ai / 智谱, `zcode`) is supported when its public CLI probe
1167
+ confirms `--prompt`, `--resume`, and `--output-format`. Its stream result
1168
+ uses `response` and `sessionId`, so configure `streamProtocol: zcode` as
1169
+ shown above. The installed `zcode-app-cli` is a community distribution over
1170
+ the ZCode runtime; it uses `~/.zcode/cli/setting.json`. The official
1171
+ open-source CLI/Desktop profile uses `~/.zcode/cli/config.json`. A
1172
+ desktop-only profile is configuration-manageable but is not offered as a
1173
+ chat or delegation executor.
1174
+ - **Trae is not supported yet.** The commercial Trae IDE (trae.ai) has no
1175
+ documented non-interactive CLI mode; the separate open-source
1176
+ `bytedance/trae-agent` project's `trae-cli run` streaming output format
1177
+ has not been verified against a real install. Neither is configured —
1178
+ don't add a `trae` target expecting it to work.
1179
+
738
1180
  ## Troubleshooting
739
1181
 
740
1182
  - **A `conflict` I don't understand**: `migrate` and `sync` both name the
@@ -745,6 +1187,18 @@ directories by hand once you're done with them.
745
1187
  the same real config files/directories `init`/`migrate`/`sync` do; if an
746
1188
  agent's config lives somewhere non-standard on your machine, that's worth
747
1189
  filing an issue with the exact path.
748
- - Other known limitations are tracked honestly in
749
- [README's Status section](../README.md#status) — read that before
750
- assuming something is a bug rather than a documented gap.
1190
+ - Other known limitations, named honestly rather than discovered the hard way:
1191
+ - `mcp sync`/`sync` never spawn or handshake-test MCP servers — they only
1192
+ guarantee the *config* is written correctly. `trellis doctor --probe-mcp`
1193
+ is the one command that actually connects, and it's opt-in.
1194
+ - The pi bridge extension (`trellis-pi-mcp-bridge`) is verified to load and
1195
+ register tools without erroring, not against a real LLM tool call in
1196
+ production.
1197
+ - Verification runs in isolated Docker containers with real agent installs,
1198
+ not against a developer's daily-use dotfiles — if you hit something a
1199
+ clean-room sandbox wouldn't catch, please open an issue.
1200
+ - `onboard` picks one agent as the migration base when several are present;
1201
+ merging differing content across multiple agents into one result is
1202
+ future work, not built yet.
1203
+ - `~/.trellis/backups/` has no automatic pruning — every write adds a run
1204
+ directory; delete old ones by hand.