@captain-app/openclaw 2026.2.4

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 (1686) hide show
  1. package/CHANGELOG.md +1528 -0
  2. package/LICENSE +21 -0
  3. package/README-header.png +0 -0
  4. package/README.md +539 -0
  5. package/assets/avatar-placeholder.svg +19 -0
  6. package/assets/chrome-extension/README.md +22 -0
  7. package/assets/chrome-extension/background.js +438 -0
  8. package/assets/chrome-extension/icons/icon128.png +0 -0
  9. package/assets/chrome-extension/icons/icon16.png +0 -0
  10. package/assets/chrome-extension/icons/icon32.png +0 -0
  11. package/assets/chrome-extension/icons/icon48.png +0 -0
  12. package/assets/chrome-extension/manifest.json +25 -0
  13. package/assets/chrome-extension/options.html +196 -0
  14. package/assets/chrome-extension/options.js +59 -0
  15. package/assets/dmg-background-small.png +0 -0
  16. package/assets/dmg-background.png +0 -0
  17. package/dist/accounts-ClnuDahN.js +250 -0
  18. package/dist/accounts-DzBgAM3C.js +251 -0
  19. package/dist/acp-cli-BEDDkzXH.js +926 -0
  20. package/dist/acp-cli-CwV4mdnW.js +923 -0
  21. package/dist/agent-CArjbSeE.js +695 -0
  22. package/dist/agent-CB7x5HLT.js +695 -0
  23. package/dist/agent-scope-BbT4OG2N.js +545 -0
  24. package/dist/agent-scope-C_O6Vpl0.js +545 -0
  25. package/dist/agent-scope-Csu2B6AM.js +606 -0
  26. package/dist/archive-CWrnG1CH.js +85 -0
  27. package/dist/archive-ccN9aDgq.js +85 -0
  28. package/dist/audit-DXPkQ275.js +1686 -0
  29. package/dist/audit-eH7nwgsM.js +1686 -0
  30. package/dist/auth-health-Bj7Gjbv0.js +149 -0
  31. package/dist/auth-health-CjjJhHey.js +149 -0
  32. package/dist/auth-nnRYiqpH.js +192 -0
  33. package/dist/auth-profiles-DVLfuixr.js +2954 -0
  34. package/dist/auth-y1BLPUhX.js +192 -0
  35. package/dist/boolean-Wzu0-e0P.js +30 -0
  36. package/dist/brew-Cqi8b49_.js +46 -0
  37. package/dist/brew-DyBGNK8A.js +46 -0
  38. package/dist/build-info.json +5 -0
  39. package/dist/call-B7EveN4V.js +252 -0
  40. package/dist/call-vuUQIjOj.js +252 -0
  41. package/dist/canvas-host/a2ui/.bundle.hash +1 -0
  42. package/dist/canvas-host/a2ui/a2ui.bundle.js +17780 -0
  43. package/dist/canvas-host/a2ui/index.html +307 -0
  44. package/dist/channel-options-CJfmOkol.js +32 -0
  45. package/dist/channel-options-lFguMTz1.js +62 -0
  46. package/dist/channel-selection-BmND9mWj.js +51 -0
  47. package/dist/channel-selection-cGhL9G0c.js +51 -0
  48. package/dist/channel-summary-B4G513Eb.js +1154 -0
  49. package/dist/channel-summary-MCwBCa5y.js +1154 -0
  50. package/dist/channels-cli-C2Of1mZG.js +1411 -0
  51. package/dist/channels-cli-DFynrP1H.js +1413 -0
  52. package/dist/channels-status-issues-YohTjZ-I.js +18 -0
  53. package/dist/channels-status-issues-ZcR1U-m5.js +18 -0
  54. package/dist/chrome-B3IuUad-.js +1953 -0
  55. package/dist/chrome-BZ9K48w9.js +1973 -0
  56. package/dist/clack-prompter-B9yLhyOm.js +92 -0
  57. package/dist/clack-prompter-BybM9xdL.js +92 -0
  58. package/dist/cli/daemon-cli.js +2 -0
  59. package/dist/cli-BJZdJwug.js +89 -0
  60. package/dist/cli-BQSoKu3d.js +86 -0
  61. package/dist/cli-utils-CO4jEMn0.js +43 -0
  62. package/dist/cli-utils-gtE-0a0D.js +43 -0
  63. package/dist/client-DPqNOpK3.js +1609 -0
  64. package/dist/client-DySXIFCA.js +1609 -0
  65. package/dist/command-format-CFzL448l.js +52 -0
  66. package/dist/command-format-DELazozB.js +52 -0
  67. package/dist/command-format-ayFsmwwz.js +38 -0
  68. package/dist/command-options-CsjxK4cZ.js +33 -0
  69. package/dist/commands-BRe9VTyU.js +229 -0
  70. package/dist/completion-cli-DlkjK0iC.js +390 -0
  71. package/dist/completion-cli-E6Pt41AL.js +387 -0
  72. package/dist/config-BtSTwPcH.js +4882 -0
  73. package/dist/config-DfMIMT-f.js +4881 -0
  74. package/dist/config-_d7_WcRv.js +5623 -0
  75. package/dist/config-guard-wSnm-U8a.js +5628 -0
  76. package/dist/configure-CPHAFKlg.js +895 -0
  77. package/dist/configure-DK1XgXYx.js +894 -0
  78. package/dist/constants-CNTiY-ZN.js +65 -0
  79. package/dist/constants-hpmbslG7.js +65 -0
  80. package/dist/control-service-CqX5g_ko.js +61 -0
  81. package/dist/control-service-o6xe3hEb.js +61 -0
  82. package/dist/control-ui/apple-touch-icon.png +0 -0
  83. package/dist/control-ui/assets/index-RwcW4Xl0.css +1 -0
  84. package/dist/control-ui/assets/index-ryaCcbyp.js +4584 -0
  85. package/dist/control-ui/assets/index-ryaCcbyp.js.map +1 -0
  86. package/dist/control-ui/favicon-32.png +0 -0
  87. package/dist/control-ui/favicon.ico +0 -0
  88. package/dist/control-ui/favicon.svg +22 -0
  89. package/dist/control-ui/index.html +17 -0
  90. package/dist/cron-cli-BoSaDgvH.js +453 -0
  91. package/dist/cron-cli-qVandvsD.js +456 -0
  92. package/dist/daemon-cli-C4gGWa15.js +760 -0
  93. package/dist/daemon-cli-DV_X0Krf.js +761 -0
  94. package/dist/daemon-runtime-D5hbSrdO.js +460 -0
  95. package/dist/daemon-runtime-DXUfrXBC.js +460 -0
  96. package/dist/deliver-BxK5nI2P.js +2587 -0
  97. package/dist/deliver-Dwzg9LUd.js +2557 -0
  98. package/dist/deliver-qpYZp20m.js +2587 -0
  99. package/dist/deps-CUXtMV9d.js +27 -0
  100. package/dist/deps-WBvZpFV_.js +27 -0
  101. package/dist/devices-cli-B2s18Qrh.js +207 -0
  102. package/dist/devices-cli-D1UEtMUJ.js +204 -0
  103. package/dist/directory-cli-BXQbrkfM.js +247 -0
  104. package/dist/directory-cli-CqA7tRbq.js +244 -0
  105. package/dist/dispatcher-Dyv7T-1r.js +160 -0
  106. package/dist/dns-cli-CWxKD22D.js +198 -0
  107. package/dist/dns-cli-CzKr_Fxj.js +201 -0
  108. package/dist/docs-cli-BNyxUbWr.js +159 -0
  109. package/dist/docs-cli-DYpTbo3i.js +161 -0
  110. package/dist/doctor-C8fDYZLq.js +2583 -0
  111. package/dist/doctor-hYcqp7c0.js +2585 -0
  112. package/dist/entry.js +1326 -0
  113. package/dist/env-l7QVNj6j.js +32 -0
  114. package/dist/errors-CMCg46fK.js +1952 -0
  115. package/dist/exec-B8JKbXKW.js +246 -0
  116. package/dist/exec-BMnoMcZW.js +1099 -0
  117. package/dist/exec-HEWTMJ7j.js +246 -0
  118. package/dist/exec-approvals-DtrnHx6M.js +1026 -0
  119. package/dist/exec-approvals-Y42bE8ud.js +1026 -0
  120. package/dist/exec-approvals-cli-CIedYxP3.js +385 -0
  121. package/dist/exec-approvals-cli-xpbxnj4O.js +388 -0
  122. package/dist/extensionAPI.js +66572 -0
  123. package/dist/format-Dzy9uRLE.js +34 -0
  124. package/dist/format-sj0fELBK.js +34 -0
  125. package/dist/gateway-cli-5A-KNLEC.js +16635 -0
  126. package/dist/gateway-cli-B8kS4chb.js +16637 -0
  127. package/dist/gateway-rpc-15n38Ize.js +28 -0
  128. package/dist/gateway-rpc-TMVRgGfj.js +28 -0
  129. package/dist/github-copilot-auth-DVZj4Zgh.js +1104 -0
  130. package/dist/github-copilot-auth-DeGYyLY9.js +1104 -0
  131. package/dist/github-copilot-token-B3SA95yo.js +103 -0
  132. package/dist/github-copilot-token-C8XFYz0i.js +103 -0
  133. package/dist/github-copilot-token-CnxakiSC.js +103 -0
  134. package/dist/gmail-setup-utils-CWPC386a.js +428 -0
  135. package/dist/gmail-setup-utils-eJVB5Ewp.js +428 -0
  136. package/dist/health-format-B0tMTk3C.js +1189 -0
  137. package/dist/health-format-DaURVaUn.js +1188 -0
  138. package/dist/help-format-CEsRHU2f.js +17 -0
  139. package/dist/help-format-GuCWws6r.js +17 -0
  140. package/dist/helpers-BEJ-phFf.js +25 -0
  141. package/dist/helpers-BtbBZVKZ.js +10 -0
  142. package/dist/helpers-C12w9zxf.js +10 -0
  143. package/dist/helpers-CzjGJZmJ.js +25 -0
  144. package/dist/hooks/bundled/boot-md/HOOK.md +19 -0
  145. package/dist/hooks/bundled/command-logger/HOOK.md +122 -0
  146. package/dist/hooks/bundled/session-memory/HOOK.md +109 -0
  147. package/dist/hooks/bundled/soul-evil/HOOK.md +71 -0
  148. package/dist/hooks-cli-BZCMAnW2.js +1058 -0
  149. package/dist/hooks-cli-D0CEFg3P.js +1061 -0
  150. package/dist/hooks-status-Bn7_O8PM.js +443 -0
  151. package/dist/hooks-status-BrWVfIn0.js +443 -0
  152. package/dist/image-BS022pvv.js +1421 -0
  153. package/dist/image-BzJtY34J.js +629 -0
  154. package/dist/image-CBqmIbQQ.js +629 -0
  155. package/dist/index.js +5809 -0
  156. package/dist/installs-BP4K5L33.js +388 -0
  157. package/dist/installs-DOpTt7VZ.js +388 -0
  158. package/dist/is-main-B4o72sqg.js +25 -0
  159. package/dist/is-main-PYGa3tDA.js +25 -0
  160. package/dist/links-B4nk2iDf.js +15 -0
  161. package/dist/links-DwjRqxgR.js +15 -0
  162. package/dist/loader-Cn4EV_pf.js +63690 -0
  163. package/dist/logging-CS3tbYDj.js +15 -0
  164. package/dist/logging-CY-Q5cwf.js +1 -0
  165. package/dist/logging-DhiLkhLw.js +15 -0
  166. package/dist/logging-pqyrk15z.js +1 -0
  167. package/dist/login-qr-CD164Aw1.js +478 -0
  168. package/dist/login-qr-D7Zdgji2.js +478 -0
  169. package/dist/login-qr-YgILJ4VC.js +475 -0
  170. package/dist/logs-cli-BdS0Uv0I.js +227 -0
  171. package/dist/logs-cli-CqSN1GzB.js +230 -0
  172. package/dist/manager-CfGY5zND.js +2870 -0
  173. package/dist/manager-CjuBqFRL.js +2870 -0
  174. package/dist/manager-CoBEAQKm.js +2872 -0
  175. package/dist/manifest-registry-Bwjq9Iev.js +668 -0
  176. package/dist/manifest-registry-D2Yntqcb.js +668 -0
  177. package/dist/message-channel-Cjsiqxok.js +105 -0
  178. package/dist/message-channel-D6v_oPAg.js +105 -0
  179. package/dist/model-selection-Cv5Ox_tY.js +2956 -0
  180. package/dist/model-selection-Dr-5U5-l.js +2708 -0
  181. package/dist/models-cli-B39ckynD.js +2541 -0
  182. package/dist/models-cli-DoiYsBYw.js +2544 -0
  183. package/dist/net-CFCxaipF.js +137 -0
  184. package/dist/net-DKJPqXuW.js +137 -0
  185. package/dist/node-cli-C_FYF-RA.js +1456 -0
  186. package/dist/node-cli-DWPoNsQS.js +1459 -0
  187. package/dist/node-service-DcJREOww.js +67 -0
  188. package/dist/node-service-DuZ9Us9h.js +67 -0
  189. package/dist/nodes-cli-Elo6tlen.js +1210 -0
  190. package/dist/nodes-cli-zqryRUWB.js +1207 -0
  191. package/dist/nodes-screen-C4aCrxie.js +157 -0
  192. package/dist/nodes-screen-D4PSynkR.js +157 -0
  193. package/dist/note-CQhSvgQv.js +73 -0
  194. package/dist/note-_C44YfAQ.js +73 -0
  195. package/dist/onboard-channels-CHBDi-ZA.js +670 -0
  196. package/dist/onboard-channels-DOEKyxaL.js +670 -0
  197. package/dist/onboard-skills-BUTXREDZ.js +3327 -0
  198. package/dist/onboard-skills-CSLYZmZA.js +3327 -0
  199. package/dist/onboarding-CgKb8b39.js +3232 -0
  200. package/dist/openclaw-root-9ILYSmJ9.js +84 -0
  201. package/dist/openclaw-root-Cvotktkd.js +84 -0
  202. package/dist/pairing-cli-B4UGR2at.js +114 -0
  203. package/dist/pairing-cli-BWDDl8cf.js +117 -0
  204. package/dist/pairing-labels-ClZ-fTWT.js +9 -0
  205. package/dist/pairing-labels-Ds7BPOkj.js +9 -0
  206. package/dist/pairing-store-DDLNuzmx.js +391 -0
  207. package/dist/pairing-store-DRn08lZD.js +391 -0
  208. package/dist/parse-87ybtYW1.js +23 -0
  209. package/dist/parse-OCFfznr3.js +23 -0
  210. package/dist/parse-log-line-C9aL5PUL.js +44 -0
  211. package/dist/parse-log-line-DxRaGzQb.js +44 -0
  212. package/dist/parse-timeout-CFqNj7No.js +16 -0
  213. package/dist/parse-timeout-DV8NQQWk.js +16 -0
  214. package/dist/path-env-C7kiJUgG.js +77 -0
  215. package/dist/path-env-DEj4CiFN.js +77 -0
  216. package/dist/paths-B-q1nXdY.js +43 -0
  217. package/dist/paths-B1kfl4h5.js +164 -0
  218. package/dist/paths-B4kigINg.js +40 -0
  219. package/dist/paths-CHGbP1-A.js +43 -0
  220. package/dist/paths-scjhy7N2.js +180 -0
  221. package/dist/pi-embedded-helpers-C19wUpMB.js +8451 -0
  222. package/dist/pi-embedded-helpers-CT5VuLCb.js +1293 -0
  223. package/dist/pi-embedded-helpers-Dl8e5Rf8.js +1293 -0
  224. package/dist/pi-model-discovery-B6CsmK6Y.js +20 -0
  225. package/dist/pi-model-discovery-DsRqYJLy.js +20 -0
  226. package/dist/pi-model-discovery-EhM2JAQo.js +20 -0
  227. package/dist/pi-tools.policy-BvkSDFDN.js +229 -0
  228. package/dist/plugin-auto-enable-Bd_StZzz.js +461 -0
  229. package/dist/plugin-auto-enable-DBhXb_0x.js +461 -0
  230. package/dist/plugin-sdk/agent-scope-DdwUKIOe.js +606 -0
  231. package/dist/plugin-sdk/chrome-G8apFa5p.js +1953 -0
  232. package/dist/plugin-sdk/command-format-qUVxzqYm.js +52 -0
  233. package/dist/plugin-sdk/config-Cm1M7tgH.js +5623 -0
  234. package/dist/plugin-sdk/deliver-Cl8uowiO.js +2557 -0
  235. package/dist/plugin-sdk/exec-Cm9b2r9Q.js +1107 -0
  236. package/dist/plugin-sdk/github-copilot-token-BHNcM4_B.js +103 -0
  237. package/dist/plugin-sdk/image-7PgoS2VD.js +1421 -0
  238. package/dist/plugin-sdk/index.d.ts +8908 -0
  239. package/dist/plugin-sdk/index.js +70888 -0
  240. package/dist/plugin-sdk/login-qr-qTALvWi2.js +475 -0
  241. package/dist/plugin-sdk/manager-Cs3EQZCb.js +2870 -0
  242. package/dist/plugin-sdk/model-selection-BgC1E1a7.js +2708 -0
  243. package/dist/plugin-sdk/paths-BYpoyRv5.js +164 -0
  244. package/dist/plugin-sdk/paths-DNQE-bvr.js +40 -0
  245. package/dist/plugin-sdk/pi-embedded-helpers-5jNqW_dE.js +8755 -0
  246. package/dist/plugin-sdk/pi-model-discovery-BUGEht9A.js +20 -0
  247. package/dist/plugin-sdk/pw-ai-COTtei4a.js +1649 -0
  248. package/dist/plugin-sdk/qmd-manager-ClSwiAJl.js +615 -0
  249. package/dist/plugin-sdk/redact-2AzjOfk2.js +94 -0
  250. package/dist/plugin-sdk/rolldown-runtime-Cbj13DAv.js +20 -0
  251. package/dist/plugin-sdk/sqlite-gCW7MlLs.js +215 -0
  252. package/dist/plugin-sdk/transcript-events-DGF257vD.js +17 -0
  253. package/dist/plugins-C3Bm-HQV.js +494 -0
  254. package/dist/plugins-QJjTXliB.js +495 -0
  255. package/dist/plugins-cli-DTci0JQb.js +443 -0
  256. package/dist/plugins-cli-wJsN1HHK.js +440 -0
  257. package/dist/ports-CiW9dmMq.js +96 -0
  258. package/dist/program-BWpTHh1I.js +188 -0
  259. package/dist/progress-Bcjniu7m.js +133 -0
  260. package/dist/progress-CvaSPjS9.js +133 -0
  261. package/dist/prompt-style-CFsleyxV.js +9 -0
  262. package/dist/prompt-style-DYJdrXyV.js +9 -0
  263. package/dist/prompts-Bt9fwsg2.js +10 -0
  264. package/dist/prompts-CudpZgTI.js +10 -0
  265. package/dist/pw-ai-08F3GD-3.js +1649 -0
  266. package/dist/pw-ai-ZmHxHQnx.js +1651 -0
  267. package/dist/pw-ai-tNPuRNn3.js +1649 -0
  268. package/dist/qmd-manager-2r-4n3sP.js +617 -0
  269. package/dist/qmd-manager-CF52nuBg.js +615 -0
  270. package/dist/qmd-manager-HEm5H2mk.js +616 -0
  271. package/dist/redact-BICFkpn7.js +97 -0
  272. package/dist/redact-BIMJ3ntQ.js +94 -0
  273. package/dist/redact-KzWHRS5J.js +97 -0
  274. package/dist/register.subclis-D2K25c84.js +348 -0
  275. package/dist/register.subclis-Dd8LbOLi.js +342 -0
  276. package/dist/reply-5UNWRwMn.js +63693 -0
  277. package/dist/restart-sentinel-Cr0vUxB8.js +65 -0
  278. package/dist/restart-sentinel-DUemCjgU.js +65 -0
  279. package/dist/rolldown-runtime-Cbj13DAv.js +20 -0
  280. package/dist/routes-C6UpTPas.js +2410 -0
  281. package/dist/routes-ClNyEvlm.js +2410 -0
  282. package/dist/rpc-D0mf7DIw.js +95 -0
  283. package/dist/rpc-DYdOrgd9.js +95 -0
  284. package/dist/run-main-CojI7gWx.js +194 -0
  285. package/dist/runtime-guard-68M_evhb.js +60 -0
  286. package/dist/runtime-guard-DkjmhnBD.js +60 -0
  287. package/dist/sandbox-Ca81z3Tw.js +2924 -0
  288. package/dist/sandbox-cli-D75GApgp.js +459 -0
  289. package/dist/sandbox-cli-E4SJsC1C.js +462 -0
  290. package/dist/sandbox-knontqD9.js +2925 -0
  291. package/dist/security-cli-BLihvXO-.js +503 -0
  292. package/dist/security-cli-IGQCsK4g.js +506 -0
  293. package/dist/server-context-B9GX5GOI.js +740 -0
  294. package/dist/server-context-BFH7HB_M.js +740 -0
  295. package/dist/server-node-events-CTdHBiEA.js +218 -0
  296. package/dist/server-node-events-DAV14qPr.js +215 -0
  297. package/dist/service-BZNBq9hq.js +680 -0
  298. package/dist/service-C-BLXx9U.js +680 -0
  299. package/dist/service-audit-BfJv4NqZ.js +542 -0
  300. package/dist/service-audit-Bw3M2OEI.js +542 -0
  301. package/dist/shared-5SH-45AX.js +74 -0
  302. package/dist/shared-BxRm5uLU.js +74 -0
  303. package/dist/shared-C80Rmxsd.js +150 -0
  304. package/dist/shared-fGK6_D2v.js +150 -0
  305. package/dist/skills-Bhp0l6UK.js +693 -0
  306. package/dist/skills-Tky2kCMO.js +694 -0
  307. package/dist/skills-cli-6rCClAE4.js +287 -0
  308. package/dist/skills-cli-C4nLCrLw.js +290 -0
  309. package/dist/skills-status-CENcKr3I.js +187 -0
  310. package/dist/skills-status-DX1eUYvk.js +187 -0
  311. package/dist/sqlite-CmdZSZRx.js +197 -0
  312. package/dist/sqlite-Dnmf3LS7.js +215 -0
  313. package/dist/sqlite-QDf0yuU0.js +215 -0
  314. package/dist/status-BSfGAp2D.js +27 -0
  315. package/dist/status-Bp_2NMjt.js +27 -0
  316. package/dist/status-C0ANDr0T.js +3140 -0
  317. package/dist/status-CCHBIZnm.js +21 -0
  318. package/dist/status-Vuqbw2Bb.js +21 -0
  319. package/dist/status.update-BZW5r8Su.js +79 -0
  320. package/dist/status.update-BnD93_O8.js +79 -0
  321. package/dist/subsystem-CAq3uyo7.js +834 -0
  322. package/dist/system-cli-Bb9zmCO1.js +83 -0
  323. package/dist/system-cli-TIIQ04ls.js +80 -0
  324. package/dist/systemd-0Qa_nGqe.js +438 -0
  325. package/dist/systemd-Czb0Xsm7.js +438 -0
  326. package/dist/systemd-hints-CWoEOQRb.js +19 -0
  327. package/dist/systemd-hints-Cv3RN_mZ.js +19 -0
  328. package/dist/systemd-linger-CsdvcIoS.js +75 -0
  329. package/dist/systemd-linger-DKUFHcLn.js +75 -0
  330. package/dist/table-DNPESyNj.js +279 -0
  331. package/dist/table-DS4-gmkV.js +279 -0
  332. package/dist/tailnet-Bg_vE5qi.js +42 -0
  333. package/dist/tailnet-CrNWlQRJ.js +42 -0
  334. package/dist/tailscale-CBv58toW.js +252 -0
  335. package/dist/tailscale-DCnMs7_q.js +225 -0
  336. package/dist/tool-display-BEACy9rK.js +795 -0
  337. package/dist/tool-display-NYQnSpdo.js +795 -0
  338. package/dist/transcript-events-CsB1Saa6.js +17 -0
  339. package/dist/transcript-events-DDYvbmRV.js +17 -0
  340. package/dist/transcript-events-JLH5W4He.js +17 -0
  341. package/dist/tui--NY0rnjr.js +2542 -0
  342. package/dist/tui-DqJfGtvM.js +2543 -0
  343. package/dist/tui-cli-BuHNY6wF.js +54 -0
  344. package/dist/tui-cli-LMFV982e.js +57 -0
  345. package/dist/update-CRpHtCgz.js +317 -0
  346. package/dist/update-D3qruxhj.js +317 -0
  347. package/dist/update-cli-CFF-pslM.js +948 -0
  348. package/dist/update-cli-cn9pEMX7.js +951 -0
  349. package/dist/update-runner-CxGU142L.js +1221 -0
  350. package/dist/update-runner-DNobz_ft.js +1221 -0
  351. package/dist/utils-CKSrBNwq.js +192 -0
  352. package/dist/utils-DX85MiPR.js +188 -0
  353. package/dist/webhooks-cli-BGtt2HAR.js +312 -0
  354. package/dist/webhooks-cli-DHLZrEO_.js +309 -0
  355. package/dist/widearea-dns-BpG7ATO8.js +127 -0
  356. package/dist/widearea-dns-D4wkCJly.js +127 -0
  357. package/dist/ws-3zr8WUwL.js +13 -0
  358. package/dist/ws-log-BXcT2xQk.js +267 -0
  359. package/dist/ws-log-DbDIUsgz.js +267 -0
  360. package/dist/ws-lzrgabja.js +13 -0
  361. package/dist/wsl-D2O2qOrl.js +160 -0
  362. package/docs/.i18n/README.md +31 -0
  363. package/docs/.i18n/glossary.zh-CN.json +190 -0
  364. package/docs/.i18n/zh-CN.tm.jsonl +1329 -0
  365. package/docs/CNAME +1 -0
  366. package/docs/_config.yml +53 -0
  367. package/docs/_layouts/default.html +145 -0
  368. package/docs/assets/markdown.css +179 -0
  369. package/docs/assets/openclaw-logo-text-dark.png +0 -0
  370. package/docs/assets/openclaw-logo-text.png +0 -0
  371. package/docs/assets/pixel-lobster.svg +60 -0
  372. package/docs/assets/showcase/agents-ui.jpg +0 -0
  373. package/docs/assets/showcase/bambu-cli.png +0 -0
  374. package/docs/assets/showcase/codexmonitor.png +0 -0
  375. package/docs/assets/showcase/gohome-grafana.png +0 -0
  376. package/docs/assets/showcase/ios-testflight.jpg +0 -0
  377. package/docs/assets/showcase/oura-health.png +0 -0
  378. package/docs/assets/showcase/padel-cli.svg +11 -0
  379. package/docs/assets/showcase/padel-screenshot.jpg +0 -0
  380. package/docs/assets/showcase/papla-tts.jpg +0 -0
  381. package/docs/assets/showcase/pr-review-telegram.jpg +0 -0
  382. package/docs/assets/showcase/roborock-screenshot.jpg +0 -0
  383. package/docs/assets/showcase/roborock-status.svg +13 -0
  384. package/docs/assets/showcase/roof-camera-sky.jpg +0 -0
  385. package/docs/assets/showcase/snag.png +0 -0
  386. package/docs/assets/showcase/tesco-shop.jpg +0 -0
  387. package/docs/assets/showcase/wienerlinien.png +0 -0
  388. package/docs/assets/showcase/wine-cellar-skill.jpg +0 -0
  389. package/docs/assets/showcase/winix-air-purifier.jpg +0 -0
  390. package/docs/assets/showcase/xuezh-pronunciation.jpeg +0 -0
  391. package/docs/assets/terminal.css +473 -0
  392. package/docs/assets/theme.js +55 -0
  393. package/docs/automation/auth-monitoring.md +44 -0
  394. package/docs/automation/cron-jobs.md +468 -0
  395. package/docs/automation/cron-vs-heartbeat.md +282 -0
  396. package/docs/automation/gmail-pubsub.md +256 -0
  397. package/docs/automation/poll.md +69 -0
  398. package/docs/automation/webhook.md +163 -0
  399. package/docs/bedrock.md +176 -0
  400. package/docs/brave-search.md +41 -0
  401. package/docs/broadcast-groups.md +442 -0
  402. package/docs/channels/bluebubbles.md +338 -0
  403. package/docs/channels/discord.md +475 -0
  404. package/docs/channels/feishu.md +507 -0
  405. package/docs/channels/googlechat.md +250 -0
  406. package/docs/channels/grammy.md +31 -0
  407. package/docs/channels/imessage.md +299 -0
  408. package/docs/channels/index.md +46 -0
  409. package/docs/channels/line.md +186 -0
  410. package/docs/channels/location.md +56 -0
  411. package/docs/channels/matrix.md +233 -0
  412. package/docs/channels/mattermost.md +138 -0
  413. package/docs/channels/msteams.md +768 -0
  414. package/docs/channels/nextcloud-talk.md +136 -0
  415. package/docs/channels/nostr.md +233 -0
  416. package/docs/channels/signal.md +202 -0
  417. package/docs/channels/slack.md +548 -0
  418. package/docs/channels/telegram.md +750 -0
  419. package/docs/channels/tlon.md +132 -0
  420. package/docs/channels/troubleshooting.md +29 -0
  421. package/docs/channels/twitch.md +379 -0
  422. package/docs/channels/whatsapp.md +404 -0
  423. package/docs/channels/zalo.md +189 -0
  424. package/docs/channels/zalouser.md +140 -0
  425. package/docs/cli/acp.md +170 -0
  426. package/docs/cli/agent.md +24 -0
  427. package/docs/cli/agents.md +75 -0
  428. package/docs/cli/approvals.md +50 -0
  429. package/docs/cli/browser.md +107 -0
  430. package/docs/cli/channels.md +79 -0
  431. package/docs/cli/config.md +50 -0
  432. package/docs/cli/configure.md +33 -0
  433. package/docs/cli/cron.md +42 -0
  434. package/docs/cli/dashboard.md +16 -0
  435. package/docs/cli/devices.md +67 -0
  436. package/docs/cli/directory.md +63 -0
  437. package/docs/cli/dns.md +23 -0
  438. package/docs/cli/docs.md +15 -0
  439. package/docs/cli/doctor.md +41 -0
  440. package/docs/cli/gateway.md +199 -0
  441. package/docs/cli/health.md +21 -0
  442. package/docs/cli/hooks.md +304 -0
  443. package/docs/cli/index.md +1029 -0
  444. package/docs/cli/logs.md +24 -0
  445. package/docs/cli/memory.md +45 -0
  446. package/docs/cli/message.md +239 -0
  447. package/docs/cli/models.md +79 -0
  448. package/docs/cli/node.md +112 -0
  449. package/docs/cli/nodes.md +73 -0
  450. package/docs/cli/onboard.md +29 -0
  451. package/docs/cli/pairing.md +21 -0
  452. package/docs/cli/plugins.md +62 -0
  453. package/docs/cli/reset.md +17 -0
  454. package/docs/cli/sandbox.md +152 -0
  455. package/docs/cli/security.md +26 -0
  456. package/docs/cli/sessions.md +16 -0
  457. package/docs/cli/setup.md +29 -0
  458. package/docs/cli/skills.md +26 -0
  459. package/docs/cli/status.md +26 -0
  460. package/docs/cli/system.md +60 -0
  461. package/docs/cli/tui.md +23 -0
  462. package/docs/cli/uninstall.md +17 -0
  463. package/docs/cli/update.md +98 -0
  464. package/docs/cli/voicecall.md +34 -0
  465. package/docs/cli/webhooks.md +25 -0
  466. package/docs/concepts/agent-loop.md +146 -0
  467. package/docs/concepts/agent-workspace.md +233 -0
  468. package/docs/concepts/agent.md +123 -0
  469. package/docs/concepts/architecture.md +129 -0
  470. package/docs/concepts/channel-routing.md +114 -0
  471. package/docs/concepts/compaction.md +61 -0
  472. package/docs/concepts/context.md +161 -0
  473. package/docs/concepts/group-messages.md +84 -0
  474. package/docs/concepts/groups.md +373 -0
  475. package/docs/concepts/markdown-formatting.md +130 -0
  476. package/docs/concepts/memory.md +546 -0
  477. package/docs/concepts/messages.md +154 -0
  478. package/docs/concepts/model-failover.md +149 -0
  479. package/docs/concepts/model-providers.md +316 -0
  480. package/docs/concepts/models.md +208 -0
  481. package/docs/concepts/multi-agent.md +376 -0
  482. package/docs/concepts/oauth.md +145 -0
  483. package/docs/concepts/presence.md +102 -0
  484. package/docs/concepts/queue.md +89 -0
  485. package/docs/concepts/retry.md +69 -0
  486. package/docs/concepts/session-pruning.md +122 -0
  487. package/docs/concepts/session-tool.md +193 -0
  488. package/docs/concepts/session.md +188 -0
  489. package/docs/concepts/sessions.md +10 -0
  490. package/docs/concepts/streaming.md +135 -0
  491. package/docs/concepts/system-prompt.md +115 -0
  492. package/docs/concepts/timezone.md +91 -0
  493. package/docs/concepts/typebox.md +289 -0
  494. package/docs/concepts/typing-indicators.md +68 -0
  495. package/docs/concepts/usage-tracking.md +35 -0
  496. package/docs/date-time.md +128 -0
  497. package/docs/debug/node-issue.md +83 -0
  498. package/docs/debugging.md +162 -0
  499. package/docs/diagnostics/flags.md +91 -0
  500. package/docs/docs.json +1587 -0
  501. package/docs/environment.md +81 -0
  502. package/docs/experiments/onboarding-config-protocol.md +40 -0
  503. package/docs/experiments/plans/cron-add-hardening.md +63 -0
  504. package/docs/experiments/plans/group-policy-hardening.md +40 -0
  505. package/docs/experiments/plans/openresponses-gateway.md +123 -0
  506. package/docs/experiments/proposals/model-config.md +36 -0
  507. package/docs/experiments/research/memory.md +228 -0
  508. package/docs/gateway/authentication.md +145 -0
  509. package/docs/gateway/background-process.md +93 -0
  510. package/docs/gateway/bonjour.md +167 -0
  511. package/docs/gateway/bridge-protocol.md +89 -0
  512. package/docs/gateway/cli-backends.md +223 -0
  513. package/docs/gateway/configuration-examples.md +606 -0
  514. package/docs/gateway/configuration.md +3393 -0
  515. package/docs/gateway/discovery.md +116 -0
  516. package/docs/gateway/doctor.md +282 -0
  517. package/docs/gateway/gateway-lock.md +34 -0
  518. package/docs/gateway/health.md +35 -0
  519. package/docs/gateway/heartbeat.md +302 -0
  520. package/docs/gateway/index.md +328 -0
  521. package/docs/gateway/local-models.md +150 -0
  522. package/docs/gateway/logging.md +113 -0
  523. package/docs/gateway/multiple-gateways.md +112 -0
  524. package/docs/gateway/openai-http-api.md +118 -0
  525. package/docs/gateway/openresponses-http-api.md +317 -0
  526. package/docs/gateway/pairing.md +99 -0
  527. package/docs/gateway/protocol.md +221 -0
  528. package/docs/gateway/remote-gateway-readme.md +157 -0
  529. package/docs/gateway/remote.md +127 -0
  530. package/docs/gateway/sandbox-vs-tool-policy-vs-elevated.md +128 -0
  531. package/docs/gateway/sandboxing.md +193 -0
  532. package/docs/gateway/security/formal-verification.md +164 -0
  533. package/docs/gateway/security/index.md +825 -0
  534. package/docs/gateway/tailscale.md +127 -0
  535. package/docs/gateway/tools-invoke-http-api.md +85 -0
  536. package/docs/gateway/troubleshooting.md +767 -0
  537. package/docs/help/faq.md +2830 -0
  538. package/docs/help/index.md +21 -0
  539. package/docs/help/troubleshooting.md +98 -0
  540. package/docs/hooks/soul-evil.md +69 -0
  541. package/docs/hooks.md +913 -0
  542. package/docs/images/feishu-step2-create-app.png +0 -0
  543. package/docs/images/feishu-step3-credentials.png +0 -0
  544. package/docs/images/feishu-step4-permissions.png +0 -0
  545. package/docs/images/feishu-step5-bot-capability.png +0 -0
  546. package/docs/images/feishu-step6-event-subscription.png +0 -0
  547. package/docs/images/groups-flow.svg +52 -0
  548. package/docs/images/mobile-ui-screenshot.png +0 -0
  549. package/docs/index.md +258 -0
  550. package/docs/install/ansible.md +208 -0
  551. package/docs/install/bun.md +59 -0
  552. package/docs/install/development-channels.md +75 -0
  553. package/docs/install/docker.md +567 -0
  554. package/docs/install/index.md +185 -0
  555. package/docs/install/installer.md +123 -0
  556. package/docs/install/migrating.md +192 -0
  557. package/docs/install/nix.md +96 -0
  558. package/docs/install/node.md +78 -0
  559. package/docs/install/uninstall.md +128 -0
  560. package/docs/install/updating.md +228 -0
  561. package/docs/logging.md +350 -0
  562. package/docs/multi-agent-sandbox-tools.md +395 -0
  563. package/docs/network.md +54 -0
  564. package/docs/nodes/audio.md +114 -0
  565. package/docs/nodes/camera.md +156 -0
  566. package/docs/nodes/images.md +72 -0
  567. package/docs/nodes/index.md +341 -0
  568. package/docs/nodes/location-command.md +113 -0
  569. package/docs/nodes/media-understanding.md +379 -0
  570. package/docs/nodes/talk.md +90 -0
  571. package/docs/nodes/voicewake.md +65 -0
  572. package/docs/northflank.mdx +53 -0
  573. package/docs/perplexity.md +80 -0
  574. package/docs/pi-dev.md +70 -0
  575. package/docs/pi.md +612 -0
  576. package/docs/platforms/android.md +148 -0
  577. package/docs/platforms/digitalocean.md +262 -0
  578. package/docs/platforms/exe-dev.md +125 -0
  579. package/docs/platforms/fly.md +486 -0
  580. package/docs/platforms/gcp.md +503 -0
  581. package/docs/platforms/hetzner.md +330 -0
  582. package/docs/platforms/index.md +53 -0
  583. package/docs/platforms/ios.md +107 -0
  584. package/docs/platforms/linux.md +94 -0
  585. package/docs/platforms/mac/bundled-gateway.md +73 -0
  586. package/docs/platforms/mac/canvas.md +125 -0
  587. package/docs/platforms/mac/child-process.md +69 -0
  588. package/docs/platforms/mac/dev-setup.md +102 -0
  589. package/docs/platforms/mac/health.md +34 -0
  590. package/docs/platforms/mac/icon.md +31 -0
  591. package/docs/platforms/mac/logging.md +57 -0
  592. package/docs/platforms/mac/menu-bar.md +81 -0
  593. package/docs/platforms/mac/peekaboo.md +65 -0
  594. package/docs/platforms/mac/permissions.md +44 -0
  595. package/docs/platforms/mac/release.md +85 -0
  596. package/docs/platforms/mac/remote.md +83 -0
  597. package/docs/platforms/mac/signing.md +47 -0
  598. package/docs/platforms/mac/skills.md +33 -0
  599. package/docs/platforms/mac/voice-overlay.md +60 -0
  600. package/docs/platforms/mac/voicewake.md +67 -0
  601. package/docs/platforms/mac/webchat.md +41 -0
  602. package/docs/platforms/mac/xpc.md +61 -0
  603. package/docs/platforms/macos-vm.md +281 -0
  604. package/docs/platforms/macos.md +203 -0
  605. package/docs/platforms/oracle.md +303 -0
  606. package/docs/platforms/raspberry-pi.md +358 -0
  607. package/docs/platforms/windows.md +159 -0
  608. package/docs/plugin.md +664 -0
  609. package/docs/plugins/agent-tools.md +99 -0
  610. package/docs/plugins/manifest.md +71 -0
  611. package/docs/plugins/voice-call.md +284 -0
  612. package/docs/plugins/zalouser.md +81 -0
  613. package/docs/prose.md +134 -0
  614. package/docs/providers/anthropic.md +152 -0
  615. package/docs/providers/claude-max-api-proxy.md +148 -0
  616. package/docs/providers/cloudflare-ai-gateway.md +71 -0
  617. package/docs/providers/deepgram.md +93 -0
  618. package/docs/providers/github-copilot.md +72 -0
  619. package/docs/providers/glm.md +33 -0
  620. package/docs/providers/index.md +63 -0
  621. package/docs/providers/minimax.md +208 -0
  622. package/docs/providers/models.md +51 -0
  623. package/docs/providers/moonshot.md +142 -0
  624. package/docs/providers/ollama.md +223 -0
  625. package/docs/providers/openai.md +62 -0
  626. package/docs/providers/opencode.md +36 -0
  627. package/docs/providers/openrouter.md +37 -0
  628. package/docs/providers/qwen.md +53 -0
  629. package/docs/providers/synthetic.md +99 -0
  630. package/docs/providers/venice.md +267 -0
  631. package/docs/providers/vercel-ai-gateway.md +50 -0
  632. package/docs/providers/xiaomi.md +64 -0
  633. package/docs/providers/zai.md +36 -0
  634. package/docs/railway.mdx +99 -0
  635. package/docs/refactor/clawnet.md +417 -0
  636. package/docs/refactor/exec-host.md +316 -0
  637. package/docs/refactor/outbound-session-mirroring.md +85 -0
  638. package/docs/refactor/plugin-sdk.md +214 -0
  639. package/docs/refactor/strict-config.md +93 -0
  640. package/docs/reference/AGENTS.default.md +124 -0
  641. package/docs/reference/RELEASING.md +120 -0
  642. package/docs/reference/api-usage-costs.md +137 -0
  643. package/docs/reference/device-models.md +47 -0
  644. package/docs/reference/rpc.md +43 -0
  645. package/docs/reference/session-management-compaction.md +285 -0
  646. package/docs/reference/templates/AGENTS.dev.md +83 -0
  647. package/docs/reference/templates/AGENTS.md +218 -0
  648. package/docs/reference/templates/BOOT.md +10 -0
  649. package/docs/reference/templates/BOOTSTRAP.md +61 -0
  650. package/docs/reference/templates/HEARTBEAT.md +11 -0
  651. package/docs/reference/templates/IDENTITY.dev.md +47 -0
  652. package/docs/reference/templates/IDENTITY.md +27 -0
  653. package/docs/reference/templates/SOUL.dev.md +76 -0
  654. package/docs/reference/templates/SOUL.md +42 -0
  655. package/docs/reference/templates/TOOLS.dev.md +24 -0
  656. package/docs/reference/templates/TOOLS.md +46 -0
  657. package/docs/reference/templates/USER.dev.md +18 -0
  658. package/docs/reference/templates/USER.md +22 -0
  659. package/docs/reference/test.md +50 -0
  660. package/docs/reference/transcript-hygiene.md +129 -0
  661. package/docs/render.mdx +165 -0
  662. package/docs/scripts.md +28 -0
  663. package/docs/security/formal-verification.md +164 -0
  664. package/docs/start/getting-started.md +208 -0
  665. package/docs/start/hubs.md +185 -0
  666. package/docs/start/lore.md +219 -0
  667. package/docs/start/onboarding.md +110 -0
  668. package/docs/start/openclaw.md +241 -0
  669. package/docs/start/pairing.md +86 -0
  670. package/docs/start/setup.md +149 -0
  671. package/docs/start/showcase.md +416 -0
  672. package/docs/start/wizard.md +349 -0
  673. package/docs/testing.md +368 -0
  674. package/docs/token-use.md +112 -0
  675. package/docs/tools/agent-send.md +53 -0
  676. package/docs/tools/apply-patch.md +50 -0
  677. package/docs/tools/browser-linux-troubleshooting.md +139 -0
  678. package/docs/tools/browser-login.md +68 -0
  679. package/docs/tools/browser.md +576 -0
  680. package/docs/tools/chrome-extension.md +178 -0
  681. package/docs/tools/clawhub.md +257 -0
  682. package/docs/tools/creating-skills.md +54 -0
  683. package/docs/tools/elevated.md +57 -0
  684. package/docs/tools/exec-approvals.md +246 -0
  685. package/docs/tools/exec.md +179 -0
  686. package/docs/tools/firecrawl.md +61 -0
  687. package/docs/tools/index.md +509 -0
  688. package/docs/tools/llm-task.md +115 -0
  689. package/docs/tools/lobster.md +342 -0
  690. package/docs/tools/reactions.md +22 -0
  691. package/docs/tools/skills-config.md +76 -0
  692. package/docs/tools/skills.md +300 -0
  693. package/docs/tools/slash-commands.md +198 -0
  694. package/docs/tools/subagents.md +151 -0
  695. package/docs/tools/thinking.md +73 -0
  696. package/docs/tools/web.md +261 -0
  697. package/docs/tts.md +396 -0
  698. package/docs/tui.md +159 -0
  699. package/docs/vps.md +43 -0
  700. package/docs/web/control-ui.md +221 -0
  701. package/docs/web/dashboard.md +46 -0
  702. package/docs/web/index.md +116 -0
  703. package/docs/web/webchat.md +49 -0
  704. package/docs/whatsapp-openclaw-ai-zh.jpg +0 -0
  705. package/docs/whatsapp-openclaw.jpg +0 -0
  706. package/docs/zh-CN/AGENTS.md +59 -0
  707. package/docs/zh-CN/automation/auth-monitoring.md +47 -0
  708. package/docs/zh-CN/automation/cron-jobs.md +424 -0
  709. package/docs/zh-CN/automation/cron-vs-heartbeat.md +286 -0
  710. package/docs/zh-CN/automation/gmail-pubsub.md +249 -0
  711. package/docs/zh-CN/automation/poll.md +76 -0
  712. package/docs/zh-CN/automation/webhook.md +163 -0
  713. package/docs/zh-CN/bedrock.md +170 -0
  714. package/docs/zh-CN/brave-search.md +48 -0
  715. package/docs/zh-CN/broadcast-groups.md +449 -0
  716. package/docs/zh-CN/channels/bluebubbles.md +271 -0
  717. package/docs/zh-CN/channels/discord.md +468 -0
  718. package/docs/zh-CN/channels/feishu.md +513 -0
  719. package/docs/zh-CN/channels/googlechat.md +257 -0
  720. package/docs/zh-CN/channels/grammy.md +38 -0
  721. package/docs/zh-CN/channels/imessage.md +302 -0
  722. package/docs/zh-CN/channels/index.md +53 -0
  723. package/docs/zh-CN/channels/line.md +180 -0
  724. package/docs/zh-CN/channels/location.md +63 -0
  725. package/docs/zh-CN/channels/matrix.md +221 -0
  726. package/docs/zh-CN/channels/mattermost.md +144 -0
  727. package/docs/zh-CN/channels/msteams.md +775 -0
  728. package/docs/zh-CN/channels/nextcloud-talk.md +142 -0
  729. package/docs/zh-CN/channels/nostr.md +240 -0
  730. package/docs/zh-CN/channels/signal.md +209 -0
  731. package/docs/zh-CN/channels/slack.md +531 -0
  732. package/docs/zh-CN/channels/telegram.md +751 -0
  733. package/docs/zh-CN/channels/tlon.md +136 -0
  734. package/docs/zh-CN/channels/troubleshooting.md +36 -0
  735. package/docs/zh-CN/channels/twitch.md +385 -0
  736. package/docs/zh-CN/channels/whatsapp.md +411 -0
  737. package/docs/zh-CN/channels/zalo.md +196 -0
  738. package/docs/zh-CN/channels/zalouser.md +147 -0
  739. package/docs/zh-CN/cli/acp.md +173 -0
  740. package/docs/zh-CN/cli/agent.md +30 -0
  741. package/docs/zh-CN/cli/agents.md +82 -0
  742. package/docs/zh-CN/cli/approvals.md +57 -0
  743. package/docs/zh-CN/cli/browser.md +114 -0
  744. package/docs/zh-CN/cli/channels.md +86 -0
  745. package/docs/zh-CN/cli/config.md +57 -0
  746. package/docs/zh-CN/cli/configure.md +38 -0
  747. package/docs/zh-CN/cli/cron.md +43 -0
  748. package/docs/zh-CN/cli/dashboard.md +23 -0
  749. package/docs/zh-CN/cli/devices.md +74 -0
  750. package/docs/zh-CN/cli/directory.md +70 -0
  751. package/docs/zh-CN/cli/dns.md +30 -0
  752. package/docs/zh-CN/cli/docs.md +22 -0
  753. package/docs/zh-CN/cli/doctor.md +48 -0
  754. package/docs/zh-CN/cli/gateway.md +206 -0
  755. package/docs/zh-CN/cli/health.md +28 -0
  756. package/docs/zh-CN/cli/hooks.md +311 -0
  757. package/docs/zh-CN/cli/index.md +1032 -0
  758. package/docs/zh-CN/cli/logs.md +31 -0
  759. package/docs/zh-CN/cli/memory.md +52 -0
  760. package/docs/zh-CN/cli/message.md +246 -0
  761. package/docs/zh-CN/cli/models.md +85 -0
  762. package/docs/zh-CN/cli/node.md +115 -0
  763. package/docs/zh-CN/cli/nodes.md +80 -0
  764. package/docs/zh-CN/cli/onboard.md +36 -0
  765. package/docs/zh-CN/cli/pairing.md +28 -0
  766. package/docs/zh-CN/cli/plugins.md +66 -0
  767. package/docs/zh-CN/cli/reset.md +24 -0
  768. package/docs/zh-CN/cli/sandbox.md +158 -0
  769. package/docs/zh-CN/cli/security.md +33 -0
  770. package/docs/zh-CN/cli/sessions.md +23 -0
  771. package/docs/zh-CN/cli/setup.md +36 -0
  772. package/docs/zh-CN/cli/skills.md +33 -0
  773. package/docs/zh-CN/cli/status.md +33 -0
  774. package/docs/zh-CN/cli/system.md +63 -0
  775. package/docs/zh-CN/cli/tui.md +30 -0
  776. package/docs/zh-CN/cli/uninstall.md +24 -0
  777. package/docs/zh-CN/cli/update.md +101 -0
  778. package/docs/zh-CN/cli/voicecall.md +41 -0
  779. package/docs/zh-CN/cli/webhooks.md +32 -0
  780. package/docs/zh-CN/concepts/agent-loop.md +146 -0
  781. package/docs/zh-CN/concepts/agent-workspace.md +219 -0
  782. package/docs/zh-CN/concepts/agent.md +115 -0
  783. package/docs/zh-CN/concepts/architecture.md +123 -0
  784. package/docs/zh-CN/concepts/channel-routing.md +117 -0
  785. package/docs/zh-CN/concepts/compaction.md +67 -0
  786. package/docs/zh-CN/concepts/context.md +168 -0
  787. package/docs/zh-CN/concepts/group-messages.md +91 -0
  788. package/docs/zh-CN/concepts/groups.md +379 -0
  789. package/docs/zh-CN/concepts/markdown-formatting.md +117 -0
  790. package/docs/zh-CN/concepts/memory.md +412 -0
  791. package/docs/zh-CN/concepts/messages.md +141 -0
  792. package/docs/zh-CN/concepts/model-failover.md +145 -0
  793. package/docs/zh-CN/concepts/model-providers.md +320 -0
  794. package/docs/zh-CN/concepts/models.md +196 -0
  795. package/docs/zh-CN/concepts/multi-agent.md +372 -0
  796. package/docs/zh-CN/concepts/oauth.md +151 -0
  797. package/docs/zh-CN/concepts/presence.md +99 -0
  798. package/docs/zh-CN/concepts/queue.md +94 -0
  799. package/docs/zh-CN/concepts/retry.md +76 -0
  800. package/docs/zh-CN/concepts/session-pruning.md +129 -0
  801. package/docs/zh-CN/concepts/session-tool.md +200 -0
  802. package/docs/zh-CN/concepts/session.md +166 -0
  803. package/docs/zh-CN/concepts/sessions.md +17 -0
  804. package/docs/zh-CN/concepts/streaming.md +133 -0
  805. package/docs/zh-CN/concepts/system-prompt.md +101 -0
  806. package/docs/zh-CN/concepts/timezone.md +96 -0
  807. package/docs/zh-CN/concepts/typebox.md +284 -0
  808. package/docs/zh-CN/concepts/typing-indicators.md +74 -0
  809. package/docs/zh-CN/concepts/usage-tracking.md +42 -0
  810. package/docs/zh-CN/date-time.md +129 -0
  811. package/docs/zh-CN/debug/node-issue.md +90 -0
  812. package/docs/zh-CN/debugging.md +160 -0
  813. package/docs/zh-CN/diagnostics/flags.md +98 -0
  814. package/docs/zh-CN/environment.md +88 -0
  815. package/docs/zh-CN/experiments/onboarding-config-protocol.md +47 -0
  816. package/docs/zh-CN/experiments/plans/cron-add-hardening.md +70 -0
  817. package/docs/zh-CN/experiments/plans/group-policy-hardening.md +45 -0
  818. package/docs/zh-CN/experiments/plans/openresponses-gateway.md +121 -0
  819. package/docs/zh-CN/experiments/proposals/model-config.md +42 -0
  820. package/docs/zh-CN/experiments/research/memory.md +235 -0
  821. package/docs/zh-CN/gateway/authentication.md +142 -0
  822. package/docs/zh-CN/gateway/background-process.md +100 -0
  823. package/docs/zh-CN/gateway/bonjour.md +174 -0
  824. package/docs/zh-CN/gateway/bridge-protocol.md +86 -0
  825. package/docs/zh-CN/gateway/cli-backends.md +213 -0
  826. package/docs/zh-CN/gateway/configuration-examples.md +587 -0
  827. package/docs/zh-CN/gateway/configuration.md +3332 -0
  828. package/docs/zh-CN/gateway/discovery.md +123 -0
  829. package/docs/zh-CN/gateway/doctor.md +238 -0
  830. package/docs/zh-CN/gateway/gateway-lock.md +41 -0
  831. package/docs/zh-CN/gateway/health.md +42 -0
  832. package/docs/zh-CN/gateway/heartbeat.md +274 -0
  833. package/docs/zh-CN/gateway/index.md +335 -0
  834. package/docs/zh-CN/gateway/local-models.md +157 -0
  835. package/docs/zh-CN/gateway/logging.md +114 -0
  836. package/docs/zh-CN/gateway/multiple-gateways.md +119 -0
  837. package/docs/zh-CN/gateway/openai-http-api.md +125 -0
  838. package/docs/zh-CN/gateway/openresponses-http-api.md +317 -0
  839. package/docs/zh-CN/gateway/pairing.md +99 -0
  840. package/docs/zh-CN/gateway/protocol.md +220 -0
  841. package/docs/zh-CN/gateway/remote-gateway-readme.md +164 -0
  842. package/docs/zh-CN/gateway/remote.md +133 -0
  843. package/docs/zh-CN/gateway/sandbox-vs-tool-policy-vs-elevated.md +135 -0
  844. package/docs/zh-CN/gateway/sandboxing.md +188 -0
  845. package/docs/zh-CN/gateway/security/formal-verification.md +169 -0
  846. package/docs/zh-CN/gateway/security/index.md +777 -0
  847. package/docs/zh-CN/gateway/tailscale.md +124 -0
  848. package/docs/zh-CN/gateway/tools-invoke-http-api.md +92 -0
  849. package/docs/zh-CN/gateway/troubleshooting.md +771 -0
  850. package/docs/zh-CN/help/faq.md +2628 -0
  851. package/docs/zh-CN/help/index.md +28 -0
  852. package/docs/zh-CN/help/troubleshooting.md +104 -0
  853. package/docs/zh-CN/hooks/soul-evil.md +72 -0
  854. package/docs/zh-CN/hooks.md +919 -0
  855. package/docs/zh-CN/index.md +264 -0
  856. package/docs/zh-CN/install/ansible.md +215 -0
  857. package/docs/zh-CN/install/bun.md +65 -0
  858. package/docs/zh-CN/install/development-channels.md +81 -0
  859. package/docs/zh-CN/install/docker.md +532 -0
  860. package/docs/zh-CN/install/index.md +193 -0
  861. package/docs/zh-CN/install/installer.md +128 -0
  862. package/docs/zh-CN/install/migrating.md +199 -0
  863. package/docs/zh-CN/install/nix.md +99 -0
  864. package/docs/zh-CN/install/node.md +85 -0
  865. package/docs/zh-CN/install/uninstall.md +135 -0
  866. package/docs/zh-CN/install/updating.md +233 -0
  867. package/docs/zh-CN/logging.md +329 -0
  868. package/docs/zh-CN/multi-agent-sandbox-tools.md +401 -0
  869. package/docs/zh-CN/network.md +59 -0
  870. package/docs/zh-CN/nodes/audio.md +120 -0
  871. package/docs/zh-CN/nodes/camera.md +162 -0
  872. package/docs/zh-CN/nodes/images.md +79 -0
  873. package/docs/zh-CN/nodes/index.md +348 -0
  874. package/docs/zh-CN/nodes/location-command.md +120 -0
  875. package/docs/zh-CN/nodes/media-understanding.md +380 -0
  876. package/docs/zh-CN/nodes/talk.md +97 -0
  877. package/docs/zh-CN/nodes/voicewake.md +72 -0
  878. package/docs/zh-CN/northflank.mdx +60 -0
  879. package/docs/zh-CN/perplexity.md +84 -0
  880. package/docs/zh-CN/pi-dev.md +77 -0
  881. package/docs/zh-CN/pi.md +619 -0
  882. package/docs/zh-CN/platforms/android.md +155 -0
  883. package/docs/zh-CN/platforms/digitalocean.md +269 -0
  884. package/docs/zh-CN/platforms/exe-dev.md +127 -0
  885. package/docs/zh-CN/platforms/fly.md +490 -0
  886. package/docs/zh-CN/platforms/gcp.md +510 -0
  887. package/docs/zh-CN/platforms/hetzner.md +337 -0
  888. package/docs/zh-CN/platforms/index.md +60 -0
  889. package/docs/zh-CN/platforms/ios.md +114 -0
  890. package/docs/zh-CN/platforms/linux.md +101 -0
  891. package/docs/zh-CN/platforms/mac/bundled-gateway.md +75 -0
  892. package/docs/zh-CN/platforms/mac/canvas.md +128 -0
  893. package/docs/zh-CN/platforms/mac/child-process.md +73 -0
  894. package/docs/zh-CN/platforms/mac/dev-setup.md +109 -0
  895. package/docs/zh-CN/platforms/mac/health.md +41 -0
  896. package/docs/zh-CN/platforms/mac/icon.md +38 -0
  897. package/docs/zh-CN/platforms/mac/logging.md +64 -0
  898. package/docs/zh-CN/platforms/mac/menu-bar.md +88 -0
  899. package/docs/zh-CN/platforms/mac/peekaboo.md +62 -0
  900. package/docs/zh-CN/platforms/mac/permissions.md +46 -0
  901. package/docs/zh-CN/platforms/mac/release.md +92 -0
  902. package/docs/zh-CN/platforms/mac/remote.md +90 -0
  903. package/docs/zh-CN/platforms/mac/signing.md +54 -0
  904. package/docs/zh-CN/platforms/mac/skills.md +40 -0
  905. package/docs/zh-CN/platforms/mac/voice-overlay.md +67 -0
  906. package/docs/zh-CN/platforms/mac/voicewake.md +74 -0
  907. package/docs/zh-CN/platforms/mac/webchat.md +43 -0
  908. package/docs/zh-CN/platforms/mac/xpc.md +68 -0
  909. package/docs/zh-CN/platforms/macos-vm.md +288 -0
  910. package/docs/zh-CN/platforms/macos.md +193 -0
  911. package/docs/zh-CN/platforms/oracle.md +310 -0
  912. package/docs/zh-CN/platforms/raspberry-pi.md +365 -0
  913. package/docs/zh-CN/platforms/windows.md +156 -0
  914. package/docs/zh-CN/plugin.md +639 -0
  915. package/docs/zh-CN/plugins/agent-tools.md +99 -0
  916. package/docs/zh-CN/plugins/manifest.md +68 -0
  917. package/docs/zh-CN/plugins/voice-call.md +250 -0
  918. package/docs/zh-CN/plugins/zalouser.md +88 -0
  919. package/docs/zh-CN/prose.md +141 -0
  920. package/docs/zh-CN/providers/anthropic.md +159 -0
  921. package/docs/zh-CN/providers/claude-max-api-proxy.md +155 -0
  922. package/docs/zh-CN/providers/deepgram.md +97 -0
  923. package/docs/zh-CN/providers/github-copilot.md +67 -0
  924. package/docs/zh-CN/providers/glm.md +39 -0
  925. package/docs/zh-CN/providers/index.md +68 -0
  926. package/docs/zh-CN/providers/minimax.md +206 -0
  927. package/docs/zh-CN/providers/models.md +55 -0
  928. package/docs/zh-CN/providers/moonshot.md +145 -0
  929. package/docs/zh-CN/providers/ollama.md +230 -0
  930. package/docs/zh-CN/providers/openai.md +68 -0
  931. package/docs/zh-CN/providers/opencode.md +41 -0
  932. package/docs/zh-CN/providers/openrouter.md +43 -0
  933. package/docs/zh-CN/providers/qwen.md +55 -0
  934. package/docs/zh-CN/providers/synthetic.md +102 -0
  935. package/docs/zh-CN/providers/venice.md +274 -0
  936. package/docs/zh-CN/providers/vercel-ai-gateway.md +57 -0
  937. package/docs/zh-CN/providers/xiaomi.md +68 -0
  938. package/docs/zh-CN/providers/zai.md +41 -0
  939. package/docs/zh-CN/railway.mdx +106 -0
  940. package/docs/zh-CN/refactor/clawnet.md +424 -0
  941. package/docs/zh-CN/refactor/exec-host.md +323 -0
  942. package/docs/zh-CN/refactor/outbound-session-mirroring.md +92 -0
  943. package/docs/zh-CN/refactor/plugin-sdk.md +221 -0
  944. package/docs/zh-CN/refactor/strict-config.md +100 -0
  945. package/docs/zh-CN/reference/AGENTS.default.md +131 -0
  946. package/docs/zh-CN/reference/RELEASING.md +123 -0
  947. package/docs/zh-CN/reference/api-usage-costs.md +136 -0
  948. package/docs/zh-CN/reference/device-models.md +54 -0
  949. package/docs/zh-CN/reference/rpc.md +48 -0
  950. package/docs/zh-CN/reference/session-management-compaction.md +287 -0
  951. package/docs/zh-CN/reference/templates/AGENTS.dev.md +89 -0
  952. package/docs/zh-CN/reference/templates/AGENTS.md +225 -0
  953. package/docs/zh-CN/reference/templates/BOOT.md +17 -0
  954. package/docs/zh-CN/reference/templates/BOOTSTRAP.md +68 -0
  955. package/docs/zh-CN/reference/templates/HEARTBEAT.md +18 -0
  956. package/docs/zh-CN/reference/templates/IDENTITY.dev.md +54 -0
  957. package/docs/zh-CN/reference/templates/IDENTITY.md +35 -0
  958. package/docs/zh-CN/reference/templates/SOUL.dev.md +83 -0
  959. package/docs/zh-CN/reference/templates/SOUL.md +49 -0
  960. package/docs/zh-CN/reference/templates/TOOLS.dev.md +31 -0
  961. package/docs/zh-CN/reference/templates/TOOLS.md +53 -0
  962. package/docs/zh-CN/reference/templates/USER.dev.md +25 -0
  963. package/docs/zh-CN/reference/templates/USER.md +30 -0
  964. package/docs/zh-CN/reference/test.md +57 -0
  965. package/docs/zh-CN/reference/transcript-hygiene.md +109 -0
  966. package/docs/zh-CN/render.mdx +169 -0
  967. package/docs/zh-CN/scripts.md +35 -0
  968. package/docs/zh-CN/security/formal-verification.md +171 -0
  969. package/docs/zh-CN/start/getting-started.md +206 -0
  970. package/docs/zh-CN/start/hubs.md +191 -0
  971. package/docs/zh-CN/start/lore.md +226 -0
  972. package/docs/zh-CN/start/onboarding.md +105 -0
  973. package/docs/zh-CN/start/openclaw.md +248 -0
  974. package/docs/zh-CN/start/pairing.md +89 -0
  975. package/docs/zh-CN/start/setup.md +153 -0
  976. package/docs/zh-CN/start/showcase.md +423 -0
  977. package/docs/zh-CN/start/wizard.md +331 -0
  978. package/docs/zh-CN/testing.md +375 -0
  979. package/docs/zh-CN/token-use.md +119 -0
  980. package/docs/zh-CN/tools/agent-send.md +59 -0
  981. package/docs/zh-CN/tools/apply-patch.md +57 -0
  982. package/docs/zh-CN/tools/browser-linux-troubleshooting.md +144 -0
  983. package/docs/zh-CN/tools/browser-login.md +75 -0
  984. package/docs/zh-CN/tools/browser.md +553 -0
  985. package/docs/zh-CN/tools/chrome-extension.md +183 -0
  986. package/docs/zh-CN/tools/clawhub.md +209 -0
  987. package/docs/zh-CN/tools/creating-skills.md +61 -0
  988. package/docs/zh-CN/tools/elevated.md +64 -0
  989. package/docs/zh-CN/tools/exec-approvals.md +234 -0
  990. package/docs/zh-CN/tools/exec.md +169 -0
  991. package/docs/zh-CN/tools/firecrawl.md +68 -0
  992. package/docs/zh-CN/tools/index.md +515 -0
  993. package/docs/zh-CN/tools/llm-task.md +117 -0
  994. package/docs/zh-CN/tools/lobster.md +349 -0
  995. package/docs/zh-CN/tools/reactions.md +29 -0
  996. package/docs/zh-CN/tools/skills-config.md +78 -0
  997. package/docs/zh-CN/tools/skills.md +279 -0
  998. package/docs/zh-CN/tools/slash-commands.md +205 -0
  999. package/docs/zh-CN/tools/subagents.md +156 -0
  1000. package/docs/zh-CN/tools/thinking.md +80 -0
  1001. package/docs/zh-CN/tools/web.md +257 -0
  1002. package/docs/zh-CN/tts.md +375 -0
  1003. package/docs/zh-CN/tui.md +166 -0
  1004. package/docs/zh-CN/vps.md +47 -0
  1005. package/docs/zh-CN/web/control-ui.md +191 -0
  1006. package/docs/zh-CN/web/dashboard.md +53 -0
  1007. package/docs/zh-CN/web/index.md +118 -0
  1008. package/docs/zh-CN/web/webchat.md +56 -0
  1009. package/extensions/bluebubbles/README.md +45 -0
  1010. package/extensions/bluebubbles/index.ts +19 -0
  1011. package/extensions/bluebubbles/node_modules/.bin/openclaw +21 -0
  1012. package/extensions/bluebubbles/openclaw.plugin.json +9 -0
  1013. package/extensions/bluebubbles/package.json +36 -0
  1014. package/extensions/bluebubbles/src/accounts.ts +88 -0
  1015. package/extensions/bluebubbles/src/actions.test.ts +650 -0
  1016. package/extensions/bluebubbles/src/actions.ts +438 -0
  1017. package/extensions/bluebubbles/src/attachments.test.ts +345 -0
  1018. package/extensions/bluebubbles/src/attachments.ts +300 -0
  1019. package/extensions/bluebubbles/src/channel.ts +414 -0
  1020. package/extensions/bluebubbles/src/chat.test.ts +461 -0
  1021. package/extensions/bluebubbles/src/chat.ts +378 -0
  1022. package/extensions/bluebubbles/src/config-schema.ts +51 -0
  1023. package/extensions/bluebubbles/src/media-send.ts +174 -0
  1024. package/extensions/bluebubbles/src/monitor.test.ts +2342 -0
  1025. package/extensions/bluebubbles/src/monitor.ts +2490 -0
  1026. package/extensions/bluebubbles/src/onboarding.ts +352 -0
  1027. package/extensions/bluebubbles/src/probe.ts +135 -0
  1028. package/extensions/bluebubbles/src/reactions.test.ts +392 -0
  1029. package/extensions/bluebubbles/src/reactions.ts +188 -0
  1030. package/extensions/bluebubbles/src/runtime.ts +14 -0
  1031. package/extensions/bluebubbles/src/send.test.ts +808 -0
  1032. package/extensions/bluebubbles/src/send.ts +467 -0
  1033. package/extensions/bluebubbles/src/targets.test.ts +183 -0
  1034. package/extensions/bluebubbles/src/targets.ts +422 -0
  1035. package/extensions/bluebubbles/src/types.ts +127 -0
  1036. package/extensions/copilot-proxy/README.md +24 -0
  1037. package/extensions/copilot-proxy/index.ts +148 -0
  1038. package/extensions/copilot-proxy/node_modules/.bin/openclaw +21 -0
  1039. package/extensions/copilot-proxy/openclaw.plugin.json +9 -0
  1040. package/extensions/copilot-proxy/package.json +14 -0
  1041. package/extensions/diagnostics-otel/index.ts +15 -0
  1042. package/extensions/diagnostics-otel/node_modules/.bin/openclaw +21 -0
  1043. package/extensions/diagnostics-otel/openclaw.plugin.json +8 -0
  1044. package/extensions/diagnostics-otel/package.json +27 -0
  1045. package/extensions/diagnostics-otel/src/service.test.ts +226 -0
  1046. package/extensions/diagnostics-otel/src/service.ts +635 -0
  1047. package/extensions/discord/index.ts +17 -0
  1048. package/extensions/discord/node_modules/.bin/openclaw +21 -0
  1049. package/extensions/discord/openclaw.plugin.json +9 -0
  1050. package/extensions/discord/package.json +14 -0
  1051. package/extensions/discord/src/channel.ts +422 -0
  1052. package/extensions/discord/src/runtime.ts +14 -0
  1053. package/extensions/feishu/README.md +47 -0
  1054. package/extensions/feishu/index.ts +15 -0
  1055. package/extensions/feishu/node_modules/.bin/openclaw +21 -0
  1056. package/extensions/feishu/openclaw.plugin.json +9 -0
  1057. package/extensions/feishu/package.json +33 -0
  1058. package/extensions/feishu/src/channel.ts +276 -0
  1059. package/extensions/feishu/src/config-schema.ts +46 -0
  1060. package/extensions/feishu/src/onboarding.ts +278 -0
  1061. package/extensions/google-antigravity-auth/README.md +24 -0
  1062. package/extensions/google-antigravity-auth/index.ts +461 -0
  1063. package/extensions/google-antigravity-auth/node_modules/.bin/openclaw +21 -0
  1064. package/extensions/google-antigravity-auth/openclaw.plugin.json +9 -0
  1065. package/extensions/google-antigravity-auth/package.json +14 -0
  1066. package/extensions/google-gemini-cli-auth/README.md +35 -0
  1067. package/extensions/google-gemini-cli-auth/index.ts +88 -0
  1068. package/extensions/google-gemini-cli-auth/node_modules/.bin/openclaw +21 -0
  1069. package/extensions/google-gemini-cli-auth/oauth.test.ts +240 -0
  1070. package/extensions/google-gemini-cli-auth/oauth.ts +662 -0
  1071. package/extensions/google-gemini-cli-auth/openclaw.plugin.json +9 -0
  1072. package/extensions/google-gemini-cli-auth/package.json +14 -0
  1073. package/extensions/googlechat/index.ts +19 -0
  1074. package/extensions/googlechat/node_modules/.bin/openclaw +21 -0
  1075. package/extensions/googlechat/openclaw.plugin.json +9 -0
  1076. package/extensions/googlechat/package.json +39 -0
  1077. package/extensions/googlechat/src/accounts.ts +147 -0
  1078. package/extensions/googlechat/src/actions.ts +181 -0
  1079. package/extensions/googlechat/src/api.test.ts +61 -0
  1080. package/extensions/googlechat/src/api.ts +282 -0
  1081. package/extensions/googlechat/src/auth.ts +123 -0
  1082. package/extensions/googlechat/src/channel.ts +583 -0
  1083. package/extensions/googlechat/src/monitor.test.ts +22 -0
  1084. package/extensions/googlechat/src/monitor.ts +949 -0
  1085. package/extensions/googlechat/src/onboarding.ts +269 -0
  1086. package/extensions/googlechat/src/runtime.ts +14 -0
  1087. package/extensions/googlechat/src/targets.test.ts +32 -0
  1088. package/extensions/googlechat/src/targets.ts +65 -0
  1089. package/extensions/googlechat/src/types.config.ts +3 -0
  1090. package/extensions/googlechat/src/types.ts +73 -0
  1091. package/extensions/imessage/index.ts +17 -0
  1092. package/extensions/imessage/node_modules/.bin/openclaw +21 -0
  1093. package/extensions/imessage/openclaw.plugin.json +9 -0
  1094. package/extensions/imessage/package.json +14 -0
  1095. package/extensions/imessage/src/channel.ts +294 -0
  1096. package/extensions/imessage/src/runtime.ts +14 -0
  1097. package/extensions/line/index.ts +19 -0
  1098. package/extensions/line/node_modules/.bin/openclaw +21 -0
  1099. package/extensions/line/openclaw.plugin.json +9 -0
  1100. package/extensions/line/package.json +29 -0
  1101. package/extensions/line/src/card-command.ts +344 -0
  1102. package/extensions/line/src/channel.logout.test.ts +99 -0
  1103. package/extensions/line/src/channel.sendPayload.test.ts +306 -0
  1104. package/extensions/line/src/channel.ts +780 -0
  1105. package/extensions/line/src/runtime.ts +14 -0
  1106. package/extensions/llm-task/README.md +97 -0
  1107. package/extensions/llm-task/index.ts +6 -0
  1108. package/extensions/llm-task/node_modules/.bin/openclaw +21 -0
  1109. package/extensions/llm-task/openclaw.plugin.json +21 -0
  1110. package/extensions/llm-task/package.json +14 -0
  1111. package/extensions/llm-task/src/llm-task-tool.test.ts +138 -0
  1112. package/extensions/llm-task/src/llm-task-tool.ts +245 -0
  1113. package/extensions/lobster/README.md +75 -0
  1114. package/extensions/lobster/SKILL.md +97 -0
  1115. package/extensions/lobster/index.ts +14 -0
  1116. package/extensions/lobster/node_modules/.bin/openclaw +21 -0
  1117. package/extensions/lobster/openclaw.plugin.json +10 -0
  1118. package/extensions/lobster/package.json +14 -0
  1119. package/extensions/lobster/src/lobster-tool.test.ts +247 -0
  1120. package/extensions/lobster/src/lobster-tool.ts +328 -0
  1121. package/extensions/matrix/CHANGELOG.md +87 -0
  1122. package/extensions/matrix/index.ts +17 -0
  1123. package/extensions/matrix/node_modules/.bin/markdown-it +21 -0
  1124. package/extensions/matrix/node_modules/.bin/openclaw +21 -0
  1125. package/extensions/matrix/openclaw.plugin.json +9 -0
  1126. package/extensions/matrix/package.json +36 -0
  1127. package/extensions/matrix/src/actions.ts +195 -0
  1128. package/extensions/matrix/src/channel.directory.test.ts +64 -0
  1129. package/extensions/matrix/src/channel.ts +439 -0
  1130. package/extensions/matrix/src/config-schema.ts +62 -0
  1131. package/extensions/matrix/src/directory-live.ts +188 -0
  1132. package/extensions/matrix/src/group-mentions.ts +66 -0
  1133. package/extensions/matrix/src/matrix/accounts.test.ts +82 -0
  1134. package/extensions/matrix/src/matrix/accounts.ts +65 -0
  1135. package/extensions/matrix/src/matrix/actions/client.ts +57 -0
  1136. package/extensions/matrix/src/matrix/actions/messages.ts +128 -0
  1137. package/extensions/matrix/src/matrix/actions/pins.ts +76 -0
  1138. package/extensions/matrix/src/matrix/actions/reactions.ts +96 -0
  1139. package/extensions/matrix/src/matrix/actions/room.ts +85 -0
  1140. package/extensions/matrix/src/matrix/actions/summary.ts +75 -0
  1141. package/extensions/matrix/src/matrix/actions/types.ts +84 -0
  1142. package/extensions/matrix/src/matrix/actions.ts +15 -0
  1143. package/extensions/matrix/src/matrix/active-client.ts +11 -0
  1144. package/extensions/matrix/src/matrix/client/config.ts +160 -0
  1145. package/extensions/matrix/src/matrix/client/create-client.ts +123 -0
  1146. package/extensions/matrix/src/matrix/client/logging.ts +36 -0
  1147. package/extensions/matrix/src/matrix/client/runtime.ts +4 -0
  1148. package/extensions/matrix/src/matrix/client/shared.ts +170 -0
  1149. package/extensions/matrix/src/matrix/client/storage.ts +131 -0
  1150. package/extensions/matrix/src/matrix/client/types.ts +34 -0
  1151. package/extensions/matrix/src/matrix/client.test.ts +56 -0
  1152. package/extensions/matrix/src/matrix/client.ts +5 -0
  1153. package/extensions/matrix/src/matrix/credentials.ts +105 -0
  1154. package/extensions/matrix/src/matrix/deps.ts +60 -0
  1155. package/extensions/matrix/src/matrix/format.test.ts +33 -0
  1156. package/extensions/matrix/src/matrix/format.ts +22 -0
  1157. package/extensions/matrix/src/matrix/index.ts +11 -0
  1158. package/extensions/matrix/src/matrix/monitor/allowlist.test.ts +45 -0
  1159. package/extensions/matrix/src/matrix/monitor/allowlist.ts +103 -0
  1160. package/extensions/matrix/src/matrix/monitor/auto-join.ts +71 -0
  1161. package/extensions/matrix/src/matrix/monitor/direct.ts +104 -0
  1162. package/extensions/matrix/src/matrix/monitor/events.ts +101 -0
  1163. package/extensions/matrix/src/matrix/monitor/handler.ts +661 -0
  1164. package/extensions/matrix/src/matrix/monitor/index.ts +338 -0
  1165. package/extensions/matrix/src/matrix/monitor/location.ts +100 -0
  1166. package/extensions/matrix/src/matrix/monitor/media.test.ts +102 -0
  1167. package/extensions/matrix/src/matrix/monitor/media.ts +113 -0
  1168. package/extensions/matrix/src/matrix/monitor/mentions.ts +31 -0
  1169. package/extensions/matrix/src/matrix/monitor/replies.ts +97 -0
  1170. package/extensions/matrix/src/matrix/monitor/room-info.ts +55 -0
  1171. package/extensions/matrix/src/matrix/monitor/rooms.test.ts +39 -0
  1172. package/extensions/matrix/src/matrix/monitor/rooms.ts +47 -0
  1173. package/extensions/matrix/src/matrix/monitor/threads.ts +68 -0
  1174. package/extensions/matrix/src/matrix/monitor/types.ts +39 -0
  1175. package/extensions/matrix/src/matrix/poll-types.test.ts +21 -0
  1176. package/extensions/matrix/src/matrix/poll-types.ts +166 -0
  1177. package/extensions/matrix/src/matrix/probe.ts +70 -0
  1178. package/extensions/matrix/src/matrix/send/client.ts +66 -0
  1179. package/extensions/matrix/src/matrix/send/formatting.ts +89 -0
  1180. package/extensions/matrix/src/matrix/send/media.ts +229 -0
  1181. package/extensions/matrix/src/matrix/send/targets.test.ts +98 -0
  1182. package/extensions/matrix/src/matrix/send/targets.ts +136 -0
  1183. package/extensions/matrix/src/matrix/send/types.ts +109 -0
  1184. package/extensions/matrix/src/matrix/send.test.ts +171 -0
  1185. package/extensions/matrix/src/matrix/send.ts +260 -0
  1186. package/extensions/matrix/src/onboarding.ts +449 -0
  1187. package/extensions/matrix/src/outbound.ts +52 -0
  1188. package/extensions/matrix/src/resolve-targets.test.ts +48 -0
  1189. package/extensions/matrix/src/resolve-targets.ts +135 -0
  1190. package/extensions/matrix/src/runtime.ts +14 -0
  1191. package/extensions/matrix/src/tool-actions.ts +164 -0
  1192. package/extensions/matrix/src/types.ts +95 -0
  1193. package/extensions/mattermost/index.ts +17 -0
  1194. package/extensions/mattermost/node_modules/.bin/openclaw +21 -0
  1195. package/extensions/mattermost/openclaw.plugin.json +9 -0
  1196. package/extensions/mattermost/package.json +28 -0
  1197. package/extensions/mattermost/src/channel.test.ts +48 -0
  1198. package/extensions/mattermost/src/channel.ts +337 -0
  1199. package/extensions/mattermost/src/config-schema.ts +55 -0
  1200. package/extensions/mattermost/src/group-mentions.ts +15 -0
  1201. package/extensions/mattermost/src/mattermost/accounts.ts +128 -0
  1202. package/extensions/mattermost/src/mattermost/client.ts +220 -0
  1203. package/extensions/mattermost/src/mattermost/index.ts +9 -0
  1204. package/extensions/mattermost/src/mattermost/monitor-helpers.ts +166 -0
  1205. package/extensions/mattermost/src/mattermost/monitor.ts +987 -0
  1206. package/extensions/mattermost/src/mattermost/probe.ts +74 -0
  1207. package/extensions/mattermost/src/mattermost/send.ts +231 -0
  1208. package/extensions/mattermost/src/normalize.ts +46 -0
  1209. package/extensions/mattermost/src/onboarding-helpers.ts +44 -0
  1210. package/extensions/mattermost/src/onboarding.ts +186 -0
  1211. package/extensions/mattermost/src/runtime.ts +14 -0
  1212. package/extensions/mattermost/src/types.ts +50 -0
  1213. package/extensions/memory-core/index.ts +38 -0
  1214. package/extensions/memory-core/node_modules/.bin/openclaw +21 -0
  1215. package/extensions/memory-core/openclaw.plugin.json +9 -0
  1216. package/extensions/memory-core/package.json +17 -0
  1217. package/extensions/memory-lancedb/config.ts +139 -0
  1218. package/extensions/memory-lancedb/index.test.ts +295 -0
  1219. package/extensions/memory-lancedb/index.ts +608 -0
  1220. package/extensions/memory-lancedb/node_modules/.bin/openai +21 -0
  1221. package/extensions/memory-lancedb/node_modules/.bin/openclaw +21 -0
  1222. package/extensions/memory-lancedb/openclaw.plugin.json +60 -0
  1223. package/extensions/memory-lancedb/package.json +19 -0
  1224. package/extensions/minimax-portal-auth/README.md +33 -0
  1225. package/extensions/minimax-portal-auth/index.ts +155 -0
  1226. package/extensions/minimax-portal-auth/node_modules/.bin/openclaw +21 -0
  1227. package/extensions/minimax-portal-auth/oauth.ts +247 -0
  1228. package/extensions/minimax-portal-auth/openclaw.plugin.json +9 -0
  1229. package/extensions/minimax-portal-auth/package.json +14 -0
  1230. package/extensions/msteams/CHANGELOG.md +83 -0
  1231. package/extensions/msteams/index.ts +17 -0
  1232. package/extensions/msteams/node_modules/.bin/openclaw +21 -0
  1233. package/extensions/msteams/openclaw.plugin.json +9 -0
  1234. package/extensions/msteams/package.json +39 -0
  1235. package/extensions/msteams/src/attachments/download.ts +283 -0
  1236. package/extensions/msteams/src/attachments/graph.ts +353 -0
  1237. package/extensions/msteams/src/attachments/html.ts +90 -0
  1238. package/extensions/msteams/src/attachments/payload.ts +22 -0
  1239. package/extensions/msteams/src/attachments/shared.ts +291 -0
  1240. package/extensions/msteams/src/attachments/types.ts +37 -0
  1241. package/extensions/msteams/src/attachments.test.ts +459 -0
  1242. package/extensions/msteams/src/attachments.ts +18 -0
  1243. package/extensions/msteams/src/channel.directory.test.ts +48 -0
  1244. package/extensions/msteams/src/channel.ts +459 -0
  1245. package/extensions/msteams/src/conversation-store-fs.test.ts +88 -0
  1246. package/extensions/msteams/src/conversation-store-fs.ts +165 -0
  1247. package/extensions/msteams/src/conversation-store-memory.ts +47 -0
  1248. package/extensions/msteams/src/conversation-store.ts +41 -0
  1249. package/extensions/msteams/src/directory-live.ts +205 -0
  1250. package/extensions/msteams/src/errors.test.ts +45 -0
  1251. package/extensions/msteams/src/errors.ts +190 -0
  1252. package/extensions/msteams/src/file-consent-helpers.test.ts +243 -0
  1253. package/extensions/msteams/src/file-consent-helpers.ts +73 -0
  1254. package/extensions/msteams/src/file-consent.ts +126 -0
  1255. package/extensions/msteams/src/graph-chat.ts +53 -0
  1256. package/extensions/msteams/src/graph-upload.ts +453 -0
  1257. package/extensions/msteams/src/inbound.test.ts +66 -0
  1258. package/extensions/msteams/src/inbound.ts +48 -0
  1259. package/extensions/msteams/src/index.ts +4 -0
  1260. package/extensions/msteams/src/media-helpers.test.ts +189 -0
  1261. package/extensions/msteams/src/media-helpers.ts +86 -0
  1262. package/extensions/msteams/src/messenger.test.ts +248 -0
  1263. package/extensions/msteams/src/messenger.ts +495 -0
  1264. package/extensions/msteams/src/monitor-handler/inbound-media.ts +128 -0
  1265. package/extensions/msteams/src/monitor-handler/message-handler.ts +640 -0
  1266. package/extensions/msteams/src/monitor-handler.ts +162 -0
  1267. package/extensions/msteams/src/monitor-types.ts +5 -0
  1268. package/extensions/msteams/src/monitor.ts +295 -0
  1269. package/extensions/msteams/src/onboarding.ts +431 -0
  1270. package/extensions/msteams/src/outbound.ts +46 -0
  1271. package/extensions/msteams/src/pending-uploads.ts +89 -0
  1272. package/extensions/msteams/src/policy.test.ts +209 -0
  1273. package/extensions/msteams/src/policy.ts +273 -0
  1274. package/extensions/msteams/src/polls-store-memory.ts +32 -0
  1275. package/extensions/msteams/src/polls-store.test.ts +38 -0
  1276. package/extensions/msteams/src/polls.test.ts +72 -0
  1277. package/extensions/msteams/src/polls.ts +315 -0
  1278. package/extensions/msteams/src/probe.test.ts +58 -0
  1279. package/extensions/msteams/src/probe.ts +107 -0
  1280. package/extensions/msteams/src/reply-dispatcher.ts +130 -0
  1281. package/extensions/msteams/src/resolve-allowlist.ts +297 -0
  1282. package/extensions/msteams/src/runtime.ts +14 -0
  1283. package/extensions/msteams/src/sdk-types.ts +19 -0
  1284. package/extensions/msteams/src/sdk.ts +33 -0
  1285. package/extensions/msteams/src/send-context.ts +164 -0
  1286. package/extensions/msteams/src/send.ts +519 -0
  1287. package/extensions/msteams/src/sent-message-cache.test.ts +15 -0
  1288. package/extensions/msteams/src/sent-message-cache.ts +47 -0
  1289. package/extensions/msteams/src/storage.ts +25 -0
  1290. package/extensions/msteams/src/store-fs.ts +83 -0
  1291. package/extensions/msteams/src/token.ts +19 -0
  1292. package/extensions/nextcloud-talk/index.ts +17 -0
  1293. package/extensions/nextcloud-talk/node_modules/.bin/openclaw +21 -0
  1294. package/extensions/nextcloud-talk/openclaw.plugin.json +9 -0
  1295. package/extensions/nextcloud-talk/package.json +33 -0
  1296. package/extensions/nextcloud-talk/src/accounts.ts +174 -0
  1297. package/extensions/nextcloud-talk/src/channel.ts +409 -0
  1298. package/extensions/nextcloud-talk/src/config-schema.ts +78 -0
  1299. package/extensions/nextcloud-talk/src/format.ts +79 -0
  1300. package/extensions/nextcloud-talk/src/inbound.ts +317 -0
  1301. package/extensions/nextcloud-talk/src/monitor.ts +246 -0
  1302. package/extensions/nextcloud-talk/src/normalize.ts +39 -0
  1303. package/extensions/nextcloud-talk/src/onboarding.ts +343 -0
  1304. package/extensions/nextcloud-talk/src/policy.test.ts +33 -0
  1305. package/extensions/nextcloud-talk/src/policy.ts +180 -0
  1306. package/extensions/nextcloud-talk/src/room-info.ts +125 -0
  1307. package/extensions/nextcloud-talk/src/runtime.ts +14 -0
  1308. package/extensions/nextcloud-talk/src/send.ts +210 -0
  1309. package/extensions/nextcloud-talk/src/signature.ts +72 -0
  1310. package/extensions/nextcloud-talk/src/types.ts +179 -0
  1311. package/extensions/nostr/CHANGELOG.md +74 -0
  1312. package/extensions/nostr/README.md +136 -0
  1313. package/extensions/nostr/index.ts +68 -0
  1314. package/extensions/nostr/node_modules/.bin/openclaw +21 -0
  1315. package/extensions/nostr/openclaw.plugin.json +9 -0
  1316. package/extensions/nostr/package.json +34 -0
  1317. package/extensions/nostr/src/channel.test.ts +151 -0
  1318. package/extensions/nostr/src/channel.ts +353 -0
  1319. package/extensions/nostr/src/config-schema.ts +90 -0
  1320. package/extensions/nostr/src/metrics.ts +478 -0
  1321. package/extensions/nostr/src/nostr-bus.fuzz.test.ts +533 -0
  1322. package/extensions/nostr/src/nostr-bus.integration.test.ts +448 -0
  1323. package/extensions/nostr/src/nostr-bus.test.ts +199 -0
  1324. package/extensions/nostr/src/nostr-bus.ts +715 -0
  1325. package/extensions/nostr/src/nostr-profile-http.test.ts +378 -0
  1326. package/extensions/nostr/src/nostr-profile-http.ts +519 -0
  1327. package/extensions/nostr/src/nostr-profile-import.test.ts +119 -0
  1328. package/extensions/nostr/src/nostr-profile-import.ts +262 -0
  1329. package/extensions/nostr/src/nostr-profile.fuzz.test.ts +477 -0
  1330. package/extensions/nostr/src/nostr-profile.test.ts +410 -0
  1331. package/extensions/nostr/src/nostr-profile.ts +277 -0
  1332. package/extensions/nostr/src/nostr-state-store.test.ts +131 -0
  1333. package/extensions/nostr/src/nostr-state-store.ts +226 -0
  1334. package/extensions/nostr/src/runtime.ts +14 -0
  1335. package/extensions/nostr/src/seen-tracker.ts +303 -0
  1336. package/extensions/nostr/src/types.test.ts +157 -0
  1337. package/extensions/nostr/src/types.ts +101 -0
  1338. package/extensions/nostr/test/setup.ts +5 -0
  1339. package/extensions/open-prose/README.md +25 -0
  1340. package/extensions/open-prose/index.ts +5 -0
  1341. package/extensions/open-prose/node_modules/.bin/openclaw +21 -0
  1342. package/extensions/open-prose/openclaw.plugin.json +11 -0
  1343. package/extensions/open-prose/package.json +14 -0
  1344. package/extensions/open-prose/skills/prose/LICENSE +21 -0
  1345. package/extensions/open-prose/skills/prose/SKILL.md +323 -0
  1346. package/extensions/open-prose/skills/prose/alt-borges.md +141 -0
  1347. package/extensions/open-prose/skills/prose/alts/arabian-nights.md +358 -0
  1348. package/extensions/open-prose/skills/prose/alts/borges.md +360 -0
  1349. package/extensions/open-prose/skills/prose/alts/folk.md +322 -0
  1350. package/extensions/open-prose/skills/prose/alts/homer.md +346 -0
  1351. package/extensions/open-prose/skills/prose/alts/kafka.md +373 -0
  1352. package/extensions/open-prose/skills/prose/compiler.md +2971 -0
  1353. package/extensions/open-prose/skills/prose/examples/01-hello-world.prose +4 -0
  1354. package/extensions/open-prose/skills/prose/examples/02-research-and-summarize.prose +6 -0
  1355. package/extensions/open-prose/skills/prose/examples/03-code-review.prose +17 -0
  1356. package/extensions/open-prose/skills/prose/examples/04-write-and-refine.prose +14 -0
  1357. package/extensions/open-prose/skills/prose/examples/05-debug-issue.prose +20 -0
  1358. package/extensions/open-prose/skills/prose/examples/06-explain-codebase.prose +17 -0
  1359. package/extensions/open-prose/skills/prose/examples/07-refactor.prose +20 -0
  1360. package/extensions/open-prose/skills/prose/examples/08-blog-post.prose +20 -0
  1361. package/extensions/open-prose/skills/prose/examples/09-research-with-agents.prose +25 -0
  1362. package/extensions/open-prose/skills/prose/examples/10-code-review-agents.prose +32 -0
  1363. package/extensions/open-prose/skills/prose/examples/11-skills-and-imports.prose +27 -0
  1364. package/extensions/open-prose/skills/prose/examples/12-secure-agent-permissions.prose +43 -0
  1365. package/extensions/open-prose/skills/prose/examples/13-variables-and-context.prose +51 -0
  1366. package/extensions/open-prose/skills/prose/examples/14-composition-blocks.prose +48 -0
  1367. package/extensions/open-prose/skills/prose/examples/15-inline-sequences.prose +23 -0
  1368. package/extensions/open-prose/skills/prose/examples/16-parallel-reviews.prose +19 -0
  1369. package/extensions/open-prose/skills/prose/examples/17-parallel-research.prose +19 -0
  1370. package/extensions/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose +36 -0
  1371. package/extensions/open-prose/skills/prose/examples/19-advanced-parallel.prose +71 -0
  1372. package/extensions/open-prose/skills/prose/examples/20-fixed-loops.prose +20 -0
  1373. package/extensions/open-prose/skills/prose/examples/21-pipeline-operations.prose +35 -0
  1374. package/extensions/open-prose/skills/prose/examples/22-error-handling.prose +51 -0
  1375. package/extensions/open-prose/skills/prose/examples/23-retry-with-backoff.prose +63 -0
  1376. package/extensions/open-prose/skills/prose/examples/24-choice-blocks.prose +86 -0
  1377. package/extensions/open-prose/skills/prose/examples/25-conditionals.prose +114 -0
  1378. package/extensions/open-prose/skills/prose/examples/26-parameterized-blocks.prose +100 -0
  1379. package/extensions/open-prose/skills/prose/examples/27-string-interpolation.prose +105 -0
  1380. package/extensions/open-prose/skills/prose/examples/28-automated-pr-review.prose +37 -0
  1381. package/extensions/open-prose/skills/prose/examples/28-gas-town.prose +1572 -0
  1382. package/extensions/open-prose/skills/prose/examples/29-captains-chair.prose +218 -0
  1383. package/extensions/open-prose/skills/prose/examples/30-captains-chair-simple.prose +42 -0
  1384. package/extensions/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose +145 -0
  1385. package/extensions/open-prose/skills/prose/examples/33-pr-review-autofix.prose +168 -0
  1386. package/extensions/open-prose/skills/prose/examples/34-content-pipeline.prose +204 -0
  1387. package/extensions/open-prose/skills/prose/examples/35-feature-factory.prose +296 -0
  1388. package/extensions/open-prose/skills/prose/examples/36-bug-hunter.prose +237 -0
  1389. package/extensions/open-prose/skills/prose/examples/37-the-forge.prose +1474 -0
  1390. package/extensions/open-prose/skills/prose/examples/38-skill-scan.prose +455 -0
  1391. package/extensions/open-prose/skills/prose/examples/39-architect-by-simulation.prose +277 -0
  1392. package/extensions/open-prose/skills/prose/examples/40-rlm-self-refine.prose +32 -0
  1393. package/extensions/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose +38 -0
  1394. package/extensions/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose +46 -0
  1395. package/extensions/open-prose/skills/prose/examples/43-rlm-pairwise.prose +50 -0
  1396. package/extensions/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose +261 -0
  1397. package/extensions/open-prose/skills/prose/examples/45-plugin-release.prose +159 -0
  1398. package/extensions/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose +637 -0
  1399. package/extensions/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose +148 -0
  1400. package/extensions/open-prose/skills/prose/examples/46-workflow-crystallizer.prose +225 -0
  1401. package/extensions/open-prose/skills/prose/examples/47-language-self-improvement.prose +356 -0
  1402. package/extensions/open-prose/skills/prose/examples/48-habit-miner.prose +445 -0
  1403. package/extensions/open-prose/skills/prose/examples/49-prose-run-retrospective.prose +210 -0
  1404. package/extensions/open-prose/skills/prose/examples/README.md +391 -0
  1405. package/extensions/open-prose/skills/prose/examples/roadmap/README.md +22 -0
  1406. package/extensions/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose +20 -0
  1407. package/extensions/open-prose/skills/prose/examples/roadmap/parallel-review.prose +18 -0
  1408. package/extensions/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose +17 -0
  1409. package/extensions/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose +223 -0
  1410. package/extensions/open-prose/skills/prose/guidance/antipatterns.md +951 -0
  1411. package/extensions/open-prose/skills/prose/guidance/patterns.md +700 -0
  1412. package/extensions/open-prose/skills/prose/guidance/system-prompt.md +180 -0
  1413. package/extensions/open-prose/skills/prose/help.md +144 -0
  1414. package/extensions/open-prose/skills/prose/lib/README.md +108 -0
  1415. package/extensions/open-prose/skills/prose/lib/calibrator.prose +215 -0
  1416. package/extensions/open-prose/skills/prose/lib/cost-analyzer.prose +174 -0
  1417. package/extensions/open-prose/skills/prose/lib/error-forensics.prose +250 -0
  1418. package/extensions/open-prose/skills/prose/lib/inspector.prose +196 -0
  1419. package/extensions/open-prose/skills/prose/lib/profiler.prose +460 -0
  1420. package/extensions/open-prose/skills/prose/lib/program-improver.prose +275 -0
  1421. package/extensions/open-prose/skills/prose/lib/project-memory.prose +118 -0
  1422. package/extensions/open-prose/skills/prose/lib/user-memory.prose +93 -0
  1423. package/extensions/open-prose/skills/prose/lib/vm-improver.prose +243 -0
  1424. package/extensions/open-prose/skills/prose/primitives/session.md +593 -0
  1425. package/extensions/open-prose/skills/prose/prose.md +1237 -0
  1426. package/extensions/open-prose/skills/prose/state/filesystem.md +498 -0
  1427. package/extensions/open-prose/skills/prose/state/in-context.md +384 -0
  1428. package/extensions/open-prose/skills/prose/state/postgres.md +880 -0
  1429. package/extensions/open-prose/skills/prose/state/sqlite.md +574 -0
  1430. package/extensions/qwen-portal-auth/README.md +24 -0
  1431. package/extensions/qwen-portal-auth/index.ts +130 -0
  1432. package/extensions/qwen-portal-auth/oauth.ts +190 -0
  1433. package/extensions/qwen-portal-auth/openclaw.plugin.json +9 -0
  1434. package/extensions/signal/index.ts +17 -0
  1435. package/extensions/signal/node_modules/.bin/openclaw +21 -0
  1436. package/extensions/signal/openclaw.plugin.json +9 -0
  1437. package/extensions/signal/package.json +14 -0
  1438. package/extensions/signal/src/channel.ts +315 -0
  1439. package/extensions/signal/src/runtime.ts +14 -0
  1440. package/extensions/slack/index.ts +17 -0
  1441. package/extensions/slack/node_modules/.bin/openclaw +21 -0
  1442. package/extensions/slack/openclaw.plugin.json +9 -0
  1443. package/extensions/slack/package.json +14 -0
  1444. package/extensions/slack/src/channel.ts +604 -0
  1445. package/extensions/slack/src/runtime.ts +14 -0
  1446. package/extensions/telegram/index.ts +17 -0
  1447. package/extensions/telegram/node_modules/.bin/openclaw +21 -0
  1448. package/extensions/telegram/openclaw.plugin.json +9 -0
  1449. package/extensions/telegram/package.json +14 -0
  1450. package/extensions/telegram/src/channel.ts +482 -0
  1451. package/extensions/telegram/src/runtime.ts +14 -0
  1452. package/extensions/tlon/README.md +5 -0
  1453. package/extensions/tlon/index.ts +17 -0
  1454. package/extensions/tlon/node_modules/.bin/openclaw +21 -0
  1455. package/extensions/tlon/openclaw.plugin.json +9 -0
  1456. package/extensions/tlon/package.json +33 -0
  1457. package/extensions/tlon/src/channel.ts +392 -0
  1458. package/extensions/tlon/src/config-schema.test.ts +31 -0
  1459. package/extensions/tlon/src/config-schema.ts +43 -0
  1460. package/extensions/tlon/src/monitor/discovery.ts +76 -0
  1461. package/extensions/tlon/src/monitor/history.ts +90 -0
  1462. package/extensions/tlon/src/monitor/index.ts +553 -0
  1463. package/extensions/tlon/src/monitor/processed-messages.test.ts +23 -0
  1464. package/extensions/tlon/src/monitor/processed-messages.ts +46 -0
  1465. package/extensions/tlon/src/monitor/utils.ts +105 -0
  1466. package/extensions/tlon/src/onboarding.ts +214 -0
  1467. package/extensions/tlon/src/runtime.ts +14 -0
  1468. package/extensions/tlon/src/targets.ts +89 -0
  1469. package/extensions/tlon/src/types.ts +92 -0
  1470. package/extensions/tlon/src/urbit/auth.ts +18 -0
  1471. package/extensions/tlon/src/urbit/http-api.ts +38 -0
  1472. package/extensions/tlon/src/urbit/send.test.ts +38 -0
  1473. package/extensions/tlon/src/urbit/send.ts +131 -0
  1474. package/extensions/tlon/src/urbit/sse-client.test.ts +40 -0
  1475. package/extensions/tlon/src/urbit/sse-client.ts +395 -0
  1476. package/extensions/twitch/CHANGELOG.md +45 -0
  1477. package/extensions/twitch/README.md +89 -0
  1478. package/extensions/twitch/index.ts +20 -0
  1479. package/extensions/twitch/node_modules/.bin/openclaw +21 -0
  1480. package/extensions/twitch/openclaw.plugin.json +9 -0
  1481. package/extensions/twitch/package.json +20 -0
  1482. package/extensions/twitch/src/access-control.test.ts +489 -0
  1483. package/extensions/twitch/src/access-control.ts +166 -0
  1484. package/extensions/twitch/src/actions.ts +173 -0
  1485. package/extensions/twitch/src/client-manager-registry.ts +115 -0
  1486. package/extensions/twitch/src/config-schema.ts +82 -0
  1487. package/extensions/twitch/src/config.test.ts +87 -0
  1488. package/extensions/twitch/src/config.ts +116 -0
  1489. package/extensions/twitch/src/monitor.ts +261 -0
  1490. package/extensions/twitch/src/onboarding.test.ts +311 -0
  1491. package/extensions/twitch/src/onboarding.ts +417 -0
  1492. package/extensions/twitch/src/outbound.test.ts +373 -0
  1493. package/extensions/twitch/src/outbound.ts +184 -0
  1494. package/extensions/twitch/src/plugin.test.ts +39 -0
  1495. package/extensions/twitch/src/plugin.ts +274 -0
  1496. package/extensions/twitch/src/probe.test.ts +195 -0
  1497. package/extensions/twitch/src/probe.ts +120 -0
  1498. package/extensions/twitch/src/resolver.ts +137 -0
  1499. package/extensions/twitch/src/runtime.ts +14 -0
  1500. package/extensions/twitch/src/send.test.ts +289 -0
  1501. package/extensions/twitch/src/send.ts +136 -0
  1502. package/extensions/twitch/src/status.test.ts +270 -0
  1503. package/extensions/twitch/src/status.ts +178 -0
  1504. package/extensions/twitch/src/token.test.ts +171 -0
  1505. package/extensions/twitch/src/token.ts +91 -0
  1506. package/extensions/twitch/src/twitch-client.test.ts +589 -0
  1507. package/extensions/twitch/src/twitch-client.ts +277 -0
  1508. package/extensions/twitch/src/types.ts +141 -0
  1509. package/extensions/twitch/src/utils/markdown.ts +98 -0
  1510. package/extensions/twitch/src/utils/twitch.ts +78 -0
  1511. package/extensions/twitch/test/setup.ts +7 -0
  1512. package/extensions/voice-call/CHANGELOG.md +109 -0
  1513. package/extensions/voice-call/README.md +139 -0
  1514. package/extensions/voice-call/index.ts +493 -0
  1515. package/extensions/voice-call/node_modules/.bin/openclaw +21 -0
  1516. package/extensions/voice-call/openclaw.plugin.json +559 -0
  1517. package/extensions/voice-call/package.json +19 -0
  1518. package/extensions/voice-call/src/allowlist.ts +19 -0
  1519. package/extensions/voice-call/src/cli.ts +279 -0
  1520. package/extensions/voice-call/src/config.test.ts +234 -0
  1521. package/extensions/voice-call/src/config.ts +523 -0
  1522. package/extensions/voice-call/src/core-bridge.ts +159 -0
  1523. package/extensions/voice-call/src/manager/context.ts +21 -0
  1524. package/extensions/voice-call/src/manager/events.ts +188 -0
  1525. package/extensions/voice-call/src/manager/lookup.ts +35 -0
  1526. package/extensions/voice-call/src/manager/outbound.ts +275 -0
  1527. package/extensions/voice-call/src/manager/state.ts +48 -0
  1528. package/extensions/voice-call/src/manager/store.ts +91 -0
  1529. package/extensions/voice-call/src/manager/timers.ts +89 -0
  1530. package/extensions/voice-call/src/manager/twiml.ts +9 -0
  1531. package/extensions/voice-call/src/manager.test.ts +194 -0
  1532. package/extensions/voice-call/src/manager.ts +887 -0
  1533. package/extensions/voice-call/src/media-stream.test.ts +96 -0
  1534. package/extensions/voice-call/src/media-stream.ts +411 -0
  1535. package/extensions/voice-call/src/providers/base.ts +67 -0
  1536. package/extensions/voice-call/src/providers/index.ts +10 -0
  1537. package/extensions/voice-call/src/providers/mock.ts +165 -0
  1538. package/extensions/voice-call/src/providers/plivo.test.ts +27 -0
  1539. package/extensions/voice-call/src/providers/plivo.ts +515 -0
  1540. package/extensions/voice-call/src/providers/stt-openai-realtime.ts +311 -0
  1541. package/extensions/voice-call/src/providers/telnyx.ts +371 -0
  1542. package/extensions/voice-call/src/providers/tts-openai.ts +259 -0
  1543. package/extensions/voice-call/src/providers/twilio/api.ts +42 -0
  1544. package/extensions/voice-call/src/providers/twilio/webhook.ts +32 -0
  1545. package/extensions/voice-call/src/providers/twilio.test.ts +60 -0
  1546. package/extensions/voice-call/src/providers/twilio.ts +626 -0
  1547. package/extensions/voice-call/src/response-generator.ts +158 -0
  1548. package/extensions/voice-call/src/runtime.ts +212 -0
  1549. package/extensions/voice-call/src/telephony-audio.ts +90 -0
  1550. package/extensions/voice-call/src/telephony-tts.ts +104 -0
  1551. package/extensions/voice-call/src/tunnel.ts +314 -0
  1552. package/extensions/voice-call/src/types.ts +272 -0
  1553. package/extensions/voice-call/src/utils.ts +14 -0
  1554. package/extensions/voice-call/src/voice-mapping.ts +67 -0
  1555. package/extensions/voice-call/src/webhook-security.test.ts +377 -0
  1556. package/extensions/voice-call/src/webhook-security.ts +689 -0
  1557. package/extensions/voice-call/src/webhook.ts +491 -0
  1558. package/extensions/whatsapp/index.ts +17 -0
  1559. package/extensions/whatsapp/node_modules/.bin/openclaw +21 -0
  1560. package/extensions/whatsapp/openclaw.plugin.json +9 -0
  1561. package/extensions/whatsapp/package.json +14 -0
  1562. package/extensions/whatsapp/src/channel.ts +508 -0
  1563. package/extensions/whatsapp/src/runtime.ts +14 -0
  1564. package/extensions/zalo/CHANGELOG.md +89 -0
  1565. package/extensions/zalo/README.md +50 -0
  1566. package/extensions/zalo/index.ts +19 -0
  1567. package/extensions/zalo/node_modules/.bin/openclaw +21 -0
  1568. package/extensions/zalo/openclaw.plugin.json +9 -0
  1569. package/extensions/zalo/package.json +36 -0
  1570. package/extensions/zalo/src/accounts.ts +80 -0
  1571. package/extensions/zalo/src/actions.ts +67 -0
  1572. package/extensions/zalo/src/api.ts +208 -0
  1573. package/extensions/zalo/src/channel.directory.test.ts +43 -0
  1574. package/extensions/zalo/src/channel.ts +414 -0
  1575. package/extensions/zalo/src/config-schema.ts +24 -0
  1576. package/extensions/zalo/src/monitor.ts +753 -0
  1577. package/extensions/zalo/src/monitor.webhook.test.ts +73 -0
  1578. package/extensions/zalo/src/onboarding.ts +401 -0
  1579. package/extensions/zalo/src/probe.ts +46 -0
  1580. package/extensions/zalo/src/proxy.ts +21 -0
  1581. package/extensions/zalo/src/runtime.ts +14 -0
  1582. package/extensions/zalo/src/send.ts +124 -0
  1583. package/extensions/zalo/src/status-issues.ts +53 -0
  1584. package/extensions/zalo/src/token.ts +63 -0
  1585. package/extensions/zalo/src/types.ts +42 -0
  1586. package/extensions/zalouser/CHANGELOG.md +61 -0
  1587. package/extensions/zalouser/README.md +225 -0
  1588. package/extensions/zalouser/index.ts +31 -0
  1589. package/extensions/zalouser/node_modules/.bin/openclaw +21 -0
  1590. package/extensions/zalouser/openclaw.plugin.json +9 -0
  1591. package/extensions/zalouser/package.json +36 -0
  1592. package/extensions/zalouser/src/accounts.ts +135 -0
  1593. package/extensions/zalouser/src/channel.test.ts +18 -0
  1594. package/extensions/zalouser/src/channel.ts +686 -0
  1595. package/extensions/zalouser/src/config-schema.ts +27 -0
  1596. package/extensions/zalouser/src/monitor.ts +590 -0
  1597. package/extensions/zalouser/src/onboarding.ts +504 -0
  1598. package/extensions/zalouser/src/probe.ts +28 -0
  1599. package/extensions/zalouser/src/runtime.ts +14 -0
  1600. package/extensions/zalouser/src/send.ts +160 -0
  1601. package/extensions/zalouser/src/status-issues.test.ts +57 -0
  1602. package/extensions/zalouser/src/status-issues.ts +89 -0
  1603. package/extensions/zalouser/src/tool.ts +164 -0
  1604. package/extensions/zalouser/src/types.ts +108 -0
  1605. package/extensions/zalouser/src/zca.ts +202 -0
  1606. package/openclaw.mjs +14 -0
  1607. package/package.json +245 -0
  1608. package/skills/1password/SKILL.md +70 -0
  1609. package/skills/1password/references/cli-examples.md +29 -0
  1610. package/skills/1password/references/get-started.md +17 -0
  1611. package/skills/apple-notes/SKILL.md +77 -0
  1612. package/skills/apple-reminders/SKILL.md +96 -0
  1613. package/skills/bear-notes/SKILL.md +107 -0
  1614. package/skills/bird/SKILL.md +224 -0
  1615. package/skills/blogwatcher/SKILL.md +69 -0
  1616. package/skills/blucli/SKILL.md +47 -0
  1617. package/skills/bluebubbles/SKILL.md +131 -0
  1618. package/skills/camsnap/SKILL.md +45 -0
  1619. package/skills/canvas/SKILL.md +198 -0
  1620. package/skills/clawhub/SKILL.md +77 -0
  1621. package/skills/coding-agent/SKILL.md +284 -0
  1622. package/skills/discord/SKILL.md +578 -0
  1623. package/skills/eightctl/SKILL.md +50 -0
  1624. package/skills/food-order/SKILL.md +48 -0
  1625. package/skills/gemini/SKILL.md +43 -0
  1626. package/skills/ghostly-projects/SKILL.md +160 -0
  1627. package/skills/gifgrep/SKILL.md +79 -0
  1628. package/skills/github/SKILL.md +77 -0
  1629. package/skills/gog/SKILL.md +116 -0
  1630. package/skills/goplaces/SKILL.md +52 -0
  1631. package/skills/healthcheck/SKILL.md +245 -0
  1632. package/skills/himalaya/SKILL.md +257 -0
  1633. package/skills/himalaya/references/configuration.md +184 -0
  1634. package/skills/himalaya/references/message-composition.md +199 -0
  1635. package/skills/imsg/SKILL.md +74 -0
  1636. package/skills/linear/SKILL.md +111 -0
  1637. package/skills/linear/linear.sh +204 -0
  1638. package/skills/local-places/SERVER_README.md +101 -0
  1639. package/skills/local-places/SKILL.md +102 -0
  1640. package/skills/local-places/pyproject.toml +21 -0
  1641. package/skills/local-places/src/local_places/__init__.py +2 -0
  1642. package/skills/local-places/src/local_places/google_places.py +314 -0
  1643. package/skills/local-places/src/local_places/main.py +65 -0
  1644. package/skills/local-places/src/local_places/schemas.py +107 -0
  1645. package/skills/mcporter/SKILL.md +61 -0
  1646. package/skills/model-usage/SKILL.md +69 -0
  1647. package/skills/model-usage/references/codexbar-cli.md +33 -0
  1648. package/skills/model-usage/scripts/model_usage.py +310 -0
  1649. package/skills/nano-banana-pro/SKILL.md +58 -0
  1650. package/skills/nano-banana-pro/scripts/generate_image.py +184 -0
  1651. package/skills/nano-pdf/SKILL.md +38 -0
  1652. package/skills/notion/SKILL.md +172 -0
  1653. package/skills/obsidian/SKILL.md +81 -0
  1654. package/skills/openai-image-gen/SKILL.md +89 -0
  1655. package/skills/openai-image-gen/scripts/gen.py +240 -0
  1656. package/skills/openai-whisper/SKILL.md +38 -0
  1657. package/skills/openai-whisper-api/SKILL.md +52 -0
  1658. package/skills/openai-whisper-api/scripts/transcribe.sh +85 -0
  1659. package/skills/openhue/SKILL.md +51 -0
  1660. package/skills/oracle/SKILL.md +125 -0
  1661. package/skills/ordercli/SKILL.md +78 -0
  1662. package/skills/peekaboo/SKILL.md +190 -0
  1663. package/skills/sag/SKILL.md +87 -0
  1664. package/skills/session-logs/SKILL.md +115 -0
  1665. package/skills/sherpa-onnx-tts/SKILL.md +103 -0
  1666. package/skills/sherpa-onnx-tts/bin/sherpa-onnx-tts +178 -0
  1667. package/skills/skill-creator/SKILL.md +370 -0
  1668. package/skills/skill-creator/license.txt +202 -0
  1669. package/skills/skill-creator/scripts/init_skill.py +378 -0
  1670. package/skills/skill-creator/scripts/package_skill.py +111 -0
  1671. package/skills/skill-creator/scripts/quick_validate.py +101 -0
  1672. package/skills/slack/SKILL.md +144 -0
  1673. package/skills/songsee/SKILL.md +49 -0
  1674. package/skills/sonoscli/SKILL.md +46 -0
  1675. package/skills/spotify-player/SKILL.md +64 -0
  1676. package/skills/summarize/SKILL.md +87 -0
  1677. package/skills/things-mac/SKILL.md +86 -0
  1678. package/skills/tmux/SKILL.md +135 -0
  1679. package/skills/tmux/scripts/find-sessions.sh +112 -0
  1680. package/skills/tmux/scripts/wait-for-text.sh +83 -0
  1681. package/skills/trello/SKILL.md +95 -0
  1682. package/skills/video-frames/SKILL.md +46 -0
  1683. package/skills/video-frames/scripts/frame.sh +81 -0
  1684. package/skills/voice-call/SKILL.md +45 -0
  1685. package/skills/wacli/SKILL.md +72 -0
  1686. package/skills/weather/SKILL.md +54 -0
@@ -0,0 +1,2971 @@
1
+ ---
2
+ role: language-specification
3
+ summary: |
4
+ Complete syntax grammar, validation rules, and compilation semantics for OpenProse.
5
+ Read this file when compiling, validating, or resolving ambiguous syntax. Assumes
6
+ prose.md is already in context for execution semantics.
7
+ see-also:
8
+ - SKILL.md: Activation triggers, onboarding
9
+ - prose.md: Execution semantics, how to run programs
10
+ - state/filesystem.md: File-system state management (default)
11
+ - state/in-context.md: In-context state management (on request)
12
+ ---
13
+
14
+ # OpenProse Language Reference
15
+
16
+ OpenProse is a programming language for AI sessions. An AI session is a Turing-complete computer; this document provides complete documentation for the language syntax, semantics, and execution model.
17
+
18
+ ---
19
+
20
+ ## Document Purpose: Compiler + Validator
21
+
22
+ This document serves a dual role:
23
+
24
+ ### As Compiler
25
+
26
+ When asked to "compile" a `.prose` file, use this specification to:
27
+
28
+ 1. **Parse** the program according to the syntax grammar
29
+ 2. **Validate** that the program is well-formed and semantically valid
30
+ 3. **Transform** the program into "best practice" canonical form:
31
+ - Expand syntax sugar where appropriate
32
+ - Normalize formatting and structure
33
+ - Apply optimizations (e.g., hoisting block definitions)
34
+
35
+ ### As Validator
36
+
37
+ The validation criterion: **Would a blank agent with only `prose.md` understand this program as self-evident?**
38
+
39
+ When validating, check:
40
+
41
+ - Syntax correctness (all constructs match grammar)
42
+ - Semantic validity (references resolve, types match)
43
+ - Self-evidence (program is clear without this full spec)
44
+
45
+ If a construct is ambiguous or non-obvious, it should be flagged or transformed into a clearer form.
46
+
47
+ ### When to Read This Document
48
+
49
+ - **Compilation requested**: Read fully to apply all rules
50
+ - **Validation requested**: Read fully to check all constraints
51
+ - **Ambiguous syntax encountered**: Reference specific sections
52
+ - **Interpretation only**: Use `prose.md` instead (smaller, faster)
53
+
54
+ ---
55
+
56
+ ## Table of Contents
57
+
58
+ 1. [Overview](#overview)
59
+ 2. [File Format](#file-format)
60
+ 3. [Comments](#comments)
61
+ 4. [String Literals](#string-literals)
62
+ 5. [Use Statements](#use-statements-program-composition)
63
+ 6. [Input Declarations](#input-declarations)
64
+ 7. [Output Bindings](#output-bindings)
65
+ 8. [Program Invocation](#program-invocation)
66
+ 9. [Agent Definitions](#agent-definitions)
67
+ 10. [Session Statement](#session-statement)
68
+ 11. [Resume Statement](#resume-statement)
69
+ 12. [Variables & Context](#variables--context)
70
+ 13. [Composition Blocks](#composition-blocks)
71
+ 14. [Parallel Blocks](#parallel-blocks)
72
+ 15. [Fixed Loops](#fixed-loops)
73
+ 16. [Unbounded Loops](#unbounded-loops)
74
+ 17. [Pipeline Operations](#pipeline-operations)
75
+ 18. [Error Handling](#error-handling)
76
+ 19. [Choice Blocks](#choice-blocks)
77
+ 20. [Conditional Statements](#conditional-statements)
78
+ 21. [Execution Model](#execution-model)
79
+ 22. [Validation Rules](#validation-rules)
80
+ 23. [Examples](#examples)
81
+ 24. [Future Features](#future-features)
82
+
83
+ ---
84
+
85
+ ## Overview
86
+
87
+ OpenProse provides a declarative syntax for defining multi-agent workflows. Programs consist of statements that are executed sequentially, with each `session` statement spawning a subagent to complete a task.
88
+
89
+ ### Design Principles
90
+
91
+ - **Pattern over framework**: The simplest solution is barely anything at all—just structure for English
92
+ - **Self-evident**: Programs should be understandable with minimal documentation
93
+ - **The OpenProse VM is intelligent**: Design for understanding, not parsing
94
+ - **Framework-agnostic**: Works with Claude Code, OpenCode, and any future agent framework
95
+ - **Files are artifacts**: `.prose` is the portable unit of work
96
+
97
+ ### Current Implementation Status
98
+
99
+ The following features are implemented:
100
+
101
+ | Feature | Status | Description |
102
+ | ---------------------- | ----------- | -------------------------------------------- |
103
+ | Comments | Implemented | `# comment` syntax |
104
+ | Single-line strings | Implemented | `"string"` with escapes |
105
+ | Simple session | Implemented | `session "prompt"` |
106
+ | Agent definitions | Implemented | `agent name:` with model/prompt properties |
107
+ | Session with agent | Implemented | `session: agent` with property overrides |
108
+ | Use statements | Implemented | `use "@handle/slug" as name` |
109
+ | Agent skills | Implemented | `skills: ["skill1", "skill2"]` |
110
+ | Agent permissions | Implemented | `permissions:` block with rules |
111
+ | Let binding | Implemented | `let name = session "..."` |
112
+ | Const binding | Implemented | `const name = session "..."` |
113
+ | Variable reassignment | Implemented | `name = session "..."` (for let only) |
114
+ | Context property | Implemented | `context: var` or `context: [a, b, c]` |
115
+ | do: blocks | Implemented | Explicit sequential blocks |
116
+ | Inline sequence | Implemented | `session "A" -> session "B"` |
117
+ | Named blocks | Implemented | `block name:` with `do name` invocation |
118
+ | Parallel blocks | Implemented | `parallel:` for concurrent execution |
119
+ | Named parallel results | Implemented | `x = session "..."` inside parallel |
120
+ | Object context | Implemented | `context: { a, b, c }` shorthand |
121
+ | Join strategies | Implemented | `parallel ("first"):` or `parallel ("any"):` |
122
+ | Failure policies | Implemented | `parallel (on-fail: "continue"):` |
123
+ | Repeat blocks | Implemented | `repeat N:` fixed iterations |
124
+ | Repeat with index | Implemented | `repeat N as i:` with index variable |
125
+ | For-each blocks | Implemented | `for item in items:` iteration |
126
+ | For-each with index | Implemented | `for item, i in items:` with index |
127
+ | Parallel for-each | Implemented | `parallel for item in items:` fan-out |
128
+ | Unbounded loop | Implemented | `loop:` with optional max iterations |
129
+ | Loop until | Implemented | `loop until **condition**:` AI-evaluated |
130
+ | Loop while | Implemented | `loop while **condition**:` AI-evaluated |
131
+ | Loop with index | Implemented | `loop as i:` or `loop until ... as i:` |
132
+ | Map pipeline | Implemented | `items \| map:` transform each item |
133
+ | Filter pipeline | Implemented | `items \| filter:` keep matching items |
134
+ | Reduce pipeline | Implemented | `items \| reduce(acc, item):` accumulate |
135
+ | Parallel map | Implemented | `items \| pmap:` concurrent transform |
136
+ | Pipeline chaining | Implemented | `\| filter: ... \| map: ...` |
137
+ | Try/catch blocks | Implemented | `try:` with `catch:` for error handling |
138
+ | Try/catch/finally | Implemented | `finally:` for cleanup |
139
+ | Error variable | Implemented | `catch as err:` access error context |
140
+ | Throw statement | Implemented | `throw` or `throw "message"` |
141
+ | Retry property | Implemented | `retry: 3` automatic retry on failure |
142
+ | Backoff strategy | Implemented | `backoff: exponential` delay between retries |
143
+ | Input declarations | Implemented | `input name: "description"` |
144
+ | Output bindings | Implemented | `output name = expression` |
145
+ | Program invocation | Implemented | `name(input: value)` call imported programs |
146
+ | Multi-line strings | Implemented | `"""..."""` preserving whitespace |
147
+ | String interpolation | Implemented | `"Hello {name}"` variable substitution |
148
+ | Block parameters | Implemented | `block name(param):` with parameters |
149
+ | Block invocation args | Implemented | `do name(arg)` passing arguments |
150
+ | Choice blocks | Implemented | `choice **criteria**: option "label":` |
151
+ | If/elif/else | Implemented | `if **condition**:` conditional branching |
152
+ | Persistent agents | Implemented | `persist: true` or `persist: project` |
153
+ | Resume statement | Implemented | `resume: agent` to continue with memory |
154
+
155
+ ---
156
+
157
+ ## File Format
158
+
159
+ | Property | Value |
160
+ | ---------------- | -------------------- |
161
+ | Extension | `.prose` |
162
+ | Encoding | UTF-8 |
163
+ | Case sensitivity | Case-sensitive |
164
+ | Indentation | Spaces (Python-like) |
165
+ | Line endings | LF or CRLF |
166
+
167
+ ---
168
+
169
+ ## Comments
170
+
171
+ Comments provide documentation within programs and are ignored during execution.
172
+
173
+ ### Syntax
174
+
175
+ ```prose
176
+ # This is a standalone comment
177
+
178
+ session "Hello" # This is an inline comment
179
+ ```
180
+
181
+ ### Rules
182
+
183
+ 1. Comments begin with `#` and extend to end of line
184
+ 2. Comments can appear on their own line or after a statement
185
+ 3. Empty comments are valid: `#`
186
+ 4. The `#` character inside string literals is NOT a comment
187
+
188
+ ### Examples
189
+
190
+ ```prose
191
+ # Program header comment
192
+ # Author: Example
193
+
194
+ session "Do something" # Explain what this does
195
+
196
+ # This comment is between statements
197
+ session "Do another thing"
198
+ ```
199
+
200
+ ### Compilation Behavior
201
+
202
+ Comments are **stripped during compilation**. The OpenProse VM never sees them. They have no effect on execution and exist purely for human documentation.
203
+
204
+ ### Important Notes
205
+
206
+ - **Comments inside strings are NOT comments**:
207
+
208
+ ```prose
209
+ session "Say hello # this is part of the string"
210
+ ```
211
+
212
+ The `#` inside the string literal is part of the prompt, not a comment.
213
+
214
+ - **Comments inside indented blocks are allowed**:
215
+ ```prose
216
+ agent researcher:
217
+ # This comment is inside the block
218
+ model: sonnet
219
+ # This comment is outside the block
220
+ ```
221
+
222
+ ---
223
+
224
+ ## String Literals
225
+
226
+ String literals represent text values, primarily used for session prompts.
227
+
228
+ ### Syntax
229
+
230
+ Strings are enclosed in double quotes:
231
+
232
+ ```prose
233
+ "This is a string"
234
+ ```
235
+
236
+ ### Escape Sequences
237
+
238
+ The following escape sequences are supported:
239
+
240
+ | Sequence | Meaning |
241
+ | -------- | ------------ |
242
+ | `\\` | Backslash |
243
+ | `\"` | Double quote |
244
+ | `\n` | Newline |
245
+ | `\t` | Tab |
246
+
247
+ ### Examples
248
+
249
+ ```prose
250
+ session "Hello world"
251
+ session "Line one\nLine two"
252
+ session "She said \"hello\""
253
+ session "Path: C:\\Users\\name"
254
+ session "Column1\tColumn2"
255
+ ```
256
+
257
+ ### Rules
258
+
259
+ 1. Single-line strings must be properly terminated with a closing `"`
260
+ 2. Unknown escape sequences are errors
261
+ 3. Empty strings `""` are valid but generate a warning when used as prompts
262
+
263
+ ### Multi-line Strings
264
+
265
+ Multi-line strings use triple double-quotes (`"""`) and preserve internal whitespace and newlines:
266
+
267
+ ```prose
268
+ session """
269
+ This is a multi-line prompt.
270
+ It preserves:
271
+ - Indentation
272
+ - Line breaks
273
+ - All internal whitespace
274
+ """
275
+ ```
276
+
277
+ #### Multi-line String Rules
278
+
279
+ 1. Opening `"""` must be followed by a newline
280
+ 2. Content continues until closing `"""`
281
+ 3. Escape sequences work the same as single-line strings
282
+ 4. Leading/trailing whitespace inside the delimiters is preserved
283
+
284
+ ### String Interpolation
285
+
286
+ Strings can embed variable references using `{varname}` syntax:
287
+
288
+ ```prose
289
+ let name = session "Get the user's name"
290
+
291
+ session "Hello {name}, welcome to the system!"
292
+ ```
293
+
294
+ #### Interpolation Syntax
295
+
296
+ - Variables are referenced by wrapping the variable name in curly braces: `{varname}`
297
+ - Works in both single-line and multi-line strings
298
+ - Empty braces `{}` are treated as literal text, not interpolation
299
+ - Nested braces are not supported
300
+
301
+ #### Examples
302
+
303
+ ```prose
304
+ let research = session "Research the topic"
305
+ let analysis = session "Analyze findings"
306
+
307
+ # Single variable interpolation
308
+ session "Based on {research}, provide recommendations"
309
+
310
+ # Multiple interpolations
311
+ session "Combining {research} with {analysis}, synthesize insights"
312
+
313
+ # Multi-line with interpolation
314
+ session """
315
+ Review Summary:
316
+ - Research: {research}
317
+ - Analysis: {analysis}
318
+ Please provide final recommendations.
319
+ """
320
+ ```
321
+
322
+ #### Interpolation Rules
323
+
324
+ 1. Variable names must be valid identifiers
325
+ 2. Referenced variables must be in scope
326
+ 3. Empty braces `{}` are literal text
327
+ 4. Backslash can escape braces: `\{` produces literal `{`
328
+
329
+ ### Validation
330
+
331
+ | Check | Result |
332
+ | -------------------------------- | ------- |
333
+ | Unterminated string | Error |
334
+ | Unknown escape sequence | Error |
335
+ | Empty string as prompt | Warning |
336
+ | Undefined interpolation variable | Error |
337
+
338
+ ---
339
+
340
+ ## Use Statements (Program Composition)
341
+
342
+ Use statements import other OpenProse programs from the registry at `p.prose.md`, enabling modular workflows.
343
+
344
+ ### Syntax
345
+
346
+ ```prose
347
+ use "@handle/slug"
348
+ use "@handle/slug" as alias
349
+ ```
350
+
351
+ ### Path Format
352
+
353
+ Import paths follow the format `@handle/slug`:
354
+
355
+ - `@handle` identifies the program author/organization
356
+ - `slug` is the program name
357
+
358
+ An optional alias (`as name`) allows referencing by a shorter name.
359
+
360
+ ### Examples
361
+
362
+ ```prose
363
+ # Import a program
364
+ use "@alice/research"
365
+
366
+ # Import with alias
367
+ use "@bob/critique" as critic
368
+ ```
369
+
370
+ ### Program URL Resolution
371
+
372
+ When the OpenProse VM encounters a `use` statement:
373
+
374
+ 1. Fetch the program from `https://p.prose.md/@handle/slug`
375
+ 2. Parse the program to extract its contract (inputs/outputs)
376
+ 3. Register the program in the Import Registry
377
+
378
+ ### Validation Rules
379
+
380
+ | Check | Severity | Message |
381
+ | --------------------- | -------- | -------------------------------------- |
382
+ | Empty path | Error | Use path cannot be empty |
383
+ | Invalid path format | Error | Path must be @handle/slug format |
384
+ | Duplicate import | Error | Program already imported |
385
+ | Missing alias for dup | Error | Alias required when importing multiple |
386
+
387
+ ### Execution Semantics
388
+
389
+ Use statements are processed before any agent definitions or sessions. The OpenProse VM:
390
+
391
+ 1. Fetches and validates all imported programs at the start of execution
392
+ 2. Extracts input/output contracts from each program
393
+ 3. Registers programs in the Import Registry for later invocation
394
+
395
+ ---
396
+
397
+ ## Input Declarations
398
+
399
+ Inputs declare what values a program expects from its caller.
400
+
401
+ ### Syntax
402
+
403
+ ```prose
404
+ input name: "description"
405
+ ```
406
+
407
+ ### Examples
408
+
409
+ ```prose
410
+ input topic: "The subject to research"
411
+ input depth: "How deep to go (shallow, medium, deep)"
412
+ ```
413
+
414
+ ### Semantics
415
+
416
+ Inputs:
417
+
418
+ - Are declared at the top of the program (before executable statements)
419
+ - Have a name and a description (for documentation)
420
+ - Become available as variables within the program body
421
+ - Must be provided by the caller when invoking the program
422
+
423
+ ### Validation Rules
424
+
425
+ | Check | Severity | Message |
426
+ | ---------------------- | -------- | ---------------------------------------------------- |
427
+ | Empty input name | Error | Input name cannot be empty |
428
+ | Empty description | Warning | Consider adding a description |
429
+ | Duplicate input name | Error | Input already declared |
430
+ | Input after executable | Error | Inputs must be declared before executable statements |
431
+
432
+ ---
433
+
434
+ ## Output Bindings
435
+
436
+ Outputs declare what values a program produces for its caller.
437
+
438
+ ### Syntax
439
+
440
+ ```prose
441
+ output name = expression
442
+ ```
443
+
444
+ ### Examples
445
+
446
+ ```prose
447
+ let raw = session "Research {topic}"
448
+ output findings = session "Synthesize research"
449
+ context: raw
450
+ output sources = session "Extract sources"
451
+ context: raw
452
+ ```
453
+
454
+ ### Semantics
455
+
456
+ The `output` keyword:
457
+
458
+ - Marks a variable as an output (visible at assignment, not just at file top)
459
+ - Works like `let` but also registers the value as a program output
460
+ - Can appear anywhere in the program body
461
+ - Multiple outputs are supported
462
+
463
+ ### Validation Rules
464
+
465
+ | Check | Severity | Message |
466
+ | --------------------- | -------- | ----------------------------------- |
467
+ | Empty output name | Error | Output name cannot be empty |
468
+ | Duplicate output name | Error | Output already declared |
469
+ | Output name conflicts | Error | Output name conflicts with variable |
470
+
471
+ ---
472
+
473
+ ## Program Invocation
474
+
475
+ Call imported programs by providing their inputs.
476
+
477
+ ### Syntax
478
+
479
+ ```prose
480
+ name(input1: value1, input2: value2)
481
+ ```
482
+
483
+ ### Examples
484
+
485
+ ```prose
486
+ use "@alice/research" as research
487
+
488
+ let result = research(topic: "quantum computing")
489
+ ```
490
+
491
+ ### Accessing Outputs
492
+
493
+ The result contains all outputs from the invoked program, accessible as properties:
494
+
495
+ ```prose
496
+ session "Write summary"
497
+ context: result.findings
498
+
499
+ session "Cite sources"
500
+ context: result.sources
501
+ ```
502
+
503
+ ### Destructuring Outputs
504
+
505
+ For convenience, outputs can be destructured:
506
+
507
+ ```prose
508
+ let { findings, sources } = research(topic: "quantum computing")
509
+ ```
510
+
511
+ ### Execution Semantics
512
+
513
+ When a program invokes an imported program:
514
+
515
+ 1. **Bind inputs**: Map caller-provided values to the imported program's inputs
516
+ 2. **Execute**: Run the imported program (spawns its own sessions)
517
+ 3. **Collect outputs**: Gather all `output` bindings from the imported program
518
+ 4. **Return**: Make outputs available to the caller as a result object
519
+
520
+ The imported program runs in its own execution context but shares the same VM session.
521
+
522
+ ### Validation Rules
523
+
524
+ | Check | Severity | Message |
525
+ | ----------------------- | -------- | ------------------------------ |
526
+ | Unknown program | Error | Program not imported |
527
+ | Missing required input | Error | Required input not provided |
528
+ | Unknown input name | Error | Input not declared in program |
529
+ | Unknown output property | Error | Output not declared in program |
530
+
531
+ ---
532
+
533
+ ## Agent Definitions
534
+
535
+ Agents are reusable templates that configure subagent behavior. Once defined, agents can be referenced in session statements.
536
+
537
+ ### Syntax
538
+
539
+ ```prose
540
+ agent name:
541
+ model: sonnet
542
+ prompt: "System prompt for this agent"
543
+ skills: ["skill1", "skill2"]
544
+ permissions:
545
+ read: ["*.md"]
546
+ bash: deny
547
+ ```
548
+
549
+ ### Properties
550
+
551
+ | Property | Type | Values | Description |
552
+ | ------------- | ---------- | ---------------------------- | ----------------------------------- |
553
+ | `model` | identifier | `sonnet`, `opus`, `haiku` | The Claude model to use |
554
+ | `prompt` | string | Any string | System prompt/context for the agent |
555
+ | `persist` | value | `true`, `project`, or STRING | Enable persistent memory for agent |
556
+ | `skills` | array | String array | Skills assigned to this agent |
557
+ | `permissions` | block | Permission rules | Access control for the agent |
558
+
559
+ ### Persist Property
560
+
561
+ The `persist` property enables agents to maintain memory across invocations:
562
+
563
+ ```prose
564
+ # Execution-scoped persistence (memory dies with run)
565
+ agent captain:
566
+ model: opus
567
+ persist: true
568
+ prompt: "You coordinate and review"
569
+
570
+ # Project-scoped persistence (memory survives across runs)
571
+ agent advisor:
572
+ model: opus
573
+ persist: project
574
+ prompt: "You provide architectural guidance"
575
+
576
+ # Custom path persistence
577
+ agent shared:
578
+ model: opus
579
+ persist: ".prose/custom/shared-agent/"
580
+ prompt: "Shared across programs"
581
+ ```
582
+
583
+ | Value | Memory Location | Lifetime |
584
+ | --------- | --------------------------------- | ------------------- |
585
+ | `true` | `.prose/runs/{id}/agents/{name}/` | Dies with execution |
586
+ | `project` | `.prose/agents/{name}/` | Survives executions |
587
+ | STRING | Specified path | User-controlled |
588
+
589
+ ### Skills Property
590
+
591
+ The `skills` property assigns imported skills to an agent:
592
+
593
+ ```prose
594
+ use "@anthropic/web-search"
595
+ use "@anthropic/summarizer" as summarizer
596
+
597
+ agent researcher:
598
+ skills: ["web-search", "summarizer"]
599
+ ```
600
+
601
+ Skills must be imported before they can be assigned. Referencing an unimported skill generates a warning.
602
+
603
+ ### Permissions Property
604
+
605
+ The `permissions` property controls agent access:
606
+
607
+ ```prose
608
+ agent secure-agent:
609
+ permissions:
610
+ read: ["*.md", "*.txt"]
611
+ write: ["output/"]
612
+ bash: deny
613
+ network: allow
614
+ ```
615
+
616
+ #### Permission Types
617
+
618
+ | Type | Description |
619
+ | --------- | -------------------------------------------- |
620
+ | `read` | Files the agent can read (glob patterns) |
621
+ | `write` | Files the agent can write (glob patterns) |
622
+ | `execute` | Files the agent can execute (glob patterns) |
623
+ | `bash` | Shell access: `allow`, `deny`, or `prompt` |
624
+ | `network` | Network access: `allow`, `deny`, or `prompt` |
625
+
626
+ #### Permission Values
627
+
628
+ | Value | Description |
629
+ | -------- | ------------------------------------------------- |
630
+ | `allow` | Permission granted |
631
+ | `deny` | Permission denied |
632
+ | `prompt` | Ask user for permission |
633
+ | Array | List of allowed patterns (for read/write/execute) |
634
+
635
+ ### Examples
636
+
637
+ ```prose
638
+ # Define a research agent
639
+ agent researcher:
640
+ model: sonnet
641
+ prompt: "You are a research assistant skilled at finding and synthesizing information"
642
+
643
+ # Define a writing agent
644
+ agent writer:
645
+ model: opus
646
+ prompt: "You are a technical writer who creates clear, concise documentation"
647
+
648
+ # Agent with only model
649
+ agent quick:
650
+ model: haiku
651
+
652
+ # Agent with only prompt
653
+ agent expert:
654
+ prompt: "You are a domain expert"
655
+
656
+ # Agent with skills
657
+ agent web-researcher:
658
+ model: sonnet
659
+ skills: ["web-search", "summarizer"]
660
+
661
+ # Agent with permissions
662
+ agent file-handler:
663
+ permissions:
664
+ read: ["*.md", "*.txt"]
665
+ write: ["output/"]
666
+ bash: deny
667
+ ```
668
+
669
+ ### Model Selection
670
+
671
+ | Model | Use Case |
672
+ | -------- | ------------------------------------- |
673
+ | `haiku` | Fast, simple tasks; quick responses |
674
+ | `sonnet` | Balanced performance; general purpose |
675
+ | `opus` | Complex reasoning; detailed analysis |
676
+
677
+ ### Execution Semantics
678
+
679
+ When a session references an agent:
680
+
681
+ 1. The agent's `model` property determines which Claude model is used
682
+ 2. The agent's `prompt` property is included as system context
683
+ 3. Session properties can override agent defaults
684
+
685
+ ### Validation Rules
686
+
687
+ | Check | Severity | Message |
688
+ | --------------------- | -------- | ------------------------------ |
689
+ | Duplicate agent name | Error | Agent already defined |
690
+ | Invalid model value | Error | Must be sonnet, opus, or haiku |
691
+ | Empty prompt property | Warning | Consider providing a prompt |
692
+ | Duplicate property | Error | Property already specified |
693
+
694
+ ---
695
+
696
+ ## Session Statement
697
+
698
+ The session statement is the primary executable construct in OpenProse. It spawns a subagent to complete a task.
699
+
700
+ ### Syntax Variants
701
+
702
+ #### Simple Session (with inline prompt)
703
+
704
+ ```prose
705
+ session "prompt text"
706
+ ```
707
+
708
+ #### Session with Agent Reference
709
+
710
+ ```prose
711
+ session: agentName
712
+ ```
713
+
714
+ #### Named Session with Agent
715
+
716
+ ```prose
717
+ session sessionName: agentName
718
+ ```
719
+
720
+ #### Session with Properties
721
+
722
+ ```prose
723
+ session: agentName
724
+ prompt: "Override the agent's default prompt"
725
+ model: opus # Override the agent's model
726
+ ```
727
+
728
+ ### Property Overrides
729
+
730
+ When a session references an agent, it can override the agent's properties:
731
+
732
+ ```prose
733
+ agent researcher:
734
+ model: sonnet
735
+ prompt: "You are a research assistant"
736
+
737
+ # Use researcher with different model
738
+ session: researcher
739
+ model: opus
740
+
741
+ # Use researcher with different prompt
742
+ session: researcher
743
+ prompt: "Research this specific topic in depth"
744
+
745
+ # Override both
746
+ session: researcher
747
+ model: opus
748
+ prompt: "Specialized research task"
749
+ ```
750
+
751
+ ### Execution Semantics
752
+
753
+ When the OpenProse VM encounters a `session` statement:
754
+
755
+ 1. **Resolve Configuration**: Merge agent defaults with session overrides
756
+ 2. **Spawn a Subagent**: Create a new Claude subagent with the resolved configuration
757
+ 3. **Send the Prompt**: Pass the prompt string to the subagent
758
+ 4. **Wait for Completion**: Block until the subagent finishes
759
+ 5. **Continue**: Proceed to the next statement
760
+
761
+ ### Execution Flow Diagram
762
+
763
+ ```
764
+ OpenProse VM Subagent
765
+ | |
766
+ | spawn session |
767
+ |----------------------------->|
768
+ | |
769
+ | send prompt |
770
+ |----------------------------->|
771
+ | |
772
+ | [processing...] |
773
+ | |
774
+ | session complete |
775
+ |<-----------------------------|
776
+ | |
777
+ | continue to next statement |
778
+ v v
779
+ ```
780
+
781
+ ### Sequential Execution
782
+
783
+ Multiple sessions execute sequentially:
784
+
785
+ ```prose
786
+ session "First task"
787
+ session "Second task"
788
+ session "Third task"
789
+ ```
790
+
791
+ Each session waits for the previous one to complete before starting.
792
+
793
+ ### Using Claude Code's Task Tool
794
+
795
+ To execute a session, use the Task tool:
796
+
797
+ ```typescript
798
+ // Simple session
799
+ Task({
800
+ description: "OpenProse session",
801
+ prompt: "The prompt from the session statement",
802
+ subagent_type: "general-purpose",
803
+ });
804
+
805
+ // Session with agent configuration
806
+ Task({
807
+ description: "OpenProse session",
808
+ prompt: "The session prompt",
809
+ subagent_type: "general-purpose",
810
+ model: "opus", // From agent or override
811
+ });
812
+ ```
813
+
814
+ ### Validation Rules
815
+
816
+ | Check | Severity | Message |
817
+ | ------------------------- | -------- | -------------------------------------------- |
818
+ | Missing prompt and agent | Error | Session requires a prompt or agent reference |
819
+ | Undefined agent reference | Error | Agent not defined |
820
+ | Empty prompt `""` | Warning | Session has empty prompt |
821
+ | Whitespace-only prompt | Warning | Session prompt contains only whitespace |
822
+ | Prompt > 10,000 chars | Warning | Consider breaking into smaller tasks |
823
+ | Duplicate property | Error | Property already specified |
824
+
825
+ ### Examples
826
+
827
+ ```prose
828
+ # Simple session
829
+ session "Hello world"
830
+
831
+ # Session with agent
832
+ agent researcher:
833
+ model: sonnet
834
+ prompt: "You research topics thoroughly"
835
+
836
+ session: researcher
837
+ prompt: "Research quantum computing applications"
838
+
839
+ # Named session
840
+ session analysis: researcher
841
+ prompt: "Analyze the competitive landscape"
842
+ ```
843
+
844
+ ### Canonical Form
845
+
846
+ The compiled output preserves the structure:
847
+
848
+ ```
849
+ Input:
850
+ agent researcher:
851
+ model: sonnet
852
+
853
+ session: researcher
854
+ prompt: "Do research"
855
+
856
+ Output:
857
+ agent researcher:
858
+ model: sonnet
859
+ session: researcher
860
+ prompt: "Do research"
861
+ ```
862
+
863
+ ---
864
+
865
+ ## Resume Statement
866
+
867
+ The `resume` statement continues a persistent agent with its accumulated memory.
868
+
869
+ ### Syntax
870
+
871
+ ```prose
872
+ resume: agentName
873
+ prompt: "Continue from where we left off"
874
+ ```
875
+
876
+ ### Semantics
877
+
878
+ | Keyword | Behavior |
879
+ | ---------- | ------------------------------------- |
880
+ | `session:` | Ignores existing memory, starts fresh |
881
+ | `resume:` | Loads memory, continues with context |
882
+
883
+ ### Examples
884
+
885
+ ```prose
886
+ agent captain:
887
+ model: opus
888
+ persist: true
889
+ prompt: "You coordinate and review"
890
+
891
+ # First invocation - creates memory
892
+ session: captain
893
+ prompt: "Review the plan"
894
+ context: plan
895
+
896
+ # Later invocation - loads memory
897
+ resume: captain
898
+ prompt: "Review step 1 of the plan"
899
+ context: step1
900
+
901
+ # Output capture works with resume
902
+ let review = resume: captain
903
+ prompt: "Final review of all steps"
904
+ ```
905
+
906
+ ### Validation Rules
907
+
908
+ | Check | Severity | Message |
909
+ | ------------------------------------------ | -------- | -------------------------------------------------------------------- |
910
+ | `resume:` on non-persistent agent | Error | Agent must have `persist:` property to use `resume:` |
911
+ | `resume:` with no existing memory | Error | No memory file exists for agent; use `session:` for first invocation |
912
+ | `session:` on persistent agent with memory | Warning | Will ignore existing memory; use `resume:` to continue |
913
+ | Undefined agent reference | Error | Agent not defined |
914
+
915
+ ---
916
+
917
+ ## Variables & Context
918
+
919
+ Variables allow you to capture the results of sessions and pass them as context to subsequent sessions.
920
+
921
+ ### Let Binding
922
+
923
+ The `let` keyword creates a mutable variable bound to a session result:
924
+
925
+ ```prose
926
+ let research = session "Research the topic thoroughly"
927
+
928
+ # research now holds the output of that session
929
+ ```
930
+
931
+ Variables can be reassigned:
932
+
933
+ ```prose
934
+ let draft = session "Write initial draft"
935
+
936
+ # Revise the draft
937
+ draft = session "Improve the draft"
938
+ context: draft
939
+ ```
940
+
941
+ ### Const Binding
942
+
943
+ The `const` keyword creates an immutable variable:
944
+
945
+ ```prose
946
+ const config = session "Get configuration settings"
947
+
948
+ # This would be an error:
949
+ # config = session "Try to change"
950
+ ```
951
+
952
+ ### Context Property
953
+
954
+ The `context` property passes previous session outputs to a new session:
955
+
956
+ #### Single Context
957
+
958
+ ```prose
959
+ let research = session "Research quantum computing"
960
+
961
+ session "Write summary"
962
+ context: research
963
+ ```
964
+
965
+ #### Multiple Contexts
966
+
967
+ ```prose
968
+ let research = session "Research the topic"
969
+ let analysis = session "Analyze the findings"
970
+
971
+ session "Write final report"
972
+ context: [research, analysis]
973
+ ```
974
+
975
+ #### Empty Context (Fresh Start)
976
+
977
+ Use an empty array to start a session without inherited context:
978
+
979
+ ```prose
980
+ session "Independent task"
981
+ context: []
982
+ ```
983
+
984
+ #### Object Context Shorthand
985
+
986
+ For passing multiple named results (especially from parallel blocks), use object shorthand:
987
+
988
+ ```prose
989
+ parallel:
990
+ a = session "Task A"
991
+ b = session "Task B"
992
+
993
+ session "Combine results"
994
+ context: { a, b }
995
+ ```
996
+
997
+ This is equivalent to passing an object where each property is a variable reference.
998
+
999
+ ### Complete Example
1000
+
1001
+ ```prose
1002
+ agent researcher:
1003
+ model: sonnet
1004
+ prompt: "You are a research assistant"
1005
+
1006
+ agent writer:
1007
+ model: opus
1008
+ prompt: "You are a technical writer"
1009
+
1010
+ # Gather research
1011
+ let research = session: researcher
1012
+ prompt: "Research quantum computing developments"
1013
+
1014
+ # Analyze findings
1015
+ let analysis = session: researcher
1016
+ prompt: "Analyze the key findings"
1017
+ context: research
1018
+
1019
+ # Write the final report using both contexts
1020
+ const report = session: writer
1021
+ prompt: "Write a comprehensive report"
1022
+ context: [research, analysis]
1023
+ ```
1024
+
1025
+ ### Validation Rules
1026
+
1027
+ | Check | Severity | Message |
1028
+ | ------------------------------- | -------- | -------------------------------------------------- |
1029
+ | Duplicate variable name | Error | Variable already defined |
1030
+ | Const reassignment | Error | Cannot reassign const variable |
1031
+ | Undefined variable reference | Error | Undefined variable |
1032
+ | Variable conflicts with agent | Error | Variable name conflicts with agent name |
1033
+ | Undefined context variable | Error | Undefined variable in context |
1034
+ | Non-identifier in context array | Error | Context array elements must be variable references |
1035
+
1036
+ ### Flat Namespace Requirement
1037
+
1038
+ All variable names must be **unique within a program**. No shadowing is allowed across scopes.
1039
+
1040
+ **This is a compile error:**
1041
+
1042
+ ```prose
1043
+ let result = session "Outer task"
1044
+
1045
+ for item in items:
1046
+ let result = session "Inner task" # Error: 'result' already defined
1047
+ context: item
1048
+ ```
1049
+
1050
+ **Why this constraint:** Since bindings are stored as `bindings/{name}.md`, two variables with the same name would collide on the filesystem. Rather than introduce complex scoping rules, we enforce uniqueness.
1051
+
1052
+ **Collision scenarios this prevents:**
1053
+
1054
+ 1. Variable inside loop shadows variable outside loop
1055
+ 2. Variables in different `if`/`elif`/`else` branches with same name
1056
+ 3. Block parameters shadowing outer variables
1057
+ 4. Parallel branches reusing outer variable names
1058
+
1059
+ **Exception:** Imported programs run in isolated namespaces. A variable `result` in the main program does not collide with `result` in an imported program (they write to different `imports/{handle}--{slug}/bindings/` directories).
1060
+
1061
+ ---
1062
+
1063
+ ## Composition Blocks
1064
+
1065
+ Composition blocks allow you to structure programs into reusable, named units and express sequences of operations inline.
1066
+
1067
+ ### do: Block (Anonymous Sequential Block)
1068
+
1069
+ The `do:` keyword creates an explicit sequential block. All statements in the block execute in order.
1070
+
1071
+ #### Syntax
1072
+
1073
+ ```prose
1074
+ do:
1075
+ statement1
1076
+ statement2
1077
+ ...
1078
+ ```
1079
+
1080
+ #### Examples
1081
+
1082
+ ```prose
1083
+ # Explicit sequential block
1084
+ do:
1085
+ session "Research the topic"
1086
+ session "Analyze findings"
1087
+ session "Write summary"
1088
+
1089
+ # Assign result to a variable
1090
+ let result = do:
1091
+ session "Gather data"
1092
+ session "Process data"
1093
+ ```
1094
+
1095
+ ### Block Definitions
1096
+
1097
+ Named blocks create reusable workflow components. Define once, invoke multiple times.
1098
+
1099
+ #### Syntax
1100
+
1101
+ ```prose
1102
+ block name:
1103
+ statement1
1104
+ statement2
1105
+ ...
1106
+ ```
1107
+
1108
+ #### Invoking Blocks
1109
+
1110
+ Use `do` followed by the block name to invoke a defined block:
1111
+
1112
+ ```prose
1113
+ do blockname
1114
+ ```
1115
+
1116
+ #### Examples
1117
+
1118
+ ```prose
1119
+ # Define a review pipeline
1120
+ block review-pipeline:
1121
+ session "Security review"
1122
+ session "Performance review"
1123
+ session "Synthesize reviews"
1124
+
1125
+ # Define another block
1126
+ block final-check:
1127
+ session "Final verification"
1128
+ session "Sign off"
1129
+
1130
+ # Use the blocks
1131
+ do review-pipeline
1132
+ session "Make fixes based on review"
1133
+ do final-check
1134
+ ```
1135
+
1136
+ ### Block Parameters
1137
+
1138
+ Blocks can accept parameters to make them more flexible and reusable.
1139
+
1140
+ #### Syntax
1141
+
1142
+ ```prose
1143
+ block name(param1, param2):
1144
+ # param1 and param2 are available here
1145
+ statement1
1146
+ statement2
1147
+ ```
1148
+
1149
+ #### Invoking with Arguments
1150
+
1151
+ Pass arguments when invoking a parameterized block:
1152
+
1153
+ ```prose
1154
+ do name(arg1, arg2)
1155
+ ```
1156
+
1157
+ #### Examples
1158
+
1159
+ ```prose
1160
+ # Define a parameterized block
1161
+ block review(topic):
1162
+ session "Research {topic} thoroughly"
1163
+ session "Analyze key findings about {topic}"
1164
+ session "Summarize {topic} analysis"
1165
+
1166
+ # Invoke with different arguments
1167
+ do review("quantum computing")
1168
+ do review("machine learning")
1169
+ do review("blockchain")
1170
+ ```
1171
+
1172
+ #### Multiple Parameters
1173
+
1174
+ ```prose
1175
+ block process-item(item, mode):
1176
+ session "Process {item} using {mode} mode"
1177
+ session "Verify {item} processing"
1178
+
1179
+ do process-item("data.csv", "strict")
1180
+ do process-item("config.json", "lenient")
1181
+ ```
1182
+
1183
+ #### Parameter Scope
1184
+
1185
+ - Parameters are scoped to the block body
1186
+ - Parameters shadow outer variables of the same name (with warning)
1187
+ - Parameters are implicitly `const` within the block
1188
+
1189
+ #### Validation Rules
1190
+
1191
+ | Check | Severity | Message |
1192
+ | ----------------------- | -------- | ---------------------------------------------- |
1193
+ | Argument count mismatch | Warning | Block expects N parameters but got M arguments |
1194
+ | Parameter shadows outer | Warning | Parameter shadows outer variable |
1195
+
1196
+ ### Inline Sequence (Arrow Operator)
1197
+
1198
+ The `->` operator chains sessions into a sequence on a single line. This is syntactic sugar for sequential execution.
1199
+
1200
+ #### Syntax
1201
+
1202
+ ```prose
1203
+ session "A" -> session "B" -> session "C"
1204
+ ```
1205
+
1206
+ This is equivalent to:
1207
+
1208
+ ```prose
1209
+ session "A"
1210
+ session "B"
1211
+ session "C"
1212
+ ```
1213
+
1214
+ #### Examples
1215
+
1216
+ ```prose
1217
+ # Quick pipeline
1218
+ session "Plan" -> session "Execute" -> session "Review"
1219
+
1220
+ # Assign result
1221
+ let workflow = session "Draft" -> session "Edit" -> session "Finalize"
1222
+ ```
1223
+
1224
+ ### Block Hoisting
1225
+
1226
+ Block definitions are hoisted - you can use a block before it's defined in the source:
1227
+
1228
+ ```prose
1229
+ # Use before definition
1230
+ do validation-checks
1231
+
1232
+ # Definition comes later
1233
+ block validation-checks:
1234
+ session "Check syntax"
1235
+ session "Check semantics"
1236
+ ```
1237
+
1238
+ ### Nested Composition
1239
+
1240
+ Blocks and do: blocks can be nested:
1241
+
1242
+ ```prose
1243
+ block outer-workflow:
1244
+ session "Start"
1245
+ do:
1246
+ session "Sub-task 1"
1247
+ session "Sub-task 2"
1248
+ session "End"
1249
+
1250
+ do:
1251
+ do outer-workflow
1252
+ session "Final step"
1253
+ ```
1254
+
1255
+ ### Context with Blocks
1256
+
1257
+ Blocks work with the context system:
1258
+
1259
+ ```prose
1260
+ # Capture do block result
1261
+ let research = do:
1262
+ session "Gather information"
1263
+ session "Analyze patterns"
1264
+
1265
+ # Use in subsequent session
1266
+ session "Write report"
1267
+ context: research
1268
+ ```
1269
+
1270
+ ### Validation Rules
1271
+
1272
+ | Check | Severity | Message |
1273
+ | ------------------------------- | -------- | ------------------------------------ |
1274
+ | Undefined block reference | Error | Block not defined |
1275
+ | Duplicate block definition | Error | Block already defined |
1276
+ | Block name conflicts with agent | Error | Block name conflicts with agent name |
1277
+ | Empty block name | Error | Block definition must have a name |
1278
+
1279
+ ---
1280
+
1281
+ ## Parallel Blocks
1282
+
1283
+ Parallel blocks allow multiple sessions to run concurrently. All branches execute simultaneously, and the block waits for all to complete before continuing.
1284
+
1285
+ ### Basic Syntax
1286
+
1287
+ ```prose
1288
+ parallel:
1289
+ session "Security review"
1290
+ session "Performance review"
1291
+ session "Style review"
1292
+ ```
1293
+
1294
+ All three sessions start at the same time and run concurrently. The program waits for all of them to complete before proceeding.
1295
+
1296
+ ### Named Parallel Results
1297
+
1298
+ Capture the results of parallel branches into variables:
1299
+
1300
+ ```prose
1301
+ parallel:
1302
+ security = session "Security review"
1303
+ perf = session "Performance review"
1304
+ style = session "Style review"
1305
+ ```
1306
+
1307
+ These variables can then be used in subsequent sessions.
1308
+
1309
+ ### Object Context Shorthand
1310
+
1311
+ Pass multiple parallel results to a session using object shorthand:
1312
+
1313
+ ```prose
1314
+ parallel:
1315
+ security = session "Security review"
1316
+ perf = session "Performance review"
1317
+ style = session "Style review"
1318
+
1319
+ session "Synthesize all reviews"
1320
+ context: { security, perf, style }
1321
+ ```
1322
+
1323
+ The object shorthand `{ a, b, c }` is equivalent to passing an object with properties `a`, `b`, and `c` where each property's value is the corresponding variable.
1324
+
1325
+ ### Mixed Composition
1326
+
1327
+ #### Parallel Inside Sequential
1328
+
1329
+ ```prose
1330
+ do:
1331
+ session "Setup"
1332
+ parallel:
1333
+ session "Task A"
1334
+ session "Task B"
1335
+ session "Cleanup"
1336
+ ```
1337
+
1338
+ The setup runs first, then Task A and Task B run in parallel, and finally cleanup runs.
1339
+
1340
+ #### Sequential Inside Parallel
1341
+
1342
+ ```prose
1343
+ parallel:
1344
+ do:
1345
+ session "Multi-step task 1a"
1346
+ session "Multi-step task 1b"
1347
+ do:
1348
+ session "Multi-step task 2a"
1349
+ session "Multi-step task 2b"
1350
+ ```
1351
+
1352
+ Each parallel branch contains a sequential workflow. The two workflows run concurrently.
1353
+
1354
+ ### Assigning Parallel Blocks to Variables
1355
+
1356
+ ```prose
1357
+ let results = parallel:
1358
+ session "Task A"
1359
+ session "Task B"
1360
+ ```
1361
+
1362
+ ### Complete Example
1363
+
1364
+ ```prose
1365
+ agent reviewer:
1366
+ model: sonnet
1367
+
1368
+ # Run parallel reviews
1369
+ parallel:
1370
+ sec = session: reviewer
1371
+ prompt: "Review for security issues"
1372
+ perf = session: reviewer
1373
+ prompt: "Review for performance issues"
1374
+ style = session: reviewer
1375
+ prompt: "Review for style issues"
1376
+
1377
+ # Combine all reviews
1378
+ session "Create unified review report"
1379
+ context: { sec, perf, style }
1380
+ ```
1381
+
1382
+ ### Join Strategies
1383
+
1384
+ By default, parallel blocks wait for all branches to complete. You can specify alternative join strategies:
1385
+
1386
+ #### First (Race)
1387
+
1388
+ Return as soon as the first branch completes, cancel others:
1389
+
1390
+ ```prose
1391
+ parallel ("first"):
1392
+ session "Try approach A"
1393
+ session "Try approach B"
1394
+ session "Try approach C"
1395
+ ```
1396
+
1397
+ The first successful result wins. Other branches are cancelled.
1398
+
1399
+ #### Any (N of M)
1400
+
1401
+ Return when any N branches complete successfully:
1402
+
1403
+ ```prose
1404
+ # Default: any 1 success
1405
+ parallel ("any"):
1406
+ session "Attempt 1"
1407
+ session "Attempt 2"
1408
+
1409
+ # Specific count: wait for 2 successes
1410
+ parallel ("any", count: 2):
1411
+ session "Attempt 1"
1412
+ session "Attempt 2"
1413
+ session "Attempt 3"
1414
+ ```
1415
+
1416
+ #### All (Default)
1417
+
1418
+ Wait for all branches to complete:
1419
+
1420
+ ```prose
1421
+ # Implicit - this is the default
1422
+ parallel:
1423
+ session "Task A"
1424
+ session "Task B"
1425
+
1426
+ # Explicit
1427
+ parallel ("all"):
1428
+ session "Task A"
1429
+ session "Task B"
1430
+ ```
1431
+
1432
+ ### Failure Policies
1433
+
1434
+ Control how the parallel block handles branch failures:
1435
+
1436
+ #### Fail-Fast (Default)
1437
+
1438
+ If any branch fails, fail immediately and cancel other branches:
1439
+
1440
+ ```prose
1441
+ parallel: # Implicit fail-fast
1442
+ session "Critical task 1"
1443
+ session "Critical task 2"
1444
+
1445
+ # Explicit
1446
+ parallel (on-fail: "fail-fast"):
1447
+ session "Critical task 1"
1448
+ session "Critical task 2"
1449
+ ```
1450
+
1451
+ #### Continue
1452
+
1453
+ Let all branches complete, then report all failures:
1454
+
1455
+ ```prose
1456
+ parallel (on-fail: "continue"):
1457
+ session "Task 1"
1458
+ session "Task 2"
1459
+ session "Task 3"
1460
+
1461
+ # Continue regardless of which branches failed
1462
+ session "Process results, including failures"
1463
+ ```
1464
+
1465
+ #### Ignore
1466
+
1467
+ Ignore all failures, always succeed:
1468
+
1469
+ ```prose
1470
+ parallel (on-fail: "ignore"):
1471
+ session "Optional enrichment 1"
1472
+ session "Optional enrichment 2"
1473
+
1474
+ # This always runs, even if all branches failed
1475
+ session "Continue regardless"
1476
+ ```
1477
+
1478
+ ### Combining Modifiers
1479
+
1480
+ Join strategies and failure policies can be combined:
1481
+
1482
+ ```prose
1483
+ # Race with resilience
1484
+ parallel ("first", on-fail: "continue"):
1485
+ session "Fast but unreliable"
1486
+ session "Slow but reliable"
1487
+
1488
+ # Get any 2 results, ignoring failures
1489
+ parallel ("any", count: 2, on-fail: "ignore"):
1490
+ session "Approach 1"
1491
+ session "Approach 2"
1492
+ session "Approach 3"
1493
+ session "Approach 4"
1494
+ ```
1495
+
1496
+ ### Execution Semantics
1497
+
1498
+ When the OpenProse VM encounters a `parallel:` block:
1499
+
1500
+ 1. **Fork**: Start all branches concurrently
1501
+ 2. **Execute**: Each branch runs independently
1502
+ 3. **Join**: Wait according to join strategy:
1503
+ - `"all"` (default): Wait for all branches
1504
+ - `"first"`: Return on first completion
1505
+ - `"any"`: Return on first success (or N successes with `count`)
1506
+ 4. **Handle failures**: According to on-fail policy:
1507
+ - `"fail-fast"` (default): Cancel remaining and fail immediately
1508
+ - `"continue"`: Wait for all, then report failures
1509
+ - `"ignore"`: Treat failures as successes
1510
+ 5. **Continue**: Proceed to the next statement with available results
1511
+
1512
+ ### Validation Rules
1513
+
1514
+ | Check | Severity | Message |
1515
+ | ------------------------------------ | -------- | -------------------------------------------- |
1516
+ | Invalid join strategy | Error | Must be "all", "first", or "any" |
1517
+ | Invalid on-fail policy | Error | Must be "fail-fast", "continue", or "ignore" |
1518
+ | Count without "any" | Error | Count is only valid with "any" strategy |
1519
+ | Count less than 1 | Error | Count must be at least 1 |
1520
+ | Count exceeds branches | Warning | Count exceeds number of parallel branches |
1521
+ | Duplicate variable in parallel | Error | Variable already defined |
1522
+ | Variable conflicts with agent | Error | Variable name conflicts with agent name |
1523
+ | Undefined variable in object context | Error | Undefined variable in context |
1524
+
1525
+ ---
1526
+
1527
+ ## Fixed Loops
1528
+
1529
+ Fixed loops provide bounded iteration over a set number of times or over a collection.
1530
+
1531
+ ### Repeat Block
1532
+
1533
+ The `repeat` block executes its body a fixed number of times.
1534
+
1535
+ #### Basic Syntax
1536
+
1537
+ ```prose
1538
+ repeat 3:
1539
+ session "Generate a creative idea"
1540
+ ```
1541
+
1542
+ #### With Index Variable
1543
+
1544
+ Access the current iteration index using `as`:
1545
+
1546
+ ```prose
1547
+ repeat 5 as i:
1548
+ session "Process item"
1549
+ context: i
1550
+ ```
1551
+
1552
+ The index variable `i` is scoped to the loop body and starts at 0.
1553
+
1554
+ ### For-Each Block
1555
+
1556
+ The `for` block iterates over a collection.
1557
+
1558
+ #### Basic Syntax
1559
+
1560
+ ```prose
1561
+ let fruits = ["apple", "banana", "cherry"]
1562
+ for fruit in fruits:
1563
+ session "Describe this fruit"
1564
+ context: fruit
1565
+ ```
1566
+
1567
+ #### With Inline Array
1568
+
1569
+ ```prose
1570
+ for topic in ["AI", "climate", "space"]:
1571
+ session "Research this topic"
1572
+ context: topic
1573
+ ```
1574
+
1575
+ #### With Index Variable
1576
+
1577
+ Access both the item and its index:
1578
+
1579
+ ```prose
1580
+ let items = ["a", "b", "c"]
1581
+ for item, i in items:
1582
+ session "Process item with index"
1583
+ context: [item, i]
1584
+ ```
1585
+
1586
+ ### Parallel For-Each
1587
+
1588
+ The `parallel for` block runs all iterations concurrently (fan-out pattern):
1589
+
1590
+ ```prose
1591
+ let topics = ["AI", "climate", "space"]
1592
+ parallel for topic in topics:
1593
+ session "Research this topic"
1594
+ context: topic
1595
+
1596
+ session "Combine all research"
1597
+ ```
1598
+
1599
+ This is equivalent to:
1600
+
1601
+ ```prose
1602
+ parallel:
1603
+ session "Research AI" context: "AI"
1604
+ session "Research climate" context: "climate"
1605
+ session "Research space" context: "space"
1606
+ ```
1607
+
1608
+ But more concise and dynamic.
1609
+
1610
+ ### Variable Scoping
1611
+
1612
+ Loop variables are scoped to the loop body:
1613
+
1614
+ - They are implicitly `const` within each iteration
1615
+ - They shadow outer variables of the same name (with a warning)
1616
+ - They are not accessible outside the loop
1617
+
1618
+ ```prose
1619
+ let item = session "outer"
1620
+ for item in ["a", "b"]:
1621
+ # 'item' here is the loop variable
1622
+ session "process loop item"
1623
+ context: item
1624
+ # 'item' here refers to the outer variable again
1625
+ session "use outer item"
1626
+ context: item
1627
+ ```
1628
+
1629
+ ### Nesting
1630
+
1631
+ Loops can be nested:
1632
+
1633
+ ```prose
1634
+ repeat 2:
1635
+ repeat 3:
1636
+ session "Inner task"
1637
+ ```
1638
+
1639
+ Different loop types can be combined:
1640
+
1641
+ ```prose
1642
+ let items = ["a", "b"]
1643
+ repeat 2:
1644
+ for item in items:
1645
+ session "Process item"
1646
+ context: item
1647
+ ```
1648
+
1649
+ ### Complete Example
1650
+
1651
+ ```prose
1652
+ # Generate multiple variations of ideas
1653
+ repeat 3:
1654
+ session "Generate a creative startup idea"
1655
+
1656
+ session "Select the best idea from the options above"
1657
+
1658
+ # Research the selected idea from multiple angles
1659
+ let angles = ["market", "technology", "competition"]
1660
+ parallel for angle in angles:
1661
+ session "Research this angle of the startup idea"
1662
+ context: angle
1663
+
1664
+ session "Synthesize all research into a business plan"
1665
+ ```
1666
+
1667
+ ### Validation Rules
1668
+
1669
+ | Check | Severity | Message |
1670
+ | ----------------------------- | -------- | ------------------------------------ |
1671
+ | Repeat count must be positive | Error | Repeat count must be positive |
1672
+ | Repeat count must be integer | Error | Repeat count must be an integer |
1673
+ | Undefined collection variable | Error | Undefined collection variable |
1674
+ | Loop variable shadows outer | Warning | Loop variable shadows outer variable |
1675
+
1676
+ ---
1677
+
1678
+ ## Unbounded Loops
1679
+
1680
+ Unbounded loops provide iteration with AI-evaluated termination conditions. Unlike fixed loops, the iteration count is not known ahead of time - the OpenProse VM evaluates conditions at runtime using its intelligence to determine when to stop.
1681
+
1682
+ ### Discretion Markers
1683
+
1684
+ Unbounded loops use **discretion markers** (`**...**`) to wrap AI-evaluated conditions. These markers signal that the enclosed text should be interpreted intelligently by the OpenProse VM at runtime, not as a literal boolean expression.
1685
+
1686
+ ```prose
1687
+ # The text inside **...** is evaluated by the AI
1688
+ loop until **the poem has vivid imagery and flows smoothly**:
1689
+ session "Review and improve the poem"
1690
+ ```
1691
+
1692
+ For multi-line conditions, use triple-asterisks:
1693
+
1694
+ ```prose
1695
+ loop until ***
1696
+ the document is complete
1697
+ all sections have been reviewed
1698
+ and formatting is consistent
1699
+ ***:
1700
+ session "Continue working on the document"
1701
+ ```
1702
+
1703
+ ### Basic Loop
1704
+
1705
+ The simplest unbounded loop runs indefinitely until explicitly limited:
1706
+
1707
+ ```prose
1708
+ loop:
1709
+ session "Process next item"
1710
+ ```
1711
+
1712
+ **Warning**: Loops without termination conditions or max iterations generate a warning. Always include a safety limit:
1713
+
1714
+ ```prose
1715
+ loop (max: 50):
1716
+ session "Process next item"
1717
+ ```
1718
+
1719
+ ### Loop Until
1720
+
1721
+ The `loop until` variant runs until a condition becomes true:
1722
+
1723
+ ```prose
1724
+ loop until **the task is complete**:
1725
+ session "Continue working on the task"
1726
+ ```
1727
+
1728
+ The OpenProse VM evaluates the discretion condition after each iteration and exits when it determines the condition is satisfied.
1729
+
1730
+ ### Loop While
1731
+
1732
+ The `loop while` variant runs while a condition remains true:
1733
+
1734
+ ```prose
1735
+ loop while **there are still items to process**:
1736
+ session "Process the next item"
1737
+ ```
1738
+
1739
+ Semantically, `loop while **X**` is equivalent to `loop until **not X**`.
1740
+
1741
+ ### Iteration Variable
1742
+
1743
+ Track the current iteration number using `as`:
1744
+
1745
+ ```prose
1746
+ loop until **done** as attempt:
1747
+ session "Try approach"
1748
+ context: attempt
1749
+ ```
1750
+
1751
+ The iteration variable:
1752
+
1753
+ - Starts at 0
1754
+ - Increments by 1 each iteration
1755
+ - Is scoped to the loop body
1756
+ - Is implicitly `const` within each iteration
1757
+
1758
+ ### Safety Limits
1759
+
1760
+ Specify maximum iterations with `(max: N)`:
1761
+
1762
+ ```prose
1763
+ # Stop after 10 iterations even if condition not met
1764
+ loop until **all bugs fixed** (max: 10):
1765
+ session "Find and fix a bug"
1766
+ ```
1767
+
1768
+ The loop exits when:
1769
+
1770
+ 1. The condition is satisfied (for `until`/`while` variants), OR
1771
+ 2. The maximum iteration count is reached
1772
+
1773
+ ### Complete Syntax
1774
+
1775
+ All options can be combined:
1776
+
1777
+ ```prose
1778
+ loop until **condition** (max: N) as i:
1779
+ body...
1780
+ ```
1781
+
1782
+ Order matters: condition comes before modifiers, modifiers before `as`.
1783
+
1784
+ ### Examples
1785
+
1786
+ #### Iterative Improvement
1787
+
1788
+ ```prose
1789
+ session "Write an initial draft"
1790
+
1791
+ loop until **the draft is polished and ready for review** (max: 5):
1792
+ session "Review the current draft and identify issues"
1793
+ session "Revise the draft to address the issues"
1794
+
1795
+ session "Present the final draft"
1796
+ ```
1797
+
1798
+ #### Debugging Workflow
1799
+
1800
+ ```prose
1801
+ session "Run tests to identify failures"
1802
+
1803
+ loop until **all tests pass** (max: 20) as attempt:
1804
+ session "Identify the failing test"
1805
+ session "Fix the bug causing the failure"
1806
+ session "Run tests again"
1807
+
1808
+ session "Confirm all tests pass and summarize fixes"
1809
+ ```
1810
+
1811
+ #### Consensus Building
1812
+
1813
+ ```prose
1814
+ parallel:
1815
+ opinion1 = session "Get first expert opinion"
1816
+ opinion2 = session "Get second expert opinion"
1817
+
1818
+ loop until **experts have reached consensus** (max: 5):
1819
+ session "Identify points of disagreement"
1820
+ context: { opinion1, opinion2 }
1821
+ session "Facilitate discussion to resolve differences"
1822
+
1823
+ session "Document the final consensus"
1824
+ ```
1825
+
1826
+ #### Quality Threshold
1827
+
1828
+ ```prose
1829
+ let draft = session "Create initial document"
1830
+
1831
+ loop while **quality score is below threshold** (max: 10):
1832
+ draft = session "Review and improve the document"
1833
+ context: draft
1834
+ session "Calculate new quality score"
1835
+
1836
+ session "Finalize the document"
1837
+ context: draft
1838
+ ```
1839
+
1840
+ ### Execution Semantics
1841
+
1842
+ When the OpenProse VM encounters an unbounded loop:
1843
+
1844
+ 1. **Initialize**: Set iteration counter to 0
1845
+ 2. **Check Condition** (for `until`/`while`):
1846
+ - For `until`: Exit if condition is satisfied
1847
+ - For `while`: Exit if condition is NOT satisfied
1848
+ 3. **Check Limit**: Exit if iteration count >= max iterations
1849
+ 4. **Execute Body**: Run all statements in the loop body
1850
+ 5. **Increment**: Increase iteration counter
1851
+ 6. **Repeat**: Go to step 2
1852
+
1853
+ For basic `loop:` without conditions:
1854
+
1855
+ - Only the max iteration limit can cause exit
1856
+ - Without max, the loop runs indefinitely (warning issued)
1857
+
1858
+ ### Condition Evaluation
1859
+
1860
+ The OpenProse VM uses its intelligence to evaluate discretion conditions:
1861
+
1862
+ 1. **Context Awareness**: The condition is evaluated in the context of what has happened so far in the session
1863
+ 2. **Semantic Understanding**: The condition text is interpreted semantically, not literally
1864
+ 3. **Uncertainty Handling**: When uncertain, the OpenProse VM may:
1865
+ - Continue iterating if progress is being made
1866
+ - Exit early if diminishing returns are detected
1867
+ - Use heuristics based on the condition's semantics
1868
+
1869
+ ### Nesting
1870
+
1871
+ Unbounded loops can be nested with other loop types:
1872
+
1873
+ ```prose
1874
+ # Unbounded inside fixed
1875
+ repeat 3:
1876
+ loop until **sub-task complete** (max: 10):
1877
+ session "Work on sub-task"
1878
+
1879
+ # Fixed inside unbounded
1880
+ loop until **all batches processed** (max: 5):
1881
+ repeat 3:
1882
+ session "Process batch item"
1883
+
1884
+ # Multiple unbounded
1885
+ loop until **outer condition** (max: 5):
1886
+ loop until **inner condition** (max: 10):
1887
+ session "Deep iteration"
1888
+ ```
1889
+
1890
+ ### Variable Scoping
1891
+
1892
+ Loop variables follow the same scoping rules as fixed loops:
1893
+
1894
+ ```prose
1895
+ let i = session "outer"
1896
+ loop until **done** as i:
1897
+ # 'i' here is the loop variable (shadows outer)
1898
+ session "use loop i"
1899
+ context: i
1900
+ # 'i' here refers to the outer variable again
1901
+ session "use outer i"
1902
+ context: i
1903
+ ```
1904
+
1905
+ ### Validation Rules
1906
+
1907
+ | Check | Severity | Message |
1908
+ | ----------------------------- | -------- | ------------------------------------- |
1909
+ | Loop without max or condition | Warning | Unbounded loop without max iterations |
1910
+ | Max iterations <= 0 | Error | Max iterations must be positive |
1911
+ | Max iterations not integer | Error | Max iterations must be an integer |
1912
+ | Empty discretion condition | Error | Discretion condition cannot be empty |
1913
+ | Very short condition | Warning | Discretion condition may be ambiguous |
1914
+ | Loop variable shadows outer | Warning | Loop variable shadows outer variable |
1915
+
1916
+ ---
1917
+
1918
+ ## Pipeline Operations
1919
+
1920
+ Pipeline operations provide functional-style collection transformations. They allow you to chain operations like map, filter, and reduce using the pipe operator (`|`).
1921
+
1922
+ ### Pipe Operator
1923
+
1924
+ The pipe operator (`|`) passes a collection to a transformation operation:
1925
+
1926
+ ```prose
1927
+ let items = ["a", "b", "c"]
1928
+ let results = items | map:
1929
+ session "Process this item"
1930
+ context: item
1931
+ ```
1932
+
1933
+ ### Map
1934
+
1935
+ The `map` operation transforms each element in a collection:
1936
+
1937
+ ```prose
1938
+ let articles = ["article1", "article2", "article3"]
1939
+
1940
+ let summaries = articles | map:
1941
+ session "Summarize this article in one sentence"
1942
+ context: item
1943
+ ```
1944
+
1945
+ Inside a map body, the implicit variable `item` refers to the current element being processed.
1946
+
1947
+ ### Filter
1948
+
1949
+ The `filter` operation keeps elements that match a condition:
1950
+
1951
+ ```prose
1952
+ let items = ["one", "two", "three", "four", "five"]
1953
+
1954
+ let short = items | filter:
1955
+ session "Does this word have 4 or fewer letters? Answer yes or no."
1956
+ context: item
1957
+ ```
1958
+
1959
+ The session in a filter body should return something the OpenProse VM can interpret as truthy/falsy (like "yes"/"no").
1960
+
1961
+ ### Reduce
1962
+
1963
+ The `reduce` operation accumulates elements into a single result:
1964
+
1965
+ ```prose
1966
+ let ideas = ["AI assistant", "smart home", "health tracker"]
1967
+
1968
+ let combined = ideas | reduce(summary, idea):
1969
+ session "Add this idea to the summary, creating a cohesive concept"
1970
+ context: [summary, idea]
1971
+ ```
1972
+
1973
+ The reduce operation requires explicit variable names:
1974
+
1975
+ - First variable (`summary`): the accumulator
1976
+ - Second variable (`idea`): the current item
1977
+
1978
+ The first item in the collection becomes the initial accumulator value.
1979
+
1980
+ ### Parallel Map (pmap)
1981
+
1982
+ The `pmap` operation is like `map` but runs all transformations concurrently:
1983
+
1984
+ ```prose
1985
+ let tasks = ["task1", "task2", "task3"]
1986
+
1987
+ let results = tasks | pmap:
1988
+ session "Process this task in parallel"
1989
+ context: item
1990
+
1991
+ session "Aggregate all results"
1992
+ context: results
1993
+ ```
1994
+
1995
+ This is similar to `parallel for`, but in pipeline syntax.
1996
+
1997
+ ### Chaining
1998
+
1999
+ Pipeline operations can be chained to compose complex transformations:
2000
+
2001
+ ```prose
2002
+ let topics = ["quantum computing", "blockchain", "machine learning", "IoT"]
2003
+
2004
+ let result = topics
2005
+ | filter:
2006
+ session "Is this topic trending? Answer yes or no."
2007
+ context: item
2008
+ | map:
2009
+ session "Write a one-line startup pitch for this topic"
2010
+ context: item
2011
+
2012
+ session "Present the startup pitches"
2013
+ context: result
2014
+ ```
2015
+
2016
+ Operations execute left-to-right: first filter, then map.
2017
+
2018
+ ### Complete Example
2019
+
2020
+ ```prose
2021
+ # Define a collection
2022
+ let articles = ["AI breakthroughs", "Climate solutions", "Space exploration"]
2023
+
2024
+ # Process with chained operations
2025
+ let summaries = articles
2026
+ | filter:
2027
+ session "Is this topic relevant to technology? Answer yes or no."
2028
+ context: item
2029
+ | map:
2030
+ session "Write a compelling one-paragraph summary"
2031
+ context: item
2032
+ | reduce(combined, summary):
2033
+ session "Merge this summary into the combined document"
2034
+ context: [combined, summary]
2035
+
2036
+ # Present the final result
2037
+ session "Format and present the combined summaries"
2038
+ context: summaries
2039
+ ```
2040
+
2041
+ ### Implicit Variables
2042
+
2043
+ | Operation | Available Variables |
2044
+ | --------- | -------------------------------------------- |
2045
+ | `map` | `item` - current element |
2046
+ | `filter` | `item` - current element |
2047
+ | `pmap` | `item` - current element |
2048
+ | `reduce` | Named explicitly: `reduce(accVar, itemVar):` |
2049
+
2050
+ ### Execution Semantics
2051
+
2052
+ When the OpenProse VM encounters a pipeline:
2053
+
2054
+ 1. **Input**: Start with the input collection
2055
+ 2. **For each operation**:
2056
+ - **map**: Transform each element, producing a new collection
2057
+ - **filter**: Keep elements where the session returns truthy
2058
+ - **reduce**: Accumulate elements into a single value
2059
+ - **pmap**: Transform all elements concurrently
2060
+ 3. **Output**: Return the final transformed collection/value
2061
+
2062
+ ### Variable Scoping
2063
+
2064
+ Pipeline variables are scoped to their operation body:
2065
+
2066
+ ```prose
2067
+ let item = "outer"
2068
+ let items = ["a", "b"]
2069
+
2070
+ let results = items | map:
2071
+ # 'item' here is the pipeline variable (shadows outer)
2072
+ session "process"
2073
+ context: item
2074
+
2075
+ # 'item' here refers to the outer variable again
2076
+ session "use outer"
2077
+ context: item
2078
+ ```
2079
+
2080
+ ### Validation Rules
2081
+
2082
+ | Check | Severity | Message |
2083
+ | ------------------------------- | -------- | -------------------------------------------------- |
2084
+ | Undefined input collection | Error | Undefined collection variable |
2085
+ | Invalid pipe operator | Error | Expected pipe operator (map, filter, reduce, pmap) |
2086
+ | Reduce without variables | Error | Expected accumulator and item variables |
2087
+ | Pipeline variable shadows outer | Warning | Implicit/explicit variable shadows outer variable |
2088
+
2089
+ ---
2090
+
2091
+ ## Error Handling
2092
+
2093
+ OpenProse provides structured error handling with try/catch/finally blocks, throw statements, and retry mechanisms for resilient workflows.
2094
+
2095
+ ### Try/Catch Blocks
2096
+
2097
+ The `try:` block wraps operations that might fail. The `catch:` block handles errors.
2098
+
2099
+ ```prose
2100
+ try:
2101
+ session "Attempt risky operation"
2102
+ catch:
2103
+ session "Handle the error gracefully"
2104
+ ```
2105
+
2106
+ #### Error Variable Access
2107
+
2108
+ Use `catch as err:` to capture error context for the error handler:
2109
+
2110
+ ```prose
2111
+ try:
2112
+ session "Call external API"
2113
+ catch as err:
2114
+ session "Log and handle the error"
2115
+ context: err
2116
+ ```
2117
+
2118
+ The error variable (`err`) contains contextual information about what went wrong and is only accessible within the catch block.
2119
+
2120
+ ### Try/Catch/Finally
2121
+
2122
+ The `finally:` block always executes, whether the try block succeeds or fails:
2123
+
2124
+ ```prose
2125
+ try:
2126
+ session "Acquire and use resource"
2127
+ catch:
2128
+ session "Handle any errors"
2129
+ finally:
2130
+ session "Always clean up resource"
2131
+ ```
2132
+
2133
+ #### Execution Order
2134
+
2135
+ 1. **Try succeeds**: try body → finally body
2136
+ 2. **Try fails**: try body (until failure) → catch body → finally body
2137
+
2138
+ ### Try/Finally (No Catch)
2139
+
2140
+ For cleanup without error handling, use try/finally:
2141
+
2142
+ ```prose
2143
+ try:
2144
+ session "Open connection and do work"
2145
+ finally:
2146
+ session "Close connection"
2147
+ ```
2148
+
2149
+ ### Throw Statement
2150
+
2151
+ The `throw` statement raises or re-raises errors.
2152
+
2153
+ #### Rethrow
2154
+
2155
+ Inside a catch block, `throw` without arguments re-raises the caught error to outer handlers:
2156
+
2157
+ ```prose
2158
+ try:
2159
+ try:
2160
+ session "Inner operation"
2161
+ catch:
2162
+ session "Partial handling"
2163
+ throw # Re-raise to outer handler
2164
+ catch:
2165
+ session "Handle re-raised error"
2166
+ ```
2167
+
2168
+ #### Throw with Message
2169
+
2170
+ Throw a new error with a custom message:
2171
+
2172
+ ```prose
2173
+ session "Check preconditions"
2174
+ throw "Precondition not met"
2175
+ ```
2176
+
2177
+ ### Nested Error Handling
2178
+
2179
+ Try blocks can be nested. Inner catch blocks don't trigger outer handlers unless they rethrow:
2180
+
2181
+ ```prose
2182
+ try:
2183
+ session "Outer operation"
2184
+ try:
2185
+ session "Inner risky operation"
2186
+ catch:
2187
+ session "Handle inner error" # Outer catch won't run
2188
+ session "Continue outer operation"
2189
+ catch:
2190
+ session "Handle outer error only"
2191
+ ```
2192
+
2193
+ ### Error Handling in Parallel
2194
+
2195
+ Each parallel branch can have its own error handling:
2196
+
2197
+ ```prose
2198
+ parallel:
2199
+ try:
2200
+ session "Branch A might fail"
2201
+ catch:
2202
+ session "Recover branch A"
2203
+ try:
2204
+ session "Branch B might fail"
2205
+ catch:
2206
+ session "Recover branch B"
2207
+
2208
+ session "Continue with recovered results"
2209
+ ```
2210
+
2211
+ This differs from the `on-fail:` policy which controls behavior when unhandled errors occur.
2212
+
2213
+ ### Retry Property
2214
+
2215
+ The `retry:` property makes a session automatically retry on failure:
2216
+
2217
+ ```prose
2218
+ session "Call flaky API"
2219
+ retry: 3
2220
+ ```
2221
+
2222
+ #### Retry with Backoff
2223
+
2224
+ Add `backoff:` to control delay between retries:
2225
+
2226
+ ```prose
2227
+ session "Rate-limited API"
2228
+ retry: 5
2229
+ backoff: exponential
2230
+ ```
2231
+
2232
+ **Backoff Strategies:**
2233
+
2234
+ | Strategy | Behavior |
2235
+ | ------------- | ---------------------------------- |
2236
+ | `none` | Immediate retry (default) |
2237
+ | `linear` | Fixed delay between retries |
2238
+ | `exponential` | Doubling delay (1s, 2s, 4s, 8s...) |
2239
+
2240
+ #### Retry with Context
2241
+
2242
+ Retry works with other session properties:
2243
+
2244
+ ```prose
2245
+ let data = session "Get input"
2246
+ session "Process data"
2247
+ context: data
2248
+ retry: 3
2249
+ backoff: linear
2250
+ ```
2251
+
2252
+ ### Combining Patterns
2253
+
2254
+ Retry and try/catch work together for maximum resilience:
2255
+
2256
+ ```prose
2257
+ try:
2258
+ session "Call external service"
2259
+ retry: 3
2260
+ backoff: exponential
2261
+ catch:
2262
+ session "All retries failed, use fallback"
2263
+ ```
2264
+
2265
+ ### Validation Rules
2266
+
2267
+ | Check | Severity | Message |
2268
+ | ---------------------------- | -------- | --------------------------------------------------- |
2269
+ | Try without catch or finally | Error | Try block must have at least "catch:" or "finally:" |
2270
+ | Error variable shadows outer | Warning | Error variable shadows outer variable |
2271
+ | Empty throw message | Warning | Throw message is empty |
2272
+ | Non-positive retry count | Error | Retry count must be positive |
2273
+ | Non-integer retry count | Error | Retry count must be an integer |
2274
+ | High retry count (>10) | Warning | Retry count is unusually high |
2275
+ | Invalid backoff strategy | Error | Must be none, linear, or exponential |
2276
+ | Retry on agent definition | Warning | Retry property is only valid in session statements |
2277
+
2278
+ ### Syntax Reference
2279
+
2280
+ ```
2281
+ try_block ::= "try" ":" NEWLINE INDENT statement+ DEDENT
2282
+ [catch_block]
2283
+ [finally_block]
2284
+
2285
+ catch_block ::= "catch" ["as" identifier] ":" NEWLINE INDENT statement+ DEDENT
2286
+
2287
+ finally_block ::= "finally" ":" NEWLINE INDENT statement+ DEDENT
2288
+
2289
+ throw_statement ::= "throw" [string_literal]
2290
+
2291
+ retry_property ::= "retry" ":" number_literal
2292
+
2293
+ backoff_property ::= "backoff" ":" ( "none" | "linear" | "exponential" )
2294
+ ```
2295
+
2296
+ ---
2297
+
2298
+ ## Choice Blocks
2299
+
2300
+ Choice blocks allow the OpenProse VM to select from multiple labeled options based on criteria. This is useful for branching workflows where the best path depends on runtime analysis.
2301
+
2302
+ ### Syntax
2303
+
2304
+ ```prose
2305
+ choice **criteria**:
2306
+ option "Label A":
2307
+ statements...
2308
+ option "Label B":
2309
+ statements...
2310
+ ```
2311
+
2312
+ ### Criteria
2313
+
2314
+ The criteria is wrapped in discretion markers (`**...**`) and is evaluated by the OpenProse VM to select which option to execute:
2315
+
2316
+ ```prose
2317
+ choice **the best approach for the current situation**:
2318
+ option "Quick fix":
2319
+ session "Apply a quick temporary fix"
2320
+ option "Full refactor":
2321
+ session "Perform a complete code refactor"
2322
+ ```
2323
+
2324
+ ### Multi-line Criteria
2325
+
2326
+ For complex criteria, use triple-asterisks:
2327
+
2328
+ ```prose
2329
+ choice ***
2330
+ which strategy is most appropriate
2331
+ given the current project constraints
2332
+ and timeline requirements
2333
+ ***:
2334
+ option "MVP approach":
2335
+ session "Build minimum viable product"
2336
+ option "Full feature set":
2337
+ session "Build complete feature set"
2338
+ ```
2339
+
2340
+ ### Examples
2341
+
2342
+ #### Simple Choice
2343
+
2344
+ ```prose
2345
+ let analysis = session "Analyze the code quality"
2346
+
2347
+ choice **the severity of issues found in the analysis**:
2348
+ option "Critical":
2349
+ session "Stop deployment and fix critical issues"
2350
+ context: analysis
2351
+ option "Minor":
2352
+ session "Log issues for later and proceed"
2353
+ context: analysis
2354
+ option "None":
2355
+ session "Proceed with deployment"
2356
+ ```
2357
+
2358
+ #### Choice with Multiple Statements per Option
2359
+
2360
+ ```prose
2361
+ choice **the user's experience level**:
2362
+ option "Beginner":
2363
+ session "Explain basic concepts first"
2364
+ session "Provide step-by-step guidance"
2365
+ session "Include helpful tips and warnings"
2366
+ option "Expert":
2367
+ session "Provide concise technical summary"
2368
+ session "Include advanced configuration options"
2369
+ ```
2370
+
2371
+ #### Nested Choices
2372
+
2373
+ ```prose
2374
+ choice **the type of request**:
2375
+ option "Bug report":
2376
+ choice **the bug severity**:
2377
+ option "Critical":
2378
+ session "Escalate immediately"
2379
+ option "Normal":
2380
+ session "Add to sprint backlog"
2381
+ option "Feature request":
2382
+ session "Add to feature backlog"
2383
+ ```
2384
+
2385
+ ### Execution Semantics
2386
+
2387
+ When the OpenProse VM encounters a `choice` block:
2388
+
2389
+ 1. **Evaluate Criteria**: Interpret the discretion criteria in current context
2390
+ 2. **Select Option**: Choose the most appropriate labeled option
2391
+ 3. **Execute**: Run all statements in the selected option's body
2392
+ 4. **Continue**: Proceed to the next statement after the choice block
2393
+
2394
+ Only one option is executed per choice block.
2395
+
2396
+ ### Validation Rules
2397
+
2398
+ | Check | Severity | Message |
2399
+ | ----------------------- | -------- | ------------------------------------------ |
2400
+ | Choice without options | Error | Choice block must have at least one option |
2401
+ | Empty criteria | Error | Choice criteria cannot be empty |
2402
+ | Duplicate option labels | Warning | Duplicate option label |
2403
+ | Empty option body | Warning | Option has empty body |
2404
+
2405
+ ### Syntax Reference
2406
+
2407
+ ```
2408
+ choice_block ::= "choice" discretion ":" NEWLINE INDENT option+ DEDENT
2409
+
2410
+ option ::= "option" string ":" NEWLINE INDENT statement+ DEDENT
2411
+
2412
+ discretion ::= "**" text "**" | "***" text "***"
2413
+ ```
2414
+
2415
+ ---
2416
+
2417
+ ## Conditional Statements
2418
+
2419
+ If/elif/else statements provide conditional branching based on AI-evaluated conditions using discretion markers.
2420
+
2421
+ ### If Statement
2422
+
2423
+ ```prose
2424
+ if **condition**:
2425
+ statements...
2426
+ ```
2427
+
2428
+ ### If/Else
2429
+
2430
+ ```prose
2431
+ if **condition**:
2432
+ statements...
2433
+ else:
2434
+ statements...
2435
+ ```
2436
+
2437
+ ### If/Elif/Else
2438
+
2439
+ ```prose
2440
+ if **first condition**:
2441
+ statements...
2442
+ elif **second condition**:
2443
+ statements...
2444
+ elif **third condition**:
2445
+ statements...
2446
+ else:
2447
+ statements...
2448
+ ```
2449
+
2450
+ ### Discretion Conditions
2451
+
2452
+ Conditions are wrapped in discretion markers (`**...**`) for AI evaluation:
2453
+
2454
+ ```prose
2455
+ let analysis = session "Analyze the codebase"
2456
+
2457
+ if **the code has security vulnerabilities**:
2458
+ session "Fix security issues immediately"
2459
+ context: analysis
2460
+ elif **the code has performance issues**:
2461
+ session "Optimize performance bottlenecks"
2462
+ context: analysis
2463
+ else:
2464
+ session "Proceed with normal review"
2465
+ context: analysis
2466
+ ```
2467
+
2468
+ ### Multi-line Conditions
2469
+
2470
+ Use triple-asterisks for complex conditions:
2471
+
2472
+ ```prose
2473
+ if ***
2474
+ the test suite passes
2475
+ and the code coverage is above 80%
2476
+ and there are no linting errors
2477
+ ***:
2478
+ session "Deploy to production"
2479
+ else:
2480
+ session "Fix issues before deploying"
2481
+ ```
2482
+
2483
+ ### Examples
2484
+
2485
+ #### Simple If
2486
+
2487
+ ```prose
2488
+ session "Check system health"
2489
+
2490
+ if **the system is healthy**:
2491
+ session "Continue with normal operations"
2492
+ ```
2493
+
2494
+ #### If/Else
2495
+
2496
+ ```prose
2497
+ let review = session "Review the pull request"
2498
+
2499
+ if **the code changes are safe and well-tested**:
2500
+ session "Approve and merge the PR"
2501
+ context: review
2502
+ else:
2503
+ session "Request changes"
2504
+ context: review
2505
+ ```
2506
+
2507
+ #### Multiple Elif
2508
+
2509
+ ```prose
2510
+ let status = session "Check project status"
2511
+
2512
+ if **the project is on track**:
2513
+ session "Continue as planned"
2514
+ elif **the project is slightly delayed**:
2515
+ session "Adjust timeline and communicate"
2516
+ elif **the project is significantly delayed**:
2517
+ session "Escalate to management"
2518
+ session "Create recovery plan"
2519
+ else:
2520
+ session "Assess project viability"
2521
+ ```
2522
+
2523
+ #### Nested Conditionals
2524
+
2525
+ ```prose
2526
+ if **the request is authenticated**:
2527
+ if **the user has admin privileges**:
2528
+ session "Process admin request"
2529
+ else:
2530
+ session "Process standard user request"
2531
+ else:
2532
+ session "Return authentication error"
2533
+ ```
2534
+
2535
+ ### Combining with Other Constructs
2536
+
2537
+ #### With Try/Catch
2538
+
2539
+ ```prose
2540
+ try:
2541
+ session "Attempt operation"
2542
+ if **operation succeeded partially**:
2543
+ session "Complete remaining steps"
2544
+ catch as err:
2545
+ if **error is recoverable**:
2546
+ session "Apply recovery procedure"
2547
+ context: err
2548
+ else:
2549
+ throw "Unrecoverable error"
2550
+ ```
2551
+
2552
+ #### With Loops
2553
+
2554
+ ```prose
2555
+ loop until **task complete** (max: 10):
2556
+ session "Work on task"
2557
+ if **encountered blocker**:
2558
+ session "Resolve blocker"
2559
+ ```
2560
+
2561
+ ### Execution Semantics
2562
+
2563
+ When the OpenProse VM encounters an `if` statement:
2564
+
2565
+ 1. **Evaluate Condition**: Interpret the first discretion condition
2566
+ 2. **If True**: Execute the then-body and skip remaining clauses
2567
+ 3. **If False**: Check each `elif` condition in order
2568
+ 4. **Elif Match**: Execute that elif's body and skip remaining
2569
+ 5. **No Match**: Execute the `else` body (if present)
2570
+ 6. **Continue**: Proceed to the next statement
2571
+
2572
+ ### Validation Rules
2573
+
2574
+ | Check | Severity | Message |
2575
+ | --------------- | -------- | --------------------------------- |
2576
+ | Empty condition | Error | If/elif condition cannot be empty |
2577
+ | Elif without if | Error | Elif must follow if |
2578
+ | Else without if | Error | Else must follow if or elif |
2579
+ | Multiple else | Error | Only one else clause allowed |
2580
+ | Empty body | Warning | Condition has empty body |
2581
+
2582
+ ### Syntax Reference
2583
+
2584
+ ```
2585
+ if_statement ::= "if" discretion ":" NEWLINE INDENT statement+ DEDENT
2586
+ elif_clause*
2587
+ [else_clause]
2588
+
2589
+ elif_clause ::= "elif" discretion ":" NEWLINE INDENT statement+ DEDENT
2590
+
2591
+ else_clause ::= "else" ":" NEWLINE INDENT statement+ DEDENT
2592
+
2593
+ discretion ::= "**" text "**" | "***" text "***"
2594
+ ```
2595
+
2596
+ ---
2597
+
2598
+ ## Execution Model
2599
+
2600
+ OpenProse uses a two-phase execution model.
2601
+
2602
+ ### Phase 1: Compilation (Static)
2603
+
2604
+ The compile phase handles deterministic preprocessing:
2605
+
2606
+ 1. **Parse**: Convert source code to AST
2607
+ 2. **Validate**: Check for syntax and semantic errors
2608
+ 3. **Expand**: Normalize syntax sugar (when implemented)
2609
+ 4. **Output**: Generate canonical program
2610
+
2611
+ ### Phase 2: Runtime (Intelligent)
2612
+
2613
+ The OpenProse VM executes the compiled program:
2614
+
2615
+ 1. **Load**: Receive the compiled program
2616
+ 2. **Collect Agents**: Register all agent definitions
2617
+ 3. **Execute**: Process each statement in order
2618
+ 4. **Spawn**: Create subagents with resolved configurations
2619
+ 5. **Coordinate**: Manage context passing between sessions
2620
+
2621
+ ### OpenProse VM Behavior
2622
+
2623
+ | Aspect | Behavior |
2624
+ | -------------------- | ----------------------------------------------- |
2625
+ | Execution order | Strict - follows program exactly |
2626
+ | Session creation | Strict - creates what program specifies |
2627
+ | Agent resolution | Strict - merge properties deterministically |
2628
+ | Context passing | Intelligent - summarizes/transforms as needed |
2629
+ | Completion detection | Intelligent - determines when session is "done" |
2630
+
2631
+ ### State Management
2632
+
2633
+ For the current implementation, state is tracked in-context (conversation history):
2634
+
2635
+ | State Type | Tracking Approach |
2636
+ | ------------------- | --------------------------------------------------- |
2637
+ | Agent definitions | Collected at program start |
2638
+ | Execution flow | Implicit reasoning ("completed X, now executing Y") |
2639
+ | Session outputs | Held in conversation history |
2640
+ | Position in program | Tracked by OpenProse VM |
2641
+
2642
+ ---
2643
+
2644
+ ## Validation Rules
2645
+
2646
+ The validator checks programs for errors and warnings before execution.
2647
+
2648
+ ### Errors (Block Execution)
2649
+
2650
+ | Code | Description |
2651
+ | ---- | ---------------------------------------- |
2652
+ | E001 | Unterminated string literal |
2653
+ | E002 | Unknown escape sequence in string |
2654
+ | E003 | Session missing prompt or agent |
2655
+ | E004 | Unexpected token |
2656
+ | E005 | Invalid syntax |
2657
+ | E006 | Duplicate agent definition |
2658
+ | E007 | Undefined agent reference |
2659
+ | E008 | Invalid model value |
2660
+ | E009 | Duplicate property |
2661
+ | E010 | Duplicate use statement |
2662
+ | E011 | Empty use path |
2663
+ | E012 | Invalid use path format |
2664
+ | E013 | Skills must be an array |
2665
+ | E014 | Skill name must be a string |
2666
+ | E015 | Permissions must be a block |
2667
+ | E016 | Permission pattern must be a string |
2668
+ | E017 | `resume:` requires persistent agent |
2669
+ | E018 | `resume:` with no existing memory |
2670
+ | E019 | Duplicate variable name (flat namespace) |
2671
+ | E020 | Empty input name |
2672
+ | E021 | Duplicate input declaration |
2673
+ | E022 | Input after executable statement |
2674
+ | E023 | Empty output name |
2675
+ | E024 | Duplicate output declaration |
2676
+ | E025 | Unknown program in invocation |
2677
+ | E026 | Missing required input |
2678
+ | E027 | Unknown input name in invocation |
2679
+ | E028 | Unknown output property access |
2680
+
2681
+ ### Warnings (Non-blocking)
2682
+
2683
+ | Code | Description |
2684
+ | ---- | --------------------------------------------------- |
2685
+ | W001 | Empty session prompt |
2686
+ | W002 | Whitespace-only session prompt |
2687
+ | W003 | Session prompt exceeds 10,000 characters |
2688
+ | W004 | Empty prompt property |
2689
+ | W005 | Unknown property name |
2690
+ | W006 | Unknown import source format |
2691
+ | W007 | Skill not imported |
2692
+ | W008 | Unknown permission type |
2693
+ | W009 | Unknown permission value |
2694
+ | W010 | Empty skills array |
2695
+ | W011 | `session:` on persistent agent with existing memory |
2696
+
2697
+ ### Error Message Format
2698
+
2699
+ Errors include location information:
2700
+
2701
+ ```
2702
+ Error at line 5, column 12: Unterminated string literal
2703
+ session "Hello
2704
+ ^
2705
+ ```
2706
+
2707
+ ---
2708
+
2709
+ ## Examples
2710
+
2711
+ ### Minimal Program
2712
+
2713
+ ```prose
2714
+ session "Hello world"
2715
+ ```
2716
+
2717
+ ### Research Pipeline with Agents
2718
+
2719
+ ```prose
2720
+ # Define specialized agents
2721
+ agent researcher:
2722
+ model: sonnet
2723
+ prompt: "You are a research assistant"
2724
+
2725
+ agent writer:
2726
+ model: opus
2727
+ prompt: "You are a technical writer"
2728
+
2729
+ # Execute workflow
2730
+ session: researcher
2731
+ prompt: "Research recent developments in quantum computing"
2732
+
2733
+ session: writer
2734
+ prompt: "Write a summary of the research findings"
2735
+ ```
2736
+
2737
+ ### Code Review Workflow
2738
+
2739
+ ```prose
2740
+ agent reviewer:
2741
+ model: sonnet
2742
+ prompt: "You are an expert code reviewer"
2743
+
2744
+ session: reviewer
2745
+ prompt: "Read the code in src/ and identify potential bugs"
2746
+
2747
+ session: reviewer
2748
+ prompt: "Suggest fixes for each bug found"
2749
+
2750
+ session: reviewer
2751
+ prompt: "Create a summary of all changes needed"
2752
+ ```
2753
+
2754
+ ### Multi-step Task with Model Override
2755
+
2756
+ ```prose
2757
+ agent analyst:
2758
+ model: haiku
2759
+ prompt: "You analyze data quickly"
2760
+
2761
+ # Quick initial analysis
2762
+ session: analyst
2763
+ prompt: "Scan the data for obvious patterns"
2764
+
2765
+ # Detailed analysis with more powerful model
2766
+ session: analyst
2767
+ model: opus
2768
+ prompt: "Perform deep analysis on the patterns found"
2769
+ ```
2770
+
2771
+ ### Comments for Documentation
2772
+
2773
+ ```prose
2774
+ # Project: Quarterly Report Generator
2775
+ # Author: Team Lead
2776
+ # Date: 2024-01-01
2777
+
2778
+ agent data-collector:
2779
+ model: sonnet
2780
+ prompt: "You gather and organize data"
2781
+
2782
+ agent analyst:
2783
+ model: opus
2784
+ prompt: "You analyze data and create insights"
2785
+
2786
+ # Step 1: Gather data
2787
+ session: data-collector
2788
+ prompt: "Collect all sales data from the past quarter"
2789
+
2790
+ # Step 2: Analysis
2791
+ session: analyst
2792
+ prompt: "Perform trend analysis on the collected data"
2793
+
2794
+ # Step 3: Report generation
2795
+ session: analyst
2796
+ prompt: "Generate a formatted quarterly report with charts"
2797
+ ```
2798
+
2799
+ ### Workflow with Skills and Permissions
2800
+
2801
+ ```prose
2802
+ # Import external programs
2803
+ use "@anthropic/web-search"
2804
+ use "@anthropic/file-writer" as file-writer
2805
+
2806
+ # Define a secure research agent
2807
+ agent researcher:
2808
+ model: sonnet
2809
+ prompt: "You are a research assistant"
2810
+ skills: ["web-search"]
2811
+ permissions:
2812
+ read: ["*.md", "*.txt"]
2813
+ bash: deny
2814
+
2815
+ # Define a writer agent
2816
+ agent writer:
2817
+ model: opus
2818
+ prompt: "You create documentation"
2819
+ skills: ["file-writer"]
2820
+ permissions:
2821
+ write: ["docs/"]
2822
+ bash: deny
2823
+
2824
+ # Execute workflow
2825
+ session: researcher
2826
+ prompt: "Research AI safety topics"
2827
+
2828
+ session: writer
2829
+ prompt: "Write a summary document"
2830
+ ```
2831
+
2832
+ ---
2833
+
2834
+ ## Future Features
2835
+
2836
+ All core features through Tier 12 have been implemented. Potential future enhancements:
2837
+
2838
+ ### Tier 13: Extended Features
2839
+
2840
+ - Custom functions with return values
2841
+ - Module system for code organization
2842
+ - Type annotations for validation
2843
+ - Async/await patterns for advanced concurrency
2844
+
2845
+ ### Tier 14: Tooling
2846
+
2847
+ - Language server protocol (LSP) support
2848
+ - VS Code extension
2849
+ - Interactive debugger
2850
+ - Performance profiling
2851
+
2852
+ ---
2853
+
2854
+ ## Syntax Grammar (Implemented)
2855
+
2856
+ ```
2857
+ program → statement* EOF
2858
+ statement → useStatement | inputDecl | agentDef | session | resumeStmt
2859
+ | letBinding | constBinding | assignment | outputBinding
2860
+ | parallelBlock | repeatBlock | forEachBlock | loopBlock
2861
+ | tryBlock | choiceBlock | ifStatement | doBlock | blockDef
2862
+ | throwStatement | comment
2863
+
2864
+ # Program Composition
2865
+ useStatement → "use" string ( "as" IDENTIFIER )?
2866
+ inputDecl → "input" IDENTIFIER ":" string
2867
+ outputBinding → "output" IDENTIFIER "=" expression
2868
+ programCall → IDENTIFIER "(" ( IDENTIFIER ":" expression )* ")"
2869
+
2870
+ # Definitions
2871
+ agentDef → "agent" IDENTIFIER ":" NEWLINE INDENT agentProperty* DEDENT
2872
+ agentProperty → "model:" ( "sonnet" | "opus" | "haiku" )
2873
+ | "prompt:" string
2874
+ | "persist:" ( "true" | "project" | string )
2875
+ | "context:" ( IDENTIFIER | array | objectContext )
2876
+ | "retry:" NUMBER
2877
+ | "backoff:" ( "none" | "linear" | "exponential" )
2878
+ | "skills:" "[" string* "]"
2879
+ | "permissions:" NEWLINE INDENT permission* DEDENT
2880
+ blockDef → "block" IDENTIFIER params? ":" NEWLINE INDENT statement* DEDENT
2881
+ params → "(" IDENTIFIER ( "," IDENTIFIER )* ")"
2882
+
2883
+ # Control Flow
2884
+ parallelBlock → "parallel" parallelMods? ":" NEWLINE INDENT parallelBranch* DEDENT
2885
+ parallelMods → "(" ( joinStrategy | onFail | countMod ) ( "," ( joinStrategy | onFail | countMod ) )* ")"
2886
+ joinStrategy → string # "all" | "first" | "any"
2887
+ onFail → "on-fail" ":" string # "fail-fast" | "continue" | "ignore"
2888
+ countMod → "count" ":" NUMBER # only valid with "any"
2889
+ parallelBranch → ( IDENTIFIER "=" )? statement
2890
+
2891
+ # Loops
2892
+ repeatBlock → "repeat" NUMBER ( "as" IDENTIFIER )? ":" NEWLINE INDENT statement* DEDENT
2893
+ forEachBlock → "parallel"? "for" IDENTIFIER ( "," IDENTIFIER )? "in" collection ":" NEWLINE INDENT statement* DEDENT
2894
+ loopBlock → "loop" ( ( "until" | "while" ) discretion )? loopMods? ( "as" IDENTIFIER )? ":" NEWLINE INDENT statement* DEDENT
2895
+ loopMods → "(" "max" ":" NUMBER ")"
2896
+
2897
+ # Error Handling
2898
+ tryBlock → "try" ":" NEWLINE INDENT statement+ DEDENT catchBlock? finallyBlock?
2899
+ catchBlock → "catch" ( "as" IDENTIFIER )? ":" NEWLINE INDENT statement+ DEDENT
2900
+ finallyBlock → "finally" ":" NEWLINE INDENT statement+ DEDENT
2901
+ throwStatement → "throw" string?
2902
+
2903
+ # Conditionals
2904
+ choiceBlock → "choice" discretion ":" NEWLINE INDENT choiceOption+ DEDENT
2905
+ choiceOption → "option" string ":" NEWLINE INDENT statement+ DEDENT
2906
+ ifStatement → "if" discretion ":" NEWLINE INDENT statement+ DEDENT elifClause* elseClause?
2907
+ elifClause → "elif" discretion ":" NEWLINE INDENT statement+ DEDENT
2908
+ elseClause → "else" ":" NEWLINE INDENT statement+ DEDENT
2909
+
2910
+ # Composition
2911
+ doBlock → "do" ( ":" NEWLINE INDENT statement* DEDENT | IDENTIFIER args? )
2912
+ args → "(" expression ( "," expression )* ")"
2913
+ arrowExpr → session ( "->" session )+
2914
+
2915
+ # Sessions
2916
+ session → "session" ( string | ":" IDENTIFIER | IDENTIFIER ":" IDENTIFIER )
2917
+ ( NEWLINE INDENT sessionProperty* DEDENT )?
2918
+ resumeStmt → "resume" ":" IDENTIFIER ( NEWLINE INDENT sessionProperty* DEDENT )?
2919
+ sessionProperty → "model:" ( "sonnet" | "opus" | "haiku" )
2920
+ | "prompt:" string
2921
+ | "context:" ( IDENTIFIER | array | objectContext )
2922
+ | "retry:" NUMBER
2923
+ | "backoff:" ( "none" | "linear" | "exponential" )
2924
+
2925
+ # Bindings
2926
+ letBinding → "let" IDENTIFIER "=" expression
2927
+ constBinding → "const" IDENTIFIER "=" expression
2928
+ assignment → IDENTIFIER "=" expression
2929
+
2930
+ # Expressions
2931
+ expression → session | doBlock | parallelBlock | repeatBlock | forEachBlock
2932
+ | loopBlock | arrowExpr | pipeExpr | programCall | string | IDENTIFIER | array | objectContext
2933
+
2934
+ # Pipelines
2935
+ pipeExpr → ( IDENTIFIER | array ) ( "|" pipeOp )+
2936
+ pipeOp → ( "map" | "filter" | "pmap" ) ":" NEWLINE INDENT statement* DEDENT
2937
+ | "reduce" "(" IDENTIFIER "," IDENTIFIER ")" ":" NEWLINE INDENT statement* DEDENT
2938
+
2939
+ # Properties
2940
+ property → ( "model" | "prompt" | "context" | "retry" | "backoff" | IDENTIFIER )
2941
+ ":" ( IDENTIFIER | string | array | objectContext | NUMBER )
2942
+
2943
+ # Primitives
2944
+ discretion → "**" text "**" | "***" text "***"
2945
+ collection → IDENTIFIER | array
2946
+ array → "[" ( expression ( "," expression )* )? "]"
2947
+ objectContext → "{" ( IDENTIFIER ( "," IDENTIFIER )* )? "}"
2948
+ comment → "#" text NEWLINE
2949
+
2950
+ # Strings
2951
+ string → singleString | tripleString | interpolatedString
2952
+ singleString → '"' character* '"'
2953
+ tripleString → '"""' ( character | NEWLINE )* '"""'
2954
+ interpolatedString → string containing "{" IDENTIFIER "}"
2955
+ character → escape | non-quote
2956
+ escape → "\\" | "\"" | "\n" | "\t"
2957
+ ```
2958
+
2959
+ ---
2960
+
2961
+ ## Compiler API
2962
+
2963
+ When a user invokes `/prose-compile` or asks you to compile a `.prose` file:
2964
+
2965
+ 1. **Read this document** (`compiler.md`) fully to understand all syntax and validation rules
2966
+ 2. **Parse** the program according to the syntax grammar
2967
+ 3. **Validate** syntax correctness, semantic validity, and self-evidence
2968
+ 4. **Transform** to canonical form (expand syntax sugar, normalize structure)
2969
+ 5. **Output** the compiled program or report errors/warnings with line numbers
2970
+
2971
+ For direct interpretation without compilation, read `prose.md` and execute statements as described in the Session Statement section.