@raybase/create 0.0.2 → 0.3.3
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/LICENSE +21 -0
- package/THIRD_PARTY_NOTICES.md +38 -0
- package/assets/apple-touch-icons/0.png +0 -0
- package/assets/apple-touch-icons/1.png +0 -0
- package/assets/apple-touch-icons/2.png +0 -0
- package/assets/apple-touch-icons/3.png +0 -0
- package/assets/apple-touch-icons/4.png +0 -0
- package/assets/apple-touch-icons/5.png +0 -0
- package/assets/apple-touch-icons/6.png +0 -0
- package/assets/apple-touch-icons/7.png +0 -0
- package/assets/apple-touch-icons/8.png +0 -0
- package/assets/apple-touch-icons/9.png +0 -0
- package/assets/apple-touch-icons/A.png +0 -0
- package/assets/apple-touch-icons/B.png +0 -0
- package/assets/apple-touch-icons/C.png +0 -0
- package/assets/apple-touch-icons/D.png +0 -0
- package/assets/apple-touch-icons/E.png +0 -0
- package/assets/apple-touch-icons/F.png +0 -0
- package/assets/apple-touch-icons/G.png +0 -0
- package/assets/apple-touch-icons/H.png +0 -0
- package/assets/apple-touch-icons/I.png +0 -0
- package/assets/apple-touch-icons/J.png +0 -0
- package/assets/apple-touch-icons/K.png +0 -0
- package/assets/apple-touch-icons/L.png +0 -0
- package/assets/apple-touch-icons/M.png +0 -0
- package/assets/apple-touch-icons/N.png +0 -0
- package/assets/apple-touch-icons/O.png +0 -0
- package/assets/apple-touch-icons/P.png +0 -0
- package/assets/apple-touch-icons/Q.png +0 -0
- package/assets/apple-touch-icons/R.png +0 -0
- package/assets/apple-touch-icons/S.png +0 -0
- package/assets/apple-touch-icons/T.png +0 -0
- package/assets/apple-touch-icons/U.png +0 -0
- package/assets/apple-touch-icons/V.png +0 -0
- package/assets/apple-touch-icons/W.png +0 -0
- package/assets/apple-touch-icons/X.png +0 -0
- package/assets/apple-touch-icons/Y.png +0 -0
- package/assets/apple-touch-icons/Z.png +0 -0
- package/assets/apple-touch-icons/default.png +0 -0
- package/dist/.source-hash +1 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2351 -0
- package/dist/index.js.map +1 -0
- package/dist/raybase-package-ranges.d.ts +11 -0
- package/dist/raybase-package-ranges.d.ts.map +1 -0
- package/dist/raybase-package-ranges.js +11 -0
- package/dist/raybase-package-ranges.js.map +1 -0
- package/dist/source-fetch.d.ts +91 -0
- package/dist/source-fetch.d.ts.map +1 -0
- package/dist/source-fetch.js +325 -0
- package/dist/source-fetch.js.map +1 -0
- package/dist/source-hash.d.ts +2 -0
- package/dist/source-hash.d.ts.map +1 -0
- package/dist/source-hash.js +23 -0
- package/dist/source-hash.js.map +1 -0
- package/dist/starter-description.d.ts +44 -0
- package/dist/starter-description.d.ts.map +1 -0
- package/dist/starter-description.js +273 -0
- package/dist/starter-description.js.map +1 -0
- package/dist/starter-source.d.ts +43 -0
- package/dist/starter-source.d.ts.map +1 -0
- package/dist/starter-source.js +156 -0
- package/dist/starter-source.js.map +1 -0
- package/dist/store-app-apply.d.ts +27 -0
- package/dist/store-app-apply.d.ts.map +1 -0
- package/dist/store-app-apply.js +100 -0
- package/dist/store-app-apply.js.map +1 -0
- package/dist/store-app-manifest.d.ts +86 -0
- package/dist/store-app-manifest.d.ts.map +1 -0
- package/dist/store-app-manifest.js +110 -0
- package/dist/store-app-manifest.js.map +1 -0
- package/dist/store-app-registry.d.ts +30 -0
- package/dist/store-app-registry.d.ts.map +1 -0
- package/dist/store-app-registry.js +232 -0
- package/dist/store-app-registry.js.map +1 -0
- package/models/recommended.json +42 -0
- package/modules/api/templates/react-router/app/api/operations.ts +8 -0
- package/modules/api/templates/tanstack-start/src/api/operations.ts +15 -0
- package/modules/docs/templates/astro-emdash/content/docs/getting-started.mdx +13 -0
- package/modules/docs/templates/astro-emdash/content/docs/index.mdx +13 -0
- package/modules/docs/templates/astro-emdash/content/docs/mcp.mdx +11 -0
- package/modules/docs/templates/astro-emdash/content/docs/meta.json +4 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/getting-started.mdx +12 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/index.mdx +12 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/mcp.mdx +10 -0
- package/modules/docs/templates/astro-emdash/site/content/docs/meta.json +4 -0
- package/modules/docs/templates/astro-emdash/site/source.config.ts +10 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/astro-emdash/site/src/docs/source.ts +7 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/[...slug].ts +6 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/markdown.ts +4 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/docs/api/search.ts +4 -0
- package/modules/docs/templates/astro-emdash/site/src/pages/llms.txt.ts +8 -0
- package/modules/docs/templates/astro-emdash/site/src/styles-docs.css +3 -0
- package/modules/docs/templates/astro-emdash/source.config.ts +10 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/astro-emdash/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/astro-emdash/src/docs/source.ts +7 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/routes/docs.tsx +22 -0
- package/modules/docs/templates/astro-emdash/src/styles-docs.css +3 -0
- package/modules/docs/templates/react-router/app/components/mdx.tsx +79 -0
- package/modules/docs/templates/react-router/app/lib/layout.shared.tsx +54 -0
- package/modules/docs/templates/react-router/app/lib/source.ts +7 -0
- package/modules/docs/templates/react-router/app/routes/docs.$.tsx +49 -0
- package/modules/docs/templates/react-router/app/routes/docs.api.search.ts +10 -0
- package/modules/docs/templates/react-router/app/routes/docs.tsx +13 -0
- package/modules/docs/templates/react-router/content/docs/getting-started.mdx +8 -0
- package/modules/docs/templates/react-router/content/docs/index.mdx +8 -0
- package/modules/docs/templates/react-router/content/docs/mcp.mdx +121 -0
- package/modules/docs/templates/react-router/content/docs/meta.json +4 -0
- package/modules/docs/templates/react-router/source.config.ts +5 -0
- package/modules/docs/templates/tanstack-start/content/docs/getting-started.mdx +10 -0
- package/modules/docs/templates/tanstack-start/content/docs/index.mdx +8 -0
- package/modules/docs/templates/tanstack-start/content/docs/mcp.mdx +121 -0
- package/modules/docs/templates/tanstack-start/content/docs/meta.json +4 -0
- package/modules/docs/templates/tanstack-start/source.config.ts +10 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-data.ts +24 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
- package/modules/docs/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
- package/modules/docs/templates/tanstack-start/src/docs/llm-text.ts +61 -0
- package/modules/docs/templates/tanstack-start/src/docs/source.ts +7 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/routes/docs.tsx +22 -0
- package/modules/docs/templates/tanstack-start/src/styles-docs.css +3 -0
- package/modules/guide/templates/astro-emdash/content/guide/capability-map.md +17 -0
- package/modules/guide/templates/astro-emdash/src/components/guide-widget.tsx +41 -0
- package/modules/guide/templates/astro-emdash/src/guide/actions.ts +8 -0
- package/modules/guide/templates/astro-emdash/src/guide/config.ts +21 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
- package/modules/guide/templates/astro-emdash/src/guide/corpus.ts +4 -0
- package/modules/guide/templates/astro-emdash/src/guide/resources.json +4 -0
- package/modules/guide/templates/react-router/app/components/guide-widget.tsx +29 -0
- package/modules/guide/templates/react-router/app/guide/actions.ts +3 -0
- package/modules/guide/templates/react-router/app/guide/config.ts +21 -0
- package/modules/guide/templates/react-router/app/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/react-router/app/guide/corpus.manifest.json +22 -0
- package/modules/guide/templates/react-router/app/guide/corpus.ts +4 -0
- package/modules/guide/templates/react-router/app/guide/resources.json +4 -0
- package/modules/guide/templates/react-router/content/guide/capability-map.md +13 -0
- package/modules/guide/templates/tanstack-start/content/guide/capability-map.md +17 -0
- package/modules/guide/templates/tanstack-start/src/components/guide-widget.tsx +41 -0
- package/modules/guide/templates/tanstack-start/src/guide/actions.ts +17 -0
- package/modules/guide/templates/tanstack-start/src/guide/config.ts +21 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.gen.ts +4 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.manifest.json +22 -0
- package/modules/guide/templates/tanstack-start/src/guide/corpus.ts +4 -0
- package/modules/guide/templates/tanstack-start/src/guide/resources.json +4 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/astro-emdash/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/astro-emdash/src/openai-subscription.ts +11 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/react-router/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/react-router/app/openai-subscription.ts +11 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/SKILL.md +57 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/compatibility-and-testing.md +129 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/module-contract.md +133 -0
- package/modules/openai-subscription/templates/tanstack-start/.agents/skills/raybase-openai-subscription/references/structured-outputs.md +159 -0
- package/modules/openai-subscription/templates/tanstack-start/src/openai-subscription.ts +11 -0
- package/package.json +34 -8
- package/skills/README.md +122 -0
- package/skills/raybase-actions/SKILL.md +223 -0
- package/skills/raybase-actions/references/action-patterns.md +190 -0
- package/skills/raybase-actions/references/adapting-actions.md +93 -0
- package/skills/raybase-actions/references/testing-actions.md +48 -0
- package/skills/raybase-agent-debugging/SKILL.md +230 -0
- package/skills/raybase-ai/SKILL.md +1310 -0
- package/skills/raybase-api/SKILL.md +45 -0
- package/skills/raybase-astro-emdash/SKILL.md +143 -0
- package/skills/raybase-astro-emdash-content-model/SKILL.md +217 -0
- package/skills/raybase-astro-emdash-content-model/references/LICENSE-emdash +9 -0
- package/skills/raybase-astro-emdash-content-model/references/emdash-collections.md +265 -0
- package/skills/raybase-astro-emdash-design/LICENSE-impeccable +60 -0
- package/skills/raybase-astro-emdash-design/SKILL.md +170 -0
- package/skills/raybase-astro-emdash-design/reference/color.md +91 -0
- package/skills/raybase-astro-emdash-design/reference/copy.md +73 -0
- package/skills/raybase-astro-emdash-design/reference/direction.md +115 -0
- package/skills/raybase-astro-emdash-design/reference/imagery.md +84 -0
- package/skills/raybase-astro-emdash-design/reference/layout.md +69 -0
- package/skills/raybase-astro-emdash-design/reference/motion.md +75 -0
- package/skills/raybase-astro-emdash-design/reference/polish.md +75 -0
- package/skills/raybase-astro-emdash-design/reference/typography.md +72 -0
- package/skills/raybase-astro-emdash-galley/SKILL.md +265 -0
- package/skills/raybase-astro-emdash-migration/SKILL.md +218 -0
- package/skills/raybase-astro-emdash-migration/references/inventory-and-conversion.md +242 -0
- package/skills/raybase-astro-emdash-security-review/SKILL.md +68 -0
- package/skills/raybase-astro-emdash-theme-selection/SKILL.md +216 -0
- package/skills/raybase-auth/SKILL.md +358 -0
- package/skills/raybase-background-jobs/SKILL.md +774 -0
- package/skills/raybase-building/SKILL.md +409 -0
- package/skills/raybase-building/references/interview-and-spec.md +87 -0
- package/skills/raybase-building/references/planning-docs.md +26 -0
- package/skills/raybase-building/references/schema-and-config.md +70 -0
- package/skills/raybase-changing-a-live-app/SKILL.md +119 -0
- package/skills/raybase-data-and-policies/SKILL.md +377 -0
- package/skills/raybase-deploy/SKILL.md +136 -0
- package/skills/raybase-docs-writing/SKILL.md +119 -0
- package/skills/raybase-guide/SKILL.md +235 -0
- package/skills/raybase-mcp/SKILL.md +309 -0
- package/skills/raybase-mcp/agents/openai.yaml +4 -0
- package/skills/raybase-notifications/SKILL.md +138 -0
- package/skills/raybase-pro-migration/SKILL.md +28 -0
- package/skills/raybase-react-router/SKILL.md +241 -0
- package/skills/raybase-react-router-design/LICENSE-impeccable +60 -0
- package/skills/raybase-react-router-design/SKILL.md +135 -0
- package/skills/raybase-react-router-design/reference/color.md +87 -0
- package/skills/raybase-react-router-design/reference/copy.md +83 -0
- package/skills/raybase-react-router-design/reference/delight.md +48 -0
- package/skills/raybase-react-router-design/reference/interaction.md +91 -0
- package/skills/raybase-react-router-design/reference/layout.md +82 -0
- package/skills/raybase-react-router-design/reference/motion.md +86 -0
- package/skills/raybase-react-router-design/reference/polish.md +79 -0
- package/skills/raybase-react-router-design/reference/typography.md +71 -0
- package/skills/raybase-react-router-security-review/LICENSE +22 -0
- package/skills/raybase-react-router-security-review/SKILL.md +190 -0
- package/skills/raybase-react-router-security-review/agents/openai.yaml +4 -0
- package/skills/raybase-react-router-security-review/references/api-security.md +519 -0
- package/skills/raybase-react-router-security-review/references/authentication.md +353 -0
- package/skills/raybase-react-router-security-review/references/authorization.md +372 -0
- package/skills/raybase-react-router-security-review/references/business-logic.md +443 -0
- package/skills/raybase-react-router-security-review/references/cryptography.md +329 -0
- package/skills/raybase-react-router-security-review/references/csrf.md +398 -0
- package/skills/raybase-react-router-security-review/references/data-protection.md +378 -0
- package/skills/raybase-react-router-security-review/references/deserialization.md +410 -0
- package/skills/raybase-react-router-security-review/references/error-handling.md +436 -0
- package/skills/raybase-react-router-security-review/references/file-security.md +457 -0
- package/skills/raybase-react-router-security-review/references/injection.md +259 -0
- package/skills/raybase-react-router-security-review/references/logging.md +433 -0
- package/skills/raybase-react-router-security-review/references/misconfiguration.md +435 -0
- package/skills/raybase-react-router-security-review/references/modern-threats.md +475 -0
- package/skills/raybase-react-router-security-review/references/raybase-react-router-security.md +235 -0
- package/skills/raybase-react-router-security-review/references/ssrf.md +413 -0
- package/skills/raybase-react-router-security-review/references/supply-chain.md +405 -0
- package/skills/raybase-react-router-security-review/references/xss.md +336 -0
- package/skills/raybase-realtime/SKILL.md +158 -0
- package/skills/raybase-realtime/agents/openai.yaml +4 -0
- package/skills/raybase-schema/SKILL.md +209 -0
- package/skills/raybase-search/SKILL.md +137 -0
- package/skills/raybase-search/agents/openai.yaml +4 -0
- package/skills/raybase-settings/SKILL.md +139 -0
- package/skills/raybase-settings/agents/openai.yaml +4 -0
- package/skills/raybase-tanstack-start/SKILL.md +166 -0
- package/skills/raybase-tanstack-start-design/LICENSE-impeccable +60 -0
- package/skills/raybase-tanstack-start-design/SKILL.md +140 -0
- package/skills/raybase-tanstack-start-design/reference/color.md +80 -0
- package/skills/raybase-tanstack-start-design/reference/copy.md +83 -0
- package/skills/raybase-tanstack-start-design/reference/delight.md +48 -0
- package/skills/raybase-tanstack-start-design/reference/interaction.md +91 -0
- package/skills/raybase-tanstack-start-design/reference/layout.md +82 -0
- package/skills/raybase-tanstack-start-design/reference/motion.md +86 -0
- package/skills/raybase-tanstack-start-design/reference/polish.md +79 -0
- package/skills/raybase-tanstack-start-design/reference/typography.md +71 -0
- package/skills/raybase-tanstack-start-security-review/LICENSE +22 -0
- package/skills/raybase-tanstack-start-security-review/SKILL.md +194 -0
- package/skills/raybase-tanstack-start-security-review/agents/openai.yaml +4 -0
- package/skills/raybase-tanstack-start-security-review/references/api-security.md +519 -0
- package/skills/raybase-tanstack-start-security-review/references/authentication.md +353 -0
- package/skills/raybase-tanstack-start-security-review/references/authorization.md +372 -0
- package/skills/raybase-tanstack-start-security-review/references/business-logic.md +443 -0
- package/skills/raybase-tanstack-start-security-review/references/cryptography.md +329 -0
- package/skills/raybase-tanstack-start-security-review/references/csrf.md +398 -0
- package/skills/raybase-tanstack-start-security-review/references/data-protection.md +378 -0
- package/skills/raybase-tanstack-start-security-review/references/deserialization.md +410 -0
- package/skills/raybase-tanstack-start-security-review/references/error-handling.md +436 -0
- package/skills/raybase-tanstack-start-security-review/references/file-security.md +457 -0
- package/skills/raybase-tanstack-start-security-review/references/injection.md +259 -0
- package/skills/raybase-tanstack-start-security-review/references/logging.md +433 -0
- package/skills/raybase-tanstack-start-security-review/references/misconfiguration.md +435 -0
- package/skills/raybase-tanstack-start-security-review/references/modern-threats.md +475 -0
- package/skills/raybase-tanstack-start-security-review/references/raybase-tanstack-security.md +208 -0
- package/skills/raybase-tanstack-start-security-review/references/ssrf.md +413 -0
- package/skills/raybase-tanstack-start-security-review/references/supply-chain.md +405 -0
- package/skills/raybase-tanstack-start-security-review/references/xss.md +336 -0
- package/skills-manifest.json +41 -0
- package/templates/astro-emdash/.dev.vars.example +7 -0
- package/templates/astro-emdash/AGENTS.md +122 -0
- package/templates/astro-emdash/DESIGN.md +90 -0
- package/templates/astro-emdash/components.json +21 -0
- package/templates/astro-emdash/content/docs/getting-started.mdx +20 -0
- package/templates/astro-emdash/content/docs/index.mdx +13 -0
- package/templates/astro-emdash/content/docs/mcp.mdx +11 -0
- package/templates/astro-emdash/content/docs/meta.json +4 -0
- package/templates/astro-emdash/content/docs/site-templates.mdx +62 -0
- package/templates/astro-emdash/dev/CODEBASE-MAP.md +46 -0
- package/templates/astro-emdash/dev/SPEC-OVERVIEW.md +15 -0
- package/templates/astro-emdash/dev/SPEC.md +84 -0
- package/templates/astro-emdash/dev/features/archive/.gitkeep +1 -0
- package/templates/astro-emdash/docs/theme-previews/base.svg +24 -0
- package/templates/astro-emdash/docs/theme-previews/steel.svg +24 -0
- package/templates/astro-emdash/docs/theme-previews/zen.svg +24 -0
- package/templates/astro-emdash/docs/themes.md +106 -0
- package/templates/astro-emdash/drizzle.config.ts +5 -0
- package/templates/astro-emdash/gitignore +11 -0
- package/templates/astro-emdash/migrations/app/meta/_journal.json +5 -0
- package/templates/astro-emdash/package.json +79 -0
- package/templates/astro-emdash/pnpm-workspace.yaml +71 -0
- package/templates/astro-emdash/public/_headers +4 -0
- package/templates/astro-emdash/site/astro.config.mjs +120 -0
- package/templates/astro-emdash/site/demo/README.md +72 -0
- package/templates/astro-emdash/site/demo/content/collection.json +43 -0
- package/templates/astro-emdash/site/demo/content/entries.json +120 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-card/manifest.json +51 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-card/sample-content.json +5 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-card/template.liquid +48 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/host.json +9 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/manifest.json +38 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/sample-content.json +34 -0
- package/templates/astro-emdash/site/demo/templates/demo-article-page/template.liquid +84 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/manifest.json +64 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/page.json +7 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/sample-content.json +24 -0
- package/templates/astro-emdash/site/demo/templates/demo-articles-index/template.liquid +100 -0
- package/templates/astro-emdash/site/demo/templates/demo-menu-nav/manifest.json +51 -0
- package/templates/astro-emdash/site/demo/templates/demo-menu-nav/sample-content.json +5 -0
- package/templates/astro-emdash/site/demo/templates/demo-menu-nav/template.liquid +70 -0
- package/templates/astro-emdash/site/gitignore +1 -0
- package/templates/astro-emdash/site/package.json +56 -0
- package/templates/astro-emdash/site/scripts/apply-site-templates.mjs +560 -0
- package/templates/astro-emdash/site/scripts/galley-demo.mjs +298 -0
- package/templates/astro-emdash/site/scripts/seed-galley-starter.mjs +360 -0
- package/templates/astro-emdash/site/scripts/site-origin.mjs +45 -0
- package/templates/astro-emdash/site/seed/seed.json +154 -0
- package/templates/astro-emdash/site/seed/templates/.gitkeep +1 -0
- package/templates/astro-emdash/site/src/components/RaybaseSignedInMenu.astro +163 -0
- package/templates/astro-emdash/site/src/components/blocks/RaybaseActionIsland.astro +41 -0
- package/templates/astro-emdash/site/src/content-door/raybase-routes.ts +738 -0
- package/templates/astro-emdash/site/src/content-door/resolve-page.ts +142 -0
- package/templates/astro-emdash/site/src/content-door/seed.ts +85 -0
- package/templates/astro-emdash/site/src/env.d.ts +12 -0
- package/templates/astro-emdash/site/src/layouts/SiteLayout.astro +68 -0
- package/templates/astro-emdash/site/src/lib/palettes.gen.ts +7 -0
- package/templates/astro-emdash/site/src/lib/site-motion.ts +169 -0
- package/templates/astro-emdash/site/src/lib/site-shell.ts +294 -0
- package/templates/astro-emdash/site/src/live.config.ts +8 -0
- package/templates/astro-emdash/site/src/middleware.ts +20 -0
- package/templates/astro-emdash/site/src/pages/[...slug].astro +113 -0
- package/templates/astro-emdash/site/src/pages/_raybase/handoff/consume.ts +6 -0
- package/templates/astro-emdash/site/src/pages/_raybase/islands/action.ts +8 -0
- package/templates/astro-emdash/site/src/pages/_raybase/sign-out/index.ts +6 -0
- package/templates/astro-emdash/site/src/styles/palette-fonts.gen.css +1 -0
- package/templates/astro-emdash/site/src/styles/palettes.gen.css +3 -0
- package/templates/astro-emdash/site/src/styles.css +607 -0
- package/templates/astro-emdash/site/tsconfig.json +12 -0
- package/templates/astro-emdash/site/wrangler.jsonc +34 -0
- package/templates/astro-emdash/source.config.ts +10 -0
- package/templates/astro-emdash/src/actions.ts +58 -0
- package/templates/astro-emdash/src/ai/agents.ts +20 -0
- package/templates/astro-emdash/src/ai/retrieval.ts +36 -0
- package/templates/astro-emdash/src/auth-door.ts +18 -0
- package/templates/astro-emdash/src/client.tsx +25 -0
- package/templates/astro-emdash/src/components/.gitkeep +1 -0
- package/templates/astro-emdash/src/components/account-menu.tsx +91 -0
- package/templates/astro-emdash/src/components/auth-shell.tsx +69 -0
- package/templates/astro-emdash/src/components/mode-toggle.tsx +32 -0
- package/templates/astro-emdash/src/components/search-command-palette.tsx +107 -0
- package/templates/astro-emdash/src/components/setup-token-page.tsx +196 -0
- package/templates/astro-emdash/src/components/ui/avatar.tsx +107 -0
- package/templates/astro-emdash/src/components/ui/badge.tsx +52 -0
- package/templates/astro-emdash/src/components/ui/button.tsx +69 -0
- package/templates/astro-emdash/src/components/ui/checkbox.tsx +29 -0
- package/templates/astro-emdash/src/components/ui/dialog.tsx +158 -0
- package/templates/astro-emdash/src/components/ui/dropdown-menu.tsx +303 -0
- package/templates/astro-emdash/src/components/ui/input.tsx +20 -0
- package/templates/astro-emdash/src/components/ui/label.tsx +20 -0
- package/templates/astro-emdash/src/components/ui/scroll-area.tsx +53 -0
- package/templates/astro-emdash/src/components/ui/select.tsx +215 -0
- package/templates/astro-emdash/src/components/ui/separator.tsx +23 -0
- package/templates/astro-emdash/src/components/ui/sheet.tsx +138 -0
- package/templates/astro-emdash/src/components/ui/sidebar.tsx +728 -0
- package/templates/astro-emdash/src/components/ui/skeleton.tsx +13 -0
- package/templates/astro-emdash/src/components/ui/textarea.tsx +18 -0
- package/templates/astro-emdash/src/components/ui/tooltip.tsx +66 -0
- package/templates/astro-emdash/src/db/migrations.gen.ts +6 -0
- package/templates/astro-emdash/src/db/schema.ts +6 -0
- package/templates/astro-emdash/src/db/seed.ts +16 -0
- package/templates/astro-emdash/src/db/storage.ts +32 -0
- package/templates/astro-emdash/src/docs/docs-assets.ts +1 -0
- package/templates/astro-emdash/src/docs/docs-client.tsx +22 -0
- package/templates/astro-emdash/src/docs/docs-data.ts +24 -0
- package/templates/astro-emdash/src/docs/docs-handler.tsx +105 -0
- package/templates/astro-emdash/src/docs/docs-layout.tsx +56 -0
- package/templates/astro-emdash/src/docs/docs-mdx.tsx +79 -0
- package/templates/astro-emdash/src/docs/docs-page-actions.tsx +146 -0
- package/templates/astro-emdash/src/docs/docs-page.tsx +70 -0
- package/templates/astro-emdash/src/docs/llm-text.ts +61 -0
- package/templates/astro-emdash/src/docs/source.ts +7 -0
- package/templates/astro-emdash/src/guide/corpus.gen.ts +4 -0
- package/templates/astro-emdash/src/guide/corpus.manifest.json +72 -0
- package/templates/astro-emdash/src/hooks/use-mobile.ts +19 -0
- package/templates/astro-emdash/src/jobs.example.ts +48 -0
- package/templates/astro-emdash/src/lib/account.ts +12 -0
- package/templates/astro-emdash/src/lib/auth-client.ts +181 -0
- package/templates/astro-emdash/src/lib/utils.ts +6 -0
- package/templates/astro-emdash/src/mcp-app.ts +57 -0
- package/templates/astro-emdash/src/notifications.example.ts +37 -0
- package/templates/astro-emdash/src/raybase.auth.ts +70 -0
- package/templates/astro-emdash/src/raybase.config.ts +49 -0
- package/templates/astro-emdash/src/raybase.server.ts +56 -0
- package/templates/astro-emdash/src/realtime.example.ts +18 -0
- package/templates/astro-emdash/src/router.tsx +19 -0
- package/templates/astro-emdash/src/routes/__root.tsx +56 -0
- package/templates/astro-emdash/src/routes/_app/admin.tsx +13 -0
- package/templates/astro-emdash/src/routes/_app/forgot-password.tsx +97 -0
- package/templates/astro-emdash/src/routes/_app/index.tsx +169 -0
- package/templates/astro-emdash/src/routes/_app/invite.$token.tsx +11 -0
- package/templates/astro-emdash/src/routes/_app/login.tsx +193 -0
- package/templates/astro-emdash/src/routes/_app/profile.tsx +98 -0
- package/templates/astro-emdash/src/routes/_app/reset-password.$token.tsx +15 -0
- package/templates/astro-emdash/src/routes/_app/reset-password.tsx +115 -0
- package/templates/astro-emdash/src/routes/_app/setup.$token.tsx +11 -0
- package/templates/astro-emdash/src/routes/_app/signup.tsx +141 -0
- package/templates/astro-emdash/src/routes/_app/verify-email.$token.tsx +15 -0
- package/templates/astro-emdash/src/routes/_app/verify-email.tsx +154 -0
- package/templates/astro-emdash/src/routes/_app.tsx +33 -0
- package/templates/astro-emdash/src/routes/admin/$.ts +20 -0
- package/templates/astro-emdash/src/routes/api/$.ts +19 -0
- package/templates/astro-emdash/src/routes/docs/$.tsx +22 -0
- package/templates/astro-emdash/src/routes/docs/api/markdown.ts +12 -0
- package/templates/astro-emdash/src/routes/docs/api/search.ts +12 -0
- package/templates/astro-emdash/src/routes/docs.index.tsx +22 -0
- package/templates/astro-emdash/src/routes/docs.tsx +22 -0
- package/templates/astro-emdash/src/search.ts +6 -0
- package/templates/astro-emdash/src/settings.ts +12 -0
- package/templates/astro-emdash/src/styles-docs.css +3 -0
- package/templates/astro-emdash/src/styles.css +101 -0
- package/templates/astro-emdash/src/themes/base.css +76 -0
- package/templates/astro-emdash/src/themes/carbon.css +76 -0
- package/templates/astro-emdash/src/themes/fonts.css +25 -0
- package/templates/astro-emdash/src/themes/sage.css +76 -0
- package/templates/astro-emdash/src/themes/sand.css +76 -0
- package/templates/astro-emdash/src/themes/slate.css +81 -0
- package/templates/astro-emdash/src/themes/ultra.css +76 -0
- package/templates/astro-emdash/src/themes/zen.css +76 -0
- package/templates/astro-emdash/src/worker-entry.ts +31 -0
- package/templates/astro-emdash/tests/raybase-patterns.test.ts +29 -0
- package/templates/astro-emdash/tsconfig.json +36 -0
- package/templates/astro-emdash/vite.config.ts +130 -0
- package/templates/astro-emdash/vitest.config.ts +8 -0
- package/templates/astro-emdash/wrangler.jsonc +112 -0
- package/templates/react-router/.dev.vars.example +5 -0
- package/templates/react-router/.editorconfig +15 -0
- package/templates/react-router/AGENTS.md +54 -0
- package/templates/react-router/README.md +52 -0
- package/templates/react-router/app/app.css +44 -0
- package/templates/react-router/app/components/mdx.tsx +79 -0
- package/templates/react-router/app/components/ui/button.tsx +45 -0
- package/templates/react-router/app/components/ui/card.tsx +87 -0
- package/templates/react-router/app/components/ui/separator.tsx +22 -0
- package/templates/react-router/app/db/migrations.gen.ts +6 -0
- package/templates/react-router/app/db/schema.ts +56 -0
- package/templates/react-router/app/db/seed.ts +14 -0
- package/templates/react-router/app/entry.server.tsx +41 -0
- package/templates/react-router/app/globals.d.ts +1 -0
- package/templates/react-router/app/lib/layout.shared.tsx +52 -0
- package/templates/react-router/app/lib/source.ts +7 -0
- package/templates/react-router/app/lib/utils.ts +6 -0
- package/templates/react-router/app/raybase.server.ts +65 -0
- package/templates/react-router/app/root.tsx +23 -0
- package/templates/react-router/app/routes/_index.tsx +53 -0
- package/templates/react-router/app/routes/docs.$.tsx +49 -0
- package/templates/react-router/app/routes/docs.api.search.ts +10 -0
- package/templates/react-router/app/routes/docs.tsx +13 -0
- package/templates/react-router/app/routes.ts +3 -0
- package/templates/react-router/components.json +22 -0
- package/templates/react-router/content/docs/getting-started.mdx +15 -0
- package/templates/react-router/content/docs/index.mdx +8 -0
- package/templates/react-router/content/docs/mcp.mdx +121 -0
- package/templates/react-router/content/docs/meta.json +4 -0
- package/templates/react-router/dev/CODEBASE-MAP.md +48 -0
- package/templates/react-router/dev/SPEC-OVERVIEW.md +35 -0
- package/templates/react-router/dev/SPEC.md +93 -0
- package/templates/react-router/dev/features/archive/.gitkeep +1 -0
- package/templates/react-router/drizzle.config.ts +5 -0
- package/templates/react-router/env.d.ts +53 -0
- package/templates/react-router/gitignore +23 -0
- package/templates/react-router/migrations/app/meta/_journal.json +1 -0
- package/templates/react-router/package.json +70 -0
- package/templates/react-router/public/_headers +4 -0
- package/templates/react-router/public/favicon.ico +0 -0
- package/templates/react-router/react-router.config.ts +9 -0
- package/templates/react-router/source.config.ts +5 -0
- package/templates/react-router/tests/raybase-patterns.test.ts +23 -0
- package/templates/react-router/tsconfig.json +27 -0
- package/templates/react-router/vite.config.ts +59 -0
- package/templates/react-router/vitest.config.ts +8 -0
- package/templates/react-router/workers/app.ts +40 -0
- package/templates/react-router/wrangler.jsonc +111 -0
- package/templates/tanstack-start/.dev.vars.example +5 -0
- package/templates/tanstack-start/AGENTS.md +95 -0
- package/templates/tanstack-start/DESIGN.md +65 -0
- package/templates/tanstack-start/components.json +21 -0
- package/templates/tanstack-start/content/docs/getting-started.mdx +65 -0
- package/templates/tanstack-start/content/docs/index.mdx +10 -0
- package/templates/tanstack-start/content/docs/mcp.mdx +122 -0
- package/templates/tanstack-start/content/docs/meta.json +4 -0
- package/templates/tanstack-start/dev/CODEBASE-MAP.md +84 -0
- package/templates/tanstack-start/dev/SPEC-OVERVIEW.md +46 -0
- package/templates/tanstack-start/dev/SPEC.md +213 -0
- package/templates/tanstack-start/dev/features/archive/.gitkeep +1 -0
- package/templates/tanstack-start/docs/theme-previews/base.svg +24 -0
- package/templates/tanstack-start/docs/theme-previews/steel.svg +24 -0
- package/templates/tanstack-start/docs/theme-previews/zen.svg +24 -0
- package/templates/tanstack-start/docs/themes.md +116 -0
- package/templates/tanstack-start/drizzle.config.ts +5 -0
- package/templates/tanstack-start/gitignore +11 -0
- package/templates/tanstack-start/migrations/app/0000_low_karen_page.sql +26 -0
- package/templates/tanstack-start/migrations/app/meta/0000_snapshot.json +196 -0
- package/templates/tanstack-start/migrations/app/meta/_journal.json +13 -0
- package/templates/tanstack-start/package.json +77 -0
- package/templates/tanstack-start/public/_headers +8 -0
- package/templates/tanstack-start/public/icons/app-icon-maskable.svg +1 -0
- package/templates/tanstack-start/public/icons/app-icon.svg +1 -0
- package/templates/tanstack-start/public/icons/apple-touch-icon.png +0 -0
- package/templates/tanstack-start/public/manifest.webmanifest +14 -0
- package/templates/tanstack-start/public/raybase-push-sw.js +32 -0
- package/templates/tanstack-start/source.config.ts +10 -0
- package/templates/tanstack-start/src/actions.ts +560 -0
- package/templates/tanstack-start/src/ai/agents.ts +78 -0
- package/templates/tanstack-start/src/ai/retrieval.ts +36 -0
- package/templates/tanstack-start/src/auth-door.ts +18 -0
- package/templates/tanstack-start/src/client.tsx +25 -0
- package/templates/tanstack-start/src/components/.gitkeep +1 -0
- package/templates/tanstack-start/src/components/account-menu.tsx +127 -0
- package/templates/tanstack-start/src/components/auth-shell.tsx +69 -0
- package/templates/tanstack-start/src/components/install-app.tsx +35 -0
- package/templates/tanstack-start/src/components/mode-toggle.tsx +32 -0
- package/templates/tanstack-start/src/components/search-command-palette.tsx +107 -0
- package/templates/tanstack-start/src/components/setup-token-page.tsx +197 -0
- package/templates/tanstack-start/src/components/ui/avatar.tsx +107 -0
- package/templates/tanstack-start/src/components/ui/badge.tsx +52 -0
- package/templates/tanstack-start/src/components/ui/button.tsx +69 -0
- package/templates/tanstack-start/src/components/ui/checkbox.tsx +29 -0
- package/templates/tanstack-start/src/components/ui/dialog.tsx +158 -0
- package/templates/tanstack-start/src/components/ui/dropdown-menu.tsx +303 -0
- package/templates/tanstack-start/src/components/ui/input.tsx +20 -0
- package/templates/tanstack-start/src/components/ui/label.tsx +20 -0
- package/templates/tanstack-start/src/components/ui/scroll-area.tsx +53 -0
- package/templates/tanstack-start/src/components/ui/select.tsx +215 -0
- package/templates/tanstack-start/src/components/ui/separator.tsx +23 -0
- package/templates/tanstack-start/src/components/ui/sheet.tsx +138 -0
- package/templates/tanstack-start/src/components/ui/sidebar.tsx +728 -0
- package/templates/tanstack-start/src/components/ui/skeleton.tsx +13 -0
- package/templates/tanstack-start/src/components/ui/textarea.tsx +18 -0
- package/templates/tanstack-start/src/components/ui/tooltip.tsx +66 -0
- package/templates/tanstack-start/src/db/migrations.gen.ts +6 -0
- package/templates/tanstack-start/src/db/schema.ts +90 -0
- package/templates/tanstack-start/src/db/seed.ts +106 -0
- package/templates/tanstack-start/src/db/storage.ts +32 -0
- package/templates/tanstack-start/src/docs/docs-assets.ts +1 -0
- package/templates/tanstack-start/src/docs/docs-client.tsx +22 -0
- package/templates/tanstack-start/src/docs/docs-data.ts +24 -0
- package/templates/tanstack-start/src/docs/docs-handler.tsx +105 -0
- package/templates/tanstack-start/src/docs/docs-layout.tsx +56 -0
- package/templates/tanstack-start/src/docs/docs-mdx.tsx +79 -0
- package/templates/tanstack-start/src/docs/docs-page-actions.tsx +146 -0
- package/templates/tanstack-start/src/docs/docs-page.tsx +70 -0
- package/templates/tanstack-start/src/docs/llm-text.ts +61 -0
- package/templates/tanstack-start/src/docs/source.ts +7 -0
- package/templates/tanstack-start/src/hooks/use-mobile.ts +19 -0
- package/templates/tanstack-start/src/hooks/use-pwa-install.ts +77 -0
- package/templates/tanstack-start/src/jobs.example.ts +56 -0
- package/templates/tanstack-start/src/lib/account.ts +13 -0
- package/templates/tanstack-start/src/lib/auth-client.ts +187 -0
- package/templates/tanstack-start/src/lib/push-client.ts +98 -0
- package/templates/tanstack-start/src/lib/utils.ts +6 -0
- package/templates/tanstack-start/src/mcp-app.ts +74 -0
- package/templates/tanstack-start/src/notifications.example.ts +37 -0
- package/templates/tanstack-start/src/raybase.auth.ts +86 -0
- package/templates/tanstack-start/src/raybase.config.ts +86 -0
- package/templates/tanstack-start/src/raybase.server.ts +155 -0
- package/templates/tanstack-start/src/realtime.example.ts +46 -0
- package/templates/tanstack-start/src/router.tsx +19 -0
- package/templates/tanstack-start/src/routes/__root.tsx +73 -0
- package/templates/tanstack-start/src/routes/_app/admin.tsx +13 -0
- package/templates/tanstack-start/src/routes/_app/forgot-password.tsx +97 -0
- package/templates/tanstack-start/src/routes/_app/index.tsx +1316 -0
- package/templates/tanstack-start/src/routes/_app/invite.$token.tsx +11 -0
- package/templates/tanstack-start/src/routes/_app/login.tsx +193 -0
- package/templates/tanstack-start/src/routes/_app/profile.tsx +98 -0
- package/templates/tanstack-start/src/routes/_app/reset-password.$token.tsx +16 -0
- package/templates/tanstack-start/src/routes/_app/reset-password.tsx +115 -0
- package/templates/tanstack-start/src/routes/_app/setup.$token.tsx +11 -0
- package/templates/tanstack-start/src/routes/_app/signup.tsx +141 -0
- package/templates/tanstack-start/src/routes/_app/verify-email.$token.tsx +15 -0
- package/templates/tanstack-start/src/routes/_app/verify-email.tsx +154 -0
- package/templates/tanstack-start/src/routes/_app.tsx +33 -0
- package/templates/tanstack-start/src/routes/admin/$.ts +20 -0
- package/templates/tanstack-start/src/routes/api/$.ts +19 -0
- package/templates/tanstack-start/src/routes/docs/$.tsx +22 -0
- package/templates/tanstack-start/src/routes/docs/api/markdown.ts +12 -0
- package/templates/tanstack-start/src/routes/docs/api/search.ts +12 -0
- package/templates/tanstack-start/src/routes/docs.index.tsx +22 -0
- package/templates/tanstack-start/src/routes/docs.tsx +22 -0
- package/templates/tanstack-start/src/search.ts +26 -0
- package/templates/tanstack-start/src/settings.ts +12 -0
- package/templates/tanstack-start/src/styles-docs.css +3 -0
- package/templates/tanstack-start/src/styles.css +73 -0
- package/templates/tanstack-start/src/themes/base.css +76 -0
- package/templates/tanstack-start/src/themes/carbon.css +76 -0
- package/templates/tanstack-start/src/themes/fonts.css +18 -0
- package/templates/tanstack-start/src/themes/sage.css +76 -0
- package/templates/tanstack-start/src/themes/sand.css +76 -0
- package/templates/tanstack-start/src/themes/slate.css +76 -0
- package/templates/tanstack-start/src/themes/ultra.css +76 -0
- package/templates/tanstack-start/src/themes/zen.css +76 -0
- package/templates/tanstack-start/src/worker-entry.ts +30 -0
- package/templates/tanstack-start/tests/raybase-patterns.test.ts +247 -0
- package/templates/tanstack-start/tsconfig.json +33 -0
- package/templates/tanstack-start/vite.config.ts +132 -0
- package/templates/tanstack-start/vitest.config.ts +8 -0
- package/templates/tanstack-start/wrangler.jsonc +112 -0
- package/README.md +0 -3
package/package.json
CHANGED
|
@@ -1,16 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@raybase/create",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"license": "
|
|
3
|
+
"version": "0.3.3",
|
|
4
|
+
"description": "Scaffold secure internal apps powered by Raybase.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"bin": {
|
|
10
|
+
"create-raybase": "./dist/index.js"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"assets",
|
|
15
|
+
"templates",
|
|
16
|
+
"modules",
|
|
17
|
+
"models",
|
|
18
|
+
"skills",
|
|
19
|
+
"skills-manifest.json",
|
|
20
|
+
"THIRD_PARTY_NOTICES.md"
|
|
21
|
+
],
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"commander": "^14.0.2",
|
|
24
|
+
"jsonc-parser": "^3.3.1"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^22.15.29",
|
|
28
|
+
"typescript": "^5.8.3"
|
|
29
|
+
},
|
|
6
30
|
"repository": {
|
|
7
31
|
"type": "git",
|
|
8
|
-
"url": "git+https://github.com/raybasedev/raybase.git"
|
|
32
|
+
"url": "git+https://github.com/raybasedev/raybase.git",
|
|
33
|
+
"directory": "packages/create-raybase"
|
|
9
34
|
},
|
|
10
35
|
"publishConfig": {
|
|
11
36
|
"access": "public"
|
|
12
37
|
},
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
}
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc -p tsconfig.json && node scripts/stamp-source-hash.mjs",
|
|
40
|
+
"check": "tsc -p tsconfig.json --noEmit"
|
|
41
|
+
}
|
|
42
|
+
}
|
package/skills/README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# Raybase Skills
|
|
2
|
+
|
|
3
|
+
Each skill lives in a folder named after its SKILL.md frontmatter `name`
|
|
4
|
+
(flat layout; reference material may nest inside a skill's folder).
|
|
5
|
+
|
|
6
|
+
## Authoring Convention
|
|
7
|
+
|
|
8
|
+
Raybase skills are operating instructions, not essays. For consequential
|
|
9
|
+
rules, explain only enough intent for an agent to make a better choice: why the
|
|
10
|
+
order exists, what failure mode it prevents, when deviation is valid, and which
|
|
11
|
+
surface verifies the result. `Invariant:` and `Default:` labels are useful when
|
|
12
|
+
they clarify rule weight, but they are optional tools rather than required
|
|
13
|
+
ceremony. Keep deterministic enforcement in the CLI, doctor, runtime, tests, or
|
|
14
|
+
security review; skill prose should explain sequence and judgment.
|
|
15
|
+
|
|
16
|
+
Agent plugin skills:
|
|
17
|
+
|
|
18
|
+
- `raybase`: install/update/repair Raybase, interview before scaffolding, choose
|
|
19
|
+
a framework or starter, scaffold, and hand off to project skills
|
|
20
|
+
- `raybase-schema`: schema and policy guidance before a project skill exists
|
|
21
|
+
- `raybase-deploy`: deploy and operate Raybase apps; this same skill is also
|
|
22
|
+
installed into generated projects
|
|
23
|
+
|
|
24
|
+
Project skills (installed into `.agents/skills` by the scaffolder and symlinked
|
|
25
|
+
into `.claude/skills` for Claude Code):
|
|
26
|
+
|
|
27
|
+
- `raybase-building`: generic first implementation sequence through local app;
|
|
28
|
+
pair with the installed framework skill for framework-specific paths and
|
|
29
|
+
checks
|
|
30
|
+
- `raybase-auth`: closed signup, owner setup, manual invite links, paid
|
|
31
|
+
transactional auth email, password reset, optional magic links, and
|
|
32
|
+
Cloudflare Email Service checks
|
|
33
|
+
- `raybase-data-and-policies`: schema and permission modeling
|
|
34
|
+
- `raybase-actions`: portable business mutations and adapters for UI, MCP,
|
|
35
|
+
jobs, Guide, Agents, and API
|
|
36
|
+
- `raybase-background-jobs`: durable async work, queues, schedules, retries,
|
|
37
|
+
idempotency, and Jobs admin verification
|
|
38
|
+
- `raybase-notifications`: notification feed, outbound/inbound adapters,
|
|
39
|
+
delivery evidence, and notification-related job wiring
|
|
40
|
+
- `raybase-deploy`: Cloudflare deploy flow
|
|
41
|
+
- `raybase-changing-a-live-app`: safe changes after launch
|
|
42
|
+
- `raybase-mcp`: App MCP, Operator MCP, and MCP Apps UI resources/tools
|
|
43
|
+
- `raybase-search`: SQL FTS search indexes, table/corpus sources, and search
|
|
44
|
+
CLI/client use
|
|
45
|
+
- `raybase-realtime`: table subscriptions, live lists, presence, and
|
|
46
|
+
notification feed updates
|
|
47
|
+
- `raybase-settings`: runtime setting declarations, admin overrides, and safe
|
|
48
|
+
settings boundaries
|
|
49
|
+
- `raybase-ai`: Raybase AI helpers, budgets, audit, Gateway metadata, and
|
|
50
|
+
safe model/action usage
|
|
51
|
+
- `raybase-docs-writing`: required Fumadocs documentation deliverable in
|
|
52
|
+
`content/docs` for generated apps where `raybase.modules.docs.enabled` is true
|
|
53
|
+
- `raybase-guide`: Guide Agent capability context, corpus, support capture, and
|
|
54
|
+
indexing guidance when `raybase.modules.guide.enabled` is true
|
|
55
|
+
- `raybase-astro-emdash-galley`: Galley runtime page-section authoring for
|
|
56
|
+
Astro/EmDash apps: Liquid templates, Portable Text Galley blocks, shared
|
|
57
|
+
blocks, designed fields, and runtime edit context
|
|
58
|
+
- Generated apps also include agent-facing planning docs in
|
|
59
|
+
`dev/SPEC-OVERVIEW.md`, `dev/CODEBASE-MAP.md`, and temporary
|
|
60
|
+
`dev/features/<feature-slug>/` folders. These are maintained by judgment
|
|
61
|
+
during substantial product or architecture changes, not by `raybase doctor`.
|
|
62
|
+
|
|
63
|
+
Raybase Kits are discovered with `raybase kits list/search/info` and installed
|
|
64
|
+
with `raybase add <kit-id>`. Kits copy source into the app and are tracked in
|
|
65
|
+
`.raybase/kits.json`; they are not agent host plugins.
|
|
66
|
+
|
|
67
|
+
Which skills a project gets depends on its framework
|
|
68
|
+
(`packages/create-raybase/skills-manifest.json`). A project created from an
|
|
69
|
+
outside starter also gets the skills that starter brings (its
|
|
70
|
+
`raybase.starter.json` `skills`), installed beside Raybase's in
|
|
71
|
+
`.agents/skills` and recorded in `.raybase/starter.json` rather than
|
|
72
|
+
`.raybase/skills.json`, so `raybase skills sync` neither refreshes nor
|
|
73
|
+
prunes them.
|
|
74
|
+
|
|
75
|
+
TanStack Start framework additionally gets:
|
|
76
|
+
|
|
77
|
+
- `raybase-tanstack-start`: TanStack Start file layout, React route patterns,
|
|
78
|
+
server functions, Worker entry, local dev loop, and template verification
|
|
79
|
+
- `raybase-tanstack-start-design`: app UI design — typography, color, layout,
|
|
80
|
+
motion, interaction, copy, delight, polish (adapted from Impeccable Design,
|
|
81
|
+
https://impeccable.style/, Apache-2.0).
|
|
82
|
+
- `raybase-tanstack-start-security-review`: high-confidence security review
|
|
83
|
+
for TanStack Start internal apps, adapted from Sentry's security-review skill
|
|
84
|
+
and narrowed to Raybase/TanStack boundaries.
|
|
85
|
+
|
|
86
|
+
Astro/EmDash framework additionally gets:
|
|
87
|
+
|
|
88
|
+
- `raybase-astro-emdash`: Raybase spine plus nested Astro/EmDash content-site
|
|
89
|
+
architecture, the CMS handoff, and public Server Island boundaries
|
|
90
|
+
- `raybase-astro-emdash-content-model`: site plan (page inventory, nav/footer
|
|
91
|
+
links) plus EmDash collections, template bindings, and seed content,
|
|
92
|
+
planned together before theme selection
|
|
93
|
+
- `raybase-astro-emdash-migration`: browser-only existing-site inventory,
|
|
94
|
+
owner-approved IA and URL mapping, media harvest, and content conversion
|
|
95
|
+
guidance before content modeling
|
|
96
|
+
- `raybase-astro-emdash-galley`: runtime-editable public content sections
|
|
97
|
+
through Galley templates and Portable Text blocks
|
|
98
|
+
- `raybase-astro-emdash-theme-selection`: registry theme search, explicit
|
|
99
|
+
layout/nav/footer/color/page-starter choices, staging, activation, and
|
|
100
|
+
verification for full-site assembly
|
|
101
|
+
- `raybase-astro-emdash-design`: public-site design to a brand-register bar —
|
|
102
|
+
design direction from the spec (before or alongside theme selection),
|
|
103
|
+
theme-constrained craft under the shadcn-semantic-v1 token contract, with
|
|
104
|
+
reference depth for typography, color, layout, imagery, motion, copy, and
|
|
105
|
+
polish; DESIGN.md as the durable design memory, plus public site / Raybase
|
|
106
|
+
spine guardrails (adapted from Impeccable Design,
|
|
107
|
+
https://impeccable.style/, Apache-2.0)
|
|
108
|
+
- `raybase-astro-emdash-security-review`: handoff token signing, JWKS, EmDash
|
|
109
|
+
auth, cookies, Server Island proxying, and deployment-secret review
|
|
110
|
+
|
|
111
|
+
React Router framework additionally gets:
|
|
112
|
+
|
|
113
|
+
- `raybase-react-router`: React Router file layout (`app/` + `workers/app.ts`),
|
|
114
|
+
how the Worker sends Raybase-owned paths to Raybase ahead of the router,
|
|
115
|
+
loaders and actions that check `currentUser()`, local dev loop, and
|
|
116
|
+
framework verification
|
|
117
|
+
- `raybase-react-router-design`: app UI design for the starter's Tailwind UI
|
|
118
|
+
kit — typography, color, layout, motion, interaction, copy, delight, polish
|
|
119
|
+
(adapted from Impeccable Design, https://impeccable.style/, Apache-2.0)
|
|
120
|
+
- `raybase-react-router-security-review`: high-confidence security review for
|
|
121
|
+
React Router apps, adapted from Sentry's security-review skill and narrowed
|
|
122
|
+
to Raybase/React Router boundaries.
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: raybase-actions
|
|
3
|
+
description: Define portable Raybase business actions and adapt them safely to UI, HTTP, MCP, jobs, Guide, Agents, and the optional API.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Raybase Actions
|
|
7
|
+
|
|
8
|
+
Use this skill when adding a business mutation or workflow that more than one
|
|
9
|
+
surface may need: app UI, HTTP/server functions, MCP, background jobs, Guide,
|
|
10
|
+
generic Raybase Agents, or the optional external API.
|
|
11
|
+
|
|
12
|
+
Actions are the canonical place for shared business behavior. Prefer
|
|
13
|
+
`defineAction()` over raw CRUD, a bare route handler, a direct MCP handler, or a
|
|
14
|
+
direct job handler when the code changes business state, validates a state
|
|
15
|
+
transition, emits side effects, or should be reused by models and humans.
|
|
16
|
+
|
|
17
|
+
Raw table CRUD is fine for simple owner-approved record editing. A direct MCP
|
|
18
|
+
tool is fine for read-only snapshots, UI resources, and introspection helpers.
|
|
19
|
+
A direct `defineJob()` is fine for background-only operational work such as
|
|
20
|
+
syncs, digests, cleanup, imports, external delivery, and backup checks.
|
|
21
|
+
|
|
22
|
+
## Define Actions
|
|
23
|
+
|
|
24
|
+
Use `handler(ctx, input)`. Keep validation, policy, idempotency, and side-effect
|
|
25
|
+
metadata close to the handler.
|
|
26
|
+
|
|
27
|
+
```ts
|
|
28
|
+
import { actionError, defineAction, defineActions, role, rowAuthorization } from "@raybase/core";
|
|
29
|
+
import type { RaybaseEnv } from "@raybase/core/worker";
|
|
30
|
+
import { z } from "zod";
|
|
31
|
+
import type { schema } from "../db/schema";
|
|
32
|
+
import { appRoles } from "../raybase.config";
|
|
33
|
+
|
|
34
|
+
export const requestUpdateRow = rowAuthorization({
|
|
35
|
+
table: "requests",
|
|
36
|
+
action: "update",
|
|
37
|
+
id: (input: { id: string }) => input.id
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const actions = defineActions<RaybaseEnv, typeof schema>({
|
|
41
|
+
approveRequest: defineAction({
|
|
42
|
+
name: "requests.approve",
|
|
43
|
+
description: "Approve a pending request as an operations user.",
|
|
44
|
+
input: z.object({
|
|
45
|
+
id: z.string().min(1),
|
|
46
|
+
note: z.string().max(500).optional()
|
|
47
|
+
}),
|
|
48
|
+
output: z.object({
|
|
49
|
+
id: z.string(),
|
|
50
|
+
status: z.literal("approved")
|
|
51
|
+
}).passthrough(),
|
|
52
|
+
policy: role(appRoles, "operations"),
|
|
53
|
+
idempotencyKey: (input) => `requests.approve:${input.id}`,
|
|
54
|
+
annotations: {
|
|
55
|
+
title: "Approve request",
|
|
56
|
+
idempotentHint: true
|
|
57
|
+
},
|
|
58
|
+
effects: ["updates requests.status", "records approval note"],
|
|
59
|
+
handler: async ({ db }, input) => {
|
|
60
|
+
const request = await db.get("requests", input.id);
|
|
61
|
+
if (request.status !== "pending") throw actionError("Only pending requests can be approved.", { code: "invalid_state", retryable: false });
|
|
62
|
+
return db.update("requests", input.id, { status: "approved", approvalNote: input.note ?? null });
|
|
63
|
+
}
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Deeper define-time patterns, with worked examples, are in
|
|
69
|
+
[references/action-patterns.md](references/action-patterns.md): workflow
|
|
70
|
+
tables with denied writes (policy-scoped read, validated transition, audited
|
|
71
|
+
narrow `adminOverride` final write), discovery actions and `resource` metadata
|
|
72
|
+
for id-based model workflows, JSON Schema inputs, and read-only user search
|
|
73
|
+
actions.
|
|
74
|
+
|
|
75
|
+
Rules:
|
|
76
|
+
|
|
77
|
+
- `defineActions({ ... })` gives unnamed actions stable names from object keys
|
|
78
|
+
and validates duplicates.
|
|
79
|
+
- Parameterize `defineActions<RaybaseEnv, typeof schema>({ ... })` or
|
|
80
|
+
`defineAction<Input, Output, RaybaseEnv, typeof schema>({ ... })` whenever an
|
|
81
|
+
action reads `ctx.db`, `ctx.env`, calls helpers such as
|
|
82
|
+
`raybaseAuthExecutor(ctx.env)`, or creates an audited write client with
|
|
83
|
+
`createRaybaseDb(ctx.env, schema, ...)`.
|
|
84
|
+
- Signed-in actions need an explicit `policy`. Public actions may declare
|
|
85
|
+
`audience: "public"` or `audience: ["signed-in", "public"]`, but public
|
|
86
|
+
actions must be narrow, rate-limited by the caller surface, and safe without
|
|
87
|
+
app data authority.
|
|
88
|
+
- Use `rowAuthorization()` with adapters or `executeAction()` when an
|
|
89
|
+
action-level role/policy is necessary but too broad for the target row. It
|
|
90
|
+
checks the named table/action against the row id derived from input.
|
|
91
|
+
- Use `output` validation when consumers depend on the result shape. Actions
|
|
92
|
+
exposed to Guide, generic Agents, or external API routes must declare
|
|
93
|
+
`output`; `raybase doctor` reports those model/API surfaces as errors when
|
|
94
|
+
the output contract is missing.
|
|
95
|
+
- For model-facing actions, use `resource` metadata when an input is an
|
|
96
|
+
internal id for a business resource. Pair internal-id mutations with a
|
|
97
|
+
read-only discovery action for the same resource.
|
|
98
|
+
- Use `annotations.title` for human/tool labels, `readOnlyHint` for
|
|
99
|
+
non-mutating actions, `destructiveHint` for irreversible or high-risk
|
|
100
|
+
changes, and `idempotentHint` when repeat calls should be safe.
|
|
101
|
+
- Use `idempotencyKey` for state transitions, enqueue requests, external sends,
|
|
102
|
+
and model-callable tools that may be retried. Include the stable inputs that
|
|
103
|
+
define the intended effect, such as the target row id, actor, decision, date
|
|
104
|
+
range, external message id, or unique import id. Do not include volatile
|
|
105
|
+
fields such as timestamps or optional notes unless changing that field should
|
|
106
|
+
create a distinct side effect. If omitting an input would make two different
|
|
107
|
+
intended effects collapse into one cached result, include it.
|
|
108
|
+
- Use `effects` to summarize visible side effects for humans and models.
|
|
109
|
+
- Use `actionError(message, { code, status, guidance, retryable })` for
|
|
110
|
+
business-domain failures that Guide, Agents, MCP, HTTP clients, or jobs can
|
|
111
|
+
act on, such as "request not found", "already cancelled", or "choose an
|
|
112
|
+
active manager". Do not put secrets, stack traces, SQL, raw validation
|
|
113
|
+
payloads, or internal provider errors in `actionError` messages or details.
|
|
114
|
+
- Use `requiresInternalControl` only for actions that truly need internal
|
|
115
|
+
runtime control state. Such actions must not be adapted to public/user
|
|
116
|
+
surfaces unless the adapter explicitly allows internal control.
|
|
117
|
+
|
|
118
|
+
Do not put raw SQL, schema changes, operator authority, deploy authority,
|
|
119
|
+
filesystem access, shell access, or generic table mutation power in actions
|
|
120
|
+
exposed to users, MCP clients, Guide, Agents, or API keys. A narrow audited
|
|
121
|
+
`adminOverride` write is acceptable only after the action has enforced its own
|
|
122
|
+
policy, row ownership, field allowlist, and state transition rules.
|
|
123
|
+
|
|
124
|
+
## Agent-Driven Calls
|
|
125
|
+
|
|
126
|
+
Inside an Agent run, `ctx.principal.kind === "agent"`: `agent` is the agent
|
|
127
|
+
name, `onBehalfOf` the user, visitor, or service principal whose authority the
|
|
128
|
+
run carries, `scopes` the agent definition's `scopes`, and `runId` the run.
|
|
129
|
+
`ctx.user` still points at the person. Policies and audience checks evaluate
|
|
130
|
+
`onBehalfOf`, so the agent never gains authority; audit rows name the agent as
|
|
131
|
+
actor and the person as `runAs`. Gate governance-grade writes explicitly:
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
if (ctx.principal.kind === "agent" && !agentPrincipalHasScope(ctx.principal, "governance")) {
|
|
135
|
+
throw actionError("agent_forbidden", "A person must approve this.");
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Declare `scopes` on `defineAgent` to allow named agents through such gates.
|
|
140
|
+
Use `principalOnBehalfOf(ctx.principal)` when code needs the human or service
|
|
141
|
+
behind whichever principal it was handed. A check for `ctx.principal.kind ===
|
|
142
|
+
"public"` never matches a public visitor's agent, so check that kind on the
|
|
143
|
+
unwrapped principal.
|
|
144
|
+
|
|
145
|
+
## Test Actions
|
|
146
|
+
|
|
147
|
+
Business logic and mutating actions need focused tests. Replacing starter
|
|
148
|
+
workflows means replacing starter tests; do not leave
|
|
149
|
+
`tests/raybase-patterns.test.ts` pointing at removed starter actions or tables.
|
|
150
|
+
|
|
151
|
+
Cover these cases for every important mutation or state transition:
|
|
152
|
+
|
|
153
|
+
- Allowed role succeeds through `executeAction()`.
|
|
154
|
+
- Disallowed role is rejected before data access.
|
|
155
|
+
- Ownership and table policy boundaries are enforced through real Raybase table
|
|
156
|
+
policies when practical.
|
|
157
|
+
- Invalid input is rejected before writing.
|
|
158
|
+
- Invalid business state is rejected with an `actionError()` or equivalent
|
|
159
|
+
domain failure.
|
|
160
|
+
|
|
161
|
+
Use `@raybase/core/test` for action unit tests: `createActionTestContext()` is
|
|
162
|
+
a cheap fake context for focused handler/policy tests, and
|
|
163
|
+
`createSchemaActionTestContext()` proves table policy, `owns()`, row
|
|
164
|
+
authorization, validation, and invariants against the real schema. Worked
|
|
165
|
+
examples are in [references/testing-actions.md](references/testing-actions.md).
|
|
166
|
+
|
|
167
|
+
## Adapt Actions
|
|
168
|
+
|
|
169
|
+
Expose the same action through the surfaces that need it instead of rewriting
|
|
170
|
+
the business rules. Worked adapter examples are in
|
|
171
|
+
[references/adapting-actions.md](references/adapting-actions.md).
|
|
172
|
+
|
|
173
|
+
- `mcpToolFromAction()` uses `mcp:read` plus `mcp:tool:<name>` for
|
|
174
|
+
`readOnlyHint` actions and `mcp:write` plus `mcp:tool:<name>` for mutating
|
|
175
|
+
actions unless explicit scopes are supplied.
|
|
176
|
+
- `actionRoute()` registers the HTTP route and `serverFnFromAction()` exposes
|
|
177
|
+
the same endpoint to UI server functions.
|
|
178
|
+
- `jobFromAction()` requires `enqueue` and `runAs`, re-evaluates policy when
|
|
179
|
+
the queue message runs, and rejects public-audience actions.
|
|
180
|
+
- Agents and Guide take explicit action arrays:
|
|
181
|
+
`defineAgent({ ..., actions: [...] })` and
|
|
182
|
+
`guideModule({ ..., actions: guideActions })`.
|
|
183
|
+
- `apiOperation(action, ...)` exposes an action on the optional external API.
|
|
184
|
+
API key scopes are separate from action policy: the key scope authorizes the
|
|
185
|
+
operation, then the linked user still has to pass the action policy.
|
|
186
|
+
|
|
187
|
+
In generated apps, keep Guide's allow-list in `src/guide/actions.ts` or
|
|
188
|
+
`app/guide/actions.ts`, then import `guideActions` in `raybase.server.ts` and
|
|
189
|
+
pass `guideModule({ config: guideConfig, corpus: guideCorpus, actions:
|
|
190
|
+
guideActions })`. When adding user-facing actions and Guide is enabled, update
|
|
191
|
+
that allow-list or explicitly set `mode: "knowledge-only"` if Guide must not
|
|
192
|
+
perform app workflows. Register only intentional actions for each Agent or
|
|
193
|
+
Guide surface. Do not pass every app action to a model.
|
|
194
|
+
|
|
195
|
+
## Audit Action Reachability
|
|
196
|
+
|
|
197
|
+
Audit every declared action after wiring adapters. For each action, identify at
|
|
198
|
+
least one concrete route/server-function registration, MCP tool, job caller,
|
|
199
|
+
Agent or Guide allow-list, API operation, direct internal call site, or explicit
|
|
200
|
+
app-owned `internal only` marker. A `defineAction()` declaration does not expose
|
|
201
|
+
or invoke the action by itself. Treat an action with no reachable surface,
|
|
202
|
+
caller, or intentional internal-only marker as a bug; do not assume a future
|
|
203
|
+
member interaction will reveal the missing route.
|
|
204
|
+
|
|
205
|
+
## Checklist
|
|
206
|
+
|
|
207
|
+
1. Name the action with a durable domain name such as `requests.approve`.
|
|
208
|
+
2. Validate input with Zod or JSON Schema, and declare `output` for any action
|
|
209
|
+
exposed to Guide, Agents, or external API routes.
|
|
210
|
+
3. Set action `policy`, `audience`, and `rowAuthorization()` deliberately.
|
|
211
|
+
4. Add `idempotencyKey`, `annotations`, and `effects` for retried or
|
|
212
|
+
model/tool-callable behavior.
|
|
213
|
+
5. Keep `requiresInternalControl` actions off public/user adapters unless
|
|
214
|
+
the adapter explicitly supports internal control.
|
|
215
|
+
6. Adapt with `mcpToolFromAction()`, `actionRoute()`, `serverFnFromAction()`,
|
|
216
|
+
`jobFromAction()`, selected Agent/Guide action arrays, or
|
|
217
|
+
`apiOperation(action, ...)`.
|
|
218
|
+
7. Audit every declared action for a reachable adapter/caller or an explicit
|
|
219
|
+
internal-only marker.
|
|
220
|
+
8. Add focused tests for allowed role, denied role, ownership/table policy,
|
|
221
|
+
invalid input, and invalid state.
|
|
222
|
+
9. Run `raybase doctor` while iterating and `raybase check` before handoff when
|
|
223
|
+
action correctness or workflow behavior changed.
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Raybase Action Patterns
|
|
2
|
+
|
|
3
|
+
Define-time patterns for `defineAction()`. Read together with the Rules in
|
|
4
|
+
the skill's SKILL.md; the rules there govern when each pattern applies.
|
|
5
|
+
|
|
6
|
+
## Workflow Tables With Denied Writes
|
|
7
|
+
|
|
8
|
+
For approval queues, requests, cancellations, inventory movements, and other
|
|
9
|
+
state machines, table policies often deny normal `create`, `update`, and
|
|
10
|
+
`delete` so `/api/data`, generated MCP CRUD, and generic UI code cannot bypass
|
|
11
|
+
the workflow. In that case, actions should first read through `ctx.db` under
|
|
12
|
+
the caller's policy, validate the transition, then perform the final write with
|
|
13
|
+
an audited, narrow `adminOverride` context that names the action.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { actionError, createRaybaseDb, defineAction, role } from "@raybase/core";
|
|
17
|
+
import type { RaybaseEnv } from "@raybase/core/worker";
|
|
18
|
+
import { z } from "zod";
|
|
19
|
+
import { appMigrations } from "../db/migrations.gen";
|
|
20
|
+
import { schema } from "../db/schema";
|
|
21
|
+
import { appRoles } from "../raybase.config";
|
|
22
|
+
|
|
23
|
+
export const approveRequest = defineAction({
|
|
24
|
+
name: "requests.approve",
|
|
25
|
+
description: "Approve a pending request assigned to the signed-in manager.",
|
|
26
|
+
input: z.object({
|
|
27
|
+
id: z.string().min(1),
|
|
28
|
+
note: z.string().max(500).optional()
|
|
29
|
+
}),
|
|
30
|
+
output: z.object({
|
|
31
|
+
id: z.string(),
|
|
32
|
+
status: z.literal("approved")
|
|
33
|
+
}),
|
|
34
|
+
policy: role(appRoles, "manager"),
|
|
35
|
+
idempotencyKey: (input) => `requests.approve:${input.id}`,
|
|
36
|
+
annotations: { title: "Approve request", idempotentHint: true },
|
|
37
|
+
effects: ["updates requests.status", "records approval history"],
|
|
38
|
+
handler: async (ctx, input) => {
|
|
39
|
+
if (!ctx.user) throw actionError("Authentication required.", { code: "authentication_required", status: 401, retryable: false });
|
|
40
|
+
|
|
41
|
+
const visible = await ctx.db.get("requests", input.id);
|
|
42
|
+
if (!visible || visible.managerId !== ctx.user.id) {
|
|
43
|
+
throw actionError("Request not found.", {
|
|
44
|
+
code: "request_not_found",
|
|
45
|
+
status: 404,
|
|
46
|
+
guidance: "Retry only with an id returned by a request-listing action visible to this user.",
|
|
47
|
+
retryable: true
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
if (visible.status !== "pending") throw actionError("Only pending requests can be approved.", { code: "invalid_state", retryable: false });
|
|
51
|
+
|
|
52
|
+
const writeDb = createRaybaseDb(ctx.env as RaybaseEnv, schema, appMigrations).for({
|
|
53
|
+
user: ctx.user,
|
|
54
|
+
adminOverride: true,
|
|
55
|
+
source: { surface: "action", actionName: "requests.approve" },
|
|
56
|
+
audit: ctx.audit as never
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
const updated = await writeDb.update("requests", input.id, {
|
|
60
|
+
status: "approved",
|
|
61
|
+
approvalNote: input.note?.trim() || null
|
|
62
|
+
});
|
|
63
|
+
return { id: String(updated.id), status: "approved" as const };
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Use this pattern only to complete a validated domain action. Do not expose a
|
|
69
|
+
generic "write as admin" action or skip the policy-scoped read and row checks.
|
|
70
|
+
|
|
71
|
+
## Discovery Actions For ID-Based Workflows
|
|
72
|
+
|
|
73
|
+
When an action exposed to Guide or another model surface acts on a resource by
|
|
74
|
+
an internal id, also expose a policy-scoped read-only discovery action for that
|
|
75
|
+
resource unless the id is always supplied by trusted UI context or a previous
|
|
76
|
+
action in the same flow. Users should be able to say "cancel my request from
|
|
77
|
+
July 2 to July 6" instead of finding a row id.
|
|
78
|
+
|
|
79
|
+
Declare `resource` metadata on model-facing actions so `raybase doctor` can
|
|
80
|
+
check the action graph without guessing from names:
|
|
81
|
+
|
|
82
|
+
```ts
|
|
83
|
+
resource: {
|
|
84
|
+
name: "requests",
|
|
85
|
+
operation: "update",
|
|
86
|
+
inputRefs: { id: { kind: "internal-id" } }
|
|
87
|
+
}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Pair that with a read-only `list`, `search`, or `get` action for the same
|
|
91
|
+
resource, for example `requests.list_my_requests`, and include both actions in
|
|
92
|
+
Guide's allow-list when Guide should manage that resource.
|
|
93
|
+
|
|
94
|
+
For read-only model-facing actions, set `annotations.readOnlyHint: true` or a
|
|
95
|
+
read-like `resource.operation`. Guide's client refresh bridge uses this action
|
|
96
|
+
metadata: successful non-read Guide actions notify the host app that data may
|
|
97
|
+
have changed, and the default TanStack widget invalidates active route loaders.
|
|
98
|
+
|
|
99
|
+
Use JSON Schema when the action should stay protocol-neutral or be shared with
|
|
100
|
+
tool surfaces that already speak JSON Schema:
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import { defineAction, role } from "@raybase/core";
|
|
104
|
+
import { appRoles } from "../raybase.config";
|
|
105
|
+
|
|
106
|
+
export const flagInvoice = defineAction({
|
|
107
|
+
name: "invoices.flag",
|
|
108
|
+
description: "Flag an invoice for finance review.",
|
|
109
|
+
input: {
|
|
110
|
+
type: "object",
|
|
111
|
+
properties: {
|
|
112
|
+
id: { type: "string", minLength: 1 },
|
|
113
|
+
reason: { type: "string", minLength: 1 }
|
|
114
|
+
},
|
|
115
|
+
required: ["id", "reason"],
|
|
116
|
+
additionalProperties: false
|
|
117
|
+
},
|
|
118
|
+
output: {
|
|
119
|
+
type: "object",
|
|
120
|
+
properties: {
|
|
121
|
+
id: { type: "string" },
|
|
122
|
+
flagged: { type: "boolean" }
|
|
123
|
+
},
|
|
124
|
+
required: ["id", "flagged"],
|
|
125
|
+
additionalProperties: false
|
|
126
|
+
},
|
|
127
|
+
policy: role(appRoles, "finance"),
|
|
128
|
+
annotations: { title: "Flag invoice" },
|
|
129
|
+
effects: ["marks invoice review state"],
|
|
130
|
+
handler: async ({ db }, input) => {
|
|
131
|
+
const invoice = await db.update("invoices", input.id, { reviewReason: input.reason });
|
|
132
|
+
return { id: invoice.id, flagged: true };
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
## Read-Only user search Actions
|
|
138
|
+
|
|
139
|
+
Generated apps that need assignment pickers should expose a deliberate action,
|
|
140
|
+
not a generic Core route or raw auth-user query. Filter by business
|
|
141
|
+
`appRoles`, return only the UI projection, and register the route explicitly.
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
import { actionError, actionRoute, defineAction, getAppUserById, listAppUsers, raybaseAuthExecutor, role } from "@raybase/core";
|
|
145
|
+
import { z } from "zod";
|
|
146
|
+
import { appRoles } from "../raybase.config";
|
|
147
|
+
|
|
148
|
+
export const searchManagers = defineAction({
|
|
149
|
+
name: "users.search_managers",
|
|
150
|
+
description: "Search invited managers who can receive assignments.",
|
|
151
|
+
input: z.object({
|
|
152
|
+
search: z.string().max(120).optional(),
|
|
153
|
+
limit: z.number().int().min(1).max(50).optional()
|
|
154
|
+
}).strict(),
|
|
155
|
+
output: z.object({
|
|
156
|
+
users: z.array(z.object({
|
|
157
|
+
id: z.string(),
|
|
158
|
+
name: z.string(),
|
|
159
|
+
email: z.string()
|
|
160
|
+
})),
|
|
161
|
+
total: z.number()
|
|
162
|
+
}),
|
|
163
|
+
policy: role(appRoles, "user"),
|
|
164
|
+
annotations: { title: "Search managers", readOnlyHint: true },
|
|
165
|
+
effects: [],
|
|
166
|
+
handler: async (ctx, input) => {
|
|
167
|
+
const result = await listAppUsers(raybaseAuthExecutor(ctx.env), {
|
|
168
|
+
appRoles: "manager",
|
|
169
|
+
search: input.search,
|
|
170
|
+
limit: input.limit
|
|
171
|
+
});
|
|
172
|
+
return {
|
|
173
|
+
users: result.users.map(({ id, name, email }) => ({ id, name, email })),
|
|
174
|
+
total: result.total
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
export const managerSearchRoute = actionRoute(searchManagers);
|
|
180
|
+
|
|
181
|
+
export async function assertManager(ctx: { env: unknown }, managerId: string) {
|
|
182
|
+
const manager = await getAppUserById(raybaseAuthExecutor(ctx.env), managerId, { appRoles: "manager" });
|
|
183
|
+
if (!manager) throw actionError("Choose an active manager.", { code: "manager_not_found", status: 404, retryable: true });
|
|
184
|
+
return manager;
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Use the narrowest action policy that matches the workflow. Store the selected
|
|
189
|
+
user id in a `userRef()` column, and re-check the user role inside the
|
|
190
|
+
mutation action before assigning new work.
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# Adapting Actions To Surfaces
|
|
2
|
+
|
|
3
|
+
Worked adapter examples. The adapter semantics and the Guide allow-list rule
|
|
4
|
+
live in the skill's SKILL.md Adapt Actions section.
|
|
5
|
+
|
|
6
|
+
MCP user business tools:
|
|
7
|
+
|
|
8
|
+
```ts
|
|
9
|
+
import { mcpToolFromAction } from "@raybase/core";
|
|
10
|
+
import { actions, requestUpdateRow } from "./actions";
|
|
11
|
+
|
|
12
|
+
export const mcpTools = [
|
|
13
|
+
mcpToolFromAction(actions.approveRequest, { rowAuthorization: requestUpdateRow })
|
|
14
|
+
];
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
HTTP route and UI server function:
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { actionRoute, serverFnFromAction } from "@raybase/core";
|
|
21
|
+
import { actions, requestUpdateRow } from "./actions";
|
|
22
|
+
|
|
23
|
+
export const approveRequestRoute = actionRoute(actions.approveRequest, {
|
|
24
|
+
path: "/api/actions/requests/approve",
|
|
25
|
+
rowAuthorization: requestUpdateRow
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
export const approveRequest = serverFnFromAction(actions.approveRequest, {
|
|
29
|
+
endpoint: "/api/actions/requests/approve"
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Background execution:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { anyOf, fromService, jobFromAction, role } from "@raybase/core";
|
|
37
|
+
import { actions, requestUpdateRow } from "./actions";
|
|
38
|
+
import { appRoles } from "./raybase.config";
|
|
39
|
+
|
|
40
|
+
export const jobs = {
|
|
41
|
+
approveRequest: jobFromAction(actions.approveRequest, {
|
|
42
|
+
enqueue: anyOf(role(appRoles, "operations"), fromService("scheduler")),
|
|
43
|
+
runAs: "actor",
|
|
44
|
+
rowAuthorization: requestUpdateRow,
|
|
45
|
+
retries: { maxAttempts: 3, backoff: "exponential", delay: "30 seconds" }
|
|
46
|
+
})
|
|
47
|
+
};
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Generic Raybase Agent and Guide:
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import { defineAgent, defineAgents } from "@raybase/core";
|
|
54
|
+
import { guideModule } from "@raybase/guide";
|
|
55
|
+
import { actions } from "./actions";
|
|
56
|
+
import { guideConfig } from "./guide/config";
|
|
57
|
+
import { guideCorpus } from "./guide/corpus";
|
|
58
|
+
|
|
59
|
+
export const agents = defineAgents({
|
|
60
|
+
operationsHelper: defineAgent({
|
|
61
|
+
name: "operations-helper",
|
|
62
|
+
title: "Operations helper",
|
|
63
|
+
runtime: "ai-chat",
|
|
64
|
+
actions: [actions.approveRequest],
|
|
65
|
+
limits: { maxToolCallsPerTurn: 4, maxOutputTokens: 800 }
|
|
66
|
+
})
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
export const guide = guideModule({
|
|
70
|
+
config: guideConfig,
|
|
71
|
+
corpus: guideCorpus,
|
|
72
|
+
actions: [actions.approveRequest]
|
|
73
|
+
});
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Optional external API:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { apiModule, apiOperation, defineApiOperations } from "@raybase/api";
|
|
80
|
+
import { actions } from "./actions";
|
|
81
|
+
|
|
82
|
+
export const api = apiModule({
|
|
83
|
+
prefix: "/api/v1",
|
|
84
|
+
operations: defineApiOperations({
|
|
85
|
+
approveRequest: apiOperation(actions.approveRequest, {
|
|
86
|
+
method: "POST",
|
|
87
|
+
path: "/requests/:id/approve",
|
|
88
|
+
scopes: ["requests:write"],
|
|
89
|
+
parseRequest: ({ params, body }) => ({ id: params.id, ...(body as object) })
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
```
|