enya-agent 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 (389) hide show
  1. package/.env.example +20 -0
  2. package/.github/workflows/ci.yml +70 -0
  3. package/.github/workflows/publish.yml +250 -0
  4. package/.gitmodules +3 -0
  5. package/Cargo.lock +3584 -0
  6. package/Cargo.toml +97 -0
  7. package/crates/enact/Cargo.toml +27 -0
  8. package/crates/enact/src/lib.rs +60 -0
  9. package/crates/enact-a2a/Cargo.toml +25 -0
  10. package/crates/enact-a2a/src/lib.rs +411 -0
  11. package/crates/enact-channels/Cargo.toml +64 -0
  12. package/crates/enact-channels/examples/README.md +80 -0
  13. package/crates/enact-channels/examples/channel_bot.rs +169 -0
  14. package/crates/enact-channels/examples/telegram-echo.rs +34 -0
  15. package/crates/enact-channels/examples/whatsapp-echo.rs +142 -0
  16. package/crates/enact-channels/src/config.rs +213 -0
  17. package/crates/enact-channels/src/lib.rs +25 -0
  18. package/crates/enact-channels/src/runtime.rs +237 -0
  19. package/crates/enact-channels/src/security/mod.rs +5 -0
  20. package/crates/enact-channels/src/security/pairing.rs +205 -0
  21. package/crates/enact-channels/src/teams.rs +601 -0
  22. package/crates/enact-channels/src/telegram.rs +2833 -0
  23. package/crates/enact-channels/src/traits.rs +200 -0
  24. package/crates/enact-channels/src/webhook.rs +262 -0
  25. package/crates/enact-channels/src/whatsapp.rs +310 -0
  26. package/crates/enact-cli/Cargo.toml +40 -0
  27. package/crates/enact-cli/src/commands/doctor.rs +62 -0
  28. package/crates/enact-cli/src/commands/mod.rs +3 -0
  29. package/crates/enact-cli/src/commands/run.rs +69 -0
  30. package/crates/enact-cli/src/commands/serve.rs +81 -0
  31. package/crates/enact-cli/src/config.rs +2 -0
  32. package/crates/enact-cli/src/main.rs +79 -0
  33. package/crates/enact-config/Cargo.toml +36 -0
  34. package/crates/enact-config/ENV_VAR_MAPPING.md +135 -0
  35. package/crates/enact-config/QUICK_REFERENCE.md +92 -0
  36. package/crates/enact-config/README.md +107 -0
  37. package/crates/enact-config/TESTING.md +161 -0
  38. package/crates/enact-config/examples/test-env-vars.rs +100 -0
  39. package/crates/enact-config/src/config.rs +399 -0
  40. package/crates/enact-config/src/encrypted_store.rs +211 -0
  41. package/crates/enact-config/src/lib.rs +298 -0
  42. package/crates/enact-config/src/secrets.rs +149 -0
  43. package/crates/enact-config/src/sync.rs +260 -0
  44. package/crates/enact-config/test-env-vars.sh +34 -0
  45. package/crates/enact-config/tests/README.md +99 -0
  46. package/crates/enact-config/tests/config_integration_test.rs +202 -0
  47. package/crates/enact-config/tests/security_test.rs +140 -0
  48. package/crates/enact-context/Cargo.toml +41 -0
  49. package/crates/enact-context/src/budget.rs +314 -0
  50. package/crates/enact-context/src/calibrator.rs +535 -0
  51. package/crates/enact-context/src/compactor.rs +392 -0
  52. package/crates/enact-context/src/condenser.rs +826 -0
  53. package/crates/enact-context/src/lib.rs +94 -0
  54. package/crates/enact-context/src/segment.rs +238 -0
  55. package/crates/enact-context/src/step_context.rs +645 -0
  56. package/crates/enact-context/src/token_counter.rs +148 -0
  57. package/crates/enact-context/src/window.rs +372 -0
  58. package/crates/enact-core/Cargo.toml +42 -0
  59. package/crates/enact-core/README.md +98 -0
  60. package/crates/enact-core/src/background/executor.rs +524 -0
  61. package/crates/enact-core/src/background/mod.rs +48 -0
  62. package/crates/enact-core/src/background/target_binding.rs +390 -0
  63. package/crates/enact-core/src/background/trigger.rs +511 -0
  64. package/crates/enact-core/src/callable/callable.rs +152 -0
  65. package/crates/enact-core/src/callable/composite.rs +817 -0
  66. package/crates/enact-core/src/callable/graph.rs +104 -0
  67. package/crates/enact-core/src/callable/llm.rs +211 -0
  68. package/crates/enact-core/src/callable/mod.rs +64 -0
  69. package/crates/enact-core/src/callable/registry.rs +206 -0
  70. package/crates/enact-core/src/context/execution_context.rs +757 -0
  71. package/crates/enact-core/src/context/invocation.rs +99 -0
  72. package/crates/enact-core/src/context/mod.rs +50 -0
  73. package/crates/enact-core/src/context/tenant.rs +175 -0
  74. package/crates/enact-core/src/context/trace.rs +127 -0
  75. package/crates/enact-core/src/flow/conditional.rs +293 -0
  76. package/crates/enact-core/src/flow/mod.rs +43 -0
  77. package/crates/enact-core/src/flow/parallel.rs +437 -0
  78. package/crates/enact-core/src/flow/repeat.rs +534 -0
  79. package/crates/enact-core/src/flow/sequential.rs +248 -0
  80. package/crates/enact-core/src/graph/checkpoint.rs +79 -0
  81. package/crates/enact-core/src/graph/checkpoint_store.rs +76 -0
  82. package/crates/enact-core/src/graph/compiled.rs +189 -0
  83. package/crates/enact-core/src/graph/edge.rs +59 -0
  84. package/crates/enact-core/src/graph/graph_schema.rs +218 -0
  85. package/crates/enact-core/src/graph/loader.rs +155 -0
  86. package/crates/enact-core/src/graph/mod.rs +18 -0
  87. package/crates/enact-core/src/graph/node/function.rs +49 -0
  88. package/crates/enact-core/src/graph/node/mod.rs +48 -0
  89. package/crates/enact-core/src/graph/schema.rs +62 -0
  90. package/crates/enact-core/src/inbox/message.rs +405 -0
  91. package/crates/enact-core/src/inbox/mod.rs +31 -0
  92. package/crates/enact-core/src/inbox/store.rs +355 -0
  93. package/crates/enact-core/src/kernel/artifact/filesystem.rs +546 -0
  94. package/crates/enact-core/src/kernel/artifact/metadata.rs +283 -0
  95. package/crates/enact-core/src/kernel/artifact/mod.rs +27 -0
  96. package/crates/enact-core/src/kernel/artifact/store.rs +427 -0
  97. package/crates/enact-core/src/kernel/enforcement.rs +1315 -0
  98. package/crates/enact-core/src/kernel/error.rs +1200 -0
  99. package/crates/enact-core/src/kernel/event.rs +1394 -0
  100. package/crates/enact-core/src/kernel/execution_model.rs +831 -0
  101. package/crates/enact-core/src/kernel/execution_state.rs +189 -0
  102. package/crates/enact-core/src/kernel/execution_strategy.rs +117 -0
  103. package/crates/enact-core/src/kernel/ids.rs +2086 -0
  104. package/crates/enact-core/src/kernel/interrupt.rs +125 -0
  105. package/crates/enact-core/src/kernel/kernel.rs +1283 -0
  106. package/crates/enact-core/src/kernel/mod.rs +205 -0
  107. package/crates/enact-core/src/kernel/persistence/event_store.rs +270 -0
  108. package/crates/enact-core/src/kernel/persistence/message_store.rs +908 -0
  109. package/crates/enact-core/src/kernel/persistence/mod.rs +102 -0
  110. package/crates/enact-core/src/kernel/persistence/state_store.rs +228 -0
  111. package/crates/enact-core/src/kernel/persistence/vector_store.rs +299 -0
  112. package/crates/enact-core/src/kernel/reducer.rs +808 -0
  113. package/crates/enact-core/src/kernel/replay.rs +153 -0
  114. package/crates/enact-core/src/lib.rs +413 -0
  115. package/crates/enact-core/src/memory/episodic.rs +0 -0
  116. package/crates/enact-core/src/memory/mod.rs +6 -0
  117. package/crates/enact-core/src/memory/semantic.rs +0 -0
  118. package/crates/enact-core/src/memory/trait.rs +0 -0
  119. package/crates/enact-core/src/memory/vector_db.rs +0 -0
  120. package/crates/enact-core/src/memory/working.rs +0 -0
  121. package/crates/enact-core/src/policy/execution_policy.rs +292 -0
  122. package/crates/enact-core/src/policy/filters.rs +458 -0
  123. package/crates/enact-core/src/policy/input_processor.rs +407 -0
  124. package/crates/enact-core/src/policy/long_running.rs +134 -0
  125. package/crates/enact-core/src/policy/mod.rs +193 -0
  126. package/crates/enact-core/src/policy/pii_input.rs +274 -0
  127. package/crates/enact-core/src/policy/tenant_policy.rs +453 -0
  128. package/crates/enact-core/src/policy/tool_policy.rs +407 -0
  129. package/crates/enact-core/src/providers/mod.rs +63 -0
  130. package/crates/enact-core/src/providers/trait.rs +292 -0
  131. package/crates/enact-core/src/runner/callbacks.rs +6 -0
  132. package/crates/enact-core/src/runner/execution_runner.rs +476 -0
  133. package/crates/enact-core/src/runner/loop.rs +117 -0
  134. package/crates/enact-core/src/runner/mod.rs +58 -0
  135. package/crates/enact-core/src/runner/protected_runner.rs +280 -0
  136. package/crates/enact-core/src/signal/inmemory.rs +231 -0
  137. package/crates/enact-core/src/signal/mod.rs +108 -0
  138. package/crates/enact-core/src/streaming/event_logger.rs +195 -0
  139. package/crates/enact-core/src/streaming/event_stream.rs +1423 -0
  140. package/crates/enact-core/src/streaming/mod.rs +108 -0
  141. package/crates/enact-core/src/streaming/pause_cancel.rs +0 -0
  142. package/crates/enact-core/src/streaming/protected_emitter.rs +173 -0
  143. package/crates/enact-core/src/streaming/protection/context.rs +136 -0
  144. package/crates/enact-core/src/streaming/protection/encryption.rs +289 -0
  145. package/crates/enact-core/src/streaming/protection/mod.rs +43 -0
  146. package/crates/enact-core/src/streaming/protection/pii_protection.rs +243 -0
  147. package/crates/enact-core/src/streaming/protection/processor.rs +166 -0
  148. package/crates/enact-core/src/streaming/sse.rs +0 -0
  149. package/crates/enact-core/src/telemetry/exporter.rs +0 -0
  150. package/crates/enact-core/src/telemetry/init.rs +0 -0
  151. package/crates/enact-core/src/telemetry/mod.rs +49 -0
  152. package/crates/enact-core/src/telemetry/spans.rs +245 -0
  153. package/crates/enact-core/src/tool/agent_tool.rs +177 -0
  154. package/crates/enact-core/src/tool/browser/mod.rs +0 -0
  155. package/crates/enact-core/src/tool/browser/webdriver.rs +0 -0
  156. package/crates/enact-core/src/tool/cost.rs +247 -0
  157. package/crates/enact-core/src/tool/discovery.rs +0 -0
  158. package/crates/enact-core/src/tool/dispatcher.rs +347 -0
  159. package/crates/enact-core/src/tool/filesystem.rs +231 -0
  160. package/crates/enact-core/src/tool/function.rs +99 -0
  161. package/crates/enact-core/src/tool/git.rs +162 -0
  162. package/crates/enact-core/src/tool/http.rs +214 -0
  163. package/crates/enact-core/src/tool/mcp/client.rs +0 -0
  164. package/crates/enact-core/src/tool/mcp/mod.rs +0 -0
  165. package/crates/enact-core/src/tool/mod.rs +51 -0
  166. package/crates/enact-core/src/tool/reasoning/debugging.rs +0 -0
  167. package/crates/enact-core/src/tool/reasoning/mcts.rs +0 -0
  168. package/crates/enact-core/src/tool/reasoning/mod.rs +0 -0
  169. package/crates/enact-core/src/tool/reasoning/sequential.rs +0 -0
  170. package/crates/enact-core/src/tool/sandbox/dagger.rs +0 -0
  171. package/crates/enact-core/src/tool/sandbox/mod.rs +0 -0
  172. package/crates/enact-core/src/tool/shell.rs +147 -0
  173. package/crates/enact-core/src/tool/trait.rs +33 -0
  174. package/crates/enact-core/src/tool/web_search.rs +277 -0
  175. package/crates/enact-core/src/util/config.rs +0 -0
  176. package/crates/enact-core/src/util/errors.rs +0 -0
  177. package/crates/enact-core/src/util/mod.rs +6 -0
  178. package/crates/enact-core/tests/airgapped_e2e_test.rs +291 -0
  179. package/crates/enact-core/tests/e2e_agentic_loop.rs +119 -0
  180. package/crates/enact-core/tests/e2e_test.rs +259 -0
  181. package/crates/enact-core/tests/graph_test.rs +130 -0
  182. package/crates/enact-core/tests/stream_event_id_validation.rs +435 -0
  183. package/crates/enact-cron/Cargo.toml +28 -0
  184. package/crates/enact-cron/src/lib.rs +44 -0
  185. package/crates/enact-cron/src/schedule.rs +156 -0
  186. package/crates/enact-cron/src/store.rs +589 -0
  187. package/crates/enact-cron/src/types.rs +148 -0
  188. package/crates/enact-gateway/Cargo.toml +31 -0
  189. package/crates/enact-gateway/README.md +30 -0
  190. package/crates/enact-gateway/examples/whatsapp-gateway-runner-mock.rs +59 -0
  191. package/crates/enact-gateway/examples/whatsapp-gateway.rs +42 -0
  192. package/crates/enact-gateway/src/lib.rs +582 -0
  193. package/crates/enact-mcp/Cargo.toml +24 -0
  194. package/crates/enact-mcp/src/lib.rs +178 -0
  195. package/crates/enact-memory/Cargo.toml +25 -0
  196. package/crates/enact-memory/src/backend.rs +20 -0
  197. package/crates/enact-memory/src/chunker.rs +230 -0
  198. package/crates/enact-memory/src/embeddings.rs +221 -0
  199. package/crates/enact-memory/src/lib.rs +67 -0
  200. package/crates/enact-memory/src/markdown.rs +127 -0
  201. package/crates/enact-memory/src/none.rs +61 -0
  202. package/crates/enact-memory/src/sqlite.rs +276 -0
  203. package/crates/enact-memory/src/traits.rs +65 -0
  204. package/crates/enact-memory/src/vector.rs +198 -0
  205. package/crates/enact-oauth/Cargo.toml +27 -0
  206. package/crates/enact-oauth/src/lib.rs +584 -0
  207. package/crates/enact-observability/Cargo.toml +22 -0
  208. package/crates/enact-observability/src/lib.rs +197 -0
  209. package/crates/enact-providers/Cargo.toml +33 -0
  210. package/crates/enact-providers/examples/hello-agent.rs +33 -0
  211. package/crates/enact-providers/src/anthropic.rs +182 -0
  212. package/crates/enact-providers/src/azure.rs +96 -0
  213. package/crates/enact-providers/src/bridge.rs +221 -0
  214. package/crates/enact-providers/src/gemini.rs +227 -0
  215. package/crates/enact-providers/src/http.rs +78 -0
  216. package/crates/enact-providers/src/lib.rs +53 -0
  217. package/crates/enact-providers/src/openai_compatible.rs +167 -0
  218. package/crates/enact-providers/src/openrouter.rs +33 -0
  219. package/crates/enact-runner/Cargo.toml +24 -0
  220. package/crates/enact-runner/README.md +76 -0
  221. package/crates/enact-runner/src/compaction.rs +225 -0
  222. package/crates/enact-runner/src/config.rs +118 -0
  223. package/crates/enact-runner/src/lib.rs +63 -0
  224. package/crates/enact-runner/src/loop_driver.rs +414 -0
  225. package/crates/enact-runner/src/parser.rs +421 -0
  226. package/crates/enact-runner/src/retry.rs +262 -0
  227. package/crates/enact-runner/tests/integration.rs +278 -0
  228. package/crates/enact-security/Cargo.toml +22 -0
  229. package/crates/enact-security/src/audit.rs +375 -0
  230. package/crates/enact-security/src/lib.rs +37 -0
  231. package/crates/enact-security/src/policy.rs +406 -0
  232. package/crates/enact-skills/Cargo.toml +25 -0
  233. package/crates/enact-skills/src/lib.rs +506 -0
  234. package/crates/enact-tools/Cargo.toml +22 -0
  235. package/crates/enact-tools/src/file_read.rs +166 -0
  236. package/crates/enact-tools/src/file_write.rs +216 -0
  237. package/crates/enact-tools/src/git_operations.rs +513 -0
  238. package/crates/enact-tools/src/http_request.rs +417 -0
  239. package/crates/enact-tools/src/lib.rs +104 -0
  240. package/crates/enact-tools/src/security.rs +227 -0
  241. package/crates/enact-tools/src/shell.rs +191 -0
  242. package/crates/enact-tools/src/traits.rs +159 -0
  243. package/docs/Makefile +74 -0
  244. package/docs/config.toml +62 -0
  245. package/docs/content/_index.md +174 -0
  246. package/docs/content/a2a/_index.md +431 -0
  247. package/docs/content/api/_index.md +323 -0
  248. package/docs/content/channels/_index.md +160 -0
  249. package/docs/content/channels/teams.md +205 -0
  250. package/docs/content/channels/telegram.md +182 -0
  251. package/docs/content/channels/webhook.md +423 -0
  252. package/docs/content/channels/whatsapp.md +240 -0
  253. package/docs/content/cli/_index.md +261 -0
  254. package/docs/content/concepts/_index.md +273 -0
  255. package/docs/content/configuration/_index.md +241 -0
  256. package/docs/content/cron/_index.md +248 -0
  257. package/docs/content/developers/_index.md +278 -0
  258. package/docs/content/getting-started/_index.md +180 -0
  259. package/docs/content/installation/_index.md +186 -0
  260. package/docs/content/installation/uninstall.md +101 -0
  261. package/docs/content/installation/updating.md +120 -0
  262. package/docs/content/mcp/_index.md +215 -0
  263. package/docs/content/memory/_index.md +163 -0
  264. package/docs/content/oauth/_index.md +515 -0
  265. package/docs/content/providers/_index.md +206 -0
  266. package/docs/content/roadmap/_index.md +199 -0
  267. package/docs/content/security/_index.md +219 -0
  268. package/docs/content/skills/_index.md +228 -0
  269. package/docs/content/tools/_index.md +485 -0
  270. package/docs/content/troubleshooting/_index.md +259 -0
  271. package/docs/content/yaml-schema/_index.md +294 -0
  272. package/docs/static/giallo-dark.css +91 -0
  273. package/docs/static/giallo-light.css +91 -0
  274. package/docs/themes/tanuki/.github/workflows/deploy.yml +44 -0
  275. package/docs/themes/tanuki/LICENSE +21 -0
  276. package/docs/themes/tanuki/README.md +166 -0
  277. package/docs/themes/tanuki/examples/blog/config.toml +58 -0
  278. package/docs/themes/tanuki/examples/blog/content/_index.md +4 -0
  279. package/docs/themes/tanuki/examples/blog/content/about.md +33 -0
  280. package/docs/themes/tanuki/examples/blog/content/blog/_index.md +7 -0
  281. package/docs/themes/tanuki/examples/blog/content/blog/api-design-best-practices.md +245 -0
  282. package/docs/themes/tanuki/examples/blog/content/blog/building-accessible-websites.md +147 -0
  283. package/docs/themes/tanuki/examples/blog/content/blog/css-grid-vs-flexbox.md +165 -0
  284. package/docs/themes/tanuki/examples/blog/content/blog/customizing-catppuccin-colors.md +137 -0
  285. package/docs/themes/tanuki/examples/blog/content/blog/dark-mode-best-practices.md +82 -0
  286. package/docs/themes/tanuki/examples/blog/content/blog/docker-essentials.md +301 -0
  287. package/docs/themes/tanuki/examples/blog/content/blog/getting-started-with-zola.md +129 -0
  288. package/docs/themes/tanuki/examples/blog/content/blog/git-workflow-for-content.md +112 -0
  289. package/docs/themes/tanuki/examples/blog/content/blog/introduction-to-webassembly.md +183 -0
  290. package/docs/themes/tanuki/examples/blog/content/blog/modern-javascript-features.md +234 -0
  291. package/docs/themes/tanuki/examples/blog/content/blog/testing-strategies.md +311 -0
  292. package/docs/themes/tanuki/examples/blog/content/blog/typography-for-developers.md +104 -0
  293. package/docs/themes/tanuki/examples/blog/content/blog/welcome-to-tanuki.md +67 -0
  294. package/docs/themes/tanuki/examples/blog/content/blog/why-static-sites.md +85 -0
  295. package/docs/themes/tanuki/examples/blog/content/projects.md +64 -0
  296. package/docs/themes/tanuki/examples/book/config.toml +17 -0
  297. package/docs/themes/tanuki/examples/book/content/_index.md +12 -0
  298. package/docs/themes/tanuki/examples/book/content/chapter-1.md +90 -0
  299. package/docs/themes/tanuki/examples/book/content/chapter-2.md +143 -0
  300. package/docs/themes/tanuki/examples/book/content/chapter-3.md +217 -0
  301. package/docs/themes/tanuki/examples/book/content/chapter-4.md +224 -0
  302. package/docs/themes/tanuki/examples/book/content/chapter-5.md +297 -0
  303. package/docs/themes/tanuki/examples/book/content/print.md +6 -0
  304. package/docs/themes/tanuki/examples/docs/config.toml +28 -0
  305. package/docs/themes/tanuki/examples/docs/content/_index.md +20 -0
  306. package/docs/themes/tanuki/examples/docs/content/components.md +156 -0
  307. package/docs/themes/tanuki/examples/docs/content/configuration.md +94 -0
  308. package/docs/themes/tanuki/examples/docs/content/customization.md +202 -0
  309. package/docs/themes/tanuki/examples/docs/content/deployment.md +204 -0
  310. package/docs/themes/tanuki/examples/docs/content/installation.md +59 -0
  311. package/docs/themes/tanuki/examples/docs/content/print.md +6 -0
  312. package/docs/themes/tanuki/examples/docs/static/img/tanuki-icon.avif +0 -0
  313. package/docs/themes/tanuki/examples/index.html +2104 -0
  314. package/docs/themes/tanuki/mise.toml +108 -0
  315. package/docs/themes/tanuki/sass/base/_catppuccin.scss +164 -0
  316. package/docs/themes/tanuki/sass/base/_fonts.scss +64 -0
  317. package/docs/themes/tanuki/sass/base/_reset.scss +152 -0
  318. package/docs/themes/tanuki/sass/base/_typography.scss +523 -0
  319. package/docs/themes/tanuki/sass/components/_buttons.scss +209 -0
  320. package/docs/themes/tanuki/sass/components/_code.scss +457 -0
  321. package/docs/themes/tanuki/sass/components/_landing.scss +633 -0
  322. package/docs/themes/tanuki/sass/components/_layout.scss +294 -0
  323. package/docs/themes/tanuki/sass/components/_navigation.scss +1200 -0
  324. package/docs/themes/tanuki/sass/components/_print.scss +237 -0
  325. package/docs/themes/tanuki/sass/components/_search.scss +224 -0
  326. package/docs/themes/tanuki/sass/components/_sidebar.scss +473 -0
  327. package/docs/themes/tanuki/sass/components/_theme-toggle.scss +186 -0
  328. package/docs/themes/tanuki/sass/modes/_blog.scss +366 -0
  329. package/docs/themes/tanuki/sass/modes/_product.scss +875 -0
  330. package/docs/themes/tanuki/sass/modes/_raskell.scss +1696 -0
  331. package/docs/themes/tanuki/sass/patterns/_buttons.scss +183 -0
  332. package/docs/themes/tanuki/sass/patterns/_cards.scss +144 -0
  333. package/docs/themes/tanuki/sass/patterns/_index.scss +9 -0
  334. package/docs/themes/tanuki/sass/patterns/_lists.scss +259 -0
  335. package/docs/themes/tanuki/sass/patterns/_sections.scss +243 -0
  336. package/docs/themes/tanuki/sass/style.scss +47 -0
  337. package/docs/themes/tanuki/sass/tokens/_colors.scss +139 -0
  338. package/docs/themes/tanuki/sass/tokens/_spacing.scss +100 -0
  339. package/docs/themes/tanuki/sass/tokens/_typography.scss +186 -0
  340. package/docs/themes/tanuki/screenshot.png +0 -0
  341. package/docs/themes/tanuki/sentinel.kdl +59 -0
  342. package/docs/themes/tanuki/static/elasticlunr.min.js +10 -0
  343. package/docs/themes/tanuki/static/fonts/GEIST-LICENSE.txt +92 -0
  344. package/docs/themes/tanuki/static/fonts/Geist-Variable.woff2 +0 -0
  345. package/docs/themes/tanuki/static/fonts/GeistMono-Variable.woff2 +0 -0
  346. package/docs/themes/tanuki/static/img/tanuki-icon.avif +0 -0
  347. package/docs/themes/tanuki/static/img/tanuki-icon.png +0 -0
  348. package/docs/themes/tanuki/static/js/anchors.js +18 -0
  349. package/docs/themes/tanuki/static/js/app.js +274 -0
  350. package/docs/themes/tanuki/static/js/code.js +394 -0
  351. package/docs/themes/tanuki/static/js/navigation.js +778 -0
  352. package/docs/themes/tanuki/static/js/scroll-to-top.js +33 -0
  353. package/docs/themes/tanuki/static/js/search-raskell.js +240 -0
  354. package/docs/themes/tanuki/static/js/search.js +215 -0
  355. package/docs/themes/tanuki/static/js/theme.js +169 -0
  356. package/docs/themes/tanuki/static/syntax-dark.css +151 -0
  357. package/docs/themes/tanuki/static/syntax-light.css +151 -0
  358. package/docs/themes/tanuki/static/wasm/sentinel_playground_wasm.js +486 -0
  359. package/docs/themes/tanuki/static/wasm/sentinel_playground_wasm_bg.wasm +0 -0
  360. package/docs/themes/tanuki/templates/404.html +52 -0
  361. package/docs/themes/tanuki/templates/base.html +428 -0
  362. package/docs/themes/tanuki/templates/blog.html +66 -0
  363. package/docs/themes/tanuki/templates/home.html +108 -0
  364. package/docs/themes/tanuki/templates/index.html +178 -0
  365. package/docs/themes/tanuki/templates/landing.html +168 -0
  366. package/docs/themes/tanuki/templates/macros/nav.html +128 -0
  367. package/docs/themes/tanuki/templates/macros/posts.html +101 -0
  368. package/docs/themes/tanuki/templates/macros/ui.html +159 -0
  369. package/docs/themes/tanuki/templates/page.html +135 -0
  370. package/docs/themes/tanuki/templates/partials/footer.html +38 -0
  371. package/docs/themes/tanuki/templates/partials/header.html +366 -0
  372. package/docs/themes/tanuki/templates/partials/nav-buttons.html +55 -0
  373. package/docs/themes/tanuki/templates/partials/nav-overlay.html +81 -0
  374. package/docs/themes/tanuki/templates/partials/page-toc-panel.html +43 -0
  375. package/docs/themes/tanuki/templates/partials/search.html +52 -0
  376. package/docs/themes/tanuki/templates/partials/sidebar.html +107 -0
  377. package/docs/themes/tanuki/templates/partials/theme-toggle.html +35 -0
  378. package/docs/themes/tanuki/templates/partials/toc-overlay.html +146 -0
  379. package/docs/themes/tanuki/templates/partials/version-picker.html +38 -0
  380. package/docs/themes/tanuki/templates/print.html +244 -0
  381. package/docs/themes/tanuki/templates/section.html +186 -0
  382. package/docs/themes/tanuki/templates/taxonomy_list.html +18 -0
  383. package/docs/themes/tanuki/templates/taxonomy_single.html +31 -0
  384. package/docs/themes/tanuki/theme.toml +58 -0
  385. package/examples/hello-agent.rs +55 -0
  386. package/package.json +36 -0
  387. package/proto/config.proto +60 -0
  388. package/proto/events.proto +0 -0
  389. package/proto/runtime.proto +215 -0
@@ -0,0 +1,107 @@
1
+ {# Sidebar with Table of Contents for Docs Mode #}
2
+ <aside id="sidebar" class="sidebar" role="complementary" aria-labelledby="sidebar-title">
3
+ {# Resize handle (desktop only) #}
4
+ <div class="sidebar__resize-handle" aria-hidden="true" title="Drag to resize sidebar width"></div>
5
+
6
+ <div class="sidebar__header">
7
+ <span id="sidebar-title" class="sidebar__title">Table of contents</span>
8
+ <button class="sidebar__close" type="button" aria-label="Close sidebar" title="Close">
9
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
10
+ <path d="M18 6 6 18"/>
11
+ <path d="m6 6 12 12"/>
12
+ </svg>
13
+ </button>
14
+ </div>
15
+
16
+ <nav class="sidebar__content" aria-label="Documentation navigation">
17
+ <div class="toc">
18
+ {# Get the root section for docs #}
19
+ {% set root_section = get_section(path="_index.md") %}
20
+
21
+ {% if root_section %}
22
+ <div class="toc__section">
23
+ <ol class="toc__list toc__list--numbered" start="0">
24
+ {% for pg in root_section.pages %}
25
+ {% if pg.extra.hide_from_toc is not defined or not pg.extra.hide_from_toc %}
26
+ <li class="toc__item">
27
+ <a href="{{ pg.permalink | safe }}" class="toc__link {% if current_path is defined and current_path == pg.path %}active{% endif %}">
28
+ <span class="toc__number">{{ loop.index0 }}.</span>
29
+ {{ pg.title }}
30
+ </a>
31
+ </li>
32
+ {% endif %}
33
+ {% endfor %}
34
+ </ol>
35
+ </div>
36
+
37
+ {# Subsections - Zola automatically sorts section.subsections by weight #}
38
+ {% if root_section.subsections %}
39
+ {% for subsection_path in root_section.subsections %}
40
+ {% set subsection = get_section(path=subsection_path) %}
41
+ <div class="toc__section">
42
+ <a href="{{ subsection.permalink | safe }}" class="toc__section-title {% if current_path is defined and current_path == subsection.path %}active{% endif %}">{{ subsection.title }}</a>
43
+ <ul class="toc__list">
44
+ {% for pg in subsection.pages %}
45
+ <li class="toc__item">
46
+ <a href="{{ pg.permalink | safe }}" class="toc__link {% if current_path is defined and current_path == pg.path %}active{% endif %}">
47
+ {{ pg.title }}
48
+ </a>
49
+ </li>
50
+ {% endfor %}
51
+ </ul>
52
+ </div>
53
+ {% endfor %}
54
+ {% endif %}
55
+ {% endif %}
56
+ </div>
57
+ </nav>
58
+
59
+ <div class="sidebar__footer">
60
+ {# Mobile-only actions (hidden on desktop where they're in header) #}
61
+ <div class="sidebar__actions-mobile">
62
+ {# Version picker #}
63
+ {% if config.extra.versions is defined %}
64
+ <div class="sidebar__action">
65
+ <span class="sidebar__action-label">Version</span>
66
+ <div class="sidebar__version">
67
+ <span class="sidebar__version-current">v{{ config.extra.versions.current }}</span>
68
+ {% for v in config.extra.versions.list %}
69
+ {% if v.version != config.extra.versions.current %}
70
+ <a href="{{ v.url | safe }}" class="sidebar__version-link">v{{ v.version }}</a>
71
+ {% endif %}
72
+ {% endfor %}
73
+ </div>
74
+ </div>
75
+ {% endif %}
76
+
77
+ {# Theme toggle #}
78
+ {% if config.extra.show_theme_toggle | default(value=true) %}
79
+ <div class="sidebar__action">
80
+ <span class="sidebar__action-label">Theme</span>
81
+ {% include "partials/theme-toggle.html" %}
82
+ </div>
83
+ {% endif %}
84
+
85
+ {# GitHub link #}
86
+ {% if config.extra.github %}
87
+ <a href="{{ config.extra.github }}" class="sidebar__github" target="_blank" rel="noopener noreferrer" aria-label="View project on GitHub (opens in new tab)">
88
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
89
+ <path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/>
90
+ <path d="M9 18c-4.51 2-5-2-7-2"/>
91
+ </svg>
92
+ <span>View on GitHub</span>
93
+ </a>
94
+ {% endif %}
95
+ </div>
96
+
97
+ {# Print button #}
98
+ <a href="{{ get_url(path='print') | safe }}?auto=true" class="print-button" target="_blank" rel="noopener" aria-label="Print all documentation pages (opens print dialog)">
99
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
100
+ <polyline points="6 9 6 2 18 2 18 9"/>
101
+ <path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/>
102
+ <rect width="12" height="8" x="6" y="14"/>
103
+ </svg>
104
+ <span>Print all pages</span>
105
+ </a>
106
+ </div>
107
+ </aside>
@@ -0,0 +1,35 @@
1
+ {# Theme Toggle Button - Nintendo-style whimsical #}
2
+ <button class="theme-toggle" type="button" aria-label="Toggle color theme: cycles through light, dark, and auto modes" aria-live="polite" title="Toggle theme">
3
+ <span class="theme-toggle__icons">
4
+ {# Sun icon (for switching to light mode) #}
5
+ <span class="theme-toggle__sun" aria-hidden="true">
6
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
7
+ <circle cx="12" cy="12" r="4"/>
8
+ <path d="M12 2v2"/>
9
+ <path d="M12 20v2"/>
10
+ <path d="m4.93 4.93 1.41 1.41"/>
11
+ <path d="m17.66 17.66 1.41 1.41"/>
12
+ <path d="M2 12h2"/>
13
+ <path d="M20 12h2"/>
14
+ <path d="m6.34 17.66-1.41 1.41"/>
15
+ <path d="m19.07 4.93-1.41 1.41"/>
16
+ </svg>
17
+ </span>
18
+
19
+ {# Moon icon (for switching to dark mode) #}
20
+ <span class="theme-toggle__moon" aria-hidden="true">
21
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
22
+ <path d="M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z"/>
23
+ </svg>
24
+ </span>
25
+
26
+ {# Eclipse icon (for switching to auto/system mode) #}
27
+ <span class="theme-toggle__auto" aria-hidden="true">
28
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
29
+ <circle cx="12" cy="12" r="10"/>
30
+ <path d="M12 2a7 7 0 1 0 7 7"/>
31
+ </svg>
32
+ </span>
33
+ </span>
34
+ <span class="sr-only theme-toggle__status">Current theme: auto</span>
35
+ </button>
@@ -0,0 +1,146 @@
1
+ {# Full-screen Table of Contents overlay for docs/book mode #}
2
+ {% set mode = config.extra.mode | default(value="site") %}
3
+
4
+ <div id="toc-overlay" class="toc-overlay" aria-hidden="true" role="dialog" aria-label="Table of Contents">
5
+ <div class="toc-overlay__backdrop"></div>
6
+ <div class="toc-overlay__panel">
7
+ <div class="toc-overlay__header">
8
+ <h2 class="toc-overlay__title">{{ config.title }}</h2>
9
+ <button class="toc-overlay__close" aria-label="Close table of contents">
10
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
11
+ <path d="M18 6 6 18"/>
12
+ <path d="m6 6 12 12"/>
13
+ </svg>
14
+ </button>
15
+ </div>
16
+
17
+ <nav class="toc-overlay__nav" aria-label="{% if mode == 'docs' %}Table of contents{% else %}Book chapters{% endif %}">
18
+ {% set root_section = get_section(path="_index.md") %}
19
+
20
+ {% if mode == "docs" %}
21
+ {# Docs mode: numbered chapters #}
22
+ {% if root_section %}
23
+ <ul class="toc-overlay__list">
24
+ {% for pg in root_section.pages %}
25
+ {% if pg.extra.hide_from_toc is not defined or not pg.extra.hide_from_toc %}
26
+ <li class="toc-overlay__item">
27
+ <a href="{{ pg.permalink | safe }}" class="toc-overlay__link{% if current_path is defined and current_path == pg.path %} toc-overlay__link--active{% endif %}">
28
+ <span class="toc-overlay__chapter">{{ loop.index0 }}.</span>
29
+ <span class="toc-overlay__page-title">{{ pg.title }}</span>
30
+ </a>
31
+ </li>
32
+ {% endif %}
33
+ {% endfor %}
34
+ </ul>
35
+
36
+ {# Subsections - collect and sort by weight #}
37
+ {% if root_section.subsections %}
38
+ {% set_global subsection_data = [] %}
39
+ {% for subsection_path in root_section.subsections %}
40
+ {% set sec = get_section(path=subsection_path) %}
41
+ {% set w = sec.weight | default(value=999) %}
42
+ {# Pad weight to 3 digits for proper string sorting, then concat with path #}
43
+ {% if w < 10 %}
44
+ {% set w_str = "00" ~ w %}
45
+ {% elif w < 100 %}
46
+ {% set w_str = "0" ~ w %}
47
+ {% else %}
48
+ {% set w_str = w %}
49
+ {% endif %}
50
+ {% set_global subsection_data = subsection_data | concat(with=[w_str ~ "|" ~ subsection_path]) %}
51
+ {% endfor %}
52
+ {% set_global subsection_data = subsection_data | sort %}
53
+
54
+ {% for item in subsection_data %}
55
+ {% set parts = item | split(pat="|") %}
56
+ {% set subsection = get_section(path=parts.1) %}
57
+ <div class="toc-overlay__section">
58
+ <div class="toc-overlay__section-title">{{ subsection.title }}</div>
59
+ <ul class="toc-overlay__list">
60
+ {% for pg in subsection.pages %}
61
+ <li class="toc-overlay__item">
62
+ <a href="{{ pg.permalink | safe }}" class="toc-overlay__link{% if current_path is defined and current_path == pg.path %} toc-overlay__link--active{% endif %}">
63
+ <span class="toc-overlay__page-title">{{ pg.title }}</span>
64
+ </a>
65
+ </li>
66
+ {% endfor %}
67
+ </ul>
68
+ </div>
69
+ {% endfor %}
70
+ {% endif %}
71
+ {% endif %}
72
+
73
+ {% else %}
74
+ {# Book mode: chapters #}
75
+ {% if root_section %}
76
+ <ul class="toc-overlay__list">
77
+ <li class="toc-overlay__item">
78
+ <a href="{{ root_section.permalink | safe }}" class="toc-overlay__link toc-overlay__link--section">
79
+ {{ root_section.title }}
80
+ </a>
81
+ </li>
82
+ {% for page in root_section.pages %}
83
+ {% if page.extra.hide_from_toc is not defined or not page.extra.hide_from_toc %}
84
+ <li class="toc-overlay__item">
85
+ <a href="{{ page.permalink | safe }}" class="toc-overlay__link{% if current_path is defined and current_path == page.path %} toc-overlay__link--active{% endif %}">
86
+ <span class="toc-overlay__chapter">Chapter {{ loop.index }}</span>
87
+ <span class="toc-overlay__page-title">{{ page.title }}</span>
88
+ </a>
89
+ </li>
90
+ {% endif %}
91
+ {% endfor %}
92
+ </ul>
93
+ {% endif %}
94
+ {% endif %}
95
+ </nav>
96
+
97
+ {# Footer with actions #}
98
+ <div class="toc-overlay__footer">
99
+ {# Version picker (docs mode only) #}
100
+ {% if mode == "docs" and config.extra.versions is defined %}
101
+ <div class="toc-overlay__action">
102
+ <span class="toc-overlay__action-label">Version</span>
103
+ <div class="toc-overlay__version">
104
+ <span class="toc-overlay__version-current">v{{ config.extra.versions.current }}</span>
105
+ {% for v in config.extra.versions.list %}
106
+ {% if v.version != config.extra.versions.current %}
107
+ <a href="{{ v.url | safe }}" class="toc-overlay__version-link">v{{ v.version }}</a>
108
+ {% endif %}
109
+ {% endfor %}
110
+ </div>
111
+ </div>
112
+ {% endif %}
113
+
114
+ {# Theme toggle #}
115
+ {% if config.extra.show_theme_toggle | default(value=true) %}
116
+ <div class="toc-overlay__action">
117
+ <span class="toc-overlay__action-label">Theme</span>
118
+ {% include "partials/theme-toggle.html" %}
119
+ </div>
120
+ {% endif %}
121
+
122
+ {# GitHub link #}
123
+ {% if config.extra.github %}
124
+ <a href="{{ config.extra.github }}" class="toc-overlay__github" target="_blank" rel="noopener">
125
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
126
+ <path d="M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"/>
127
+ <path d="M9 18c-4.51 2-5-2-7-2"/>
128
+ </svg>
129
+ <span>View on GitHub</span>
130
+ </a>
131
+ {% endif %}
132
+
133
+ {# Print all pages (docs and book modes) #}
134
+ {% if mode == "docs" or mode == "book" %}
135
+ <a href="{{ get_url(path='print') | safe }}?auto=true" class="toc-overlay__print" target="_blank">
136
+ <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
137
+ <polyline points="6 9 6 2 18 2 18 9"/>
138
+ <path d="M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"/>
139
+ <rect width="12" height="8" x="6" y="14"/>
140
+ </svg>
141
+ <span>Print all pages</span>
142
+ </a>
143
+ {% endif %}
144
+ </div>
145
+ </div>
146
+ </div>
@@ -0,0 +1,38 @@
1
+ {# Version Picker Dropdown (docs mode only) #}
2
+ {% if config.extra.versions %}
3
+ {% set current_version = config.extra.versions.current | default(value="latest") %}
4
+
5
+ <div class="version-picker">
6
+ <button class="version-picker__button" aria-haspopup="listbox" aria-expanded="false">
7
+ <span>v{{ current_version }}</span>
8
+ {% for v in config.extra.versions.list %}
9
+ {% if v.version == current_version and v.label is defined %}
10
+ <span class="version-picker__badge">{{ v.label }}</span>
11
+ {% endif %}
12
+ {% endfor %}
13
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
14
+ <path d="m6 9 6 6 6-6"/>
15
+ </svg>
16
+ </button>
17
+
18
+ <div class="version-picker__dropdown" role="listbox">
19
+ {% for v in config.extra.versions.list %}
20
+ <a href="{{ v.url | safe }}" class="version-picker__item {% if v.version == current_version %}active{% endif %}" role="option">
21
+ v{{ v.version }}
22
+ {% if v.label is defined and v.label %}
23
+ <span class="version-picker__badge">{{ v.label }}</span>
24
+ {% endif %}
25
+ </a>
26
+ {% endfor %}
27
+ <hr class="version-picker__divider">
28
+ <a href="{{ get_url(path='appendix/versioning/') | safe }}" class="version-picker__item version-picker__item--link">
29
+ All versions
30
+ <svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
31
+ <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>
32
+ <polyline points="15 3 21 3 21 9"/>
33
+ <line x1="10" y1="14" x2="21" y2="3"/>
34
+ </svg>
35
+ </a>
36
+ </div>
37
+ </div>
38
+ {% endif %}
@@ -0,0 +1,244 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ lang | default(value='en') }}">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <meta name="robots" content="noindex">
7
+ <title>{{ config.title }} - Print Version</title>
8
+
9
+ <link rel="stylesheet" href="{{ get_url(path='style.css') | safe }}">
10
+
11
+ <style>
12
+ /* Print-specific overrides */
13
+ body {
14
+ background: white;
15
+ color: black;
16
+ }
17
+
18
+ .print-page {
19
+ max-width: 800px;
20
+ margin: 0 auto;
21
+ padding: 2rem;
22
+ }
23
+
24
+ .print-page__header {
25
+ text-align: center;
26
+ margin-bottom: 3rem;
27
+ padding-bottom: 2rem;
28
+ border-bottom: 2px solid #ddd;
29
+ }
30
+
31
+ .print-page__header h1 {
32
+ color: #333;
33
+ margin-bottom: 0.5rem;
34
+ }
35
+
36
+ .print-page__meta {
37
+ color: #666;
38
+ font-size: 0.9rem;
39
+ }
40
+
41
+ .print-page__toc {
42
+ margin-bottom: 3rem;
43
+ padding: 1.5rem;
44
+ background: #f5f5f5;
45
+ border-radius: 8px;
46
+ }
47
+
48
+ .print-page__toc h2 {
49
+ margin-top: 0;
50
+ border-bottom: none;
51
+ }
52
+
53
+ .print-page__toc-section {
54
+ margin-top: 1rem;
55
+ }
56
+
57
+ .print-page__toc-section-title {
58
+ font-weight: 600;
59
+ color: #555;
60
+ margin-bottom: 0.5rem;
61
+ }
62
+
63
+ .print-page__toc ol {
64
+ margin: 0;
65
+ padding-left: 1.5rem;
66
+ }
67
+
68
+ .print-page__toc li {
69
+ margin: 0.25rem 0;
70
+ }
71
+
72
+ .print-page__section {
73
+ margin-bottom: 2rem;
74
+ }
75
+
76
+ .print-page__section-title {
77
+ font-size: 1.5rem;
78
+ color: #555;
79
+ border-bottom: 2px solid #ddd;
80
+ padding-bottom: 0.5rem;
81
+ margin-bottom: 2rem;
82
+ page-break-after: avoid;
83
+ }
84
+
85
+ .print-page__chapter {
86
+ margin-bottom: 3rem;
87
+ padding-bottom: 2rem;
88
+ border-bottom: 1px solid #ddd;
89
+ page-break-after: always;
90
+ }
91
+
92
+ .print-page__chapter:last-child {
93
+ border-bottom: none;
94
+ page-break-after: auto;
95
+ }
96
+
97
+ .print-page__chapter h1 {
98
+ color: #333;
99
+ page-break-after: avoid;
100
+ }
101
+
102
+ /* Hide interactive elements */
103
+ .no-print,
104
+ .code-buttons {
105
+ display: none !important;
106
+ }
107
+
108
+ @media print {
109
+ body {
110
+ font-size: 11pt;
111
+ }
112
+
113
+ .print-page {
114
+ padding: 0;
115
+ }
116
+
117
+ .print-page__toc {
118
+ background: none;
119
+ border: 1px solid #ddd;
120
+ }
121
+
122
+ pre {
123
+ background: #f5f5f5 !important;
124
+ border: 1px solid #ddd !important;
125
+ white-space: pre-wrap;
126
+ word-wrap: break-word;
127
+ }
128
+
129
+ a {
130
+ color: #333;
131
+ text-decoration: underline;
132
+ }
133
+
134
+ @page {
135
+ margin: 2cm;
136
+ }
137
+ }
138
+ </style>
139
+ </head>
140
+ <body>
141
+ <div class="print-page">
142
+ <header class="print-page__header">
143
+ <h1>{{ config.title }}</h1>
144
+ <p class="print-page__meta">
145
+ {{ config.description }}
146
+ <br>
147
+ Generated on {{ now() | date(format="%B %d, %Y") }}
148
+ </p>
149
+ </header>
150
+
151
+ {# Build Table of Contents #}
152
+ <nav class="print-page__toc">
153
+ <h2>Table of Contents</h2>
154
+
155
+ {% set root = get_section(path="_index.md") %}
156
+
157
+ {# Root pages #}
158
+ {% if root.pages | length > 0 %}
159
+ <ol>
160
+ {% for page in root.pages %}
161
+ {% if page.extra.hide_from_toc is not defined or not page.extra.hide_from_toc %}
162
+ {% if page.slug != "print" %}
163
+ <li><a href="#page-{{ page.slug }}">{{ page.title }}</a></li>
164
+ {% endif %}
165
+ {% endif %}
166
+ {% endfor %}
167
+ </ol>
168
+ {% endif %}
169
+
170
+ {# Subsections #}
171
+ {% for subsection_path in root.subsections %}
172
+ {% set subsection = get_section(path=subsection_path) %}
173
+ <div class="print-page__toc-section">
174
+ <div class="print-page__toc-section-title">{{ subsection.title }}</div>
175
+ <ol>
176
+ {% for page in subsection.pages %}
177
+ {% if page.extra.hide_from_toc is not defined or not page.extra.hide_from_toc %}
178
+ <li><a href="#page-{{ page.slug }}">{{ page.title }}</a></li>
179
+ {% endif %}
180
+ {% endfor %}
181
+ </ol>
182
+ </div>
183
+ {% endfor %}
184
+ </nav>
185
+
186
+ {# Render all content #}
187
+ {% set root = get_section(path="_index.md") %}
188
+
189
+ {# Root pages first #}
190
+ {% for page in root.pages %}
191
+ {% if page.extra.hide_from_toc is not defined or not page.extra.hide_from_toc %}
192
+ {% if page.slug != "print" %}
193
+ <article class="print-page__chapter" id="page-{{ page.slug }}">
194
+ <h1>{{ page.title }}</h1>
195
+ {{ page.content | safe }}
196
+ </article>
197
+ {% endif %}
198
+ {% endif %}
199
+ {% endfor %}
200
+
201
+ {# Then each subsection #}
202
+ {% for subsection_path in root.subsections %}
203
+ {% set subsection = get_section(path=subsection_path) %}
204
+ <div class="print-page__section">
205
+ <h2 class="print-page__section-title">{{ subsection.title }}</h2>
206
+
207
+ {% for page in subsection.pages %}
208
+ {% if page.extra.hide_from_toc is not defined or not page.extra.hide_from_toc %}
209
+ <article class="print-page__chapter" id="page-{{ page.slug }}">
210
+ <h1>{{ page.title }}</h1>
211
+ {{ page.content | safe }}
212
+ </article>
213
+ {% endif %}
214
+ {% endfor %}
215
+ </div>
216
+ {% endfor %}
217
+
218
+ <footer class="print-page__footer">
219
+ <p>&copy; {{ now() | date(format="%Y") }} {{ config.extra.author | default(value=config.title) }}</p>
220
+ </footer>
221
+ </div>
222
+
223
+ <script>
224
+ // Auto-print when page loads (if triggered from print button)
225
+ if (window.location.search.includes('auto=true')) {
226
+ window.onload = function() {
227
+ // Close the tab after print dialog is closed (print or cancel)
228
+ window.addEventListener('afterprint', function() {
229
+ window.close();
230
+ });
231
+
232
+ // Trigger print dialog
233
+ window.print();
234
+
235
+ // Fallback for browsers that don't fire afterprint reliably
236
+ // Close after a short delay if still open
237
+ setTimeout(function() {
238
+ window.close();
239
+ }, 1000);
240
+ };
241
+ }
242
+ </script>
243
+ </body>
244
+ </html>