mayura 1.1.0 → 1.2.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/ag-ui/index.d.ts +1 -0
- package/ag-ui/index.js +1 -0
- package/authz/index.d.ts +1 -0
- package/authz/index.js +1 -0
- package/docs/README.md +162 -0
- package/docs/cli/init.md +12 -0
- package/docs/concepts/outcomes.md +2 -0
- package/docs/concepts/permissions.md +50 -0
- package/docs/concepts/runtime.md +189 -1
- package/docs/concepts/tools.md +1 -0
- package/docs/concepts/workflows.md +8 -0
- package/docs/guides/ag-ui.md +560 -0
- package/docs/guides/agent-handoffs.md +120 -0
- package/docs/guides/ai-gateways.md +60 -0
- package/docs/guides/approvals-and-human-input.md +24 -0
- package/docs/guides/authorization.md +499 -0
- package/docs/guides/child-agents.md +7 -0
- package/docs/guides/copy-in-ui.md +79 -0
- package/docs/guides/deployment.md +3 -2
- package/docs/guides/durable-workflows.md +3 -0
- package/docs/guides/framework-starters.md +92 -0
- package/docs/guides/helpers.md +2 -2
- package/docs/guides/lifecycle-hooks.md +34 -0
- package/docs/guides/memory-and-context.md +117 -0
- package/docs/guides/model-providers.md +19 -0
- package/docs/guides/observability.md +9 -0
- package/docs/guides/rag.md +180 -0
- package/docs/guides/react.md +237 -1
- package/docs/guides/release-readiness.md +101 -0
- package/docs/guides/sandboxes.md +3 -2
- package/docs/guides/server-and-client.md +404 -1
- package/docs/guides/storage.md +1 -0
- package/docs/guides/testing.md +4 -2
- package/docs/guides/threads.md +296 -0
- package/docs/integrations/auth-auth0.md +120 -0
- package/docs/integrations/auth-clerk.md +128 -0
- package/docs/integrations/auth-cognito.md +120 -0
- package/docs/integrations/auth-entra.md +126 -0
- package/docs/integrations/auth-facebook.md +165 -0
- package/docs/integrations/auth-firebase.md +116 -0
- package/docs/integrations/auth-google.md +151 -0
- package/docs/integrations/auth-neon.md +109 -0
- package/docs/integrations/auth-okta.md +122 -0
- package/docs/integrations/auth-supabase.md +122 -0
- package/docs/integrations/auth-workos.md +121 -0
- package/docs/integrations/authz-cedar.md +131 -0
- package/docs/integrations/authz-http.md +175 -0
- package/docs/integrations/authz-openfga.md +187 -0
- package/docs/integrations/authz-oso.md +154 -0
- package/docs/integrations/authz-permit.md +152 -0
- package/docs/integrations/browser-agent-browser.md +155 -0
- package/docs/integrations/browser-anchor.md +137 -0
- package/docs/integrations/browser-browser-use.md +134 -0
- package/docs/integrations/browser-browserbase.md +134 -0
- package/docs/integrations/browser-browserless.md +121 -0
- package/docs/integrations/browser-browserview.md +146 -0
- package/docs/integrations/browser-cloudflare.md +159 -0
- package/docs/integrations/browser-firecrawl.md +200 -0
- package/docs/integrations/browser-hyperbrowser.md +133 -0
- package/docs/integrations/browser-kernel.md +131 -0
- package/docs/integrations/browser-stagehand.md +159 -0
- package/docs/integrations/browser-steel.md +133 -0
- package/docs/integrations/browser-viewer.md +167 -0
- package/docs/integrations/cloudflare-quick-action.md +175 -0
- package/docs/integrations/deploy-agentcore.md +189 -0
- package/docs/integrations/deploy-aws-ecs.md +169 -0
- package/docs/integrations/deploy-aws-lambda.md +197 -0
- package/docs/integrations/deploy-azure.md +151 -0
- package/docs/integrations/deploy-cloudflare.md +220 -0
- package/docs/integrations/deploy-cloudrun.md +149 -0
- package/docs/integrations/deploy-digitalocean.md +147 -0
- package/docs/integrations/deploy-fly.md +154 -0
- package/docs/integrations/deploy-railway.md +138 -0
- package/docs/integrations/deploy-render.md +144 -0
- package/docs/integrations/deploy-vercel.md +173 -0
- package/docs/integrations/filestorage-agentfs.md +111 -0
- package/docs/integrations/filestorage-azure-blob.md +127 -0
- package/docs/integrations/filestorage-files-sdk.md +120 -0
- package/docs/integrations/filestorage-gcs.md +121 -0
- package/docs/integrations/filestorage-google-drive.md +129 -0
- package/docs/integrations/filestorage-mesa.md +130 -0
- package/docs/integrations/filestorage-r2.md +119 -0
- package/docs/integrations/filestorage-vercel-blob.md +121 -0
- package/docs/integrations/gateway-cloudflare.md +57 -0
- package/docs/integrations/gateway-helicone.md +57 -0
- package/docs/integrations/gateway-litellm.md +57 -0
- package/docs/integrations/gateway-openrouter.md +59 -0
- package/docs/integrations/gateway-portkey.md +57 -0
- package/docs/integrations/gateway-vercel.md +57 -0
- package/docs/integrations/km-reqkey.md +172 -0
- package/docs/integrations/km-unkey.md +179 -0
- package/docs/integrations/observability-arize.md +226 -0
- package/docs/integrations/observability-betterstack.md +161 -0
- package/docs/integrations/observability-datadog.md +181 -0
- package/docs/integrations/observability-langfuse.md +174 -0
- package/docs/integrations/observability-langsmith.md +182 -0
- package/docs/integrations/observability-posthog.md +156 -0
- package/docs/integrations/observability-sentry.md +167 -0
- package/docs/integrations/provider-anthropic.md +238 -0
- package/docs/integrations/provider-azure.md +251 -0
- package/docs/integrations/provider-bedrock.md +258 -0
- package/docs/integrations/provider-google.md +223 -0
- package/docs/integrations/provider-groq.md +216 -0
- package/docs/integrations/provider-mistral.md +220 -0
- package/docs/integrations/provider-ollama.md +220 -0
- package/docs/integrations/provider-openai.md +294 -0
- package/docs/integrations/reranker-cohere.md +23 -0
- package/docs/integrations/reranker-jina.md +23 -0
- package/docs/integrations/reranker-voyage.md +23 -0
- package/docs/integrations/sandbox-agentcore.md +140 -0
- package/docs/integrations/sandbox-apple-container.md +132 -0
- package/docs/integrations/sandbox-cloudflare.md +132 -0
- package/docs/integrations/sandbox-codesandbox.md +138 -0
- package/docs/integrations/sandbox-daytona.md +148 -0
- package/docs/integrations/sandbox-e2b-desktop.md +137 -0
- package/docs/integrations/sandbox-e2b.md +109 -0
- package/docs/integrations/sandbox-fly.md +143 -0
- package/docs/integrations/sandbox-modal.md +129 -0
- package/docs/integrations/sandbox-northflank.md +135 -0
- package/docs/integrations/sandbox-railway.md +141 -0
- package/docs/integrations/sandbox-vercel.md +140 -0
- package/docs/integrations/storage-d1.md +128 -0
- package/docs/integrations/storage-dynamodb.md +158 -0
- package/docs/integrations/storage-libsql.md +143 -0
- package/docs/integrations/storage-mongodb.md +123 -0
- package/docs/integrations/storage-mysql.md +133 -0
- package/docs/integrations/vector-chroma.md +26 -0
- package/docs/integrations/vector-libsql.md +24 -0
- package/docs/integrations/vector-pgvector.md +24 -0
- package/docs/integrations/vector-pinecone.md +26 -0
- package/docs/integrations/vector-qdrant.md +26 -0
- package/docs/integrations/vector-weaviate.md +26 -0
- package/docs/integrations/voice-assemblyai.md +148 -0
- package/docs/integrations/voice-azure.md +159 -0
- package/docs/integrations/voice-cartesia.md +148 -0
- package/docs/integrations/voice-deepgram.md +141 -0
- package/docs/integrations/voice-elevenlabs.md +142 -0
- package/docs/integrations/voice-google.md +176 -0
- package/docs/integrations/voice-openai.md +158 -0
- package/docs/project/credits.md +2 -1
- package/docs/reference/entry-points.md +1 -0
- package/docs/reference/integrations.md +137 -88
- package/lib/adapter-code-docker/image/Dockerfile +1 -1
- package/lib/adapter-code-docker/package.json +1 -1
- package/lib/adapter-code-quickjs/package.json +1 -1
- package/lib/adapter-mcp/package.json +1 -1
- package/lib/ag-ui/dist/durable-frontend-tools.d.ts +4 -0
- package/lib/ag-ui/dist/durable-frontend-tools.d.ts.map +1 -0
- package/lib/ag-ui/dist/durable-frontend-tools.js +275 -0
- package/lib/ag-ui/dist/durable-frontend-tools.js.map +1 -0
- package/lib/ag-ui/dist/frontend-executor.d.ts +44 -0
- package/lib/ag-ui/dist/frontend-executor.d.ts.map +1 -0
- package/lib/ag-ui/dist/frontend-executor.js +148 -0
- package/lib/ag-ui/dist/frontend-executor.js.map +1 -0
- package/lib/ag-ui/dist/frontend-tools.d.ts +109 -0
- package/lib/ag-ui/dist/frontend-tools.d.ts.map +1 -0
- package/lib/ag-ui/dist/frontend-tools.js +227 -0
- package/lib/ag-ui/dist/frontend-tools.js.map +1 -0
- package/lib/ag-ui/dist/index.d.ts +67 -0
- package/lib/ag-ui/dist/index.d.ts.map +1 -0
- package/lib/ag-ui/dist/index.js +605 -0
- package/lib/ag-ui/dist/index.js.map +1 -0
- package/lib/ag-ui/dist/interrupts.d.ts +18 -0
- package/lib/ag-ui/dist/interrupts.d.ts.map +1 -0
- package/lib/ag-ui/dist/interrupts.js +48 -0
- package/lib/ag-ui/dist/interrupts.js.map +1 -0
- package/lib/ag-ui/dist/messages.d.ts +15 -0
- package/lib/ag-ui/dist/messages.d.ts.map +1 -0
- package/lib/ag-ui/dist/messages.js +89 -0
- package/lib/ag-ui/dist/messages.js.map +1 -0
- package/lib/ag-ui/dist/protocol.d.ts +197 -0
- package/lib/ag-ui/dist/protocol.d.ts.map +1 -0
- package/lib/ag-ui/dist/protocol.js +177 -0
- package/lib/ag-ui/dist/protocol.js.map +1 -0
- package/lib/ag-ui/dist/state.d.ts +40 -0
- package/lib/ag-ui/dist/state.d.ts.map +1 -0
- package/lib/ag-ui/dist/state.js +160 -0
- package/lib/ag-ui/dist/state.js.map +1 -0
- package/lib/ag-ui/package.json +5 -0
- package/lib/ag-ui/src/durable-frontend-tools.ts +201 -0
- package/lib/ag-ui/src/frontend-executor.ts +96 -0
- package/lib/ag-ui/src/frontend-tools.ts +208 -0
- package/lib/ag-ui/src/index.ts +445 -0
- package/lib/ag-ui/src/interrupts.ts +45 -0
- package/lib/ag-ui/src/messages.ts +68 -0
- package/lib/ag-ui/src/protocol.ts +179 -0
- package/lib/ag-ui/src/state.ts +132 -0
- package/lib/artifacts/package.json +1 -1
- package/lib/auth/dist/identity.js +1 -1
- package/lib/auth/dist/identity.js.map +1 -1
- package/lib/auth/package.json +1 -1
- package/lib/auth/src/identity.ts +1 -1
- package/lib/authz/dist/index.d.ts +44 -0
- package/lib/authz/dist/index.d.ts.map +1 -0
- package/lib/authz/dist/index.js +177 -0
- package/lib/authz/dist/index.js.map +1 -0
- package/lib/authz/package.json +5 -0
- package/lib/authz/src/index.ts +148 -0
- package/lib/browser/package.json +1 -1
- package/lib/cli/dist/bin.js +28 -0
- package/lib/cli/dist/bin.js.map +1 -1
- package/lib/cli/dist/index.d.ts +2 -1
- package/lib/cli/dist/index.d.ts.map +1 -1
- package/lib/cli/dist/index.js +13 -6
- package/lib/cli/dist/index.js.map +1 -1
- package/lib/cli/dist/output.js.map +1 -1
- package/lib/cli/dist/ui.d.ts +27 -0
- package/lib/cli/dist/ui.d.ts.map +1 -0
- package/lib/cli/dist/ui.js +80 -0
- package/lib/cli/dist/ui.js.map +1 -0
- package/lib/cli/package.json +1 -1
- package/lib/cli/src/bin.ts +11 -0
- package/lib/cli/src/index.ts +14 -6
- package/lib/cli/src/output.ts +252 -252
- package/lib/cli/src/ui.ts +52 -0
- package/lib/cli/starters/approval-workflow/README.md +1 -1
- package/lib/cli/starters/approval-workflow/dot-env.example +1 -1
- package/lib/cli/starters/approval-workflow/test/refunds.test.ts +18 -1
- package/lib/cli/starters/cli-agent/test/assistant.test.ts +12 -0
- package/lib/cli/starters/event-automation/README.md +1 -1
- package/lib/cli/starters/event-automation/compose.yaml +1 -1
- package/lib/cli/starters/event-automation/dot-env.example +3 -3
- package/lib/cli/starters/event-automation/test/automation.test.ts +18 -1
- package/lib/cli/starters/hono/Dockerfile +12 -0
- package/lib/cli/starters/hono/README.md +94 -0
- package/lib/cli/starters/hono/compose.yaml +19 -0
- package/lib/cli/starters/hono/deno.json +3 -0
- package/lib/cli/starters/hono/dot-dockerignore +11 -0
- package/lib/cli/starters/hono/dot-env.example +7 -0
- package/lib/cli/starters/hono/dot-gitignore +15 -0
- package/lib/cli/starters/hono/mayura.project.json +37 -0
- package/lib/cli/starters/hono/package.json +47 -0
- package/lib/cli/starters/hono/scripts/dev.mjs +5 -0
- package/lib/cli/starters/hono/scripts/setup.mjs +9 -0
- package/lib/cli/starters/hono/server/application.mjs +74 -0
- package/lib/cli/starters/hono/server/auth.mjs +24 -0
- package/lib/cli/starters/hono/server/bun.mjs +10 -0
- package/lib/cli/starters/hono/server/deno.mjs +10 -0
- package/lib/cli/starters/hono/server/hono-node.mjs +10 -0
- package/lib/cli/starters/hono/server/node.mjs +31 -0
- package/lib/cli/starters/hono/server/portable.mjs +9 -0
- package/lib/cli/starters/hono/server/worker-edge.mjs +18 -0
- package/lib/cli/starters/hono/server/worker.mjs +11 -0
- package/lib/cli/starters/hono/server/workflows.mjs +23 -0
- package/lib/cli/starters/hono/src/ChatApp.jsx +57 -0
- package/lib/cli/starters/hono/src/Notebook.jsx +25 -0
- package/lib/cli/starters/hono/src/components/mayura/approval.tsx +142 -0
- package/lib/cli/starters/hono/src/components/mayura/thread-history.tsx +142 -0
- package/lib/cli/starters/hono/src/components/mayura/thread-list.tsx +9 -0
- package/lib/cli/starters/hono/src/components/mayura/ui.css +14 -0
- package/lib/cli/starters/hono/src/connect.js +21 -0
- package/lib/cli/starters/hono/src/session.js +138 -0
- package/lib/cli/starters/hono/src/style.css +11 -0
- package/lib/cli/starters/hono/src/vite-env.d.ts +1 -0
- package/lib/cli/starters/hono/test/server.test.mjs +95 -0
- package/lib/cli/starters/hono/test/session.test.mjs +16 -0
- package/lib/cli/starters/hono/tsconfig.json +34 -0
- package/lib/cli/starters/hono/vite.config.ts +3 -0
- package/lib/cli/starters/hono/web/index.html +1 -0
- package/lib/cli/starters/hono/web/main.jsx +4 -0
- package/lib/cli/starters/hono/wrangler.jsonc +29 -0
- package/lib/cli/starters/nextjs/Dockerfile +12 -0
- package/lib/cli/starters/nextjs/README.md +76 -0
- package/lib/cli/starters/nextjs/app/api/mayura/[[...path]]/route.ts +8 -0
- package/lib/cli/starters/nextjs/app/layout.tsx +4 -0
- package/lib/cli/starters/nextjs/app/page.tsx +2 -0
- package/lib/cli/starters/nextjs/compose.yaml +19 -0
- package/lib/cli/starters/nextjs/dot-dockerignore +11 -0
- package/lib/cli/starters/nextjs/dot-env.example +7 -0
- package/lib/cli/starters/nextjs/dot-gitignore +14 -0
- package/lib/cli/starters/nextjs/mayura.project.json +37 -0
- package/lib/cli/starters/nextjs/next-env.d.ts +7 -0
- package/lib/cli/starters/nextjs/next.config.mjs +1 -0
- package/lib/cli/starters/nextjs/package.json +38 -0
- package/lib/cli/starters/nextjs/scripts/setup.mjs +9 -0
- package/lib/cli/starters/nextjs/server/application.mjs +74 -0
- package/lib/cli/starters/nextjs/server/auth.mjs +24 -0
- package/lib/cli/starters/nextjs/server/node.mjs +31 -0
- package/lib/cli/starters/nextjs/server/worker.mjs +11 -0
- package/lib/cli/starters/nextjs/server/workflows.mjs +23 -0
- package/lib/cli/starters/nextjs/src/ChatApp.jsx +57 -0
- package/lib/cli/starters/nextjs/src/Notebook.jsx +25 -0
- package/lib/cli/starters/nextjs/src/components/mayura/approval.tsx +142 -0
- package/lib/cli/starters/nextjs/src/components/mayura/thread-history.tsx +142 -0
- package/lib/cli/starters/nextjs/src/components/mayura/thread-list.tsx +9 -0
- package/lib/cli/starters/nextjs/src/components/mayura/ui.css +14 -0
- package/lib/cli/starters/nextjs/src/connect.js +21 -0
- package/lib/cli/starters/nextjs/src/session.js +138 -0
- package/lib/cli/starters/nextjs/src/style.css +11 -0
- package/lib/cli/starters/nextjs/test/server.test.mjs +95 -0
- package/lib/cli/starters/nextjs/test/session.test.mjs +16 -0
- package/lib/cli/starters/nextjs/tsconfig.json +44 -0
- package/lib/cli/starters/nuxt/Dockerfile +12 -0
- package/lib/cli/starters/nuxt/README.md +77 -0
- package/lib/cli/starters/nuxt/app/app.vue +34 -0
- package/lib/cli/starters/nuxt/compose.yaml +19 -0
- package/lib/cli/starters/nuxt/dot-dockerignore +11 -0
- package/lib/cli/starters/nuxt/dot-env.example +7 -0
- package/lib/cli/starters/nuxt/dot-gitignore +14 -0
- package/lib/cli/starters/nuxt/mayura.project.json +37 -0
- package/lib/cli/starters/nuxt/nuxt.config.ts +1 -0
- package/lib/cli/starters/nuxt/package.json +37 -0
- package/lib/cli/starters/nuxt/scripts/setup.mjs +9 -0
- package/lib/cli/starters/nuxt/server/application.mjs +74 -0
- package/lib/cli/starters/nuxt/server/auth.mjs +24 -0
- package/lib/cli/starters/nuxt/server/node.mjs +31 -0
- package/lib/cli/starters/nuxt/server/routes/api/mayura/[...path].ts +3 -0
- package/lib/cli/starters/nuxt/server/worker.mjs +11 -0
- package/lib/cli/starters/nuxt/server/workflows.mjs +23 -0
- package/lib/cli/starters/nuxt/src/connect.js +21 -0
- package/lib/cli/starters/nuxt/src/session.js +138 -0
- package/lib/cli/starters/nuxt/src/style.css +11 -0
- package/lib/cli/starters/nuxt/src/view.js +49 -0
- package/lib/cli/starters/nuxt/test/server.test.mjs +95 -0
- package/lib/cli/starters/nuxt/test/session.test.mjs +16 -0
- package/lib/cli/starters/nuxt/tsconfig.json +3 -0
- package/lib/cli/starters/react-router/Dockerfile +12 -0
- package/lib/cli/starters/react-router/README.md +78 -0
- package/lib/cli/starters/react-router/app/root.tsx +3 -0
- package/lib/cli/starters/react-router/app/routes/api.ts +3 -0
- package/lib/cli/starters/react-router/app/routes/home.tsx +2 -0
- package/lib/cli/starters/react-router/app/routes.ts +2 -0
- package/lib/cli/starters/react-router/compose.yaml +19 -0
- package/lib/cli/starters/react-router/dot-dockerignore +11 -0
- package/lib/cli/starters/react-router/dot-env.example +7 -0
- package/lib/cli/starters/react-router/dot-gitignore +14 -0
- package/lib/cli/starters/react-router/mayura.project.json +37 -0
- package/lib/cli/starters/react-router/package.json +43 -0
- package/lib/cli/starters/react-router/react-router.config.ts +2 -0
- package/lib/cli/starters/react-router/scripts/setup.mjs +9 -0
- package/lib/cli/starters/react-router/server/application.mjs +74 -0
- package/lib/cli/starters/react-router/server/auth.mjs +24 -0
- package/lib/cli/starters/react-router/server/node.mjs +31 -0
- package/lib/cli/starters/react-router/server/worker.mjs +11 -0
- package/lib/cli/starters/react-router/server/workflows.mjs +23 -0
- package/lib/cli/starters/react-router/src/ChatApp.jsx +57 -0
- package/lib/cli/starters/react-router/src/Notebook.jsx +25 -0
- package/lib/cli/starters/react-router/src/components/mayura/approval.tsx +142 -0
- package/lib/cli/starters/react-router/src/components/mayura/thread-history.tsx +142 -0
- package/lib/cli/starters/react-router/src/components/mayura/thread-list.tsx +9 -0
- package/lib/cli/starters/react-router/src/components/mayura/ui.css +14 -0
- package/lib/cli/starters/react-router/src/connect.js +21 -0
- package/lib/cli/starters/react-router/src/session.js +138 -0
- package/lib/cli/starters/react-router/src/style.css +11 -0
- package/lib/cli/starters/react-router/src/vite-env.d.ts +1 -0
- package/lib/cli/starters/react-router/test/server.test.mjs +95 -0
- package/lib/cli/starters/react-router/test/session.test.mjs +16 -0
- package/lib/cli/starters/react-router/tsconfig.json +39 -0
- package/lib/cli/starters/react-router/vite.config.ts +3 -0
- package/lib/cli/starters/research-team/README.md +1 -1
- package/lib/cli/starters/research-team/dot-env.example +1 -1
- package/lib/cli/starters/research-team/test/research.test.ts +18 -1
- package/lib/cli/starters/support-agent/dot-env.example +1 -1
- package/lib/cli/starters/support-agent/test/support.test.ts +18 -1
- package/lib/cli/starters/sveltekit/Dockerfile +12 -0
- package/lib/cli/starters/sveltekit/README.md +79 -0
- package/lib/cli/starters/sveltekit/compose.yaml +19 -0
- package/lib/cli/starters/sveltekit/dot-dockerignore +11 -0
- package/lib/cli/starters/sveltekit/dot-env.example +7 -0
- package/lib/cli/starters/sveltekit/dot-gitignore +14 -0
- package/lib/cli/starters/sveltekit/mayura.project.json +37 -0
- package/lib/cli/starters/sveltekit/package.json +39 -0
- package/lib/cli/starters/sveltekit/scripts/setup.mjs +9 -0
- package/lib/cli/starters/sveltekit/server/application.mjs +74 -0
- package/lib/cli/starters/sveltekit/server/auth.mjs +24 -0
- package/lib/cli/starters/sveltekit/server/node.mjs +31 -0
- package/lib/cli/starters/sveltekit/server/worker.mjs +11 -0
- package/lib/cli/starters/sveltekit/server/workflows.mjs +23 -0
- package/lib/cli/starters/sveltekit/src/app.html +1 -0
- package/lib/cli/starters/sveltekit/src/connect.js +21 -0
- package/lib/cli/starters/sveltekit/src/routes/+page.svelte +48 -0
- package/lib/cli/starters/sveltekit/src/routes/api/mayura/[...path]/+server.ts +4 -0
- package/lib/cli/starters/sveltekit/src/session.js +138 -0
- package/lib/cli/starters/sveltekit/src/style.css +11 -0
- package/lib/cli/starters/sveltekit/src/view.js +49 -0
- package/lib/cli/starters/sveltekit/test/server.test.mjs +95 -0
- package/lib/cli/starters/sveltekit/test/session.test.mjs +16 -0
- package/lib/cli/starters/sveltekit/tsconfig.json +11 -0
- package/lib/cli/starters/sveltekit/vite.config.ts +5 -0
- package/lib/cli/starters/tanstack-start/Dockerfile +12 -0
- package/lib/cli/starters/tanstack-start/README.md +80 -0
- package/lib/cli/starters/tanstack-start/compose.yaml +19 -0
- package/lib/cli/starters/tanstack-start/dot-dockerignore +11 -0
- package/lib/cli/starters/tanstack-start/dot-env.example +7 -0
- package/lib/cli/starters/tanstack-start/dot-gitignore +14 -0
- package/lib/cli/starters/tanstack-start/mayura.project.json +37 -0
- package/lib/cli/starters/tanstack-start/package.json +42 -0
- package/lib/cli/starters/tanstack-start/scripts/setup.mjs +9 -0
- package/lib/cli/starters/tanstack-start/server/application.mjs +74 -0
- package/lib/cli/starters/tanstack-start/server/auth.mjs +24 -0
- package/lib/cli/starters/tanstack-start/server/node.mjs +31 -0
- package/lib/cli/starters/tanstack-start/server/worker.mjs +11 -0
- package/lib/cli/starters/tanstack-start/server/workflows.mjs +23 -0
- package/lib/cli/starters/tanstack-start/src/ChatApp.jsx +57 -0
- package/lib/cli/starters/tanstack-start/src/Notebook.jsx +25 -0
- package/lib/cli/starters/tanstack-start/src/components/mayura/approval.tsx +142 -0
- package/lib/cli/starters/tanstack-start/src/components/mayura/thread-history.tsx +142 -0
- package/lib/cli/starters/tanstack-start/src/components/mayura/thread-list.tsx +9 -0
- package/lib/cli/starters/tanstack-start/src/components/mayura/ui.css +14 -0
- package/lib/cli/starters/tanstack-start/src/connect.js +21 -0
- package/lib/cli/starters/tanstack-start/src/routeTree.gen.ts +86 -0
- package/lib/cli/starters/tanstack-start/src/router.tsx +4 -0
- package/lib/cli/starters/tanstack-start/src/routes/__root.tsx +3 -0
- package/lib/cli/starters/tanstack-start/src/routes/api.mayura.$.ts +4 -0
- package/lib/cli/starters/tanstack-start/src/routes/index.tsx +3 -0
- package/lib/cli/starters/tanstack-start/src/session.js +138 -0
- package/lib/cli/starters/tanstack-start/src/style.css +11 -0
- package/lib/cli/starters/tanstack-start/test/server.test.mjs +95 -0
- package/lib/cli/starters/tanstack-start/test/session.test.mjs +16 -0
- package/lib/cli/starters/tanstack-start/tsconfig.json +35 -0
- package/lib/cli/starters/tanstack-start/vite.config.ts +5 -0
- package/lib/cli/ui/approval.tsx +142 -0
- package/lib/cli/ui/browser-view.tsx +6 -0
- package/lib/cli/ui/chat.tsx +17 -0
- package/lib/cli/ui/citations.tsx +7 -0
- package/lib/cli/ui/registry.json +153 -0
- package/lib/cli/ui/run-status.tsx +4 -0
- package/lib/cli/ui/sandbox-terminal.tsx +5 -0
- package/lib/cli/ui/thread-history.tsx +142 -0
- package/lib/cli/ui/thread-list.tsx +9 -0
- package/lib/cli/ui/tool-call.tsx +6 -0
- package/lib/cli/ui/ui.css +14 -0
- package/lib/cli/ui/voice.tsx +21 -0
- package/lib/cli/ui/workflow-progress.tsx +4 -0
- package/lib/client/dist/conversation-stores.d.ts +84 -0
- package/lib/client/dist/conversation-stores.d.ts.map +1 -0
- package/lib/client/dist/conversation-stores.js +196 -0
- package/lib/client/dist/conversation-stores.js.map +1 -0
- package/lib/client/dist/conversations.d.ts +228 -0
- package/lib/client/dist/conversations.d.ts.map +1 -0
- package/lib/client/dist/conversations.js +465 -0
- package/lib/client/dist/conversations.js.map +1 -0
- package/lib/client/dist/headless.d.ts +11 -1
- package/lib/client/dist/headless.d.ts.map +1 -1
- package/lib/client/dist/headless.js +73 -6
- package/lib/client/dist/headless.js.map +1 -1
- package/lib/client/dist/history-event.d.ts +3 -0
- package/lib/client/dist/history-event.d.ts.map +1 -0
- package/lib/client/dist/history-event.js +9 -0
- package/lib/client/dist/history-event.js.map +1 -0
- package/lib/client/dist/index.d.ts +25 -7
- package/lib/client/dist/index.d.ts.map +1 -1
- package/lib/client/dist/index.js +57 -16
- package/lib/client/dist/index.js.map +1 -1
- package/lib/client/dist/thread-compaction-store.d.ts +41 -0
- package/lib/client/dist/thread-compaction-store.d.ts.map +1 -0
- package/lib/client/dist/thread-compaction-store.js +135 -0
- package/lib/client/dist/thread-compaction-store.js.map +1 -0
- package/lib/client/package.json +1 -1
- package/lib/client/src/conversation-stores.ts +167 -0
- package/lib/client/src/conversations.ts +325 -0
- package/lib/client/src/headless.ts +41 -8
- package/lib/client/src/history-event.ts +8 -0
- package/lib/client/src/index.ts +62 -29
- package/lib/client/src/thread-compaction-store.ts +92 -0
- package/lib/client-react/dist/compaction-components.d.ts +16 -0
- package/lib/client-react/dist/compaction-components.d.ts.map +1 -0
- package/lib/client-react/dist/compaction-components.js +81 -0
- package/lib/client-react/dist/compaction-components.js.map +1 -0
- package/lib/client-react/dist/components.d.ts +2 -0
- package/lib/client-react/dist/components.d.ts.map +1 -1
- package/lib/client-react/dist/components.js +2 -0
- package/lib/client-react/dist/components.js.map +1 -1
- package/lib/client-react/dist/conversation-components.d.ts +30 -0
- package/lib/client-react/dist/conversation-components.d.ts.map +1 -0
- package/lib/client-react/dist/conversation-components.js +120 -0
- package/lib/client-react/dist/conversation-components.js.map +1 -0
- package/lib/client-react/dist/index.d.ts +17 -2
- package/lib/client-react/dist/index.d.ts.map +1 -1
- package/lib/client-react/dist/index.js +43 -0
- package/lib/client-react/dist/index.js.map +1 -1
- package/lib/client-react/package.json +1 -1
- package/lib/client-react/src/compaction-components.ts +89 -0
- package/lib/client-react/src/components.ts +4 -0
- package/lib/client-react/src/conversation-components.ts +138 -0
- package/lib/client-react/src/index.ts +47 -1
- package/lib/code-mode/dist/index.d.ts.map +1 -1
- package/lib/code-mode/dist/index.js +2 -0
- package/lib/code-mode/dist/index.js.map +1 -1
- package/lib/code-mode/package.json +1 -1
- package/lib/code-mode/src/index.ts +2 -0
- package/lib/code-mode-workflows/package.json +1 -1
- package/lib/context/dist/assemble.d.ts.map +1 -1
- package/lib/context/dist/assemble.js +25 -2
- package/lib/context/dist/assemble.js.map +1 -1
- package/lib/context/dist/cache.d.ts.map +1 -1
- package/lib/context/dist/cache.js +5 -0
- package/lib/context/dist/cache.js.map +1 -1
- package/lib/context/dist/contracts.d.ts +5 -3
- package/lib/context/dist/contracts.d.ts.map +1 -1
- package/lib/context/dist/contracts.js.map +1 -1
- package/lib/context/package.json +1 -1
- package/lib/context/src/assemble.ts +18 -2
- package/lib/context/src/cache.ts +3 -0
- package/lib/context/src/contracts.ts +5 -3
- package/lib/core/dist/authorization-audit.d.ts +41 -0
- package/lib/core/dist/authorization-audit.d.ts.map +1 -0
- package/lib/core/dist/authorization-audit.js +103 -0
- package/lib/core/dist/authorization-audit.js.map +1 -0
- package/lib/core/dist/authorization.d.ts +69 -0
- package/lib/core/dist/authorization.d.ts.map +1 -0
- package/lib/core/dist/authorization.js +156 -0
- package/lib/core/dist/authorization.js.map +1 -0
- package/lib/core/dist/contracts.d.ts +19 -2
- package/lib/core/dist/contracts.d.ts.map +1 -1
- package/lib/core/dist/contracts.js.map +1 -1
- package/lib/core/dist/errors.d.ts +1 -1
- package/lib/core/dist/errors.d.ts.map +1 -1
- package/lib/core/dist/errors.js.map +1 -1
- package/lib/core/dist/index.d.ts +2 -0
- package/lib/core/dist/index.d.ts.map +1 -1
- package/lib/core/dist/index.js +2 -0
- package/lib/core/dist/index.js.map +1 -1
- package/lib/core/package.json +1 -1
- package/lib/core/src/authorization-audit.ts +93 -0
- package/lib/core/src/authorization.ts +148 -0
- package/lib/core/src/contracts.ts +18 -4
- package/lib/core/src/errors.ts +1 -1
- package/lib/core/src/index.ts +4 -0
- package/lib/exporter-otlp/dist/authorization.d.ts +22 -0
- package/lib/exporter-otlp/dist/authorization.d.ts.map +1 -0
- package/lib/exporter-otlp/dist/authorization.js +78 -0
- package/lib/exporter-otlp/dist/authorization.js.map +1 -0
- package/lib/exporter-otlp/dist/opentelemetry.d.ts +1 -0
- package/lib/exporter-otlp/dist/opentelemetry.d.ts.map +1 -1
- package/lib/exporter-otlp/dist/opentelemetry.js +1 -0
- package/lib/exporter-otlp/dist/opentelemetry.js.map +1 -1
- package/lib/exporter-otlp/dist/otlp-http-json.js +1 -1
- package/lib/exporter-otlp/dist/otlp-http-json.js.map +1 -1
- package/lib/exporter-otlp/dist/signals.js +2 -2
- package/lib/exporter-otlp/dist/signals.js.map +1 -1
- package/lib/exporter-otlp/package.json +1 -1
- package/lib/exporter-otlp/src/authorization.ts +70 -0
- package/lib/exporter-otlp/src/opentelemetry.ts +2 -0
- package/lib/exporter-otlp/src/otlp-http-json.ts +1 -1
- package/lib/exporter-otlp/src/signals.ts +2 -2
- package/lib/files/package.json +1 -1
- package/lib/guardrails/package.json +1 -1
- package/lib/helpers/dist/configuration.d.ts.map +1 -1
- package/lib/helpers/dist/configuration.js +18 -5
- package/lib/helpers/dist/configuration.js.map +1 -1
- package/lib/helpers/package.json +1 -1
- package/lib/helpers/src/configuration.ts +14 -6
- package/lib/keys/dist/conformance.d.ts.map +1 -1
- package/lib/keys/dist/conformance.js +17 -7
- package/lib/keys/dist/conformance.js.map +1 -1
- package/lib/keys/package.json +1 -1
- package/lib/keys/src/conformance.ts +17 -7
- package/lib/memory/dist/authorization.d.ts +10 -0
- package/lib/memory/dist/authorization.d.ts.map +1 -0
- package/lib/memory/dist/authorization.js +65 -0
- package/lib/memory/dist/authorization.js.map +1 -0
- package/lib/memory/dist/contracts.d.ts +3 -1
- package/lib/memory/dist/contracts.d.ts.map +1 -1
- package/lib/memory/dist/contracts.js.map +1 -1
- package/lib/memory/dist/index.d.ts.map +1 -1
- package/lib/memory/dist/index.js +49 -13
- package/lib/memory/dist/index.js.map +1 -1
- package/lib/memory/dist/native.d.ts +3 -1
- package/lib/memory/dist/native.d.ts.map +1 -1
- package/lib/memory/dist/native.js +177 -33
- package/lib/memory/dist/native.js.map +1 -1
- package/lib/memory/package.json +1 -1
- package/lib/memory/src/authorization.ts +46 -0
- package/lib/memory/src/contracts.ts +3 -1
- package/lib/memory/src/index.ts +41 -17
- package/lib/memory/src/native.ts +122 -42
- package/lib/memory-remote/dist/index.d.ts +2 -1
- package/lib/memory-remote/dist/index.d.ts.map +1 -1
- package/lib/memory-remote/dist/index.js +38 -3
- package/lib/memory-remote/dist/index.js.map +1 -1
- package/lib/memory-remote/package.json +1 -1
- package/lib/memory-remote/src/index.ts +31 -5
- package/lib/observability/dist/validation.d.ts.map +1 -1
- package/lib/observability/dist/validation.js +35 -2
- package/lib/observability/dist/validation.js.map +1 -1
- package/lib/observability/package.json +1 -1
- package/lib/observability/src/validation.ts +19 -2
- package/lib/provider-anthropic/dist/index.d.ts.map +1 -1
- package/lib/provider-anthropic/dist/index.js +70 -3
- package/lib/provider-anthropic/dist/index.js.map +1 -1
- package/lib/provider-anthropic/package.json +1 -1
- package/lib/provider-anthropic/src/index.ts +58 -3
- package/lib/provider-openai/dist/index.d.ts +6 -3
- package/lib/provider-openai/dist/index.d.ts.map +1 -1
- package/lib/provider-openai/dist/index.js +129 -15
- package/lib/provider-openai/dist/index.js.map +1 -1
- package/lib/provider-openai/package.json +1 -1
- package/lib/provider-openai/src/index.ts +112 -19
- package/lib/rag/dist/catalog.d.ts +5 -0
- package/lib/rag/dist/catalog.d.ts.map +1 -0
- package/lib/rag/dist/catalog.js +39 -0
- package/lib/rag/dist/catalog.js.map +1 -0
- package/lib/rag/dist/contracts.d.ts +138 -0
- package/lib/rag/dist/contracts.d.ts.map +1 -0
- package/lib/rag/dist/contracts.js +2 -0
- package/lib/rag/dist/contracts.js.map +1 -0
- package/lib/rag/dist/host.d.ts +5 -0
- package/lib/rag/dist/host.d.ts.map +1 -0
- package/lib/rag/dist/host.js +5 -0
- package/lib/rag/dist/host.js.map +1 -0
- package/lib/rag/dist/http.d.ts +12 -0
- package/lib/rag/dist/http.d.ts.map +1 -0
- package/lib/rag/dist/http.js +102 -0
- package/lib/rag/dist/http.js.map +1 -0
- package/lib/rag/dist/index.d.ts +11 -0
- package/lib/rag/dist/index.d.ts.map +1 -0
- package/lib/rag/dist/index.js +10 -0
- package/lib/rag/dist/index.js.map +1 -0
- package/lib/rag/dist/ingestion.d.ts +66 -0
- package/lib/rag/dist/ingestion.d.ts.map +1 -0
- package/lib/rag/dist/ingestion.js +200 -0
- package/lib/rag/dist/ingestion.js.map +1 -0
- package/lib/rag/dist/loaders.d.ts +59 -0
- package/lib/rag/dist/loaders.d.ts.map +1 -0
- package/lib/rag/dist/loaders.js +128 -0
- package/lib/rag/dist/loaders.js.map +1 -0
- package/lib/rag/dist/metrics.d.ts +24 -0
- package/lib/rag/dist/metrics.d.ts.map +1 -0
- package/lib/rag/dist/metrics.js +30 -0
- package/lib/rag/dist/metrics.js.map +1 -0
- package/lib/rag/dist/models.d.ts +21 -0
- package/lib/rag/dist/models.d.ts.map +1 -0
- package/lib/rag/dist/models.js +55 -0
- package/lib/rag/dist/models.js.map +1 -0
- package/lib/rag/dist/native.d.ts +11 -0
- package/lib/rag/dist/native.d.ts.map +1 -0
- package/lib/rag/dist/native.js +107 -0
- package/lib/rag/dist/native.js.map +1 -0
- package/lib/rag/dist/retrieval.d.ts +21 -0
- package/lib/rag/dist/retrieval.d.ts.map +1 -0
- package/lib/rag/dist/retrieval.js +149 -0
- package/lib/rag/dist/retrieval.js.map +1 -0
- package/lib/rag/dist/tool.d.ts +13 -0
- package/lib/rag/dist/tool.d.ts.map +1 -0
- package/lib/rag/dist/tool.js +27 -0
- package/lib/rag/dist/tool.js.map +1 -0
- package/lib/rag/dist/validation.d.ts +29 -0
- package/lib/rag/dist/validation.d.ts.map +1 -0
- package/lib/rag/dist/validation.js +94 -0
- package/lib/rag/dist/validation.js.map +1 -0
- package/lib/rag/dist/vectors.d.ts +15 -0
- package/lib/rag/dist/vectors.d.ts.map +1 -0
- package/lib/rag/dist/vectors.js +79 -0
- package/lib/rag/dist/vectors.js.map +1 -0
- package/lib/rag/package.json +5 -0
- package/lib/rag/src/catalog.ts +28 -0
- package/lib/rag/src/contracts.ts +76 -0
- package/lib/rag/src/host.ts +4 -0
- package/lib/rag/src/http.ts +38 -0
- package/lib/rag/src/index.ts +10 -0
- package/lib/rag/src/ingestion.ts +151 -0
- package/lib/rag/src/loaders.ts +85 -0
- package/lib/rag/src/metrics.ts +23 -0
- package/lib/rag/src/models.ts +41 -0
- package/lib/rag/src/native.ts +65 -0
- package/lib/rag/src/retrieval.ts +95 -0
- package/lib/rag/src/tool.ts +23 -0
- package/lib/rag/src/validation.ts +62 -0
- package/lib/rag/src/vectors.ts +55 -0
- package/lib/runtime/dist/agent.d.ts +15 -1
- package/lib/runtime/dist/agent.d.ts.map +1 -1
- package/lib/runtime/dist/agent.js +65 -4
- package/lib/runtime/dist/agent.js.map +1 -1
- package/lib/runtime/dist/checkpoint.d.ts +131 -0
- package/lib/runtime/dist/checkpoint.d.ts.map +1 -0
- package/lib/runtime/dist/checkpoint.js +203 -0
- package/lib/runtime/dist/checkpoint.js.map +1 -0
- package/lib/runtime/dist/handoffs.d.ts +12 -0
- package/lib/runtime/dist/handoffs.d.ts.map +1 -0
- package/lib/runtime/dist/handoffs.js +28 -0
- package/lib/runtime/dist/handoffs.js.map +1 -0
- package/lib/runtime/dist/history.d.ts +27 -0
- package/lib/runtime/dist/history.d.ts.map +1 -0
- package/lib/runtime/dist/history.js +106 -0
- package/lib/runtime/dist/history.js.map +1 -0
- package/lib/runtime/dist/hooks.d.ts +11 -2
- package/lib/runtime/dist/hooks.d.ts.map +1 -1
- package/lib/runtime/dist/hooks.js +1 -1
- package/lib/runtime/dist/hooks.js.map +1 -1
- package/lib/runtime/dist/index.d.ts +5 -2
- package/lib/runtime/dist/index.d.ts.map +1 -1
- package/lib/runtime/dist/index.js.map +1 -1
- package/lib/runtime/dist/managed-guards.d.ts +1 -0
- package/lib/runtime/dist/managed-guards.d.ts.map +1 -1
- package/lib/runtime/dist/managed-guards.js +2 -0
- package/lib/runtime/dist/managed-guards.js.map +1 -1
- package/lib/runtime/dist/recording.d.ts +31 -0
- package/lib/runtime/dist/recording.d.ts.map +1 -0
- package/lib/runtime/dist/recording.js +2 -0
- package/lib/runtime/dist/recording.js.map +1 -0
- package/lib/runtime/dist/router.d.ts.map +1 -1
- package/lib/runtime/dist/router.js +1 -0
- package/lib/runtime/dist/router.js.map +1 -1
- package/lib/runtime/dist/runtime.d.ts +100 -5
- package/lib/runtime/dist/runtime.d.ts.map +1 -1
- package/lib/runtime/dist/runtime.js +1207 -284
- package/lib/runtime/dist/runtime.js.map +1 -1
- package/lib/runtime/package.json +1 -1
- package/lib/runtime/src/agent.ts +58 -5
- package/lib/runtime/src/checkpoint.ts +236 -0
- package/lib/runtime/src/handoffs.ts +22 -0
- package/lib/runtime/src/history.ts +92 -0
- package/lib/runtime/src/hooks.ts +8 -3
- package/lib/runtime/src/index.ts +7 -2
- package/lib/runtime/src/managed-guards.ts +3 -0
- package/lib/runtime/src/recording.ts +31 -0
- package/lib/runtime/src/router.ts +1 -0
- package/lib/runtime/src/runtime.ts +838 -69
- package/lib/sandbox/package.json +1 -1
- package/lib/sdk/package.json +1 -1
- package/lib/server/dist/approval-reconciliation.d.ts +72 -0
- package/lib/server/dist/approval-reconciliation.d.ts.map +1 -0
- package/lib/server/dist/approval-reconciliation.js +257 -0
- package/lib/server/dist/approval-reconciliation.js.map +1 -0
- package/lib/server/dist/authorization.d.ts +20 -0
- package/lib/server/dist/authorization.d.ts.map +1 -0
- package/lib/server/dist/authorization.js +136 -0
- package/lib/server/dist/authorization.js.map +1 -0
- package/lib/server/dist/conversation-recovery.d.ts +42 -0
- package/lib/server/dist/conversation-recovery.d.ts.map +1 -0
- package/lib/server/dist/conversation-recovery.js +90 -0
- package/lib/server/dist/conversation-recovery.js.map +1 -0
- package/lib/server/dist/index.d.ts +52 -4
- package/lib/server/dist/index.d.ts.map +1 -1
- package/lib/server/dist/index.js +899 -85
- package/lib/server/dist/index.js.map +1 -1
- package/lib/server/dist/inspector-bundle.d.ts +1 -1
- package/lib/server/dist/inspector-bundle.d.ts.map +1 -1
- package/lib/server/dist/inspector-bundle.js +4 -4
- package/lib/server/dist/inspector-bundle.js.map +1 -1
- package/lib/server/dist/thread-compaction.d.ts +33 -0
- package/lib/server/dist/thread-compaction.d.ts.map +1 -0
- package/lib/server/dist/thread-compaction.js +116 -0
- package/lib/server/dist/thread-compaction.js.map +1 -0
- package/lib/server/package.json +1 -1
- package/lib/server/src/approval-reconciliation.ts +226 -0
- package/lib/server/src/authorization.ts +99 -0
- package/lib/server/src/conversation-recovery.ts +85 -0
- package/lib/server/src/index.ts +680 -81
- package/lib/server/src/inspector-bundle.ts +4 -4
- package/lib/server/src/thread-compaction.ts +97 -0
- package/lib/server-node/dist/hardening.d.ts +6 -0
- package/lib/server-node/dist/hardening.d.ts.map +1 -1
- package/lib/server-node/dist/hardening.js +25 -0
- package/lib/server-node/dist/hardening.js.map +1 -1
- package/lib/server-node/dist/index.d.ts +6 -1
- package/lib/server-node/dist/index.d.ts.map +1 -1
- package/lib/server-node/dist/index.js +7 -3
- package/lib/server-node/dist/index.js.map +1 -1
- package/lib/server-node/dist/production.d.ts +6 -1
- package/lib/server-node/dist/production.d.ts.map +1 -1
- package/lib/server-node/dist/production.js +7 -3
- package/lib/server-node/dist/production.js.map +1 -1
- package/lib/server-node/package.json +1 -1
- package/lib/server-node/src/hardening.ts +25 -0
- package/lib/server-node/src/index.ts +12 -3
- package/lib/server-node/src/production.ts +12 -3
- package/lib/skills/package.json +1 -1
- package/lib/storage/package.json +1 -1
- package/lib/storage-contracts/dist/conversation-contracts.d.ts +298 -0
- package/lib/storage-contracts/dist/conversation-contracts.d.ts.map +1 -0
- package/lib/storage-contracts/dist/conversation-contracts.js +701 -0
- package/lib/storage-contracts/dist/conversation-contracts.js.map +1 -0
- package/lib/storage-contracts/dist/frontend-tools.d.ts +114 -0
- package/lib/storage-contracts/dist/frontend-tools.d.ts.map +1 -0
- package/lib/storage-contracts/dist/frontend-tools.js +335 -0
- package/lib/storage-contracts/dist/frontend-tools.js.map +1 -0
- package/lib/storage-contracts/dist/index.d.ts +2 -0
- package/lib/storage-contracts/dist/index.d.ts.map +1 -1
- package/lib/storage-contracts/dist/index.js +2 -0
- package/lib/storage-contracts/dist/index.js.map +1 -1
- package/lib/storage-contracts/dist/run-records.d.ts +9 -1
- package/lib/storage-contracts/dist/run-records.d.ts.map +1 -1
- package/lib/storage-contracts/dist/run-records.js +45 -17
- package/lib/storage-contracts/dist/run-records.js.map +1 -1
- package/lib/storage-contracts/package.json +1 -1
- package/lib/storage-contracts/src/conversation-contracts.ts +546 -0
- package/lib/storage-contracts/src/frontend-tools.ts +233 -0
- package/lib/storage-contracts/src/index.ts +2 -0
- package/lib/storage-contracts/src/run-records.ts +44 -18
- package/lib/storage-postgres/dist/postgres.d.ts +2 -2
- package/lib/storage-postgres/dist/postgres.d.ts.map +1 -1
- package/lib/storage-postgres/dist/postgres.js.map +1 -1
- package/lib/storage-postgres/dist/store.d.ts +2 -2
- package/lib/storage-postgres/dist/store.d.ts.map +1 -1
- package/lib/storage-postgres/dist/store.js +4 -1
- package/lib/storage-postgres/dist/store.js.map +1 -1
- package/lib/storage-postgres/package.json +1 -1
- package/lib/storage-postgres/src/postgres.ts +2 -2
- package/lib/storage-postgres/src/store.ts +6 -3
- package/lib/storage-sql/dist/conversation-database.d.ts +25 -0
- package/lib/storage-sql/dist/conversation-database.d.ts.map +1 -0
- package/lib/storage-sql/dist/conversation-database.js +388 -0
- package/lib/storage-sql/dist/conversation-database.js.map +1 -0
- package/lib/storage-sql/dist/conversation-persistence.d.ts +89 -0
- package/lib/storage-sql/dist/conversation-persistence.d.ts.map +1 -0
- package/lib/storage-sql/dist/conversation-persistence.js +113 -0
- package/lib/storage-sql/dist/conversation-persistence.js.map +1 -0
- package/lib/storage-sql/dist/document/conversation-rows.d.ts +5 -0
- package/lib/storage-sql/dist/document/conversation-rows.d.ts.map +1 -0
- package/lib/storage-sql/dist/document/conversation-rows.js +177 -0
- package/lib/storage-sql/dist/document/conversation-rows.js.map +1 -0
- package/lib/storage-sql/dist/document/store.d.ts +3 -3
- package/lib/storage-sql/dist/document/store.d.ts.map +1 -1
- package/lib/storage-sql/dist/document/store.js +7 -1
- package/lib/storage-sql/dist/document/store.js.map +1 -1
- package/lib/storage-sql/dist/host.d.ts +4 -0
- package/lib/storage-sql/dist/host.d.ts.map +1 -1
- package/lib/storage-sql/dist/host.js +2 -0
- package/lib/storage-sql/dist/host.js.map +1 -1
- package/lib/storage-sql/dist/thread-compaction.d.ts +8 -0
- package/lib/storage-sql/dist/thread-compaction.d.ts.map +1 -0
- package/lib/storage-sql/dist/thread-compaction.js +130 -0
- package/lib/storage-sql/dist/thread-compaction.js.map +1 -0
- package/lib/storage-sql/package.json +1 -1
- package/lib/storage-sql/src/conversation-database.ts +323 -0
- package/lib/storage-sql/src/conversation-persistence.ts +166 -0
- package/lib/storage-sql/src/document/conversation-rows.ts +162 -0
- package/lib/storage-sql/src/document/store.ts +11 -4
- package/lib/storage-sql/src/host.ts +4 -0
- package/lib/storage-sql/src/thread-compaction.ts +110 -0
- package/lib/storage-sqlite/dist/sqlite-database.d.ts +4 -1
- package/lib/storage-sqlite/dist/sqlite-database.d.ts.map +1 -1
- package/lib/storage-sqlite/dist/sqlite-database.js +5 -1
- package/lib/storage-sqlite/dist/sqlite-database.js.map +1 -1
- package/lib/storage-sqlite/dist/sqlite-worker.js +6 -0
- package/lib/storage-sqlite/dist/sqlite-worker.js.map +1 -1
- package/lib/storage-sqlite/dist/sqlite.d.ts +2 -2
- package/lib/storage-sqlite/dist/sqlite.d.ts.map +1 -1
- package/lib/storage-sqlite/dist/sqlite.js +3 -1
- package/lib/storage-sqlite/dist/sqlite.js.map +1 -1
- package/lib/storage-sqlite/package.json +1 -1
- package/lib/storage-sqlite/src/sqlite-database.ts +6 -2
- package/lib/storage-sqlite/src/sqlite-worker.ts +3 -1
- package/lib/storage-sqlite/src/sqlite.ts +5 -3
- package/lib/terminal/dist/index.js.map +1 -1
- package/lib/terminal/package.json +1 -1
- package/lib/terminal/src/index.ts +273 -273
- package/lib/testing/dist/index.d.ts +5 -1
- package/lib/testing/dist/index.d.ts.map +1 -1
- package/lib/testing/dist/index.js +14 -3
- package/lib/testing/dist/index.js.map +1 -1
- package/lib/testing/package.json +1 -1
- package/lib/testing/src/index.ts +14 -4
- package/lib/threads/dist/authorization.d.ts +10 -0
- package/lib/threads/dist/authorization.d.ts.map +1 -0
- package/lib/threads/dist/authorization.js +94 -0
- package/lib/threads/dist/authorization.js.map +1 -0
- package/lib/threads/dist/compaction.d.ts +55 -0
- package/lib/threads/dist/compaction.d.ts.map +1 -0
- package/lib/threads/dist/compaction.js +279 -0
- package/lib/threads/dist/compaction.js.map +1 -0
- package/lib/threads/dist/history.d.ts +44 -0
- package/lib/threads/dist/history.d.ts.map +1 -0
- package/lib/threads/dist/history.js +134 -0
- package/lib/threads/dist/history.js.map +1 -0
- package/lib/threads/dist/index.d.ts +256 -0
- package/lib/threads/dist/index.d.ts.map +1 -0
- package/lib/threads/dist/index.js +640 -0
- package/lib/threads/dist/index.js.map +1 -0
- package/lib/threads/dist/media.d.ts +14 -0
- package/lib/threads/dist/media.d.ts.map +1 -0
- package/lib/threads/dist/media.js +25 -0
- package/lib/threads/dist/media.js.map +1 -0
- package/lib/threads/package.json +5 -0
- package/lib/threads/src/authorization.ts +68 -0
- package/lib/threads/src/compaction.ts +225 -0
- package/lib/threads/src/history.ts +100 -0
- package/lib/threads/src/index.ts +625 -0
- package/lib/threads/src/media.ts +27 -0
- package/lib/tools/dist/approval-binding.d.ts +17 -0
- package/lib/tools/dist/approval-binding.d.ts.map +1 -0
- package/lib/tools/dist/approval-binding.js +29 -0
- package/lib/tools/dist/approval-binding.js.map +1 -0
- package/lib/tools/dist/batch.d.ts.map +1 -1
- package/lib/tools/dist/batch.js +18 -0
- package/lib/tools/dist/batch.js.map +1 -1
- package/lib/tools/dist/continuation.d.ts +39 -0
- package/lib/tools/dist/continuation.d.ts.map +1 -0
- package/lib/tools/dist/continuation.js +56 -0
- package/lib/tools/dist/continuation.js.map +1 -0
- package/lib/tools/dist/host.d.ts +3 -0
- package/lib/tools/dist/host.d.ts.map +1 -1
- package/lib/tools/dist/host.js +3 -0
- package/lib/tools/dist/host.js.map +1 -1
- package/lib/tools/dist/index.d.ts +23 -1
- package/lib/tools/dist/index.d.ts.map +1 -1
- package/lib/tools/dist/index.js +61 -7
- package/lib/tools/dist/index.js.map +1 -1
- package/lib/tools/package.json +1 -1
- package/lib/tools/src/approval-binding.ts +39 -0
- package/lib/tools/src/batch.ts +11 -0
- package/lib/tools/src/continuation.ts +64 -0
- package/lib/tools/src/host.ts +4 -0
- package/lib/tools/src/index.ts +72 -8
- package/lib/voice/package.json +1 -1
- package/lib/workflows/dist/agent-step.d.ts +3 -1
- package/lib/workflows/dist/agent-step.d.ts.map +1 -1
- package/lib/workflows/dist/agent-step.js +2 -1
- package/lib/workflows/dist/agent-step.js.map +1 -1
- package/lib/workflows/dist/agents.d.ts +3 -1
- package/lib/workflows/dist/agents.d.ts.map +1 -1
- package/lib/workflows/dist/agents.js +2 -1
- package/lib/workflows/dist/agents.js.map +1 -1
- package/lib/workflows/dist/authorization.d.ts +15 -0
- package/lib/workflows/dist/authorization.d.ts.map +1 -0
- package/lib/workflows/dist/authorization.js +69 -0
- package/lib/workflows/dist/authorization.js.map +1 -0
- package/lib/workflows/dist/children-coordinator.js +2 -2
- package/lib/workflows/dist/children-coordinator.js.map +1 -1
- package/lib/workflows/dist/children-runtime.d.ts +3 -0
- package/lib/workflows/dist/children-runtime.d.ts.map +1 -1
- package/lib/workflows/dist/children-runtime.js +207 -156
- package/lib/workflows/dist/children-runtime.js.map +1 -1
- package/lib/workflows/dist/graph-coordinator.js +2 -2
- package/lib/workflows/dist/graph-coordinator.js.map +1 -1
- package/lib/workflows/dist/lifecycle-runtime.d.ts +12 -1
- package/lib/workflows/dist/lifecycle-runtime.d.ts.map +1 -1
- package/lib/workflows/dist/lifecycle-runtime.js +85 -18
- package/lib/workflows/dist/lifecycle-runtime.js.map +1 -1
- package/lib/workflows/dist/loop-runtime.d.ts.map +1 -1
- package/lib/workflows/dist/loop-runtime.js +44 -20
- package/lib/workflows/dist/loop-runtime.js.map +1 -1
- package/lib/workflows/dist/runtime.d.ts +3 -0
- package/lib/workflows/dist/runtime.d.ts.map +1 -1
- package/lib/workflows/dist/runtime.js +43 -12
- package/lib/workflows/dist/runtime.js.map +1 -1
- package/lib/workflows/dist/saga-runtime.d.ts.map +1 -1
- package/lib/workflows/dist/saga-runtime.js +51 -20
- package/lib/workflows/dist/saga-runtime.js.map +1 -1
- package/lib/workflows/dist/scheduled.d.ts.map +1 -1
- package/lib/workflows/dist/scheduled.js +32 -9
- package/lib/workflows/dist/scheduled.js.map +1 -1
- package/lib/workflows/package.json +1 -1
- package/lib/workflows/src/agent-step.ts +5 -2
- package/lib/workflows/src/agents.ts +5 -2
- package/lib/workflows/src/authorization.ts +57 -0
- package/lib/workflows/src/children-coordinator.ts +2 -2
- package/lib/workflows/src/children-runtime.ts +30 -16
- package/lib/workflows/src/graph-coordinator.ts +2 -2
- package/lib/workflows/src/lifecycle-runtime.ts +80 -15
- package/lib/workflows/src/loop-runtime.ts +41 -17
- package/lib/workflows/src/runtime.ts +47 -12
- package/lib/workflows/src/saga-runtime.ts +47 -16
- package/lib/workflows/src/scheduled.ts +33 -12
- package/lib/workstream/package.json +1 -1
- package/llms-full.txt +18012 -360
- package/llms.txt +157 -1
- package/package.json +25 -1
- package/rag/host/index.d.ts +1 -0
- package/rag/host/index.js +1 -0
- package/rag/index.d.ts +1 -0
- package/rag/index.js +1 -0
- package/threads/index.d.ts +1 -0
- package/threads/index.js +1 -0
package/README.md
CHANGED
|
@@ -123,6 +123,13 @@ Anthropic (`anthropicMessages` from `mayura/provider-anthropic`) and OpenAI-comp
|
|
|
123
123
|
(`openAICompatibleChat` from `mayura/provider-openai`) are drop-in replacements for the model. The
|
|
124
124
|
[quickstart](docs/quickstart.md) goes further: streaming, a durable workflow, and serving the agent over HTTP.
|
|
125
125
|
|
|
126
|
+
## Runnable thread chat
|
|
127
|
+
|
|
128
|
+
From a repository checkout, run `pnpm build` then `node examples/thread-chat/server.mjs` and open the printed URL.
|
|
129
|
+
The [thread chat example](examples/thread-chat/README.md) wires React history and approval controls to SQLite-backed
|
|
130
|
+
runs: send a note, approve/reject the proposed write, or cancel. It works without a model API key and recovers a
|
|
131
|
+
waiting approval after page reload.
|
|
132
|
+
|
|
126
133
|
## CLI
|
|
127
134
|
|
|
128
135
|
The `mayura` command comes with the package. Start a new project with the interactive wizard: pick a starter, pick a
|
|
@@ -183,3 +190,6 @@ Mayura is created by **Aryabh** ([dev@rokad.co](mailto:dev@rokad.co)). The team
|
|
|
183
190
|
|
|
184
191
|
Mayura is open source under the [Apache-2.0 license](LICENSE). See [CONTRIBUTING.md](CONTRIBUTING.md) to contribute,
|
|
185
192
|
[SECURITY.md](SECURITY.md) to report a vulnerability and [SUPPORT.md](SUPPORT.md) for support.
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
The release-1.2 development branch includes the offline `examples/ag-ui-chat` notebook and a copy-in React registry (`mayura add ui --list`). See [copy-in UI](docs/guides/copy-in-ui.md) and [AG-UI](docs/guides/ag-ui.md). Local Windows tests, builds and package checks pass. V1.2 remains unreleased; see the [release validation status](docs/guides/release-readiness.md) for results and remaining qualifications.
|
package/ag-ui/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../lib/ag-ui/dist/index.js';
|
package/ag-ui/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../lib/ag-ui/dist/index.js';
|
package/authz/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../lib/authz/dist/index.js';
|
package/authz/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../lib/authz/dist/index.js';
|
package/docs/README.md
CHANGED
|
@@ -11,6 +11,7 @@ Mayura is a TypeScript framework for building AI agents, typed tools and durable
|
|
|
11
11
|
- [Introduction](introduction.md): what Mayura is and how its parts fit together.
|
|
12
12
|
- [Quickstart](quickstart.md): create a project, or add a first agent to your own.
|
|
13
13
|
- [Installation](installation.md): requirements, optional packages and TypeScript settings.
|
|
14
|
+
- [V1.2 release validation status](guides/release-readiness.md): completed local and CI checks, limitations and remaining release gates.
|
|
14
15
|
- [Using Mayura with AI coding agents](ai-agents.md): documentation your assistant can read offline.
|
|
15
16
|
|
|
16
17
|
## Concepts
|
|
@@ -23,15 +24,21 @@ Mayura is a TypeScript framework for building AI agents, typed tools and durable
|
|
|
23
24
|
- [Costs and budgets](concepts/costs-and-budgets.md): prices, cost caps and shared budgets.
|
|
24
25
|
- [Workflows](concepts/workflows.md): multi-step work, in memory or durable.
|
|
25
26
|
|
|
27
|
+
- [Framework starters](guides/framework-starters.md): six notebook applications with scoped threads, exact approvals and workers.
|
|
28
|
+
|
|
29
|
+
- [Retrieval augmented generation](guides/rag.md): scoped evidence, durable ingestion, vector stores and reranking.
|
|
30
|
+
|
|
26
31
|
## Agents and models
|
|
27
32
|
|
|
28
33
|
- [Model providers](guides/model-providers.md): OpenAI, Anthropic and OpenAI-compatible providers.
|
|
29
34
|
- [Model registry](guides/model-registry.md): models as provider/model from @mayurajs provider packages, with prices, retries and chains.
|
|
35
|
+
- [AI gateways](guides/ai-gateways.md): explicit gateway credentials, scoped models, discovery and reported costs.
|
|
30
36
|
- [Model routing](guides/model-routing.md): failover between providers.
|
|
31
37
|
- [Streaming](guides/streaming.md): show an answer while it is written.
|
|
32
38
|
- [Vision](guides/vision.md): agents that see images and PDFs, from the input or from tools.
|
|
33
39
|
- [Voice](guides/voice.md): transcribe speech and speak text, with prices and per-call bounds.
|
|
34
40
|
- [Child agents](guides/child-agents.md): agents that delegate to other agents.
|
|
41
|
+
- [Agent handoffs](guides/agent-handoffs.md): transfer a conversation with a continuing budget and separate agent permissions.
|
|
35
42
|
- [Skills](guides/skills.md): `SKILL.md` folders an agent loads on demand.
|
|
36
43
|
- [MCP tools](guides/mcp.md): call tools on an MCP server.
|
|
37
44
|
- [Terminal chat and commands](guides/terminal.md): run an agent in a terminal.
|
|
@@ -49,7 +56,9 @@ Mayura is a TypeScript framework for building AI agents, typed tools and durable
|
|
|
49
56
|
## Data, safety and extensions
|
|
50
57
|
|
|
51
58
|
- [Storage](guides/storage.md): SQLite, PostgreSQL, libSQL (Turso), MySQL, MongoDB, D1 and DynamoDB.
|
|
59
|
+
- [Threads](guides/threads.md): keep users' conversations and run each message with the conversation so far.
|
|
52
60
|
- [Memory and context](guides/memory-and-context.md): what an agent remembers and sees.
|
|
61
|
+
- [Fine-grained authorization](guides/authorization.md): scoped resource access with the core policy contract and built-in RBAC.
|
|
53
62
|
- [Guardrails](guides/guardrails.md): check, block or redact inputs and outputs.
|
|
54
63
|
- [Lifecycle hooks](guides/lifecycle-hooks.md): code that can stop a run at defined points.
|
|
55
64
|
- [Artifacts](guides/artifacts.md): store files that runs produce.
|
|
@@ -62,8 +71,10 @@ Mayura is a TypeScript framework for building AI agents, typed tools and durable
|
|
|
62
71
|
## Serve, observe and deploy
|
|
63
72
|
|
|
64
73
|
- [Server and client](guides/server-and-client.md): serve agents and workflows over HTTP.
|
|
74
|
+
- [AG-UI adapter](guides/ag-ui.md): scoped run events, stored messages, state snapshots/deltas, permissioned durable frontend tools with native-owner recovery and approval interrupts with the experimental AG-UI 1.0 profile.
|
|
65
75
|
- [Authentication and API keys](guides/authentication.md): tokens from identity providers and API keys on your own storage, mapped to what callers may do.
|
|
66
76
|
- [React](guides/react.md): hooks, components and forms.
|
|
77
|
+
- [Copy-in UI components](guides/copy-in-ui.md): versioned source registry, safe CLI installation and component gallery.
|
|
67
78
|
- [Observability](guides/observability.md): events, tracing and OpenTelemetry.
|
|
68
79
|
- [Operator console](guides/operator-console.md): a UI for runs, workflows and approvals.
|
|
69
80
|
- [Deployment](guides/deployment.md): run Mayura in production.
|
|
@@ -77,6 +88,157 @@ Mayura is a TypeScript framework for building AI agents, typed tools and durable
|
|
|
77
88
|
- [mayura deploy](cli/deploy.md): deploy with Docker, Compose, Kubernetes or a platform package.
|
|
78
89
|
- [Operator commands](cli/operations.md): manage a running server.
|
|
79
90
|
|
|
91
|
+
<!-- integrations:start (generated by scripts/integrations-index.mjs) -->
|
|
92
|
+
|
|
93
|
+
## Integrations: vector stores
|
|
94
|
+
|
|
95
|
+
- [Chroma](integrations/vector-chroma.md): Scoped native vector storage for chroma.
|
|
96
|
+
- [Libsql](integrations/vector-libsql.md): Scoped native vector storage for libsql.
|
|
97
|
+
- [Pgvector](integrations/vector-pgvector.md): Scoped native vector storage for pgvector.
|
|
98
|
+
- [Pinecone](integrations/vector-pinecone.md): Scoped native vector storage for pinecone.
|
|
99
|
+
- [Qdrant](integrations/vector-qdrant.md): Scoped native vector storage for qdrant.
|
|
100
|
+
- [Weaviate](integrations/vector-weaviate.md): Scoped native vector storage for weaviate.
|
|
101
|
+
|
|
102
|
+
## Integrations: rerankers
|
|
103
|
+
|
|
104
|
+
- [Cohere](integrations/reranker-cohere.md): Bounded indexed-result reranking with cohere.
|
|
105
|
+
- [Jina](integrations/reranker-jina.md): Bounded indexed-result reranking with jina.
|
|
106
|
+
- [Voyage](integrations/reranker-voyage.md): Bounded indexed-result reranking with voyage.
|
|
107
|
+
|
|
108
|
+
## Integrations: ai gateways
|
|
109
|
+
|
|
110
|
+
- [Cloudflare AI Gateway](integrations/gateway-cloudflare.md): Cloudflare AI Gateway models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
|
|
111
|
+
- [Helicone](integrations/gateway-helicone.md): Helicone models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
|
|
112
|
+
- [LiteLLM](integrations/gateway-litellm.md): LiteLLM models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
|
|
113
|
+
- [OpenRouter](integrations/gateway-openrouter.md): OpenRouter models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
|
|
114
|
+
- [Portkey](integrations/gateway-portkey.md): Portkey models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
|
|
115
|
+
- [Vercel AI Gateway](integrations/gateway-vercel.md): Vercel AI Gateway models for Mayura, with explicit credentials, bounded calls and gateway cost accounting.
|
|
116
|
+
|
|
117
|
+
## Integrations: model providers
|
|
118
|
+
|
|
119
|
+
- [Amazon Web Services](integrations/provider-bedrock.md): Amazon Bedrock models for Mayura, through the official AWS SDK and the Converse API.
|
|
120
|
+
- [Anthropic](integrations/provider-anthropic.md): Anthropic Claude models for Mayura, through the official Anthropic SDK.
|
|
121
|
+
- [Google](integrations/provider-google.md): Google Gemini models for Mayura, through the official Google Gen AI SDK.
|
|
122
|
+
- [Groq](integrations/provider-groq.md): Groq models for Mayura, through the official Groq SDK.
|
|
123
|
+
- [Microsoft Azure](integrations/provider-azure.md): Azure OpenAI models for Mayura, through the official OpenAI SDK and Azure's v1 API.
|
|
124
|
+
- [Mistral AI](integrations/provider-mistral.md): Mistral models for Mayura, through the official Mistral SDK.
|
|
125
|
+
- [Ollama](integrations/provider-ollama.md): Ollama models for Mayura, local or in Ollama's cloud, through the official Ollama SDK.
|
|
126
|
+
- [OpenAI](integrations/provider-openai.md): OpenAI models for Mayura, through the official OpenAI SDK.
|
|
127
|
+
|
|
128
|
+
## Integrations: voice
|
|
129
|
+
|
|
130
|
+
- [AssemblyAI](integrations/voice-assemblyai.md): AssemblyAI speech-to-text for Mayura's voice registry, over AssemblyAI's HTTP API.
|
|
131
|
+
- [Cartesia](integrations/voice-cartesia.md): Cartesia speech-to-text and text-to-speech for Mayura's voice registry, over Cartesia's HTTP API.
|
|
132
|
+
- [Deepgram](integrations/voice-deepgram.md): Deepgram speech-to-text and text-to-speech for Mayura's voice registry, over Deepgram's HTTP API.
|
|
133
|
+
- [ElevenLabs](integrations/voice-elevenlabs.md): ElevenLabs speech-to-text and text-to-speech for Mayura's voice registry, over ElevenLabs' HTTP API.
|
|
134
|
+
- [Google Cloud](integrations/voice-google.md): Google Cloud Speech-to-Text and Text-to-Speech for Mayura's voice registry, over Google's HTTP APIs.
|
|
135
|
+
- [Microsoft Azure](integrations/voice-azure.md): Azure Speech transcription and text-to-speech for Mayura's voice registry, over Azure's HTTP APIs.
|
|
136
|
+
- [OpenAI](integrations/voice-openai.md): OpenAI speech-to-text and text-to-speech for Mayura's voice registry, through the official OpenAI SDK.
|
|
137
|
+
|
|
138
|
+
## Integrations: storage
|
|
139
|
+
|
|
140
|
+
- [Amazon Web Services](integrations/storage-dynamodb.md): Mayura storage on Amazon DynamoDB, as optimistic transactions through the official AWS SDK.
|
|
141
|
+
- [Cloudflare](integrations/storage-d1.md): Mayura storage on Cloudflare D1, as optimistic transactions over a Worker's D1 binding.
|
|
142
|
+
- [MongoDB](integrations/storage-mongodb.md): Mayura storage on MongoDB, through the official MongoDB driver.
|
|
143
|
+
- [MySQL](integrations/storage-mysql.md): Mayura storage on MySQL 8, through mysql2.
|
|
144
|
+
- [Turso](integrations/storage-libsql.md): Mayura storage on libSQL (Turso, sqld or a local file), through the official libSQL client.
|
|
145
|
+
|
|
146
|
+
## Integrations: files
|
|
147
|
+
|
|
148
|
+
- [Cloudflare](integrations/filestorage-r2.md): Cloudflare R2 through a Workers binding, for Mayura's file stores.
|
|
149
|
+
- [Files SDK](integrations/filestorage-files-sdk.md): Any Files SDK provider for Mayura's file stores.
|
|
150
|
+
- [Google Cloud](integrations/filestorage-gcs.md): Google Cloud Storage for Mayura's file stores, over the Cloud Storage JSON API.
|
|
151
|
+
- [Google Drive](integrations/filestorage-google-drive.md): Google Drive for Mayura's file stores, over the Drive API v3.
|
|
152
|
+
- [Mesa](integrations/filestorage-mesa.md): Mesa (mesa.dev), a versioned filesystem for agents, for Mayura's file stores.
|
|
153
|
+
- [Microsoft Azure](integrations/filestorage-azure-blob.md): Azure Blob Storage for Mayura's file stores, over the Blob REST API.
|
|
154
|
+
- [Turso](integrations/filestorage-agentfs.md): AgentFS (Turso's filesystem for agents) for Mayura's file stores.
|
|
155
|
+
- [Vercel](integrations/filestorage-vercel-blob.md): Vercel Blob for Mayura's file stores, over the Blob API with fetch.
|
|
156
|
+
|
|
157
|
+
## Integrations: observability
|
|
158
|
+
|
|
159
|
+
- [Arize](integrations/observability-arize.md): Arize AX for Mayura's traces, with OpenInference attributes beside the GenAI ones.
|
|
160
|
+
- [Better Stack](integrations/observability-betterstack.md): Better Stack for Mayura's traces, over a source's OpenTelemetry endpoint.
|
|
161
|
+
- [Datadog](integrations/observability-datadog.md): Datadog APM or LLM Observability for Mayura's traces, over Datadog's OTLP intake.
|
|
162
|
+
- [Langfuse](integrations/observability-langfuse.md): Langfuse for Mayura's traces: agent runs, model calls and tool calls over Langfuse's OpenTelemetry endpoint.
|
|
163
|
+
- [LangSmith](integrations/observability-langsmith.md): LangSmith for Mayura's traces, with LangSmith's run types, over LangSmith's OpenTelemetry endpoint.
|
|
164
|
+
- [PostHog](integrations/observability-posthog.md): PostHog LLM analytics for Mayura's traces, over PostHog's OpenTelemetry endpoint for AI events.
|
|
165
|
+
- [Sentry](integrations/observability-sentry.md): Sentry for Mayura's traces, with Sentry's gen_ai span ops, over Sentry's OTLP endpoint.
|
|
166
|
+
|
|
167
|
+
## Integrations: sandboxes
|
|
168
|
+
|
|
169
|
+
- [Apple](integrations/sandbox-apple-container.md): Apple container (macOS) sandboxes for mayura/sandbox, through the container command line.
|
|
170
|
+
- [AWS](integrations/sandbox-agentcore.md): Amazon Bedrock AgentCore Code Interpreter sessions as sandboxes for mayura/sandbox.
|
|
171
|
+
- [Cloudflare](integrations/sandbox-cloudflare.md): Cloudflare Sandboxes for mayura/sandbox, through the sandbox bridge Worker.
|
|
172
|
+
- [CodeSandbox](integrations/sandbox-codesandbox.md): CodeSandbox (Together) sandboxes for mayura/sandbox, through the CodeSandbox SDK.
|
|
173
|
+
- [Daytona](integrations/sandbox-daytona.md): Daytona sandboxes for mayura/sandbox, over Daytona's REST and toolbox APIs.
|
|
174
|
+
- [E2B](integrations/sandbox-e2b.md): E2B sandboxes for mayura/sandbox, over E2B's HTTP APIs.
|
|
175
|
+
- [E2B](integrations/sandbox-e2b-desktop.md): E2B Desktop sandboxes for mayura/sandbox: a Linux desktop agents can see and use.
|
|
176
|
+
- [Fly.io](integrations/sandbox-fly.md): Fly.io Machines as sandboxes for mayura/sandbox, over the Machines API.
|
|
177
|
+
- [Modal](integrations/sandbox-modal.md): Modal Sandboxes for mayura/sandbox, through Modal's JavaScript SDK.
|
|
178
|
+
- [Northflank](integrations/sandbox-northflank.md): Northflank sandboxes for mayura/sandbox, through Northflank's JavaScript client.
|
|
179
|
+
- [Railway](integrations/sandbox-railway.md): Railway Sandboxes for mayura/sandbox, through Railway's TypeScript SDK.
|
|
180
|
+
- [Vercel](integrations/sandbox-vercel.md): Vercel Sandbox for mayura/sandbox, over Vercel's REST API.
|
|
181
|
+
|
|
182
|
+
## Integrations: browsers
|
|
183
|
+
|
|
184
|
+
- [agent-browser](integrations/browser-agent-browser.md): Vercel Labs' agent-browser CLI as tools on a mayura/browser browser.
|
|
185
|
+
- [Anchor Browser](integrations/browser-anchor.md): Anchor Browser browsers for mayura/browser, over its sessions API.
|
|
186
|
+
- [Browser Use](integrations/browser-browser-use.md): Browser Use cloud browsers for mayura/browser, over its browsers API.
|
|
187
|
+
- [Browserbase](integrations/browser-browserbase.md): Browserbase browsers for mayura/browser, over its sessions API.
|
|
188
|
+
- [Browserless](integrations/browser-browserless.md): Browserless browsers for mayura/browser, hosted or self-hosted.
|
|
189
|
+
- [BrowserView](integrations/browser-browserview.md): BrowserView browsers for mayura/browser, over its sessions API.
|
|
190
|
+
- [Cloudflare](integrations/browser-cloudflare.md): Cloudflare Browser Run browsers for mayura/browser, over its CDP endpoint.
|
|
191
|
+
- [Cloudflare](integrations/cloudflare-quick-action.md): Cloudflare Browser Run quick actions (markdown, links, scrape, screenshots, PDFs, JSON, crawls) as a client and as tools.
|
|
192
|
+
- [Firecrawl](integrations/browser-firecrawl.md): Firecrawl browsers for mayura/browser, and Firecrawl's scrape, map, search, crawl and extract as tools.
|
|
193
|
+
- [Hyperbrowser](integrations/browser-hyperbrowser.md): Hyperbrowser browsers for mayura/browser, over its sessions API.
|
|
194
|
+
- [Kernel](integrations/browser-kernel.md): Kernel browsers for mayura/browser, over its browsers API.
|
|
195
|
+
- [Mayura](integrations/browser-viewer.md): A live viewer for mayura/browser browsers: a screencast of the active tab, shared by link, optionally interactive.
|
|
196
|
+
- [Stagehand](integrations/browser-stagehand.md): Stagehand's act, extract and observe as tools on a mayura/browser browser.
|
|
197
|
+
- [Steel](integrations/browser-steel.md): Steel browsers for mayura/browser, over its sessions API.
|
|
198
|
+
|
|
199
|
+
## Integrations: authorization policies
|
|
200
|
+
|
|
201
|
+
- [Cedar](integrations/authz-cedar.md): Scoped local Cedar authorization with pinned policies, trusted attributes and core audit integration.
|
|
202
|
+
- [HTTP authorization](integrations/authz-http.md): Bounded HTTP authorization policies with scoped fail-closed decisions and core audit integration.
|
|
203
|
+
- [OpenFGA](integrations/authz-openfga.md): Scoped OpenFGA authorization checks with pinned models, bounded transport and core audit integration.
|
|
204
|
+
- [Oso](integrations/authz-oso.md): Scoped Oso Cloud authorization checks with bounded transport and shared core audit integration.
|
|
205
|
+
- [Permit.io](integrations/authz-permit.md): Scoped Permit.io PDP checks with explicit environment credentials, bounded transport and core audit integration.
|
|
206
|
+
|
|
207
|
+
## Integrations: sign-in providers
|
|
208
|
+
|
|
209
|
+
- [Amazon Cognito](integrations/auth-cognito.md): Amazon Cognito user pool tokens as Mayura server identities, verified with the pool's published keys.
|
|
210
|
+
- [Auth0](integrations/auth-auth0.md): Auth0 access tokens as Mayura server identities, verified with your tenant's published keys.
|
|
211
|
+
- [Clerk](integrations/auth-clerk.md): Clerk session tokens as Mayura server identities, verified with Clerk's published keys or its PEM key.
|
|
212
|
+
- [Facebook](integrations/auth-facebook.md): Facebook Login access tokens (checked with Facebook) and Limited Login tokens as Mayura server identities, and a preset for better-auth's Facebook sign-in.
|
|
213
|
+
- [Firebase](integrations/auth-firebase.md): Firebase Authentication ID tokens as Mayura server identities, verified with Google's published keys.
|
|
214
|
+
- [Google](integrations/auth-google.md): Google ID tokens as Mayura server identities, and a least-privilege preset for better-auth's Google sign-in.
|
|
215
|
+
- [Microsoft Entra ID](integrations/auth-entra.md): Microsoft Entra ID access tokens for your API as Mayura server identities, single- or multi-tenant.
|
|
216
|
+
- [Neon](integrations/auth-neon.md): Neon Auth (managed better-auth) JWTs as Mayura server identities, verified with your project's published keys.
|
|
217
|
+
- [Okta](integrations/auth-okta.md): Okta access tokens as Mayura server identities, verified with your authorization server's published keys.
|
|
218
|
+
- [Supabase](integrations/auth-supabase.md): Supabase Auth access tokens as Mayura server identities, verified with your project's published keys.
|
|
219
|
+
- [WorkOS](integrations/auth-workos.md): WorkOS AuthKit session tokens and Connect machine tokens as Mayura server identities, verified with WorkOS's published keys.
|
|
220
|
+
|
|
221
|
+
## Integrations: api key services
|
|
222
|
+
|
|
223
|
+
- [ReqKey](integrations/km-reqkey.md): API keys issued by ReqKey as Mayura server identities, validated with ReqKey's API.
|
|
224
|
+
- [Unkey](integrations/km-unkey.md): API keys issued by Unkey as Mayura server identities, verified with Unkey's API.
|
|
225
|
+
|
|
226
|
+
## Integrations: deploy targets
|
|
227
|
+
|
|
228
|
+
- [Amazon Bedrock AgentCore](integrations/deploy-agentcore.md): Amazon Bedrock AgentCore Runtime as a mayura deploy target: an ARM64 image serving its HTTP contract, then the runtime update.
|
|
229
|
+
- [Amazon ECS](integrations/deploy-aws-ecs.md): Amazon ECS on Fargate as a mayura deploy target: task definitions, a checked migration task, then the services.
|
|
230
|
+
- [AWS Lambda](integrations/deploy-aws-lambda.md): AWS Lambda as a mayura deploy target: one container image, the migration function first, then the API and workflows functions.
|
|
231
|
+
- [Azure Container Apps](integrations/deploy-azure.md): Azure Container Apps as a mayura deploy target: a migration job run to success, then the server and worker apps.
|
|
232
|
+
- [Cloudflare](integrations/deploy-cloudflare.md): Cloudflare as a mayura deploy target: the app in Containers, or the serverless module on Workers, with wrangler.
|
|
233
|
+
- [DigitalOcean App Platform](integrations/deploy-digitalocean.md): DigitalOcean App Platform as a mayura deploy target: a pre-deploy migration, the server and a worker, released by image tag.
|
|
234
|
+
- [Fly.io](integrations/deploy-fly.md): Fly.io as a mayura deploy target: server and worker processes, the migration as the release command.
|
|
235
|
+
- [Google Cloud Run](integrations/deploy-cloudrun.md): Google Cloud Run as a mayura deploy target: a migration job, then the server and an always-on worker as services.
|
|
236
|
+
- [Railway](integrations/deploy-railway.md): Railway as a mayura deploy target: server and worker services, each migrating before it goes live.
|
|
237
|
+
- [Render](integrations/deploy-render.md): Render as a mayura deploy target: a Blueprint with a web service, a background worker and PostgreSQL.
|
|
238
|
+
- [Vercel](integrations/deploy-vercel.md): Vercel Functions as a mayura deploy target: the API, cron-driven workflows, and storage migrated before each release.
|
|
239
|
+
|
|
240
|
+
<!-- integrations:end -->
|
|
241
|
+
|
|
80
242
|
## Reference
|
|
81
243
|
|
|
82
244
|
- [Entry points](reference/entry-points.md): every `mayura/...` import.
|
package/docs/cli/init.md
CHANGED
|
@@ -190,3 +190,15 @@ starter or template name, `source` paths under `src/` ending in `.ts`, and no du
|
|
|
190
190
|
- [Develop with mayura dev](dev.md)
|
|
191
191
|
- [Model providers](../guides/model-providers.md)
|
|
192
192
|
- [Quickstart](../quickstart.md)
|
|
193
|
+
|
|
194
|
+
## Framework applications
|
|
195
|
+
|
|
196
|
+
`mayura init --starter` also accepts `nextjs`, `hono`, `react-router`, `tanstack-start`, `sveltekit` and `nuxt`.
|
|
197
|
+
These produce complete scoped notebook applications with persistent threads, exact approval UI, offline model
|
|
198
|
+
fixtures, environment examples, deployment files and a separate worker or Cron path. See
|
|
199
|
+
[Framework starters](../guides/framework-starters.md) for local setup, runtime boundaries and remaining qualifications.
|
|
200
|
+
|
|
201
|
+
The project catalog can name definitions under `server/` as `.mjs`, as well as `src/` TypeScript sources.
|
|
202
|
+
Initializer plans remain content-bound: no install scripts run, paths cannot escape the destination, and replacing
|
|
203
|
+
files requires the displayed digest. Framework route filenames may include bounded `+`, `$` and bracket characters.
|
|
204
|
+
The initializer pins the Hono starter's reviewed D1 extension to the same Mayura release.
|
|
@@ -103,6 +103,8 @@ your tool if you need them. The one exception is `ToolRefusal`, whose reason you
|
|
|
103
103
|
| `CONFLICT` | The request conflicts with current state: a closed runtime, a reused id, a record changed meanwhile. |
|
|
104
104
|
| `STORAGE_UNAVAILABLE` | Storage could not be reached. |
|
|
105
105
|
| `INTEGRITY_VIOLATION` | Stored or packaged data failed an integrity check. |
|
|
106
|
+
| `APPROVAL_UNAVAILABLE` | A call needs a person's approval where none can be given: in a child run, a hook action, or outside an agent run. |
|
|
107
|
+
| `DEFINITION_CHANGED` | The agent's definition changed while its run was saved, waiting for approval, so the run cannot continue. |
|
|
106
108
|
|
|
107
109
|
Storage adapters report their own failures as `StorageError`, a `MayuraError` whose `code` is one of the codes above
|
|
108
110
|
and whose `storageCode` names the exact storage condition, such as `STORE_CLOSED`. See
|
|
@@ -38,6 +38,7 @@ called.
|
|
|
38
38
|
| Grant | Allows | Example |
|
|
39
39
|
| --- | --- | --- |
|
|
40
40
|
| `model:<adapter id>` | Calling that model adapter. Checked before every model call. | `model:openai.responses`, `model:anthropic.messages`, `model:scripted` |
|
|
41
|
+
| `gateway:<id>:models` | Explicit bounded model discovery for a gateway provider. Does not grant inference or install prices. | `gateway:openrouter:models` |
|
|
41
42
|
| `tool:<tool id>` | Calling that tool. | `tool:orders.lookup` |
|
|
42
43
|
| `effect:read` | Calling tools with `effects: 'read'`. | |
|
|
43
44
|
| `effect:write` | Calling tools with `effects: 'write'`. | |
|
|
@@ -153,3 +154,52 @@ gives each access token capabilities such as `runs:submit` and `workflows:read`
|
|
|
153
154
|
- [Outcomes and errors](./outcomes.md)
|
|
154
155
|
- [Guardrails](../guides/guardrails.md)
|
|
155
156
|
- [Security](../project/security.md)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
## Agent handoff authority
|
|
160
|
+
|
|
161
|
+
A declared [handoff](../guides/agent-handoffs.md) requires the source grant `agent:<target id>`. Its host-owned edge
|
|
162
|
+
contains the target's explicit permission list. Transfer replaces source authority with that list and keeps the same
|
|
163
|
+
scope, budget, counters and deadline. The model cannot supply grants. This differs from child delegation: a child
|
|
164
|
+
receives an intersection with its parent, while an authorized handoff enters a separate configured agent role.
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
## Resource authorization
|
|
168
|
+
|
|
169
|
+
[Fine-grained authorization](../guides/authorization.md) decides whether a verified principal may perform an action
|
|
170
|
+
on a particular scoped resource. The host calls `authorizer.require` before its operation. The separate
|
|
171
|
+
`authz:evaluate` grant admits bounded policy evaluation; policy action names do not mint execution grants. Built-in
|
|
172
|
+
RBAC lives at `mayura/authz`. An allow decision still requires the operation's ordinary run grants, server capability,
|
|
173
|
+
limits and approvals. No role membership is taken from model or request-body claims.
|
|
174
|
+
|
|
175
|
+
`authz:audit` separately permits explicitly configured authorization audit delivery. The sink receives validated
|
|
176
|
+
identity and resource identifiers, so configure a trusted destination. Missing this grant with `audit` configured
|
|
177
|
+
fails construction; it does not silently enable delivery. Sink failures do not grant or revoke access. See
|
|
178
|
+
[authorization audit events](../guides/authorization.md#authorization-audit-events).
|
|
179
|
+
|
|
180
|
+
`authz:http` permits explicitly configured external authorization requests through `@mayurajs/authz-http`. It permits
|
|
181
|
+
no protected operation itself, does not replace `authz:evaluate`, and does not admit audit delivery. Without it,
|
|
182
|
+
remote checks deny before I/O. See [HTTP authorization policies](../integrations/authz-http.md).
|
|
183
|
+
|
|
184
|
+
Runtime `authorization` and tool/batch invocation `authorization` accept a host-owned core authorizer. Scoped
|
|
185
|
+
`agent/execute`, `run/execute` and `tool/execute` decisions add gates; they do not mint `model:*`, `tool:*`, effect,
|
|
186
|
+
child or handoff grants. Approval does not override current execution policy. See
|
|
187
|
+
[agent runs and tool execution](../guides/authorization.md#agent-runs-and-tool-execution).
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## Checkpointed frontend-result recovery
|
|
191
|
+
|
|
192
|
+
[AG-UI frontend tools](../guides/ag-ui.md#safe-native-owner-recovery) require `ag-ui:frontend-recover` in the host's
|
|
193
|
+
`nativeRecovery.permissions`, alongside a shared journal with `frontend-tools:store`. Browser recovery requests
|
|
194
|
+
require the separate `runs:resume` capability and core `run/resume_tool` policy. This does not grant human approval
|
|
195
|
+
or permit replaying browser writes. Trusted scanner recovery uses `conversations:recover` plus an explicit
|
|
196
|
+
`kind: 'frontend'` policy decision. Existing tool/effect/model grants, continuing budgets and output guards remain
|
|
197
|
+
in force. A consumed checkpoint is never recreated to repeat uncertain paid work.
|
|
198
|
+
|
|
199
|
+
## Retrieval capabilities
|
|
200
|
+
|
|
201
|
+
[RAG](../guides/rag.md) requires `rag:read` for retrieval, `rag:index` for ingestion/deletion, `rag:embed` for hosted
|
|
202
|
+
embeddings, `rag:reconcile` for verified claim recovery and `rag:admin` for explicit SQL schema setup. Native
|
|
203
|
+
transports require `rag:transport:<provider>`; expansion, reranking and contextualization require
|
|
204
|
+
`rag:transform:<id>`, `rag:rerank:<id>` and `rag:contextualize:<id>`. HTML/PDF parser dispatch requires
|
|
205
|
+
`rag:load:html` / `rag:load:pdf`. Capability grants do not replace per-document authorization or sensitivity limits.
|
package/docs/concepts/runtime.md
CHANGED
|
@@ -37,6 +37,38 @@ try {
|
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
### A conversation history
|
|
41
|
+
|
|
42
|
+
A run starts from its input. To continue a conversation, pass the turns before it as `history`, oldest first:
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
const followUp = runtime.submit(supportAgent, {
|
|
46
|
+
input: { message: 'And when will it arrive?' },
|
|
47
|
+
history: [
|
|
48
|
+
{ role: 'user', content: { message: 'Where is order A-1001?' } },
|
|
49
|
+
{ role: 'assistant', calls: [{ id: 'call-1', toolId: 'orders.lookup', input: { orderId: 'A-1001' } }] },
|
|
50
|
+
{ role: 'tool', callId: 'call-1', toolId: 'orders.lookup', result: { status: 'shipped' } },
|
|
51
|
+
{ role: 'assistant', output: { reply: 'Order A-1001 has shipped.' } },
|
|
52
|
+
],
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- **Whole turns:** every tool call has its result, in the order called, before the next message. An earlier final
|
|
57
|
+
answer is `{ role: 'assistant', output }`. A history that breaks this is refused with `INVALID_INPUT` before the run
|
|
58
|
+
starts.
|
|
59
|
+
- **Sent on every model call:** the history goes before the run's own messages on every model call of the run, and
|
|
60
|
+
counts toward `limits.maxContextBytes`.
|
|
61
|
+
- **Adapter support:** only a model adapter that declares `capabilities.history` takes a history. Every Mayura
|
|
62
|
+
provider does. With an adapter that doesn't, the submission is refused with `INVALID_CONFIG` rather than sent without
|
|
63
|
+
it.
|
|
64
|
+
- **Across providers:** a history can come from another provider's run. Each adapter sends it in its provider's own
|
|
65
|
+
format, with no reasoning or thinking state. Call ids a provider refuses (Anthropic and Bedrock allow fewer
|
|
66
|
+
characters, Mistral needs nine letters and digits) are renamed on the wire only. Anthropic and Bedrock refuse tool
|
|
67
|
+
blocks in a request without tools, so for an agent without tools, earlier calls and results are sent as JSON text.
|
|
68
|
+
- **No media yet:** history carries no media in this release.
|
|
69
|
+
- **Hooks:** they see the history in their content view of a model call.
|
|
70
|
+
- **Events:** `run.started` reports how many messages it has.
|
|
71
|
+
|
|
40
72
|
## Options
|
|
41
73
|
|
|
42
74
|
| Option | Default | What it is |
|
|
@@ -45,6 +77,9 @@ try {
|
|
|
45
77
|
| `permissions` | `{ allow: [] }` | What runs may use. Nothing is allowed by default. See [Permissions](./permissions.md). |
|
|
46
78
|
| `scope` | `{ principalId: 'local', projectId: 'default' }` | Who runs act for. Tools, guards and hooks receive it. |
|
|
47
79
|
| `limits` | see below | Ceilings for every run. |
|
|
80
|
+
| `approvals` | none | `{ tools, expiresInMs, onExpired }`: tools whose calls need a person's approval, and how long a request waits. See [Approve a tool call](#approve-a-tool-call). |
|
|
81
|
+
| `checkpoints` | none | `{ store, agents?, replicaId?, leaseMs?, autoExpire? }`: save runs waiting for approval, so they survive a restart. See [Surviving a restart](#surviving-a-restart). |
|
|
82
|
+
| `recorder` | none | Host `RunRecorder` with idempotent `begin` and `complete` callbacks. For persisted conversation turns, use `threads.recorder`; the association and approval decisions survive checkpoints. See [Threads](../guides/threads.md#recording-across-restarts). |
|
|
48
83
|
|
|
49
84
|
`ephemeral` means the runtime keeps everything in memory. Runs, events and costs are lost when the process exits, and
|
|
50
85
|
a run interrupted by a crash is not resumed. For work that must survive restarts, use
|
|
@@ -60,6 +95,7 @@ and `maxConcurrentOperations` also apply to the runtime as a whole. Child runs c
|
|
|
60
95
|
|
|
61
96
|
| Limit | Default | What it bounds |
|
|
62
97
|
| --- | --- | --- |
|
|
98
|
+
| `maxHandoffs` | `8` | Transfers within one root run; 0–64. History, budget and counters continue across targets. See [Agent handoffs](../guides/agent-handoffs.md). |
|
|
63
99
|
| `maxSteps` | `16` | Model turns in one run. Reaching it fails the run with `LIMIT_EXCEEDED`. |
|
|
64
100
|
| `maxModelCalls` | `16` | Model calls, including model-backed guards. |
|
|
65
101
|
| `maxToolCalls` | `64` | Tool calls. `0` is allowed. |
|
|
@@ -112,8 +148,11 @@ object (ids, counts and statuses, never prompts or secrets).
|
|
|
112
148
|
| `hook.started`, `hook.completed` | A lifecycle hook ran. |
|
|
113
149
|
| `delegate.started`, `delegate.completed` | A child run began or ended. |
|
|
114
150
|
| `output.delta`, `output.withheld` | A streamed batch of text was released, or streaming stopped. |
|
|
151
|
+
| `approval.requested` | The run is waiting for a person to approve a tool call: its `callId`, `toolId`, `digest` and `expiresAtMs`. |
|
|
152
|
+
| `approval.resolved` | The request was answered (`approved` or `rejected`, with the `actorId`) or `expired`. |
|
|
115
153
|
| `events.gap` | Older events were dropped before you read them. |
|
|
116
154
|
| `run.completed` | The run ended, with its status and cost totals. |
|
|
155
|
+
| `run.paused`, `run.resumed` | A run waiting for approval was saved to the checkpoint store, or continued from it. |
|
|
117
156
|
|
|
118
157
|
Events are kept in a buffer of `maxEventRetention` entries. If you start observing late, or read slower than the run
|
|
119
158
|
writes, the oldest events may be gone; you then get one `events.gap` event with the missing range instead of silence.
|
|
@@ -128,11 +167,121 @@ complete it. In that case the call is `outcome_unknown`, and so is the run. See
|
|
|
128
167
|
|
|
129
168
|
When `maxDurationMs` passes, the run is stopped the same way and fails with `TIMEOUT`.
|
|
130
169
|
|
|
170
|
+
## Approve a tool call
|
|
171
|
+
|
|
172
|
+
A tool can require a person to approve a call before it runs. Declare it on the tool, for every call or depending on
|
|
173
|
+
the input the model proposed:
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
import { createRuntime, defineTool, z } from 'mayura';
|
|
177
|
+
|
|
178
|
+
const refund = defineTool({
|
|
179
|
+
id: 'orders.refund', version: '1', description: 'Refund part or all of an order.',
|
|
180
|
+
input: z.object({ orderId: z.string(), amountCents: z.number().int().positive() }),
|
|
181
|
+
output: z.object({ refundId: z.string() }), effects: 'write', capabilities: [],
|
|
182
|
+
approval: input => input.amountCents > 10_000, // refunds over $100 wait for a person
|
|
183
|
+
execute: async input => ({ refundId: `re_${input.orderId}` }),
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
const runtime = createRuntime({
|
|
187
|
+
profile: 'ephemeral',
|
|
188
|
+
permissions: { allow: ['model:openai.responses', 'tool:orders.refund', 'effect:write'] },
|
|
189
|
+
approvals: { expiresInMs: 30 * 60_000 },
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
const run = runtime.submit(refundAgent, { input: { message: 'Refund order A-1001 in full.' } });
|
|
193
|
+
for await (const event of run.observe()) {
|
|
194
|
+
if (event.type !== 'approval.requested') continue;
|
|
195
|
+
const { approval } = runtime.inspect(run); // the exact call: toolId, toolVersion, input
|
|
196
|
+
if (approval && (await askManager(approval))) {
|
|
197
|
+
await runtime.approve(run, { callId: approval.callId, digest: approval.digest, decision: 'approved', actorId: 'manager-7' });
|
|
198
|
+
} else if (approval) {
|
|
199
|
+
await runtime.approve(run, { callId: approval.callId, digest: approval.digest, decision: 'rejected', actorId: 'manager-7',
|
|
200
|
+
reason: 'Refunds over $100 need a receipt.' });
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
- **When it asks:** only for a call that passed the run's permissions, the tool's input schema and any
|
|
206
|
+
`beforeToolCall` hook. An approval never grants anything the run lacks. Earlier calls of the same batch run first.
|
|
207
|
+
- **Waiting:** the run's status is `waiting`, and `runtime.inspect(run).approval` holds the call: `callId`, `toolId`,
|
|
208
|
+
`toolVersion`, `input`, `digest` and `expiresAtMs`. The run holds no reservation while it waits, and waiting does
|
|
209
|
+
not count against `maxDurationMs`. `result()` stays pending until the run ends.
|
|
210
|
+
- **Answering:** `runtime.approve(run or runId, { callId, digest, decision, actorId, reason? })`. The digest binds
|
|
211
|
+
the answer to this run, call, tool version, input and expiry; a different one is refused with `CONFLICT`, as is an
|
|
212
|
+
answer after the request expired. A call is answered once.
|
|
213
|
+
- **Approved:** the tool runs with exactly the approved input, under the run's limits as they are then.
|
|
214
|
+
- **Rejected:** the call does not run. The model gets `{ error: 'APPROVAL_REJECTED', message, reason? }` as the tool's
|
|
215
|
+
result and carries on, for example by explaining to the user.
|
|
216
|
+
- **Expired:** after `approvals.expiresInMs` (default 15 minutes, at most 7 days), the model gets
|
|
217
|
+
`{ error: 'APPROVAL_EXPIRED', message }`. With `onExpired: 'cancel'`, the run is cancelled instead.
|
|
218
|
+
- **Cancelling** a waiting run ends it `cancelled`; the call never runs.
|
|
219
|
+
- **Without editing tools:** `approvals: { tools: ['orders.refund'] }` makes every call of those tools wait.
|
|
220
|
+
- **Only root runs wait.** A child run, a speculative branch or a hook action that reaches a call needing approval
|
|
221
|
+
fails with `APPROVAL_UNAVAILABLE`. So does calling the tool outside a run, for example from code mode or a workflow
|
|
222
|
+
step: the tool checks for the runtime's proof that a person approved that exact call.
|
|
223
|
+
- **In memory:** without `checkpoints`, a waiting run lives in this process. If it exits, the run is lost, as any
|
|
224
|
+
ephemeral run is.
|
|
225
|
+
|
|
226
|
+
### Surviving a restart
|
|
227
|
+
|
|
228
|
+
Give the runtime a checkpoint store, and a waiting run is saved there instead of held in memory. Any runtime with the
|
|
229
|
+
same store, scope and agent can then approve and continue it, after a restart or on another server:
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
import { createRuntime } from 'mayura';
|
|
233
|
+
import { createSqliteStore } from 'mayura/storage-sqlite';
|
|
234
|
+
|
|
235
|
+
const store = createSqliteStore({ filename: 'runs.sqlite' });
|
|
236
|
+
await store.initialize();
|
|
237
|
+
await store.threads.initialize(); // creates the thread and run-checkpoint tables
|
|
238
|
+
|
|
239
|
+
const runtime = createRuntime({
|
|
240
|
+
profile: 'ephemeral',
|
|
241
|
+
permissions: { allow: ['model:openai.responses', 'tool:orders.refund', 'effect:write'] },
|
|
242
|
+
scope: { principalId: 'support-team', projectId: 'shop' },
|
|
243
|
+
checkpoints: { store: store.runCheckpoints, agents: [refundAgent] },
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
// Later, perhaps in another process: answer by run id. The run continues here.
|
|
247
|
+
const run = await runtime.approve(runId, { callId, digest, decision: 'approved', actorId: 'manager-7' });
|
|
248
|
+
console.log(await run.result());
|
|
249
|
+
|
|
250
|
+
// Now and then, continue saved runs whose request expired.
|
|
251
|
+
setInterval(() => void runtime.expireApprovals(), 60_000);
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
- **When a run is saved:** when it pauses at a safe point, with no child run still running and nothing reserved. It
|
|
255
|
+
emits `run.paused`, holds no concurrency slot or active-run deadline, and its status is `waiting`. Otherwise, or if the store
|
|
256
|
+
cannot take it (it holds at most 3 MiB), it waits in memory.
|
|
257
|
+
- **What is saved:** the conversation so far (with media), the paused batch's remaining calls, the provider
|
|
258
|
+
continuation, its call counts, what it spent, its receipts, its permissions and limits, and the active time it had
|
|
259
|
+
left. Waiting still does not count against `maxDurationMs`.
|
|
260
|
+
- **Answering:** `approve` checks the call and digest against the saved run, then claims it. A run this process paused
|
|
261
|
+
continues on its own handle; otherwise `approve` returns a new handle, whose events start with `run.resumed`.
|
|
262
|
+
- **At most once:** before the approved call runs, the runtime removes the checkpoint. If another runtime took the
|
|
263
|
+
run meanwhile, removing fails and nothing runs here: the run ends `failed` with `CONFLICT`.
|
|
264
|
+
- **The same agent:** `checkpoints.agents` lists the agents this runtime may continue when it did not start the run.
|
|
265
|
+
If an agent's definition changed while the run waited (its instructions, model, tools, guards, hooks or schemas),
|
|
266
|
+
the run cannot continue: `approve` throws `DEFINITION_CHANGED` and the saved run is removed.
|
|
267
|
+
- **Never wider:** a resumed run keeps its own permissions and limits, narrowed to this runtime's. Its budget counts
|
|
268
|
+
what it spent before the pause.
|
|
269
|
+
- **Expiry:** a runtime continues the runs it paused when their request expires, while it lives.
|
|
270
|
+
`runtime.expireApprovals()` handles the rest of this scope's expired runs, as their policy says. Set
|
|
271
|
+
`checkpoints.autoExpire: false` when a host owns expiry scheduling. `runtime.expireApproval(runId)` handles one saved
|
|
272
|
+
request and returns `not_due`, `cancelled`, or `{ status: 'resumed', run }`; observe and persist the returned handle.
|
|
273
|
+
Hosted servers use [conversation recovery](../guides/server-and-client.md#hosted-conversation-recovery) for this.
|
|
274
|
+
- **Cancelling** a saved run removes its checkpoint first, so no other runtime continues it.
|
|
275
|
+
- **Closing** the runtime leaves saved runs in the store. Their handles in this process settle only if this runtime
|
|
276
|
+
continues them.
|
|
277
|
+
- **Hosted approvals:** the [server and client](../guides/server-and-client.md) expose waiting calls and scoped decisions.
|
|
278
|
+
|
|
131
279
|
## Inspect a run
|
|
132
280
|
|
|
133
281
|
`runtime.inspect(handle)` returns a snapshot of a run and its children, while it runs or after:
|
|
134
282
|
|
|
135
|
-
- `status`: `running` or the final status.
|
|
283
|
+
- `status`: `running`, `waiting` (for an [approval](#approve-a-tool-call)) or the final status.
|
|
284
|
+
- `approval`: while the run waits, the call it asks a person to approve.
|
|
136
285
|
- `budget`: `spentMicros`, `reservedMicros` (cost held for calls in progress or with unknown cost) and `calls`.
|
|
137
286
|
- `runs`: the run and every child run, with ids, agent ids and statuses.
|
|
138
287
|
- `evidence`: for each tool call, whether it ran (`not_started`, `succeeded`, `failed` or `unknown`) and whether its
|
|
@@ -170,3 +319,42 @@ Call it when your process shuts down, or in a `finally` block in scripts and tes
|
|
|
170
319
|
- [Permissions](./permissions.md)
|
|
171
320
|
- [Costs and budgets](./costs-and-budgets.md)
|
|
172
321
|
- [Observability](../guides/observability.md)
|
|
322
|
+
|
|
323
|
+
## Run recording
|
|
324
|
+
|
|
325
|
+
`RunRecorder`, `RunRecordingContext`, `RunRecording` and `RecordedApproval` describe an optional trusted host
|
|
326
|
+
persistence seam. A submission's `recording` is a JSON object of identifiers, bounded to 4096 UTF-8 bytes; `begin`
|
|
327
|
+
persists its association before execution. `complete` receives the run's released messages, retained approval
|
|
328
|
+
decisions and final outcome before the handle settles. Configure the recorder on every replica that resumes a bound
|
|
329
|
+
run. These callbacks are trusted storage code, not model tools or a sandbox.
|
|
330
|
+
|
|
331
|
+
A recording failure reports `STORAGE_UNAVAILABLE` while retaining the original completion for
|
|
332
|
+
`runtime.retryRecording(handle)`. This retries persistence only; it never reruns a model or tool, and does not change
|
|
333
|
+
the handle's already-settled outcome. [Threads](../guides/threads.md#recording-across-restarts) add a durable terminal
|
|
334
|
+
journal and recovery for this seam.
|
|
335
|
+
|
|
336
|
+
`runtime.cancelSaved(runId)` cancels an approval checkpoint in this runtime's scope without dispatching its pending
|
|
337
|
+
tool. It claims and deletes the checkpoint, and records the cancelled turn when a recorder is configured.
|
|
338
|
+
|
|
339
|
+
## Fine-grained execution authorization
|
|
340
|
+
|
|
341
|
+
Set `createRuntime({ authorization })` with a host-owned core authorizer to guard scoped root/child execution,
|
|
342
|
+
handoffs, model dispatch, approvals and the common tool broker. `submit`/`spawn` retain synchronous handles; asynchronous
|
|
343
|
+
admission can end a run as blocked before paid work. Existing static grants, target permissions, budgets and approvals
|
|
344
|
+
remain independent. Standalone `invokeTool` and `invokeBatch` accept the same authorizer. See
|
|
345
|
+
[agent runs and tool execution](../guides/authorization.md#agent-runs-and-tool-execution) for actions, audit lifecycle,
|
|
346
|
+
receipt preservation and trusted-handle semantics.
|
|
347
|
+
|
|
348
|
+
## History fitting metadata
|
|
349
|
+
|
|
350
|
+
`runtime.submit(agent, { input, history })` accepts either the existing readonly message array or a `RunHistory`
|
|
351
|
+
object with `messages`, `omittedTurns` and optional `scanTruncated`. The result of `threads.history(...)` fits this
|
|
352
|
+
shape directly. Only messages are passed to models; metadata is bounded informational data, not authorization.
|
|
353
|
+
Nonempty history still requires the adapter's `history` capability and counts toward `maxContextBytes`.
|
|
354
|
+
|
|
355
|
+
A fresh admitted run emits `history.applied` with exactly `{ entries, omitted, bytes, scanTruncated }`, once after
|
|
356
|
+
its input boundary succeeds. Entries count messages, omissions count known whole turns, and bytes measure the
|
|
357
|
+
UTF-8 JSON representation. Empty supplied history reports `{ entries: 0, omitted: 0, bytes: 2, scanTruncated: false }`;
|
|
358
|
+
a submission without history emits no such event. Resuming a checkpoint or handing off within the same run does not
|
|
359
|
+
reapply history. See [threads](../guides/threads.md#history-application-events) and
|
|
360
|
+
[approval observers](../guides/lifecycle-hooks.md#approval-request-observers).
|
package/docs/concepts/tools.md
CHANGED
|
@@ -52,6 +52,7 @@ list to let the model use it.
|
|
|
52
52
|
| `costMicros` | `0` | The most one call can cost, in micros (millionths of a dollar). |
|
|
53
53
|
| `timeoutMs` | `30000` | How long one call may take before it is stopped. |
|
|
54
54
|
| `guards` | none | `{ input, output }` lists of guards that allow or block this tool's input and output. |
|
|
55
|
+
| `approval` | none | `'required'`, or a function of the proposed input returning `true` when a call needs approval. A person must approve such a call before it runs; a function that throws asks for approval. See [Approve a tool call](./runtime.md#approve-a-tool-call). |
|
|
55
56
|
| `execute` | required | `(input, context)` returning the output or a promise of it. |
|
|
56
57
|
|
|
57
58
|
## Input schemas for real models
|
|
@@ -132,3 +132,11 @@ to the new version with a reviewed migration. See [Operating workflows](../guide
|
|
|
132
132
|
- [Approvals and human input](../guides/approvals-and-human-input.md)
|
|
133
133
|
- [Sagas and loops](../guides/sagas-and-loops.md)
|
|
134
134
|
- [Operating workflows](../guides/workflow-operations.md)
|
|
135
|
+
|
|
136
|
+
## Execution authorization
|
|
137
|
+
|
|
138
|
+
Durable workflow runtimes accept a host-owned core `authorization` instance alongside their static grants and
|
|
139
|
+
budget limits. It gates workflow/run execution, tools and child delegation, including loop and saga children.
|
|
140
|
+
Revoked execution never authorizes replay of a dispatched effect; known receipts and charges remain durable while
|
|
141
|
+
output can be withheld. See the [authorization guide](../guides/authorization.md#workflow-execution-and-child-workflows)
|
|
142
|
+
for resource IDs, actions, audit delivery and the boundary between workers and HTTP operator controls.
|