@hera-al/server 1.6.1

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 (348) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +325 -0
  3. package/bundled/apple-notes/SKILL.md +77 -0
  4. package/bundled/apple-reminders/SKILL.md +96 -0
  5. package/bundled/blogwatcher/SKILL.md +69 -0
  6. package/bundled/camsnap/SKILL.md +45 -0
  7. package/bundled/discord/SKILL.md +578 -0
  8. package/bundled/gemini/SKILL.md +43 -0
  9. package/bundled/gifgrep/SKILL.md +79 -0
  10. package/bundled/github/SKILL.md +77 -0
  11. package/bundled/gog/SKILL.md +116 -0
  12. package/bundled/goplaces/SKILL.md +52 -0
  13. package/bundled/himalaya/SKILL.md +257 -0
  14. package/bundled/himalaya/references/configuration.md +184 -0
  15. package/bundled/himalaya/references/message-composition.md +199 -0
  16. package/bundled/homebrew/SKILL.md +82 -0
  17. package/bundled/local-places/SERVER_README.md +101 -0
  18. package/bundled/local-places/SKILL.md +102 -0
  19. package/bundled/local-places/pyproject.toml +21 -0
  20. package/bundled/local-places/src/local_places/__init__.py +2 -0
  21. package/bundled/local-places/src/local_places/google_places.py +314 -0
  22. package/bundled/local-places/src/local_places/main.py +65 -0
  23. package/bundled/local-places/src/local_places/schemas.py +107 -0
  24. package/bundled/markitdown/SKILL.md +96 -0
  25. package/bundled/mcporter/SKILL.md +61 -0
  26. package/bundled/merge-pr/SKILL.md +187 -0
  27. package/bundled/merge-pr/agents/openai.yaml +4 -0
  28. package/bundled/nano-banana-pro/SKILL.md +58 -0
  29. package/bundled/nano-banana-pro/scripts/generate_image.py +184 -0
  30. package/bundled/nano-pdf/SKILL.md +38 -0
  31. package/bundled/open-prose/README.md +25 -0
  32. package/bundled/open-prose/index.ts +5 -0
  33. package/bundled/open-prose/openclaw.plugin.json +11 -0
  34. package/bundled/open-prose/package.json +15 -0
  35. package/bundled/open-prose/skills/prose/LICENSE +21 -0
  36. package/bundled/open-prose/skills/prose/SKILL.md +323 -0
  37. package/bundled/open-prose/skills/prose/alt-borges.md +141 -0
  38. package/bundled/open-prose/skills/prose/alts/arabian-nights.md +358 -0
  39. package/bundled/open-prose/skills/prose/alts/borges.md +360 -0
  40. package/bundled/open-prose/skills/prose/alts/folk.md +322 -0
  41. package/bundled/open-prose/skills/prose/alts/homer.md +346 -0
  42. package/bundled/open-prose/skills/prose/alts/kafka.md +373 -0
  43. package/bundled/open-prose/skills/prose/compiler.md +2971 -0
  44. package/bundled/open-prose/skills/prose/examples/01-hello-world.prose +4 -0
  45. package/bundled/open-prose/skills/prose/examples/02-research-and-summarize.prose +6 -0
  46. package/bundled/open-prose/skills/prose/examples/03-code-review.prose +17 -0
  47. package/bundled/open-prose/skills/prose/examples/04-write-and-refine.prose +14 -0
  48. package/bundled/open-prose/skills/prose/examples/05-debug-issue.prose +20 -0
  49. package/bundled/open-prose/skills/prose/examples/06-explain-codebase.prose +17 -0
  50. package/bundled/open-prose/skills/prose/examples/07-refactor.prose +20 -0
  51. package/bundled/open-prose/skills/prose/examples/08-blog-post.prose +20 -0
  52. package/bundled/open-prose/skills/prose/examples/09-research-with-agents.prose +25 -0
  53. package/bundled/open-prose/skills/prose/examples/10-code-review-agents.prose +32 -0
  54. package/bundled/open-prose/skills/prose/examples/11-skills-and-imports.prose +27 -0
  55. package/bundled/open-prose/skills/prose/examples/12-secure-agent-permissions.prose +43 -0
  56. package/bundled/open-prose/skills/prose/examples/13-variables-and-context.prose +51 -0
  57. package/bundled/open-prose/skills/prose/examples/14-composition-blocks.prose +48 -0
  58. package/bundled/open-prose/skills/prose/examples/15-inline-sequences.prose +23 -0
  59. package/bundled/open-prose/skills/prose/examples/16-parallel-reviews.prose +19 -0
  60. package/bundled/open-prose/skills/prose/examples/17-parallel-research.prose +19 -0
  61. package/bundled/open-prose/skills/prose/examples/18-mixed-parallel-sequential.prose +36 -0
  62. package/bundled/open-prose/skills/prose/examples/19-advanced-parallel.prose +71 -0
  63. package/bundled/open-prose/skills/prose/examples/20-fixed-loops.prose +20 -0
  64. package/bundled/open-prose/skills/prose/examples/21-pipeline-operations.prose +35 -0
  65. package/bundled/open-prose/skills/prose/examples/22-error-handling.prose +51 -0
  66. package/bundled/open-prose/skills/prose/examples/23-retry-with-backoff.prose +63 -0
  67. package/bundled/open-prose/skills/prose/examples/24-choice-blocks.prose +86 -0
  68. package/bundled/open-prose/skills/prose/examples/25-conditionals.prose +114 -0
  69. package/bundled/open-prose/skills/prose/examples/26-parameterized-blocks.prose +100 -0
  70. package/bundled/open-prose/skills/prose/examples/27-string-interpolation.prose +105 -0
  71. package/bundled/open-prose/skills/prose/examples/28-automated-pr-review.prose +37 -0
  72. package/bundled/open-prose/skills/prose/examples/28-gas-town.prose +1572 -0
  73. package/bundled/open-prose/skills/prose/examples/29-captains-chair.prose +218 -0
  74. package/bundled/open-prose/skills/prose/examples/30-captains-chair-simple.prose +42 -0
  75. package/bundled/open-prose/skills/prose/examples/31-captains-chair-with-memory.prose +145 -0
  76. package/bundled/open-prose/skills/prose/examples/33-pr-review-autofix.prose +168 -0
  77. package/bundled/open-prose/skills/prose/examples/34-content-pipeline.prose +204 -0
  78. package/bundled/open-prose/skills/prose/examples/35-feature-factory.prose +296 -0
  79. package/bundled/open-prose/skills/prose/examples/36-bug-hunter.prose +237 -0
  80. package/bundled/open-prose/skills/prose/examples/37-the-forge.prose +1474 -0
  81. package/bundled/open-prose/skills/prose/examples/38-skill-scan.prose +455 -0
  82. package/bundled/open-prose/skills/prose/examples/39-architect-by-simulation.prose +277 -0
  83. package/bundled/open-prose/skills/prose/examples/40-rlm-self-refine.prose +32 -0
  84. package/bundled/open-prose/skills/prose/examples/41-rlm-divide-conquer.prose +38 -0
  85. package/bundled/open-prose/skills/prose/examples/42-rlm-filter-recurse.prose +46 -0
  86. package/bundled/open-prose/skills/prose/examples/43-rlm-pairwise.prose +50 -0
  87. package/bundled/open-prose/skills/prose/examples/44-run-endpoint-ux-test.prose +261 -0
  88. package/bundled/open-prose/skills/prose/examples/45-plugin-release.prose +159 -0
  89. package/bundled/open-prose/skills/prose/examples/45-run-endpoint-ux-test-with-remediation.prose +637 -0
  90. package/bundled/open-prose/skills/prose/examples/46-run-endpoint-ux-test-fast.prose +148 -0
  91. package/bundled/open-prose/skills/prose/examples/46-workflow-crystallizer.prose +225 -0
  92. package/bundled/open-prose/skills/prose/examples/47-language-self-improvement.prose +356 -0
  93. package/bundled/open-prose/skills/prose/examples/48-habit-miner.prose +445 -0
  94. package/bundled/open-prose/skills/prose/examples/49-prose-run-retrospective.prose +210 -0
  95. package/bundled/open-prose/skills/prose/examples/README.md +391 -0
  96. package/bundled/open-prose/skills/prose/examples/roadmap/README.md +22 -0
  97. package/bundled/open-prose/skills/prose/examples/roadmap/iterative-refinement.prose +20 -0
  98. package/bundled/open-prose/skills/prose/examples/roadmap/parallel-review.prose +18 -0
  99. package/bundled/open-prose/skills/prose/examples/roadmap/simple-pipeline.prose +17 -0
  100. package/bundled/open-prose/skills/prose/examples/roadmap/syntax/open-prose-syntax.prose +223 -0
  101. package/bundled/open-prose/skills/prose/guidance/antipatterns.md +951 -0
  102. package/bundled/open-prose/skills/prose/guidance/patterns.md +700 -0
  103. package/bundled/open-prose/skills/prose/guidance/system-prompt.md +180 -0
  104. package/bundled/open-prose/skills/prose/help.md +144 -0
  105. package/bundled/open-prose/skills/prose/lib/README.md +108 -0
  106. package/bundled/open-prose/skills/prose/lib/calibrator.prose +215 -0
  107. package/bundled/open-prose/skills/prose/lib/cost-analyzer.prose +174 -0
  108. package/bundled/open-prose/skills/prose/lib/error-forensics.prose +250 -0
  109. package/bundled/open-prose/skills/prose/lib/inspector.prose +196 -0
  110. package/bundled/open-prose/skills/prose/lib/profiler.prose +460 -0
  111. package/bundled/open-prose/skills/prose/lib/program-improver.prose +275 -0
  112. package/bundled/open-prose/skills/prose/lib/project-memory.prose +118 -0
  113. package/bundled/open-prose/skills/prose/lib/user-memory.prose +93 -0
  114. package/bundled/open-prose/skills/prose/lib/vm-improver.prose +243 -0
  115. package/bundled/open-prose/skills/prose/primitives/session.md +593 -0
  116. package/bundled/open-prose/skills/prose/prose.md +1237 -0
  117. package/bundled/open-prose/skills/prose/state/filesystem.md +498 -0
  118. package/bundled/open-prose/skills/prose/state/in-context.md +384 -0
  119. package/bundled/open-prose/skills/prose/state/postgres.md +880 -0
  120. package/bundled/open-prose/skills/prose/state/sqlite.md +574 -0
  121. package/bundled/peekaboo/SKILL.md +190 -0
  122. package/bundled/prepare-pr/SKILL.md +277 -0
  123. package/bundled/prepare-pr/agents/openai.yaml +4 -0
  124. package/bundled/review-pr/SKILL.md +228 -0
  125. package/bundled/review-pr/agents/openai.yaml +4 -0
  126. package/bundled/sag/SKILL.md +87 -0
  127. package/bundled/skill-creator/SKILL.md +370 -0
  128. package/bundled/skill-creator/license.txt +202 -0
  129. package/bundled/skill-creator/scripts/init_skill.py +378 -0
  130. package/bundled/skill-creator/scripts/package_skill.py +111 -0
  131. package/bundled/skill-creator/scripts/quick_validate.py +101 -0
  132. package/bundled/spotify-player/SKILL.md +64 -0
  133. package/bundled/ssh/SKILL.md +119 -0
  134. package/bundled/summarize/SKILL.md +87 -0
  135. package/bundled/video-frames/SKILL.md +46 -0
  136. package/bundled/video-frames/scripts/frame.sh +81 -0
  137. package/bundled/voice-call/SKILL.md +45 -0
  138. package/bundled/wacli/SKILL.md +72 -0
  139. package/bundled/weather/SKILL.md +54 -0
  140. package/dist/agent/agent-service.d.ts +88 -0
  141. package/dist/agent/agent-service.js +1 -0
  142. package/dist/agent/message-queue.d.ts +24 -0
  143. package/dist/agent/message-queue.js +1 -0
  144. package/dist/agent/prompt-builder.d.ts +58 -0
  145. package/dist/agent/prompt-builder.js +1 -0
  146. package/dist/agent/session-agent.d.ts +197 -0
  147. package/dist/agent/session-agent.js +1 -0
  148. package/dist/agent/session-db.d.ts +26 -0
  149. package/dist/agent/session-db.js +1 -0
  150. package/dist/agent/session-error-handler.d.ts +37 -0
  151. package/dist/agent/session-error-handler.js +1 -0
  152. package/dist/agent/session-manager.d.ts +19 -0
  153. package/dist/agent/session-manager.js +1 -0
  154. package/dist/agent/workspace-files.d.ts +51 -0
  155. package/dist/agent/workspace-files.js +1 -0
  156. package/dist/auth/auth-middleware.d.ts +9 -0
  157. package/dist/auth/auth-middleware.js +1 -0
  158. package/dist/auth/node-signature-db.d.ts +30 -0
  159. package/dist/auth/node-signature-db.js +1 -0
  160. package/dist/auth/token-db.d.ts +38 -0
  161. package/dist/auth/token-db.js +1 -0
  162. package/dist/browser/browser-service.d.ts +9 -0
  163. package/dist/browser/browser-service.js +1 -0
  164. package/dist/channels/channel.d.ts +2 -0
  165. package/dist/channels/channel.js +1 -0
  166. package/dist/channels/responses.d.ts +21 -0
  167. package/dist/channels/responses.js +1 -0
  168. package/dist/commands/clear.d.ts +7 -0
  169. package/dist/commands/clear.js +1 -0
  170. package/dist/commands/cmd.d.ts +7 -0
  171. package/dist/commands/cmd.js +1 -0
  172. package/dist/commands/coder.d.ts +12 -0
  173. package/dist/commands/coder.js +1 -0
  174. package/dist/commands/command-registry.d.ts +12 -0
  175. package/dist/commands/command-registry.js +1 -0
  176. package/dist/commands/command.d.ts +22 -0
  177. package/dist/commands/command.js +1 -0
  178. package/dist/commands/compact.d.ts +7 -0
  179. package/dist/commands/compact.js +1 -0
  180. package/dist/commands/customsubagents.d.ts +15 -0
  181. package/dist/commands/customsubagents.js +1 -0
  182. package/dist/commands/help.d.ts +9 -0
  183. package/dist/commands/help.js +1 -0
  184. package/dist/commands/mcp.d.ts +9 -0
  185. package/dist/commands/mcp.js +1 -0
  186. package/dist/commands/model.d.ts +22 -0
  187. package/dist/commands/model.js +1 -0
  188. package/dist/commands/models.d.ts +11 -0
  189. package/dist/commands/models.js +1 -0
  190. package/dist/commands/new.d.ts +7 -0
  191. package/dist/commands/new.js +1 -0
  192. package/dist/commands/plugin.d.ts +7 -0
  193. package/dist/commands/plugin.js +1 -0
  194. package/dist/commands/sandbox.d.ts +12 -0
  195. package/dist/commands/sandbox.js +1 -0
  196. package/dist/commands/showtool.d.ts +12 -0
  197. package/dist/commands/showtool.js +1 -0
  198. package/dist/commands/status.d.ts +24 -0
  199. package/dist/commands/status.js +1 -0
  200. package/dist/commands/stop.d.ts +10 -0
  201. package/dist/commands/stop.js +1 -0
  202. package/dist/commands/subagents.d.ts +12 -0
  203. package/dist/commands/subagents.js +1 -0
  204. package/dist/commands/usage.d.ts +25 -0
  205. package/dist/commands/usage.js +1 -0
  206. package/dist/commands/useplugin.d.ts +7 -0
  207. package/dist/commands/useplugin.js +1 -0
  208. package/dist/config-watcher.d.ts +14 -0
  209. package/dist/config-watcher.js +1 -0
  210. package/dist/config.d.ts +267 -0
  211. package/dist/config.js +1 -0
  212. package/dist/cron/cron-service.d.ts +57 -0
  213. package/dist/cron/cron-service.js +1 -0
  214. package/dist/cron/heartbeat-token.d.ts +29 -0
  215. package/dist/cron/heartbeat-token.js +1 -0
  216. package/dist/cron/schedule.d.ts +3 -0
  217. package/dist/cron/schedule.js +1 -0
  218. package/dist/cron/store.d.ts +4 -0
  219. package/dist/cron/store.js +1 -0
  220. package/dist/cron/types.d.ts +47 -0
  221. package/dist/cron/types.js +1 -0
  222. package/dist/gateway/bridge.d.ts +38 -0
  223. package/dist/gateway/bridge.js +1 -0
  224. package/dist/gateway/channel-manager.d.ts +45 -0
  225. package/dist/gateway/channel-manager.js +1 -0
  226. package/dist/gateway/channels/qr-image.d.ts +5 -0
  227. package/dist/gateway/channels/qr-image.js +1 -0
  228. package/dist/gateway/channels/telegram.d.ts +39 -0
  229. package/dist/gateway/channels/telegram.js +1 -0
  230. package/dist/gateway/channels/webchat.d.ts +51 -0
  231. package/dist/gateway/channels/webchat.js +1 -0
  232. package/dist/gateway/channels/whatsapp.d.ts +40 -0
  233. package/dist/gateway/channels/whatsapp.js +1 -0
  234. package/dist/gateway/node-registry.d.ts +38 -0
  235. package/dist/gateway/node-registry.js +1 -0
  236. package/dist/heracli/index.d.ts +3 -0
  237. package/dist/heracli/index.js +2 -0
  238. package/dist/heracli/logs.d.ts +13 -0
  239. package/dist/heracli/logs.js +1 -0
  240. package/dist/heracli/security/audit.d.ts +17 -0
  241. package/dist/heracli/security/audit.js +1 -0
  242. package/dist/heracli/security/checks/channel-policies.d.ts +6 -0
  243. package/dist/heracli/security/checks/channel-policies.js +1 -0
  244. package/dist/heracli/security/checks/credentials.d.ts +6 -0
  245. package/dist/heracli/security/checks/credentials.js +1 -0
  246. package/dist/heracli/security/checks/fs-permissions.d.ts +6 -0
  247. package/dist/heracli/security/checks/fs-permissions.js +1 -0
  248. package/dist/heracli/security/checks/network.d.ts +4 -0
  249. package/dist/heracli/security/checks/network.js +1 -0
  250. package/dist/heracli/security/report.d.ts +4 -0
  251. package/dist/heracli/security/report.js +1 -0
  252. package/dist/index.d.ts +3 -0
  253. package/dist/index.js +2 -0
  254. package/dist/installer/hera.d.ts +3 -0
  255. package/dist/installer/hera.js +2 -0
  256. package/dist/media/message-processor.d.ts +23 -0
  257. package/dist/media/message-processor.js +1 -0
  258. package/dist/memory/memory-manager.d.ts +21 -0
  259. package/dist/memory/memory-manager.js +1 -0
  260. package/dist/memory/memory-provider.d.ts +22 -0
  261. package/dist/memory/memory-provider.js +1 -0
  262. package/dist/memory/memory-search.d.ts +102 -0
  263. package/dist/memory/memory-search.js +1 -0
  264. package/dist/memory/recall-strategies.d.ts +2 -0
  265. package/dist/memory/recall-strategies.js +1 -0
  266. package/dist/nostromo/auth.d.ts +29 -0
  267. package/dist/nostromo/auth.js +1 -0
  268. package/dist/nostromo/nostromo.d.ts +23 -0
  269. package/dist/nostromo/nostromo.js +1 -0
  270. package/dist/nostromo/ui-html-layout.d.ts +3 -0
  271. package/dist/nostromo/ui-html-layout.js +1 -0
  272. package/dist/nostromo/ui-html-modals.d.ts +3 -0
  273. package/dist/nostromo/ui-html-modals.js +1 -0
  274. package/dist/nostromo/ui-js-agent.d.ts +3 -0
  275. package/dist/nostromo/ui-js-agent.js +1 -0
  276. package/dist/nostromo/ui-js-channels.d.ts +3 -0
  277. package/dist/nostromo/ui-js-channels.js +1 -0
  278. package/dist/nostromo/ui-js-competences.d.ts +3 -0
  279. package/dist/nostromo/ui-js-competences.js +1 -0
  280. package/dist/nostromo/ui-js-config.d.ts +3 -0
  281. package/dist/nostromo/ui-js-config.js +1 -0
  282. package/dist/nostromo/ui-js-core.d.ts +3 -0
  283. package/dist/nostromo/ui-js-core.js +1 -0
  284. package/dist/nostromo/ui-js-ops.d.ts +3 -0
  285. package/dist/nostromo/ui-js-ops.js +1 -0
  286. package/dist/nostromo/ui-js-prompts.d.ts +3 -0
  287. package/dist/nostromo/ui-js-prompts.js +1 -0
  288. package/dist/nostromo/ui-styles.d.ts +3 -0
  289. package/dist/nostromo/ui-styles.js +1 -0
  290. package/dist/nostromo/ui.d.ts +2 -0
  291. package/dist/nostromo/ui.js +1 -0
  292. package/dist/server.d.ts +80 -0
  293. package/dist/server.js +1 -0
  294. package/dist/stt/local-whisper.d.ts +9 -0
  295. package/dist/stt/local-whisper.js +1 -0
  296. package/dist/stt/openai-whisper.d.ts +14 -0
  297. package/dist/stt/openai-whisper.js +1 -0
  298. package/dist/stt/stt-loader.d.ts +4 -0
  299. package/dist/stt/stt-loader.js +1 -0
  300. package/dist/stt/stt-provider.d.ts +4 -0
  301. package/dist/stt/stt-provider.js +1 -0
  302. package/dist/tools/browser-tools.d.ts +9 -0
  303. package/dist/tools/browser-tools.js +1 -0
  304. package/dist/tools/cron-tools.d.ts +4 -0
  305. package/dist/tools/cron-tools.js +1 -0
  306. package/dist/tools/memory-tools.d.ts +3 -0
  307. package/dist/tools/memory-tools.js +1 -0
  308. package/dist/tools/message-tools.d.ts +5 -0
  309. package/dist/tools/message-tools.js +1 -0
  310. package/dist/tools/node-tools.d.ts +3 -0
  311. package/dist/tools/node-tools.js +1 -0
  312. package/dist/tools/server-tools.d.ts +2 -0
  313. package/dist/tools/server-tools.js +1 -0
  314. package/dist/tools/tts-tools.d.ts +3 -0
  315. package/dist/tools/tts-tools.js +1 -0
  316. package/dist/tts/tts-service.d.ts +19 -0
  317. package/dist/tts/tts-service.js +1 -0
  318. package/dist/utils/chunk.d.ts +3 -0
  319. package/dist/utils/chunk.js +1 -0
  320. package/dist/utils/logger.d.ts +16 -0
  321. package/dist/utils/logger.js +1 -0
  322. package/dist/utils/markdown/fences.d.ts +11 -0
  323. package/dist/utils/markdown/fences.js +1 -0
  324. package/dist/utils/markdown/ir.d.ts +33 -0
  325. package/dist/utils/markdown/ir.js +1 -0
  326. package/dist/utils/markdown/render.d.ts +19 -0
  327. package/dist/utils/markdown/render.js +1 -0
  328. package/dist/utils/markdown/tables.d.ts +3 -0
  329. package/dist/utils/markdown/tables.js +1 -0
  330. package/dist/utils/media-response.d.ts +29 -0
  331. package/dist/utils/media-response.js +1 -0
  332. package/dist/utils/package-paths.d.ts +5 -0
  333. package/dist/utils/package-paths.js +1 -0
  334. package/dist/utils/telegram-format.d.ts +13 -0
  335. package/dist/utils/telegram-format.js +1 -0
  336. package/installationPkg/.env.example +26 -0
  337. package/installationPkg/AGENTS.md +143 -0
  338. package/installationPkg/BOOTSTRAP.md +45 -0
  339. package/installationPkg/CBINT.json +16 -0
  340. package/installationPkg/HEARTBEAT.md +5 -0
  341. package/installationPkg/IDENTITY.md +7 -0
  342. package/installationPkg/SOUL.md +36 -0
  343. package/installationPkg/SYSTEM_PROMPT.md +55 -0
  344. package/installationPkg/SYSTEM_PROMPT_SUBAGENT.md +40 -0
  345. package/installationPkg/TOOLS.md +36 -0
  346. package/installationPkg/USER.md +11 -0
  347. package/installationPkg/config.example.yaml +291 -0
  348. package/package.json +95 -0
@@ -0,0 +1,63 @@
1
+ # Retry with Backoff Example
2
+ # Demonstrates automatic retry patterns for resilient API calls
3
+
4
+ # Simple retry - try up to 3 times on failure
5
+ session "Call flaky third-party API"
6
+ retry: 3
7
+
8
+ # Retry with exponential backoff for rate-limited APIs
9
+ session "Query rate-limited service"
10
+ retry: 5
11
+ backoff: "exponential"
12
+
13
+ # Retry with linear backoff
14
+ session "Send webhook notification"
15
+ retry: 3
16
+ backoff: "linear"
17
+
18
+ # Combining retry with context passing
19
+ let config = session "Load API configuration"
20
+
21
+ session "Make authenticated API request"
22
+ context: config
23
+ retry: 3
24
+ backoff: "exponential"
25
+
26
+ # Retry inside try/catch for fallback after all retries fail
27
+ try:
28
+ session "Call primary payment processor"
29
+ retry: 3
30
+ backoff: "exponential"
31
+ catch:
32
+ session "All retries failed - use backup payment processor"
33
+ retry: 2
34
+
35
+ # Parallel retries for redundant services
36
+ parallel:
37
+ primary = try:
38
+ session "Query primary database"
39
+ retry: 2
40
+ backoff: "linear"
41
+ catch:
42
+ session "Primary DB unavailable"
43
+ replica = try:
44
+ session "Query replica database"
45
+ retry: 2
46
+ backoff: "linear"
47
+ catch:
48
+ session "Replica DB unavailable"
49
+
50
+ session "Merge results from available databases"
51
+ context: { primary, replica }
52
+
53
+ # Retry in a loop for batch processing
54
+ let items = ["batch1", "batch2", "batch3"]
55
+ for item in items:
56
+ try:
57
+ session "Process this batch item"
58
+ context: item
59
+ retry: 2
60
+ backoff: "exponential"
61
+ catch:
62
+ session "Log failed batch for manual review"
63
+ context: item
@@ -0,0 +1,86 @@
1
+ # Choice Blocks Example
2
+ # Demonstrates AI-selected branching based on runtime criteria
3
+
4
+ # Simple choice based on analysis
5
+ let analysis = session "Analyze the current codebase quality"
6
+
7
+ choice **the severity of issues found**:
8
+ option "Critical":
9
+ session "Stop all work and fix critical issues immediately"
10
+ context: analysis
11
+ session "Create incident report"
12
+ option "Moderate":
13
+ session "Schedule fixes for next sprint"
14
+ context: analysis
15
+ option "Minor":
16
+ session "Add to technical debt backlog"
17
+ context: analysis
18
+
19
+ # Choice for user experience level
20
+ choice **the user's technical expertise based on their question**:
21
+ option "Beginner":
22
+ session "Explain concepts from first principles"
23
+ session "Provide step-by-step tutorial"
24
+ session "Include helpful analogies"
25
+ option "Intermediate":
26
+ session "Give concise explanation with examples"
27
+ session "Link to relevant documentation"
28
+ option "Expert":
29
+ session "Provide technical deep-dive"
30
+ session "Include advanced configuration options"
31
+
32
+ # Choice for project approach
33
+ let requirements = session "Gather project requirements"
34
+
35
+ choice **the best development approach given the requirements**:
36
+ option "Rapid prototype":
37
+ session "Create quick MVP focusing on core features"
38
+ context: requirements
39
+ session "Plan iteration cycle"
40
+ option "Production-ready":
41
+ session "Design complete architecture"
42
+ context: requirements
43
+ session "Set up CI/CD pipeline"
44
+ session "Implement with full test coverage"
45
+ option "Research spike":
46
+ session "Explore technical feasibility"
47
+ context: requirements
48
+ session "Document findings and recommendations"
49
+
50
+ # Multi-line criteria for complex decisions
51
+ let market_data = session "Gather market research data"
52
+ let tech_analysis = session "Analyze technical landscape"
53
+
54
+ choice ***
55
+ the optimal market entry strategy
56
+ considering both market conditions
57
+ and technical readiness
58
+ ***:
59
+ option "Aggressive launch":
60
+ session "Prepare for immediate market entry"
61
+ context: [market_data, tech_analysis]
62
+ option "Soft launch":
63
+ session "Plan limited beta release"
64
+ context: [market_data, tech_analysis]
65
+ option "Wait and iterate":
66
+ session "Continue development and monitor market"
67
+ context: [market_data, tech_analysis]
68
+
69
+ # Nested choices for detailed decision trees
70
+ let request = session "Analyze incoming customer request"
71
+
72
+ choice **the type of request**:
73
+ option "Technical support":
74
+ choice **the complexity of the technical issue**:
75
+ option "Simple":
76
+ session "Provide self-service solution"
77
+ context: request
78
+ option "Complex":
79
+ session "Escalate to senior engineer"
80
+ context: request
81
+ option "Sales inquiry":
82
+ session "Forward to sales team with context"
83
+ context: request
84
+ option "Feature request":
85
+ session "Add to product backlog and notify PM"
86
+ context: request
@@ -0,0 +1,114 @@
1
+ # Conditionals Example
2
+ # Demonstrates if/elif/else patterns with AI-evaluated conditions
3
+
4
+ # Simple if statement
5
+ let health_check = session "Check system health status"
6
+
7
+ if **the system is unhealthy**:
8
+ session "Alert on-call engineer"
9
+ context: health_check
10
+ session "Begin incident response"
11
+
12
+ # If/else for binary decisions
13
+ let review = session "Review the pull request changes"
14
+
15
+ if **the code changes are safe and well-tested**:
16
+ session "Approve and merge the pull request"
17
+ context: review
18
+ else:
19
+ session "Request changes with detailed feedback"
20
+ context: review
21
+
22
+ # If/elif/else for multiple conditions
23
+ let status = session "Check project milestone status"
24
+
25
+ if **the project is ahead of schedule**:
26
+ session "Document success factors"
27
+ session "Consider adding stretch goals"
28
+ elif **the project is on track**:
29
+ session "Continue with current plan"
30
+ session "Prepare status report"
31
+ elif **the project is slightly delayed**:
32
+ session "Identify bottlenecks"
33
+ session "Adjust timeline and communicate to stakeholders"
34
+ else:
35
+ session "Escalate to management"
36
+ session "Create recovery plan"
37
+ session "Schedule daily standups"
38
+
39
+ # Multi-line conditions
40
+ let test_results = session "Run full test suite"
41
+
42
+ if ***
43
+ all tests pass
44
+ and code coverage is above 80%
45
+ and there are no linting errors
46
+ ***:
47
+ session "Deploy to production"
48
+ else:
49
+ session "Fix issues before deploying"
50
+ context: test_results
51
+
52
+ # Nested conditionals
53
+ let request = session "Analyze the API request"
54
+
55
+ if **the request is authenticated**:
56
+ if **the user has admin privileges**:
57
+ session "Process admin request with full access"
58
+ context: request
59
+ else:
60
+ session "Process standard user request"
61
+ context: request
62
+ else:
63
+ session "Return 401 authentication error"
64
+
65
+ # Conditionals with error handling
66
+ let operation_result = session "Attempt complex operation"
67
+
68
+ if **the operation succeeded partially**:
69
+ session "Complete remaining steps"
70
+ context: operation_result
71
+
72
+ try:
73
+ session "Perform another risky operation"
74
+ catch as err:
75
+ if **the error is recoverable**:
76
+ session "Apply automatic recovery procedure"
77
+ context: err
78
+ else:
79
+ throw "Unrecoverable error encountered"
80
+
81
+ # Conditionals inside loops
82
+ let items = ["item1", "item2", "item3"]
83
+
84
+ for item in items:
85
+ session "Analyze this item"
86
+ context: item
87
+
88
+ if **the item needs processing**:
89
+ session "Process the item"
90
+ context: item
91
+ elif **the item should be skipped**:
92
+ session "Log skip reason"
93
+ context: item
94
+ else:
95
+ session "Archive the item"
96
+ context: item
97
+
98
+ # Conditionals with parallel blocks
99
+ parallel:
100
+ security = session "Run security scan"
101
+ performance = session "Run performance tests"
102
+ style = session "Run style checks"
103
+
104
+ if **security issues were found**:
105
+ session "Fix security issues immediately"
106
+ context: security
107
+ elif **performance issues were found**:
108
+ session "Optimize performance bottlenecks"
109
+ context: performance
110
+ elif **style issues were found**:
111
+ session "Clean up code style"
112
+ context: style
113
+ else:
114
+ session "All checks passed - ready for review"
@@ -0,0 +1,100 @@
1
+ # Parameterized Blocks Example
2
+ # Demonstrates reusable blocks with arguments for DRY workflows
3
+
4
+ # Simple parameterized block
5
+ block research(topic):
6
+ session "Research {topic} thoroughly"
7
+ session "Summarize key findings about {topic}"
8
+ session "List open questions about {topic}"
9
+
10
+ # Invoke with different arguments
11
+ do research("quantum computing")
12
+ do research("machine learning")
13
+ do research("blockchain technology")
14
+
15
+ # Block with multiple parameters
16
+ block review_code(language, focus_area):
17
+ session "Review the {language} code for {focus_area} issues"
18
+ session "Suggest {focus_area} improvements for {language}"
19
+ session "Provide {language} best practices for {focus_area}"
20
+
21
+ do review_code("Python", "performance")
22
+ do review_code("TypeScript", "type safety")
23
+ do review_code("Rust", "memory safety")
24
+
25
+ # Parameterized block for data processing
26
+ block process_dataset(source, format):
27
+ session "Load data from {source}"
28
+ session "Validate {format} structure"
29
+ session "Transform to standard format"
30
+ session "Generate quality report for {source} data"
31
+
32
+ do process_dataset("sales_db", "CSV")
33
+ do process_dataset("api_logs", "JSON")
34
+ do process_dataset("user_events", "Parquet")
35
+
36
+ # Blocks with parameters used in control flow
37
+ block test_feature(feature_name, test_level):
38
+ session "Write {test_level} tests for {feature_name}"
39
+
40
+ if **the tests reveal issues**:
41
+ session "Fix issues in {feature_name}"
42
+ session "Re-run {test_level} tests for {feature_name}"
43
+ else:
44
+ session "Mark {feature_name} {test_level} testing complete"
45
+
46
+ do test_feature("authentication", "unit")
47
+ do test_feature("payment processing", "integration")
48
+ do test_feature("user dashboard", "e2e")
49
+
50
+ # Parameterized blocks in parallel
51
+ block analyze_competitor(company):
52
+ session "Research {company} products"
53
+ session "Analyze {company} market position"
54
+ session "Identify {company} strengths and weaknesses"
55
+
56
+ parallel:
57
+ a = do analyze_competitor("Company A")
58
+ b = do analyze_competitor("Company B")
59
+ c = do analyze_competitor("Company C")
60
+
61
+ session "Create competitive analysis report"
62
+ context: { a, b, c }
63
+
64
+ # Block with error handling
65
+ block safe_api_call(endpoint, method):
66
+ try:
67
+ session "Call {endpoint} with {method} request"
68
+ retry: 3
69
+ backoff: "exponential"
70
+ catch as err:
71
+ session "Log failed {method} call to {endpoint}"
72
+ context: err
73
+ session "Return fallback response for {endpoint}"
74
+
75
+ do safe_api_call("/users", "GET")
76
+ do safe_api_call("/orders", "POST")
77
+ do safe_api_call("/inventory", "PUT")
78
+
79
+ # Nested block invocations
80
+ block full_review(component):
81
+ do review_code("TypeScript", "security")
82
+ do test_feature(component, "unit")
83
+ session "Generate documentation for {component}"
84
+
85
+ do full_review("UserService")
86
+ do full_review("PaymentGateway")
87
+
88
+ # Block with loop inside
89
+ block process_batch(batch_name, items):
90
+ session "Start processing {batch_name}"
91
+ for item in items:
92
+ session "Process item from {batch_name}"
93
+ context: item
94
+ session "Complete {batch_name} processing"
95
+
96
+ let batch1 = ["a", "b", "c"]
97
+ let batch2 = ["x", "y", "z"]
98
+
99
+ do process_batch("alpha", batch1)
100
+ do process_batch("beta", batch2)
@@ -0,0 +1,105 @@
1
+ # String Interpolation Example
2
+ # Demonstrates dynamic prompt construction with {variable} syntax
3
+
4
+ # Basic interpolation
5
+ let user_name = session "Get the user's name"
6
+ let topic = session "Ask what topic they want to learn about"
7
+
8
+ session "Create a personalized greeting for {user_name} about {topic}"
9
+
10
+ # Multiple interpolations in one prompt
11
+ let company = session "Get the company name"
12
+ let industry = session "Identify the company's industry"
13
+ let size = session "Determine company size (startup/mid/enterprise)"
14
+
15
+ session "Write a customized proposal for {company}, a {size} company in {industry}"
16
+
17
+ # Interpolation with context
18
+ let research = session "Research the topic thoroughly"
19
+
20
+ session "Based on the research, explain {topic} to {user_name}"
21
+ context: research
22
+
23
+ # Multi-line strings with interpolation
24
+ let project = session "Get the project name"
25
+ let deadline = session "Get the project deadline"
26
+ let team_size = session "Get the team size"
27
+
28
+ session """
29
+ Create a project plan for {project}.
30
+
31
+ Key constraints:
32
+ - Deadline: {deadline}
33
+ - Team size: {team_size}
34
+
35
+ Include milestones and resource allocation.
36
+ """
37
+
38
+ # Interpolation in loops
39
+ let languages = ["Python", "JavaScript", "Go"]
40
+
41
+ for lang in languages:
42
+ session "Write a hello world program in {lang}"
43
+ session "Explain the syntax of {lang}"
44
+
45
+ # Interpolation in parallel blocks
46
+ let regions = ["North America", "Europe", "Asia Pacific"]
47
+
48
+ parallel for region in regions:
49
+ session "Analyze market conditions in {region}"
50
+ session "Identify top competitors in {region}"
51
+
52
+ # Interpolation with computed values
53
+ let base_topic = session "Get the main topic"
54
+ let analysis = session "Analyze {base_topic} from multiple angles"
55
+
56
+ let subtopics = ["history", "current state", "future trends"]
57
+ for subtopic in subtopics:
58
+ session "Explore the {subtopic} of {base_topic}"
59
+ context: analysis
60
+
61
+ # Building dynamic workflows
62
+ let workflow_type = session "What type of document should we create?"
63
+ let audience = session "Who is the target audience?"
64
+ let length = session "How long should the document be?"
65
+
66
+ session """
67
+ Create a {workflow_type} for {audience}.
68
+
69
+ Requirements:
70
+ - Length: approximately {length}
71
+ - Tone: appropriate for {audience}
72
+ - Focus: practical and actionable
73
+
74
+ Please structure with clear sections.
75
+ """
76
+
77
+ # Interpolation in error messages
78
+ let operation = session "Get the operation name"
79
+ let target = session "Get the target resource"
80
+
81
+ try:
82
+ session "Perform {operation} on {target}"
83
+ catch:
84
+ session "Failed to {operation} on {target} - attempting recovery"
85
+ throw "Operation {operation} failed for {target}"
86
+
87
+ # Combining interpolation with choice blocks
88
+ let task_type = session "Identify the type of task"
89
+ let priority = session "Determine task priority"
90
+
91
+ choice **the best approach for a {priority} priority {task_type}**:
92
+ option "Immediate action":
93
+ session "Execute {task_type} immediately with {priority} priority handling"
94
+ option "Scheduled action":
95
+ session "Schedule {task_type} based on {priority} priority queue"
96
+ option "Delegate":
97
+ session "Assign {task_type} to appropriate team member"
98
+
99
+ # Interpolation with agent definitions
100
+ agent custom_agent:
101
+ model: sonnet
102
+ prompt: "You specialize in helping with {topic}"
103
+
104
+ session: custom_agent
105
+ prompt: "Provide expert guidance on {topic} for {user_name}"
@@ -0,0 +1,37 @@
1
+ # Automated PR Review Workflow
2
+ # This workflow performs a multi-dimensional review of a codebase changes.
3
+
4
+ agent reviewer:
5
+ model: sonnet
6
+ prompt: "You are an expert software engineer specializing in code reviews."
7
+
8
+ agent security_expert:
9
+ model: opus
10
+ prompt: "You are a security researcher specializing in finding vulnerabilities."
11
+
12
+ agent performance_expert:
13
+ model: sonnet
14
+ prompt: "You are a performance engineer specializing in optimization."
15
+
16
+ # 1. Initial overview
17
+ let overview = session: reviewer
18
+ prompt: "Read the changes in the current directory and provide a high-level summary of the architectural impact."
19
+
20
+ # 2. Parallel deep-dive reviews
21
+ parallel:
22
+ security = session: security_expert
23
+ prompt: "Perform a deep security audit of the changes. Look for OWASP top 10 issues."
24
+ context: overview
25
+
26
+ perf = session: performance_expert
27
+ prompt: "Analyze the performance implications. Identify potential bottlenecks or regressions."
28
+ context: overview
29
+
30
+ style = session: reviewer
31
+ prompt: "Review for code style, maintainability, and adherence to best practices."
32
+ context: overview
33
+
34
+ # 3. Synthesis and final recommendation
35
+ session: reviewer
36
+ prompt: "Synthesize the security, performance, and style reviews into a final PR comment. Provide a clear 'Approve', 'Request Changes', or 'Comment' recommendation."
37
+ context: { security, perf, style, overview }