@raybase/create 0.0.2 → 0.3.4
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 +2353 -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,336 @@
|
|
|
1
|
+
# Cross-Site Scripting (XSS) Prevention Reference
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
XSS occurs when applications include untrusted data in web pages without proper validation or escaping. Attackers can execute scripts in victims' browsers to hijack sessions, deface websites, or redirect users to malicious sites.
|
|
6
|
+
|
|
7
|
+
## XSS Types
|
|
8
|
+
|
|
9
|
+
| Type | Description | Example |
|
|
10
|
+
|------|-------------|---------|
|
|
11
|
+
| **Reflected** | Malicious script from current HTTP request | URL parameter rendered in response |
|
|
12
|
+
| **Stored** | Malicious script stored in target server | Comment field saved and displayed |
|
|
13
|
+
| **DOM-based** | Vulnerability in client-side code | JavaScript reads URL and writes to DOM |
|
|
14
|
+
|
|
15
|
+
## Output Encoding by Context
|
|
16
|
+
|
|
17
|
+
### HTML Body Context
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
// VULNERABLE: innerHTML with user data
|
|
21
|
+
element.innerHTML = userInput;
|
|
22
|
+
|
|
23
|
+
// SAFE: Use textContent
|
|
24
|
+
element.textContent = userInput;
|
|
25
|
+
|
|
26
|
+
// SAFE: Use createTextNode
|
|
27
|
+
document.createTextNode(userInput);
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**HTML Entity Encoding**
|
|
31
|
+
| Character | Encoding |
|
|
32
|
+
|-----------|----------|
|
|
33
|
+
| `<` | `<` |
|
|
34
|
+
| `>` | `>` |
|
|
35
|
+
| `&` | `&` |
|
|
36
|
+
| `"` | `"` |
|
|
37
|
+
| `'` | `'` |
|
|
38
|
+
|
|
39
|
+
### HTML Attribute Context
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
<!-- VULNERABLE: Unquoted attribute -->
|
|
43
|
+
<input value=${userInput}>
|
|
44
|
+
|
|
45
|
+
<!-- VULNERABLE: Event handler with user data -->
|
|
46
|
+
<button onclick="doSomething('${userInput}')">
|
|
47
|
+
|
|
48
|
+
<!-- SAFE: Quoted attribute with encoding -->
|
|
49
|
+
<input value="${htmlEncode(userInput)}">
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Rules:**
|
|
53
|
+
- Always quote attribute values
|
|
54
|
+
- Never place user input in event handlers (`onclick`, `onerror`, etc.)
|
|
55
|
+
- Use `setAttribute()` which auto-encodes
|
|
56
|
+
|
|
57
|
+
### JavaScript Context
|
|
58
|
+
|
|
59
|
+
```javascript
|
|
60
|
+
// VULNERABLE: eval with user input
|
|
61
|
+
eval(userInput);
|
|
62
|
+
|
|
63
|
+
// VULNERABLE: setTimeout with string
|
|
64
|
+
setTimeout("doSomething('" + userInput + "')", 1000);
|
|
65
|
+
|
|
66
|
+
// VULNERABLE: Function constructor
|
|
67
|
+
new Function("return " + userInput)();
|
|
68
|
+
|
|
69
|
+
// SAFE: JSON encoding for data
|
|
70
|
+
const data = JSON.parse(jsonString);
|
|
71
|
+
|
|
72
|
+
// SAFE: setTimeout with function
|
|
73
|
+
setTimeout(() => doSomething(userInput), 1000);
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Safe JavaScript Locations** (with proper encoding):
|
|
77
|
+
- Inside quoted string values only
|
|
78
|
+
- Never directly in script blocks
|
|
79
|
+
|
|
80
|
+
### URL Context
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
// VULNERABLE: User input in href
|
|
84
|
+
element.href = userInput;
|
|
85
|
+
|
|
86
|
+
// VULNERABLE: javascript: URL scheme
|
|
87
|
+
<a href="javascript:${userInput}">
|
|
88
|
+
|
|
89
|
+
// SAFE: Validate URL scheme
|
|
90
|
+
const url = new URL(userInput);
|
|
91
|
+
if (url.protocol === 'https:' || url.protocol === 'http:') {
|
|
92
|
+
element.href = url.toString();
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// SAFE: Encode URL parameters
|
|
96
|
+
const encoded = encodeURIComponent(userInput);
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### CSS Context
|
|
100
|
+
|
|
101
|
+
```css
|
|
102
|
+
/* VULNERABLE: User input in style */
|
|
103
|
+
.element { background: url(${userInput}); }
|
|
104
|
+
|
|
105
|
+
/* VULNERABLE: Expression in CSS */
|
|
106
|
+
.element { behavior: expression(${userInput}); }
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
**Rules:**
|
|
110
|
+
- Place user data only in CSS property values
|
|
111
|
+
- Never allow user input in selectors or URLs
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Safe DOM Sinks
|
|
116
|
+
|
|
117
|
+
**Use These:**
|
|
118
|
+
```javascript
|
|
119
|
+
elem.textContent = variable;
|
|
120
|
+
elem.insertAdjacentText('beforeend', variable);
|
|
121
|
+
elem.className = variable; // for class names
|
|
122
|
+
elem.setAttribute('data-value', variable);
|
|
123
|
+
formField.value = variable;
|
|
124
|
+
document.createTextNode(variable);
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Avoid These:**
|
|
128
|
+
```javascript
|
|
129
|
+
elem.innerHTML = variable; // XSS
|
|
130
|
+
elem.outerHTML = variable; // XSS
|
|
131
|
+
document.write(variable); // XSS
|
|
132
|
+
document.writeln(variable); // XSS
|
|
133
|
+
eval(variable); // Code execution
|
|
134
|
+
setTimeout(variable); // If string argument
|
|
135
|
+
setInterval(variable); // If string argument
|
|
136
|
+
new Function(variable); // Code execution
|
|
137
|
+
elem.insertAdjacentHTML(); // XSS
|
|
138
|
+
elem.onevent = variable; // Event handler
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
## Framework-Specific Considerations
|
|
144
|
+
|
|
145
|
+
### React
|
|
146
|
+
|
|
147
|
+
```jsx
|
|
148
|
+
// SAFE: Auto-escaped by default
|
|
149
|
+
<div>{userInput}</div>
|
|
150
|
+
|
|
151
|
+
// VULNERABLE: dangerouslySetInnerHTML
|
|
152
|
+
<div dangerouslySetInnerHTML={{__html: userInput}} />
|
|
153
|
+
|
|
154
|
+
// SAFE: Sanitize before using dangerouslySetInnerHTML
|
|
155
|
+
import DOMPurify from 'dompurify';
|
|
156
|
+
<div dangerouslySetInnerHTML={{__html: DOMPurify.sanitize(userInput)}} />
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Angular
|
|
160
|
+
|
|
161
|
+
```typescript
|
|
162
|
+
// SAFE: Auto-escaped by default
|
|
163
|
+
<div>{{ userInput }}</div>
|
|
164
|
+
|
|
165
|
+
// VULNERABLE: bypassSecurityTrust*
|
|
166
|
+
this.sanitizer.bypassSecurityTrustHtml(userInput);
|
|
167
|
+
|
|
168
|
+
// Use bypassSecurityTrust* only with sanitized input
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### Vue
|
|
172
|
+
|
|
173
|
+
```html
|
|
174
|
+
<!-- SAFE: Auto-escaped -->
|
|
175
|
+
<div>{{ userInput }}</div>
|
|
176
|
+
|
|
177
|
+
<!-- VULNERABLE: v-html directive -->
|
|
178
|
+
<div v-html="userInput"></div>
|
|
179
|
+
|
|
180
|
+
<!-- SAFE: Sanitize first -->
|
|
181
|
+
<div v-html="sanitizedInput"></div>
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Django/Jinja2
|
|
185
|
+
|
|
186
|
+
```django
|
|
187
|
+
<!-- SAFE: Auto-escaped by default -->
|
|
188
|
+
{{ user_input }}
|
|
189
|
+
|
|
190
|
+
<!-- VULNERABLE: |safe filter -->
|
|
191
|
+
{{ user_input|safe }}
|
|
192
|
+
|
|
193
|
+
<!-- VULNERABLE: {% autoescape off %} -->
|
|
194
|
+
{% autoescape off %}
|
|
195
|
+
{{ user_input }}
|
|
196
|
+
{% endautoescape %}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## HTML Sanitization
|
|
202
|
+
|
|
203
|
+
When users must submit HTML (rich text editors), use a sanitization library.
|
|
204
|
+
|
|
205
|
+
```javascript
|
|
206
|
+
// Recommended: DOMPurify
|
|
207
|
+
import DOMPurify from 'dompurify';
|
|
208
|
+
|
|
209
|
+
const clean = DOMPurify.sanitize(dirty);
|
|
210
|
+
|
|
211
|
+
// With configuration
|
|
212
|
+
const clean = DOMPurify.sanitize(dirty, {
|
|
213
|
+
ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a'],
|
|
214
|
+
ALLOWED_ATTR: ['href']
|
|
215
|
+
});
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**Key Points:**
|
|
219
|
+
- Keep sanitization libraries updated
|
|
220
|
+
- Configure allowed tags/attributes based on needs
|
|
221
|
+
- Sanitize on output, not just input
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Content Security Policy (CSP)
|
|
226
|
+
|
|
227
|
+
CSP provides defense-in-depth but should not be the primary XSS defense.
|
|
228
|
+
|
|
229
|
+
### Strict CSP (Recommended)
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
Content-Security-Policy:
|
|
233
|
+
default-src 'self';
|
|
234
|
+
script-src 'nonce-{RANDOM}' 'strict-dynamic';
|
|
235
|
+
object-src 'none';
|
|
236
|
+
base-uri 'none';
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Nonce-Based Approach
|
|
240
|
+
|
|
241
|
+
```html
|
|
242
|
+
<!-- Server generates unique nonce per request -->
|
|
243
|
+
<script nonce="r4nd0m123">
|
|
244
|
+
// Allowed script
|
|
245
|
+
</script>
|
|
246
|
+
|
|
247
|
+
<script>
|
|
248
|
+
// Blocked - no nonce
|
|
249
|
+
</script>
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Hash-Based Approach
|
|
253
|
+
|
|
254
|
+
```
|
|
255
|
+
Content-Security-Policy: script-src 'sha256-base64hash...'
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## DOM-based XSS Prevention
|
|
261
|
+
|
|
262
|
+
### Dangerous Sources
|
|
263
|
+
|
|
264
|
+
```javascript
|
|
265
|
+
// Attacker-controllable sources
|
|
266
|
+
location.hash
|
|
267
|
+
location.search
|
|
268
|
+
document.referrer
|
|
269
|
+
window.name
|
|
270
|
+
postMessage data
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Prevention
|
|
274
|
+
|
|
275
|
+
```javascript
|
|
276
|
+
// VULNERABLE: Direct use of source in sink
|
|
277
|
+
element.innerHTML = location.hash.slice(1);
|
|
278
|
+
|
|
279
|
+
// SAFE: Validate and encode
|
|
280
|
+
const hash = location.hash.slice(1);
|
|
281
|
+
if (/^[a-zA-Z0-9-]+$/.test(hash)) {
|
|
282
|
+
element.textContent = hash;
|
|
283
|
+
}
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## Key Grep Patterns for Detection
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
# Dangerous DOM sinks
|
|
292
|
+
grep -rn "innerHTML\|outerHTML\|document\.write" --include="*.js" --include="*.jsx"
|
|
293
|
+
grep -rn "dangerouslySetInnerHTML" --include="*.jsx" --include="*.tsx"
|
|
294
|
+
grep -rn "v-html" --include="*.vue"
|
|
295
|
+
grep -rn "\|safe\|autoescape off" --include="*.html" --include="*.jinja"
|
|
296
|
+
|
|
297
|
+
# Dangerous JavaScript
|
|
298
|
+
grep -rn "eval(\|Function(\|setTimeout.*string\|setInterval.*string" --include="*.js"
|
|
299
|
+
|
|
300
|
+
# Framework bypasses
|
|
301
|
+
grep -rn "bypassSecurityTrust" --include="*.ts"
|
|
302
|
+
grep -rn "mark_safe\|SafeString" --include="*.py"
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Testing Payloads
|
|
308
|
+
|
|
309
|
+
**Basic:**
|
|
310
|
+
```
|
|
311
|
+
<script>alert('XSS')</script>
|
|
312
|
+
<img src=x onerror=alert('XSS')>
|
|
313
|
+
<svg onload=alert('XSS')>
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
**Attribute Escape:**
|
|
317
|
+
```
|
|
318
|
+
" onmouseover="alert('XSS')
|
|
319
|
+
' onclick='alert("XSS")
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
**JavaScript Context:**
|
|
323
|
+
```
|
|
324
|
+
';alert('XSS')//
|
|
325
|
+
\';alert(\'XSS\')//
|
|
326
|
+
</script><script>alert('XSS')</script>
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
---
|
|
330
|
+
|
|
331
|
+
## References
|
|
332
|
+
|
|
333
|
+
- [OWASP XSS Prevention Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Cross_Site_Scripting_Prevention_Cheat_Sheet.html)
|
|
334
|
+
- [OWASP DOM-based XSS Prevention](https://cheatsheetseries.owasp.org/cheatsheets/DOM_based_XSS_Prevention_Cheat_Sheet.html)
|
|
335
|
+
- [OWASP CSP Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/Content_Security_Policy_Cheat_Sheet.html)
|
|
336
|
+
- [CWE-79: Cross-site Scripting](https://cwe.mitre.org/data/definitions/79.html)
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: raybase-realtime
|
|
3
|
+
description: Add or review Raybase realtime features. Use when enabling appConfig.realtime, subscribing to table changes, live lists, presence rooms, notification feed updates, WebSocket limits, retention, or avoiding custom websocket/feed implementations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Raybase Realtime
|
|
7
|
+
|
|
8
|
+
Use this skill for live table updates, collaborative presence, notification
|
|
9
|
+
feed updates, or any request that might otherwise tempt a custom WebSocket
|
|
10
|
+
implementation.
|
|
11
|
+
|
|
12
|
+
## Enable Runtime
|
|
13
|
+
|
|
14
|
+
Realtime is off by default. Enable it only when the app has a real live-update
|
|
15
|
+
surface such as live lists, subscriptions, presence, or notification feed
|
|
16
|
+
updates. Do not turn it on speculatively; it adds a WebSocket
|
|
17
|
+
endpoint and more policy surface to verify.
|
|
18
|
+
|
|
19
|
+
Enable it in the template's Raybase config file. TanStack Start and
|
|
20
|
+
astro-emdash apps use `src/raybase.config.ts`; React Router apps define
|
|
21
|
+
`appConfig` in `app/db/schema.ts`.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
export const appConfig = {
|
|
25
|
+
// ...
|
|
26
|
+
realtime: {
|
|
27
|
+
enabled: true,
|
|
28
|
+
endpoint: "/api/realtime",
|
|
29
|
+
retention: { maxChanges: 1000, maxAgeSeconds: 300 },
|
|
30
|
+
limits: {
|
|
31
|
+
maxSockets: 200,
|
|
32
|
+
maxSubscriptionsPerSocket: 32,
|
|
33
|
+
maxPresenceRoomsPerSocket: 16,
|
|
34
|
+
maxPresenceStateBytes: 2048
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Use defaults unless the app has a clear scale or retention requirement.
|
|
41
|
+
`createRaybaseApp` wires the endpoint into the Raybase handler and Durable
|
|
42
|
+
Object broadcast path from config. Do not add another WebSocket route for app
|
|
43
|
+
data.
|
|
44
|
+
|
|
45
|
+
## Subscribe From UI
|
|
46
|
+
|
|
47
|
+
Use `createRealtimeClient()` from `@raybase/core`:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { createRealtimeClient } from "@raybase/core";
|
|
51
|
+
|
|
52
|
+
const realtime = createRealtimeClient();
|
|
53
|
+
|
|
54
|
+
const subscription = realtime.table("todos").subscribe(
|
|
55
|
+
{ filter: { status: "open" } },
|
|
56
|
+
{
|
|
57
|
+
onInsert: (row) => setRows((rows) => [...rows, row]),
|
|
58
|
+
onUpdate: (row, prev) => setRows((rows) => rows.map((item) => item.id === prev.id ? row : item)),
|
|
59
|
+
onDelete: (id) => setRows((rows) => rows.filter((item) => item.id !== id)),
|
|
60
|
+
onStatus: (status) => setStatus(status),
|
|
61
|
+
onError: (error) => setError(error)
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
|
|
65
|
+
const cleanup = () => subscription.unsubscribe();
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
For simple lists, prefer `liveList()`:
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
const liveTodos = realtime.table("todos").liveList({ sort: { column: "updatedAt", direction: "desc" } });
|
|
72
|
+
const stopListening = liveTodos.subscribe(() => {
|
|
73
|
+
setRows(liveTodos.rows);
|
|
74
|
+
setStatus(liveTodos.status);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
const cleanup = () => {
|
|
78
|
+
stopListening();
|
|
79
|
+
liveTodos.unsubscribe();
|
|
80
|
+
};
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
For component lifecycles, call `subscription.unsubscribe()` for direct
|
|
84
|
+
subscriptions. For `liveList()`, call both the listener cleanup returned by
|
|
85
|
+
`liveList.subscribe()` and `liveList.unsubscribe()` to end the realtime
|
|
86
|
+
subscription. Call `realtime.close()` when the whole client scope is done.
|
|
87
|
+
|
|
88
|
+
## Presence
|
|
89
|
+
|
|
90
|
+
Use presence for lightweight collaboration state, not durable business state:
|
|
91
|
+
|
|
92
|
+
```ts
|
|
93
|
+
const room = realtime.presence<{ cursor?: string }>("project:proj_123");
|
|
94
|
+
const stop = room.onSync((members) => setMembers(members));
|
|
95
|
+
room.set({ cursor: selectedTaskId });
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Presence state is limited by `maxPresenceStateBytes`. Store durable comments,
|
|
99
|
+
assignments, approvals, and activity history in app tables, then use realtime
|
|
100
|
+
only to reflect changes.
|
|
101
|
+
|
|
102
|
+
## Data Change Rules
|
|
103
|
+
|
|
104
|
+
- Raybase emits table changes when writes go through the policy-checked data
|
|
105
|
+
client, actions, admin data API, imports, or Raybase internals that call
|
|
106
|
+
`runWithChange`.
|
|
107
|
+
- Direct SQL writes bypass policy filtering and may not emit realtime changes.
|
|
108
|
+
Avoid direct SQL for app workflows; it can leave subscribers with missing
|
|
109
|
+
fanout, stale lists, or resync gaps that are hard to explain to users.
|
|
110
|
+
- Subscriptions are filtered by the subscriber's read policy and list options.
|
|
111
|
+
If an update causes a row to become invisible, clients should see a delete or
|
|
112
|
+
resync rather than leaked row data.
|
|
113
|
+
- Clients may receive `resync` for gaps, retention expiry, policy changes, or
|
|
114
|
+
reconnects. Fetch the authoritative list again instead of guessing.
|
|
115
|
+
Treat resync as a correctness signal, not an error to hide.
|
|
116
|
+
|
|
117
|
+
## Built-In Realtime Surfaces
|
|
118
|
+
|
|
119
|
+
- Notifications use Raybase realtime feed events when notifications are
|
|
120
|
+
enabled. Follow `raybase-notifications`; do not build custom notification
|
|
121
|
+
feed sockets.
|
|
122
|
+
- Agent chat uses the Agent runtime and `@raybase/agent-ui`, not app-owned
|
|
123
|
+
realtime subscriptions. Do not build a separate chat socket. The built-in
|
|
124
|
+
Agent conversation socket is the one live read protocol for both direct and
|
|
125
|
+
room conversations:
|
|
126
|
+
- room-member writes remain HTTP: ack-only idempotent `POST .../messages`, plain
|
|
127
|
+
`GET .../requests/:requestKey` status polling, and cooperative
|
|
128
|
+
`POST .../cancel`;
|
|
129
|
+
- `POST .../ws-token` mints the short-lived socket credential, and the
|
|
130
|
+
socket accepts only `subscribe` plus keepalive frames from the client;
|
|
131
|
+
- committed `message`, `run`, `membership`, `redaction`, `title`, and
|
|
132
|
+
`chapter` events use one dense per-conversation `seq`; an observed gap is
|
|
133
|
+
repaired by resubscribing with the last applied sequence so replay happens
|
|
134
|
+
before live fanout;
|
|
135
|
+
- `resync` is reserved for cursors outside chapter-watermark/numeric
|
|
136
|
+
retention bounds or a gap replay cannot satisfy. Reload the authoritative
|
|
137
|
+
snapshot and its sequence watermark, then subscribe again;
|
|
138
|
+
- `delta` and presence frames are ephemeral and unsequenced. Backpressure
|
|
139
|
+
may drop deltas without `resync`; the committed message event is truth;
|
|
140
|
+
- keepalive applies to idle sockets, and the default connection cap is 16
|
|
141
|
+
sockets per conversation, including public Guide conversations.
|
|
142
|
+
- Operator/admin evidence stays Raybase-owned. Do not add app realtime
|
|
143
|
+
shortcuts around admin authorization.
|
|
144
|
+
|
|
145
|
+
## Verification
|
|
146
|
+
|
|
147
|
+
Run `raybase doctor`, then test with two signed-in users:
|
|
148
|
+
|
|
149
|
+
- Allowed user sees inserts, updates, deletes, reconnects, and resync.
|
|
150
|
+
- Denied user does not receive private rows, titles, or delete hints that reveal
|
|
151
|
+
forbidden records.
|
|
152
|
+
- Presence join/update/leave works and does not store durable business state.
|
|
153
|
+
- When an Agent conversation is in scope, verify ack-only sends, status
|
|
154
|
+
polling, receive-only socket enforcement, replay after a sequence gap,
|
|
155
|
+
snapshot recovery after `resync`, lossy-delta recovery through the committed
|
|
156
|
+
message, token re-mint, keepalive, and the per-conversation connection cap.
|
|
157
|
+
- Disabling `appConfig.realtime.enabled` removes the WebSocket endpoint instead
|
|
158
|
+
of leaving a custom fallback route.
|