loudmouth-ai 0.1.0

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