mayura 1.2.0 → 1.2.2

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 (409) hide show
  1. package/README.md +2 -0
  2. package/docs/README.md +17 -4
  3. package/docs/cli/init.md +15 -3
  4. package/docs/concepts/workflows.md +60 -1
  5. package/docs/guides/choosing-a-starter.md +80 -0
  6. package/docs/guides/durable-workflows.md +1 -1
  7. package/docs/guides/framework-starters.md +5 -1
  8. package/docs/guides/hono.md +94 -0
  9. package/docs/guides/nextjs.md +94 -0
  10. package/docs/guides/nuxt.md +94 -0
  11. package/docs/guides/rag-deployment.md +48 -0
  12. package/docs/guides/rag-modal-pinecone-starter.md +63 -0
  13. package/docs/guides/rag-production.md +48 -0
  14. package/docs/guides/rag-quickstart.md +119 -0
  15. package/docs/guides/rag.md +23 -3
  16. package/docs/guides/react-router.md +94 -0
  17. package/docs/guides/release-readiness.md +78 -55
  18. package/docs/guides/sveltekit.md +94 -0
  19. package/docs/guides/tanstack-start.md +94 -0
  20. package/docs/guides/workflow-composition.md +1 -1
  21. package/docs/integrations/reranker-cohere.md +1 -0
  22. package/docs/integrations/reranker-jina.md +1 -0
  23. package/docs/integrations/reranker-voyage.md +1 -0
  24. package/docs/integrations/vector-chroma.md +1 -0
  25. package/docs/integrations/vector-libsql.md +1 -0
  26. package/docs/integrations/vector-pgvector.md +1 -0
  27. package/docs/integrations/vector-pinecone.md +4 -1
  28. package/docs/integrations/vector-qdrant.md +1 -0
  29. package/docs/integrations/vector-weaviate.md +1 -0
  30. package/docs/introduction.md +5 -0
  31. package/docs/project/whats-new.md +70 -2
  32. package/docs/quickstart.md +5 -3
  33. package/lib/adapter-code-docker/image/Dockerfile +1 -1
  34. package/lib/adapter-code-docker/package.json +1 -1
  35. package/lib/adapter-code-quickjs/package.json +1 -1
  36. package/lib/adapter-mcp/package.json +1 -1
  37. package/lib/ag-ui/package.json +1 -1
  38. package/lib/artifacts/package.json +1 -1
  39. package/lib/auth/package.json +1 -1
  40. package/lib/authz/package.json +1 -1
  41. package/lib/browser/package.json +1 -1
  42. package/lib/cli/dist/index.d.ts +1 -1
  43. package/lib/cli/dist/index.d.ts.map +1 -1
  44. package/lib/cli/dist/index.js +63 -20
  45. package/lib/cli/dist/index.js.map +1 -1
  46. package/lib/cli/dist/interactive.js +2 -2
  47. package/lib/cli/dist/interactive.js.map +1 -1
  48. package/lib/cli/dist/operations.d.ts +1 -0
  49. package/lib/cli/dist/operations.d.ts.map +1 -1
  50. package/lib/cli/dist/operations.js +13 -5
  51. package/lib/cli/dist/operations.js.map +1 -1
  52. package/lib/cli/package.json +1 -1
  53. package/lib/cli/src/index.ts +51 -12
  54. package/lib/cli/src/interactive.ts +2 -2
  55. package/lib/cli/src/operations.ts +9 -5
  56. package/lib/cli/starter-assets/manifest.json +1 -0
  57. package/lib/cli/starters/hono/package.json +2 -2
  58. package/lib/cli/starters/rag-modal-pinecone/README.md +60 -0
  59. package/lib/cli/starters/rag-modal-pinecone/dot-env.example +23 -0
  60. package/lib/cli/starters/{event-automation → rag-modal-pinecone}/dot-gitignore +2 -4
  61. package/lib/cli/starters/rag-modal-pinecone/fixtures/on-call.md +4 -0
  62. package/lib/cli/starters/rag-modal-pinecone/mayura.project.json +13 -0
  63. package/lib/cli/starters/rag-modal-pinecone/modal-app.py +110 -0
  64. package/lib/cli/starters/rag-modal-pinecone/package.json +28 -0
  65. package/lib/cli/starters/rag-modal-pinecone/src/application.ts +148 -0
  66. package/lib/cli/starters/rag-modal-pinecone/src/cli.ts +78 -0
  67. package/lib/cli/starters/rag-modal-pinecone/src/hosted.ts +137 -0
  68. package/lib/cli/starters/rag-modal-pinecone/test/modal_worker_test.py +53 -0
  69. package/lib/cli/starters/rag-modal-pinecone/test/pipeline.test.ts +137 -0
  70. package/lib/cli/starters/{cli-agent → rag-modal-pinecone}/tsconfig.json +0 -1
  71. package/lib/client/dist/index.d.ts.map +1 -1
  72. package/lib/client/dist/index.js +12 -4
  73. package/lib/client/dist/index.js.map +1 -1
  74. package/lib/client/dist/workflow-limits.d.ts +6 -0
  75. package/lib/client/dist/workflow-limits.d.ts.map +1 -0
  76. package/lib/client/dist/workflow-limits.js +15 -0
  77. package/lib/client/dist/workflow-limits.js.map +1 -0
  78. package/lib/client/dist/workflows.d.ts +3 -0
  79. package/lib/client/dist/workflows.d.ts.map +1 -1
  80. package/lib/client/dist/workflows.js +15 -7
  81. package/lib/client/dist/workflows.js.map +1 -1
  82. package/lib/client/package.json +1 -1
  83. package/lib/client/src/index.ts +7 -4
  84. package/lib/client/src/workflow-limits.ts +12 -0
  85. package/lib/client/src/workflows.ts +12 -6
  86. package/lib/client-react/package.json +1 -1
  87. package/lib/code-mode/package.json +1 -1
  88. package/lib/code-mode-workflows/package.json +1 -1
  89. package/lib/context/package.json +1 -1
  90. package/lib/core/dist/host.d.ts +1 -0
  91. package/lib/core/dist/host.d.ts.map +1 -1
  92. package/lib/core/dist/host.js +1 -0
  93. package/lib/core/dist/host.js.map +1 -1
  94. package/lib/core/dist/index.d.ts +1 -0
  95. package/lib/core/dist/index.d.ts.map +1 -1
  96. package/lib/core/dist/index.js +1 -0
  97. package/lib/core/dist/index.js.map +1 -1
  98. package/lib/core/dist/workflow-environment.d.ts +9 -0
  99. package/lib/core/dist/workflow-environment.d.ts.map +1 -0
  100. package/lib/core/dist/workflow-environment.js +15 -0
  101. package/lib/core/dist/workflow-environment.js.map +1 -0
  102. package/lib/core/dist/workflow-limits.d.ts +7 -0
  103. package/lib/core/dist/workflow-limits.d.ts.map +1 -0
  104. package/lib/core/dist/workflow-limits.js +17 -0
  105. package/lib/core/dist/workflow-limits.js.map +1 -0
  106. package/lib/core/package.json +1 -1
  107. package/lib/core/src/host.ts +1 -0
  108. package/lib/core/src/index.ts +1 -0
  109. package/lib/core/src/workflow-environment.ts +15 -0
  110. package/lib/core/src/workflow-limits.ts +16 -0
  111. package/lib/exporter-otlp/dist/otlp-http-json.js +1 -1
  112. package/lib/exporter-otlp/dist/otlp-http-json.js.map +1 -1
  113. package/lib/exporter-otlp/dist/signals.js +2 -2
  114. package/lib/exporter-otlp/dist/signals.js.map +1 -1
  115. package/lib/exporter-otlp/package.json +1 -1
  116. package/lib/exporter-otlp/src/otlp-http-json.ts +1 -1
  117. package/lib/exporter-otlp/src/signals.ts +2 -2
  118. package/lib/files/package.json +1 -1
  119. package/lib/guardrails/package.json +1 -1
  120. package/lib/helpers/package.json +1 -1
  121. package/lib/keys/package.json +1 -1
  122. package/lib/memory/package.json +1 -1
  123. package/lib/memory-remote/package.json +1 -1
  124. package/lib/observability/package.json +1 -1
  125. package/lib/provider-anthropic/package.json +1 -1
  126. package/lib/provider-openai/package.json +1 -1
  127. package/lib/rag/dist/bm25.d.ts +13 -0
  128. package/lib/rag/dist/bm25.d.ts.map +1 -0
  129. package/lib/rag/dist/bm25.js +76 -0
  130. package/lib/rag/dist/bm25.js.map +1 -0
  131. package/lib/rag/dist/document-lexical.d.ts +7 -0
  132. package/lib/rag/dist/document-lexical.d.ts.map +1 -0
  133. package/lib/rag/dist/document-lexical.js +33 -0
  134. package/lib/rag/dist/document-lexical.js.map +1 -0
  135. package/lib/rag/dist/evidence-window.d.ts +15 -0
  136. package/lib/rag/dist/evidence-window.d.ts.map +1 -0
  137. package/lib/rag/dist/evidence-window.js +52 -0
  138. package/lib/rag/dist/evidence-window.js.map +1 -0
  139. package/lib/rag/dist/retrieval.d.ts +6 -0
  140. package/lib/rag/dist/retrieval.d.ts.map +1 -1
  141. package/lib/rag/dist/retrieval.js +60 -6
  142. package/lib/rag/dist/retrieval.js.map +1 -1
  143. package/lib/rag/dist/vectors.d.ts +8 -0
  144. package/lib/rag/dist/vectors.d.ts.map +1 -1
  145. package/lib/rag/dist/vectors.js +121 -4
  146. package/lib/rag/dist/vectors.js.map +1 -1
  147. package/lib/rag/package.json +1 -1
  148. package/lib/rag/src/bm25.ts +35 -0
  149. package/lib/rag/src/document-lexical.ts +17 -0
  150. package/lib/rag/src/evidence-window.ts +41 -0
  151. package/lib/rag/src/retrieval.ts +56 -7
  152. package/lib/rag/src/vectors.ts +62 -4
  153. package/lib/runtime/package.json +1 -1
  154. package/lib/sandbox/package.json +1 -1
  155. package/lib/sdk/package.json +1 -1
  156. package/lib/server/dist/index.d.ts +2 -0
  157. package/lib/server/dist/index.d.ts.map +1 -1
  158. package/lib/server/dist/index.js +12 -4
  159. package/lib/server/dist/index.js.map +1 -1
  160. package/lib/server/dist/inspector-bundle.d.ts +1 -1
  161. package/lib/server/dist/inspector-bundle.d.ts.map +1 -1
  162. package/lib/server/dist/inspector-bundle.js +4 -4
  163. package/lib/server/dist/inspector-bundle.js.map +1 -1
  164. package/lib/server/package.json +1 -1
  165. package/lib/server/src/index.ts +9 -4
  166. package/lib/server/src/inspector-bundle.ts +4 -4
  167. package/lib/server-node/package.json +1 -1
  168. package/lib/skills/package.json +1 -1
  169. package/lib/storage/package.json +1 -1
  170. package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts +2 -0
  171. package/lib/storage-contracts/dist/scheduled-workflow-contracts.d.ts.map +1 -1
  172. package/lib/storage-contracts/dist/scheduled-workflow-contracts.js.map +1 -1
  173. package/lib/storage-contracts/dist/workflow-format2.d.ts +2 -0
  174. package/lib/storage-contracts/dist/workflow-format2.d.ts.map +1 -1
  175. package/lib/storage-contracts/dist/workflow-format2.js +8 -7
  176. package/lib/storage-contracts/dist/workflow-format2.js.map +1 -1
  177. package/lib/storage-contracts/dist/workflow-format3.d.ts.map +1 -1
  178. package/lib/storage-contracts/dist/workflow-format3.js +9 -7
  179. package/lib/storage-contracts/dist/workflow-format3.js.map +1 -1
  180. package/lib/storage-contracts/dist/workflow-format4.d.ts +2 -0
  181. package/lib/storage-contracts/dist/workflow-format4.d.ts.map +1 -1
  182. package/lib/storage-contracts/dist/workflow-format4.js +9 -8
  183. package/lib/storage-contracts/dist/workflow-format4.js.map +1 -1
  184. package/lib/storage-contracts/dist/workflow-format5.d.ts +4 -0
  185. package/lib/storage-contracts/dist/workflow-format5.d.ts.map +1 -1
  186. package/lib/storage-contracts/dist/workflow-format5.js +9 -8
  187. package/lib/storage-contracts/dist/workflow-format5.js.map +1 -1
  188. package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts +2 -0
  189. package/lib/storage-contracts/dist/workflow-graph-contracts.d.ts.map +1 -1
  190. package/lib/storage-contracts/dist/workflow-graph-contracts.js.map +1 -1
  191. package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts +2 -0
  192. package/lib/storage-contracts/dist/workflow-tree-contracts.d.ts.map +1 -1
  193. package/lib/storage-contracts/dist/workflow-tree-contracts.js +5 -3
  194. package/lib/storage-contracts/dist/workflow-tree-contracts.js.map +1 -1
  195. package/lib/storage-contracts/package.json +1 -1
  196. package/lib/storage-contracts/src/scheduled-workflow-contracts.ts +2 -0
  197. package/lib/storage-contracts/src/workflow-format2.ts +10 -7
  198. package/lib/storage-contracts/src/workflow-format3.ts +9 -7
  199. package/lib/storage-contracts/src/workflow-format4.ts +11 -8
  200. package/lib/storage-contracts/src/workflow-format5.ts +13 -8
  201. package/lib/storage-contracts/src/workflow-graph-contracts.ts +2 -0
  202. package/lib/storage-contracts/src/workflow-tree-contracts.ts +7 -3
  203. package/lib/storage-postgres/package.json +1 -1
  204. package/lib/storage-sql/dist/scheduled-database.js +1 -1
  205. package/lib/storage-sql/dist/scheduled-database.js.map +1 -1
  206. package/lib/storage-sql/dist/workflow-tree-database.d.ts.map +1 -1
  207. package/lib/storage-sql/dist/workflow-tree-database.js +37 -1
  208. package/lib/storage-sql/dist/workflow-tree-database.js.map +1 -1
  209. package/lib/storage-sql/package.json +1 -1
  210. package/lib/storage-sql/src/scheduled-database.ts +1 -1
  211. package/lib/storage-sql/src/workflow-tree-database.ts +15 -1
  212. package/lib/storage-sqlite/package.json +1 -1
  213. package/lib/terminal/package.json +1 -1
  214. package/lib/testing/package.json +1 -1
  215. package/lib/threads/package.json +1 -1
  216. package/lib/tools/package.json +1 -1
  217. package/lib/voice/package.json +1 -1
  218. package/lib/workflows/dist/children-definition.d.ts +5 -1
  219. package/lib/workflows/dist/children-definition.d.ts.map +1 -1
  220. package/lib/workflows/dist/children-definition.js +6 -2
  221. package/lib/workflows/dist/children-definition.js.map +1 -1
  222. package/lib/workflows/dist/children-runtime.d.ts.map +1 -1
  223. package/lib/workflows/dist/children-runtime.js +4 -3
  224. package/lib/workflows/dist/children-runtime.js.map +1 -1
  225. package/lib/workflows/dist/definition.d.ts +4 -0
  226. package/lib/workflows/dist/definition.d.ts.map +1 -1
  227. package/lib/workflows/dist/definition.js +6 -3
  228. package/lib/workflows/dist/definition.js.map +1 -1
  229. package/lib/workflows/dist/graph-definition.d.ts +5 -1
  230. package/lib/workflows/dist/graph-definition.d.ts.map +1 -1
  231. package/lib/workflows/dist/graph-definition.js +8 -4
  232. package/lib/workflows/dist/graph-definition.js.map +1 -1
  233. package/lib/workflows/dist/lifecycle-definition.d.ts +5 -1
  234. package/lib/workflows/dist/lifecycle-definition.d.ts.map +1 -1
  235. package/lib/workflows/dist/lifecycle-definition.js +5 -2
  236. package/lib/workflows/dist/lifecycle-definition.js.map +1 -1
  237. package/lib/workflows/dist/lifecycle-runtime.d.ts.map +1 -1
  238. package/lib/workflows/dist/lifecycle-runtime.js +4 -5
  239. package/lib/workflows/dist/lifecycle-runtime.js.map +1 -1
  240. package/lib/workflows/dist/node-batches.d.ts +9 -0
  241. package/lib/workflows/dist/node-batches.d.ts.map +1 -0
  242. package/lib/workflows/dist/node-batches.js +19 -0
  243. package/lib/workflows/dist/node-batches.js.map +1 -0
  244. package/lib/workflows/dist/operator-transports.d.ts +1 -0
  245. package/lib/workflows/dist/operator-transports.d.ts.map +1 -1
  246. package/lib/workflows/dist/operator-transports.js +1 -0
  247. package/lib/workflows/dist/operator-transports.js.map +1 -1
  248. package/lib/workflows/dist/runtime.d.ts.map +1 -1
  249. package/lib/workflows/dist/runtime.js +6 -7
  250. package/lib/workflows/dist/runtime.js.map +1 -1
  251. package/lib/workflows/dist/scheduled-helpers.d.ts.map +1 -1
  252. package/lib/workflows/dist/scheduled-helpers.js +3 -2
  253. package/lib/workflows/dist/scheduled-helpers.js.map +1 -1
  254. package/lib/workflows/dist/scheduled.d.ts.map +1 -1
  255. package/lib/workflows/dist/scheduled.js +2 -1
  256. package/lib/workflows/dist/scheduled.js.map +1 -1
  257. package/lib/workflows/package.json +1 -1
  258. package/lib/workflows/src/children-definition.ts +10 -3
  259. package/lib/workflows/src/children-runtime.ts +3 -2
  260. package/lib/workflows/src/definition.ts +9 -2
  261. package/lib/workflows/src/graph-definition.ts +10 -3
  262. package/lib/workflows/src/lifecycle-definition.ts +10 -3
  263. package/lib/workflows/src/lifecycle-runtime.ts +4 -4
  264. package/lib/workflows/src/node-batches.ts +21 -0
  265. package/lib/workflows/src/operator-transports.ts +3 -1
  266. package/lib/workflows/src/runtime.ts +6 -6
  267. package/lib/workflows/src/scheduled-helpers.ts +3 -2
  268. package/lib/workflows/src/scheduled.ts +2 -1
  269. package/lib/workstream/package.json +1 -1
  270. package/llms-full.txt +1442 -281
  271. package/llms.txt +17 -3
  272. package/package.json +4 -4
  273. package/lib/cli/starters/cli-agent/dot-github/workflows/ci.yml +0 -13
  274. package/lib/cli/starters/cli-agent/dot-gitignore +0 -10
  275. package/lib/cli/starters/event-automation/dot-dockerignore +0 -7
  276. package/lib/cli/starters/event-automation/dot-github/workflows/ci.yml +0 -13
  277. package/lib/cli/starters/event-automation/src/model.ts +0 -40
  278. package/lib/cli/starters/event-automation/tsconfig.json +0 -20
  279. package/lib/cli/starters/nextjs/Dockerfile +0 -12
  280. package/lib/cli/starters/nextjs/compose.yaml +0 -19
  281. package/lib/cli/starters/nextjs/dot-dockerignore +0 -11
  282. package/lib/cli/starters/nextjs/dot-env.example +0 -7
  283. package/lib/cli/starters/nextjs/scripts/setup.mjs +0 -9
  284. package/lib/cli/starters/nextjs/server/application.mjs +0 -74
  285. package/lib/cli/starters/nextjs/server/auth.mjs +0 -24
  286. package/lib/cli/starters/nextjs/server/worker.mjs +0 -11
  287. package/lib/cli/starters/nextjs/server/workflows.mjs +0 -23
  288. package/lib/cli/starters/nextjs/src/ChatApp.jsx +0 -57
  289. package/lib/cli/starters/nextjs/src/Notebook.jsx +0 -25
  290. package/lib/cli/starters/nextjs/src/components/mayura/approval.tsx +0 -142
  291. package/lib/cli/starters/nextjs/src/components/mayura/thread-history.tsx +0 -142
  292. package/lib/cli/starters/nextjs/src/components/mayura/thread-list.tsx +0 -9
  293. package/lib/cli/starters/nextjs/src/components/mayura/ui.css +0 -14
  294. package/lib/cli/starters/nextjs/src/connect.js +0 -21
  295. package/lib/cli/starters/nextjs/src/session.js +0 -138
  296. package/lib/cli/starters/nextjs/src/style.css +0 -11
  297. package/lib/cli/starters/nextjs/test/server.test.mjs +0 -95
  298. package/lib/cli/starters/nextjs/test/session.test.mjs +0 -16
  299. package/lib/cli/starters/nuxt/compose.yaml +0 -19
  300. package/lib/cli/starters/nuxt/dot-dockerignore +0 -11
  301. package/lib/cli/starters/nuxt/dot-env.example +0 -7
  302. package/lib/cli/starters/nuxt/dot-gitignore +0 -14
  303. package/lib/cli/starters/nuxt/scripts/setup.mjs +0 -9
  304. package/lib/cli/starters/nuxt/server/application.mjs +0 -74
  305. package/lib/cli/starters/nuxt/server/auth.mjs +0 -24
  306. package/lib/cli/starters/nuxt/server/worker.mjs +0 -11
  307. package/lib/cli/starters/nuxt/server/workflows.mjs +0 -23
  308. package/lib/cli/starters/nuxt/src/connect.js +0 -21
  309. package/lib/cli/starters/nuxt/src/session.js +0 -138
  310. package/lib/cli/starters/nuxt/src/style.css +0 -11
  311. package/lib/cli/starters/nuxt/test/server.test.mjs +0 -95
  312. package/lib/cli/starters/nuxt/test/session.test.mjs +0 -16
  313. package/lib/cli/starters/react-router/Dockerfile +0 -12
  314. package/lib/cli/starters/react-router/compose.yaml +0 -19
  315. package/lib/cli/starters/react-router/dot-dockerignore +0 -11
  316. package/lib/cli/starters/react-router/dot-env.example +0 -7
  317. package/lib/cli/starters/react-router/dot-gitignore +0 -14
  318. package/lib/cli/starters/react-router/scripts/setup.mjs +0 -9
  319. package/lib/cli/starters/react-router/server/application.mjs +0 -74
  320. package/lib/cli/starters/react-router/server/auth.mjs +0 -24
  321. package/lib/cli/starters/react-router/server/worker.mjs +0 -11
  322. package/lib/cli/starters/react-router/server/workflows.mjs +0 -23
  323. package/lib/cli/starters/react-router/src/ChatApp.jsx +0 -57
  324. package/lib/cli/starters/react-router/src/Notebook.jsx +0 -25
  325. package/lib/cli/starters/react-router/src/components/mayura/approval.tsx +0 -142
  326. package/lib/cli/starters/react-router/src/components/mayura/thread-history.tsx +0 -142
  327. package/lib/cli/starters/react-router/src/components/mayura/thread-list.tsx +0 -9
  328. package/lib/cli/starters/react-router/src/components/mayura/ui.css +0 -14
  329. package/lib/cli/starters/react-router/src/connect.js +0 -21
  330. package/lib/cli/starters/react-router/src/session.js +0 -138
  331. package/lib/cli/starters/react-router/src/style.css +0 -11
  332. package/lib/cli/starters/react-router/src/vite-env.d.ts +0 -1
  333. package/lib/cli/starters/react-router/test/server.test.mjs +0 -95
  334. package/lib/cli/starters/react-router/test/session.test.mjs +0 -16
  335. package/lib/cli/starters/research-team/dot-dockerignore +0 -7
  336. package/lib/cli/starters/research-team/dot-github/workflows/ci.yml +0 -13
  337. package/lib/cli/starters/research-team/dot-gitignore +0 -10
  338. package/lib/cli/starters/research-team/src/model.ts +0 -40
  339. package/lib/cli/starters/research-team/tsconfig.json +0 -20
  340. package/lib/cli/starters/support-agent/dot-dockerignore +0 -7
  341. package/lib/cli/starters/support-agent/dot-github/workflows/ci.yml +0 -13
  342. package/lib/cli/starters/support-agent/dot-gitignore +0 -10
  343. package/lib/cli/starters/support-agent/src/model.ts +0 -40
  344. package/lib/cli/starters/support-agent/tsconfig.json +0 -20
  345. package/lib/cli/starters/sveltekit/Dockerfile +0 -12
  346. package/lib/cli/starters/sveltekit/compose.yaml +0 -19
  347. package/lib/cli/starters/sveltekit/dot-dockerignore +0 -11
  348. package/lib/cli/starters/sveltekit/dot-env.example +0 -7
  349. package/lib/cli/starters/sveltekit/dot-gitignore +0 -14
  350. package/lib/cli/starters/sveltekit/scripts/setup.mjs +0 -9
  351. package/lib/cli/starters/sveltekit/server/application.mjs +0 -74
  352. package/lib/cli/starters/sveltekit/server/auth.mjs +0 -24
  353. package/lib/cli/starters/sveltekit/server/worker.mjs +0 -11
  354. package/lib/cli/starters/sveltekit/server/workflows.mjs +0 -23
  355. package/lib/cli/starters/sveltekit/src/connect.js +0 -21
  356. package/lib/cli/starters/sveltekit/src/session.js +0 -138
  357. package/lib/cli/starters/sveltekit/src/style.css +0 -11
  358. package/lib/cli/starters/sveltekit/src/view.js +0 -49
  359. package/lib/cli/starters/sveltekit/test/server.test.mjs +0 -95
  360. package/lib/cli/starters/sveltekit/test/session.test.mjs +0 -16
  361. package/lib/cli/starters/tanstack-start/Dockerfile +0 -12
  362. package/lib/cli/starters/tanstack-start/compose.yaml +0 -19
  363. package/lib/cli/starters/tanstack-start/dot-dockerignore +0 -11
  364. package/lib/cli/starters/tanstack-start/dot-env.example +0 -7
  365. package/lib/cli/starters/tanstack-start/dot-gitignore +0 -14
  366. package/lib/cli/starters/tanstack-start/scripts/setup.mjs +0 -9
  367. package/lib/cli/starters/tanstack-start/server/application.mjs +0 -74
  368. package/lib/cli/starters/tanstack-start/server/auth.mjs +0 -24
  369. package/lib/cli/starters/tanstack-start/server/worker.mjs +0 -11
  370. package/lib/cli/starters/tanstack-start/server/workflows.mjs +0 -23
  371. package/lib/cli/starters/tanstack-start/src/ChatApp.jsx +0 -57
  372. package/lib/cli/starters/tanstack-start/src/Notebook.jsx +0 -25
  373. package/lib/cli/starters/tanstack-start/src/components/mayura/approval.tsx +0 -142
  374. package/lib/cli/starters/tanstack-start/src/components/mayura/thread-history.tsx +0 -142
  375. package/lib/cli/starters/tanstack-start/src/components/mayura/thread-list.tsx +0 -9
  376. package/lib/cli/starters/tanstack-start/src/components/mayura/ui.css +0 -14
  377. package/lib/cli/starters/tanstack-start/src/connect.js +0 -21
  378. package/lib/cli/starters/tanstack-start/src/session.js +0 -138
  379. package/lib/cli/starters/tanstack-start/src/style.css +0 -11
  380. package/lib/cli/starters/tanstack-start/test/server.test.mjs +0 -95
  381. package/lib/cli/starters/tanstack-start/test/session.test.mjs +0 -16
  382. /package/lib/cli/{starters/hono/src/components/mayura/ui.css → starter-assets/011cacc77ada0de5b447674e9fc4374a247b9a46eb169722b12649753f24188f} +0 -0
  383. /package/lib/cli/{starters/hono/test/server.test.mjs → starter-assets/0c825d6a776673ec6274cfc29cd45b1a8c56dcb880c291a91075c77e1ef1e4f3} +0 -0
  384. /package/lib/cli/{starters/hono/server/auth.mjs → starter-assets/0dd570bfacc357d23be3340250090b9a4c6193a49cdd02e9b6789e7bee8433dd} +0 -0
  385. /package/lib/cli/{starters/hono/src/components/mayura/approval.tsx → starter-assets/11292bd14cdaf27a8f8317ba4ab768d706a726b2e26474b599f3db116674b4b3} +0 -0
  386. /package/lib/cli/{starters/nextjs/dot-gitignore → starter-assets/1873b02e070347f9a449e07084242982fa6af412c45aa764985d553975b64589} +0 -0
  387. /package/lib/cli/{starters/hono/src/style.css → starter-assets/2f3869e6d69134e43be713c4590bfe48896a5c54ece6ffc1a4f204cfcfe54218} +0 -0
  388. /package/lib/cli/{starters/hono/server/worker.mjs → starter-assets/350d77757f548369beff29d658cf1620752d4e23b4b732d99a1b403ca043137f} +0 -0
  389. /package/lib/cli/{starters/approval-workflow/src/model.ts → starter-assets/37294d24c04b71eaf6d6f0bd52fd4c1cc7a5d3cb63da9c7920ed1d44276da9cb} +0 -0
  390. /package/lib/cli/{starters/approval-workflow/tsconfig.json → starter-assets/4387d6537dd5924ae62326aa3d7d8cbad1e5abd930aecc9daa6fab1ac2f6ef24} +0 -0
  391. /package/lib/cli/{starters/hono/dot-dockerignore → starter-assets/4434be031b58cc6ee680b2860b2ad1fe4089af7ee866c13223dfb621dd042ff1} +0 -0
  392. /package/lib/cli/{starters/hono/src/ChatApp.jsx → starter-assets/46e199317648a076243d6c8e7ffedc48785a6ffc0f203b88c7c4a9479b34c5b9} +0 -0
  393. /package/lib/cli/{starters/hono/src/components/mayura/thread-history.tsx → starter-assets/4741fccbca2e0d2fc6f61d11af3cf7bcc5f0238b67bb46282287207abdc6c536} +0 -0
  394. /package/lib/cli/{starters/approval-workflow/dot-dockerignore → starter-assets/4be664708b0120da5d2b73c5a27968093da06b8728f88f2bda2a1ccbf40f6891} +0 -0
  395. /package/lib/cli/{starters/hono/server/workflows.mjs → starter-assets/4d11f729672df54969a851494877a3c5aee24bb8f8c68eacaaa22e715bf5ed69} +0 -0
  396. /package/lib/cli/{starters/hono/dot-env.example → starter-assets/4f141323062660c4dc5b563300d57bb4cdbdc7fe9bfba96e43d9c64bb274474e} +0 -0
  397. /package/lib/cli/{starters/hono/Dockerfile → starter-assets/5471b74c46258d1edb00eb8f60f4219c389a252f7e224f2692f8f3e71ae43e3e} +0 -0
  398. /package/lib/cli/{starters/hono/scripts/setup.mjs → starter-assets/56e2d6db9fe4b0449c979acd06947a5b776bcc645184b54b8d3654a48bd12c38} +0 -0
  399. /package/lib/cli/{starters/hono/src/Notebook.jsx → starter-assets/6138d1e2ca4469daf4f5545d140943f6e23b0c37f865051b266ec99695cf181a} +0 -0
  400. /package/lib/cli/{starters/hono/src/vite-env.d.ts → starter-assets/65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5} +0 -0
  401. /package/lib/cli/{starters/hono/server/application.mjs → starter-assets/757f43c27415654049ecf01b67d560c83d788108d1aebcf1f16a86d956bd7fb6} +0 -0
  402. /package/lib/cli/{starters/hono/src/components/mayura/thread-list.tsx → starter-assets/97601d0bf331df7bbde88f7ee269610bc8a1239f8eeb58fded6416e588a5b7dd} +0 -0
  403. /package/lib/cli/{starters/approval-workflow/dot-github/workflows/ci.yml → starter-assets/aa4182c76778ba2194ecbfde9a960c20181534fd1ab484df126278dbc6eb0186} +0 -0
  404. /package/lib/cli/{starters/hono/src/session.js → starter-assets/abcc6ebd29ba47a079befb6568054dec8f43d4c729187e4a3610af39789e77be} +0 -0
  405. /package/lib/cli/{starters/hono/compose.yaml → starter-assets/cc1df6f5ce0eebffc567ecea1d599eba97cd1b94ab01551085c0eb87a28e3a6c} +0 -0
  406. /package/lib/cli/{starters/hono/src/connect.js → starter-assets/cd3ddb959b277e7d495cc020a6f8146acfbcc9d05ececa3809e8aafcf84504d9} +0 -0
  407. /package/lib/cli/{starters/hono/test/session.test.mjs → starter-assets/dfe75fd07538427d80ba76767e037e929664c80ff5a41b7544496a789181bb73} +0 -0
  408. /package/lib/cli/{starters/approval-workflow/dot-gitignore → starter-assets/f3ef7285253ec9668732f535306beee602e91cb6e20f83d4799b3323399ce569} +0 -0
  409. /package/lib/cli/{starters/nuxt/src/view.js → starter-assets/ff840fe960683d377e78f731b5d4318adf6050384791fa20e4948d34192aa35d} +0 -0
package/llms-full.txt CHANGED
@@ -22,6 +22,11 @@ points you import only when you need them, and other services (more model provid
22
22
  hosted sandboxes and browsers, identity providers, observability services and deploy targets) come as optional
23
23
  [`@mayurajs/*` packages](reference/integrations.md).
24
24
 
25
+ V1.2 adds persistent conversations, exact tool approvals, agent handoffs and fine-grained authorization.
26
+ Start with one of the [six framework notebooks](guides/framework-starters.md), or
27
+ [choose another application starter](guides/choosing-a-starter.md). The
28
+ [release overview](project/whats-new.md) covers the 105 extensions, the qualified RAG profile and experimental AG-UI.
29
+
25
30
  ## The building blocks
26
31
 
27
32
  | Block | What it is | Start here |
@@ -104,8 +109,8 @@ npx mayura init
104
109
 
105
110
  The wizard asks three things:
106
111
 
107
- 1. **A starter or a template.** Starters are complete projects with tests: four are servers with a worker, a UI and
108
- deployment files, and one (`cli-agent`) is an assistant you run in your terminal. Templates are single files that show one feature.
112
+ 1. **A starter or a template.** Choose from four server applications, six framework notebooks with persistent chat
113
+ and exact approvals, or the `cli-agent` terminal assistant. Templates are small projects showing one feature.
109
114
  2. **A model provider.** Offline (no key needed; rule-based stand-in models), OpenAI, Anthropic, an
110
115
  OpenAI-compatible provider such as Groq, Gemini, Mistral, DeepSeek, xAI, OpenRouter, Together or Fireworks, Azure
111
116
  OpenAI, or any other compatible endpoint.
@@ -120,7 +125,9 @@ npm install
120
125
  npm run dev
121
126
  ```
122
127
 
123
- `npm run dev` runs `mayura dev`: it builds the project, starts it, and rebuilds and restarts whenever you save. See
128
+ For the server starters, `npm run dev` runs `mayura dev`: it builds, starts and watches the project. Framework
129
+ notebooks have their own dev server and first need `npm run setup` for a local session. Follow
130
+ [Choose a starter](guides/choosing-a-starter.md) and the generated README for the right sequence, or
124
131
  [mayura init](cli/init.md) for every starter and template.
125
132
 
126
133
  ## Option 2: add Mayura to your project
@@ -390,47 +397,84 @@ assistants, matching the exact version you installed. See [Using Mayura with AI
390
397
 
391
398
  ---
392
399
 
393
- # V1.2 release validation status
400
+ # V1.2.1 release validation status
394
401
 
395
402
  Source: docs/guides/release-readiness.md
396
403
 
397
- Completed local and CI qualification, experimental surfaces and the checks still required before releasing Mayura V1.2.
404
+ Verified publication of all 106 packages, the scoped production RAG qualification, and remaining interoperability limits.
405
+
406
+ ## V1.2.1 publication
407
+
408
+ **1.2.1 was published on November 23, 2026.** The [qualification on main](https://github.com/KartikeyAI/mayura/actions/runs/45084310737)
409
+ passed all 39 jobs at `ff69ac1e559b4360f2befffe35f13aece1b4ba89`. The
410
+ [106-package rehearsal](https://github.com/KartikeyAI/mayura/actions/runs/45087206578) passed on the same commit.
411
+ The [protected publication](https://github.com/KartikeyAI/mayura/actions/runs/45088101597) published all 106 packages
412
+ under `latest` with npm trusted publishing. All tarball hashes and provenance were verified, and all 22 existing
413
+ `next` tags were preserved. The [V1.2.1 GitHub release](https://github.com/KartikeyAI/mayura/releases/tag/v1.2.1)
414
+ retains the manifests and publication receipt.
415
+
416
+ The [Modal and Pinecone Loki v28 profile](rag-production.md) passed production RAG qualification for its
417
+ registered workload. Other RAG profiles and the bounded AG-UI profile remain experimental.
398
418
 
399
- Stable V1.2 is prepared for review and is not yet published. The implementation and full-release safeguards are
400
- merged into `main`, whose full qualification passed on **2026-10-23** at
401
- `a9b5c565167170e4b35b5f42cf7df58a64b485e8`. The coordinated **1.2.0** version PR needs its own qualification and
402
- green main checks after merging. The reviewed 22-package set was previously published as
403
- **1.2.0-rc.1 under `next`**, through trusted publishing, with all existing `latest` tags unchanged. The local and
404
- earlier release-branch snapshots below remain historical evidence; none establishes interoperability with
405
- unqualified real external services.
419
+ ## V1.2.0 publication history
420
+
421
+ Stable **1.2.0 was published on 2026-10-23** for `mayura` and all **105 extensions** under `latest`, through
422
+ `release.yml` and the protected `release` environment using npm trusted publishing. All **106 packages** have
423
+ verified archive integrity and provenance, and every existing `next` tag was preserved. The
424
+ [stable GitHub Release and v1.2.0 tag](https://github.com/KartikeyAI/mayura/releases/tag/v1.2.0) identify the qualified
425
+ source commit, `ac32daa412d7209066530cfdc9542d820d054b86`.
426
+ The local and earlier release-branch snapshots below remain historical evidence; publication does not establish
427
+ interoperability with unqualified real external services.
406
428
 
407
429
  ## Completed CI qualification
408
430
 
409
- The [main qualification run 39903621300](https://github.com/KartikeyAI/mayura/actions/runs/39903621300) passed all
431
+ The [main qualification run 39928903180](https://github.com/KartikeyAI/mayura/actions/runs/39928903180) passed all
410
432
  **39 jobs**, including the required **Qualification gate**: shared checks, six OS/Node consumer lanes, 12 unit-test
411
433
  shards, 12 bundle shards, four database integration shards, shared runtimes and two container lanes. Linux, macOS and
412
434
  Windows retain Node 22.23.2 and 24.14.1 coverage. Branch protection requires the aggregate gate. The
413
- [main website run 39903621303](https://github.com/KartikeyAI/mayura/actions/runs/39903621303) also passed.
414
-
415
- [PR #21](https://github.com/KartikeyAI/mayura/pull/21) passed all 39 qualification jobs before merging at the main
416
- commit above. The full publisher now requires a committed version, exact-main qualification and source-bound
417
- archive/receipt verification, and creates only the version tag and GitHub Release after publication. It does not
418
- commit, rebase or push main. A local 1.2.0 rehearsal passed build, upgrade from V1.1.0, all 106 archive checks,
419
- 450-component SBOM checks with no license findings, and 106 offline npm dry runs. These local archives are rehearsal
420
- evidence, not the final stable publication artifacts.
435
+ [main website run 39914438301](https://github.com/KartikeyAI/mayura/actions/runs/39914438301) also passed at the
436
+ version-preparation commit `0ba32b038ba8b8a8de6b40e1f4781f36f6a9ba00`, before the final workflow/test-fixture follow-up.
437
+
438
+ [PR #22](https://github.com/KartikeyAI/mayura/pull/22) prepared the coordinated version and
439
+ [PR #23](https://github.com/KartikeyAI/mayura/pull/23) corrected artifact retention and a Windows graph stress fixture.
440
+ Each passed all 39 qualification jobs before merging. The final main run above qualifies the published source.
441
+ The full publisher requires a committed version, exact-main qualification and source-bound archive/receipt
442
+ verification, and creates only the version tag and GitHub Release after publication. It does not commit, rebase or
443
+ push main.
444
+
445
+ The [full workflow rehearsal 39932634159](https://github.com/KartikeyAI/mayura/actions/runs/39932634159) passed at
446
+ that same source with `version=1.2.0`, `package_set=all` and `dry_run=true`: build, upgrade from V1.1.0, all 106 archive
447
+ checks, 450-component SBOM checks with no license findings, and 106 offline npm dry runs. Its downloaded
448
+ `release-rehearsal-1.2.0` artifact was verified independently. This rehearsal preceded live publication.
449
+
450
+ ## Completed stable publication
451
+
452
+ The [stable release run 39934428405](https://github.com/KartikeyAI/mayura/actions/runs/39934428405) succeeded with
453
+ `version=1.2.0`, `package_set=all` and `dry_run=false`, after approval of the protected `release` environment.
454
+ All **106 OIDC uploads were accepted** and the publisher verified all versions, provenance and distribution tags
455
+ before creating the source-bound `v1.2.0` tag and stable GitHub Release. This establishes successful trusted publishing
456
+ for every package, superseding the earlier 22-package RC-only evidence and 84 configuration-only readbacks.
457
+
458
+ Independent public registry checks confirmed all 106 package identities and versions, SHA-512 archive integrity,
459
+ provenance and `latest=1.2.0` against the saved publication archives and receipt. Every `next` value matched the
460
+ pre-publication baseline: the reviewed 22-package set remains at `1.2.0-rc.1`, and packages without `next` still have
461
+ no such tag. Stable publication did not promote or replace the prerelease channel.
462
+
463
+ The [release evidence artifact](https://github.com/KartikeyAI/mayura/actions/runs/39934428405/artifacts/12494296045),
464
+ `release-all-1.2.0`, contains all 106 archives, their manifest, the complete published receipt, exact-main
465
+ qualification, the 450-component SBOM and release notes. Its downloaded ZIP matched SHA-256
466
+ `cc0c2d22b23c9ccfdf7856378cb5234f6980efe13c92a2b4945554a65236a39f`.
467
+ The receipt and qualification both identify the published source and successful main run `39928903180`.
468
+
469
+ ### Historical RC1 publication
421
470
 
422
471
  The [RC1 release run 39884720470](https://github.com/KartikeyAI/mayura/actions/runs/39884720470) succeeded through
423
472
  `release.yml` and the protected `release` environment at `ba4a1e868904453e533e57e2876d64ab8536c454`, after
424
473
  [its 39-job main qualification](https://github.com/KartikeyAI/mayura/actions/runs/39879429442). All 22 selected archives matched
425
474
  their public npm integrity metadata, every version had provenance, and `next` resolved to `1.2.0-rc.1`. Existing
426
475
  `latest` values remained `1.1.0` for `mayura` and the OpenAI provider, and `1.2.0-rc.0` for the 20 newly introduced
427
- extensions. This proves OIDC publication for those 22 packages, not the full 106-package stable release.
428
-
429
- On **2026-10-23**, read-only npm checks confirmed that all other **84 packages** have the expected trusted-publisher
430
- configuration: `KartikeyAI/mayura`, `release.yml`, environment `release`, and direct publishing allowed. No trust
431
- settings were changed. The CLI readback does not expose activation or expiry status and is not proof of a successful
432
- OIDC exchange; the first live publication remains unproven for those packages. Recheck eligibility at release time
433
- and recreate any expired configurations. Public registry preflight also found all 106 stable `1.2.0` versions unused.
476
+ extensions. Those `latest` values describe the RC1 snapshot; stable publication subsequently advanced all 106
477
+ packages to `1.2.0` while preserving their `next` tags, as verified above.
434
478
 
435
479
  ### Historical release-branch run
436
480
 
@@ -476,8 +520,8 @@ Node 24.15.0 for framework starter qualification.
476
520
  | Frozen installation, secret scan and licenses/SBOM | Passed; 450 SBOM components, no license findings |
477
521
 
478
522
  These counts describe the completed qualification snapshot before this status page was added. Documentation edits
479
- are checked again during release preparation. The archives were staged for verification, not published; the release
480
- workflow must generate new archives bound to the final source commit and V1.2 version.
523
+ were checked again during release preparation. These local archives were staged for verification; the completed
524
+ workflow rehearsal and stable publication generated their own archives bound to the final source and V1.2 version.
481
525
 
482
526
  The integration result combines the latest execution of each case. The original all-service run had 54 failures
483
527
  and 313 skipped cases. Focused reruns cleared all executed failures, including a final serial run of 107 cases
@@ -487,19 +531,14 @@ concurrent builds and unit-suite load. The subsequent complete CI pass is record
487
531
 
488
532
  ## Remaining qualifications and limitations
489
533
 
490
- - **Stable publication:** full-release safeguards passed PR and main qualification at the recorded source; scoped
491
- RC1 publication passed at its separately recorded source. The stable version PR still needs review, qualification
492
- and green main checks, then a final-source workflow rehearsal and publication approval. All other 84 publisher
493
- configurations matched in read-only checks, but were not exercised by RC1 and their activation/expiry status was
494
- not exposed by the CLI. Recheck eligibility and replace any expired configurations before full publication.
495
534
  - **Providers and gateways:** offline transports and the provider harness dry run passed. Paid inference, real
496
535
  embedding endpoints, gateway accounting and remote discovery behavior have not been qualified.
497
536
  - **Authorization:** OpenFGA, Cedar, Permit.io and Oso passed offline tests and package checks. Real provider/native
498
537
  engine interoperability, deployed policies and revision consistency remain host responsibilities and unqualified
499
538
  here. Amazon Verified Permissions is outside the implemented Cedar adapter.
500
- - **RAG:** the [experimental RAG surface](rag.md) passed offline tests, including fake vector transports/SQL executors
501
- and local SQLite native-memory checks. This does not establish real vector/reranker service compatibility, SQL
502
- query plans, deployment limits or read-after-write visibility on eventually consistent services.
539
+ - **RAG:** the [qualified Modal and Pinecone profile](rag-production.md) covers one pinned Loki workload. Other
540
+ configurations have offline or narrower test evidence. Check the vector store, index behavior, workload and
541
+ security requirements for the deployment you plan to operate.
503
542
  - **AG-UI:** the [experimental bounded profile](ag-ui.md) passed adapter and native server tests. The opt-in reference
504
543
  HttpAgent/schema harness, CopilotKit compatibility and the notebook's rendered browser flow remain unqualified.
505
544
  Arbitrary in-flight paid-operation recovery, conversation branching, audio/video media and reasoning disclosure
@@ -509,26 +548,101 @@ concurrent builds and unit-suite load. The subsequent complete CI pass is record
509
548
  Rendered browser interaction, visual/accessibility checks and live deployment qualification remain outstanding.
510
549
  See [framework starters](framework-starters.md) and [copy-in UI](copy-in-ui.md).
511
550
 
512
- Retain the experimental labels and these limits when publishing. Any claim of stable external interoperability
513
- requires the corresponding real-service or reference-client qualification before release; an offline pass is not
514
- sufficient evidence for that claim.
551
+ The published release retains the experimental labels and these limits. Any future claim of stable external
552
+ interoperability requires the corresponding real-service or reference-client qualification; an offline pass or
553
+ successful npm publication is not sufficient evidence for that claim.
554
+
555
+ ## Release completion
556
+
557
+ The coordinated version PR, artifact/fixture follow-up, full main qualification, final-source rehearsal, protected
558
+ environment approval, 106-package stable publication and source-bound tag/GitHub Release are complete.
559
+ Trusted publishing is verified by successful OIDC publication for all 106 packages, rather than configuration
560
+ readback alone. The remaining work concerns the explicitly unqualified integrations, rendered browser flows and
561
+ deployments listed above; stable package availability does not qualify those application paths.
562
+
563
+ ---
564
+
565
+ # Choose a starter
566
+
567
+ Source: docs/guides/choosing-a-starter.md
568
+
569
+ Choose among runnable Mayura applications, six framework notebooks and focused templates, then follow the right setup path.
570
+
571
+ Start with the application shape you need. A **starter** includes an application, tests and configuration;
572
+ a **template** demonstrates one capability in a smaller project. Both can begin with offline model fixtures.
573
+ You do not need a model API key to learn the approval and persistence flow.
574
+
575
+ ## Pick an application
576
+
577
+ | Your goal | Starter | What you start with |
578
+ | --- | --- | --- |
579
+ | Chat inside Next.js | `nextjs` | App Router, React notebook, exact note approvals and indexing worker |
580
+ | Fetch routing with a separate frontend | `hono` | Hono, Vite React and additional runtime source |
581
+ | Chat in React Router | `react-router` | Resource routes and React notebook controls |
582
+ | Chat in TanStack Start | `tanstack-start` | Server routes and React notebook controls |
583
+ | Native Svelte chat | `sveltekit` | Svelte controls over the headless conversation stores |
584
+ | Native Vue chat | `nuxt` | Nitro routing and Vue conversation controls |
585
+ | A customer support service | `support-agent` | Scoped support chat and server deployment source |
586
+ | A durable review process | `approval-workflow` | A refund workflow that waits for human approval |
587
+ | Parallel research | `research-team` | Planner, researchers and writer with bounded shared spending |
588
+ | Webhook-driven work | `event-automation` | Signed webhook admission and durable MCP tool work |
589
+ | Interactive terminal use | `cli-agent` | Terminal conversation with confirmation for writes |
590
+ | A retrieval agent with citations | [`rag-modal-pinecone`](rag-modal-pinecone-starter.md) | Durable Markdown ingestion, an offline demo and optional hosted retrieval |
591
+
592
+ The six framework notebooks share one portable server application and the same scope, approval and recovery
593
+ contract. Choose the framework your team already operates; choosing a framework does not change an agent's authority.
594
+ Use [Next.js](nextjs.md), [Hono](hono.md), [React Router](react-router.md), [TanStack Start](tanstack-start.md),
595
+ [SvelteKit](sveltekit.md) or [Nuxt](nuxt.md) for exact setup and generated file locations.
596
+
597
+ ## Generate a reviewed directory
598
+
599
+ ```sh
600
+ npx mayura@1.2.1 init --starter nextjs --directory ./my-notebook --apply
601
+ ```
602
+
603
+ Replace `nextjs` with the selected starter ID. The [initializer](../cli/init.md) supports a plan before writing and
604
+ refuses unapproved replacement of existing files. Run from a directory you own; use the generated README for that
605
+ starter's install, build and environment commands.
606
+
607
+ For a framework notebook:
608
+
609
+ ```sh
610
+ cd my-notebook
611
+ npm install
612
+ npm run setup
613
+ npm run dev
614
+ ```
615
+
616
+ Use Node 24.14.1 or a later supported 24.x release; the Nuxt toolchain requires 24.15.0 or later.
617
+ Read the local token from ignored `.data/login-token`, enter it in the notebook and start `npm run worker` in another
618
+ terminal. Setup never prints that credential and does not overwrite existing credentials. Other starter families
619
+ have their own setup instructions; do not assume the notebook login flow applies to a CLI or support service.
620
+
621
+ ## What to verify first
622
+
623
+ Send a note, inspect the proposed input, approve once and inspect its recorded outcome. Reject another proposal
624
+ and confirm that it did not write. Let the separate worker process indexing, then reload and reconnect to inspect
625
+ the saved thread. If submission is uncertain, retain its original input and key for explicit recovery.
626
+
627
+ The notebook is a local, single-user identity demonstration. Before exposing it to customers, replace its
628
+ authenticator with verified per-tenant identity. The host owns scope, route capabilities, tools and budgets;
629
+ browser data never grants authority. Keep secrets on the server and configure the exact public origin.
515
630
 
516
- ## Release preparation
631
+ ## Choose a template for one concept
517
632
 
518
- 1. Full-release publisher/recovery changes are merged and qualified on main; review these updated release records.
519
- 2. Review the prepared coordinated **1.2.0** version/changelog PR, committed without `[skip ci]`, merge through normal branch
520
- protection and require the pushed main commit's complete qualification to pass. The publisher does not write main.
521
- 3. Verify trusted publishing for all 106 packages, the protected `release` environment, tag creation permission and
522
- publishing enablement. Preserve the experimental labels and limitations above.
523
- 4. Rehearse **1.2.0** with `package_set=all` and `dry_run=true`, regenerating archives, checksums, SBOM and notes from
524
- the final source. Dry runs do not validate unexercised package trust.
525
- 5. Approve publication from that qualified main commit with `dry_run=false`. Verify all 106 versions, `latest` tags,
526
- provenance and the source-bound tag/GitHub Release. Recover partial publication from the original run's saved
527
- archives and receipt, without replaying accepted or uncertain uploads.
633
+ Use the interactive initializer to see the current template catalog when you want a small example rather than a
634
+ complete service. Templates suit learning a tool schema, a model call or a workflow primitive. When adapting one
635
+ for customers, supply your own identity, persistence, server lifecycle, deployment and operational recovery.
528
636
 
529
- This version PR sets source manifests and version references to **1.2.0** and prepares the changelog. It does not
530
- publish to npm, change distribution tags, create `v1.2.0` or create a stable GitHub Release. Stable publication and
531
- deployment remain outstanding; RC1 availability is not evidence of live-service or rendered browser qualification.
637
+ ## Before adding paid work
638
+
639
+ Select a [model provider](model-providers.md) or [AI gateway](ai-gateways.md), declare prices and a finite model-call
640
+ cap, and grant only the model/tools needed for the application. Preserve separate worker permissions and
641
+ [authorization](authorization.md). A UI approval does not authorize an unrelated workflow tool.
642
+
643
+ The V1.2 package release and cross-platform checks passed. Rendered browser, external provider and live deployment
644
+ qualification remain separate from offline fixture checks. Follow [framework architecture](framework-starters.md),
645
+ [deployment](deployment.md) and [release evidence](release-readiness.md) before production rollout.
532
646
 
533
647
  ---
534
648
 
@@ -2000,10 +2114,69 @@ The pieces:
2000
2114
  are done run together.
2001
2115
  - **`result`** is a binding that picks the workflow's output, checked against the `output` schema.
2002
2116
 
2003
- The graph is fixed when you define it: at most 128 nodes, no cycles, and no code runs between steps. Logic lives in the
2117
+ The graph is fixed when you define it: 128 nodes by default, no cycles, and no code runs between steps. Logic lives in the
2004
2118
  tools. For work whose width depends on data, a durable workflow can declare up to a fixed number of parallel slots
2005
2119
  (`fanOut`) and skip steps with a condition (`when`). See [Durable workflows](../guides/durable-workflows.md).
2006
2120
 
2121
+ ## Configuring graph size
2122
+
2123
+ Starting in V1.2.1, `defineWorkflow`, `defineWorkflowLifecycle`, `defineWorkflowGraph` and `defineWorkflowTree` accept
2124
+ an optional `maxNodes`: `false` or an integer from 1 through 512. Omission retains the 128-node admission limit. Set the bound
2125
+ explicitly when defining a larger graph; it does not automatically increase to match the supplied nodes.
2126
+
2127
+ ```ts
2128
+ import { z } from 'mayura';
2129
+ import { defineWorkflowLifecycle } from 'mayura/workflows/lifecycle';
2130
+
2131
+ const workflow = defineWorkflowLifecycle({
2132
+ id: 'wide-review', version: '1', input: z.null(), output: z.null(), maxNodes: 256,
2133
+ nodes: Array.from({ length: 256 }, (_, index) => ({
2134
+ kind: 'join' as const, id: `step${index}`, dependsOn: [],
2135
+ })),
2136
+ result: { kind: 'input', path: [] },
2137
+ });
2138
+ void workflow;
2139
+ ```
2140
+
2141
+ To disable the per-graph node-count constraint through environment configuration, set
2142
+ `MAYURA_WORKFLOW_DISABLE_MAX_NODES=true` (or `1`) and explicitly wire the host helper into each definition:
2143
+
2144
+ ```ts
2145
+ import { z } from 'mayura';
2146
+ import { workflowNodeLimitsFromEnv } from 'mayura/core/host';
2147
+ import { defineWorkflowLifecycle } from 'mayura/workflows/lifecycle';
2148
+
2149
+ const workflow = defineWorkflowLifecycle({
2150
+ id: 'unbounded-graph', version: '1', input: z.null(), output: z.null(),
2151
+ ...workflowNodeLimitsFromEnv(process.env),
2152
+ nodes: [{ kind: 'join', id: 'ready', dependsOn: [] }],
2153
+ result: { kind: 'input', path: [] },
2154
+ });
2155
+ void workflow;
2156
+ ```
2157
+
2158
+ The helper accepts a host-owned environment map without reading ambient globals. Unset, empty, `false` and `0`
2159
+ return no override; other values are rejected. Its opt-in becomes the JSON-safe `maxNodes: false`, included in
2160
+ the definition identity and stored state. Changing the environment never changes an already-pinned run. Browser
2161
+ and edge hosts may pass their own configuration map, or set `maxNodes: false` explicitly. To override a numeric
2162
+ setting, spread the helper **after** that setting. Roll out matching workers and readers before submitting runs.
2163
+
2164
+ The explicit bound becomes part of the definition digest and persisted state. Restarted workers validate the same
2165
+ bound; changing it for an existing run requires the normal reviewed migration process. Definitions that omit it keep
2166
+ their existing hashes and stored representation. Deploy readers, workers and clients from V1.2.1 together before
2167
+ submitting larger graphs: V1.2.0 readers reject the additional metadata.
2168
+
2169
+ Increasing `maxNodes` does not increase spending, tool calls, output sizes, human/timer/signal counts or concurrency.
2170
+ The server and client graph views allow at most four dependency edges per configured node in total (per actual node
2171
+ when `maxNodes` is `false`); a node may depend
2172
+ on at most `maxNodes - 1` other nodes. Existing JSON byte limits still apply, so a dense graph or large accumulated
2173
+ outputs may reach a byte limit before reaching the node ceiling. Larger in-process and lifecycle graphs execute in
2174
+ small batches to bound storage queues and contention.
2175
+
2176
+ Workflow trees still allow at most 16 children, 256 total nodes across root and children, and 128 tool nodes. A
2177
+ root's `maxNodes` does not raise these tree-wide limits, and each leaf declares its own per-graph bound. Saga step
2178
+ counts, loop iteration counts and graph wait-target limits are separate and retain their existing bounds.
2179
+
2007
2180
  ## In-process or durable
2008
2181
 
2009
2182
  Mayura runs workflows in two ways.
@@ -2067,293 +2240,1199 @@ to the new version with a reviewed migration. See [Operating workflows](../guide
2067
2240
  - [Sagas and loops](../guides/sagas-and-loops.md)
2068
2241
  - [Operating workflows](../guides/workflow-operations.md)
2069
2242
 
2070
- ## Execution authorization
2243
+ ## Execution authorization
2244
+
2245
+ Durable workflow runtimes accept a host-owned core `authorization` instance alongside their static grants and
2246
+ budget limits. It gates workflow/run execution, tools and child delegation, including loop and saga children.
2247
+ Revoked execution never authorizes replay of a dispatched effect; known receipts and charges remain durable while
2248
+ output can be withheld. See the [authorization guide](../guides/authorization.md#workflow-execution-and-child-workflows)
2249
+ for resource IDs, actions, audit delivery and the boundary between workers and HTTP operator controls.
2250
+
2251
+ ---
2252
+
2253
+ # RAG quickstart
2254
+
2255
+ Source: docs/guides/rag-quickstart.md
2256
+
2257
+ Install Mayura, ingest Markdown, retrieve and verify an exact citation, then delete the source locally.
2258
+
2259
+ Use `mayura/rag` to publish a Markdown source, retrieve a passage with a citation, and revoke the source's
2260
+ visibility. This example uses SQLite for the workflow journal and catalog, a deterministic hashing embedder,
2261
+ and an in-memory vector store. It runs without API keys or model calls.
2262
+
2263
+ ## Install and run
2264
+
2265
+ Use [a supported Node.js version](../installation.md). From an empty project directory, install Mayura and its
2266
+ optional SQLite dependency.
2267
+
2268
+ ```sh
2269
+ npm init -y
2270
+ npm install mayura better-sqlite3@13
2271
+ ```
2272
+
2273
+ Save this as `rag-quickstart.mts`.
2274
+
2275
+ ```ts
2276
+ import { hashingEmbedder } from 'mayura/memory';
2277
+ import {
2278
+ aggregateRagCatalog, createRetriever, defineRagIngestion, deleteRagDocument,
2279
+ inMemoryVectorStore, loadMarkdown, ragEmbedder, ragIndexSpace, type RagAccess,
2280
+ } from 'mayura/rag';
2281
+ import { createSqliteStore } from 'mayura/storage-sqlite';
2282
+ import { createWorkflowRuntime } from 'mayura/workflows';
2283
+
2284
+ const scope = { principalId: 'demo-reader', projectId: 'handbook' };
2285
+ const readAccess: RagAccess = {
2286
+ scope, permissions: { allow: ['rag:read'] }, allowedSensitivities: ['internal'],
2287
+ };
2288
+ const writeAccess: RagAccess = {
2289
+ scope, permissions: { allow: ['rag:index'] }, allowedSensitivities: ['internal'],
2290
+ };
2291
+ const db = createSqliteStore({ filename: ':memory:' });
2292
+ const catalog = aggregateRagCatalog(db);
2293
+ const embedder = ragEmbedder(hashingEmbedder({ dimensions: 64 }), { costMicros: 0 });
2294
+ const vectors = inMemoryVectorStore({ dimensions: 64, maxVectors: 100 });
2295
+ const chunking = { mode: 'markdown', maxChars: 512, overlapChars: 64, maxChunks: 8 } as const;
2296
+ const document = loadMarkdown('## Returns\nUnopened items can be returned within 30 days with a receipt.', {
2297
+ id: 'returns', reference: 'handbook/returns.md', sensitivity: 'internal',
2298
+ });
2299
+
2300
+ await db.initialize();
2301
+ const runtime = createWorkflowRuntime({
2302
+ store: db, scope, policyVersion: 'handbook-v1', maxCostMicros: 0,
2303
+ permissions: { allow: ['effect:write', 'rag:index', 'tool:handbook.ingest.stage', 'tool:handbook.ingest.publish'] },
2304
+ });
2305
+ try {
2306
+ const ingestion = defineRagIngestion({
2307
+ ...writeAccess, id: 'handbook.ingest', version: '1', journal: db, catalog,
2308
+ store: vectors, embedder, chunking, maxCostMicros: 0, timeoutMs: 5_000,
2309
+ });
2310
+ const submission = await runtime.submit(ingestion, {
2311
+ input: { document, expectedRevision: null },
2312
+ idempotencyKey: 'returns-v1',
2313
+ });
2314
+ const outcome = await runtime.runUntilSettled(ingestion, submission.id);
2315
+ if (outcome.status !== 'succeeded') throw new Error('Ingestion did not publish.');
2316
+
2317
+ const retriever = createRetriever({
2318
+ ...readAccess, catalog, store: vectors, embedder, space: ragIndexSpace(embedder, chunking),
2319
+ mode: 'hybrid', limit: 3, candidateLimit: 10, maxQueries: 1, maxCostMicros: 0,
2320
+ timeoutMs: 5_000, maxConcurrent: 2,
2321
+ });
2322
+ const query = 'returns receipt';
2323
+ const { hits } = await retriever.retrieve(query);
2324
+ const hit = hits[0];
2325
+ if (!hit) throw new Error('Expected a returns passage.');
2326
+ const { chunk } = hit;
2327
+ const citation = {
2328
+ documentId: chunk.documentId, revision: chunk.revision, chunkId: chunk.id,
2329
+ reference: chunk.reference, start: chunk.start, end: chunk.end,
2330
+ };
2331
+ const passage = document.text.slice(citation.start, citation.end);
2332
+ if (passage !== chunk.text) throw new Error('Citation did not match the source.');
2333
+ console.log(JSON.stringify({ passage, citation }, null, 2));
2334
+
2335
+ const active = await catalog.read(scope, document.id, AbortSignal.timeout(5_000));
2336
+ if (!active || active.deleted || active.revision !== citation.revision) {
2337
+ throw new Error('The cited revision is no longer active.');
2338
+ }
2339
+ const tombstone = await deleteRagDocument({
2340
+ ...writeAccess, catalog, documentId: document.id, expectedRevision: active.revision,
2341
+ signal: AbortSignal.timeout(5_000),
2342
+ });
2343
+ if ((await retriever.retrieve(query)).hits.length !== 0) {
2344
+ throw new Error('The deleted source is still visible.');
2345
+ }
2346
+ await vectors.delete(scope, tombstone.space, tombstone.chunkIds, AbortSignal.timeout(5_000));
2347
+ console.log('Source hidden and vectors removed.');
2348
+ } finally {
2349
+ try { await runtime.close(); } finally { await db.close(); }
2350
+ }
2351
+ ```
2352
+
2353
+ ```sh
2354
+ node --experimental-strip-types rag-quickstart.mts
2355
+ ```
2356
+
2357
+ The first output contains the returns passage and its document, revision, chunk ID, source reference and exact UTF-16
2358
+ offsets in the normalized Markdown. The second confirms the catalog tombstone hid the passage before vector cleanup.
2359
+
2360
+ ## Connect an agent or persist the corpus
2361
+
2362
+ Bind `defineRetrievalTool` to the scoped retriever to expose a query-only search tool. Derive the scope on the host
2363
+ from trusted request identity. Treat returned passages as untrusted evidence and verify access to the cited revision
2364
+ again when displaying it. [Scoped retrieval and tools](rag.md#scoped-retrieval-and-tools)
2365
+
2366
+ For restart recovery, use a file-backed journal and catalog plus a persistent vector store. Reuse the same submission
2367
+ key, storage, index space and workflow version when recovering known work. Keep the journal for reconciliation when
2368
+ an acknowledgement is uncertain. Catalog deletion changes what readers can see before vector cleanup. Configure
2369
+ retention separately for workflow inputs and journal history. [Durable ingestion](rag.md#durable-ingestion)
2370
+
2371
+ To try a hosted setup, follow the [deployment guide](rag-deployment.md) and check which exact configurations the
2372
+ [qualification matrix](rag-production.md#qualification-matrix) covers.
2373
+
2374
+ ---
2375
+
2376
+ # Retrieval augmented generation
2377
+
2378
+ Source: docs/guides/rag.md
2379
+
2380
+ Scoped retrieval tools, durable content-addressed ingestion, vector adapters, citations and bounded reranking.
2381
+
2382
+ `mayura/rag` adds retrieval without giving a model a database connection or letting it choose a principal, project,
2383
+ index or filter. Host code loads documents, stages embeddings and publishes a revision. A retrieval tool returns
2384
+ only authorized evidence and exact citation identities. The [qualified Modal + Pinecone Loki v28
2385
+ profile](rag-production.md#qualified-production-profile) is stable within its tested scope. Other RAG profiles
2386
+ remain experimental. See [release validation status](release-readiness.md) for the limits of the available evidence.
2387
+
2388
+ Follow the [RAG quickstart](rag-quickstart.md) to ingest, retrieve, verify a citation and delete a source from a
2389
+ registry install. Then use the [deployment guide](rag-deployment.md) to prepare a hosted setup.
2390
+
2391
+ ## Retrieval configuration
2392
+
2393
+ Chunk-level fusion remains the default. Use `fusionLevel: 'document'` to combine ranks by document and
2394
+ return a real passage as the citation witness. Use `distinctDocuments: true` to return at most one
2395
+ passage per document. Parent context still depends on published, authorized evidence.
2396
+
2397
+ The in-memory vector store supports optional BM25, document-level lexical and semantic candidates,
2398
+ and max or mean aggregation of document cosine scores. The default stays chunk-level.
2399
+
2400
+ ## Architecture
2401
+
2402
+ A `VectorStore` is a trusted infrastructure boundary. Each operation includes a verified scope and a pinned index
2403
+ space. A separate `RagCatalog` is the authority for the active revision and its exact chunk IDs. Search results
2404
+ from abandoned, superseded or deleted revisions are discarded before reranking and again before disclosure.
2405
+ `aggregateRagCatalog` uses the existing compare-and-set aggregate contract on all storage adapters; no new database
2406
+ schema is needed for the catalog or ingestion journal.
2407
+
2408
+ Two built-in vector backends are available: `inMemoryVectorStore` is bounded exact cosine plus lexical overlap;
2409
+ `nativeMemoryVectorStore` uses the native memory tables in a separate scope, BM25 and a bounded exact vector scan.
2410
+ Initialize `store.memory` before using the native adapter; declare its `location` and whole-operation `costMicros` ceiling, including the bounded scan's storage reads. Neither backend performs network or model calls.
2411
+ The hashing embedder is deterministic lexical feature hashing, not a semantic model.
2412
+
2413
+ ## Durable ingestion
2414
+
2415
+ The offline runnable example is `examples/rag.mjs` in the repository. After building the workspace:
2416
+
2417
+ ```bash
2418
+ node examples/rag.mjs
2419
+ ```
2420
+
2421
+ It loads Markdown, runs a two-step durable workflow, indexes locally, gives an agent a scoped retrieval tool and
2422
+ returns an answer with exact citations. Its scripted model and hashing embedder perform no inference or network.
2423
+
2424
+ Define ingestion with `defineRagIngestion` and submit it to the conservative `createWorkflowRuntime` from
2425
+ [workflows](../concepts/workflows.md). Pass a host-owned `journal`, `catalog`, vector `store`, priced `embedder`,
2426
+ `chunking`, scope, sensitivity profile, `maxCostMicros` and `timeoutMs`. Pin the definition ID/version in the host.
2427
+ The input is exactly `{ document, expectedRevision }`; use `null` only for an absent document. Read the current
2428
+ catalog revision through trusted host code before submitting an update. No browser-supplied scope is accepted.
2429
+
2430
+ The workflow has two steps:
2431
+
2432
+ 1. `<id>.stage` claims a deterministic revision, loads confirmed cached chunk vectors or embeds new chunks, writes
2433
+ immutable vector IDs, and saves a prepared receipt. Its output contains only the publication manifest.
2434
+ 2. `<id>.publish` verifies that prepared receipt and compare-and-sets the catalog from `expectedRevision` to the
2435
+ new revision. Concurrent publication or deletion fences a stale writer.
2436
+
2437
+ The workflow needs `tool:<id>.stage`, `tool:<id>.publish`, `effect:write` and `rag:index`. Hosted embeddings also
2438
+ need `rag:embed`. The definition's `RagAccess` has its own explicit grants; the runtime's grants do not replace them.
2439
+ Use the same durable storage after restart. Supply the same submission key to recover the same workflow.
2440
+
2441
+ Content identity includes normalized text, source reference, metadata and sensitivity. Index space pins model,
2442
+ dimensions, chunking, parent settings and contextualizer identity. An unchanged published document is a no-op only
2443
+ when `expectedRevision` matches. A scoped embedding cache keys exact embedding input and sensitivity, so unchanged
2444
+ chunks are not paid for again when another part of the document changes. Changed context, model or settings
2445
+ creates a different embedding identity. Duplicate text in a batch shares one claim.
2446
+
2447
+ Claims are durable **before** paid work. A failed, timed-out or lost acknowledgement leaves the claim uncertain.
2448
+ A second submission cannot repeat it. `reconcileRagClaim` requires `rag:reconcile`, core authorization and a trusted
2449
+ verifier of the already completed stage or embedding. It changes only the receipt; it never calls a provider or
2450
+ writes vectors. Stage verification must confirm every exact staged chunk exists with its intended payload/vector.
2451
+ Embedding verification must recover the original confirmed vector. If evidence is unavailable, leave the claim
2452
+ blocked. A new content/index identity is an explicit new ingestion, not recovery of an uncertain call.
2453
+
2454
+ Catalog publication and vector storage are not a distributed transaction. Partially staged vectors stay hidden.
2455
+ Run cleanup separately using the exact scope, space and chunk IDs, after confirming they are not active. Do not
2456
+ delete a prepared active revision during a concurrent publication. `deleteRagDocument` first publishes a tombstone
2457
+ with an expected revision; reads stop disclosing that source immediately. Its returned IDs support later physical
2458
+ cleanup through `VectorStore.delete`. Deletion does not erase old workflow inputs, provider logs or journal history;
2459
+ configure retention and storage encryption in the host.
2460
+
2461
+ ## Loaders and chunkers
2462
+
2463
+ `loadText` normalizes line endings and Unicode NFC. `loadMarkdown` keeps the original Markdown syntax as evidence.
2464
+ `loadJson` extracts only host-selected JSON Pointer string leaves; it never dumps an entire configuration file.
2465
+ `loadHtml` requires `rag:load:html` and an inert host-installed DOM parser; it removes script/style/template/hidden
2466
+ nodes before text extraction. `loadPdf` requires `rag:load:pdf` and a host-owned PDF text extractor, bounded bytes,
2467
+ page limit and abort signal. PDF parsing has a bounded timeout and shared per-parser concurrency; an abort-ignoring parser retains its slot until settlement. PDF engines, sandboxing, fonts and workers remain host dependencies; no heavyweight
2468
+ parser is installed into the core. Neither loader fetches URLs or executes embedded source content.
2469
+
2470
+ Normalized documents are bounded to 32,000 UTF-16 code units. Larger corpora should be split into bounded documents
2471
+ at acquisition time. `chunkDocument` supports `fixed`, `recursive` and `markdown` modes, explicit character size,
2472
+ overlap and maximum chunks. It refuses truncation. Offsets are exact UTF-16 positions in normalized loader text,
2473
+ not byte offsets or original PDF coordinates. Character bounds are not tokenizer counts.
2474
+
2475
+ Set `parentChars` to retain a bounded parent passage for each child embedding, and `parentDocuments: true` on the
2476
+ retriever to release it after the same document authorization checks. A host-owned ingestion `contextualizer`
2477
+ can produce one bounded retrieval-context string per chunk. Declare its stable ID, location and full-request cost,
2478
+ grant `rag:contextualize:<id>`, and pin its behavior in the ingestion version. Generated context prefixes embedding
2479
+ and reranking input but is returned separately as `retrievalContext`; it is not a source quotation. Include it in
2480
+ your provider input-size budget (at most 1,000 extra characters per chunk).
2481
+
2482
+ ## Embedding providers and budgets
2483
+
2484
+ `ragEmbedder(adapter, { costMicros })` prices any `MemoryEmbedder`-compatible adapter, including `hashingEmbedder`
2485
+ and the existing OpenAI embedding adapter. Provider packages also export native embedding factories:
2486
+
2487
+ | Provider entry | Factory | Admission |
2488
+ | --- | --- | --- |
2489
+ | `mayura/provider-openai` or `@mayurajs/provider-openai` | `openAIEmbeddings`, wrapped by `ragEmbedder` | `rag:embed` for hosted use |
2490
+ | `@mayurajs/provider-google` | `googleEmbeddings` | `rag:transport:google-embeddings` |
2491
+ | `@mayurajs/provider-mistral` | `mistralEmbeddings` | `rag:transport:mistral-embeddings` |
2492
+ | `@mayurajs/provider-azure` | `azureEmbeddings` | `rag:transport:azure-embeddings` |
2493
+ | `@mayurajs/provider-ollama` | `ollamaEmbeddings` | `rag:transport:ollama-embeddings` |
2494
+ | `@mayurajs/provider-bedrock` | `titanEmbeddings` | `rag:transport:bedrock-embeddings` |
2495
+
2496
+ The new HTTP factories require explicit model, dimensions, maximum batch, credentials/endpoint as applicable,
2497
+ `costMicros`, transport permissions, timeout and concurrency. Azure uses an explicit resource and deployment name.
2498
+ Ollama requires a declared local/hosted location; local is restricted to loopback. Titan is the explicit text V2
2499
+ profile, one input at a time, with supplied SigV4 credentials and 256/512/1024 dimensions; close its owned client.
2500
+ No adapter reads credentials from the environment, selects an embedding model or silently retries.
2501
+
2502
+ `costMicros` is a **host-declared maximum for the entire bounded operation**, not a price lookup or billed-cost
2503
+ estimate. Ingestion reserves maximum embedding batches plus vector writes and contextualization. Retrieval
2504
+ reserves bounded query expansion, embeddings, vector/lexical searches and reranking before dispatch. Runtime tool
2505
+ reservations contain those nested operations. Failures conservatively retain the reservation; the source no-op
2506
+ reports zero. Provider-side billing cannot be enforced by an in-process declaration: configure real service quotas
2507
+ and an honest bound for the admitted model and input/output lengths.
2508
+
2509
+ ## Scoped retrieval and tools
2510
+
2511
+ Create a retriever with the host's scope, explicit permissions, `allowedSensitivities`, index space, fixed metadata
2512
+ `filter`, `limit`, `candidateLimit`, `maxQueries`, `maxCostMicros`, `timeoutMs` and `maxConcurrent`. All hosted content
2513
+ writes/embeddings/reranks require the corresponding sensitivity in `hostedSensitivities` (default empty).
2514
+
2515
+ `defineRetrievalTool({ id, version, retriever, timeoutMs })` accepts only `{ query }`. Runtime admission needs
2516
+ `tool:<id>`, `effect:read` and `rag:read`; the retriever also checks its own `rag:read` and hosted `rag:embed` grant.
2517
+ It checks the actual tool scope against the bound retriever scope. Results contain plain untrusted text, scores,
2518
+ metadata-only metrics, and citations with document/revision/chunk/reference/start/end. A reference is an opaque
2519
+ source label, not a fetched or verified URL. Render it as plain text unless your application independently approves
2520
+ links. Retrieved text never becomes a system instruction.
2521
+
2522
+ Pass the existing core `authorization` to evaluate `rag_document` actions: `search` on `collection`, `read` on each
2523
+ document, `index` on ingestion, `delete` on deletion and `reconcile` for recovery. Embedding-cache recovery uses
2524
+ `collection` because cache entries may be shared by multiple documents in that scope. The same authorizer emits
2525
+ its normal metadata-only audit events. Per-document denial withholds evidence before external reranking. Policy
2526
+ outage/cancellation fails closed and never triggers a weaker fallback. Authorization/publication checks repeat
2527
+ before releasing results. Candidate limits can reduce recall when many stored candidates are stale or denied;
2528
+ the retriever does not scan or spend without a bound to refill the result.
2529
+
2530
+ ## Hybrid search and query expansion
2531
+
2532
+ `mode: 'hybrid'` fuses semantic and lexical ranks with reciprocal-rank fusion. Native memory provides BM25;
2533
+ in-memory lexical scoring is a small deterministic reference implementation. External semantic backends can be
2534
+ paired with a scoped lexical mirror using `hybridVectorStore({ semantic, lexical })`; ingestion stages into both,
2535
+ and a partial mirror write remains unpublished. A backend without lexical capability refuses hybrid mode rather
2536
+ than silently changing retrieval behavior.
2537
+
2538
+ `modelQueryTransform` supports rewrite, multi-query and HyDE. It requires a model grant, explicit query mode and
2539
+ query count. Set `maxQueries` to include the original query for multi-query mode. Expansion makes one bounded model
2540
+ call, without tools/history or automatic retries. HyDE output is only a search representation and never returned
2541
+ as evidence. Custom transforms obey the same contract and declare a finite cost.
2542
+
2543
+ ## Reranking and evaluation
2544
+
2545
+ Optional adapters: [Cohere](../integrations/reranker-cohere.md), [Voyage](../integrations/reranker-voyage.md), and
2546
+ [Jina](../integrations/reranker-jina.md). `modelReranker` uses an explicitly granted model instead. The retriever
2547
+ requires `rag:rerank:<id>`, checks hosted sensitivities and authorizes input documents before ranking. Each adapter
2548
+ returns only original-document indexes and finite scores; it cannot replace or inject source text.
2549
+
2550
+ `retrievalQuality` returns precision@k, recall@k, reciprocal rank and binary nDCG for one query. `evaluateRetrieval`
2551
+ macro-averages test-set recall and MRR. `citationCoverage` checks that cited chunk IDs belong to the evidence used;
2552
+ it does not establish semantic entailment. Retrieval result metrics contain admitted query/candidate/result counts,
2553
+ declared cost reservation and duration, without raw query text, denied document identities or source content.
2554
+
2555
+ For grounded answers, score citation correctness against the document revision and the exact evidence span. Then
2556
+ judge each claim against independently labeled support in those spans. Measure the unsupported-claim rate and
2557
+ answer faithfulness alongside retrieval recall and MRR. The package qualification uses deterministic fixtures for
2558
+ these distinctions. Use a representative held-out corpus and reviewed claims to evaluate your deployment.
2559
+
2560
+ ## Vector adapters and qualification
2561
+
2562
+ Built-in exact stores plus six optional integrations share the `VectorStore` contract:
2563
+ [pgvector](../integrations/vector-pgvector.md), [libSQL](../integrations/vector-libsql.md),
2564
+ [Pinecone](../integrations/vector-pinecone.md), [Qdrant](../integrations/vector-qdrant.md),
2565
+ [Weaviate](../integrations/vector-weaviate.md), and [Chroma](../integrations/vector-chroma.md).
2566
+ Use explicit infrastructure permissions and an honest cost ceiling for each whole bounded operation. Provision
2567
+ remote collections with matching dimensions and cosine similarity before ingestion. These adapters manage data,
2568
+ not infrastructure provisioning. The SQL profiles use host-owned parameterized executors and explicit schema setup.
2569
+
2570
+ The shared offline conformance suite passes locally for all eight stores: scope/index isolation, filtering before top-k,
2571
+ ID replacement, scoped deletion, invalid dimensions and cancellation. Native protocol tests use fake transports;
2572
+ SQL protocol tests use fake executors, while native-memory tests use local in-memory SQLite. These cases, the offline runnable example, package checks and edge/runtime checks passed locally. Frozen dependency installation also passed with strict peers and lifecycle scripts disabled. Fake transports and executors do not qualify real service compatibility, SQL query plans or deployment limits.
2573
+
2574
+ Remote indexes may acknowledge writes before making them searchable. Give eventually consistent indexes time to
2575
+ catch up before evaluating recall. See the [qualification matrix](rag-production.md#qualification-matrix) for the
2576
+ pinned production profile and the status of other adapters and model combinations.
2577
+
2578
+ ---
2579
+
2580
+ # RAG production qualification
2581
+
2582
+ Source: docs/guides/rag-production.md
2583
+
2584
+ Compare the qualified Modal and Pinecone Loki v28 profile with experimental RAG configurations, and see measured scale, recall, and latency.
2585
+
2586
+ ## Qualification matrix
2587
+
2588
+ | Configuration | Embeddings | Retrieval and ranking | Release status |
2589
+ | --- | --- | --- | --- |
2590
+ | Registered Modal + Pinecone Loki v28 | Pinned Nomic Embed Text v1.5 on Modal, 768 dimensions | Pinecone cosine with self-provided vectors. Modal DeepSeek V4.1 Flash 1017 for candidate ranking and answer generation | **Production-qualified** for the registered Loki software-operations corpus and configuration |
2591
+ | Modal + Pinecone starter | Nomic Embed Text v1.5 on Modal | Pinecone cosine. Modal DeepSeek for reranking and generation | **Experimental deployment profile**. The starter has its own sample corpus, configuration and smoke test. [Starter guide](rag-modal-pinecone-starter.md) |
2592
+ | Built-in local stores | Deterministic hashing for offline examples. Host-supplied embeddings through the adapter contract | In-memory exact cosine with lexical scoring or BM25. Native memory with bounded exact vector scans and BM25 | **Local development and conformance**. Production use remains experimental. [RAG API guide](rag.md#architecture) |
2593
+ | Other vector stores and model combinations | Host-supplied embedders, including OpenAI, Google, Mistral, Azure, Ollama and Bedrock adapters | [pgvector](../integrations/vector-pgvector.md), [libSQL](../integrations/vector-libsql.md), [Qdrant](../integrations/vector-qdrant.md), [Weaviate](../integrations/vector-weaviate.md), [Chroma](../integrations/vector-chroma.md), or Pinecone with a different profile. This includes Cohere, Voyage, Jina and other rerankers | **Experimental**. Evidence varies by adapter. [Vector conformance and model adapters](rag.md#vector-adapters-and-qualification) |
2594
+
2595
+ Changing the corpus, model, index, ranker, serving configuration, or operating load calls for separate qualification.
2596
+
2597
+ ## Qualified production profile
2598
+
2599
+ The registered catalog contains 24 normalized documents from 22 Loki documentation source families and
2600
+ 426 verified document embeddings. The semantic holdout contains 16 single-source cases, 16 multi-source cases
2601
+ and eight abstention cases.
2602
+
2603
+ | Check | Scale | Quality | Timing |
2604
+ | --- | --- | --- | --- |
2605
+ | Source-reviewed semantic evaluation | 40 Loki cases | Required-fact coverage at three results averaged 98.4375% across answerable cases. Answer fact coverage averaged 98.4375%. All eight abstentions passed. Source review recorded zero unsupported claims. | Acquisition and ranking p95 upper bound of 4.725 s against the 5 s limit |
2606
+ | Nomic acquisition load | 120/120 queries on the registered Loki catalog | 99.833% mean recall, 90% minimum | 417.127 ms acquisition p95 |
2607
+ | Pinecone native load | 600/600 timed queries in the separate native vector load profile with observed concurrency of one | 98.333% mean recall, 90% minimum | 45.095 ms native query p95 |
2608
+ | Recovery and scope security | Seven production recovery checkpoints and the scope security check | Passed | 25.428 s maximum observed recovery |
2609
+
2610
+ The semantic gate counts required facts supported within the top three results. The load checks measure recall against
2611
+ their registered reference neighbors. Each latency figure covers the named phase. Document-level MRR and full-answer
2612
+ p95 are unpublished for this profile. Use workload-specific
2613
+ quality and latency targets for your deployment. [Deployment qualification](rag-deployment.md#qualify-the-deployment-you-intend-to-operate)
2614
+
2615
+ ## Recovery and cleanup evidence
2616
+
2617
+ Document preparation reused the verified registered checkpoint. The original 600-query request archive was recovered
2618
+ and checked. Provider evidence covers 14 owned apps and 23 sandboxes. No owned Pinecone indexes remained.
2619
+ The pre-existing Modal app was verified by exact ID.
2620
+
2621
+ The revised cleanup verifier uses retained provider observations for current owners and original
2622
+ shutdown receipts for historical owners. Missing records alone provide no cleanup credit. The
2623
+ original incomplete audit remains in the evidence, including its completed archive verification.
2624
+ The offline release check made no provider calls and reran no queries. The original quality,
2625
+ latency, recovery, security and 600-query gates still apply.
2626
+
2627
+ The versioned release receipt records the passed gates, phase digests and measured latency.
2628
+ [Loki v28 release receipt](https://github.com/KartikeyAI/mayura/blob/ff69ac1e559b4360f2befffe35f13aece1b4ba89/compatibility/rag-modal-pinecone-loki-production-v1.json)
2629
+
2630
+ ---
2631
+
2632
+ # Build and deploy a retrieval agent
2633
+
2634
+ Source: docs/guides/rag-deployment.md
2635
+
2636
+ Start offline, connect a scoped vector store, and qualify retrieval and citations on your own workload.
2637
+
2638
+ Start with the [RAG quickstart](rag-quickstart.md) to ingest, retrieve, verify citations and delete a source
2639
+ from an npm install. The [Modal + Pinecone starter](rag-modal-pinecone-starter.md) adds an offline demo
2640
+ and an opt-in hosted walkthrough.
2641
+
2642
+ The repository also includes a single-file example in `examples/rag.mjs`. It ingests Markdown in a durable workflow, then answers with
2643
+ citation identities using a scripted model and a deterministic hashing embedder. After building the workspace, run:
2644
+
2645
+ ```bash
2646
+ node examples/rag.mjs
2647
+ ```
2648
+
2649
+ This exercises the ingestion, publication and retrieval paths without an API key. Use the
2650
+ [RAG API guide](rag.md) to adapt the example to your application.
2651
+
2652
+ ## Move from the example to your application
2653
+
2654
+ 1. **Resolve scope on the server.** Derive the principal and project from the authenticated request. Create the
2655
+ [retrieval tool](rag.md#scoped-retrieval-and-tools) with that scope and its permissions. Keep provider credentials in
2656
+ host configuration, and keep scope and index selection out of the model's tool arguments.
2657
+ 2. **Pin the index space.** Record the embedder, dimensions, chunking settings and catalog scope together.
2658
+ When changing any of these, prepare a new index space. For Pinecone, provision a cosine index with self-provided
2659
+ vectors and matching dimensions. See the [Pinecone integration](../integrations/vector-pinecone.md).
2660
+ 3. **Publish from a separate ingestion workflow.** Stage embeddings first, then activate the exact revision through
2661
+ the catalog. Keep ingestion credentials and write permission out of the answering path. Preserve the durable
2662
+ journal so a restart can reuse completed work and surface uncertain results for reconciliation.
2663
+ 4. **Return evidence the viewer can open.** Resolve citations to the active source revision and check access at
2664
+ display time. Keep citation IDs paired with their source offsets. Ask the agent to abstain when it lacks enough
2665
+ evidence, and review generated claims against the cited passages.
2666
+
2667
+ ## Qualify the deployment you intend to operate
2668
+
2669
+ Use representative documents and independently reviewed questions. Include single-source and multi-source
2670
+ answers, insufficient-evidence cases, unpublished revisions and access denials. Evaluate evidence coverage and
2671
+ answer grounding separately. Measure retrieval latency and full answer latency under expected concurrent load.
2672
+
2673
+ Exercise recovery by interrupting ingestion and retrieval. Verify which operations resume, which results are
2674
+ reused, and how uncertain paid work is reconciled. Check that cleanup receipts account for every resource
2675
+ allocated by the qualification run and preserve pre-existing resources.
2676
+
2677
+ Mayura V1.2.1 qualifies the [registered Modal and Pinecone Loki v28 profile](rag-production.md) within its
2678
+ tested software-operations workload. Other combinations of corpus, models, providers and deployment settings
2679
+ need their own evidence. The 4.725-second p95 upper bound applies to acquisition and ranking in the 40-case
2680
+ evaluation. Use your own end-to-end measurements for an answer-latency target.
2681
+
2682
+ ---
2683
+
2684
+ # Run the Modal + Pinecone RAG starter
2685
+
2686
+ Source: docs/guides/rag-modal-pinecone-starter.md
2687
+
2688
+ Generate the Mayura RAG starter, run its offline demo, and connect private Modal inference and a scoped Pinecone index.
2689
+
2690
+ The `rag-modal-pinecone` starter ingests Markdown through a durable workflow and returns an answer with exact
2691
+ source revisions and offsets. It has an offline demo and a hosted mode using Nomic embeddings on Modal,
2692
+ Pinecone vectors, and Modal DeepSeek for reranking and generation.
2693
+
2694
+ ## Generate and run the demo
2695
+
2696
+ The starter is included in Mayura 1.2.2. Once that version is available on npm, generate the project with the
2697
+ published CLI.
2698
+
2699
+ ```sh
2700
+ npx mayura@1.2.2 init --starter rag-modal-pinecone --directory ./mayura-rag-starter --apply
2701
+ cd mayura-rag-starter
2702
+ npm install
2703
+ npm run dev
2704
+ npm test
2705
+ ```
2706
+
2707
+ For a source checkout, run `pnpm build` and use the built CLI from the workspace root.
2708
+
2709
+ ```sh
2710
+ node packages/cli/dist/bin.js init --starter rag-modal-pinecone --directory ../mayura-rag-starter --apply
2711
+ cd ../mayura-rag-starter
2712
+ npm install
2713
+ npm run dev
2714
+ npm test
2715
+ ```
2716
+
2717
+ The demo requires no API key and uses an in-memory vector store. It reads `fixtures/on-call.md` and prints a
2718
+ JSON answer that includes the incident-summary deadline and a citation with its document, revision, chunk ID,
2719
+ reference and exact offsets. The tests exercise the hosted protocol with local fixtures.
2720
+
2721
+ ## Connect Modal and Pinecone
2722
+
2723
+ Follow the generated README to deploy `modal-app.py` as a private Modal Function and create a Modal workspace
2724
+ proxy token before setting up a Shared Endpoint for DeepSeek V4.1 Flash 1017. In
2725
+ [Pinecone](../integrations/vector-pinecone.md), create a dedicated
2726
+ 768-dimensional cosine index with self-provided vectors. The starter uses the `2025-10` data-plane API.
2727
+
2728
+ On Windows PowerShell, set `$env:PYTHONIOENCODING = 'utf-8'` before running `modal deploy` if your console
2729
+ uses a legacy encoding. Modal streams the model pull's progress characters during the first image build.
2730
+
2731
+ Copy the generated `.env.example` to `.env`. Set the data-plane host and key, the Modal environment and SDK
2732
+ credentials, the Modal inference endpoint hostname and proxy token, and the per-operation USD-micro bounds.
2733
+ Use a stable principal ID, project ID and persistent SQLite path. Test with the sample public corpus first.
2734
+
2735
+ ```sh
2736
+ npm run build
2737
+ npm run ingest -- --hosted on-call fixtures/on-call.md
2738
+ npm run ask -- --hosted "When should the incident summary be posted?"
2739
+ ```
2740
+
2741
+ Pinecone can acknowledge changes before queries see them. Let the index catch up if the first search abstains.
2742
+ When updating a source, ingest under its existing source ID and retain the same catalog. If an ingestion
2743
+ acknowledgement is lost, keep the journal and run ID for [reconciliation](rag.md#durable-ingestion).
2744
+
2745
+ The starter shares the embedding model and provider choices of the [qualified Loki profile](rag-production.md).
2746
+ Its example corpus, prompts and deployment have their own quality and capacity characteristics. Follow
2747
+ [Build and deploy a retrieval agent](rag-deployment.md) to qualify your actual corpus, concurrency and scope policy.
2748
+
2749
+ ---
2750
+
2751
+ # Framework starters
2752
+
2753
+ Source: docs/guides/framework-starters.md
2754
+
2755
+ Generate Next.js, Hono, React Router, TanStack Start, SvelteKit or Nuxt notebooks with scoped threads and in-run approvals.
2756
+
2757
+ The six framework starters extend [mayura init](../cli/init.md) with a small persistent notebook application.
2758
+ Each includes scoped server routes, a deterministic no-cost model fixture, threads, exact approval controls,
2759
+ scripted offline tests, a separate workflow worker, deployment files and an environment example.
2760
+
2761
+ | Starter | Server route | Interface | Background processing |
2762
+ | --- | --- | --- | --- |
2763
+ | `nextjs` | App Router catch-all, Node runtime | React copy-in source | Node worker |
2764
+ | `hono` | Hono Fetch routing | Vite React copy-in source | Node/Bun/Deno process or Workers Cron |
2765
+ | `react-router` | Resource loader/action route | React copy-in source | Node worker |
2766
+ | `tanstack-start` | Server-route handlers | React copy-in source | Node worker |
2767
+ | `sveltekit` | Catch-all `+server.ts` | Native Svelte with headless stores | Node worker |
2768
+ | `nuxt` | Nitro catch-all with a Web Request/Response bridge | Native Vue with headless stores | Node worker |
2769
+
2770
+ Follow the dedicated setup for [Next.js](nextjs.md), [Hono](hono.md), [React Router](react-router.md),
2771
+ [TanStack Start](tanstack-start.md), [SvelteKit](sveltekit.md) or [Nuxt](nuxt.md).
2772
+ For other application shapes, see [Choose a starter](choosing-a-starter.md).
2773
+
2774
+ ## Generate and connect
2775
+
2776
+ ```sh
2777
+ mayura init --starter nextjs --directory /absolute/path/my-notebook --apply
2778
+ ```
2779
+
2780
+ In the generated project, install dependencies, run `npm run setup`, then `npm run dev`. The local setup writes
2781
+ an eight-hour session to ignored owner-readable files and refuses to overwrite existing files. Open `.data/login-token`
2782
+ locally and enter its value in the notebook at `http://localhost:3000`. No token is printed by setup or embedded in
2783
+ the frontend. Start `npm run worker` in another terminal to process note indexing and bounded conversation recovery.
2784
+ The generated README describes configuration and deployment for that framework.
2785
+
2786
+ The notebook asks to save one note for each submitted message. The runtime pauses for approval; the UI displays the
2787
+ captured input before an explicit approve/reject command. A successful write queues a separate durable indexing
2788
+ workflow. No model provider, network write or paid request is part of the fixture.
2789
+
2790
+ ## Scope and ownership
2791
+
2792
+ The server owns the project, verified principal, route capabilities, agent permissions, model budgets and workflow
2793
+ permissions. Browser input cannot choose an identity. The local token directory is a demonstration; production apps
2794
+ must connect the server's authenticate callback to verified application identity and issue distinct tenant sessions.
2795
+ Rotate credentials and restart the service when changing the host identity configuration.
2796
+
2797
+ `server/application.mjs` holds the portable Mayura setup. The framework mounts it under `/api/mayura/*`; the browser
2798
+ client uses an origin-pinned Fetch adapter to preserve Mayura's root route contract while adding that prefix.
2799
+ No framework action parses and reserializes run/approval payloads, so the native server owns validation and limits.
2800
+ Native event responses are streamed through the framework bridge.
2801
+
2802
+ The interface keeps a session token in memory. Thread/run selection and an unconfirmed message/key may be retained
2803
+ in this tab's session storage, under a credential digest. Re-entering the token after reload restores that selection.
2804
+ Observers only read; decisions and submissions are explicit. Retry retains the same submission key and input.
2805
+ Disconnect/unmount removes observers and credentials without pretending that a remote write was cancelled.
2806
+ An ambiguous approval or tool outcome requires inspection and safe reconciliation; it is never a browser write retry.
2807
+
2808
+ React starters include owned source from the [copy-in registry](copy-in-ui.md) for thread history, approval controls
2809
+ and the thread list. SvelteKit and Nuxt use [headless stores](react.md#other-frameworks) with native subscriptions and
2810
+ controls. The copy-in registry is React-only in 1.2. All output is rendered as plain text; long approval previews
2811
+ block approval rather than silently authorizing unseen input.
2812
+
2813
+ ## Persistence and workers
2814
+
2815
+ Node defaults to SQLite on a persistent single-host volume. PostgreSQL through `DATABASE_URL` supports shared
2816
+ replicas and serverless request hosts. Each chat invocation runs inside its request, with persisted run records
2817
+ and checkpoints. Native model and tool budgets remain explicit; the fixture costs zero. Switching providers needs
2818
+ reviewed host prices, permissions and finite call/run budgets.
2819
+
2820
+ The worker uses separate scoped workflow permissions and shared-store leadership, with bounded passes over configured
2821
+ identities. Its recovery path advances checkpoint/recording work without replaying claimed writes or model calls.
2822
+ A saved note and its workflow submission are two operations: if scheduling is unconfirmed after the note is written,
2823
+ inspect the run and reconcile the job using the note id. Never repeat the note write to repair scheduling.
2824
+
2825
+ Deploy source includes a Docker image and Compose web/worker services sharing one database volume. Supply the exact
2826
+ public origin and runtime credentials at deployment; local configuration and generated framework output are excluded
2827
+ from starter packaging. Use shared PostgreSQL rather than unshared SQLite files for multiple hosts. Allow at least
2828
+ 30 seconds for the configured request/run bounds. A trusted scheduler may call the bounded application `runOnce`;
2829
+ there is no public Cron route.
2830
+
2831
+ Hono additionally includes Bun and Deno entry points using PostgreSQL without native SQLite imports. Workers uses
2832
+ the optional D1 extension, a Workers assets binding and a scheduled handler. Configure its D1 binding, public origin,
2833
+ project and secret identity directory before use. Its frontend is built by Vite; serve only the built asset directory.
2834
+
2835
+ ## Validation and remaining qualifications
2836
+
2837
+ The starter suite passed locally for all 11 starters, including all six frameworks. It builds and boots each framework in the workspace, exercises its mounted approval flow,
2838
+ and generates, packs, installs and tests each server contract offline. Like the existing Vite starters, framework toolchains
2839
+ are qualified in the workspace; generated packed installs qualify the Mayura server contract separately.
2840
+ The shared runtime checks passed on Bun, Deno, workerd and Vercel Edge; they do not qualify the Hono-specific Bun/Deno entry points or a deployed Workers/D1 application. Those profiles and rendered browser interaction checks remain outstanding.
2841
+
2842
+ Tests, type checks, framework builds and mounted HTTP approval/worker flows passed locally on Windows using Node 24.15.0 for framework qualification. The final V1.2 main qualification passed all 39 jobs, including Linux/macOS/Windows Node 22/24 consumer lanes. This does not establish rendered browser or live deployment qualification. TanStack's Node adapter uses a pinned Nitro beta; framework compiler integrations use TypeScript 6 tooling. Keep the starter's declared Node version and repeat qualification on the target deployment. See [release validation status](release-readiness.md).
2843
+
2844
+ The Stagehand/OpenAI/Zod and Mistral/OpenTelemetry peer conflicts are resolved in the workspace lockfile. An exact
2845
+ local pnpm metadata hook gives the legacy OpenAI 4 SDK its own supported Zod 3 dependency; Mayura, Stagehand and
2846
+ its Ollama transport keep Zod 4. Root development dependencies provide Mistral's OpenTelemetry 2.9 peers. Strict
2847
+ peer checks remain enabled. Frozen installation with lifecycle scripts disabled, local builds and offline package compatibility checks passed.
2848
+
2849
+ ---
2850
+
2851
+ # Mayura with Next.js
2852
+
2853
+ Source: docs/guides/nextjs.md
2854
+
2855
+ Run the Next.js notebook starter with persistent threads, exact tool approvals, a scoped server and a separate durable worker.
2856
+
2857
+ Use the `nextjs` starter to build a Next.js application with a working approval flow before adding a paid model.
2858
+ It includes persistent scoped chat, a deterministic note agent, an explicit approve/reject interface and a separate
2859
+ durable indexing worker. This is runnable application source, not a hosted service.
2860
+
2861
+ ## Generate and run
2862
+
2863
+ Use Node 24.14.1 or a later supported 24.x version. Run the initializer from a directory you own;
2864
+ inspect its plan before applying it to an existing project.
2865
+
2866
+ ```sh
2867
+ npx mayura@1.2.1 init --starter nextjs --directory ./my-notebook --apply
2868
+ cd my-notebook
2869
+ npm install
2870
+ npm run setup
2871
+ npm run dev
2872
+ ```
2873
+
2874
+ Open `http://localhost:3000`. Read the generated ignored `.data/login-token` file locally and enter its value in
2875
+ the notebook's password field. Setup creates an eight-hour local session, never prints its token, and refuses to
2876
+ replace existing credentials. Keep `.env` and `.data` out of source control.
2877
+
2878
+ In another terminal, inside the generated project:
2879
+
2880
+ ```sh
2881
+ npm run worker
2882
+ ```
2883
+
2884
+ ## Follow a complete conversation
2885
+
2886
+ 1. Connect with the local session and create a thread.
2887
+ 2. Send a note. Inspect the exact proposed input before approving or rejecting it.
2888
+ 3. Approve once: the note is saved and a separate durable indexing workflow is submitted.
2889
+ 4. Let the worker process the index job. Reload, re-enter the session and inspect the persisted history.
2890
+ 5. If a response is lost, inspect the saved run before using the explicit recovery action. Do not send the note again
2891
+ with a new key to repair an uncertain write.
2892
+
2893
+ The fixture needs no provider API key, model billing or external write. A rejected proposal must not save a note.
2894
+ Thread history and approval controls remain scoped to the identity verified by the server.
2895
+
2896
+ ## Framework boundary
2897
+
2898
+ The App Router catch-all exports the native HTTP methods and uses the Node runtime. Keep the Mayura host in the server module; never import it into a client component. The page renders the React notebook while browser transport adds the API mount prefix.
2899
+
2900
+ | Part | Generated location |
2901
+ | --- | --- |
2902
+ | HTTP bridge | `app/api/mayura/[[...path]]/route.ts` |
2903
+ | Notebook interface | `app/page.tsx` |
2904
+ | Application and tool configuration | `server/application.mjs` |
2905
+ | Session verification | `server/auth.mjs` |
2906
+ | Background processing | `server/worker.mjs` |
2907
+
2908
+ The API is mounted at `/api/mayura/*`; the browser's origin-pinned transport preserves the native Mayura route
2909
+ contract while adding that prefix. Keep interactive controls inside the existing client boundary. Customize the copied React components rather than sending the private session directory through page props. The server route must preserve event-stream response bodies and avoid caching authenticated run responses.
2910
+
2911
+ ## Customize identity, tools and storage
2912
+
2913
+ Replace the single-user demonstration authenticator with verified application identity before opening the app to
2914
+ customers. The host fixes principal, project, route capabilities and agent permissions. Browser input cannot choose
2915
+ a tenant or grant itself a capability. Never distribute one shared owner token to multiple customers.
2916
+
2917
+ The note agent and indexing worker have separate grants. If you replace the fixture model, declare the model grant,
2918
+ prices, finite per-call cost cap and run budget. A gateway subscription does not remove those limits. See
2919
+ [AI gateways](ai-gateways.md) and [authorization](authorization.md).
2920
+
2921
+ Use the generated Node deployment first. A serverless Next.js host needs shared PostgreSQL and a trusted worker or scheduler outside the request lifecycle. A local SQLite file is not shared across function instances. The starter is not a React Server Actions transport: approvals go through the scoped HTTP API.
2922
+
2923
+ A note write and workflow submission are separate operations. If scheduling is unconfirmed after the note was saved,
2924
+ reconcile the missing index job using the note's identity; never replay the browser write to repair scheduling.
2925
+ See [framework starter architecture](framework-starters.md) for worker leadership, retention and recovery details.
2926
+
2927
+ ## Verify your changes
2928
+
2929
+ ```sh
2930
+ npm test
2931
+ npm run typecheck
2932
+ npm run build
2933
+ ```
2934
+
2935
+ The V1.2 release passed the complete cross-platform qualification matrix, including generated packed server
2936
+ contracts and workspace framework builds/HTTP approval flows. Rendered browser interaction and actual framework
2937
+ deployments are separate checks; qualify your target before exposing customer data. See
2938
+ [release validation status](release-readiness.md) and [deployment](deployment.md).
2939
+
2940
+ ## Continue building
2941
+
2942
+ - [Threads and compaction](threads.md): history, recording and bounded summaries.
2943
+ - [Approvals and human input](approvals-and-human-input.md): exact-call decisions and durable resumption.
2944
+ - [Copy-in UI](copy-in-ui.md) and [headless stores](react.md): customize the conversation interface.
2945
+ - [Choose a starter](choosing-a-starter.md): compare this notebook with the other application shapes.
2946
+
2947
+ ---
2948
+
2949
+ # Mayura with Hono
2950
+
2951
+ Source: docs/guides/hono.md
2952
+
2953
+ Run the Hono notebook starter with persistent threads, exact tool approvals, a scoped server and a separate durable worker.
2954
+
2955
+ Use the `hono` starter to build a Hono application with a working approval flow before adding a paid model.
2956
+ It includes persistent scoped chat, a deterministic note agent, an explicit approve/reject interface and a separate
2957
+ durable indexing worker. This is runnable application source, not a hosted service.
2958
+
2959
+ ## Generate and run
2960
+
2961
+ Use Node 24.14.1 or a later supported 24.x version. Run the initializer from a directory you own;
2962
+ inspect its plan before applying it to an existing project.
2963
+
2964
+ ```sh
2965
+ npx mayura@1.2.1 init --starter hono --directory ./my-notebook --apply
2966
+ cd my-notebook
2967
+ npm install
2968
+ npm run setup
2969
+ npm run dev
2970
+ ```
2971
+
2972
+ Open `http://localhost:3000`. Read the generated ignored `.data/login-token` file locally and enter its value in
2973
+ the notebook's password field. Setup creates an eight-hour local session, never prints its token, and refuses to
2974
+ replace existing credentials. Keep `.env` and `.data` out of source control.
2975
+
2976
+ In another terminal, inside the generated project:
2977
+
2978
+ ```sh
2979
+ npm run worker
2980
+ ```
2981
+
2982
+ ## Follow a complete conversation
2983
+
2984
+ 1. Connect with the local session and create a thread.
2985
+ 2. Send a note. Inspect the exact proposed input before approving or rejecting it.
2986
+ 3. Approve once: the note is saved and a separate durable indexing workflow is submitted.
2987
+ 4. Let the worker process the index job. Reload, re-enter the session and inspect the persisted history.
2988
+ 5. If a response is lost, inspect the saved run before using the explicit recovery action. Do not send the note again
2989
+ with a new key to repair an uncertain write.
2990
+
2991
+ The fixture needs no provider API key, model billing or external write. A rejected proposal must not save a note.
2992
+ Thread history and approval controls remain scoped to the identity verified by the server.
2993
+
2994
+ ## Framework boundary
2995
+
2996
+ Hono mounts the native Fetch handler while Vite builds the React notebook. The Node entry point and the separate worker share the application configuration. Keep the API prefix and the origin-pinned browser transport in agreement when mounting behind another router.
2997
+
2998
+ | Part | Generated location |
2999
+ | --- | --- |
3000
+ | HTTP bridge | `server/hono-node.mjs` |
3001
+ | Notebook interface | `src/` |
3002
+ | Application and tool configuration | `server/application.mjs` |
3003
+ | Session verification | `server/auth.mjs` |
3004
+ | Background processing | `server/worker.mjs` |
3005
+
3006
+ The API is mounted at `/api/mayura/*`; the browser's origin-pinned transport preserves the native Mayura route
3007
+ contract while adding that prefix. Start with the Node path before selecting another runtime. Review the generated start:bun, start:deno, dev:workers and deploy:workers scripts rather than reusing Node SQLite imports at the edge. Workers needs a configured D1 binding and secret identity directory; serve only built frontend assets.
3008
+
3009
+ ## Customize identity, tools and storage
3010
+
3011
+ Replace the single-user demonstration authenticator with verified application identity before opening the app to
3012
+ customers. The host fixes principal, project, route capabilities and agent permissions. Browser input cannot choose
3013
+ a tenant or grant itself a capability. Never distribute one shared owner token to multiple customers.
3014
+
3015
+ The note agent and indexing worker have separate grants. If you replace the fixture model, declare the model grant,
3016
+ prices, finite per-call cost cap and run budget. A gateway subscription does not remove those limits. See
3017
+ [AI gateways](ai-gateways.md) and [authorization](authorization.md).
3018
+
3019
+ The starter also ships Bun and Deno entry points using PostgreSQL, and Workers source with a D1 binding, assets and a scheduled handler. Those application-specific profiles still need qualification on the target host; shared runtime CI is not a live Workers deployment check.
3020
+
3021
+ A note write and workflow submission are separate operations. If scheduling is unconfirmed after the note was saved,
3022
+ reconcile the missing index job using the note's identity; never replay the browser write to repair scheduling.
3023
+ See [framework starter architecture](framework-starters.md) for worker leadership, retention and recovery details.
3024
+
3025
+ ## Verify your changes
3026
+
3027
+ ```sh
3028
+ npm test
3029
+ npm run typecheck
3030
+ npm run build
3031
+ ```
3032
+
3033
+ The V1.2 release passed the complete cross-platform qualification matrix, including generated packed server
3034
+ contracts and workspace framework builds/HTTP approval flows. Rendered browser interaction and actual framework
3035
+ deployments are separate checks; qualify your target before exposing customer data. See
3036
+ [release validation status](release-readiness.md) and [deployment](deployment.md).
3037
+
3038
+ ## Continue building
3039
+
3040
+ - [Threads and compaction](threads.md): history, recording and bounded summaries.
3041
+ - [Approvals and human input](approvals-and-human-input.md): exact-call decisions and durable resumption.
3042
+ - [Copy-in UI](copy-in-ui.md) and [headless stores](react.md): customize the conversation interface.
3043
+ - [Choose a starter](choosing-a-starter.md): compare this notebook with the other application shapes.
3044
+
3045
+ ---
3046
+
3047
+ # Mayura with React Router
3048
+
3049
+ Source: docs/guides/react-router.md
3050
+
3051
+ Run the React Router notebook starter with persistent threads, exact tool approvals, a scoped server and a separate durable worker.
3052
+
3053
+ Use the `react-router` starter to build a React Router application with a working approval flow before adding a paid model.
3054
+ It includes persistent scoped chat, a deterministic note agent, an explicit approve/reject interface and a separate
3055
+ durable indexing worker. This is runnable application source, not a hosted service.
3056
+
3057
+ ## Generate and run
3058
+
3059
+ Use Node 24.14.1 or a later supported 24.x version. Run the initializer from a directory you own;
3060
+ inspect its plan before applying it to an existing project.
3061
+
3062
+ ```sh
3063
+ npx mayura@1.2.1 init --starter react-router --directory ./my-notebook --apply
3064
+ cd my-notebook
3065
+ npm install
3066
+ npm run setup
3067
+ npm run dev
3068
+ ```
3069
+
3070
+ Open `http://localhost:3000`. Read the generated ignored `.data/login-token` file locally and enter its value in
3071
+ the notebook's password field. Setup creates an eight-hour local session, never prints its token, and refuses to
3072
+ replace existing credentials. Keep `.env` and `.data` out of source control.
3073
+
3074
+ In another terminal, inside the generated project:
3075
+
3076
+ ```sh
3077
+ npm run worker
3078
+ ```
3079
+
3080
+ ## Follow a complete conversation
3081
+
3082
+ 1. Connect with the local session and create a thread.
3083
+ 2. Send a note. Inspect the exact proposed input before approving or rejecting it.
3084
+ 3. Approve once: the note is saved and a separate durable indexing workflow is submitted.
3085
+ 4. Let the worker process the index job. Reload, re-enter the session and inspect the persisted history.
3086
+ 5. If a response is lost, inspect the saved run before using the explicit recovery action. Do not send the note again
3087
+ with a new key to repair an uncertain write.
3088
+
3089
+ The fixture needs no provider API key, model billing or external write. A rejected proposal must not save a note.
3090
+ Thread history and approval controls remain scoped to the identity verified by the server.
3091
+
3092
+ ## Framework boundary
3093
+
3094
+ The resource route forwards loader requests and action requests to the same native handler. The home route hosts the React notebook. Keep the resource route separate from page data loaders so authenticated run responses and event streams are not transformed into page data.
3095
+
3096
+ | Part | Generated location |
3097
+ | --- | --- |
3098
+ | HTTP bridge | `app/routes/api.ts` |
3099
+ | Notebook interface | `app/routes/home.tsx` |
3100
+ | Application and tool configuration | `server/application.mjs` |
3101
+ | Session verification | `server/auth.mjs` |
3102
+ | Background processing | `server/worker.mjs` |
3103
+
3104
+ The API is mounted at `/api/mayura/*`; the browser's origin-pinned transport preserves the native Mayura route
3105
+ contract while adding that prefix. Use React Router for navigation and Mayura stores for thread/run observation. Unmounting a route disposes its observers; it must not automatically resubmit the previous message or approve the captured call. Preserve the exact submission key when explicitly recovering a lost response.
3106
+
3107
+ ## Customize identity, tools and storage
3108
+
3109
+ Replace the single-user demonstration authenticator with verified application identity before opening the app to
3110
+ customers. The host fixes principal, project, route capabilities and agent permissions. Browser input cannot choose
3111
+ a tenant or grant itself a capability. Never distribute one shared owner token to multiple customers.
3112
+
3113
+ The note agent and indexing worker have separate grants. If you replace the fixture model, declare the model grant,
3114
+ prices, finite per-call cost cap and run budget. A gateway subscription does not remove those limits. See
3115
+ [AI gateways](ai-gateways.md) and [authorization](authorization.md).
3116
+
3117
+ Build and serve the generated React Router Node application with its separate worker. A persistent single-host deployment can share the SQLite volume; replicas need shared PostgreSQL. Route actions do not replace the background worker or guarantee that a remote write was cancelled when navigation stops.
3118
+
3119
+ A note write and workflow submission are separate operations. If scheduling is unconfirmed after the note was saved,
3120
+ reconcile the missing index job using the note's identity; never replay the browser write to repair scheduling.
3121
+ See [framework starter architecture](framework-starters.md) for worker leadership, retention and recovery details.
3122
+
3123
+ ## Verify your changes
3124
+
3125
+ ```sh
3126
+ npm test
3127
+ npm run typecheck
3128
+ npm run build
3129
+ ```
3130
+
3131
+ The V1.2 release passed the complete cross-platform qualification matrix, including generated packed server
3132
+ contracts and workspace framework builds/HTTP approval flows. Rendered browser interaction and actual framework
3133
+ deployments are separate checks; qualify your target before exposing customer data. See
3134
+ [release validation status](release-readiness.md) and [deployment](deployment.md).
3135
+
3136
+ ## Continue building
3137
+
3138
+ - [Threads and compaction](threads.md): history, recording and bounded summaries.
3139
+ - [Approvals and human input](approvals-and-human-input.md): exact-call decisions and durable resumption.
3140
+ - [Copy-in UI](copy-in-ui.md) and [headless stores](react.md): customize the conversation interface.
3141
+ - [Choose a starter](choosing-a-starter.md): compare this notebook with the other application shapes.
3142
+
3143
+ ---
3144
+
3145
+ # Mayura with TanStack Start
3146
+
3147
+ Source: docs/guides/tanstack-start.md
3148
+
3149
+ Run the TanStack Start notebook starter with persistent threads, exact tool approvals, a scoped server and a separate durable worker.
3150
+
3151
+ Use the `tanstack-start` starter to build a TanStack Start application with a working approval flow before adding a paid model.
3152
+ It includes persistent scoped chat, a deterministic note agent, an explicit approve/reject interface and a separate
3153
+ durable indexing worker. This is runnable application source, not a hosted service.
3154
+
3155
+ ## Generate and run
3156
+
3157
+ Use Node 24.14.1 or a later supported 24.x version. Run the initializer from a directory you own;
3158
+ inspect its plan before applying it to an existing project.
3159
+
3160
+ ```sh
3161
+ npx mayura@1.2.1 init --starter tanstack-start --directory ./my-notebook --apply
3162
+ cd my-notebook
3163
+ npm install
3164
+ npm run setup
3165
+ npm run dev
3166
+ ```
3167
+
3168
+ Open `http://localhost:3000`. Read the generated ignored `.data/login-token` file locally and enter its value in
3169
+ the notebook's password field. Setup creates an eight-hour local session, never prints its token, and refuses to
3170
+ replace existing credentials. Keep `.env` and `.data` out of source control.
3171
+
3172
+ In another terminal, inside the generated project:
3173
+
3174
+ ```sh
3175
+ npm run worker
3176
+ ```
3177
+
3178
+ ## Follow a complete conversation
3179
+
3180
+ 1. Connect with the local session and create a thread.
3181
+ 2. Send a note. Inspect the exact proposed input before approving or rejecting it.
3182
+ 3. Approve once: the note is saved and a separate durable indexing workflow is submitted.
3183
+ 4. Let the worker process the index job. Reload, re-enter the session and inspect the persisted history.
3184
+ 5. If a response is lost, inspect the saved run before using the explicit recovery action. Do not send the note again
3185
+ with a new key to repair an uncertain write.
3186
+
3187
+ The fixture needs no provider API key, model billing or external write. A rejected proposal must not save a note.
3188
+ Thread history and approval controls remain scoped to the identity verified by the server.
3189
+
3190
+ ## Framework boundary
2071
3191
 
2072
- Durable workflow runtimes accept a host-owned core `authorization` instance alongside their static grants and
2073
- budget limits. It gates workflow/run execution, tools and child delegation, including loop and saga children.
2074
- Revoked execution never authorizes replay of a dispatched effect; known receipts and charges remain durable while
2075
- output can be withheld. See the [authorization guide](../guides/authorization.md#workflow-execution-and-child-workflows)
2076
- for resource IDs, actions, audit delivery and the boundary between workers and HTTP operator controls.
3192
+ The file route registers native GET, POST, DELETE, OPTIONS and HEAD handlers. Each forwards the Request to the portable server module. The index route renders the notebook. Keep this server route boundary instead of serializing approval commands through a server function.
2077
3193
 
2078
- ---
3194
+ | Part | Generated location |
3195
+ | --- | --- |
3196
+ | HTTP bridge | `src/routes/api.mayura.$.ts` |
3197
+ | Notebook interface | `src/routes/index.tsx` |
3198
+ | Application and tool configuration | `server/application.mjs` |
3199
+ | Session verification | `server/auth.mjs` |
3200
+ | Background processing | `server/worker.mjs` |
2079
3201
 
2080
- # Framework starters
3202
+ The API is mounted at `/api/mayura/*`; the browser's origin-pinned transport preserves the native Mayura route
3203
+ contract while adding that prefix. Keep server-only imports out of the React page bundle. Update the route prefix and browser transport together if the application moves under another mount. Native stream responses should pass through unchanged so run events and approval pauses remain observable.
2081
3204
 
2082
- Source: docs/guides/framework-starters.md
3205
+ ## Customize identity, tools and storage
2083
3206
 
2084
- Generate Next.js, Hono, React Router, TanStack Start, SvelteKit or Nuxt notebooks with scoped threads and in-run approvals.
3207
+ Replace the single-user demonstration authenticator with verified application identity before opening the app to
3208
+ customers. The host fixes principal, project, route capabilities and agent permissions. Browser input cannot choose
3209
+ a tenant or grant itself a capability. Never distribute one shared owner token to multiple customers.
2085
3210
 
2086
- The six framework starters extend [mayura init](../cli/init.md) with a small persistent notebook application.
2087
- Each includes scoped server routes, a deterministic no-cost model fixture, threads, exact approval controls,
2088
- scripted offline tests, a separate workflow worker, deployment files and an environment example.
3211
+ The note agent and indexing worker have separate grants. If you replace the fixture model, declare the model grant,
3212
+ prices, finite per-call cost cap and run budget. A gateway subscription does not remove those limits. See
3213
+ [AI gateways](ai-gateways.md) and [authorization](authorization.md).
2089
3214
 
2090
- | Starter | Server route | Interface | Background processing |
2091
- | --- | --- | --- | --- |
2092
- | `nextjs` | App Router catch-all, Node runtime | React copy-in source | Node worker |
2093
- | `hono` | Hono Fetch routing | Vite React copy-in source | Node/Bun/Deno process or Workers Cron |
2094
- | `react-router` | Resource loader/action route | React copy-in source | Node worker |
2095
- | `tanstack-start` | Server-route handlers | React copy-in source | Node worker |
2096
- | `sveltekit` | Catch-all `+server.ts` | Native Svelte with headless stores | Node worker |
2097
- | `nuxt` | Nitro catch-all with a Web Request/Response bridge | Native Vue with headless stores | Node worker |
3215
+ The generated Node adapter uses a pinned Nitro beta. Retain the starter toolchain and verify the build on the actual deployment before changing adapter versions. The worker is a separate Node process; a server route alone does not advance the durable indexing workflow.
2098
3216
 
2099
- ## Generate and connect
3217
+ A note write and workflow submission are separate operations. If scheduling is unconfirmed after the note was saved,
3218
+ reconcile the missing index job using the note's identity; never replay the browser write to repair scheduling.
3219
+ See [framework starter architecture](framework-starters.md) for worker leadership, retention and recovery details.
3220
+
3221
+ ## Verify your changes
2100
3222
 
2101
3223
  ```sh
2102
- mayura init --starter nextjs --directory /absolute/path/my-notebook --apply
3224
+ npm test
3225
+ npm run typecheck
3226
+ npm run build
2103
3227
  ```
2104
3228
 
2105
- In the generated project, install dependencies, run `npm run setup`, then `npm run dev`. The local setup writes
2106
- an eight-hour session to ignored owner-readable files and refuses to overwrite existing files. Open `.data/login-token`
2107
- locally and enter its value in the notebook at `http://localhost:3000`. No token is printed by setup or embedded in
2108
- the frontend. Start `npm run worker` in another terminal to process note indexing and bounded conversation recovery.
2109
- The generated README describes configuration and deployment for that framework.
3229
+ The V1.2 release passed the complete cross-platform qualification matrix, including generated packed server
3230
+ contracts and workspace framework builds/HTTP approval flows. Rendered browser interaction and actual framework
3231
+ deployments are separate checks; qualify your target before exposing customer data. See
3232
+ [release validation status](release-readiness.md) and [deployment](deployment.md).
2110
3233
 
2111
- The notebook asks to save one note for each submitted message. The runtime pauses for approval; the UI displays the
2112
- captured input before an explicit approve/reject command. A successful write queues a separate durable indexing
2113
- workflow. No model provider, network write or paid request is part of the fixture.
3234
+ ## Continue building
2114
3235
 
2115
- ## Scope and ownership
3236
+ - [Threads and compaction](threads.md): history, recording and bounded summaries.
3237
+ - [Approvals and human input](approvals-and-human-input.md): exact-call decisions and durable resumption.
3238
+ - [Copy-in UI](copy-in-ui.md) and [headless stores](react.md): customize the conversation interface.
3239
+ - [Choose a starter](choosing-a-starter.md): compare this notebook with the other application shapes.
2116
3240
 
2117
- The server owns the project, verified principal, route capabilities, agent permissions, model budgets and workflow
2118
- permissions. Browser input cannot choose an identity. The local token directory is a demonstration; production apps
2119
- must connect the server's authenticate callback to verified application identity and issue distinct tenant sessions.
2120
- Rotate credentials and restart the service when changing the host identity configuration.
3241
+ ---
2121
3242
 
2122
- `server/application.mjs` holds the portable Mayura setup. The framework mounts it under `/api/mayura/*`; the browser
2123
- client uses an origin-pinned Fetch adapter to preserve Mayura's root route contract while adding that prefix.
2124
- No framework action parses and reserializes run/approval payloads, so the native server owns validation and limits.
2125
- Native event responses are streamed through the framework bridge.
3243
+ # Mayura with SvelteKit
2126
3244
 
2127
- The interface keeps a session token in memory. Thread/run selection and an unconfirmed message/key may be retained
2128
- in this tab's session storage, under a credential digest. Re-entering the token after reload restores that selection.
2129
- Observers only read; decisions and submissions are explicit. Retry retains the same submission key and input.
2130
- Disconnect/unmount removes observers and credentials without pretending that a remote write was cancelled.
2131
- An ambiguous approval or tool outcome requires inspection and safe reconciliation; it is never a browser write retry.
3245
+ Source: docs/guides/sveltekit.md
2132
3246
 
2133
- React starters include owned source from the [copy-in registry](copy-in-ui.md) for thread history, approval controls
2134
- and the thread list. SvelteKit and Nuxt use [headless stores](react.md#other-frameworks) with native subscriptions and
2135
- controls. The copy-in registry is React-only in 1.2. All output is rendered as plain text; long approval previews
2136
- block approval rather than silently authorizing unseen input.
3247
+ Run the SvelteKit notebook starter with persistent threads, exact tool approvals, a scoped server and a separate durable worker.
2137
3248
 
2138
- ## Persistence and workers
3249
+ Use the `sveltekit` starter to build a SvelteKit application with a working approval flow before adding a paid model.
3250
+ It includes persistent scoped chat, a deterministic note agent, an explicit approve/reject interface and a separate
3251
+ durable indexing worker. This is runnable application source, not a hosted service.
2139
3252
 
2140
- Node defaults to SQLite on a persistent single-host volume. PostgreSQL through `DATABASE_URL` supports shared
2141
- replicas and serverless request hosts. Each chat invocation runs inside its request, with persisted run records
2142
- and checkpoints. Native model and tool budgets remain explicit; the fixture costs zero. Switching providers needs
2143
- reviewed host prices, permissions and finite call/run budgets.
3253
+ ## Generate and run
2144
3254
 
2145
- The worker uses separate scoped workflow permissions and shared-store leadership, with bounded passes over configured
2146
- identities. Its recovery path advances checkpoint/recording work without replaying claimed writes or model calls.
2147
- A saved note and its workflow submission are two operations: if scheduling is unconfirmed after the note is written,
2148
- inspect the run and reconcile the job using the note id. Never repeat the note write to repair scheduling.
3255
+ Use Node 24.14.1 or a later supported 24.x version. Run the initializer from a directory you own;
3256
+ inspect its plan before applying it to an existing project.
2149
3257
 
2150
- Deploy source includes a Docker image and Compose web/worker services sharing one database volume. Supply the exact
2151
- public origin and runtime credentials at deployment; local configuration and generated framework output are excluded
2152
- from starter packaging. Use shared PostgreSQL rather than unshared SQLite files for multiple hosts. Allow at least
2153
- 30 seconds for the configured request/run bounds. A trusted scheduler may call the bounded application `runOnce`;
2154
- there is no public Cron route.
3258
+ ```sh
3259
+ npx mayura@1.2.1 init --starter sveltekit --directory ./my-notebook --apply
3260
+ cd my-notebook
3261
+ npm install
3262
+ npm run setup
3263
+ npm run dev
3264
+ ```
2155
3265
 
2156
- Hono additionally includes Bun and Deno entry points using PostgreSQL without native SQLite imports. Workers uses
2157
- the optional D1 extension, a Workers assets binding and a scheduled handler. Configure its D1 binding, public origin,
2158
- project and secret identity directory before use. Its frontend is built by Vite; serve only the built asset directory.
3266
+ Open `http://localhost:3000`. Read the generated ignored `.data/login-token` file locally and enter its value in
3267
+ the notebook's password field. Setup creates an eight-hour local session, never prints its token, and refuses to
3268
+ replace existing credentials. Keep `.env` and `.data` out of source control.
2159
3269
 
2160
- ## Validation and remaining qualifications
3270
+ In another terminal, inside the generated project:
2161
3271
 
2162
- The starter suite passed locally for all 11 starters, including all six frameworks. It builds and boots each framework in the workspace, exercises its mounted approval flow,
2163
- and generates, packs, installs and tests each server contract offline. Like the existing Vite starters, framework toolchains
2164
- are qualified in the workspace; generated packed installs qualify the Mayura server contract separately.
2165
- The shared runtime checks passed on Bun, Deno, workerd and Vercel Edge; they do not qualify the Hono-specific Bun/Deno entry points or a deployed Workers/D1 application. Those profiles and rendered browser interaction checks remain outstanding.
3272
+ ```sh
3273
+ npm run worker
3274
+ ```
2166
3275
 
2167
- Tests, type checks, framework builds and mounted HTTP approval/worker flows passed locally on Windows using Node 24.15.0 for framework qualification. Rendered browser checks, live deployments and the full Linux/macOS and Node 22/24 CI matrix remain outstanding. TanStack's Node adapter uses a pinned Nitro beta; framework compiler integrations use TypeScript 6 tooling. Keep the starter's declared Node version and repeat qualification on the target deployment. See [release validation status](release-readiness.md).
3276
+ ## Follow a complete conversation
2168
3277
 
2169
- The Stagehand/OpenAI/Zod and Mistral/OpenTelemetry peer conflicts are resolved in the workspace lockfile. An exact
2170
- local pnpm metadata hook gives the legacy OpenAI 4 SDK its own supported Zod 3 dependency; Mayura, Stagehand and
2171
- its Ollama transport keep Zod 4. Root development dependencies provide Mistral's OpenTelemetry 2.9 peers. Strict
2172
- peer checks remain enabled. Frozen installation with lifecycle scripts disabled, local builds and offline package compatibility checks passed.
3278
+ 1. Connect with the local session and create a thread.
3279
+ 2. Send a note. Inspect the exact proposed input before approving or rejecting it.
3280
+ 3. Approve once: the note is saved and a separate durable indexing workflow is submitted.
3281
+ 4. Let the worker process the index job. Reload, re-enter the session and inspect the persisted history.
3282
+ 5. If a response is lost, inspect the saved run before using the explicit recovery action. Do not send the note again
3283
+ with a new key to repair an uncertain write.
2173
3284
 
2174
- ---
3285
+ The fixture needs no provider API key, model billing or external write. A rejected proposal must not save a note.
3286
+ Thread history and approval controls remain scoped to the identity verified by the server.
2175
3287
 
2176
- # Retrieval augmented generation
3288
+ ## Framework boundary
2177
3289
 
2178
- Source: docs/guides/rag.md
3290
+ The catch-all +server.ts forwards the native HTTP methods to the application handler. The page uses native Svelte controls and headless stores, not React components. Keep connection setup and subscriptions in the browser lifecycle, with disposal when the page disconnects.
2179
3291
 
2180
- Scoped retrieval tools, durable content-addressed ingestion, vector adapters, citations and bounded reranking.
3292
+ | Part | Generated location |
3293
+ | --- | --- |
3294
+ | HTTP bridge | `src/routes/api/mayura/[...path]/+server.ts` |
3295
+ | Notebook interface | `src/routes/+page.svelte` |
3296
+ | Application and tool configuration | `server/application.mjs` |
3297
+ | Session verification | `server/auth.mjs` |
3298
+ | Background processing | `server/worker.mjs` |
2181
3299
 
2182
- `mayura/rag` adds retrieval without giving a model a database connection or letting it choose a principal, project,
2183
- index or filter. Host code loads documents, stages embeddings and publishes a revision. A retrieval tool returns
2184
- only authorized evidence and exact citation identities. This is an experimental 1.2 surface; source, examples and
2185
- regression cases pass local offline validation, including builds, documentation and package checks. Real service qualification remains outstanding; see [release validation status](release-readiness.md).
3300
+ The API is mounted at `/api/mayura/*`; the browser's origin-pinned transport preserves the native Mayura route
3301
+ contract while adding that prefix. Subscribe to the headless thread, run and approval snapshots from the Svelte view. Keep approve/reject behind explicit controls bound to the displayed call. The React copy-in registry does not generate Svelte source in 1.2; the included Svelte interface is the supported starting point.
2186
3302
 
2187
- ## Architecture
3303
+ ## Customize identity, tools and storage
2188
3304
 
2189
- A `VectorStore` is a trusted infrastructure boundary. Each operation includes a verified scope and a pinned index
2190
- space. A separate `RagCatalog` is the authority for the active revision and its exact chunk IDs. Search results
2191
- from abandoned, superseded or deleted revisions are discarded before reranking and again before disclosure.
2192
- `aggregateRagCatalog` uses the existing compare-and-set aggregate contract on all storage adapters; no new database
2193
- schema is needed for the catalog or ingestion journal.
3305
+ Replace the single-user demonstration authenticator with verified application identity before opening the app to
3306
+ customers. The host fixes principal, project, route capabilities and agent permissions. Browser input cannot choose
3307
+ a tenant or grant itself a capability. Never distribute one shared owner token to multiple customers.
2194
3308
 
2195
- Two built-in vector backends are available: `inMemoryVectorStore` is bounded exact cosine plus lexical overlap;
2196
- `nativeMemoryVectorStore` uses the native memory tables in a separate scope, BM25 and a bounded exact vector scan.
2197
- Initialize `store.memory` before using the native adapter; declare its `location` and whole-operation `costMicros` ceiling, including the bounded scan's storage reads. Neither backend performs network or model calls.
2198
- The hashing embedder is deterministic lexical feature hashing, not a semantic model.
3309
+ The note agent and indexing worker have separate grants. If you replace the fixture model, declare the model grant,
3310
+ prices, finite per-call cost cap and run budget. A gateway subscription does not remove those limits. See
3311
+ [AI gateways](ai-gateways.md) and [authorization](authorization.md).
2199
3312
 
2200
- ## Durable ingestion
3313
+ Use the generated Node host and a separate Node worker. Review the SvelteKit adapter before switching deployment platforms. PostgreSQL supports multiple hosts; SQLite needs a persistent volume shared with the worker. Serverless hosting still needs a trusted path to advance bounded background work.
2201
3314
 
2202
- The offline runnable example is `examples/rag.mjs` in the repository. After building the workspace:
3315
+ A note write and workflow submission are separate operations. If scheduling is unconfirmed after the note was saved,
3316
+ reconcile the missing index job using the note's identity; never replay the browser write to repair scheduling.
3317
+ See [framework starter architecture](framework-starters.md) for worker leadership, retention and recovery details.
2203
3318
 
2204
- ```bash
2205
- node examples/rag.mjs
3319
+ ## Verify your changes
3320
+
3321
+ ```sh
3322
+ npm test
3323
+ npm run typecheck
3324
+ npm run build
2206
3325
  ```
2207
3326
 
2208
- It loads Markdown, runs a two-step durable workflow, indexes locally, gives an agent a scoped retrieval tool and
2209
- returns an answer with exact citations. Its scripted model and hashing embedder perform no inference or network.
3327
+ The V1.2 release passed the complete cross-platform qualification matrix, including generated packed server
3328
+ contracts and workspace framework builds/HTTP approval flows. Rendered browser interaction and actual framework
3329
+ deployments are separate checks; qualify your target before exposing customer data. See
3330
+ [release validation status](release-readiness.md) and [deployment](deployment.md).
2210
3331
 
2211
- Define ingestion with `defineRagIngestion` and submit it to the conservative `createWorkflowRuntime` from
2212
- [workflows](../concepts/workflows.md). Pass a host-owned `journal`, `catalog`, vector `store`, priced `embedder`,
2213
- `chunking`, scope, sensitivity profile, `maxCostMicros` and `timeoutMs`. Pin the definition ID/version in the host.
2214
- The input is exactly `{ document, expectedRevision }`; use `null` only for an absent document. Read the current
2215
- catalog revision through trusted host code before submitting an update. No browser-supplied scope is accepted.
3332
+ ## Continue building
2216
3333
 
2217
- The workflow has two steps:
3334
+ - [Threads and compaction](threads.md): history, recording and bounded summaries.
3335
+ - [Approvals and human input](approvals-and-human-input.md): exact-call decisions and durable resumption.
3336
+ - [Copy-in UI](copy-in-ui.md) and [headless stores](react.md): customize the conversation interface.
3337
+ - [Choose a starter](choosing-a-starter.md): compare this notebook with the other application shapes.
2218
3338
 
2219
- 1. `<id>.stage` claims a deterministic revision, loads confirmed cached chunk vectors or embeds new chunks, writes
2220
- immutable vector IDs, and saves a prepared receipt. Its output contains only the publication manifest.
2221
- 2. `<id>.publish` verifies that prepared receipt and compare-and-sets the catalog from `expectedRevision` to the
2222
- new revision. Concurrent publication or deletion fences a stale writer.
3339
+ ---
2223
3340
 
2224
- The workflow needs `tool:<id>.stage`, `tool:<id>.publish`, `effect:write` and `rag:index`. Hosted embeddings also
2225
- need `rag:embed`. The definition's `RagAccess` has its own explicit grants; the runtime's grants do not replace them.
2226
- Use the same durable storage after restart. Supply the same submission key to recover the same workflow.
3341
+ # Mayura with Nuxt
2227
3342
 
2228
- Content identity includes normalized text, source reference, metadata and sensitivity. Index space pins model,
2229
- dimensions, chunking, parent settings and contextualizer identity. An unchanged published document is a no-op only
2230
- when `expectedRevision` matches. A scoped embedding cache keys exact embedding input and sensitivity, so unchanged
2231
- chunks are not paid for again when another part of the document changes. Changed context, model or settings
2232
- creates a different embedding identity. Duplicate text in a batch shares one claim.
3343
+ Source: docs/guides/nuxt.md
2233
3344
 
2234
- Claims are durable **before** paid work. A failed, timed-out or lost acknowledgement leaves the claim uncertain.
2235
- A second submission cannot repeat it. `reconcileRagClaim` requires `rag:reconcile`, core authorization and a trusted
2236
- verifier of the already completed stage or embedding. It changes only the receipt; it never calls a provider or
2237
- writes vectors. Stage verification must confirm every exact staged chunk exists with its intended payload/vector.
2238
- Embedding verification must recover the original confirmed vector. If evidence is unavailable, leave the claim
2239
- blocked. A new content/index identity is an explicit new ingestion, not recovery of an uncertain call.
3345
+ Run the Nuxt notebook starter with persistent threads, exact tool approvals, a scoped server and a separate durable worker.
2240
3346
 
2241
- Catalog publication and vector storage are not a distributed transaction. Partially staged vectors stay hidden.
2242
- Run cleanup separately using the exact scope, space and chunk IDs, after confirming they are not active. Do not
2243
- delete a prepared active revision during a concurrent publication. `deleteRagDocument` first publishes a tombstone
2244
- with an expected revision; reads stop disclosing that source immediately. Its returned IDs support later physical
2245
- cleanup through `VectorStore.delete`. Deletion does not erase old workflow inputs, provider logs or journal history;
2246
- configure retention and storage encryption in the host.
3347
+ Use the `nuxt` starter to build a Nuxt application with a working approval flow before adding a paid model.
3348
+ It includes persistent scoped chat, a deterministic note agent, an explicit approve/reject interface and a separate
3349
+ durable indexing worker. This is runnable application source, not a hosted service.
2247
3350
 
2248
- ## Loaders and chunkers
3351
+ ## Generate and run
2249
3352
 
2250
- `loadText` normalizes line endings and Unicode NFC. `loadMarkdown` keeps the original Markdown syntax as evidence.
2251
- `loadJson` extracts only host-selected JSON Pointer string leaves; it never dumps an entire configuration file.
2252
- `loadHtml` requires `rag:load:html` and an inert host-installed DOM parser; it removes script/style/template/hidden
2253
- nodes before text extraction. `loadPdf` requires `rag:load:pdf` and a host-owned PDF text extractor, bounded bytes,
2254
- page limit and abort signal. PDF parsing has a bounded timeout and shared per-parser concurrency; an abort-ignoring parser retains its slot until settlement. PDF engines, sandboxing, fonts and workers remain host dependencies; no heavyweight
2255
- parser is installed into the core. Neither loader fetches URLs or executes embedded source content.
3353
+ Use Node 24.15.0 or a later supported 24.x version. Run the initializer from a directory you own;
3354
+ inspect its plan before applying it to an existing project.
2256
3355
 
2257
- Normalized documents are bounded to 32,000 UTF-16 code units. Larger corpora should be split into bounded documents
2258
- at acquisition time. `chunkDocument` supports `fixed`, `recursive` and `markdown` modes, explicit character size,
2259
- overlap and maximum chunks. It refuses truncation. Offsets are exact UTF-16 positions in normalized loader text,
2260
- not byte offsets or original PDF coordinates. Character bounds are not tokenizer counts.
3356
+ ```sh
3357
+ npx mayura@1.2.1 init --starter nuxt --directory ./my-notebook --apply
3358
+ cd my-notebook
3359
+ npm install
3360
+ npm run setup
3361
+ npm run dev
3362
+ ```
2261
3363
 
2262
- Set `parentChars` to retain a bounded parent passage for each child embedding, and `parentDocuments: true` on the
2263
- retriever to release it after the same document authorization checks. A host-owned ingestion `contextualizer`
2264
- can produce one bounded retrieval-context string per chunk. Declare its stable ID, location and full-request cost,
2265
- grant `rag:contextualize:<id>`, and pin its behavior in the ingestion version. Generated context prefixes embedding
2266
- and reranking input but is returned separately as `retrievalContext`; it is not a source quotation. Include it in
2267
- your provider input-size budget (at most 1,000 extra characters per chunk).
3364
+ Open `http://localhost:3000`. Read the generated ignored `.data/login-token` file locally and enter its value in
3365
+ the notebook's password field. Setup creates an eight-hour local session, never prints its token, and refuses to
3366
+ replace existing credentials. Keep `.env` and `.data` out of source control.
2268
3367
 
2269
- ## Embedding providers and budgets
3368
+ In another terminal, inside the generated project:
2270
3369
 
2271
- `ragEmbedder(adapter, { costMicros })` prices any `MemoryEmbedder`-compatible adapter, including `hashingEmbedder`
2272
- and the existing OpenAI embedding adapter. Provider packages also export native embedding factories:
3370
+ ```sh
3371
+ npm run worker
3372
+ ```
2273
3373
 
2274
- | Provider entry | Factory | Admission |
2275
- | --- | --- | --- |
2276
- | `mayura/provider-openai` or `@mayurajs/provider-openai` | `openAIEmbeddings`, wrapped by `ragEmbedder` | `rag:embed` for hosted use |
2277
- | `@mayurajs/provider-google` | `googleEmbeddings` | `rag:transport:google-embeddings` |
2278
- | `@mayurajs/provider-mistral` | `mistralEmbeddings` | `rag:transport:mistral-embeddings` |
2279
- | `@mayurajs/provider-azure` | `azureEmbeddings` | `rag:transport:azure-embeddings` |
2280
- | `@mayurajs/provider-ollama` | `ollamaEmbeddings` | `rag:transport:ollama-embeddings` |
2281
- | `@mayurajs/provider-bedrock` | `titanEmbeddings` | `rag:transport:bedrock-embeddings` |
3374
+ ## Follow a complete conversation
2282
3375
 
2283
- The new HTTP factories require explicit model, dimensions, maximum batch, credentials/endpoint as applicable,
2284
- `costMicros`, transport permissions, timeout and concurrency. Azure uses an explicit resource and deployment name.
2285
- Ollama requires a declared local/hosted location; local is restricted to loopback. Titan is the explicit text V2
2286
- profile, one input at a time, with supplied SigV4 credentials and 256/512/1024 dimensions; close its owned client.
2287
- No adapter reads credentials from the environment, selects an embedding model or silently retries.
3376
+ 1. Connect with the local session and create a thread.
3377
+ 2. Send a note. Inspect the exact proposed input before approving or rejecting it.
3378
+ 3. Approve once: the note is saved and a separate durable indexing workflow is submitted.
3379
+ 4. Let the worker process the index job. Reload, re-enter the session and inspect the persisted history.
3380
+ 5. If a response is lost, inspect the saved run before using the explicit recovery action. Do not send the note again
3381
+ with a new key to repair an uncertain write.
2288
3382
 
2289
- `costMicros` is a **host-declared maximum for the entire bounded operation**, not a price lookup or billed-cost
2290
- estimate. Ingestion reserves maximum embedding batches plus vector writes and contextualization. Retrieval
2291
- reserves bounded query expansion, embeddings, vector/lexical searches and reranking before dispatch. Runtime tool
2292
- reservations contain those nested operations. Failures conservatively retain the reservation; the source no-op
2293
- reports zero. Provider-side billing cannot be enforced by an in-process declaration: configure real service quotas
2294
- and an honest bound for the admitted model and input/output lengths.
3383
+ The fixture needs no provider API key, model billing or external write. A rejected proposal must not save a note.
3384
+ Thread history and approval controls remain scoped to the identity verified by the server.
2295
3385
 
2296
- ## Scoped retrieval and tools
3386
+ ## Framework boundary
2297
3387
 
2298
- Create a retriever with the host's scope, explicit permissions, `allowedSensitivities`, index space, fixed metadata
2299
- `filter`, `limit`, `candidateLimit`, `maxQueries`, `maxCostMicros`, `timeoutMs` and `maxConcurrent`. All hosted content
2300
- writes/embeddings/reranks require the corresponding sensitivity in `hostedSensitivities` (default empty).
3388
+ The Nitro route converts the H3 event to a Web Request and returns the native Web Response through the H3 bridge. The Vue page uses headless stores and explicit controls. Keep credentials and the application host in private server configuration, outside public runtime config.
2301
3389
 
2302
- `defineRetrievalTool({ id, version, retriever, timeoutMs })` accepts only `{ query }`. Runtime admission needs
2303
- `tool:<id>`, `effect:read` and `rag:read`; the retriever also checks its own `rag:read` and hosted `rag:embed` grant.
2304
- It checks the actual tool scope against the bound retriever scope. Results contain plain untrusted text, scores,
2305
- metadata-only metrics, and citations with document/revision/chunk/reference/start/end. A reference is an opaque
2306
- source label, not a fetched or verified URL. Render it as plain text unless your application independently approves
2307
- links. Retrieved text never becomes a system instruction.
3390
+ | Part | Generated location |
3391
+ | --- | --- |
3392
+ | HTTP bridge | `server/routes/api/mayura/[...path].ts` |
3393
+ | Notebook interface | `app/app.vue` |
3394
+ | Application and tool configuration | `server/application.mjs` |
3395
+ | Session verification | `server/auth.mjs` |
3396
+ | Background processing | `server/worker.mjs` |
2308
3397
 
2309
- Pass the existing core `authorization` to evaluate `rag_document` actions: `search` on `collection`, `read` on each
2310
- document, `index` on ingestion, `delete` on deletion and `reconcile` for recovery. Embedding-cache recovery uses
2311
- `collection` because cache entries may be shared by multiple documents in that scope. The same authorizer emits
2312
- its normal metadata-only audit events. Per-document denial withholds evidence before external reranking. Policy
2313
- outage/cancellation fails closed and never triggers a weaker fallback. Authorization/publication checks repeat
2314
- before releasing results. Candidate limits can reduce recall when many stored candidates are stale or denied;
2315
- the retriever does not scan or spend without a bound to refill the result.
3398
+ The API is mounted at `/api/mayura/*`; the browser's origin-pinned transport preserves the native Mayura route
3399
+ contract while adding that prefix. Retain the native Request/Response bridge when customizing Nitro middleware. Avoid reading and rebuilding approval payloads or buffering event streams in a page API wrapper. The React copy-in registry does not generate Vue components in 1.2; customize the supplied native Vue controls.
2316
3400
 
2317
- ## Hybrid search and query expansion
3401
+ ## Customize identity, tools and storage
2318
3402
 
2319
- `mode: 'hybrid'` fuses semantic and lexical ranks with reciprocal-rank fusion. Native memory provides BM25;
2320
- in-memory lexical scoring is a small deterministic reference implementation. External semantic backends can be
2321
- paired with a scoped lexical mirror using `hybridVectorStore({ semantic, lexical })`; ingestion stages into both,
2322
- and a partial mirror write remains unpublished. A backend without lexical capability refuses hybrid mode rather
2323
- than silently changing retrieval behavior.
3403
+ Replace the single-user demonstration authenticator with verified application identity before opening the app to
3404
+ customers. The host fixes principal, project, route capabilities and agent permissions. Browser input cannot choose
3405
+ a tenant or grant itself a capability. Never distribute one shared owner token to multiple customers.
2324
3406
 
2325
- `modelQueryTransform` supports rewrite, multi-query and HyDE. It requires a model grant, explicit query mode and
2326
- query count. Set `maxQueries` to include the original query for multi-query mode. Expansion makes one bounded model
2327
- call, without tools/history or automatic retries. HyDE output is only a search representation and never returned
2328
- as evidence. Custom transforms obey the same contract and declare a finite cost.
3407
+ The note agent and indexing worker have separate grants. If you replace the fixture model, declare the model grant,
3408
+ prices, finite per-call cost cap and run budget. A gateway subscription does not remove those limits. See
3409
+ [AI gateways](ai-gateways.md) and [authorization](authorization.md).
2329
3410
 
2330
- ## Reranking and evaluation
3411
+ Use Node 24.15.0 or a later supported 24.x version for the generated Nuxt toolchain. Build the Nitro application and run the separate worker against the same store. Select a deployment preset deliberately; the Node/SQLite application is not automatically portable to edge presets.
2331
3412
 
2332
- Optional adapters: [Cohere](../integrations/reranker-cohere.md), [Voyage](../integrations/reranker-voyage.md), and
2333
- [Jina](../integrations/reranker-jina.md). `modelReranker` uses an explicitly granted model instead. The retriever
2334
- requires `rag:rerank:<id>`, checks hosted sensitivities and authorizes input documents before ranking. Each adapter
2335
- returns only original-document indexes and finite scores; it cannot replace or inject source text.
3413
+ A note write and workflow submission are separate operations. If scheduling is unconfirmed after the note was saved,
3414
+ reconcile the missing index job using the note's identity; never replay the browser write to repair scheduling.
3415
+ See [framework starter architecture](framework-starters.md) for worker leadership, retention and recovery details.
2336
3416
 
2337
- `retrievalQuality` returns precision@k, recall@k, reciprocal rank and binary nDCG for one query. `evaluateRetrieval`
2338
- macro-averages test-set recall and MRR. `citationCoverage` checks that cited chunk IDs belong to the evidence used;
2339
- it does not establish semantic entailment. Retrieval result metrics contain admitted query/candidate/result counts,
2340
- declared cost reservation and duration, without raw query text, denied document identities or source content.
3417
+ ## Verify your changes
2341
3418
 
2342
- ## Vector adapters and qualification
3419
+ ```sh
3420
+ npm test
3421
+ npm run typecheck
3422
+ npm run build
3423
+ ```
2343
3424
 
2344
- Built-in exact stores plus six optional integrations share the `VectorStore` contract:
2345
- [pgvector](../integrations/vector-pgvector.md), [libSQL](../integrations/vector-libsql.md),
2346
- [Pinecone](../integrations/vector-pinecone.md), [Qdrant](../integrations/vector-qdrant.md),
2347
- [Weaviate](../integrations/vector-weaviate.md), and [Chroma](../integrations/vector-chroma.md).
2348
- Use explicit infrastructure permissions and an honest cost ceiling for each whole bounded operation. Provision
2349
- remote collections with matching dimensions and cosine similarity before ingestion. These adapters manage data,
2350
- not infrastructure provisioning. The SQL profiles use host-owned parameterized executors and explicit schema setup.
3425
+ The V1.2 release passed the complete cross-platform qualification matrix, including generated packed server
3426
+ contracts and workspace framework builds/HTTP approval flows. Rendered browser interaction and actual framework
3427
+ deployments are separate checks; qualify your target before exposing customer data. See
3428
+ [release validation status](release-readiness.md) and [deployment](deployment.md).
2351
3429
 
2352
- The shared offline conformance suite passes locally for all eight stores: scope/index isolation, filtering before top-k,
2353
- ID replacement, scoped deletion, invalid dimensions and cancellation. Native protocol tests use fake transports;
2354
- SQL protocol tests use fake executors, while native-memory tests use local in-memory SQLite. These cases, the offline runnable example, package checks and edge/runtime checks passed locally. Frozen dependency installation also passed with strict peers and lifecycle scripts disabled. Fake transports and executors do not qualify real service compatibility, SQL query plans or deployment limits.
3430
+ ## Continue building
2355
3431
 
2356
- Remote indexes may acknowledge writes before making them searchable. Publication does not promise immediate full recall across eventually consistent services. Real service readiness and deployment behavior remain unqualified.
3432
+ - [Threads and compaction](threads.md): history, recording and bounded summaries.
3433
+ - [Approvals and human input](approvals-and-human-input.md): exact-call decisions and durable resumption.
3434
+ - [Copy-in UI](copy-in-ui.md) and [headless stores](react.md): customize the conversation interface.
3435
+ - [Choose a starter](choosing-a-starter.md): compare this notebook with the other application shapes.
2357
3436
 
2358
3437
  ---
2359
3438
 
@@ -4666,7 +5745,7 @@ earlier steps; `runtime.inspect(run)` lists what executed. Cancelling does not u
4666
5745
  ## Good to know
4667
5746
 
4668
5747
  - A graph with an `approval: true` step is refused. Approvals need a durable workflow.
4669
- - The graph has at most 128 nodes and no cycles. For data-dependent branching, let an agent decide.
5748
+ - The graph has at most 128 nodes by default and no cycles. V1.2.1 adds an explicit `maxNodes` up to 512; see [graph size](../concepts/workflows.md#configuring-graph-size). For data-dependent branching, let an agent decide.
4670
5749
  - The same `defineWorkflow` graph can also run durably through the earlier runtimes in `mayura/workflows`, but new
4671
5750
  durable work should use `defineWorkflowLifecycle`; see [Durable workflows](durable-workflows.md).
4672
5751
 
@@ -5135,7 +6214,7 @@ const runtime = createWorkflowLifecycleFleetRuntime({
5135
6214
  - **Errors.** Every error the runtimes and stores throw is a `MayuraError` with a stable `code`. Reusing an
5136
6215
  idempotency key with other input, another definition version or other runtime settings is `CONFLICT`; resubmit the
5137
6216
  identical request to get the existing run. See [Storage](storage.md#errors).
5138
- - **Limits.** At most 128 steps, 32 human steps, 64 timers and 64 signal steps per definition; prompts up to 1 KiB.
6217
+ - **Limits.** 128 steps by default; V1.2.1 adds an explicit `maxNodes` up to 512 (see [graph size](../concepts/workflows.md#configuring-graph-size)). At most 32 human steps, 64 timers and 64 signal steps per definition; prompts up to 1 KiB.
5139
6218
  - `runUntilSettled` runs steps in the calling process. A plain runtime starts no background timers; waiting runs move
5140
6219
  only when something calls it again.
5141
6220
 
@@ -13106,8 +14185,8 @@ Create a Mayura project from a starter or a template with mayura init, interacti
13106
14185
  `mayura init` creates a new project. You choose between two kinds of starting point:
13107
14186
 
13108
14187
  - A **starter** is a complete application you can run, test and ship: configuration read from the environment,
13109
- tests and CI. Four are servers, with a worker, a Dockerfile and a compose file; `cli-agent` is a command-line
13110
- assistant. Start here for a real project.
14188
+ tests and CI. Choose four server applications, six framework notebooks with persistent chat and exact approvals,
14189
+ or the `cli-agent` command-line assistant. See [Choose a starter](../guides/choosing-a-starter.md).
13111
14190
  - A **template** is one small file that shows one feature, with a `package.json` and `tsconfig.json` around it. Start
13112
14191
  here to learn a single idea.
13113
14192
 
@@ -13143,7 +14222,8 @@ below instead.
13143
14222
 
13144
14223
  ### Choosing a model provider
13145
14224
 
13146
- For a starter, the wizard offers:
14225
+ The model-provider wizard offers the choices below. The [RAG starter](../guides/rag-modal-pinecone-starter.md)
14226
+ starts offline and uses its generated README to configure both hosted services.
13147
14227
 
13148
14228
  | Choice | What it asks for |
13149
14229
  |---|---|
@@ -13226,6 +14306,17 @@ it does not do. The server starters use SQLite locally and PostgreSQL when `DATA
13226
14306
  | `research-team` | Multi-agent research as one durable workflow: a planner, up to four parallel researchers over a source library and a writer whose citations are checked, under one shared budget. The report is stored as a content-addressed artifact, with optional OpenTelemetry traces. |
13227
14307
  | `event-automation` | Signed webhooks start durable workflow runs in which a triage agent acts on a ticket tracker through MCP tools under explicit permissions. Forged, stale and replayed deliveries start nothing, and assigning an urgent ticket waits for operator approval. |
13228
14308
  | `cli-agent` | A command-line assistant: `assistant chat`, or one request such as `assistant list files in src`, about the folder you run it in. File tools stay inside that folder and never open `.env` files, you confirm every write, skills load from `skills/`, and replies stream. `npm run dev` starts the chat. |
14309
+ | [`rag-modal-pinecone`](../guides/rag-modal-pinecone-starter.md) | A retrieval agent with durable Markdown ingestion and exact citations. `npm run dev` runs the offline demo. Use the generated README to configure Modal and Pinecone. |
14310
+ | `nextjs` | App Router notebook with persistent threads, exact note approvals and a separate indexing worker. |
14311
+ | `hono` | Hono/Vite React notebook with a Node path and additional Bun, Deno and Workers source. |
14312
+ | `react-router` | React Router resource routes and an owned React notebook interface. |
14313
+ | `tanstack-start` | TanStack Start server routes, React notebook and separate worker. |
14314
+ | `sveltekit` | Native Svelte controls with the headless conversation stores. |
14315
+ | `nuxt` | Nitro server bridge and native Vue conversation controls. |
14316
+
14317
+ The framework notebooks first use `npm run setup` to create a local session, then `npm run dev` and a separate
14318
+ `npm run worker`. See [framework starters](../guides/framework-starters.md) for the shared architecture and the
14319
+ dedicated guide for your framework. This demonstration identity must be replaced before opening the app to customers.
13229
14320
 
13230
14321
  Browse the source at
13231
14322
  [packages/cli/starters](https://github.com/KartikeyAI/mayura/blob/main/packages/cli/starters).
@@ -14085,7 +15176,9 @@ Scoped native vector storage for pinecone.
14085
15176
 
14086
15177
  `@mayurajs/vector-pinecone` implements the [RAG contracts](../guides/rag.md). Install it alongside `mayura`.
14087
15178
  Construction performs no I/O, credential discovery, provisioning or background work. All operations require an
14088
- explicit host permission and a nonnegative `costMicros` ceiling. Offline tests and package checks passed locally. Real service behavior remains unqualified; see [release validation status](../guides/release-readiness.md).
15179
+ explicit host permission and a nonnegative `costMicros` ceiling. See the
15180
+ [qualification matrix](../guides/rag-production.md#qualification-matrix) for the stable Modal + Pinecone Loki v28
15181
+ configuration and its measured limits.
14089
15182
 
14090
15183
  `pineconeVectorStore` accepts `endpoint`, `headers`, `collection`, `dimensions`, `costMicros`, `permissions`,
14091
15184
  `timeoutMs`, `maxConcurrent` and optional test `fetch`. Grant `rag:transport:pinecone`. Credentials go in host-owned
@@ -28854,11 +29947,79 @@ Platforms for `mayura deploy`, beside Docker, Compose and Kubernetes. See [mayur
28854
29947
 
28855
29948
  ---
28856
29949
 
28857
- # What's new in Mayura 1.1
29950
+ # What's new in Mayura 1.2.1
28858
29951
 
28859
29952
  Source: docs/project/whats-new.md
28860
29953
 
28861
- Mayura 1.1: a model registry, voice, files, sandboxes, browsers, authentication and API keys, mayura deploy, edge runtimes and 85 integration packages.
29954
+ Qualified retrieval for the Modal and Pinecone Loki profile, configurable workflow graphs, and the capabilities shipped in Mayura 1.2.
29955
+
29956
+ Mayura **1.2.1 is published** under `latest` for `mayura` and 105 optional
29957
+ [integration packages](../reference/integrations.md). All 106 packages were published through trusted publishing
29958
+ with verified integrity and provenance. All 22 existing `next` tags were preserved. See the
29959
+ [release evidence](../guides/release-readiness.md) for the qualified source and remaining interoperability limits.
29960
+
29961
+ ## Production retrieval and configurable graphs
29962
+
29963
+ The [Modal and Pinecone Loki v28 profile](../guides/rag-production.md) is stable for its registered
29964
+ software-operations workload. Qualification covered 40 source-reviewed cases, 600 timed native queries,
29965
+ recovery, scope isolation and cleanup. The semantic acquisition and ranking p95 upper bound was 4.725 seconds.
29966
+ Other profiles remain experimental. Start with [Build and deploy a retrieval agent](../guides/rag-deployment.md).
29967
+
29968
+ Workflow graphs keep the 128-node default. V1.2.1 adds a configurable per-graph bound and a trusted host
29969
+ option to disable that count limit. See [configuring graph size](../concepts/workflows.md#configuring-graph-size).
29970
+
29971
+ The following capabilities were introduced in Mayura 1.2.0.
29972
+
29973
+ ## Conversations that continue
29974
+
29975
+ [Threads](../guides/threads.md) retain scoped conversation history in your database. A run can pause for an
29976
+ [exact tool approval](../guides/approvals-and-human-input.md), save a checkpoint, and resume through another host.
29977
+ Thread/run recording and recovery preserve completed turns without replaying tool writes. Bounded compaction
29978
+ journals the summary's source, model and cost; uncertain paid work requires inspection rather than another call.
29979
+
29980
+ [Agent handoffs](../guides/agent-handoffs.md) continue the thread and budget while switching to separately declared
29981
+ agent permissions. The initial profile is buffered, text-only, non-speculative root runs.
29982
+
29983
+ ## Authorization throughout the runtime
29984
+
29985
+ [Fine-grained authorization](../guides/authorization.md) adds a shared policy contract, built-in RBAC, audit events
29986
+ and OpenTelemetry integration. Scoped server routes, agent/tool execution, workflows, memory, retrieval, threads,
29987
+ approvals and compaction use that contract. Optional adapters cover OpenFGA, Cedar, Permit.io, Oso and an external
29988
+ HTTP policy service. Resource decisions supplement explicit runtime grants; they do not replace them.
29989
+
29990
+ ## Start with an application
29991
+
29992
+ [Six framework starters](../guides/framework-starters.md) generate working notebooks for
29993
+ [Next.js](../guides/nextjs.md), [Hono](../guides/hono.md), [React Router](../guides/react-router.md),
29994
+ [TanStack Start](../guides/tanstack-start.md), [SvelteKit](../guides/sveltekit.md) and [Nuxt](../guides/nuxt.md).
29995
+ They include scoped threads, exact note approvals, an offline model fixture, a separate indexing worker and
29996
+ deployment source. [Choose a starter](../guides/choosing-a-starter.md) compares all 11 applications.
29997
+
29998
+ [Copy-in React components](../guides/copy-in-ui.md) provide thread history, approval and run controls as source you
29999
+ own. [Headless stores](../guides/react.md) support native Svelte and Vue views. Hooks and subscriptions observe;
30000
+ submissions and approval decisions remain explicit actions.
30001
+
30002
+ ## Gateways and retrieval
30003
+
30004
+ Six [AI gateway packages](../guides/ai-gateways.md) connect Vercel AI Gateway, Cloudflare AI Gateway, OpenRouter,
30005
+ Portkey, Helicone and LiteLLM with scoped models, explicit credentials and bounded costs.
30006
+
30007
+ [Retrieval augmented generation](../guides/rag.md) adds scoped citations, durable ingestion and embedding claims,
30008
+ parent context, hybrid retrieval and query expansion, six vector adapters, three rerankers and offline evaluation.
30009
+
30010
+ The **experimental [AG-UI adapter](../guides/ag-ui.md)** projects run events, thread messages, state snapshots/deltas
30011
+ and approval interrupts. Durable frontend-tool claims and result outboxes support safe native-owner recovery without
30012
+ automatically replaying browser writes. Reference-client, CopilotKit and rendered notebook interoperability remain
30013
+ outside the completed qualification.
30014
+
30015
+ ## Upgrade and qualification
30016
+
30017
+ Install the coordinated release with `npm install mayura@1.2.1`. Select matching `@mayurajs/*@1.2.1` packages only
30018
+ where needed. Review [versioning](versioning.md), [support](support.md) and the
30019
+ [release validation status](../guides/release-readiness.md) before changing a production host. The full main CI
30020
+ matrix and V1.1 upgrade check passed. Check the qualification scope for the external services you use.
30021
+
30022
+ ## Mayura 1.1
28862
30023
 
28863
30024
  Mayura 1.1 adds new capabilities to `mayura` and 85 optional [integration packages](../reference/integrations.md) that
28864
30025
  connect it to other services. It is a minor release: nothing documented in 1.0 changes, and a 1.0 database works with