pllan 2026.3.44 → 2026.3.45

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 (758) hide show
  1. package/docs/assets/pllan-banner-dark.svg +7 -0
  2. package/docs/assets/pllan-banner-light.svg +7 -0
  3. package/docs/assets/pllan-favicon.svg +1 -0
  4. package/docs/assets/pllan-logo-dark.svg +3 -0
  5. package/docs/assets/pllan-logo.svg +3 -0
  6. package/docs/automation/cron-vs-heartbeat.md +10 -10
  7. package/docs/cli/agents.md +3 -3
  8. package/docs/cli/index.md +2 -2
  9. package/docs/concepts/agent.md +1 -1
  10. package/docs/concepts/features.md +1 -1
  11. package/docs/docs.json +1491 -56
  12. package/docs/gateway/configuration-examples.md +1 -1
  13. package/docs/gateway/configuration-reference.md +1 -1
  14. package/docs/index.md +8 -24
  15. package/docs/ja-JP/index.md +2 -4
  16. package/docs/nb/auth-credential-semantics.md +53 -0
  17. package/docs/nb/automation/auth-monitoring.md +44 -0
  18. package/docs/nb/automation/cron-jobs.md +727 -0
  19. package/docs/nb/automation/cron-vs-heartbeat.md +286 -0
  20. package/docs/nb/automation/gmail-pubsub.md +256 -0
  21. package/docs/nb/automation/hooks.md +1049 -0
  22. package/docs/nb/automation/poll.md +86 -0
  23. package/docs/nb/automation/troubleshooting.md +122 -0
  24. package/docs/nb/automation/webhook.md +217 -0
  25. package/docs/nb/brave-search.md +93 -0
  26. package/docs/nb/channels/bluebubbles.md +347 -0
  27. package/docs/nb/channels/broadcast-groups.md +442 -0
  28. package/docs/nb/channels/channel-routing.md +139 -0
  29. package/docs/nb/channels/discord.md +1229 -0
  30. package/docs/nb/channels/feishu.md +747 -0
  31. package/docs/nb/channels/googlechat.md +261 -0
  32. package/docs/nb/channels/group-messages.md +84 -0
  33. package/docs/nb/channels/groups.md +379 -0
  34. package/docs/nb/channels/imessage.md +367 -0
  35. package/docs/nb/channels/index.md +47 -0
  36. package/docs/nb/channels/irc.md +242 -0
  37. package/docs/nb/channels/line.md +193 -0
  38. package/docs/nb/channels/location.md +56 -0
  39. package/docs/nb/channels/matrix.md +677 -0
  40. package/docs/nb/channels/mattermost.md +427 -0
  41. package/docs/nb/channels/msteams.md +780 -0
  42. package/docs/nb/channels/nextcloud-talk.md +138 -0
  43. package/docs/nb/channels/nostr.md +242 -0
  44. package/docs/nb/channels/pairing.md +114 -0
  45. package/docs/nb/channels/signal.md +329 -0
  46. package/docs/nb/channels/slack.md +603 -0
  47. package/docs/nb/channels/synology-chat.md +132 -0
  48. package/docs/nb/channels/telegram.md +987 -0
  49. package/docs/nb/channels/tlon.md +276 -0
  50. package/docs/nb/channels/troubleshooting.md +118 -0
  51. package/docs/nb/channels/twitch.md +379 -0
  52. package/docs/nb/channels/whatsapp.md +460 -0
  53. package/docs/nb/channels/zalo.md +243 -0
  54. package/docs/nb/channels/zalouser.md +181 -0
  55. package/docs/nb/ci.md +55 -0
  56. package/docs/nb/cli/acp.md +288 -0
  57. package/docs/nb/cli/agent.md +29 -0
  58. package/docs/nb/cli/agents.md +123 -0
  59. package/docs/nb/cli/approvals.md +50 -0
  60. package/docs/nb/cli/backup.md +76 -0
  61. package/docs/nb/cli/browser.md +106 -0
  62. package/docs/nb/cli/channels.md +102 -0
  63. package/docs/nb/cli/clawbot.md +21 -0
  64. package/docs/nb/cli/completion.md +35 -0
  65. package/docs/nb/cli/config.md +295 -0
  66. package/docs/nb/cli/configure.md +36 -0
  67. package/docs/nb/cli/cron.md +77 -0
  68. package/docs/nb/cli/daemon.md +53 -0
  69. package/docs/nb/cli/dashboard.md +22 -0
  70. package/docs/nb/cli/devices.md +139 -0
  71. package/docs/nb/cli/directory.md +63 -0
  72. package/docs/nb/cli/dns.md +23 -0
  73. package/docs/nb/cli/docs.md +15 -0
  74. package/docs/nb/cli/doctor.md +48 -0
  75. package/docs/nb/cli/gateway.md +235 -0
  76. package/docs/nb/cli/health.md +21 -0
  77. package/docs/nb/cli/hooks.md +318 -0
  78. package/docs/nb/cli/index.md +1147 -0
  79. package/docs/nb/cli/logs.md +28 -0
  80. package/docs/nb/cli/memory.md +66 -0
  81. package/docs/nb/cli/message.md +278 -0
  82. package/docs/nb/cli/models.md +81 -0
  83. package/docs/nb/cli/node.md +127 -0
  84. package/docs/nb/cli/nodes.md +75 -0
  85. package/docs/nb/cli/onboard.md +157 -0
  86. package/docs/nb/cli/pairing.md +32 -0
  87. package/docs/nb/cli/plugins.md +186 -0
  88. package/docs/nb/cli/qr.md +46 -0
  89. package/docs/nb/cli/reset.md +20 -0
  90. package/docs/nb/cli/sandbox.md +197 -0
  91. package/docs/nb/cli/secrets.md +188 -0
  92. package/docs/nb/cli/security.md +79 -0
  93. package/docs/nb/cli/sessions.md +110 -0
  94. package/docs/nb/cli/setup.md +29 -0
  95. package/docs/nb/cli/skills.md +26 -0
  96. package/docs/nb/cli/status.md +30 -0
  97. package/docs/nb/cli/system.md +60 -0
  98. package/docs/nb/cli/tui.md +30 -0
  99. package/docs/nb/cli/uninstall.md +20 -0
  100. package/docs/nb/cli/update.md +103 -0
  101. package/docs/nb/cli/voicecall.md +34 -0
  102. package/docs/nb/cli/webhooks.md +25 -0
  103. package/docs/nb/concepts/agent-loop.md +148 -0
  104. package/docs/nb/concepts/agent-workspace.md +236 -0
  105. package/docs/nb/concepts/agent.md +122 -0
  106. package/docs/nb/concepts/architecture.md +128 -0
  107. package/docs/nb/concepts/compaction.md +123 -0
  108. package/docs/nb/concepts/context-engine.md +268 -0
  109. package/docs/nb/concepts/context.md +172 -0
  110. package/docs/nb/concepts/features.md +73 -0
  111. package/docs/nb/concepts/markdown-formatting.md +130 -0
  112. package/docs/nb/concepts/memory.md +108 -0
  113. package/docs/nb/concepts/messages.md +154 -0
  114. package/docs/nb/concepts/model-failover.md +152 -0
  115. package/docs/nb/concepts/model-providers.md +607 -0
  116. package/docs/nb/concepts/models.md +225 -0
  117. package/docs/nb/concepts/multi-agent.md +552 -0
  118. package/docs/nb/concepts/oauth.md +158 -0
  119. package/docs/nb/concepts/presence.md +102 -0
  120. package/docs/nb/concepts/queue.md +89 -0
  121. package/docs/nb/concepts/retry.md +69 -0
  122. package/docs/nb/concepts/session-pruning.md +121 -0
  123. package/docs/nb/concepts/session-tool.md +242 -0
  124. package/docs/nb/concepts/session.md +310 -0
  125. package/docs/nb/concepts/streaming.md +155 -0
  126. package/docs/nb/concepts/system-prompt.md +132 -0
  127. package/docs/nb/concepts/timezone.md +91 -0
  128. package/docs/nb/concepts/typebox.md +291 -0
  129. package/docs/nb/concepts/typing-indicators.md +68 -0
  130. package/docs/nb/concepts/usage-tracking.md +35 -0
  131. package/docs/nb/date-time.md +128 -0
  132. package/docs/nb/debug/node-issue.md +85 -0
  133. package/docs/nb/diagnostics/flags.md +91 -0
  134. package/docs/nb/gateway/authentication.md +179 -0
  135. package/docs/nb/gateway/background-process.md +97 -0
  136. package/docs/nb/gateway/bonjour.md +177 -0
  137. package/docs/nb/gateway/bridge-protocol.md +91 -0
  138. package/docs/nb/gateway/cli-backends.md +225 -0
  139. package/docs/nb/gateway/configuration-examples.md +637 -0
  140. package/docs/nb/gateway/configuration-reference.md +3117 -0
  141. package/docs/nb/gateway/configuration.md +633 -0
  142. package/docs/nb/gateway/discovery.md +123 -0
  143. package/docs/nb/gateway/doctor.md +362 -0
  144. package/docs/nb/gateway/gateway-lock.md +34 -0
  145. package/docs/nb/gateway/health.md +44 -0
  146. package/docs/nb/gateway/heartbeat.md +393 -0
  147. package/docs/nb/gateway/index.md +218 -0
  148. package/docs/nb/gateway/local-models.md +152 -0
  149. package/docs/nb/gateway/logging.md +113 -0
  150. package/docs/nb/gateway/multiple-gateways.md +112 -0
  151. package/docs/nb/gateway/network-model.md +22 -0
  152. package/docs/nb/gateway/openai-http-api.md +132 -0
  153. package/docs/nb/gateway/openresponses-http-api.md +295 -0
  154. package/docs/nb/gateway/openshell.md +307 -0
  155. package/docs/nb/gateway/pairing.md +99 -0
  156. package/docs/nb/gateway/protocol.md +267 -0
  157. package/docs/nb/gateway/remote-gateway-readme.md +158 -0
  158. package/docs/nb/gateway/remote.md +153 -0
  159. package/docs/nb/gateway/sandbox-vs-tool-policy-vs-elevated.md +134 -0
  160. package/docs/nb/gateway/sandboxing.md +469 -0
  161. package/docs/nb/gateway/secrets-plan-contract.md +116 -0
  162. package/docs/nb/gateway/secrets.md +503 -0
  163. package/docs/nb/gateway/security/index.md +1213 -0
  164. package/docs/nb/gateway/tailscale.md +132 -0
  165. package/docs/nb/gateway/tools-invoke-http-api.md +110 -0
  166. package/docs/nb/gateway/troubleshooting.md +378 -0
  167. package/docs/nb/gateway/trusted-proxy-auth.md +330 -0
  168. package/docs/nb/help/debugging.md +168 -0
  169. package/docs/nb/help/environment.md +140 -0
  170. package/docs/nb/help/faq.md +89 -0
  171. package/docs/nb/help/index.md +28 -0
  172. package/docs/nb/help/scripts.md +28 -0
  173. package/docs/nb/help/testing.md +524 -0
  174. package/docs/nb/help/troubleshooting.md +187 -0
  175. package/docs/nb/index.md +180 -0
  176. package/docs/nb/install/ansible.md +84 -0
  177. package/docs/nb/install/azure.md +122 -0
  178. package/docs/nb/install/bun.md +52 -0
  179. package/docs/nb/install/development-channels.md +51 -0
  180. package/docs/nb/install/digitalocean.md +95 -0
  181. package/docs/nb/install/docker-vm-runtime.md +50 -0
  182. package/docs/nb/install/docker.md +375 -0
  183. package/docs/nb/install/exe-dev.md +65 -0
  184. package/docs/nb/install/fly.md +316 -0
  185. package/docs/nb/install/gcp.md +111 -0
  186. package/docs/nb/install/hetzner.md +128 -0
  187. package/docs/nb/install/index.md +183 -0
  188. package/docs/nb/install/installer.md +96 -0
  189. package/docs/nb/install/kubernetes.md +191 -0
  190. package/docs/nb/install/macos-vm.md +111 -0
  191. package/docs/nb/install/migrating-matrix.md +73 -0
  192. package/docs/nb/install/migrating.md +94 -0
  193. package/docs/nb/install/nix.md +71 -0
  194. package/docs/nb/install/node.md +138 -0
  195. package/docs/nb/install/oracle.md +146 -0
  196. package/docs/nb/install/podman.md +114 -0
  197. package/docs/nb/install/raspberry-pi.md +159 -0
  198. package/docs/nb/install/reinstall.md +88 -0
  199. package/docs/nb/install/uninstall.md +126 -0
  200. package/docs/nb/install/updating.md +123 -0
  201. package/docs/nb/logging.md +352 -0
  202. package/docs/nb/network.md +54 -0
  203. package/docs/nb/nodes/audio.md +187 -0
  204. package/docs/nb/nodes/camera.md +162 -0
  205. package/docs/nb/nodes/images.md +72 -0
  206. package/docs/nb/nodes/index.md +393 -0
  207. package/docs/nb/nodes/location-command.md +98 -0
  208. package/docs/nb/nodes/media-understanding.md +394 -0
  209. package/docs/nb/nodes/talk.md +92 -0
  210. package/docs/nb/nodes/troubleshooting.md +114 -0
  211. package/docs/nb/nodes/voicewake.md +66 -0
  212. package/docs/nb/perplexity.md +174 -0
  213. package/docs/nb/pi-dev.md +80 -0
  214. package/docs/nb/pi.md +567 -0
  215. package/docs/nb/platforms/android.md +168 -0
  216. package/docs/nb/platforms/digitalocean.md +266 -0
  217. package/docs/nb/platforms/index.md +54 -0
  218. package/docs/nb/platforms/ios.md +220 -0
  219. package/docs/nb/platforms/linux.md +94 -0
  220. package/docs/nb/platforms/mac/bundled-gateway.md +73 -0
  221. package/docs/nb/platforms/mac/canvas.md +125 -0
  222. package/docs/nb/platforms/mac/child-process.md +69 -0
  223. package/docs/nb/platforms/mac/dev-setup.md +104 -0
  224. package/docs/nb/platforms/mac/health.md +34 -0
  225. package/docs/nb/platforms/mac/icon.md +31 -0
  226. package/docs/nb/platforms/mac/logging.md +57 -0
  227. package/docs/nb/platforms/mac/menu-bar.md +81 -0
  228. package/docs/nb/platforms/mac/peekaboo.md +65 -0
  229. package/docs/nb/platforms/mac/permissions.md +50 -0
  230. package/docs/nb/platforms/mac/remote.md +84 -0
  231. package/docs/nb/platforms/mac/signing.md +47 -0
  232. package/docs/nb/platforms/mac/skills.md +33 -0
  233. package/docs/nb/platforms/mac/voice-overlay.md +60 -0
  234. package/docs/nb/platforms/mac/voicewake.md +67 -0
  235. package/docs/nb/platforms/mac/webchat.md +43 -0
  236. package/docs/nb/platforms/mac/xpc.md +61 -0
  237. package/docs/nb/platforms/macos.md +226 -0
  238. package/docs/nb/platforms/oracle.md +303 -0
  239. package/docs/nb/platforms/raspberry-pi.md +412 -0
  240. package/docs/nb/platforms/windows.md +241 -0
  241. package/docs/nb/plugins/agent-tools.md +99 -0
  242. package/docs/nb/plugins/architecture.md +1349 -0
  243. package/docs/nb/plugins/building-extensions.md +205 -0
  244. package/docs/nb/plugins/bundles.md +307 -0
  245. package/docs/nb/plugins/community.md +60 -0
  246. package/docs/nb/plugins/manifest.md +145 -0
  247. package/docs/nb/plugins/voice-call.md +350 -0
  248. package/docs/nb/plugins/zalouser.md +77 -0
  249. package/docs/nb/prose.md +134 -0
  250. package/docs/nb/providers/anthropic.md +259 -0
  251. package/docs/nb/providers/bedrock.md +176 -0
  252. package/docs/nb/providers/claude-max-api-proxy.md +154 -0
  253. package/docs/nb/providers/cloudflare-ai-gateway.md +71 -0
  254. package/docs/nb/providers/deepgram.md +93 -0
  255. package/docs/nb/providers/github-copilot.md +72 -0
  256. package/docs/nb/providers/glm.md +43 -0
  257. package/docs/nb/providers/google.md +78 -0
  258. package/docs/nb/providers/groq.md +96 -0
  259. package/docs/nb/providers/huggingface.md +209 -0
  260. package/docs/nb/providers/index.md +69 -0
  261. package/docs/nb/providers/kilocode.md +74 -0
  262. package/docs/nb/providers/litellm.md +154 -0
  263. package/docs/nb/providers/minimax.md +224 -0
  264. package/docs/nb/providers/mistral.md +54 -0
  265. package/docs/nb/providers/models.md +45 -0
  266. package/docs/nb/providers/modelstudio.md +66 -0
  267. package/docs/nb/providers/moonshot.md +175 -0
  268. package/docs/nb/providers/nvidia.md +55 -0
  269. package/docs/nb/providers/ollama.md +352 -0
  270. package/docs/nb/providers/openai.md +303 -0
  271. package/docs/nb/providers/opencode-go.md +45 -0
  272. package/docs/nb/providers/opencode.md +64 -0
  273. package/docs/nb/providers/openrouter.md +37 -0
  274. package/docs/nb/providers/perplexity-provider.md +62 -0
  275. package/docs/nb/providers/qianfan.md +38 -0
  276. package/docs/nb/providers/qwen.md +53 -0
  277. package/docs/nb/providers/sglang.md +104 -0
  278. package/docs/nb/providers/synthetic.md +99 -0
  279. package/docs/nb/providers/together.md +66 -0
  280. package/docs/nb/providers/venice.md +282 -0
  281. package/docs/nb/providers/vercel-ai-gateway.md +60 -0
  282. package/docs/nb/providers/vllm.md +92 -0
  283. package/docs/nb/providers/volcengine.md +74 -0
  284. package/docs/nb/providers/xai.md +61 -0
  285. package/docs/nb/providers/xiaomi.md +86 -0
  286. package/docs/nb/providers/zai.md +46 -0
  287. package/docs/nb/reference/AGENTS.default.md +126 -0
  288. package/docs/nb/reference/RELEASING.md +42 -0
  289. package/docs/nb/reference/api-usage-costs.md +144 -0
  290. package/docs/nb/reference/credits.md +30 -0
  291. package/docs/nb/reference/device-models.md +47 -0
  292. package/docs/nb/reference/memory-config.md +711 -0
  293. package/docs/nb/reference/prompt-caching.md +185 -0
  294. package/docs/nb/reference/rpc.md +43 -0
  295. package/docs/nb/reference/secretref-credential-surface.md +140 -0
  296. package/docs/nb/reference/session-management-compaction.md +324 -0
  297. package/docs/nb/reference/templates/AGENTS.dev.md +83 -0
  298. package/docs/nb/reference/templates/AGENTS.md +219 -0
  299. package/docs/nb/reference/templates/BOOT.md +11 -0
  300. package/docs/nb/reference/templates/BOOTSTRAP.md +62 -0
  301. package/docs/nb/reference/templates/HEARTBEAT.md +14 -0
  302. package/docs/nb/reference/templates/IDENTITY.dev.md +47 -0
  303. package/docs/nb/reference/templates/IDENTITY.md +29 -0
  304. package/docs/nb/reference/templates/SOUL.dev.md +76 -0
  305. package/docs/nb/reference/templates/SOUL.md +43 -0
  306. package/docs/nb/reference/templates/TOOLS.dev.md +24 -0
  307. package/docs/nb/reference/templates/TOOLS.md +47 -0
  308. package/docs/nb/reference/templates/USER.dev.md +18 -0
  309. package/docs/nb/reference/templates/USER.md +23 -0
  310. package/docs/nb/reference/test.md +89 -0
  311. package/docs/nb/reference/token-use.md +175 -0
  312. package/docs/nb/reference/transcript-hygiene.md +151 -0
  313. package/docs/nb/reference/wizard.md +235 -0
  314. package/docs/nb/security/CONTRIBUTING-THREAT-MODEL.md +98 -0
  315. package/docs/nb/security/THREAT-MODEL-ATLAS.md +611 -0
  316. package/docs/nb/security/formal-verification.md +167 -0
  317. package/docs/nb/start/bootstrapping.md +41 -0
  318. package/docs/nb/start/docs-directory.md +66 -0
  319. package/docs/nb/start/getting-started.md +116 -0
  320. package/docs/nb/start/hubs.md +198 -0
  321. package/docs/nb/start/lore.md +217 -0
  322. package/docs/nb/start/onboarding-overview.md +67 -0
  323. package/docs/nb/start/onboarding.md +91 -0
  324. package/docs/nb/start/pllan.md +216 -0
  325. package/docs/nb/start/quickstart.md +22 -0
  326. package/docs/nb/start/setup.md +164 -0
  327. package/docs/nb/start/showcase.md +419 -0
  328. package/docs/nb/start/wizard-cli-automation.md +215 -0
  329. package/docs/nb/start/wizard-cli-reference.md +299 -0
  330. package/docs/nb/start/wizard.md +125 -0
  331. package/docs/nb/tools/acp-agents.md +623 -0
  332. package/docs/nb/tools/agent-send.md +53 -0
  333. package/docs/nb/tools/apply-patch.md +51 -0
  334. package/docs/nb/tools/brave-search.md +93 -0
  335. package/docs/nb/tools/browser-linux-troubleshooting.md +138 -0
  336. package/docs/nb/tools/browser-login.md +73 -0
  337. package/docs/nb/tools/browser-wsl2-windows-remote-cdp-troubleshooting.md +211 -0
  338. package/docs/nb/tools/browser.md +731 -0
  339. package/docs/nb/tools/btw.md +142 -0
  340. package/docs/nb/tools/capability-cookbook.md +112 -0
  341. package/docs/nb/tools/clawhub.md +257 -0
  342. package/docs/nb/tools/creating-skills.md +58 -0
  343. package/docs/nb/tools/diffs.md +386 -0
  344. package/docs/nb/tools/elevated.md +63 -0
  345. package/docs/nb/tools/exec-approvals.md +400 -0
  346. package/docs/nb/tools/exec.md +204 -0
  347. package/docs/nb/tools/firecrawl.md +140 -0
  348. package/docs/nb/tools/index.md +616 -0
  349. package/docs/nb/tools/llm-task.md +119 -0
  350. package/docs/nb/tools/loop-detection.md +100 -0
  351. package/docs/nb/tools/multi-agent-sandbox-tools.md +364 -0
  352. package/docs/nb/tools/pdf.md +156 -0
  353. package/docs/nb/tools/perplexity-search.md +174 -0
  354. package/docs/nb/tools/plugin.md +337 -0
  355. package/docs/nb/tools/reactions.md +23 -0
  356. package/docs/nb/tools/skills-config.md +86 -0
  357. package/docs/nb/tools/skills.md +306 -0
  358. package/docs/nb/tools/slash-commands.md +294 -0
  359. package/docs/nb/tools/subagents.md +295 -0
  360. package/docs/nb/tools/tavily.md +125 -0
  361. package/docs/nb/tools/thinking.md +93 -0
  362. package/docs/nb/tools/tts.md +406 -0
  363. package/docs/nb/tools/web.md +516 -0
  364. package/docs/nb/tts.md +406 -0
  365. package/docs/nb/vps.md +112 -0
  366. package/docs/nb/web/control-ui.md +127 -0
  367. package/docs/nb/web/dashboard.md +49 -0
  368. package/docs/nb/web/index.md +120 -0
  369. package/docs/nb/web/tui.md +128 -0
  370. package/docs/nb/web/webchat.md +51 -0
  371. package/docs/platforms/mac/webchat.md +1 -1
  372. package/docs/prose.md +1 -1
  373. package/docs/reference/credits.md +4 -4
  374. package/docs/reference/templates/AGENTS.dev.md +3 -3
  375. package/docs/reference/templates/IDENTITY.dev.md +1 -1
  376. package/docs/reference/templates/SOUL.dev.md +2 -2
  377. package/docs/start/lore.md +40 -40
  378. package/docs/sv/auth-credential-semantics.md +53 -0
  379. package/docs/sv/automation/auth-monitoring.md +44 -0
  380. package/docs/sv/automation/cron-jobs.md +727 -0
  381. package/docs/sv/automation/cron-vs-heartbeat.md +286 -0
  382. package/docs/sv/automation/gmail-pubsub.md +256 -0
  383. package/docs/sv/automation/hooks.md +1049 -0
  384. package/docs/sv/automation/poll.md +86 -0
  385. package/docs/sv/automation/troubleshooting.md +122 -0
  386. package/docs/sv/automation/webhook.md +217 -0
  387. package/docs/sv/brave-search.md +93 -0
  388. package/docs/sv/channels/bluebubbles.md +347 -0
  389. package/docs/sv/channels/broadcast-groups.md +442 -0
  390. package/docs/sv/channels/channel-routing.md +139 -0
  391. package/docs/sv/channels/discord.md +1229 -0
  392. package/docs/sv/channels/feishu.md +747 -0
  393. package/docs/sv/channels/googlechat.md +261 -0
  394. package/docs/sv/channels/group-messages.md +84 -0
  395. package/docs/sv/channels/groups.md +379 -0
  396. package/docs/sv/channels/imessage.md +367 -0
  397. package/docs/sv/channels/index.md +47 -0
  398. package/docs/sv/channels/irc.md +242 -0
  399. package/docs/sv/channels/line.md +193 -0
  400. package/docs/sv/channels/location.md +56 -0
  401. package/docs/sv/channels/matrix.md +677 -0
  402. package/docs/sv/channels/mattermost.md +427 -0
  403. package/docs/sv/channels/msteams.md +780 -0
  404. package/docs/sv/channels/nextcloud-talk.md +138 -0
  405. package/docs/sv/channels/nostr.md +242 -0
  406. package/docs/sv/channels/pairing.md +114 -0
  407. package/docs/sv/channels/signal.md +329 -0
  408. package/docs/sv/channels/slack.md +603 -0
  409. package/docs/sv/channels/synology-chat.md +132 -0
  410. package/docs/sv/channels/telegram.md +987 -0
  411. package/docs/sv/channels/tlon.md +276 -0
  412. package/docs/sv/channels/troubleshooting.md +118 -0
  413. package/docs/sv/channels/twitch.md +379 -0
  414. package/docs/sv/channels/whatsapp.md +460 -0
  415. package/docs/sv/channels/zalo.md +243 -0
  416. package/docs/sv/channels/zalouser.md +181 -0
  417. package/docs/sv/ci.md +55 -0
  418. package/docs/sv/cli/acp.md +288 -0
  419. package/docs/sv/cli/agent.md +29 -0
  420. package/docs/sv/cli/agents.md +123 -0
  421. package/docs/sv/cli/approvals.md +50 -0
  422. package/docs/sv/cli/backup.md +76 -0
  423. package/docs/sv/cli/browser.md +106 -0
  424. package/docs/sv/cli/channels.md +102 -0
  425. package/docs/sv/cli/clawbot.md +21 -0
  426. package/docs/sv/cli/completion.md +35 -0
  427. package/docs/sv/cli/config.md +295 -0
  428. package/docs/sv/cli/configure.md +36 -0
  429. package/docs/sv/cli/cron.md +77 -0
  430. package/docs/sv/cli/daemon.md +53 -0
  431. package/docs/sv/cli/dashboard.md +22 -0
  432. package/docs/sv/cli/devices.md +139 -0
  433. package/docs/sv/cli/directory.md +63 -0
  434. package/docs/sv/cli/dns.md +23 -0
  435. package/docs/sv/cli/docs.md +15 -0
  436. package/docs/sv/cli/doctor.md +48 -0
  437. package/docs/sv/cli/gateway.md +235 -0
  438. package/docs/sv/cli/health.md +21 -0
  439. package/docs/sv/cli/hooks.md +318 -0
  440. package/docs/sv/cli/index.md +101 -0
  441. package/docs/sv/cli/logs.md +28 -0
  442. package/docs/sv/cli/memory.md +66 -0
  443. package/docs/sv/cli/message.md +278 -0
  444. package/docs/sv/cli/models.md +81 -0
  445. package/docs/sv/cli/node.md +127 -0
  446. package/docs/sv/cli/nodes.md +75 -0
  447. package/docs/sv/cli/onboard.md +157 -0
  448. package/docs/sv/cli/pairing.md +32 -0
  449. package/docs/sv/cli/plugins.md +186 -0
  450. package/docs/sv/cli/qr.md +46 -0
  451. package/docs/sv/cli/reset.md +20 -0
  452. package/docs/sv/cli/sandbox.md +197 -0
  453. package/docs/sv/cli/secrets.md +188 -0
  454. package/docs/sv/cli/security.md +79 -0
  455. package/docs/sv/cli/sessions.md +110 -0
  456. package/docs/sv/cli/setup.md +29 -0
  457. package/docs/sv/cli/skills.md +26 -0
  458. package/docs/sv/cli/status.md +30 -0
  459. package/docs/sv/cli/system.md +60 -0
  460. package/docs/sv/cli/tui.md +30 -0
  461. package/docs/sv/cli/uninstall.md +20 -0
  462. package/docs/sv/cli/update.md +103 -0
  463. package/docs/sv/cli/voicecall.md +34 -0
  464. package/docs/sv/cli/webhooks.md +25 -0
  465. package/docs/sv/concepts/agent-loop.md +48 -0
  466. package/docs/sv/concepts/agent-workspace.md +70 -0
  467. package/docs/sv/concepts/agent.md +61 -0
  468. package/docs/sv/concepts/architecture.md +136 -0
  469. package/docs/sv/concepts/compaction.md +44 -0
  470. package/docs/sv/concepts/context-engine.md +268 -0
  471. package/docs/sv/concepts/context.md +29 -0
  472. package/docs/sv/concepts/features.md +73 -0
  473. package/docs/sv/concepts/markdown-formatting.md +130 -0
  474. package/docs/sv/concepts/memory.md +99 -0
  475. package/docs/sv/concepts/messages.md +154 -0
  476. package/docs/sv/concepts/model-failover.md +152 -0
  477. package/docs/sv/concepts/model-providers.md +607 -0
  478. package/docs/sv/concepts/models.md +56 -0
  479. package/docs/sv/concepts/multi-agent.md +50 -0
  480. package/docs/sv/concepts/oauth.md +158 -0
  481. package/docs/sv/concepts/presence.md +102 -0
  482. package/docs/sv/concepts/queue.md +51 -0
  483. package/docs/sv/concepts/retry.md +69 -0
  484. package/docs/sv/concepts/session-pruning.md +121 -0
  485. package/docs/sv/concepts/session-tool.md +242 -0
  486. package/docs/sv/concepts/session.md +99 -0
  487. package/docs/sv/concepts/streaming.md +34 -0
  488. package/docs/sv/concepts/system-prompt.md +41 -0
  489. package/docs/sv/concepts/timezone.md +91 -0
  490. package/docs/sv/concepts/typebox.md +291 -0
  491. package/docs/sv/concepts/typing-indicators.md +68 -0
  492. package/docs/sv/concepts/usage-tracking.md +35 -0
  493. package/docs/sv/date-time.md +128 -0
  494. package/docs/sv/debug/node-issue.md +85 -0
  495. package/docs/sv/diagnostics/flags.md +91 -0
  496. package/docs/sv/gateway/authentication.md +179 -0
  497. package/docs/sv/gateway/background-process.md +97 -0
  498. package/docs/sv/gateway/bonjour.md +177 -0
  499. package/docs/sv/gateway/bridge-protocol.md +91 -0
  500. package/docs/sv/gateway/cli-backends.md +225 -0
  501. package/docs/sv/gateway/configuration-examples.md +637 -0
  502. package/docs/sv/gateway/configuration-reference.md +3117 -0
  503. package/docs/sv/gateway/configuration.md +633 -0
  504. package/docs/sv/gateway/discovery.md +123 -0
  505. package/docs/sv/gateway/doctor.md +362 -0
  506. package/docs/sv/gateway/gateway-lock.md +34 -0
  507. package/docs/sv/gateway/health.md +44 -0
  508. package/docs/sv/gateway/heartbeat.md +393 -0
  509. package/docs/sv/gateway/index.md +261 -0
  510. package/docs/sv/gateway/local-models.md +152 -0
  511. package/docs/sv/gateway/logging.md +113 -0
  512. package/docs/sv/gateway/multiple-gateways.md +112 -0
  513. package/docs/sv/gateway/network-model.md +22 -0
  514. package/docs/sv/gateway/openai-http-api.md +132 -0
  515. package/docs/sv/gateway/openresponses-http-api.md +295 -0
  516. package/docs/sv/gateway/openshell.md +307 -0
  517. package/docs/sv/gateway/pairing.md +99 -0
  518. package/docs/sv/gateway/protocol.md +267 -0
  519. package/docs/sv/gateway/remote-gateway-readme.md +158 -0
  520. package/docs/sv/gateway/remote.md +153 -0
  521. package/docs/sv/gateway/sandbox-vs-tool-policy-vs-elevated.md +134 -0
  522. package/docs/sv/gateway/sandboxing.md +469 -0
  523. package/docs/sv/gateway/secrets-plan-contract.md +116 -0
  524. package/docs/sv/gateway/secrets.md +503 -0
  525. package/docs/sv/gateway/security/index.md +59 -0
  526. package/docs/sv/gateway/tailscale.md +132 -0
  527. package/docs/sv/gateway/tools-invoke-http-api.md +110 -0
  528. package/docs/sv/gateway/troubleshooting.md +378 -0
  529. package/docs/sv/gateway/trusted-proxy-auth.md +330 -0
  530. package/docs/sv/help/debugging.md +168 -0
  531. package/docs/sv/help/environment.md +140 -0
  532. package/docs/sv/help/faq.md +2999 -0
  533. package/docs/sv/help/index.md +28 -0
  534. package/docs/sv/help/scripts.md +28 -0
  535. package/docs/sv/help/testing.md +524 -0
  536. package/docs/sv/help/troubleshooting.md +297 -0
  537. package/docs/sv/index.md +180 -0
  538. package/docs/sv/install/ansible.md +230 -0
  539. package/docs/sv/install/azure.md +178 -0
  540. package/docs/sv/install/bun.md +55 -0
  541. package/docs/sv/install/development-channels.md +120 -0
  542. package/docs/sv/install/digitalocean.md +129 -0
  543. package/docs/sv/install/docker-vm-runtime.md +142 -0
  544. package/docs/sv/install/docker.md +375 -0
  545. package/docs/sv/install/exe-dev.md +126 -0
  546. package/docs/sv/install/fly.md +501 -0
  547. package/docs/sv/install/gcp.md +402 -0
  548. package/docs/sv/install/hetzner.md +251 -0
  549. package/docs/sv/install/index.md +183 -0
  550. package/docs/sv/install/installer.md +415 -0
  551. package/docs/sv/install/kubernetes.md +191 -0
  552. package/docs/sv/install/macos-vm.md +281 -0
  553. package/docs/sv/install/migrating-matrix.md +346 -0
  554. package/docs/sv/install/migrating.md +110 -0
  555. package/docs/sv/install/nix.md +89 -0
  556. package/docs/sv/install/node.md +138 -0
  557. package/docs/sv/install/oracle.md +156 -0
  558. package/docs/sv/install/podman.md +133 -0
  559. package/docs/sv/install/raspberry-pi.md +159 -0
  560. package/docs/sv/install/reinstall.md +126 -0
  561. package/docs/sv/install/uninstall.md +128 -0
  562. package/docs/sv/install/updating.md +128 -0
  563. package/docs/sv/logging.md +352 -0
  564. package/docs/sv/network.md +54 -0
  565. package/docs/sv/nodes/audio.md +187 -0
  566. package/docs/sv/nodes/camera.md +162 -0
  567. package/docs/sv/nodes/images.md +72 -0
  568. package/docs/sv/nodes/index.md +89 -0
  569. package/docs/sv/nodes/location-command.md +98 -0
  570. package/docs/sv/nodes/media-understanding.md +394 -0
  571. package/docs/sv/nodes/talk.md +92 -0
  572. package/docs/sv/nodes/troubleshooting.md +114 -0
  573. package/docs/sv/nodes/voicewake.md +66 -0
  574. package/docs/sv/perplexity.md +174 -0
  575. package/docs/sv/pi-dev.md +80 -0
  576. package/docs/sv/pi.md +567 -0
  577. package/docs/sv/platforms/android.md +168 -0
  578. package/docs/sv/platforms/digitalocean.md +266 -0
  579. package/docs/sv/platforms/index.md +54 -0
  580. package/docs/sv/platforms/ios.md +220 -0
  581. package/docs/sv/platforms/linux.md +94 -0
  582. package/docs/sv/platforms/mac/bundled-gateway.md +73 -0
  583. package/docs/sv/platforms/mac/canvas.md +125 -0
  584. package/docs/sv/platforms/mac/child-process.md +69 -0
  585. package/docs/sv/platforms/mac/dev-setup.md +104 -0
  586. package/docs/sv/platforms/mac/health.md +34 -0
  587. package/docs/sv/platforms/mac/icon.md +31 -0
  588. package/docs/sv/platforms/mac/logging.md +57 -0
  589. package/docs/sv/platforms/mac/menu-bar.md +81 -0
  590. package/docs/sv/platforms/mac/peekaboo.md +65 -0
  591. package/docs/sv/platforms/mac/permissions.md +50 -0
  592. package/docs/sv/platforms/mac/remote.md +84 -0
  593. package/docs/sv/platforms/mac/signing.md +47 -0
  594. package/docs/sv/platforms/mac/skills.md +33 -0
  595. package/docs/sv/platforms/mac/voice-overlay.md +60 -0
  596. package/docs/sv/platforms/mac/voicewake.md +67 -0
  597. package/docs/sv/platforms/mac/webchat.md +43 -0
  598. package/docs/sv/platforms/mac/xpc.md +61 -0
  599. package/docs/sv/platforms/macos.md +226 -0
  600. package/docs/sv/platforms/oracle.md +303 -0
  601. package/docs/sv/platforms/raspberry-pi.md +412 -0
  602. package/docs/sv/platforms/windows.md +241 -0
  603. package/docs/sv/plugins/agent-tools.md +99 -0
  604. package/docs/sv/plugins/architecture.md +1349 -0
  605. package/docs/sv/plugins/building-extensions.md +205 -0
  606. package/docs/sv/plugins/bundles.md +307 -0
  607. package/docs/sv/plugins/community.md +60 -0
  608. package/docs/sv/plugins/manifest.md +145 -0
  609. package/docs/sv/plugins/voice-call.md +350 -0
  610. package/docs/sv/plugins/zalouser.md +77 -0
  611. package/docs/sv/prose.md +134 -0
  612. package/docs/sv/providers/anthropic.md +259 -0
  613. package/docs/sv/providers/bedrock.md +176 -0
  614. package/docs/sv/providers/claude-max-api-proxy.md +154 -0
  615. package/docs/sv/providers/cloudflare-ai-gateway.md +71 -0
  616. package/docs/sv/providers/deepgram.md +93 -0
  617. package/docs/sv/providers/github-copilot.md +72 -0
  618. package/docs/sv/providers/glm.md +43 -0
  619. package/docs/sv/providers/google.md +78 -0
  620. package/docs/sv/providers/groq.md +96 -0
  621. package/docs/sv/providers/huggingface.md +209 -0
  622. package/docs/sv/providers/index.md +69 -0
  623. package/docs/sv/providers/kilocode.md +74 -0
  624. package/docs/sv/providers/litellm.md +154 -0
  625. package/docs/sv/providers/minimax.md +224 -0
  626. package/docs/sv/providers/mistral.md +54 -0
  627. package/docs/sv/providers/models.md +45 -0
  628. package/docs/sv/providers/modelstudio.md +66 -0
  629. package/docs/sv/providers/moonshot.md +175 -0
  630. package/docs/sv/providers/nvidia.md +55 -0
  631. package/docs/sv/providers/ollama.md +352 -0
  632. package/docs/sv/providers/openai.md +303 -0
  633. package/docs/sv/providers/opencode-go.md +45 -0
  634. package/docs/sv/providers/opencode.md +64 -0
  635. package/docs/sv/providers/openrouter.md +37 -0
  636. package/docs/sv/providers/perplexity-provider.md +62 -0
  637. package/docs/sv/providers/qianfan.md +38 -0
  638. package/docs/sv/providers/qwen.md +53 -0
  639. package/docs/sv/providers/sglang.md +104 -0
  640. package/docs/sv/providers/synthetic.md +99 -0
  641. package/docs/sv/providers/together.md +66 -0
  642. package/docs/sv/providers/venice.md +282 -0
  643. package/docs/sv/providers/vercel-ai-gateway.md +60 -0
  644. package/docs/sv/providers/vllm.md +92 -0
  645. package/docs/sv/providers/volcengine.md +74 -0
  646. package/docs/sv/providers/xai.md +61 -0
  647. package/docs/sv/providers/xiaomi.md +86 -0
  648. package/docs/sv/providers/zai.md +46 -0
  649. package/docs/sv/reference/AGENTS.default.md +126 -0
  650. package/docs/sv/reference/RELEASING.md +42 -0
  651. package/docs/sv/reference/api-usage-costs.md +144 -0
  652. package/docs/sv/reference/credits.md +30 -0
  653. package/docs/sv/reference/device-models.md +47 -0
  654. package/docs/sv/reference/memory-config.md +711 -0
  655. package/docs/sv/reference/prompt-caching.md +185 -0
  656. package/docs/sv/reference/rpc.md +43 -0
  657. package/docs/sv/reference/secretref-credential-surface.md +140 -0
  658. package/docs/sv/reference/session-management-compaction.md +324 -0
  659. package/docs/sv/reference/templates/AGENTS.dev.md +83 -0
  660. package/docs/sv/reference/templates/AGENTS.md +219 -0
  661. package/docs/sv/reference/templates/BOOT.md +11 -0
  662. package/docs/sv/reference/templates/BOOTSTRAP.md +62 -0
  663. package/docs/sv/reference/templates/HEARTBEAT.md +14 -0
  664. package/docs/sv/reference/templates/IDENTITY.dev.md +47 -0
  665. package/docs/sv/reference/templates/IDENTITY.md +29 -0
  666. package/docs/sv/reference/templates/SOUL.dev.md +76 -0
  667. package/docs/sv/reference/templates/SOUL.md +43 -0
  668. package/docs/sv/reference/templates/TOOLS.dev.md +24 -0
  669. package/docs/sv/reference/templates/TOOLS.md +47 -0
  670. package/docs/sv/reference/templates/USER.dev.md +18 -0
  671. package/docs/sv/reference/templates/USER.md +23 -0
  672. package/docs/sv/reference/test.md +89 -0
  673. package/docs/sv/reference/token-use.md +175 -0
  674. package/docs/sv/reference/transcript-hygiene.md +151 -0
  675. package/docs/sv/reference/wizard.md +235 -0
  676. package/docs/sv/security/CONTRIBUTING-THREAT-MODEL.md +98 -0
  677. package/docs/sv/security/THREAT-MODEL-ATLAS.md +611 -0
  678. package/docs/sv/security/formal-verification.md +167 -0
  679. package/docs/sv/start/bootstrapping.md +41 -0
  680. package/docs/sv/start/docs-directory.md +66 -0
  681. package/docs/sv/start/getting-started.md +116 -0
  682. package/docs/sv/start/hubs.md +198 -0
  683. package/docs/sv/start/lore.md +217 -0
  684. package/docs/sv/start/onboarding-overview.md +67 -0
  685. package/docs/sv/start/onboarding.md +91 -0
  686. package/docs/sv/start/pllan.md +216 -0
  687. package/docs/sv/start/quickstart.md +22 -0
  688. package/docs/sv/start/setup.md +164 -0
  689. package/docs/sv/start/showcase.md +419 -0
  690. package/docs/sv/start/wizard-cli-automation.md +215 -0
  691. package/docs/sv/start/wizard-cli-reference.md +299 -0
  692. package/docs/sv/start/wizard.md +125 -0
  693. package/docs/sv/tools/acp-agents.md +623 -0
  694. package/docs/sv/tools/agent-send.md +53 -0
  695. package/docs/sv/tools/apply-patch.md +51 -0
  696. package/docs/sv/tools/brave-search.md +93 -0
  697. package/docs/sv/tools/browser-linux-troubleshooting.md +138 -0
  698. package/docs/sv/tools/browser-login.md +73 -0
  699. package/docs/sv/tools/browser-wsl2-windows-remote-cdp-troubleshooting.md +211 -0
  700. package/docs/sv/tools/browser.md +731 -0
  701. package/docs/sv/tools/btw.md +142 -0
  702. package/docs/sv/tools/capability-cookbook.md +112 -0
  703. package/docs/sv/tools/clawhub.md +257 -0
  704. package/docs/sv/tools/creating-skills.md +58 -0
  705. package/docs/sv/tools/diffs.md +386 -0
  706. package/docs/sv/tools/elevated.md +63 -0
  707. package/docs/sv/tools/exec-approvals.md +400 -0
  708. package/docs/sv/tools/exec.md +204 -0
  709. package/docs/sv/tools/firecrawl.md +140 -0
  710. package/docs/sv/tools/index.md +139 -0
  711. package/docs/sv/tools/llm-task.md +119 -0
  712. package/docs/sv/tools/loop-detection.md +100 -0
  713. package/docs/sv/tools/multi-agent-sandbox-tools.md +364 -0
  714. package/docs/sv/tools/pdf.md +156 -0
  715. package/docs/sv/tools/perplexity-search.md +174 -0
  716. package/docs/sv/tools/plugin.md +337 -0
  717. package/docs/sv/tools/reactions.md +23 -0
  718. package/docs/sv/tools/skills-config.md +86 -0
  719. package/docs/sv/tools/skills.md +306 -0
  720. package/docs/sv/tools/slash-commands.md +294 -0
  721. package/docs/sv/tools/subagents.md +295 -0
  722. package/docs/sv/tools/tavily.md +125 -0
  723. package/docs/sv/tools/thinking.md +93 -0
  724. package/docs/sv/tools/tts.md +406 -0
  725. package/docs/sv/tools/web.md +516 -0
  726. package/docs/sv/tts.md +406 -0
  727. package/docs/sv/vps.md +112 -0
  728. package/docs/sv/web/control-ui.md +275 -0
  729. package/docs/sv/web/dashboard.md +54 -0
  730. package/docs/sv/web/index.md +120 -0
  731. package/docs/sv/web/tui.md +170 -0
  732. package/docs/sv/web/webchat.md +61 -0
  733. package/docs/tools/index.md +1 -1
  734. package/docs/tools/llm-task.md +3 -3
  735. package/docs/zh-CN/automation/cron-vs-heartbeat.md +9 -9
  736. package/docs/zh-CN/cli/agents.md +3 -3
  737. package/docs/zh-CN/cli/index.md +1 -1
  738. package/docs/zh-CN/concepts/agent.md +1 -1
  739. package/docs/zh-CN/gateway/configuration-examples.md +1 -1
  740. package/docs/zh-CN/gateway/configuration-reference.md +1 -1
  741. package/docs/zh-CN/gateway/security/index.md +2 -2
  742. package/docs/zh-CN/gateway/troubleshooting.md +1 -1
  743. package/docs/zh-CN/index.md +1 -3
  744. package/docs/zh-CN/platforms/mac/webchat.md +1 -1
  745. package/docs/zh-CN/prose.md +1 -1
  746. package/docs/zh-CN/reference/templates/AGENTS.dev.md +2 -2
  747. package/docs/zh-CN/start/lore.md +19 -19
  748. package/docs/zh-CN/tools/index.md +1 -1
  749. package/docs/zh-CN/tools/llm-task.md +3 -3
  750. package/docs/zh-CN/tools/plugin.md +1 -1
  751. package/package.json +1 -1
  752. package/docs/assets/pixel-lobster.svg +0 -60
  753. package/docs/assets/pllan-logo-text-dark.png +0 -0
  754. package/docs/assets/pllan-logo-text-dark.svg +0 -418
  755. package/docs/assets/pllan-logo-text.png +0 -0
  756. package/docs/assets/pllan-logo-text.svg +0 -418
  757. package/docs/tools/lobster.md +0 -340
  758. package/docs/zh-CN/tools/lobster.md +0 -349
@@ -0,0 +1,1049 @@
1
+ ---
2
+ summary: "Hooks: event-driven automation for commands and lifecycle events"
3
+ read_when:
4
+ - You want event-driven automation for /new, /reset, /stop, and agent lifecycle events
5
+ - You want to build, install, or debug hooks
6
+ title: "Hooks"
7
+ ---
8
+
9
+ # Hooks
10
+
11
+ Hooks provide an extensible event-driven system for automating actions in response to agent commands and events. Hooks are automatically discovered from directories and can be managed via CLI commands, similar to how skills work in Pllan.
12
+
13
+ ## Getting Oriented
14
+
15
+ Hooks are small scripts that run when something happens. There are two kinds:
16
+
17
+ - **Hooks** (this page): run inside the Gateway when agent events fire, like `/new`, `/reset`, `/stop`, or lifecycle events.
18
+ - **Webhooks**: external HTTP webhooks that let other systems trigger work in Pllan. See [Webhook Hooks](/automation/webhook) or use `pllan webhooks` for Gmail helper commands.
19
+
20
+ Hooks can also be bundled inside plugins; see [Plugin hooks](/plugins/architecture#provider-runtime-hooks).
21
+
22
+ Common uses:
23
+
24
+ - Save a memory snapshot when you reset a session
25
+ - Keep an audit trail of commands for troubleshooting or compliance
26
+ - Trigger follow-up automation when a session starts or ends
27
+ - Write files into the agent workspace or call external APIs when events fire
28
+
29
+ If you can write a small TypeScript function, you can write a hook. Hooks are discovered automatically, and you enable or disable them via the CLI.
30
+
31
+ ## Overview
32
+
33
+ The hooks system allows you to:
34
+
35
+ - Save session context to memory when `/new` is issued
36
+ - Log all commands for auditing
37
+ - Trigger custom automations on agent lifecycle events
38
+ - Extend Pllan's behavior without modifying core code
39
+
40
+ ## Getting Started
41
+
42
+ ### Bundled Hooks
43
+
44
+ Pllan ships with four bundled hooks that are automatically discovered:
45
+
46
+ - **💾 session-memory**: Saves session context to your agent workspace (default `~/.pllan/workspace/memory/`) when you issue `/new`
47
+ - **📎 bootstrap-extra-files**: Injects additional workspace bootstrap files from configured glob/path patterns during `agent:bootstrap`
48
+ - **📝 command-logger**: Logs all command events to `~/.pllan/logs/commands.log`
49
+ - **🚀 boot-md**: Runs `BOOT.md` when the gateway starts (requires internal hooks enabled)
50
+
51
+ List available hooks:
52
+
53
+ ```bash
54
+ pllan hooks list
55
+ ```
56
+
57
+ Enable a hook:
58
+
59
+ ```bash
60
+ pllan hooks enable session-memory
61
+ ```
62
+
63
+ Check hook status:
64
+
65
+ ```bash
66
+ pllan hooks check
67
+ ```
68
+
69
+ Get detailed information:
70
+
71
+ ```bash
72
+ pllan hooks info session-memory
73
+ ```
74
+
75
+ ### Onboarding
76
+
77
+ During onboarding (`pllan onboard`), you'll be prompted to enable recommended hooks. The wizard automatically discovers eligible hooks and presents them for selection.
78
+
79
+ ## Hook Discovery
80
+
81
+ Hooks are automatically discovered from three directories (in order of precedence):
82
+
83
+ 1. **Workspace hooks**: `<workspace>/hooks/` (per-agent, highest precedence)
84
+ 2. **Managed hooks**: `~/.pllan/hooks/` (user-installed, shared across workspaces)
85
+ 3. **Bundled hooks**: `<pllan>/dist/hooks/bundled/` (shipped with Pllan)
86
+
87
+ Managed hook directories can be either a **single hook** or a **hook pack** (package directory).
88
+
89
+ Each hook is a directory containing:
90
+
91
+ ```
92
+ my-hook/
93
+ ├── HOOK.md # Metadata + documentation
94
+ └── handler.ts # Handler implementation
95
+ ```
96
+
97
+ ## Hook Packs (npm/archives)
98
+
99
+ Hook packs are standard npm packages that export one or more hooks via `pllan.hooks` in
100
+ `package.json`. Install them with:
101
+
102
+ ```bash
103
+ pllan hooks install <path-or-spec>
104
+ ```
105
+
106
+ Npm specs are registry-only (package name + optional exact version or dist-tag).
107
+ Git/URL/file specs and semver ranges are rejected.
108
+
109
+ Bare specs and `@latest` stay on the stable track. If npm resolves either of
110
+ those to a prerelease, Pllan stops and asks you to opt in explicitly with a
111
+ prerelease tag such as `@beta`/`@rc` or an exact prerelease version.
112
+
113
+ Example `package.json`:
114
+
115
+ ```json
116
+ {
117
+ "name": "@acme/my-hooks",
118
+ "version": "0.1.0",
119
+ "pllan": {
120
+ "hooks": ["./hooks/my-hook", "./hooks/other-hook"]
121
+ }
122
+ }
123
+ ```
124
+
125
+ Each entry points to a hook directory containing `HOOK.md` and `handler.ts` (or `index.ts`).
126
+ Hook packs can ship dependencies; they will be installed under `~/.pllan/hooks/<id>`.
127
+ Each `pllan.hooks` entry must stay inside the package directory after symlink
128
+ resolution; entries that escape are rejected.
129
+
130
+ Security note: `pllan hooks install` installs dependencies with `npm install --ignore-scripts`
131
+ (no lifecycle scripts). Keep hook pack dependency trees "pure JS/TS" and avoid packages that rely
132
+ on `postinstall` builds.
133
+
134
+ ## Hook Structure
135
+
136
+ ### HOOK.md Format
137
+
138
+ The `HOOK.md` file contains metadata in YAML frontmatter plus Markdown documentation:
139
+
140
+ ```markdown
141
+ ---
142
+ name: my-hook
143
+ description: "Short description of what this hook does"
144
+ homepage: https://docs.pllan.ai/automation/hooks#my-hook
145
+ metadata:
146
+ { "pllan": { "emoji": "🔗", "events": ["command:new"], "requires": { "bins": ["node"] } } }
147
+ ---
148
+
149
+ # My Hook
150
+
151
+ Detailed documentation goes here...
152
+
153
+ ## What It Does
154
+
155
+ - Listens for `/new` commands
156
+ - Performs some action
157
+ - Logs the result
158
+
159
+ ## Requirements
160
+
161
+ - Node.js must be installed
162
+
163
+ ## Configuration
164
+
165
+ No configuration needed.
166
+ ```
167
+
168
+ ### Metadata Fields
169
+
170
+ The `metadata.pllan` object supports:
171
+
172
+ - **`emoji`**: Display emoji for CLI (e.g., `"💾"`)
173
+ - **`events`**: Array of events to listen for (e.g., `["command:new", "command:reset"]`)
174
+ - **`export`**: Named export to use (defaults to `"default"`)
175
+ - **`homepage`**: Documentation URL
176
+ - **`requires`**: Optional requirements
177
+ - **`bins`**: Required binaries on PATH (e.g., `["git", "node"]`)
178
+ - **`anyBins`**: At least one of these binaries must be present
179
+ - **`env`**: Required environment variables
180
+ - **`config`**: Required config paths (e.g., `["workspace.dir"]`)
181
+ - **`os`**: Required platforms (e.g., `["darwin", "linux"]`)
182
+ - **`always`**: Bypass eligibility checks (boolean)
183
+ - **`install`**: Installation methods (for bundled hooks: `[{"id":"bundled","kind":"bundled"}]`)
184
+
185
+ ### Handler Implementation
186
+
187
+ The `handler.ts` file exports a `HookHandler` function:
188
+
189
+ ```typescript
190
+ const myHandler = async (event) => {
191
+ // Only trigger on 'new' command
192
+ if (event.type !== "command" || event.action !== "new") {
193
+ return;
194
+ }
195
+
196
+ console.log(`[my-hook] New command triggered`);
197
+ console.log(` Session: ${event.sessionKey}`);
198
+ console.log(` Timestamp: ${event.timestamp.toISOString()}`);
199
+
200
+ // Your custom logic here
201
+
202
+ // Optionally send message to user
203
+ event.messages.push("✨ My hook executed!");
204
+ };
205
+
206
+ export default myHandler;
207
+ ```
208
+
209
+ #### Event Context
210
+
211
+ Each event includes:
212
+
213
+ ```typescript
214
+ {
215
+ type: 'command' | 'session' | 'agent' | 'gateway' | 'message',
216
+ action: string, // e.g., 'new', 'reset', 'stop', 'received', 'sent'
217
+ sessionKey: string, // Session identifier
218
+ timestamp: Date, // When the event occurred
219
+ messages: string[], // Push messages here to send to user
220
+ context: {
221
+ // Command events:
222
+ sessionEntry?: SessionEntry,
223
+ sessionId?: string,
224
+ sessionFile?: string,
225
+ commandSource?: string, // e.g., 'whatsapp', 'telegram'
226
+ senderId?: string,
227
+ workspaceDir?: string,
228
+ bootstrapFiles?: WorkspaceBootstrapFile[],
229
+ cfg?: PllanConfig,
230
+ // Message events (see Message Events section for full details):
231
+ from?: string, // message:received
232
+ to?: string, // message:sent
233
+ content?: string,
234
+ channelId?: string,
235
+ success?: boolean, // message:sent
236
+ }
237
+ }
238
+ ```
239
+
240
+ ## Event Types
241
+
242
+ ### Command Events
243
+
244
+ Triggered when agent commands are issued:
245
+
246
+ - **`command`**: All command events (general listener)
247
+ - **`command:new`**: When `/new` command is issued
248
+ - **`command:reset`**: When `/reset` command is issued
249
+ - **`command:stop`**: When `/stop` command is issued
250
+
251
+ ### Session Events
252
+
253
+ - **`session:compact:before`**: Right before compaction summarizes history
254
+ - **`session:compact:after`**: After compaction completes with summary metadata
255
+
256
+ Internal hook payloads emit these as `type: "session"` with `action: "compact:before"` / `action: "compact:after"`; listeners subscribe with the combined keys above.
257
+ Specific handler registration uses the literal key format `${type}:${action}`. For these events, register `session:compact:before` and `session:compact:after`.
258
+
259
+ ### Agent Events
260
+
261
+ - **`agent:bootstrap`**: Before workspace bootstrap files are injected (hooks may mutate `context.bootstrapFiles`)
262
+
263
+ ### Gateway Events
264
+
265
+ Triggered when the gateway starts:
266
+
267
+ - **`gateway:startup`**: After channels start and hooks are loaded
268
+
269
+ ### Message Events
270
+
271
+ Triggered when messages are received or sent:
272
+
273
+ - **`message`**: All message events (general listener)
274
+ - **`message:received`**: When an inbound message is received from any channel. Fires early in processing before media understanding. Content may contain raw placeholders like `<media:audio>` for media attachments that haven't been processed yet.
275
+ - **`message:transcribed`**: When a message has been fully processed, including audio transcription and link understanding. At this point, `transcript` contains the full transcript text for audio messages. Use this hook when you need access to transcribed audio content.
276
+ - **`message:preprocessed`**: Fires for every message after all media + link understanding completes, giving hooks access to the fully enriched body (transcripts, image descriptions, link summaries) before the agent sees it.
277
+ - **`message:sent`**: When an outbound message is successfully sent
278
+
279
+ #### Message Event Context
280
+
281
+ Message events include rich context about the message:
282
+
283
+ ```typescript
284
+ // message:received context
285
+ {
286
+ from: string, // Sender identifier (phone number, user ID, etc.)
287
+ content: string, // Message content
288
+ timestamp?: number, // Unix timestamp when received
289
+ channelId: string, // Channel (e.g., "whatsapp", "telegram", "discord")
290
+ accountId?: string, // Provider account ID for multi-account setups
291
+ conversationId?: string, // Chat/conversation ID
292
+ messageId?: string, // Message ID from the provider
293
+ metadata?: { // Additional provider-specific data
294
+ to?: string,
295
+ provider?: string,
296
+ surface?: string,
297
+ threadId?: string,
298
+ senderId?: string,
299
+ senderName?: string,
300
+ senderUsername?: string,
301
+ senderE164?: string,
302
+ }
303
+ }
304
+
305
+ // message:sent context
306
+ {
307
+ to: string, // Recipient identifier
308
+ content: string, // Message content that was sent
309
+ success: boolean, // Whether the send succeeded
310
+ error?: string, // Error message if sending failed
311
+ channelId: string, // Channel (e.g., "whatsapp", "telegram", "discord")
312
+ accountId?: string, // Provider account ID
313
+ conversationId?: string, // Chat/conversation ID
314
+ messageId?: string, // Message ID returned by the provider
315
+ isGroup?: boolean, // Whether this outbound message belongs to a group/channel context
316
+ groupId?: string, // Group/channel identifier for correlation with message:received
317
+ }
318
+
319
+ // message:transcribed context
320
+ {
321
+ body?: string, // Raw inbound body before enrichment
322
+ bodyForAgent?: string, // Enriched body visible to the agent
323
+ transcript: string, // Audio transcript text
324
+ channelId: string, // Channel (e.g., "telegram", "whatsapp")
325
+ conversationId?: string,
326
+ messageId?: string,
327
+ }
328
+
329
+ // message:preprocessed context
330
+ {
331
+ body?: string, // Raw inbound body
332
+ bodyForAgent?: string, // Final enriched body after media/link understanding
333
+ transcript?: string, // Transcript when audio was present
334
+ channelId: string, // Channel (e.g., "telegram", "whatsapp")
335
+ conversationId?: string,
336
+ messageId?: string,
337
+ isGroup?: boolean,
338
+ groupId?: string,
339
+ }
340
+ ```
341
+
342
+ #### Example: Message Logger Hook
343
+
344
+ ```typescript
345
+ const isMessageReceivedEvent = (event: { type: string; action: string }) =>
346
+ event.type === "message" && event.action === "received";
347
+ const isMessageSentEvent = (event: { type: string; action: string }) =>
348
+ event.type === "message" && event.action === "sent";
349
+
350
+ const handler = async (event) => {
351
+ if (isMessageReceivedEvent(event as { type: string; action: string })) {
352
+ console.log(`[message-logger] Received from ${event.context.from}: ${event.context.content}`);
353
+ } else if (isMessageSentEvent(event as { type: string; action: string })) {
354
+ console.log(`[message-logger] Sent to ${event.context.to}: ${event.context.content}`);
355
+ }
356
+ };
357
+
358
+ export default handler;
359
+ ```
360
+
361
+ ### Tool Result Hooks (Plugin API)
362
+
363
+ These hooks are not event-stream listeners; they let plugins synchronously adjust tool results before Pllan persists them.
364
+
365
+ - **`tool_result_persist`**: transform tool results before they are written to the session transcript. Must be synchronous; return the updated tool result payload or `undefined` to keep it as-is. See [Agent Loop](/concepts/agent-loop).
366
+
367
+ ### Plugin Hook Events
368
+
369
+ Compaction lifecycle hooks exposed through the plugin hook runner:
370
+
371
+ - **`before_compaction`**: Runs before compaction with count/token metadata
372
+ - **`after_compaction`**: Runs after compaction with compaction summary metadata
373
+
374
+ ### Future Events
375
+
376
+ Planned event types:
377
+
378
+ - **`session:start`**: When a new session begins
379
+ - **`session:end`**: When a session ends
380
+ - **`agent:error`**: When an agent encounters an error
381
+
382
+ ## Creating Custom Hooks
383
+
384
+ ### 1. Choose Location
385
+
386
+ - **Workspace hooks** (`<workspace>/hooks/`): Per-agent, highest precedence
387
+ - **Managed hooks** (`~/.pllan/hooks/`): Shared across workspaces
388
+
389
+ ### 2. Create Directory Structure
390
+
391
+ ```bash
392
+ mkdir -p ~/.pllan/hooks/my-hook
393
+ cd ~/.pllan/hooks/my-hook
394
+ ```
395
+
396
+ ### 3. Create HOOK.md
397
+
398
+ ```markdown
399
+ ---
400
+ name: my-hook
401
+ description: "Does something useful"
402
+ metadata: { "pllan": { "emoji": "🎯", "events": ["command:new"] } }
403
+ ---
404
+
405
+ # My Custom Hook
406
+
407
+ This hook does something useful when you issue `/new`.
408
+ ```
409
+
410
+ ### 4. Create handler.ts
411
+
412
+ ```typescript
413
+ const handler = async (event) => {
414
+ if (event.type !== "command" || event.action !== "new") {
415
+ return;
416
+ }
417
+
418
+ console.log("[my-hook] Running!");
419
+ // Your logic here
420
+ };
421
+
422
+ export default handler;
423
+ ```
424
+
425
+ ### 5. Enable and Test
426
+
427
+ ```bash
428
+ # Verify hook is discovered
429
+ pllan hooks list
430
+
431
+ # Enable it
432
+ pllan hooks enable my-hook
433
+
434
+ # Restart your gateway process (menu bar app restart on macOS, or restart your dev process)
435
+
436
+ # Trigger the event
437
+ # Send /new via your messaging channel
438
+ ```
439
+
440
+ ## Configuration
441
+
442
+ ### New Config Format (Recommended)
443
+
444
+ ```json
445
+ {
446
+ "hooks": {
447
+ "internal": {
448
+ "enabled": true,
449
+ "entries": {
450
+ "session-memory": { "enabled": true },
451
+ "command-logger": { "enabled": false }
452
+ }
453
+ }
454
+ }
455
+ }
456
+ ```
457
+
458
+ ### Per-Hook Configuration
459
+
460
+ Hooks can have custom configuration:
461
+
462
+ ```json
463
+ {
464
+ "hooks": {
465
+ "internal": {
466
+ "enabled": true,
467
+ "entries": {
468
+ "my-hook": {
469
+ "enabled": true,
470
+ "env": {
471
+ "MY_CUSTOM_VAR": "value"
472
+ }
473
+ }
474
+ }
475
+ }
476
+ }
477
+ }
478
+ ```
479
+
480
+ ### Extra Directories
481
+
482
+ Load hooks from additional directories:
483
+
484
+ ```json
485
+ {
486
+ "hooks": {
487
+ "internal": {
488
+ "enabled": true,
489
+ "load": {
490
+ "extraDirs": ["/path/to/more/hooks"]
491
+ }
492
+ }
493
+ }
494
+ }
495
+ ```
496
+
497
+ ### Legacy Config Format (Still Supported)
498
+
499
+ The old config format still works for backwards compatibility:
500
+
501
+ ```json
502
+ {
503
+ "hooks": {
504
+ "internal": {
505
+ "enabled": true,
506
+ "handlers": [
507
+ {
508
+ "event": "command:new",
509
+ "module": "./hooks/handlers/my-handler.ts",
510
+ "export": "default"
511
+ }
512
+ ]
513
+ }
514
+ }
515
+ }
516
+ ```
517
+
518
+ Note: `module` must be a workspace-relative path. Absolute paths and traversal outside the workspace are rejected.
519
+
520
+ **Migration**: Use the new discovery-based system for new hooks. Legacy handlers are loaded after directory-based hooks.
521
+
522
+ ## CLI Commands
523
+
524
+ ### List Hooks
525
+
526
+ ```bash
527
+ # List all hooks
528
+ pllan hooks list
529
+
530
+ # Show only eligible hooks
531
+ pllan hooks list --eligible
532
+
533
+ # Verbose output (show missing requirements)
534
+ pllan hooks list --verbose
535
+
536
+ # JSON output
537
+ pllan hooks list --json
538
+ ```
539
+
540
+ ### Hook Information
541
+
542
+ ```bash
543
+ # Show detailed info about a hook
544
+ pllan hooks info session-memory
545
+
546
+ # JSON output
547
+ pllan hooks info session-memory --json
548
+ ```
549
+
550
+ ### Check Eligibility
551
+
552
+ ```bash
553
+ # Show eligibility summary
554
+ pllan hooks check
555
+
556
+ # JSON output
557
+ pllan hooks check --json
558
+ ```
559
+
560
+ ### Enable/Disable
561
+
562
+ ```bash
563
+ # Enable a hook
564
+ pllan hooks enable session-memory
565
+
566
+ # Disable a hook
567
+ pllan hooks disable command-logger
568
+ ```
569
+
570
+ ## Bundled hook reference
571
+
572
+ ### session-memory
573
+
574
+ Saves session context to memory when you issue `/new`.
575
+
576
+ **Events**: `command:new`
577
+
578
+ **Requirements**: `workspace.dir` must be configured
579
+
580
+ **Output**: `<workspace>/memory/YYYY-MM-DD-slug.md` (defaults to `~/.pllan/workspace`)
581
+
582
+ **What it does**:
583
+
584
+ 1. Uses the pre-reset session entry to locate the correct transcript
585
+ 2. Extracts the last 15 lines of conversation
586
+ 3. Uses LLM to generate a descriptive filename slug
587
+ 4. Saves session metadata to a dated memory file
588
+
589
+ **Example output**:
590
+
591
+ ```markdown
592
+ # Session: 2026-01-16 14:30:00 UTC
593
+
594
+ - **Session Key**: agent:main:main
595
+ - **Session ID**: abc123def456
596
+ - **Source**: telegram
597
+ ```
598
+
599
+ **Filename examples**:
600
+
601
+ - `2026-01-16-vendor-pitch.md`
602
+ - `2026-01-16-api-design.md`
603
+ - `2026-01-16-1430.md` (fallback timestamp if slug generation fails)
604
+
605
+ **Enable**:
606
+
607
+ ```bash
608
+ pllan hooks enable session-memory
609
+ ```
610
+
611
+ ### bootstrap-extra-files
612
+
613
+ Injects additional bootstrap files (for example monorepo-local `AGENTS.md` / `TOOLS.md`) during `agent:bootstrap`.
614
+
615
+ **Events**: `agent:bootstrap`
616
+
617
+ **Requirements**: `workspace.dir` must be configured
618
+
619
+ **Output**: No files written; bootstrap context is modified in-memory only.
620
+
621
+ **Config**:
622
+
623
+ ```json
624
+ {
625
+ "hooks": {
626
+ "internal": {
627
+ "enabled": true,
628
+ "entries": {
629
+ "bootstrap-extra-files": {
630
+ "enabled": true,
631
+ "paths": ["packages/*/AGENTS.md", "packages/*/TOOLS.md"]
632
+ }
633
+ }
634
+ }
635
+ }
636
+ }
637
+ ```
638
+
639
+ **Notes**:
640
+
641
+ - Paths are resolved relative to workspace.
642
+ - Files must stay inside workspace (realpath-checked).
643
+ - Only recognized bootstrap basenames are loaded.
644
+ - Subagent allowlist is preserved (`AGENTS.md` and `TOOLS.md` only).
645
+
646
+ **Enable**:
647
+
648
+ ```bash
649
+ pllan hooks enable bootstrap-extra-files
650
+ ```
651
+
652
+ ### command-logger
653
+
654
+ Logs all command events to a centralized audit file.
655
+
656
+ **Events**: `command`
657
+
658
+ **Requirements**: None
659
+
660
+ **Output**: `~/.pllan/logs/commands.log`
661
+
662
+ **What it does**:
663
+
664
+ 1. Captures event details (command action, timestamp, session key, sender ID, source)
665
+ 2. Appends to log file in JSONL format
666
+ 3. Runs silently in the background
667
+
668
+ **Example log entries**:
669
+
670
+ ```jsonl
671
+ {"timestamp":"2026-01-16T14:30:00.000Z","action":"new","sessionKey":"agent:main:main","senderId":"+1234567890","source":"telegram"}
672
+ {"timestamp":"2026-01-16T15:45:22.000Z","action":"stop","sessionKey":"agent:main:main","senderId":"user@example.com","source":"whatsapp"}
673
+ ```
674
+
675
+ **View logs**:
676
+
677
+ ```bash
678
+ # View recent commands
679
+ tail -n 20 ~/.pllan/logs/commands.log
680
+
681
+ # Pretty-print with jq
682
+ cat ~/.pllan/logs/commands.log | jq .
683
+
684
+ # Filter by action
685
+ grep '"action":"new"' ~/.pllan/logs/commands.log | jq .
686
+ ```
687
+
688
+ **Enable**:
689
+
690
+ ```bash
691
+ pllan hooks enable command-logger
692
+ ```
693
+
694
+ ### boot-md
695
+
696
+ Runs `BOOT.md` when the gateway starts (after channels start).
697
+ Internal hooks must be enabled for this to run.
698
+
699
+ **Events**: `gateway:startup`
700
+
701
+ **Requirements**: `workspace.dir` must be configured
702
+
703
+ **What it does**:
704
+
705
+ 1. Reads `BOOT.md` from your workspace
706
+ 2. Runs the instructions via the agent runner
707
+ 3. Sends any requested outbound messages via the message tool
708
+
709
+ **Enable**:
710
+
711
+ ```bash
712
+ pllan hooks enable boot-md
713
+ ```
714
+
715
+ ## Best Practices
716
+
717
+ ### Keep Handlers Fast
718
+
719
+ Hooks run during command processing. Keep them lightweight:
720
+
721
+ ```typescript
722
+ // ✓ Good - async work, returns immediately
723
+ const handler: HookHandler = async (event) => {
724
+ void processInBackground(event); // Fire and forget
725
+ };
726
+
727
+ // ✗ Bad - blocks command processing
728
+ const handler: HookHandler = async (event) => {
729
+ await slowDatabaseQuery(event);
730
+ await evenSlowerAPICall(event);
731
+ };
732
+ ```
733
+
734
+ ### Handle Errors Gracefully
735
+
736
+ Always wrap risky operations:
737
+
738
+ ```typescript
739
+ const handler: HookHandler = async (event) => {
740
+ try {
741
+ await riskyOperation(event);
742
+ } catch (err) {
743
+ console.error("[my-handler] Failed:", err instanceof Error ? err.message : String(err));
744
+ // Don't throw - let other handlers run
745
+ }
746
+ };
747
+ ```
748
+
749
+ ### Filter Events Early
750
+
751
+ Return early if the event isn't relevant:
752
+
753
+ ```typescript
754
+ const handler: HookHandler = async (event) => {
755
+ // Only handle 'new' commands
756
+ if (event.type !== "command" || event.action !== "new") {
757
+ return;
758
+ }
759
+
760
+ // Your logic here
761
+ };
762
+ ```
763
+
764
+ ### Use Specific Event Keys
765
+
766
+ Specify exact events in metadata when possible:
767
+
768
+ ```yaml
769
+ metadata: { "pllan": { "events": ["command:new"] } } # Specific
770
+ ```
771
+
772
+ Rather than:
773
+
774
+ ```yaml
775
+ metadata: { "pllan": { "events": ["command"] } } # General - more overhead
776
+ ```
777
+
778
+ ## Debugging
779
+
780
+ ### Enable Hook Logging
781
+
782
+ The gateway logs hook loading at startup:
783
+
784
+ ```
785
+ Registered hook: session-memory -> command:new
786
+ Registered hook: bootstrap-extra-files -> agent:bootstrap
787
+ Registered hook: command-logger -> command
788
+ Registered hook: boot-md -> gateway:startup
789
+ ```
790
+
791
+ ### Check Discovery
792
+
793
+ List all discovered hooks:
794
+
795
+ ```bash
796
+ pllan hooks list --verbose
797
+ ```
798
+
799
+ ### Check Registration
800
+
801
+ In your handler, log when it's called:
802
+
803
+ ```typescript
804
+ const handler: HookHandler = async (event) => {
805
+ console.log("[my-handler] Triggered:", event.type, event.action);
806
+ // Your logic
807
+ };
808
+ ```
809
+
810
+ ### Verify Eligibility
811
+
812
+ Check why a hook isn't eligible:
813
+
814
+ ```bash
815
+ pllan hooks info my-hook
816
+ ```
817
+
818
+ Look for missing requirements in the output.
819
+
820
+ ## Testing
821
+
822
+ ### Gateway Logs
823
+
824
+ Monitor gateway logs to see hook execution:
825
+
826
+ ```bash
827
+ # macOS
828
+ ./scripts/clawlog.sh -f
829
+
830
+ # Other platforms
831
+ tail -f ~/.pllan/gateway.log
832
+ ```
833
+
834
+ ### Test Hooks Directly
835
+
836
+ Test your handlers in isolation:
837
+
838
+ ```typescript
839
+ import { test } from "vitest";
840
+ import myHandler from "./hooks/my-hook/handler.js";
841
+
842
+ test("my handler works", async () => {
843
+ const event = {
844
+ type: "command",
845
+ action: "new",
846
+ sessionKey: "test-session",
847
+ timestamp: new Date(),
848
+ messages: [],
849
+ context: { foo: "bar" },
850
+ };
851
+
852
+ await myHandler(event);
853
+
854
+ // Assert side effects
855
+ });
856
+ ```
857
+
858
+ ## Architecture
859
+
860
+ ### Core Components
861
+
862
+ - **`src/hooks/types.ts`**: Type definitions
863
+ - **`src/hooks/workspace.ts`**: Directory scanning and loading
864
+ - **`src/hooks/frontmatter.ts`**: HOOK.md metadata parsing
865
+ - **`src/hooks/config.ts`**: Eligibility checking
866
+ - **`src/hooks/hooks-status.ts`**: Status reporting
867
+ - **`src/hooks/loader.ts`**: Dynamic module loader
868
+ - **`src/cli/hooks-cli.ts`**: CLI commands
869
+ - **`src/gateway/server-startup.ts`**: Loads hooks at gateway start
870
+ - **`src/auto-reply/reply/commands-core.ts`**: Triggers command events
871
+
872
+ ### Discovery Flow
873
+
874
+ ```
875
+ Gateway startup
876
+
877
+ Scan directories (workspace → managed → bundled)
878
+
879
+ Parse HOOK.md files
880
+
881
+ Check eligibility (bins, env, config, os)
882
+
883
+ Load handlers from eligible hooks
884
+
885
+ Register handlers for events
886
+ ```
887
+
888
+ ### Event Flow
889
+
890
+ ```
891
+ User sends /new
892
+
893
+ Command validation
894
+
895
+ Create hook event
896
+
897
+ Trigger hook (all registered handlers)
898
+
899
+ Command processing continues
900
+
901
+ Session reset
902
+ ```
903
+
904
+ ## Troubleshooting
905
+
906
+ ### Hook Not Discovered
907
+
908
+ 1. Check directory structure:
909
+
910
+ ```bash
911
+ ls -la ~/.pllan/hooks/my-hook/
912
+ # Should show: HOOK.md, handler.ts
913
+ ```
914
+
915
+ 2. Verify HOOK.md format:
916
+
917
+ ```bash
918
+ cat ~/.pllan/hooks/my-hook/HOOK.md
919
+ # Should have YAML frontmatter with name and metadata
920
+ ```
921
+
922
+ 3. List all discovered hooks:
923
+
924
+ ```bash
925
+ pllan hooks list
926
+ ```
927
+
928
+ ### Hook Not Eligible
929
+
930
+ Check requirements:
931
+
932
+ ```bash
933
+ pllan hooks info my-hook
934
+ ```
935
+
936
+ Look for missing:
937
+
938
+ - Binaries (check PATH)
939
+ - Environment variables
940
+ - Config values
941
+ - OS compatibility
942
+
943
+ ### Hook Not Executing
944
+
945
+ 1. Verify hook is enabled:
946
+
947
+ ```bash
948
+ pllan hooks list
949
+ # Should show ✓ next to enabled hooks
950
+ ```
951
+
952
+ 2. Restart your gateway process so hooks reload.
953
+
954
+ 3. Check gateway logs for errors:
955
+
956
+ ```bash
957
+ ./scripts/clawlog.sh | grep hook
958
+ ```
959
+
960
+ ### Handler Errors
961
+
962
+ Check for TypeScript/import errors:
963
+
964
+ ```bash
965
+ # Test import directly
966
+ node -e "import('./path/to/handler.ts').then(console.log)"
967
+ ```
968
+
969
+ ## Migration Guide
970
+
971
+ ### From Legacy Config to Discovery
972
+
973
+ **Before**:
974
+
975
+ ```json
976
+ {
977
+ "hooks": {
978
+ "internal": {
979
+ "enabled": true,
980
+ "handlers": [
981
+ {
982
+ "event": "command:new",
983
+ "module": "./hooks/handlers/my-handler.ts"
984
+ }
985
+ ]
986
+ }
987
+ }
988
+ }
989
+ ```
990
+
991
+ **After**:
992
+
993
+ 1. Create hook directory:
994
+
995
+ ```bash
996
+ mkdir -p ~/.pllan/hooks/my-hook
997
+ mv ./hooks/handlers/my-handler.ts ~/.pllan/hooks/my-hook/handler.ts
998
+ ```
999
+
1000
+ 2. Create HOOK.md:
1001
+
1002
+ ```markdown
1003
+ ---
1004
+ name: my-hook
1005
+ description: "My custom hook"
1006
+ metadata: { "pllan": { "emoji": "🎯", "events": ["command:new"] } }
1007
+ ---
1008
+
1009
+ # My Hook
1010
+
1011
+ Does something useful.
1012
+ ```
1013
+
1014
+ 3. Update config:
1015
+
1016
+ ```json
1017
+ {
1018
+ "hooks": {
1019
+ "internal": {
1020
+ "enabled": true,
1021
+ "entries": {
1022
+ "my-hook": { "enabled": true }
1023
+ }
1024
+ }
1025
+ }
1026
+ }
1027
+ ```
1028
+
1029
+ 4. Verify and restart your gateway process:
1030
+
1031
+ ```bash
1032
+ pllan hooks list
1033
+ # Should show: 🎯 my-hook ✓
1034
+ ```
1035
+
1036
+ **Benefits of migration**:
1037
+
1038
+ - Automatic discovery
1039
+ - CLI management
1040
+ - Eligibility checking
1041
+ - Better documentation
1042
+ - Consistent structure
1043
+
1044
+ ## See Also
1045
+
1046
+ - [CLI Reference: hooks](/cli/hooks)
1047
+ - [Bundled Hooks README](https://github.com/pllan/pllan/tree/main/src/hooks/bundled)
1048
+ - [Webhook Hooks](/automation/webhook)
1049
+ - [Configuration](/gateway/configuration-reference#hooks)