@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
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { createNotificationClient } from "@raybase/core";
|
|
2
|
+
import { useCallback, useEffect, useState } from "react";
|
|
3
|
+
|
|
4
|
+
const notificationClient = createNotificationClient();
|
|
5
|
+
|
|
6
|
+
function applicationServerKey(value: string): ArrayBuffer {
|
|
7
|
+
const padded = `${value.replace(/-/g, "+").replace(/_/g, "/")}${"=".repeat((4 - value.length % 4) % 4)}`;
|
|
8
|
+
const binary = atob(padded);
|
|
9
|
+
const buffer = new ArrayBuffer(binary.length);
|
|
10
|
+
const bytes = new Uint8Array(buffer);
|
|
11
|
+
for (let index = 0; index < binary.length; index += 1) bytes[index] = binary.charCodeAt(index);
|
|
12
|
+
return buffer;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function supported(): boolean {
|
|
16
|
+
return typeof window !== "undefined" && "serviceWorker" in navigator && "PushManager" in window && "Notification" in window;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function usePushSubscription() {
|
|
20
|
+
const [enabled, setEnabled] = useState(false);
|
|
21
|
+
const [subscribed, setSubscribed] = useState(false);
|
|
22
|
+
const [permission, setPermission] = useState<NotificationPermission>(() => typeof Notification === "undefined" ? "default" : Notification.permission);
|
|
23
|
+
const [busy, setBusy] = useState(false);
|
|
24
|
+
const [error, setError] = useState<string | null>(null);
|
|
25
|
+
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (!supported()) return;
|
|
28
|
+
let active = true;
|
|
29
|
+
void notificationClient.push.publicKey()
|
|
30
|
+
.then(async (result) => {
|
|
31
|
+
if (!active || !result.enabled || !result.publicKey) return;
|
|
32
|
+
setEnabled(true);
|
|
33
|
+
const registration = await navigator.serviceWorker.register("/raybase-push-sw.js", { scope: "/" });
|
|
34
|
+
const subscription = await registration.pushManager.getSubscription();
|
|
35
|
+
if (!active) return;
|
|
36
|
+
setSubscribed(Boolean(subscription));
|
|
37
|
+
if (subscription) {
|
|
38
|
+
const json = subscription.toJSON();
|
|
39
|
+
if (json.endpoint && json.keys?.p256dh && json.keys?.auth) {
|
|
40
|
+
await notificationClient.push.subscribe({ endpoint: json.endpoint, expirationTime: json.expirationTime, keys: { p256dh: json.keys.p256dh, auth: json.keys.auth } });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
})
|
|
44
|
+
.catch(() => {
|
|
45
|
+
if (active) setEnabled(false);
|
|
46
|
+
});
|
|
47
|
+
return () => { active = false; };
|
|
48
|
+
}, []);
|
|
49
|
+
|
|
50
|
+
const subscribe = useCallback(async () => {
|
|
51
|
+
if (!supported() || !enabled) return false;
|
|
52
|
+
setBusy(true);
|
|
53
|
+
setError(null);
|
|
54
|
+
try {
|
|
55
|
+
const nextPermission = await Notification.requestPermission();
|
|
56
|
+
setPermission(nextPermission);
|
|
57
|
+
if (nextPermission !== "granted") return false;
|
|
58
|
+
const { publicKey } = await notificationClient.push.publicKey();
|
|
59
|
+
if (!publicKey) throw new Error("Web Push is not configured");
|
|
60
|
+
const registration = await navigator.serviceWorker.register("/raybase-push-sw.js", { scope: "/" });
|
|
61
|
+
const current = await registration.pushManager.getSubscription();
|
|
62
|
+
const subscription = current ?? await registration.pushManager.subscribe({ userVisibleOnly: true, applicationServerKey: applicationServerKey(publicKey) });
|
|
63
|
+
const json = subscription.toJSON();
|
|
64
|
+
if (!json.endpoint || !json.keys?.p256dh || !json.keys?.auth) throw new Error("Browser returned an incomplete push subscription");
|
|
65
|
+
await notificationClient.push.subscribe({ endpoint: json.endpoint, expirationTime: json.expirationTime, keys: { p256dh: json.keys.p256dh, auth: json.keys.auth } }, { label: "This device" });
|
|
66
|
+
setSubscribed(true);
|
|
67
|
+
return true;
|
|
68
|
+
} catch (cause) {
|
|
69
|
+
setError(cause instanceof Error ? cause.message : "Could not enable push notifications");
|
|
70
|
+
return false;
|
|
71
|
+
} finally {
|
|
72
|
+
setBusy(false);
|
|
73
|
+
}
|
|
74
|
+
}, [enabled]);
|
|
75
|
+
|
|
76
|
+
const unsubscribe = useCallback(async () => {
|
|
77
|
+
if (!supported()) return false;
|
|
78
|
+
setBusy(true);
|
|
79
|
+
setError(null);
|
|
80
|
+
try {
|
|
81
|
+
const registration = await navigator.serviceWorker.getRegistration("/");
|
|
82
|
+
const subscription = await registration?.pushManager.getSubscription();
|
|
83
|
+
if (subscription) {
|
|
84
|
+
await notificationClient.push.unsubscribe(subscription.endpoint);
|
|
85
|
+
await subscription.unsubscribe();
|
|
86
|
+
}
|
|
87
|
+
setSubscribed(false);
|
|
88
|
+
return true;
|
|
89
|
+
} catch (cause) {
|
|
90
|
+
setError(cause instanceof Error ? cause.message : "Could not disable push notifications");
|
|
91
|
+
return false;
|
|
92
|
+
} finally {
|
|
93
|
+
setBusy(false);
|
|
94
|
+
}
|
|
95
|
+
}, []);
|
|
96
|
+
|
|
97
|
+
return { supported: supported(), enabled, subscribed, permission, busy, error, subscribe, unsubscribe };
|
|
98
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { createMcpAppResource } from "@raybase/core";
|
|
2
|
+
|
|
3
|
+
export const todoDashboardMcpAppResource = createMcpAppResource({
|
|
4
|
+
uri: "ui://team-tasks/dashboard",
|
|
5
|
+
name: "Team Tasks dashboard",
|
|
6
|
+
description: "Interactive Team Tasks project and task snapshot for MCP clients.",
|
|
7
|
+
_meta: {
|
|
8
|
+
ui: {
|
|
9
|
+
prefersBorder: true,
|
|
10
|
+
csp: {
|
|
11
|
+
connectDomains: [],
|
|
12
|
+
resourceDomains: [],
|
|
13
|
+
frameDomains: [],
|
|
14
|
+
baseUriDomains: []
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
html: `<!doctype html>
|
|
19
|
+
<html lang="en">
|
|
20
|
+
<head>
|
|
21
|
+
<meta charset="utf-8" />
|
|
22
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
23
|
+
<title>Team Tasks dashboard</title>
|
|
24
|
+
<style>
|
|
25
|
+
:root { color-scheme: light dark; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
|
|
26
|
+
body { margin: 0; padding: 16px; background: Canvas; color: CanvasText; }
|
|
27
|
+
main { display: grid; gap: 12px; }
|
|
28
|
+
h1 { margin: 0; font-size: 18px; line-height: 1.2; }
|
|
29
|
+
p { margin: 0; color: color-mix(in srgb, CanvasText 70%, transparent); }
|
|
30
|
+
section { border: 1px solid color-mix(in srgb, CanvasText 18%, transparent); border-radius: 8px; padding: 12px; }
|
|
31
|
+
dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
|
|
32
|
+
dt { font-size: 12px; color: color-mix(in srgb, CanvasText 62%, transparent); }
|
|
33
|
+
dd { margin: 2px 0 0; font-size: 22px; font-weight: 650; }
|
|
34
|
+
pre { white-space: pre-wrap; word-break: break-word; margin: 0; font-size: 12px; line-height: 1.45; }
|
|
35
|
+
</style>
|
|
36
|
+
</head>
|
|
37
|
+
<body>
|
|
38
|
+
<main>
|
|
39
|
+
<header>
|
|
40
|
+
<h1>Team Tasks dashboard</h1>
|
|
41
|
+
<p id="status">Waiting for tool result data from the host.</p>
|
|
42
|
+
</header>
|
|
43
|
+
<section>
|
|
44
|
+
<dl>
|
|
45
|
+
<div><dt>Projects</dt><dd id="projects">-</dd></div>
|
|
46
|
+
<div><dt>Tasks</dt><dd id="todos">-</dd></div>
|
|
47
|
+
<div><dt>Open</dt><dd id="open">-</dd></div>
|
|
48
|
+
</dl>
|
|
49
|
+
</section>
|
|
50
|
+
<section><pre id="payload">No payload has arrived yet.</pre></section>
|
|
51
|
+
</main>
|
|
52
|
+
<script>
|
|
53
|
+
const status = document.getElementById("status");
|
|
54
|
+
const payload = document.getElementById("payload");
|
|
55
|
+
const projects = document.getElementById("projects");
|
|
56
|
+
const todos = document.getElementById("todos");
|
|
57
|
+
const open = document.getElementById("open");
|
|
58
|
+
function readStructuredContent(message) {
|
|
59
|
+
return message?.result?.structuredContent || message?.structuredContent || message?.data?.structuredContent || message?.data?.result?.structuredContent || null;
|
|
60
|
+
}
|
|
61
|
+
function render(message) {
|
|
62
|
+
const structured = readStructuredContent(message);
|
|
63
|
+
payload.textContent = JSON.stringify(structured || message, null, 2);
|
|
64
|
+
if (!structured) return;
|
|
65
|
+
status.textContent = "Latest MCP tool result.";
|
|
66
|
+
projects.textContent = String(structured.counts?.activeProjects ?? structured.projectCount ?? "-");
|
|
67
|
+
todos.textContent = String(structured.counts?.todos ?? structured.todoCount ?? "-");
|
|
68
|
+
open.textContent = String(structured.counts?.openTodos ?? structured.openTodoCount ?? "-");
|
|
69
|
+
}
|
|
70
|
+
window.addEventListener("message", (event) => render(event.data));
|
|
71
|
+
</script>
|
|
72
|
+
</body>
|
|
73
|
+
</html>`
|
|
74
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineNotifications,
|
|
3
|
+
type RaybaseNotificationsRuntime
|
|
4
|
+
} from "@raybase/core";
|
|
5
|
+
|
|
6
|
+
// Disabled recipe: this file is not imported by the starter.
|
|
7
|
+
//
|
|
8
|
+
// Feed notifications are the smallest safe starting point. External channels
|
|
9
|
+
// such as email, Slack, or webhooks require declared adapters plus jobs/queues
|
|
10
|
+
// for delivery and must remain disabled until the provider is configured.
|
|
11
|
+
// Runtime modules passed through modules: [...] may also contribute adapters.
|
|
12
|
+
// Provider webhooks should verify and enqueue quickly, and provider sends should
|
|
13
|
+
// go through notification adapters rather than direct fetch() calls.
|
|
14
|
+
|
|
15
|
+
export const notifications = defineNotifications/* opt-in example */({
|
|
16
|
+
feed: { enabled: true }
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export async function notifyTodoMarkedDone(
|
|
20
|
+
notificationsRuntime: RaybaseNotificationsRuntime,
|
|
21
|
+
todo: { id: string; title: string }
|
|
22
|
+
) {
|
|
23
|
+
return notificationsRuntime.send({
|
|
24
|
+
to: [{ kind: "current-user" }],
|
|
25
|
+
channels: ["feed"],
|
|
26
|
+
kind: "todo.completed",
|
|
27
|
+
severity: "success",
|
|
28
|
+
title: "Todo marked done",
|
|
29
|
+
body: todo.title,
|
|
30
|
+
target: {
|
|
31
|
+
href: `/#todo-${todo.id}`,
|
|
32
|
+
entity: { type: "todos", id: todo.id }
|
|
33
|
+
},
|
|
34
|
+
dedupeKey: `todo:${todo.id}:done`,
|
|
35
|
+
metadata: { todoId: todo.id }
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { defineRaybaseExternalAuth } from "@raybase/core";
|
|
2
|
+
|
|
3
|
+
export const externalAuth = defineRaybaseExternalAuth({
|
|
4
|
+
providers: [],
|
|
5
|
+
configure: () => ({})
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
External auth stays app-owned. Add provider metadata in src/raybase.config.ts,
|
|
10
|
+
install any provider-specific packages in this app, then return Better Auth
|
|
11
|
+
provider config from configure().
|
|
12
|
+
|
|
13
|
+
Whether a provider may create a brand-new account is appConfig.auth.signupMode,
|
|
14
|
+
not anything in this file: "invite-only" (the default) admits only existing or
|
|
15
|
+
invited users, while "public" and "provider-only" let a first-time visitor sign
|
|
16
|
+
up with the provider and land with no operator role and the default ["user"]
|
|
17
|
+
app role. Provider-only closes password signup, but password sign-in for existing
|
|
18
|
+
accounts stays available. In both public modes Core requires the provider to
|
|
19
|
+
assert a verified email.
|
|
20
|
+
|
|
21
|
+
Examples:
|
|
22
|
+
|
|
23
|
+
Google / Google Workspace:
|
|
24
|
+
|
|
25
|
+
configure: (ctx) => ({
|
|
26
|
+
socialProviders: {
|
|
27
|
+
google: {
|
|
28
|
+
clientId: ctx.env.GOOGLE_CLIENT_ID,
|
|
29
|
+
clientSecret: ctx.env.GOOGLE_CLIENT_SECRET
|
|
30
|
+
// Enforce a hosted domain only when the provider config verifies the
|
|
31
|
+
// hosted-domain claim for your Workspace tenant.
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
Microsoft Entra:
|
|
37
|
+
|
|
38
|
+
configure: (ctx) => ({
|
|
39
|
+
socialProviders: {
|
|
40
|
+
microsoft: {
|
|
41
|
+
clientId: ctx.env.MICROSOFT_CLIENT_ID,
|
|
42
|
+
clientSecret: ctx.env.MICROSOFT_CLIENT_SECRET,
|
|
43
|
+
tenantId: ctx.env.MICROSOFT_TENANT_ID
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
})
|
|
47
|
+
|
|
48
|
+
Okta, Auth0, Keycloak, and other OIDC providers:
|
|
49
|
+
|
|
50
|
+
configure: (ctx) => ({
|
|
51
|
+
genericOAuth: [{
|
|
52
|
+
providerId: "okta",
|
|
53
|
+
clientId: ctx.env.OKTA_CLIENT_ID,
|
|
54
|
+
clientSecret: ctx.env.OKTA_CLIENT_SECRET,
|
|
55
|
+
authorizationUrl: `${ctx.env.OKTA_ISSUER}/v1/authorize`,
|
|
56
|
+
tokenUrl: `${ctx.env.OKTA_ISSUER}/v1/token`,
|
|
57
|
+
userInfoUrl: `${ctx.env.OKTA_ISSUER}/v1/userinfo`,
|
|
58
|
+
scopes: ["openid", "email", "profile"]
|
|
59
|
+
}]
|
|
60
|
+
})
|
|
61
|
+
|
|
62
|
+
Raybase hosted auth broker, after `raybase hosted-auth enable` and OAuth client
|
|
63
|
+
registration:
|
|
64
|
+
|
|
65
|
+
configure: (ctx) => ({
|
|
66
|
+
providers: [{ id: "raybase", label: "Raybase" }],
|
|
67
|
+
genericOAuth: [{
|
|
68
|
+
providerId: "raybase",
|
|
69
|
+
clientId: ctx.env.RAYBASE_HOSTED_AUTH_CLIENT_ID,
|
|
70
|
+
clientSecret: ctx.env.RAYBASE_HOSTED_AUTH_CLIENT_SECRET,
|
|
71
|
+
authorizationUrl: `${ctx.env.RAYBASE_HOSTED_AUTH_URL || "https://auth.raybase.dev"}/oauth/authorize`,
|
|
72
|
+
tokenUrl: `${ctx.env.RAYBASE_HOSTED_AUTH_URL || "https://auth.raybase.dev"}/oauth/token`,
|
|
73
|
+
userInfoUrl: `${ctx.env.RAYBASE_HOSTED_AUTH_URL || "https://auth.raybase.dev"}/oauth/userinfo`,
|
|
74
|
+
scopes: ["openid", "email", "profile"]
|
|
75
|
+
}]
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
Use provider config values in this file and keep credentials in Worker secrets
|
|
79
|
+
or local .dev.vars. Do not add custom Better Auth handlers,
|
|
80
|
+
custom user/session/account tables, domain auto-provisioning, SAML/SCIM, group
|
|
81
|
+
mapping, or suite SSO behavior in Core apps.
|
|
82
|
+
|
|
83
|
+
GitHub can be useful for sign-in, but provisioning should only trust it after
|
|
84
|
+
you implement verified primary email retrieval. Apple requires app-owned client
|
|
85
|
+
secret JWT generation, usually with an app-owned jose dependency.
|
|
86
|
+
*/
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { defineRoles, type RaybaseConfig } from "@raybase/core";
|
|
2
|
+
|
|
3
|
+
export const appRoles = defineRoles(["manager"] as const);
|
|
4
|
+
|
|
5
|
+
export const appConfig = {
|
|
6
|
+
appName: "__APP_NAME__",
|
|
7
|
+
roles: appRoles,
|
|
8
|
+
// To remove the Core web admin panel, its APIs, and static assets from this
|
|
9
|
+
// deployment, set `admin: { enabled: false }`, then rebuild and redeploy.
|
|
10
|
+
// Operator MCP is separate; disable it with `mcp.operator.enabled: false`.
|
|
11
|
+
// admin: { enabled: false },
|
|
12
|
+
mcp: {
|
|
13
|
+
enabled: true,
|
|
14
|
+
oauth: {
|
|
15
|
+
dynamicClientRegistration: true,
|
|
16
|
+
allowedClientRedirectHosts: ["*"],
|
|
17
|
+
allowedClientMetadataHosts: ["*"]
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
realtime: { enabled: false },
|
|
21
|
+
auth: {
|
|
22
|
+
signupMode: "invite-only",
|
|
23
|
+
publicRoutes: [],
|
|
24
|
+
externalProviders: [],
|
|
25
|
+
devUsers: [
|
|
26
|
+
{ email: "dana@example.com", name: "Dana", role: "owner" },
|
|
27
|
+
{ email: "maya@example.com", name: "Maya", role: "manager" },
|
|
28
|
+
{ email: "riley@example.com", name: "Riley", role: "user" },
|
|
29
|
+
{ email: "quinn@example.com", name: "Quinn", role: "user" }
|
|
30
|
+
],
|
|
31
|
+
// Enable only after dev/SPEC.md records
|
|
32
|
+
// `Cloudflare email capability: transactional-email`, and after running
|
|
33
|
+
// `raybase email enable --from noreply@example.com` plus completing
|
|
34
|
+
// Cloudflare Email Service DNS onboarding:
|
|
35
|
+
// email: {
|
|
36
|
+
// provider: "cloudflare",
|
|
37
|
+
// binding: "EMAIL",
|
|
38
|
+
// from: "noreply@example.com",
|
|
39
|
+
// appUrl: "https://app.example.com",
|
|
40
|
+
// passwordReset: { enabled: true },
|
|
41
|
+
// invites: { enabled: true },
|
|
42
|
+
// welcome: { enabled: true },
|
|
43
|
+
// emailVerification: { enabled: false },
|
|
44
|
+
// magicLink: { enabled: false }
|
|
45
|
+
// }
|
|
46
|
+
// To use capped Raybase-hosted auth relay instead, run
|
|
47
|
+
// `raybase login`, then `raybase hosted-auth enable --origin https://app.example.com`.
|
|
48
|
+
// Keep the relay token in Worker secrets or local .dev.vars, never source:
|
|
49
|
+
// email: {
|
|
50
|
+
// provider: "raybase-relay",
|
|
51
|
+
// serviceUrl: "https://auth.raybase.dev",
|
|
52
|
+
// tokenEnv: "RAYBASE_HOSTED_AUTH_TOKEN",
|
|
53
|
+
// appUrl: "https://app.example.com",
|
|
54
|
+
// verificationChallenge: "paste-origin-challenge",
|
|
55
|
+
// passwordReset: { enabled: true },
|
|
56
|
+
// invites: { enabled: true },
|
|
57
|
+
// welcome: { enabled: true },
|
|
58
|
+
// emailVerification: { enabled: false },
|
|
59
|
+
// magicLink: { enabled: false }
|
|
60
|
+
// }
|
|
61
|
+
},
|
|
62
|
+
// To disable all MCP endpoints, set:
|
|
63
|
+
// mcp: { enabled: false }
|
|
64
|
+
// To keep app MCP but disable the scoped Operator MCP endpoint, set:
|
|
65
|
+
// mcp: { enabled: true, operator: { enabled: false } }
|
|
66
|
+
// To restrict production MCP to known clients, replace "*" with explicit
|
|
67
|
+
// allowed client redirect and metadata hostnames.
|
|
68
|
+
// To enable user-facing AI chat features, run `raybase ai enable`.
|
|
69
|
+
// Workers AI is the Core default. To route chat through Cloudflare AI Gateway,
|
|
70
|
+
// set ai.gateway.id and use a Gateway-routed model in ai.defaults.model.
|
|
71
|
+
// For BYOK, store only secret names here:
|
|
72
|
+
// gateway: { id: "my-gateway", authorizationSecretName: "OPENAI_API_KEY" }
|
|
73
|
+
// or use a Cloudflare AI Gateway Store Key:
|
|
74
|
+
// gateway: { id: "my-gateway", storeKeyName: "openai-prod" }
|
|
75
|
+
// ai: {
|
|
76
|
+
// enabled: true
|
|
77
|
+
// }
|
|
78
|
+
// External chat providers covered by AI Gateway should use the Core chat
|
|
79
|
+
// path. Capability Kits remain appropriate for non-chat modalities outside
|
|
80
|
+
// this contract, such as async image or video generation.
|
|
81
|
+
// To add app-specific user-facing agents, define them in src/ai/agents.ts and pass
|
|
82
|
+
// agents to createRaybaseApp in src/raybase.server.ts.
|
|
83
|
+
// To add app-owned external login providers, add metadata to auth.externalProviders,
|
|
84
|
+
// configure providers in src/raybase.auth.ts, put credentials in Worker secrets or
|
|
85
|
+
// local .dev.vars, then run raybase doctor.
|
|
86
|
+
} satisfies RaybaseConfig;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { env } from "cloudflare:workers";
|
|
2
|
+
import { actionRoute, mcpToolFromAction, rowAuthorization, withMcpAppUi } from "@raybase/core";
|
|
3
|
+
import { createRaybaseApp } from "@raybase/core/worker";
|
|
4
|
+
import type { RaybaseEnv } from "@raybase/core/worker";
|
|
5
|
+
import { docsModule } from "@raybase/docs";
|
|
6
|
+
import { appMigrations } from "./db/migrations.gen";
|
|
7
|
+
import { schema } from "./db/schema";
|
|
8
|
+
import { seed, seedVariants } from "./db/seed";
|
|
9
|
+
// import { storage } from "./db/storage";
|
|
10
|
+
import { actions } from "./actions";
|
|
11
|
+
// import { agents } from "./ai/agents";
|
|
12
|
+
// import { retrieval } from "./ai/retrieval";
|
|
13
|
+
import { search } from "./search";
|
|
14
|
+
import { settings } from "./settings";
|
|
15
|
+
import { externalAuth } from "./raybase.auth";
|
|
16
|
+
import { appConfig } from "./raybase.config";
|
|
17
|
+
import { todoDashboardMcpAppResource } from "./mcp-app";
|
|
18
|
+
|
|
19
|
+
const markTodoDoneRowAuthorization = rowAuthorization<{ id: string }, RaybaseEnv, typeof schema>({
|
|
20
|
+
table: "todos",
|
|
21
|
+
action: "update",
|
|
22
|
+
id: (input: { id: string }) => input.id
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const projectUpdateRowAuthorization = rowAuthorization<{ id: string }, RaybaseEnv, typeof schema>({
|
|
26
|
+
table: "projects",
|
|
27
|
+
action: "update",
|
|
28
|
+
id: (input: { id: string }) => input.id
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const projectDeleteRowAuthorization = rowAuthorization<{ id: string }, RaybaseEnv, typeof schema>({
|
|
32
|
+
table: "projects",
|
|
33
|
+
action: "delete",
|
|
34
|
+
id: (input: { id: string }) => input.id
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const todoUpdateRowAuthorization = rowAuthorization<{ id: string }, RaybaseEnv, typeof schema>({
|
|
38
|
+
table: "todos",
|
|
39
|
+
action: "update",
|
|
40
|
+
id: (input: { id: string }) => input.id
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const todoDeleteRowAuthorization = rowAuthorization<{ id: string }, RaybaseEnv, typeof schema>({
|
|
44
|
+
table: "todos",
|
|
45
|
+
action: "delete",
|
|
46
|
+
id: (input: { id: string }) => input.id
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const raybase = createRaybaseApp({
|
|
50
|
+
config: appConfig,
|
|
51
|
+
auth: externalAuth,
|
|
52
|
+
schema,
|
|
53
|
+
// storage,
|
|
54
|
+
appMigrations,
|
|
55
|
+
seed,
|
|
56
|
+
seedVariants,
|
|
57
|
+
actions,
|
|
58
|
+
// agents,
|
|
59
|
+
// retrieval,
|
|
60
|
+
search,
|
|
61
|
+
settings,
|
|
62
|
+
api: {
|
|
63
|
+
actions: [
|
|
64
|
+
actionRoute(actions.workspaceSnapshot),
|
|
65
|
+
actionRoute(actions.listVisibleProjects),
|
|
66
|
+
actionRoute(actions.listVisibleTodos),
|
|
67
|
+
actionRoute(actions.createProject),
|
|
68
|
+
actionRoute(actions.updateProject, {
|
|
69
|
+
rowAuthorization: projectUpdateRowAuthorization
|
|
70
|
+
}),
|
|
71
|
+
actionRoute(actions.archiveProject, {
|
|
72
|
+
rowAuthorization: projectUpdateRowAuthorization
|
|
73
|
+
}),
|
|
74
|
+
actionRoute(actions.deleteProject, {
|
|
75
|
+
rowAuthorization: projectDeleteRowAuthorization
|
|
76
|
+
}),
|
|
77
|
+
actionRoute(actions.createTodo),
|
|
78
|
+
actionRoute(actions.updateTodo, {
|
|
79
|
+
rowAuthorization: todoUpdateRowAuthorization
|
|
80
|
+
}),
|
|
81
|
+
actionRoute(actions.markTodoDone, {
|
|
82
|
+
rowAuthorization: markTodoDoneRowAuthorization
|
|
83
|
+
}),
|
|
84
|
+
actionRoute(actions.archiveTodo, {
|
|
85
|
+
rowAuthorization: todoUpdateRowAuthorization
|
|
86
|
+
}),
|
|
87
|
+
actionRoute(actions.deleteTodo, {
|
|
88
|
+
rowAuthorization: todoDeleteRowAuthorization
|
|
89
|
+
}),
|
|
90
|
+
actionRoute(actions.listAssignableUsers)
|
|
91
|
+
]
|
|
92
|
+
},
|
|
93
|
+
// raybase:modules:start
|
|
94
|
+
modules: [
|
|
95
|
+
docsModule<RaybaseEnv>()
|
|
96
|
+
],
|
|
97
|
+
// raybase:modules:end
|
|
98
|
+
mcp: {
|
|
99
|
+
resources: [todoDashboardMcpAppResource],
|
|
100
|
+
generatedTools: {
|
|
101
|
+
tables: {
|
|
102
|
+
// Todo status changes should use the declared action below so state-machine
|
|
103
|
+
// invariants, row authorization, action policy, and audit stay together.
|
|
104
|
+
todos: ["list", "get"],
|
|
105
|
+
projects: ["list", "get"]
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
tools: [
|
|
109
|
+
withMcpAppUi(
|
|
110
|
+
mcpToolFromAction(actions.workspaceSnapshot),
|
|
111
|
+
{ resourceUri: "ui://team-tasks/dashboard" }
|
|
112
|
+
),
|
|
113
|
+
mcpToolFromAction(actions.listVisibleProjects),
|
|
114
|
+
mcpToolFromAction(actions.listVisibleTodos),
|
|
115
|
+
mcpToolFromAction(actions.createProject),
|
|
116
|
+
mcpToolFromAction(actions.updateProject, {
|
|
117
|
+
rowAuthorization: projectUpdateRowAuthorization
|
|
118
|
+
}),
|
|
119
|
+
mcpToolFromAction(actions.archiveProject, {
|
|
120
|
+
rowAuthorization: projectUpdateRowAuthorization
|
|
121
|
+
}),
|
|
122
|
+
mcpToolFromAction(actions.deleteProject, {
|
|
123
|
+
rowAuthorization: projectDeleteRowAuthorization
|
|
124
|
+
}),
|
|
125
|
+
mcpToolFromAction(actions.createTodo),
|
|
126
|
+
mcpToolFromAction(actions.updateTodo, {
|
|
127
|
+
rowAuthorization: todoUpdateRowAuthorization
|
|
128
|
+
}),
|
|
129
|
+
mcpToolFromAction(actions.markTodoDone, {
|
|
130
|
+
rowAuthorization: markTodoDoneRowAuthorization
|
|
131
|
+
}),
|
|
132
|
+
mcpToolFromAction(actions.archiveTodo, {
|
|
133
|
+
rowAuthorization: todoUpdateRowAuthorization
|
|
134
|
+
}),
|
|
135
|
+
mcpToolFromAction(actions.deleteTodo, {
|
|
136
|
+
rowAuthorization: todoDeleteRowAuthorization
|
|
137
|
+
}),
|
|
138
|
+
mcpToolFromAction(actions.listAssignableUsers)
|
|
139
|
+
]
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
export const raybaseHandler = raybase.handler;
|
|
144
|
+
export class RaybaseAIChatAgentObject extends raybase.RaybaseAIChatAgentObject {}
|
|
145
|
+
|
|
146
|
+
const executionContext = {
|
|
147
|
+
waitUntil() {},
|
|
148
|
+
passThroughOnException() {},
|
|
149
|
+
props: {}
|
|
150
|
+
} as unknown as ExecutionContext;
|
|
151
|
+
|
|
152
|
+
export async function handleRaybaseRequest(request: Request): Promise<Response> {
|
|
153
|
+
if (!raybaseHandler.fetch) throw new Error("Raybase handler is not fetch-compatible");
|
|
154
|
+
return raybaseHandler.fetch(request as never, env as never, executionContext as never);
|
|
155
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createRealtimeClient, type RealtimeStatus } from "@raybase/core";
|
|
2
|
+
|
|
3
|
+
// Disabled recipe: this file is not imported by the starter.
|
|
4
|
+
//
|
|
5
|
+
// To enable a live todos list:
|
|
6
|
+
// 1. Set appConfig.realtime.enabled to true in src/raybase.config.ts.
|
|
7
|
+
// 2. Keep mutations on Raybase data clients or declared actions so table
|
|
8
|
+
// changes are broadcast through the runtime.
|
|
9
|
+
// 3. Use createRealtimeClient() from browser code to subscribe to /api/realtime.
|
|
10
|
+
// 4. Resync from /api/data on reconnect or gap events; liveList() does this.
|
|
11
|
+
// 5. Run `raybase migrate`, `raybase doctor`, and browser-test reconnects.
|
|
12
|
+
|
|
13
|
+
export type TodoRealtimeRow = {
|
|
14
|
+
id: string;
|
|
15
|
+
projectId: string;
|
|
16
|
+
title: string;
|
|
17
|
+
status: string;
|
|
18
|
+
updatedAt?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export function createTodosLiveList(handlers: {
|
|
22
|
+
onChange: (rows: TodoRealtimeRow[]) => void;
|
|
23
|
+
onStatus?: (status: RealtimeStatus) => void;
|
|
24
|
+
onError?: (error: Error | null) => void;
|
|
25
|
+
}) {
|
|
26
|
+
const realtime = createRealtimeClient();
|
|
27
|
+
const list = realtime.table("todos").liveList<TodoRealtimeRow>({
|
|
28
|
+
limit: 100,
|
|
29
|
+
sort: { column: "updatedAt", direction: "desc" }
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const unsubscribe = list.subscribe(() => {
|
|
33
|
+
handlers.onChange(list.rows);
|
|
34
|
+
handlers.onStatus?.(list.status);
|
|
35
|
+
handlers.onError?.(list.error);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
reload: list.reload,
|
|
40
|
+
close() {
|
|
41
|
+
unsubscribe();
|
|
42
|
+
list.unsubscribe();
|
|
43
|
+
realtime.close();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRouter as createTanStackRouter } from "@tanstack/react-router";
|
|
2
|
+
import { routeTree } from "./routeTree.gen";
|
|
3
|
+
|
|
4
|
+
export function createRouter() {
|
|
5
|
+
return createTanStackRouter({
|
|
6
|
+
routeTree,
|
|
7
|
+
scrollRestoration: true
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function getRouter() {
|
|
12
|
+
return createRouter();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
declare module "@tanstack/react-router" {
|
|
16
|
+
interface Register {
|
|
17
|
+
router: ReturnType<typeof createRouter>;
|
|
18
|
+
}
|
|
19
|
+
}
|