mayura 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/docs/README.md +17 -5
- package/docs/cli/init.md +15 -3
- package/docs/guides/choosing-a-starter.md +80 -0
- package/docs/guides/framework-starters.md +5 -1
- package/docs/guides/hono.md +94 -0
- package/docs/guides/nextjs.md +94 -0
- package/docs/guides/nuxt.md +94 -0
- package/docs/guides/rag-deployment.md +48 -0
- package/docs/guides/rag-modal-pinecone-starter.md +63 -0
- package/docs/guides/rag-production.md +34 -15
- package/docs/guides/rag-quickstart.md +119 -0
- package/docs/guides/rag.md +11 -1
- package/docs/guides/react-router.md +94 -0
- package/docs/guides/release-readiness.md +76 -39
- package/docs/guides/sveltekit.md +94 -0
- package/docs/guides/tanstack-start.md +94 -0
- package/docs/integrations/reranker-cohere.md +1 -0
- package/docs/integrations/reranker-jina.md +1 -0
- package/docs/integrations/reranker-voyage.md +1 -0
- package/docs/integrations/vector-chroma.md +1 -0
- package/docs/integrations/vector-libsql.md +1 -0
- package/docs/integrations/vector-pgvector.md +1 -0
- package/docs/integrations/vector-pinecone.md +4 -1
- package/docs/integrations/vector-qdrant.md +1 -0
- package/docs/integrations/vector-weaviate.md +1 -0
- package/docs/introduction.md +5 -0
- package/docs/project/whats-new.md +70 -2
- package/docs/quickstart.md +5 -3
- 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/package.json +1 -1
- package/lib/artifacts/package.json +1 -1
- package/lib/auth/package.json +1 -1
- package/lib/authz/package.json +1 -1
- package/lib/browser/package.json +1 -1
- package/lib/cli/dist/index.d.ts +1 -1
- package/lib/cli/dist/index.d.ts.map +1 -1
- package/lib/cli/dist/index.js +63 -20
- package/lib/cli/dist/index.js.map +1 -1
- package/lib/cli/dist/interactive.js +2 -2
- package/lib/cli/dist/interactive.js.map +1 -1
- package/lib/cli/package.json +1 -1
- package/lib/cli/src/index.ts +51 -12
- package/lib/cli/src/interactive.ts +2 -2
- package/lib/cli/starter-assets/manifest.json +1 -0
- package/lib/cli/starters/hono/package.json +2 -2
- package/lib/cli/starters/rag-modal-pinecone/README.md +60 -0
- package/lib/cli/starters/rag-modal-pinecone/dot-env.example +23 -0
- package/lib/cli/starters/{event-automation → rag-modal-pinecone}/dot-gitignore +2 -4
- package/lib/cli/starters/rag-modal-pinecone/fixtures/on-call.md +4 -0
- package/lib/cli/starters/rag-modal-pinecone/mayura.project.json +13 -0
- package/lib/cli/starters/rag-modal-pinecone/modal-app.py +110 -0
- package/lib/cli/starters/rag-modal-pinecone/package.json +28 -0
- package/lib/cli/starters/rag-modal-pinecone/src/application.ts +148 -0
- package/lib/cli/starters/rag-modal-pinecone/src/cli.ts +78 -0
- package/lib/cli/starters/rag-modal-pinecone/src/hosted.ts +137 -0
- package/lib/cli/starters/rag-modal-pinecone/test/modal_worker_test.py +53 -0
- package/lib/cli/starters/rag-modal-pinecone/test/pipeline.test.ts +137 -0
- package/lib/cli/starters/{cli-agent → rag-modal-pinecone}/tsconfig.json +0 -1
- package/lib/client/package.json +1 -1
- package/lib/client-react/package.json +1 -1
- package/lib/code-mode/package.json +1 -1
- package/lib/code-mode-workflows/package.json +1 -1
- package/lib/context/package.json +1 -1
- package/lib/core/package.json +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/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/package.json +1 -1
- package/lib/keys/package.json +1 -1
- package/lib/memory/package.json +1 -1
- package/lib/memory-remote/package.json +1 -1
- package/lib/observability/package.json +1 -1
- package/lib/provider-anthropic/package.json +1 -1
- package/lib/provider-openai/package.json +1 -1
- package/lib/rag/package.json +1 -1
- package/lib/runtime/package.json +1 -1
- package/lib/sandbox/package.json +1 -1
- package/lib/sdk/package.json +1 -1
- package/lib/server/package.json +1 -1
- package/lib/server-node/package.json +1 -1
- package/lib/skills/package.json +1 -1
- package/lib/storage/package.json +1 -1
- package/lib/storage-contracts/package.json +1 -1
- package/lib/storage-postgres/package.json +1 -1
- package/lib/storage-sql/package.json +1 -1
- package/lib/storage-sqlite/package.json +1 -1
- package/lib/terminal/package.json +1 -1
- package/lib/testing/package.json +1 -1
- package/lib/threads/package.json +1 -1
- package/lib/tools/package.json +1 -1
- package/lib/voice/package.json +1 -1
- package/lib/workflows/package.json +1 -1
- package/lib/workstream/package.json +1 -1
- package/llms-full.txt +1362 -289
- package/llms.txt +17 -4
- package/package.json +4 -4
- package/lib/cli/starters/cli-agent/dot-github/workflows/ci.yml +0 -13
- package/lib/cli/starters/cli-agent/dot-gitignore +0 -10
- package/lib/cli/starters/event-automation/dot-dockerignore +0 -7
- package/lib/cli/starters/event-automation/dot-github/workflows/ci.yml +0 -13
- package/lib/cli/starters/event-automation/src/model.ts +0 -40
- package/lib/cli/starters/event-automation/tsconfig.json +0 -20
- package/lib/cli/starters/nextjs/Dockerfile +0 -12
- package/lib/cli/starters/nextjs/compose.yaml +0 -19
- package/lib/cli/starters/nextjs/dot-dockerignore +0 -11
- package/lib/cli/starters/nextjs/dot-env.example +0 -7
- package/lib/cli/starters/nextjs/scripts/setup.mjs +0 -9
- package/lib/cli/starters/nextjs/server/application.mjs +0 -74
- package/lib/cli/starters/nextjs/server/auth.mjs +0 -24
- package/lib/cli/starters/nextjs/server/worker.mjs +0 -11
- package/lib/cli/starters/nextjs/server/workflows.mjs +0 -23
- package/lib/cli/starters/nextjs/src/ChatApp.jsx +0 -57
- package/lib/cli/starters/nextjs/src/Notebook.jsx +0 -25
- package/lib/cli/starters/nextjs/src/components/mayura/approval.tsx +0 -142
- package/lib/cli/starters/nextjs/src/components/mayura/thread-history.tsx +0 -142
- package/lib/cli/starters/nextjs/src/components/mayura/thread-list.tsx +0 -9
- package/lib/cli/starters/nextjs/src/components/mayura/ui.css +0 -14
- package/lib/cli/starters/nextjs/src/connect.js +0 -21
- package/lib/cli/starters/nextjs/src/session.js +0 -138
- package/lib/cli/starters/nextjs/src/style.css +0 -11
- package/lib/cli/starters/nextjs/test/server.test.mjs +0 -95
- package/lib/cli/starters/nextjs/test/session.test.mjs +0 -16
- package/lib/cli/starters/nuxt/compose.yaml +0 -19
- package/lib/cli/starters/nuxt/dot-dockerignore +0 -11
- package/lib/cli/starters/nuxt/dot-env.example +0 -7
- package/lib/cli/starters/nuxt/dot-gitignore +0 -14
- package/lib/cli/starters/nuxt/scripts/setup.mjs +0 -9
- package/lib/cli/starters/nuxt/server/application.mjs +0 -74
- package/lib/cli/starters/nuxt/server/auth.mjs +0 -24
- package/lib/cli/starters/nuxt/server/worker.mjs +0 -11
- package/lib/cli/starters/nuxt/server/workflows.mjs +0 -23
- package/lib/cli/starters/nuxt/src/connect.js +0 -21
- package/lib/cli/starters/nuxt/src/session.js +0 -138
- package/lib/cli/starters/nuxt/src/style.css +0 -11
- package/lib/cli/starters/nuxt/test/server.test.mjs +0 -95
- package/lib/cli/starters/nuxt/test/session.test.mjs +0 -16
- package/lib/cli/starters/react-router/Dockerfile +0 -12
- package/lib/cli/starters/react-router/compose.yaml +0 -19
- package/lib/cli/starters/react-router/dot-dockerignore +0 -11
- package/lib/cli/starters/react-router/dot-env.example +0 -7
- package/lib/cli/starters/react-router/dot-gitignore +0 -14
- package/lib/cli/starters/react-router/scripts/setup.mjs +0 -9
- package/lib/cli/starters/react-router/server/application.mjs +0 -74
- package/lib/cli/starters/react-router/server/auth.mjs +0 -24
- package/lib/cli/starters/react-router/server/worker.mjs +0 -11
- package/lib/cli/starters/react-router/server/workflows.mjs +0 -23
- package/lib/cli/starters/react-router/src/ChatApp.jsx +0 -57
- package/lib/cli/starters/react-router/src/Notebook.jsx +0 -25
- package/lib/cli/starters/react-router/src/components/mayura/approval.tsx +0 -142
- package/lib/cli/starters/react-router/src/components/mayura/thread-history.tsx +0 -142
- package/lib/cli/starters/react-router/src/components/mayura/thread-list.tsx +0 -9
- package/lib/cli/starters/react-router/src/components/mayura/ui.css +0 -14
- package/lib/cli/starters/react-router/src/connect.js +0 -21
- package/lib/cli/starters/react-router/src/session.js +0 -138
- package/lib/cli/starters/react-router/src/style.css +0 -11
- package/lib/cli/starters/react-router/src/vite-env.d.ts +0 -1
- package/lib/cli/starters/react-router/test/server.test.mjs +0 -95
- package/lib/cli/starters/react-router/test/session.test.mjs +0 -16
- package/lib/cli/starters/research-team/dot-dockerignore +0 -7
- package/lib/cli/starters/research-team/dot-github/workflows/ci.yml +0 -13
- package/lib/cli/starters/research-team/dot-gitignore +0 -10
- package/lib/cli/starters/research-team/src/model.ts +0 -40
- package/lib/cli/starters/research-team/tsconfig.json +0 -20
- package/lib/cli/starters/support-agent/dot-dockerignore +0 -7
- package/lib/cli/starters/support-agent/dot-github/workflows/ci.yml +0 -13
- package/lib/cli/starters/support-agent/dot-gitignore +0 -10
- package/lib/cli/starters/support-agent/src/model.ts +0 -40
- package/lib/cli/starters/support-agent/tsconfig.json +0 -20
- package/lib/cli/starters/sveltekit/Dockerfile +0 -12
- package/lib/cli/starters/sveltekit/compose.yaml +0 -19
- package/lib/cli/starters/sveltekit/dot-dockerignore +0 -11
- package/lib/cli/starters/sveltekit/dot-env.example +0 -7
- package/lib/cli/starters/sveltekit/dot-gitignore +0 -14
- package/lib/cli/starters/sveltekit/scripts/setup.mjs +0 -9
- package/lib/cli/starters/sveltekit/server/application.mjs +0 -74
- package/lib/cli/starters/sveltekit/server/auth.mjs +0 -24
- package/lib/cli/starters/sveltekit/server/worker.mjs +0 -11
- package/lib/cli/starters/sveltekit/server/workflows.mjs +0 -23
- package/lib/cli/starters/sveltekit/src/connect.js +0 -21
- package/lib/cli/starters/sveltekit/src/session.js +0 -138
- package/lib/cli/starters/sveltekit/src/style.css +0 -11
- package/lib/cli/starters/sveltekit/src/view.js +0 -49
- package/lib/cli/starters/sveltekit/test/server.test.mjs +0 -95
- package/lib/cli/starters/sveltekit/test/session.test.mjs +0 -16
- package/lib/cli/starters/tanstack-start/Dockerfile +0 -12
- package/lib/cli/starters/tanstack-start/compose.yaml +0 -19
- package/lib/cli/starters/tanstack-start/dot-dockerignore +0 -11
- package/lib/cli/starters/tanstack-start/dot-env.example +0 -7
- package/lib/cli/starters/tanstack-start/dot-gitignore +0 -14
- package/lib/cli/starters/tanstack-start/scripts/setup.mjs +0 -9
- package/lib/cli/starters/tanstack-start/server/application.mjs +0 -74
- package/lib/cli/starters/tanstack-start/server/auth.mjs +0 -24
- package/lib/cli/starters/tanstack-start/server/worker.mjs +0 -11
- package/lib/cli/starters/tanstack-start/server/workflows.mjs +0 -23
- package/lib/cli/starters/tanstack-start/src/ChatApp.jsx +0 -57
- package/lib/cli/starters/tanstack-start/src/Notebook.jsx +0 -25
- package/lib/cli/starters/tanstack-start/src/components/mayura/approval.tsx +0 -142
- package/lib/cli/starters/tanstack-start/src/components/mayura/thread-history.tsx +0 -142
- package/lib/cli/starters/tanstack-start/src/components/mayura/thread-list.tsx +0 -9
- package/lib/cli/starters/tanstack-start/src/components/mayura/ui.css +0 -14
- package/lib/cli/starters/tanstack-start/src/connect.js +0 -21
- package/lib/cli/starters/tanstack-start/src/session.js +0 -138
- package/lib/cli/starters/tanstack-start/src/style.css +0 -11
- package/lib/cli/starters/tanstack-start/test/server.test.mjs +0 -95
- package/lib/cli/starters/tanstack-start/test/session.test.mjs +0 -16
- /package/lib/cli/{starters/hono/src/components/mayura/ui.css → starter-assets/011cacc77ada0de5b447674e9fc4374a247b9a46eb169722b12649753f24188f} +0 -0
- /package/lib/cli/{starters/hono/test/server.test.mjs → starter-assets/0c825d6a776673ec6274cfc29cd45b1a8c56dcb880c291a91075c77e1ef1e4f3} +0 -0
- /package/lib/cli/{starters/hono/server/auth.mjs → starter-assets/0dd570bfacc357d23be3340250090b9a4c6193a49cdd02e9b6789e7bee8433dd} +0 -0
- /package/lib/cli/{starters/hono/src/components/mayura/approval.tsx → starter-assets/11292bd14cdaf27a8f8317ba4ab768d706a726b2e26474b599f3db116674b4b3} +0 -0
- /package/lib/cli/{starters/nextjs/dot-gitignore → starter-assets/1873b02e070347f9a449e07084242982fa6af412c45aa764985d553975b64589} +0 -0
- /package/lib/cli/{starters/hono/src/style.css → starter-assets/2f3869e6d69134e43be713c4590bfe48896a5c54ece6ffc1a4f204cfcfe54218} +0 -0
- /package/lib/cli/{starters/hono/server/worker.mjs → starter-assets/350d77757f548369beff29d658cf1620752d4e23b4b732d99a1b403ca043137f} +0 -0
- /package/lib/cli/{starters/approval-workflow/src/model.ts → starter-assets/37294d24c04b71eaf6d6f0bd52fd4c1cc7a5d3cb63da9c7920ed1d44276da9cb} +0 -0
- /package/lib/cli/{starters/approval-workflow/tsconfig.json → starter-assets/4387d6537dd5924ae62326aa3d7d8cbad1e5abd930aecc9daa6fab1ac2f6ef24} +0 -0
- /package/lib/cli/{starters/hono/dot-dockerignore → starter-assets/4434be031b58cc6ee680b2860b2ad1fe4089af7ee866c13223dfb621dd042ff1} +0 -0
- /package/lib/cli/{starters/hono/src/ChatApp.jsx → starter-assets/46e199317648a076243d6c8e7ffedc48785a6ffc0f203b88c7c4a9479b34c5b9} +0 -0
- /package/lib/cli/{starters/hono/src/components/mayura/thread-history.tsx → starter-assets/4741fccbca2e0d2fc6f61d11af3cf7bcc5f0238b67bb46282287207abdc6c536} +0 -0
- /package/lib/cli/{starters/approval-workflow/dot-dockerignore → starter-assets/4be664708b0120da5d2b73c5a27968093da06b8728f88f2bda2a1ccbf40f6891} +0 -0
- /package/lib/cli/{starters/hono/server/workflows.mjs → starter-assets/4d11f729672df54969a851494877a3c5aee24bb8f8c68eacaaa22e715bf5ed69} +0 -0
- /package/lib/cli/{starters/hono/dot-env.example → starter-assets/4f141323062660c4dc5b563300d57bb4cdbdc7fe9bfba96e43d9c64bb274474e} +0 -0
- /package/lib/cli/{starters/hono/Dockerfile → starter-assets/5471b74c46258d1edb00eb8f60f4219c389a252f7e224f2692f8f3e71ae43e3e} +0 -0
- /package/lib/cli/{starters/hono/scripts/setup.mjs → starter-assets/56e2d6db9fe4b0449c979acd06947a5b776bcc645184b54b8d3654a48bd12c38} +0 -0
- /package/lib/cli/{starters/hono/src/Notebook.jsx → starter-assets/6138d1e2ca4469daf4f5545d140943f6e23b0c37f865051b266ec99695cf181a} +0 -0
- /package/lib/cli/{starters/hono/src/vite-env.d.ts → starter-assets/65996936fbb042915f7b74a200fcdde7e410f32a669b1ab9597cfaa4b0faddb5} +0 -0
- /package/lib/cli/{starters/hono/server/application.mjs → starter-assets/757f43c27415654049ecf01b67d560c83d788108d1aebcf1f16a86d956bd7fb6} +0 -0
- /package/lib/cli/{starters/hono/src/components/mayura/thread-list.tsx → starter-assets/97601d0bf331df7bbde88f7ee269610bc8a1239f8eeb58fded6416e588a5b7dd} +0 -0
- /package/lib/cli/{starters/approval-workflow/dot-github/workflows/ci.yml → starter-assets/aa4182c76778ba2194ecbfde9a960c20181534fd1ab484df126278dbc6eb0186} +0 -0
- /package/lib/cli/{starters/hono/src/session.js → starter-assets/abcc6ebd29ba47a079befb6568054dec8f43d4c729187e4a3610af39789e77be} +0 -0
- /package/lib/cli/{starters/hono/compose.yaml → starter-assets/cc1df6f5ce0eebffc567ecea1d599eba97cd1b94ab01551085c0eb87a28e3a6c} +0 -0
- /package/lib/cli/{starters/hono/src/connect.js → starter-assets/cd3ddb959b277e7d495cc020a6f8146acfbcc9d05ececa3809e8aafcf84504d9} +0 -0
- /package/lib/cli/{starters/hono/test/session.test.mjs → starter-assets/dfe75fd07538427d80ba76767e037e929664c80ff5a41b7544496a789181bb73} +0 -0
- /package/lib/cli/{starters/approval-workflow/dot-gitignore → starter-assets/f3ef7285253ec9668732f535306beee602e91cb6e20f83d4799b3323399ce569} +0 -0
- /package/lib/cli/{starters/nuxt/src/view.js → starter-assets/ff840fe960683d377e78f731b5d4318adf6050384791fa20e4948d34192aa35d} +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Mayura with TanStack Start"
|
|
3
|
+
description: "Run the TanStack Start notebook starter with persistent threads, exact tool approvals, a scoped server and a separate durable worker."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Use the `tanstack-start` starter to build a TanStack Start application with a working approval flow before adding a paid model.
|
|
7
|
+
It includes persistent scoped chat, a deterministic note agent, an explicit approve/reject interface and a separate
|
|
8
|
+
durable indexing worker. This is runnable application source, not a hosted service.
|
|
9
|
+
|
|
10
|
+
## Generate and run
|
|
11
|
+
|
|
12
|
+
Use Node 24.14.1 or a later supported 24.x version. Run the initializer from a directory you own;
|
|
13
|
+
inspect its plan before applying it to an existing project.
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npx mayura@1.2.1 init --starter tanstack-start --directory ./my-notebook --apply
|
|
17
|
+
cd my-notebook
|
|
18
|
+
npm install
|
|
19
|
+
npm run setup
|
|
20
|
+
npm run dev
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Open `http://localhost:3000`. Read the generated ignored `.data/login-token` file locally and enter its value in
|
|
24
|
+
the notebook's password field. Setup creates an eight-hour local session, never prints its token, and refuses to
|
|
25
|
+
replace existing credentials. Keep `.env` and `.data` out of source control.
|
|
26
|
+
|
|
27
|
+
In another terminal, inside the generated project:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
npm run worker
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Follow a complete conversation
|
|
34
|
+
|
|
35
|
+
1. Connect with the local session and create a thread.
|
|
36
|
+
2. Send a note. Inspect the exact proposed input before approving or rejecting it.
|
|
37
|
+
3. Approve once: the note is saved and a separate durable indexing workflow is submitted.
|
|
38
|
+
4. Let the worker process the index job. Reload, re-enter the session and inspect the persisted history.
|
|
39
|
+
5. If a response is lost, inspect the saved run before using the explicit recovery action. Do not send the note again
|
|
40
|
+
with a new key to repair an uncertain write.
|
|
41
|
+
|
|
42
|
+
The fixture needs no provider API key, model billing or external write. A rejected proposal must not save a note.
|
|
43
|
+
Thread history and approval controls remain scoped to the identity verified by the server.
|
|
44
|
+
|
|
45
|
+
## Framework boundary
|
|
46
|
+
|
|
47
|
+
The file route registers native GET, POST, DELETE, OPTIONS and HEAD handlers. Each forwards the Request to the portable server module. The index route renders the notebook. Keep this server route boundary instead of serializing approval commands through a server function.
|
|
48
|
+
|
|
49
|
+
| Part | Generated location |
|
|
50
|
+
| --- | --- |
|
|
51
|
+
| HTTP bridge | `src/routes/api.mayura.$.ts` |
|
|
52
|
+
| Notebook interface | `src/routes/index.tsx` |
|
|
53
|
+
| Application and tool configuration | `server/application.mjs` |
|
|
54
|
+
| Session verification | `server/auth.mjs` |
|
|
55
|
+
| Background processing | `server/worker.mjs` |
|
|
56
|
+
|
|
57
|
+
The API is mounted at `/api/mayura/*`; the browser's origin-pinned transport preserves the native Mayura route
|
|
58
|
+
contract while adding that prefix. Keep server-only imports out of the React page bundle. Update the route prefix and browser transport together if the application moves under another mount. Native stream responses should pass through unchanged so run events and approval pauses remain observable.
|
|
59
|
+
|
|
60
|
+
## Customize identity, tools and storage
|
|
61
|
+
|
|
62
|
+
Replace the single-user demonstration authenticator with verified application identity before opening the app to
|
|
63
|
+
customers. The host fixes principal, project, route capabilities and agent permissions. Browser input cannot choose
|
|
64
|
+
a tenant or grant itself a capability. Never distribute one shared owner token to multiple customers.
|
|
65
|
+
|
|
66
|
+
The note agent and indexing worker have separate grants. If you replace the fixture model, declare the model grant,
|
|
67
|
+
prices, finite per-call cost cap and run budget. A gateway subscription does not remove those limits. See
|
|
68
|
+
[AI gateways](ai-gateways.md) and [authorization](authorization.md).
|
|
69
|
+
|
|
70
|
+
The generated Node adapter uses a pinned Nitro beta. Retain the starter toolchain and verify the build on the actual deployment before changing adapter versions. The worker is a separate Node process; a server route alone does not advance the durable indexing workflow.
|
|
71
|
+
|
|
72
|
+
A note write and workflow submission are separate operations. If scheduling is unconfirmed after the note was saved,
|
|
73
|
+
reconcile the missing index job using the note's identity; never replay the browser write to repair scheduling.
|
|
74
|
+
See [framework starter architecture](framework-starters.md) for worker leadership, retention and recovery details.
|
|
75
|
+
|
|
76
|
+
## Verify your changes
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
npm test
|
|
80
|
+
npm run typecheck
|
|
81
|
+
npm run build
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The V1.2 release passed the complete cross-platform qualification matrix, including generated packed server
|
|
85
|
+
contracts and workspace framework builds/HTTP approval flows. Rendered browser interaction and actual framework
|
|
86
|
+
deployments are separate checks; qualify your target before exposing customer data. See
|
|
87
|
+
[release validation status](release-readiness.md) and [deployment](deployment.md).
|
|
88
|
+
|
|
89
|
+
## Continue building
|
|
90
|
+
|
|
91
|
+
- [Threads and compaction](threads.md): history, recording and bounded summaries.
|
|
92
|
+
- [Approvals and human input](approvals-and-human-input.md): exact-call decisions and durable resumption.
|
|
93
|
+
- [Copy-in UI](copy-in-ui.md) and [headless stores](react.md): customize the conversation interface.
|
|
94
|
+
- [Choose a starter](choosing-a-starter.md): compare this notebook with the other application shapes.
|
|
@@ -3,13 +3,16 @@ title: "Pinecone vectors"
|
|
|
3
3
|
description: "Scoped native vector storage for pinecone."
|
|
4
4
|
package: "@mayurajs/vector-pinecone"
|
|
5
5
|
vendor: "Pinecone"
|
|
6
|
+
logo: "pinecone"
|
|
6
7
|
website: "https://docs.pinecone.io"
|
|
7
8
|
area: "vectors"
|
|
8
9
|
---
|
|
9
10
|
|
|
10
11
|
`@mayurajs/vector-pinecone` implements the [RAG contracts](../guides/rag.md). Install it alongside `mayura`.
|
|
11
12
|
Construction performs no I/O, credential discovery, provisioning or background work. All operations require an
|
|
12
|
-
explicit host permission and a nonnegative `costMicros` ceiling.
|
|
13
|
+
explicit host permission and a nonnegative `costMicros` ceiling. See the
|
|
14
|
+
[qualification matrix](../guides/rag-production.md#qualification-matrix) for the stable Modal + Pinecone Loki v28
|
|
15
|
+
configuration and its measured limits.
|
|
13
16
|
|
|
14
17
|
`pineconeVectorStore` accepts `endpoint`, `headers`, `collection`, `dimensions`, `costMicros`, `permissions`,
|
|
15
18
|
`timeoutMs`, `maxConcurrent` and optional test `fetch`. Grant `rag:transport:pinecone`. Credentials go in host-owned
|
package/docs/introduction.md
CHANGED
|
@@ -15,6 +15,11 @@ points you import only when you need them, and other services (more model provid
|
|
|
15
15
|
hosted sandboxes and browsers, identity providers, observability services and deploy targets) come as optional
|
|
16
16
|
[`@mayurajs/*` packages](reference/integrations.md).
|
|
17
17
|
|
|
18
|
+
V1.2 adds persistent conversations, exact tool approvals, agent handoffs and fine-grained authorization.
|
|
19
|
+
Start with one of the [six framework notebooks](guides/framework-starters.md), or
|
|
20
|
+
[choose another application starter](guides/choosing-a-starter.md). The
|
|
21
|
+
[release overview](project/whats-new.md) covers the 105 extensions, the qualified RAG profile and experimental AG-UI.
|
|
22
|
+
|
|
18
23
|
## The building blocks
|
|
19
24
|
|
|
20
25
|
| Block | What it is | Start here |
|
|
@@ -1,8 +1,76 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "What's new in Mayura 1.1"
|
|
3
|
-
description: "
|
|
2
|
+
title: "What's new in Mayura 1.2.1"
|
|
3
|
+
description: "Qualified retrieval for the Modal and Pinecone Loki profile, configurable workflow graphs, and the capabilities shipped in Mayura 1.2."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
Mayura **1.2.1 is published** under `latest` for `mayura` and 105 optional
|
|
7
|
+
[integration packages](../reference/integrations.md). All 106 packages were published through trusted publishing
|
|
8
|
+
with verified integrity and provenance. All 22 existing `next` tags were preserved. See the
|
|
9
|
+
[release evidence](../guides/release-readiness.md) for the qualified source and remaining interoperability limits.
|
|
10
|
+
|
|
11
|
+
## Production retrieval and configurable graphs
|
|
12
|
+
|
|
13
|
+
The [Modal and Pinecone Loki v28 profile](../guides/rag-production.md) is stable for its registered
|
|
14
|
+
software-operations workload. Qualification covered 40 source-reviewed cases, 600 timed native queries,
|
|
15
|
+
recovery, scope isolation and cleanup. The semantic acquisition and ranking p95 upper bound was 4.725 seconds.
|
|
16
|
+
Other profiles remain experimental. Start with [Build and deploy a retrieval agent](../guides/rag-deployment.md).
|
|
17
|
+
|
|
18
|
+
Workflow graphs keep the 128-node default. V1.2.1 adds a configurable per-graph bound and a trusted host
|
|
19
|
+
option to disable that count limit. See [configuring graph size](../concepts/workflows.md#configuring-graph-size).
|
|
20
|
+
|
|
21
|
+
The following capabilities were introduced in Mayura 1.2.0.
|
|
22
|
+
|
|
23
|
+
## Conversations that continue
|
|
24
|
+
|
|
25
|
+
[Threads](../guides/threads.md) retain scoped conversation history in your database. A run can pause for an
|
|
26
|
+
[exact tool approval](../guides/approvals-and-human-input.md), save a checkpoint, and resume through another host.
|
|
27
|
+
Thread/run recording and recovery preserve completed turns without replaying tool writes. Bounded compaction
|
|
28
|
+
journals the summary's source, model and cost; uncertain paid work requires inspection rather than another call.
|
|
29
|
+
|
|
30
|
+
[Agent handoffs](../guides/agent-handoffs.md) continue the thread and budget while switching to separately declared
|
|
31
|
+
agent permissions. The initial profile is buffered, text-only, non-speculative root runs.
|
|
32
|
+
|
|
33
|
+
## Authorization throughout the runtime
|
|
34
|
+
|
|
35
|
+
[Fine-grained authorization](../guides/authorization.md) adds a shared policy contract, built-in RBAC, audit events
|
|
36
|
+
and OpenTelemetry integration. Scoped server routes, agent/tool execution, workflows, memory, retrieval, threads,
|
|
37
|
+
approvals and compaction use that contract. Optional adapters cover OpenFGA, Cedar, Permit.io, Oso and an external
|
|
38
|
+
HTTP policy service. Resource decisions supplement explicit runtime grants; they do not replace them.
|
|
39
|
+
|
|
40
|
+
## Start with an application
|
|
41
|
+
|
|
42
|
+
[Six framework starters](../guides/framework-starters.md) generate working notebooks for
|
|
43
|
+
[Next.js](../guides/nextjs.md), [Hono](../guides/hono.md), [React Router](../guides/react-router.md),
|
|
44
|
+
[TanStack Start](../guides/tanstack-start.md), [SvelteKit](../guides/sveltekit.md) and [Nuxt](../guides/nuxt.md).
|
|
45
|
+
They include scoped threads, exact note approvals, an offline model fixture, a separate indexing worker and
|
|
46
|
+
deployment source. [Choose a starter](../guides/choosing-a-starter.md) compares all 11 applications.
|
|
47
|
+
|
|
48
|
+
[Copy-in React components](../guides/copy-in-ui.md) provide thread history, approval and run controls as source you
|
|
49
|
+
own. [Headless stores](../guides/react.md) support native Svelte and Vue views. Hooks and subscriptions observe;
|
|
50
|
+
submissions and approval decisions remain explicit actions.
|
|
51
|
+
|
|
52
|
+
## Gateways and retrieval
|
|
53
|
+
|
|
54
|
+
Six [AI gateway packages](../guides/ai-gateways.md) connect Vercel AI Gateway, Cloudflare AI Gateway, OpenRouter,
|
|
55
|
+
Portkey, Helicone and LiteLLM with scoped models, explicit credentials and bounded costs.
|
|
56
|
+
|
|
57
|
+
[Retrieval augmented generation](../guides/rag.md) adds scoped citations, durable ingestion and embedding claims,
|
|
58
|
+
parent context, hybrid retrieval and query expansion, six vector adapters, three rerankers and offline evaluation.
|
|
59
|
+
|
|
60
|
+
The **experimental [AG-UI adapter](../guides/ag-ui.md)** projects run events, thread messages, state snapshots/deltas
|
|
61
|
+
and approval interrupts. Durable frontend-tool claims and result outboxes support safe native-owner recovery without
|
|
62
|
+
automatically replaying browser writes. Reference-client, CopilotKit and rendered notebook interoperability remain
|
|
63
|
+
outside the completed qualification.
|
|
64
|
+
|
|
65
|
+
## Upgrade and qualification
|
|
66
|
+
|
|
67
|
+
Install the coordinated release with `npm install mayura@1.2.1`. Select matching `@mayurajs/*@1.2.1` packages only
|
|
68
|
+
where needed. Review [versioning](versioning.md), [support](support.md) and the
|
|
69
|
+
[release validation status](../guides/release-readiness.md) before changing a production host. The full main CI
|
|
70
|
+
matrix and V1.1 upgrade check passed. Check the qualification scope for the external services you use.
|
|
71
|
+
|
|
72
|
+
## Mayura 1.1
|
|
73
|
+
|
|
6
74
|
Mayura 1.1 adds new capabilities to `mayura` and 85 optional [integration packages](../reference/integrations.md) that
|
|
7
75
|
connect it to other services. It is a minor release: nothing documented in 1.0 changes, and a 1.0 database works with
|
|
8
76
|
1.1 as it is, with no migration. The full list is in `CHANGELOG.md`.
|
package/docs/quickstart.md
CHANGED
|
@@ -14,8 +14,8 @@ npx mayura init
|
|
|
14
14
|
|
|
15
15
|
The wizard asks three things:
|
|
16
16
|
|
|
17
|
-
1. **A starter or a template.**
|
|
18
|
-
|
|
17
|
+
1. **A starter or a template.** Choose from four server applications, six framework notebooks with persistent chat
|
|
18
|
+
and exact approvals, or the `cli-agent` terminal assistant. Templates are small projects showing one feature.
|
|
19
19
|
2. **A model provider.** Offline (no key needed; rule-based stand-in models), OpenAI, Anthropic, an
|
|
20
20
|
OpenAI-compatible provider such as Groq, Gemini, Mistral, DeepSeek, xAI, OpenRouter, Together or Fireworks, Azure
|
|
21
21
|
OpenAI, or any other compatible endpoint.
|
|
@@ -30,7 +30,9 @@ npm install
|
|
|
30
30
|
npm run dev
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
`npm run dev` runs `mayura dev`: it builds
|
|
33
|
+
For the server starters, `npm run dev` runs `mayura dev`: it builds, starts and watches the project. Framework
|
|
34
|
+
notebooks have their own dev server and first need `npm run setup` for a local session. Follow
|
|
35
|
+
[Choose a starter](guides/choosing-a-starter.md) and the generated README for the right sequence, or
|
|
34
36
|
[mayura init](cli/init.md) for every starter and template.
|
|
35
37
|
|
|
36
38
|
## Option 2: add Mayura to your project
|
|
@@ -2,7 +2,7 @@ FROM node:24.14.1-alpine@sha256:8510330d3eb72c804231a834b1a8ebb55cb3796c3e443129
|
|
|
2
2
|
|
|
3
3
|
ARG MAYURA_PROVENANCE
|
|
4
4
|
LABEL org.opencontainers.image.title="Mayura Code Sandbox" \
|
|
5
|
-
org.opencontainers.image.version="1.2.
|
|
5
|
+
org.opencontainers.image.version="1.2.2" \
|
|
6
6
|
org.opencontainers.image.base.name="node:24.14.1-alpine@sha256:8510330d3eb72c804231a834b1a8ebb55cb3796c3e4431297a24d246b8add4d5" \
|
|
7
7
|
dev.mayura.code-sandbox.provenance="${MAYURA_PROVENANCE}"
|
|
8
8
|
|
package/lib/ag-ui/package.json
CHANGED
package/lib/auth/package.json
CHANGED
package/lib/authz/package.json
CHANGED
package/lib/browser/package.json
CHANGED
package/lib/cli/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type TemplateName = typeof TEMPLATE_NAMES[number];
|
|
|
4
4
|
/** Versions of the third-party packages generated projects install; kept equal to the workspace's (tested). */
|
|
5
5
|
export declare const PEER_VERSIONS: Readonly<Record<string, string>>;
|
|
6
6
|
/** Complete multi-file projects: offline by default, one environment switch to a real provider or PostgreSQL. */
|
|
7
|
-
export declare const STARTER_NAMES: readonly ["approval-workflow", "support-agent", "research-team", "event-automation", "cli-agent", "nextjs", "hono", "react-router", "tanstack-start", "sveltekit", "nuxt"];
|
|
7
|
+
export declare const STARTER_NAMES: readonly ["approval-workflow", "support-agent", "research-team", "event-automation", "cli-agent", "nextjs", "hono", "react-router", "tanstack-start", "sveltekit", "nuxt", "rag-modal-pinecone"];
|
|
8
8
|
export type StarterName = typeof STARTER_NAMES[number];
|
|
9
9
|
export interface ProjectToolRecord {
|
|
10
10
|
readonly id: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,uBAAuB,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,UAAU,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,eAAe,EAAE,gBAAgB,EAC7M,iBAAiB,EAAE,oBA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AW,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAC"}
|
package/lib/cli/dist/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { lstat, readdir, readFile } from 'node:fs/promises';
|
|
|
3
3
|
import { isAbsolute, parse, resolve } from 'node:path';
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
import { MayuraError, freezeJson, jsonValue } from '../../core/dist/index.js';
|
|
6
|
+
import { sha256Hex } from '../../core/dist/host.js';
|
|
6
7
|
import { agentGuide } from './agent-guide.js';
|
|
7
8
|
import { assertSafeDirectory, canonicalTarget, digest, planChanges, writePlannedFiles } from './files.js';
|
|
8
9
|
export { OperationalRequestError, approveWorkflow, cancelRun, cancelWorkflow, inspectHumanRequest, inspectHumanRequests, inspectRun, inspectServerHealth, inspectServerTools, inspectWorkflow, inspectWorkflows, holdWorkflowFleet, inspectWorkflowFleet, pauseWorkflow, releaseWorkflowFleet, respondHumanRequest, resumeWorkflow, signalWorkflow, sweepWorkflowFleet, waitForRun } from './operations.js';
|
|
@@ -36,7 +37,7 @@ export const PEER_VERSIONS = Object.freeze({
|
|
|
36
37
|
'better-sqlite3': '13.0.3', pg: '8.23.0', '@jitl/quickjs-wasmfile-release-sync': '0.32.0', 'quickjs-emscripten-core': '0.32.0',
|
|
37
38
|
});
|
|
38
39
|
/** Complete multi-file projects: offline by default, one environment switch to a real provider or PostgreSQL. */
|
|
39
|
-
export const STARTER_NAMES = Object.freeze(['approval-workflow', 'support-agent', 'research-team', 'event-automation', 'cli-agent', 'nextjs', 'hono', 'react-router', 'tanstack-start', 'sveltekit', 'nuxt']);
|
|
40
|
+
export const STARTER_NAMES = Object.freeze(['approval-workflow', 'support-agent', 'research-team', 'event-automation', 'cli-agent', 'nextjs', 'hono', 'react-router', 'tanstack-start', 'sveltekit', 'nuxt', 'rag-modal-pinecone']);
|
|
40
41
|
const starterDescriptions = Object.freeze({
|
|
41
42
|
'approval-workflow': 'Durable refund approvals: triage agent, human approval, separate server and worker, operator console and a reviewed v1 to v2 migration.',
|
|
42
43
|
'support-agent': 'Customer support chat: a streaming agent with order tools scoped to the signed-in customer, per-customer native memory, PII redaction, a React chat UI and the operator console.',
|
|
@@ -49,6 +50,7 @@ const starterDescriptions = Object.freeze({
|
|
|
49
50
|
'tanstack-start': 'TanStack Start notebook: scoped persistent threads, exact in-run approvals, local deterministic models and background workflow processing.',
|
|
50
51
|
'sveltekit': 'SvelteKit notebook: scoped persistent threads, exact in-run approvals, local deterministic models and background workflow processing.',
|
|
51
52
|
'nuxt': 'Nuxt notebook: scoped persistent threads, exact in-run approvals, local deterministic models and background workflow processing.',
|
|
53
|
+
'rag-modal-pinecone': 'Retrieval agent with durable Markdown ingestion, exact citations, an offline demo and an opt-in Modal + Pinecone deployment.',
|
|
52
54
|
});
|
|
53
55
|
const id = /^[A-Za-z0-9][A-Za-z0-9._:/-]{0,127}$/u;
|
|
54
56
|
const templateRoot = fileURLToPath(new URL('../templates/', import.meta.url));
|
|
@@ -57,6 +59,7 @@ const starterRoot = fileURLToPath(new URL('../starters/', import.meta.url));
|
|
|
57
59
|
const starterLimits = Object.freeze({ files: 256, fileBytes: 262_144, totalBytes: 4_194_304 });
|
|
58
60
|
// Build output, installs and local state never leave the repository copy of a starter.
|
|
59
61
|
const starterSkipped = new Set(['node_modules', 'dist', 'build', '.data', 'coverage']);
|
|
62
|
+
const starterWorkspaceDependencies = new Set(['mayura', '@mayurajs/storage-d1', '@mayurajs/vector-pinecone']);
|
|
60
63
|
const plans = new WeakMap();
|
|
61
64
|
function projectName(directory) {
|
|
62
65
|
const name = directory.replaceAll('\\', '/').split('/').filter(Boolean).at(-1)?.toLowerCase().replace(/[^a-z0-9-]+/g, '-') ?? '';
|
|
@@ -108,41 +111,81 @@ export async function planProject(template, directory) {
|
|
|
108
111
|
}
|
|
109
112
|
// Starter files that npm would drop or rename when packing (.gitignore, .github) are stored with a `dot-` prefix.
|
|
110
113
|
const starterPath = (segments) => segments.map(segment => segment.startsWith('dot-') ? `.${segment.slice(4)}` : segment).join('/');
|
|
114
|
+
const starterSegment = /^[A-Za-z0-9_+$\[\]][A-Za-z0-9._+$\[\]-]{0,99}$/u;
|
|
115
|
+
/** Published copies can share identical source assets. A workspace starter uses its own full tree. */
|
|
116
|
+
async function sharedStarterFiles(name) {
|
|
117
|
+
const path = fileURLToPath(new URL('../starter-assets/manifest.json', import.meta.url));
|
|
118
|
+
try {
|
|
119
|
+
const details = await lstat(path);
|
|
120
|
+
if (!details.isFile() || details.size > 262_144)
|
|
121
|
+
throw new MayuraError('INTEGRITY_VIOLATION', 'Shared starter manifest is invalid.');
|
|
122
|
+
const manifest = await readFile(path, 'utf8');
|
|
123
|
+
const entries = JSON.parse(manifest)[name];
|
|
124
|
+
if (entries === undefined)
|
|
125
|
+
return {};
|
|
126
|
+
if (entries === null || typeof entries !== 'object' || Array.isArray(entries))
|
|
127
|
+
throw new MayuraError('INTEGRITY_VIOLATION', 'Shared starter entries are invalid.');
|
|
128
|
+
return entries;
|
|
129
|
+
}
|
|
130
|
+
catch (error) {
|
|
131
|
+
if (error.code === 'ENOENT')
|
|
132
|
+
return {};
|
|
133
|
+
throw error;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
111
136
|
async function collectStarter(name) {
|
|
112
137
|
const root = resolve(starterRoot, name);
|
|
113
138
|
const files = new Map();
|
|
114
139
|
let total = 0;
|
|
140
|
+
const collect = async (path, segments, expected) => {
|
|
141
|
+
const details = await lstat(path);
|
|
142
|
+
if (!details.isFile() || details.isSymbolicLink() || details.size > starterLimits.fileBytes)
|
|
143
|
+
throw new MayuraError('INTEGRITY_VIOLATION', 'Starter contains an unsupported file type or size.');
|
|
144
|
+
total += details.size;
|
|
145
|
+
if (files.size >= starterLimits.files || total > starterLimits.totalBytes)
|
|
146
|
+
throw new MayuraError('INTEGRITY_VIOLATION', 'Starter exceeds its file bounds.');
|
|
147
|
+
const bytes = await readFile(path);
|
|
148
|
+
let content;
|
|
149
|
+
try {
|
|
150
|
+
content = new TextDecoder('utf-8', { fatal: true }).decode(bytes);
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
throw new MayuraError('INTEGRITY_VIOLATION', 'Starter files must be UTF-8 text.');
|
|
154
|
+
}
|
|
155
|
+
if (expected !== undefined && sha256Hex(bytes) !== expected)
|
|
156
|
+
throw new MayuraError('INTEGRITY_VIOLATION', 'Shared starter file differs from its manifest.');
|
|
157
|
+
const target = starterPath(segments);
|
|
158
|
+
if (files.has(target))
|
|
159
|
+
throw new MayuraError('INTEGRITY_VIOLATION', 'Starter file paths overlap.');
|
|
160
|
+
files.set(target, content);
|
|
161
|
+
};
|
|
115
162
|
const walk = async (segments) => {
|
|
116
163
|
const entries = await readdir(resolve(root, ...segments), { withFileTypes: true });
|
|
117
164
|
for (const entry of entries.sort((left, right) => left.name < right.name ? -1 : left.name > right.name ? 1 : 0)) {
|
|
118
165
|
if (starterSkipped.has(entry.name) || entry.name.startsWith('.') || entry.name.endsWith('.tsbuildinfo'))
|
|
119
166
|
continue;
|
|
120
|
-
if (
|
|
167
|
+
if (!starterSegment.test(entry.name))
|
|
121
168
|
throw new MayuraError('INTEGRITY_VIOLATION', 'Starter contains an unsupported file name.');
|
|
122
169
|
const next = [...segments, entry.name];
|
|
123
170
|
if (entry.isDirectory()) {
|
|
124
171
|
await walk(next);
|
|
125
172
|
continue;
|
|
126
173
|
}
|
|
127
|
-
|
|
128
|
-
const details = await lstat(path);
|
|
129
|
-
if (!details.isFile() || details.isSymbolicLink() || details.size > starterLimits.fileBytes)
|
|
130
|
-
throw new MayuraError('INTEGRITY_VIOLATION', 'Starter contains an unsupported file type or size.');
|
|
131
|
-
total += details.size;
|
|
132
|
-
if (files.size >= starterLimits.files || total > starterLimits.totalBytes)
|
|
133
|
-
throw new MayuraError('INTEGRITY_VIOLATION', 'Starter exceeds its file bounds.');
|
|
134
|
-
let content;
|
|
135
|
-
try {
|
|
136
|
-
content = new TextDecoder('utf-8', { fatal: true }).decode(await readFile(path));
|
|
137
|
-
}
|
|
138
|
-
catch {
|
|
139
|
-
throw new MayuraError('INTEGRITY_VIOLATION', 'Starter files must be UTF-8 text.');
|
|
140
|
-
}
|
|
141
|
-
files.set(starterPath(next), content);
|
|
174
|
+
await collect(resolve(root, ...next), next);
|
|
142
175
|
}
|
|
143
176
|
};
|
|
144
177
|
await walk([]);
|
|
145
|
-
|
|
178
|
+
const sharedRoot = fileURLToPath(new URL('../starter-assets/', import.meta.url));
|
|
179
|
+
for (const [path, expected] of Object.entries(await sharedStarterFiles(name))) {
|
|
180
|
+
const segments = path.split('/');
|
|
181
|
+
if (!segments.every(segment => starterSegment.test(segment) && !starterSkipped.has(segment) && !segment.endsWith('.tsbuildinfo')) ||
|
|
182
|
+
typeof expected !== 'string' || !/^[a-f0-9]{64}$/u.test(expected)) {
|
|
183
|
+
throw new MayuraError('INTEGRITY_VIOLATION', 'Shared starter file has an invalid path or digest.');
|
|
184
|
+
}
|
|
185
|
+
await collect(resolve(sharedRoot, expected), segments, expected);
|
|
186
|
+
}
|
|
187
|
+
// Planning hashes the ordered changes. Keep the workspace and packaged file order identical.
|
|
188
|
+
return new Map([...files].sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0));
|
|
146
189
|
}
|
|
147
190
|
/** The repository copy links Mayura packages with `workspace:*`; a generated project pins this CLI's exact release. */
|
|
148
191
|
async function starterManifest(content, name) {
|
|
@@ -152,10 +195,10 @@ async function starterManifest(content, name) {
|
|
|
152
195
|
for (const field of ['dependencies', 'devDependencies']) {
|
|
153
196
|
const entries = manifest[field];
|
|
154
197
|
for (const [dependency, range] of Object.entries(entries ?? {})) {
|
|
155
|
-
if (range === 'workspace:*' && (dependency
|
|
198
|
+
if (range === 'workspace:*' && starterWorkspaceDependencies.has(dependency))
|
|
156
199
|
entries[dependency] = version;
|
|
157
200
|
else if (range.startsWith('workspace:'))
|
|
158
|
-
throw new MayuraError('INTEGRITY_VIOLATION', 'Starter manifests may
|
|
201
|
+
throw new MayuraError('INTEGRITY_VIOLATION', 'Starter manifests may only link to reviewed Mayura packages.');
|
|
159
202
|
}
|
|
160
203
|
}
|
|
161
204
|
return `${JSON.stringify(manifest, null, 2)}\n`;
|