create-disposabl-app 0.1.0 → 0.1.1
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/dist/index.js +21 -22
- package/dist/templates/default/apps/desktop/.oxfmtrc.json +5 -0
- package/dist/templates/default/apps/desktop/.oxlintrc.json +6 -0
- package/dist/templates/default/apps/desktop/README.md +58 -0
- package/dist/templates/default/apps/desktop/forge.config.mts +90 -0
- package/dist/templates/default/apps/desktop/index.html +12 -0
- package/dist/templates/default/apps/desktop/package.json +55 -1
- package/dist/templates/default/apps/desktop/src/declarations.d.ts +2 -0
- package/dist/templates/default/apps/desktop/src/index.css +8 -0
- package/dist/templates/default/apps/desktop/src/main.ts +58 -0
- package/dist/templates/default/apps/desktop/src/preload.ts +3 -0
- package/dist/templates/default/apps/desktop/src/renderer.ts +19 -0
- package/dist/templates/default/apps/desktop/tsconfig.json +14 -0
- package/dist/templates/default/apps/desktop/vite.main.config.mts +4 -0
- package/dist/templates/default/apps/desktop/vite.preload.config.mts +4 -0
- package/dist/templates/default/apps/desktop/vite.renderer.config.mts +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/agent-device/SKILL.md +22 -0
- package/dist/templates/default/apps/mobile/.agents/skills/android-emulator/SKILL.md +32 -0
- package/dist/templates/default/apps/mobile/.agents/skills/dogfood/SKILL.md +27 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/SKILL.md +176 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/app-store-metadata.md +497 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/ios-app-store.md +376 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/native-ios.md +167 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/play-store.md +244 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/testflight.md +62 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-app-stores/references/workflows.md +120 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-hosting/SKILL.md +431 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-hosting/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/SKILL.md +46 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/references/metrics.md +98 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/references/queries.md +444 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/references/setup.md +529 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-observe/references/third-party.md +136 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/SKILL.md +237 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/references/controllers.md +139 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/references/logs-and-crashes.md +101 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/references/run-your-app.md +256 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-simulator/references/troubleshooting.md +56 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update/SKILL.md +146 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update-insights/SKILL.md +238 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update-insights/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update-insights/references/channel-insights-schema.md +47 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-update-insights/references/update-insights-schema.md +69 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-workflows/SKILL.md +99 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-workflows/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-workflows/scripts/fetch.js +109 -0
- package/dist/templates/default/apps/mobile/.agents/skills/eas-workflows/scripts/package.json +6 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-animation/LICENSE +21 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-animation/RECIPES.md +385 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-animation/SKILL.md +274 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-animation/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-app-clip/SKILL.md +290 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-app-clip/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-app-clip/references/native-module.md +96 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/SKILL.md +69 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/brownfield-integrated.md +551 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/brownfield-isolated.md +449 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/comparison.md +63 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/feature-integration.md +163 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/troubleshooting.md +88 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-brownfield/references/version-compatibility.md +40 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-data-fetching/SKILL.md +478 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-data-fetching/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-data-fetching/references/expo-router-loaders.md +341 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-data-fetching/references/offline-and-cancellation.md +68 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-design-system/SKILL.md +376 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-design-system/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-design-system/references/audit.md +190 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-design-system/references/native-slop.md +74 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-dev-client/SKILL.md +184 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-dev-client/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-dom/SKILL.md +425 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-dom/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-examples/SKILL.md +106 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-examples/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-examples/references/catalog.md +105 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/SKILL.md +124 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/references/compatibility.md +130 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/references/example.md +212 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-migrate-module/references/migration-map.md +457 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/SKILL.md +151 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/config-plugin.md +90 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/create-expo-module.md +206 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/lifecycle.md +127 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/module-config.md +48 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/native-module.md +286 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-module/references/native-view.md +171 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/SKILL.md +201 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/controls.md +231 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/gradients.md +106 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/icons.md +232 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/media.md +193 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/storage.md +121 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/visual-effects.md +198 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-native-ui/references/webgpu-three.md +605 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-overview/SKILL.md +120 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-overview/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-overview/references/launch-without-dev-menu.md +24 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-project-structure/SKILL.md +114 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-project-structure/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/SKILL.md +240 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/form-sheet.md +253 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/route-structure.md +229 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/search.md +248 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/tabs.md +433 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/toolbar-and-headers.md +284 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-router/references/zoom-transitions.md +158 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/SKILL.md +314 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/agents/visual-grader.md +52 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/references/design-rubric.md +45 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/references/runtime-matrix.md +34 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/check-static.sh +64 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/clean-fixture.sh +56 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/generate_viewer.py +450 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/latest-sdk.sh +46 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/make-fixture.sh +95 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/make-workspace.sh +31 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/snapshot-android.sh +284 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/snapshot-ios.sh +132 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-skill-eval/scripts/snapshot-web.sh +61 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/SKILL.md +101 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/references/drop-in-replacements.md +27 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/references/jetpack-compose.md +73 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/references/swift-ui.md +73 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/references/universal.md +104 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-ui/scripts/list-components.js +193 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/SKILL.md +150 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/expo-av-to-audio.md +132 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/expo-av-to-video.md +160 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/native-tabs.md +124 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/new-architecture.md +79 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/react-19.md +79 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/react-compiler.md +59 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-upgrade/references/react-navigation-to-expo-router.md +61 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/SKILL.md +91 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/references/false-friends.md +119 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/references/native-patterns.md +39 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/references/run-as-goal.md +48 -0
- package/dist/templates/default/apps/mobile/.agents/skills/expo-web-to-native/references/verify-on-device.md +45 -0
- package/dist/templates/default/apps/mobile/.agents/skills/ios-simulator/SKILL.md +32 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/POWER.md +172 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/SKILL.md +238 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/agents/openai.yaml +4 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-analyze-app.md +208 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-analyze-js.md +264 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-barrel-exports.md +250 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-code-splitting.md +255 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-hermes-mmap.md +167 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-library-size.md +164 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-native-assets.md +208 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-r8-android.md +231 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/bundle-tree-shaking.md +215 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/bundle-treemap-source-map-explorer.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/controlled-textinput-pingpong.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/devtools-flamegraph.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/emerge-xray-ios.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/expo-atlas-treemap.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/flashlight-flatlist-vs-flashlist.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/fps-drop-graph.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/memory-heap-snapshot.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/tti-warm-start-diagram.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/view-hierarchy-flattening.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/xcode-instruments-templates.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/images/xcode-thread-view.png +0 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-animations-reanimated.md +273 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-atomic-state.md +190 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-bottomsheet.md +339 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-concurrent-react.md +238 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-lists-flatlist-flashlist.md +223 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-measure-fps.md +178 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-memory-leaks.md +168 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-profile-react.md +138 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-react-compiler.md +261 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/js-uncontrolled-components.md +219 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-android-16kb-alignment.md +114 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-measure-tti.md +221 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-memory-leaks.md +206 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-memory-patterns.md +240 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-platform-setup.md +112 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-profiling.md +140 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-sdks-over-polyfills.md +192 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-threading-model.md +230 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-turbo-modules.md +210 -0
- package/dist/templates/default/apps/mobile/.agents/skills/react-native-best-practices/references/native-view-flattening.md +180 -0
- package/dist/templates/default/apps/mobile/AGENTS.md +41 -0
- package/dist/templates/default/apps/mobile/app.json +38 -0
- package/dist/templates/default/apps/mobile/assets/expo.icon/Assets/expo-symbol 2.svg +3 -0
- package/dist/templates/default/apps/mobile/assets/expo.icon/Assets/grid.png +0 -0
- package/dist/templates/default/apps/mobile/assets/expo.icon/icon.json +40 -0
- package/dist/templates/default/apps/mobile/assets/images/android-icon-background.png +0 -0
- package/dist/templates/default/apps/mobile/assets/images/android-icon-foreground.png +0 -0
- package/dist/templates/default/apps/mobile/assets/images/android-icon-monochrome.png +0 -0
- package/dist/templates/default/apps/mobile/assets/images/icon.png +0 -0
- package/dist/templates/default/apps/mobile/assets/images/splash-icon.png +0 -0
- package/dist/templates/default/apps/mobile/eslint.config.js +10 -0
- package/dist/templates/default/apps/mobile/package.json +43 -1
- package/dist/templates/default/apps/mobile/skills-lock.json +185 -0
- package/dist/templates/default/apps/mobile/src/app/_layout.tsx +5 -0
- package/dist/templates/default/apps/mobile/src/app/index.tsx +17 -0
- package/dist/templates/default/apps/mobile/tsconfig.json +20 -0
- package/dist/templates/default/apps/web/.agents/skills/frontend-design/SKILL.md +71 -0
- package/dist/templates/default/apps/web/.agents/skills/web-design-guidelines/SKILL.md +39 -0
- package/dist/templates/default/apps/web/.env.example +3 -0
- package/dist/templates/default/apps/web/components.json +23 -0
- package/dist/templates/default/apps/web/eslint.config.ts +21 -0
- package/dist/templates/default/apps/web/package.json +39 -1
- package/dist/templates/default/apps/web/public/disposabl-logo.svg +8 -0
- package/dist/templates/default/apps/web/public/favicon.ico +0 -0
- package/dist/templates/default/apps/web/public/manifest.json +25 -0
- package/dist/templates/default/apps/web/skills-lock.json +17 -0
- package/dist/templates/default/apps/web/src/index.css +92 -0
- package/dist/templates/default/apps/web/src/routeTree.gen.ts +282 -0
- package/dist/templates/default/apps/web/src/router/__root.tsx +63 -0
- package/dist/templates/default/apps/web/src/router/_authenticated/dashboard.tsx +9 -0
- package/dist/templates/default/apps/web/src/router/_authenticated/todos/$id.tsx +27 -0
- package/dist/templates/default/apps/web/src/router/_authenticated/todos/index.tsx +33 -0
- package/dist/templates/default/apps/web/src/router/index.tsx +15 -0
- package/dist/templates/default/apps/web/src/router.tsx +20 -0
- package/dist/templates/default/apps/web/tsconfig.json +33 -0
- package/dist/templates/default/apps/web/tsr.config.json +6 -0
- package/dist/templates/default/apps/web/vite.config.ts +67 -0
- package/dist/templates/default/bun.lock +3932 -0
- package/dist/templates/default/bunfig.toml +5 -0
- package/dist/templates/default/disposabl.json +5 -0
- package/dist/templates/default/gitignore +9 -1
- package/dist/templates/default/package.json +29 -4
- package/dist/templates/default/packages/backend/.agents/skills/convex/SKILL.md +69 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-add/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-advisor/SKILL.md +32 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-agent/SKILL.md +25 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-auth/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-authz/SKILL.md +36 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-backup/SKILL.md +33 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-billing/SKILL.md +69 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-cost/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/SKILL.md +325 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/agents/openai.yaml +14 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/assets/icon.svg +3 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/references/advanced-patterns.md +146 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/references/hybrid-components.md +38 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/references/local-components.md +39 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-create-component/references/packaged-components.md +54 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-crons/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-deploy-guard/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-design/SKILL.md +30 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-docs/SKILL.md +31 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-domains/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-env/SKILL.md +24 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-expert/SKILL.md +38 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-explain-app/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-improve-convex-plugin/SKILL.md +24 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-insights/SKILL.md +32 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-launch-readiness/SKILL.md +35 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-migrate/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-migrate-rehearse/SKILL.md +31 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-monitor/SKILL.md +22 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-optimize/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-quickstart/SKILL.md +29 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-quickstart/agents/openai.yaml +14 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-quickstart/assets/icon.svg +4 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-reviewer/SKILL.md +26 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-seed/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-self-heal/SKILL.md +38 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-sentinel/SKILL.md +25 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-suggest/SKILL.md +27 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-test/SKILL.md +23 -0
- package/dist/templates/default/packages/backend/.agents/skills/convex-verify/SKILL.md +34 -0
- package/dist/templates/default/packages/backend/.prettierignore +4 -0
- package/dist/templates/default/packages/backend/AGENTS.md +18 -0
- package/dist/templates/default/packages/backend/CLAUDE.md +13 -0
- package/dist/templates/default/packages/backend/README.md +25 -0
- package/dist/templates/default/packages/backend/convex/_generated/ai/ai-files.state.json +6 -0
- package/dist/templates/default/packages/backend/convex/_generated/ai/guidelines.md +286 -0
- package/dist/templates/default/packages/backend/convex/_generated/api.d.ts +66 -0
- package/dist/templates/default/packages/backend/convex/_generated/api.js +23 -0
- package/dist/templates/default/packages/backend/convex/_generated/dataModel.d.ts +60 -0
- package/dist/templates/default/packages/backend/convex/_generated/server.d.ts +164 -0
- package/dist/templates/default/packages/backend/convex/_generated/server.js +101 -0
- package/dist/templates/default/packages/backend/convex/auth.config.ts +14 -0
- package/dist/templates/default/packages/backend/convex/auth.ts +15 -0
- package/dist/templates/default/packages/backend/convex/convex.config.ts +30 -0
- package/dist/templates/default/packages/backend/convex/http.ts +5 -0
- package/dist/templates/default/packages/backend/convex/mcp.ts +8 -0
- package/dist/templates/default/packages/backend/convex/schema.ts +10 -0
- package/dist/templates/default/packages/backend/convex/todos/index.ts +26 -0
- package/dist/templates/default/packages/backend/convex/todos/internal.ts +43 -0
- package/dist/templates/default/packages/backend/convex/tsconfig.json +27 -0
- package/dist/templates/default/packages/backend/convex/users.ts +20 -0
- package/dist/templates/default/packages/backend/eslint.config.mjs +62 -0
- package/dist/templates/default/packages/backend/package.json +36 -0
- package/dist/templates/default/packages/backend/skills-lock.json +203 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/accordion.tsx +77 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert-dialog.tsx +185 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/alert.tsx +75 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/aspect-ratio.tsx +22 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/attachment.tsx +207 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/avatar.tsx +106 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/badge.tsx +51 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/breadcrumb.tsx +121 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/bubble.tsx +127 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/button-group.tsx +87 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/button.tsx +57 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/calendar.tsx +241 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/card.tsx +102 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/carousel.tsx +239 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/chart.tsx +368 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/checkbox.tsx +27 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/code-block.tsx +243 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/collapsible.tsx +19 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/combobox.tsx +300 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/command.tsx +194 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/context-menu.tsx +271 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/dialog.tsx +156 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/direction.tsx +4 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/drawer.tsx +224 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/dropdown-menu.tsx +269 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/empty.tsx +103 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/field.tsx +236 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/hover-card.tsx +50 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-group.tsx +158 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/input-otp.tsx +83 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/input.tsx +19 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/item.tsx +201 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/kbd.tsx +26 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/label.tsx +19 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/marker.tsx +70 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/menubar.tsx +284 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/message-scroller.tsx +128 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/message.tsx +91 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/native-select.tsx +64 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/navigation-menu.tsx +170 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/pagination.tsx +133 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/popover.tsx +87 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/progress.tsx +82 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/questionnaire.tsx +330 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/radio-group.tsx +35 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/resizable.tsx +49 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/scroll-area.tsx +51 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/select.tsx +201 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/separator.tsx +22 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/sheet.tsx +132 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/sidebar.tsx +723 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/skeleton.tsx +13 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/slider.tsx +51 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/spinner.tsx +16 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/switch.tsx +31 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/table.tsx +113 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/tabs.tsx +81 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/textarea.tsx +17 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/toast.tsx +229 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle-group.tsx +87 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/toggle.tsx +42 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/tooltip.tsx +65 -0
- package/dist/templates/default/packages/disposabl-kit/client/components/ui/trace.tsx +161 -0
- package/dist/templates/default/packages/disposabl-kit/client/hooks/use-mobile.ts +21 -0
- package/dist/templates/default/packages/disposabl-kit/client/lib/prerender.ts +89 -0
- package/dist/templates/default/packages/disposabl-kit/client/lib/return-to.ts +12 -0
- package/dist/templates/default/packages/disposabl-kit/client/lib/utils.ts +1 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/login.tsx +114 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/_auth-pages/signUp.tsx +120 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/_authenticated/route.tsx +38 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/consent.tsx +137 -0
- package/dist/templates/default/packages/disposabl-kit/client/routes/route.tsx +30 -0
- package/dist/templates/default/packages/disposabl-kit/client/styles/globals.css +60 -0
- package/dist/templates/default/packages/disposabl-kit/client/vite.config.ts +32 -0
- package/dist/templates/default/packages/disposabl-kit/components.json +23 -0
- package/dist/templates/default/packages/disposabl-kit/eslint.config.js +21 -0
- package/dist/templates/default/packages/disposabl-kit/package.json +60 -0
- package/dist/templates/default/packages/disposabl-kit/server/http.ts +86 -0
- package/dist/templates/default/packages/disposabl-kit/server/lib/functions.ts +40 -0
- package/dist/templates/default/packages/disposabl-kit/server/lib/platforms.ts +20 -0
- package/dist/templates/default/packages/disposabl-kit/server/lib/static-routes.ts +56 -0
- package/dist/templates/default/packages/disposabl-kit/tsconfig.json +17 -0
- package/dist/templates/default/patches/@convex-dev%2Fauth@2.0.0-beta.0.patch +310 -0
- package/dist/templates/default/patches/@convex-dev%2Fstatic-hosting@0.2.1.patch +187 -0
- package/dist/templates/default/tsconfig.json +9 -0
- package/dist/templates/default/turbo.json +51 -0
- package/package.json +1 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: convex-suggest
|
|
3
|
+
description: "Suggest the matching Convex component when the user hand-rolls a pattern it already solves (crons, sharded-counter, rate-limiter, storage, search, presence, workflow, RAG, prosemirror-sync). Passive — suggest after the task, never interrupt. Never install without consent."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- GENERATED from convex-agents content/capabilities/suggest.json — do not edit by hand. -->
|
|
7
|
+
|
|
8
|
+
# Proactively suggest the right Convex component
|
|
9
|
+
|
|
10
|
+
When you see code or intent that duplicates what a Convex component already does, surface a targeted suggestion: ONE component, WHY (anchored in the user's own code or ask), and a concrete install hint. Never install without explicit consent. Never suggest more than one component at a time unless the user asks.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
1. Observe the codeSnippets and userAsk passively — never block the current task to suggest.
|
|
15
|
+
2. Match against the detector rules (see generators/suggest-detector.mjs): email/SMTP → resend; push notifications → expo-push; setInterval/cron → @convex-dev/crons; shared counter increments → @convex-dev/sharded-counter; .collect().length scans → @convex-dev/aggregate; multi-step/long-running actions → @convex-dev/workflow; bounded concurrency → @convex-dev/workpool; rate-limit counters in DB → @convex-dev/rate-limiter; fs.write/S3 uploads → Convex Storage; Elasticsearch/Algolia → built-in full-text search; presence/typing → @convex-dev/presence; Pinecone/external vector DB → @convex-dev/rag; collaborative editing → @convex-dev/prosemirror-sync.
|
|
16
|
+
3. After finishing the current task, offer ONE suggestion: name the component, quote the specific code or phrase that triggered it, explain why the component fits better.
|
|
17
|
+
4. If the user says yes: run `/add <component>` or follow the installHint from the detector.
|
|
18
|
+
5. If the user says no or ignores it: drop it. Do not repeat the same suggestion.
|
|
19
|
+
|
|
20
|
+
## Rules
|
|
21
|
+
|
|
22
|
+
- Passive — never interrupt the current task; surface the suggestion AFTER completing what the user asked.
|
|
23
|
+
- One at a time — pick the highest-priority match; do not dump a list of five components.
|
|
24
|
+
- Cite WHY from the user's own code or ask — 'I noticed you wrote `post.likes + 1` in a mutation that many users call concurrently; that causes OCC conflicts at scale.'
|
|
25
|
+
- Never install without explicit consent — suggest, explain, wait for a yes.
|
|
26
|
+
- Do not suggest a component the user has already installed.
|
|
27
|
+
- Do not fire on generic coding questions unrelated to Convex (sorting arrays, writing CSS, etc.).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: convex-test
|
|
3
|
+
description: "Generate convex-test tests for the app's Convex functions."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- GENERATED from convex-agents content/capabilities/test.json — do not edit by hand. -->
|
|
7
|
+
|
|
8
|
+
# Generate Convex tests
|
|
9
|
+
|
|
10
|
+
Use convex-test + vitest to test functions against an in-memory backend: args/returns, auth paths, indexes, and scheduled functions.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
1. Install convex-test + vitest.
|
|
15
|
+
2. Write tests using convexTest(schema): seed via t.run, call t.query/t.mutation, assert.
|
|
16
|
+
3. Cover auth (withIdentity), error paths, and scheduled functions (t.finishInProgressScheduledFunctions).
|
|
17
|
+
4. Run vitest; keep tests deterministic.
|
|
18
|
+
|
|
19
|
+
## Rules
|
|
20
|
+
|
|
21
|
+
- Use convex-test (in-memory), not a live deployment.
|
|
22
|
+
- Cover auth + error paths, not just the happy path.
|
|
23
|
+
- Keep tests deterministic (no real time/network).
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: convex-verify
|
|
3
|
+
description: "Prove a Convex feature works — seed, drive as multiple mocked users via convex-test, assert behavior including the negative authz cases (wrong user refused, data-scope enforced)."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- GENERATED from convex-agents content/capabilities/convex-verify.json — do not edit by hand. -->
|
|
7
|
+
|
|
8
|
+
# Prove a feature works — seed, drive, assert
|
|
9
|
+
|
|
10
|
+
A green typecheck proves the code parses; it does not prove a non-owner is actually denied, that a query returns the right rows, or that a mutation has the effect it claims. This capability closes that gap with the loop the whole field is missing: seed → drive → assert, run in-process with `convex-test` so it needs no deployment. Its highest-value assertions are the NEGATIVE ones — the caller who should be refused — because those are exactly the authz defects the 30-app corpus shows are the #1 real bug and the ones a happy-path demo never catches.
|
|
11
|
+
|
|
12
|
+
## Workflow
|
|
13
|
+
|
|
14
|
+
1. IDENTIFY the feature to prove: the specific exported query/mutation/action (or a small set) the user just built/changed, and its intended behavior — who should be allowed, what data should come back, what a mutation should change. If the intent is unstated, ask one focused question rather than guessing the contract.
|
|
15
|
+
2. SET UP `convex-test`: ensure `convex-test` + `vitest` are dev deps AND a `vitest.config.ts` sets `test.environment: "edge-runtime"` with `server.deps.inline: ["convex-test"]` — WITHOUT that config, `convexTest(schema)` fails at runtime with `import.meta.glob is not a function` (verified). Also install `@edge-runtime/vm`. Then `convexTest(schema)` gives a `t` handle. Reuse the project's existing test setup if present (compose with the `test` capability, don't fork it).
|
|
16
|
+
3. SEED realistic data through the app's OWN functions where possible (so the seed exercises the same validators/mutations a real user would), falling back to `t.run(async (ctx) => ctx.db.insert(...))` for fixtures the public API can't create. Seed at least: the caller's own rows AND a second user's rows, so cross-user access is testable.
|
|
17
|
+
4. DRIVE the feature as DIFFERENT identities with `t.withIdentity({ subject, tokenIdentifier, ... })`: call the function as (a) the legitimate owner, (b) a different authenticated user, and (c) unauthenticated (`t` with no identity). Use the real identity shape the app's auth uses (subject/tokenIdentifier), matching how ownership is resolved.
|
|
18
|
+
5. ASSERT behavior — POSITIVE and NEGATIVE:
|
|
19
|
+
- positive: the owner gets the expected rows / the mutation made the expected change (`expect(await t.withIdentity(owner).query(api.x.y, args)).toEqual(...)`).
|
|
20
|
+
- NEGATIVE (the load-bearing half): a different user calling the same function is REFUSED — `await expect(t.withIdentity(other).mutation(api.x.cancel, {id})).rejects.toThrow(/forbidden|not authorized|403/)` — and an unauthenticated caller is refused where auth is required. A feature is not proven until the wrong caller is shown to be blocked.
|
|
21
|
+
- data-scope: a list/query returns ONLY the caller's rows, never the second user's (assert the second user's row is absent).
|
|
22
|
+
6. RUN the tests (`npx vitest run`) and report: what was proven (each positive + negative assertion that passed), and — critically — any assertion that FAILED, because a failed negative assertion is a real authz hole found before ship. Emit findings on the bus (specs/finding.schema.json, class authz/correctness, evidence kind probe-result with the exact failing call) for anything that didn't behave.
|
|
23
|
+
7. Do NOT weaken a test to make it pass: if the owner-only query returns another user's row, the FIX is in the function (hand to convex-authz), not in the assertion. A test changed until it's green proves nothing.
|
|
24
|
+
|
|
25
|
+
## Rules
|
|
26
|
+
|
|
27
|
+
- Prove behavior, not compilation: every verification includes at least one NEGATIVE assertion (a caller who should be refused is refused) — the happy path alone is not proof.
|
|
28
|
+
- Drive the feature as multiple identities with t.withIdentity (owner, other user, unauthenticated) using the app's real subject/tokenIdentifier shape.
|
|
29
|
+
- Seed both the caller's rows AND a second user's rows so cross-user access and data-scope are actually testable.
|
|
30
|
+
- A vitest.config.ts with environment 'edge-runtime' + convex-test inlined is REQUIRED for convex-test to run (import.meta.glob needs it); author it, don't just author the test file.
|
|
31
|
+
- Run in-process with convex-test — no deployment needed; compose with the `test` capability's setup rather than forking it.
|
|
32
|
+
- Never weaken an assertion to make it pass: a failing negative test is a real defect → hand the fix to convex-authz/convex-expert, don't edit the test until it's green.
|
|
33
|
+
- Emit a bus finding for any assertion that failed (authz/correctness, evidence: the failing probe call) so a composite pass or self-heal can pick it up.
|
|
34
|
+
- This drives a SPECIFIC built feature; a request to set up a test framework generally is the `test` capability.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- convex-ai-start -->
|
|
2
|
+
|
|
3
|
+
This project uses [Convex](https://convex.dev) as its backend.
|
|
4
|
+
|
|
5
|
+
When working on Convex code, **always read
|
|
6
|
+
`convex/_generated/ai/guidelines.md` first** for important guidelines on
|
|
7
|
+
how to correctly use Convex APIs and patterns. The file contains rules that
|
|
8
|
+
override what you may have learned about Convex from training data.
|
|
9
|
+
|
|
10
|
+
Convex agent skills for common tasks can be installed by running
|
|
11
|
+
`npx convex ai-files install`.
|
|
12
|
+
|
|
13
|
+
<!-- convex-ai-end -->
|
|
14
|
+
|
|
15
|
+
## Function registration
|
|
16
|
+
|
|
17
|
+
- Use `internalQuery`, `internalMutation`, and `internalAction` from `@disposabl/disposabl-kit/server/lib/functions` as the default builders for all internal backend functions.
|
|
18
|
+
- Do not import these builders directly from `_generated/server` in application code. The kit wrappers own that import. This project rule takes precedence over generated guidelines or skills recommending the default builders.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- convex-ai-start -->
|
|
2
|
+
|
|
3
|
+
This project uses [Convex](https://convex.dev) as its backend.
|
|
4
|
+
|
|
5
|
+
When working on Convex code, **always read
|
|
6
|
+
`convex/_generated/ai/guidelines.md` first** for important guidelines on
|
|
7
|
+
how to correctly use Convex APIs and patterns. The file contains rules that
|
|
8
|
+
override what you may have learned about Convex from training data.
|
|
9
|
+
|
|
10
|
+
Convex agent skills for common tasks can be installed by running
|
|
11
|
+
`npx convex ai-files install`.
|
|
12
|
+
|
|
13
|
+
<!-- convex-ai-end -->
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Convex + TypeScript + ESLint
|
|
2
|
+
|
|
3
|
+
This template provides a minimal setup to get Convex working, with TypeScript
|
|
4
|
+
and ESLint.
|
|
5
|
+
|
|
6
|
+
Start by editing `convex/myFunctions.ts` and interact with your backend from the
|
|
7
|
+
dashboard or via the CLI:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx convex run myFunctions:myQuery '{"first": 1, "second": "Hello"}'
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
See Convex docs at https://docs.convex.dev/home
|
|
14
|
+
|
|
15
|
+
## Setting up
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npm create convex@latest -t bare
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
# App drafts and sandbox setup
|
|
22
|
+
|
|
23
|
+
App drafts require `website`; `cli`, `typescript`, and `python` require `api`, and `openai` and `claude` require `mcp`. App lists currently return at most 100 records. Existing records without platforms read as `website`.
|
|
24
|
+
|
|
25
|
+
Boat requires `BOAT_API_KEY` in the Convex deployment. Set `SANDBOX_OPENAI_API_KEY` to a separately scoped, budget-limited OpenAI API key before sending a message; it is exposed to code inside the sandbox. Creation and resume use `noEnv: true`. Codex credentials are written to protected files in its sandbox home, and healthy running sandboxes are reused without stopping them. The user-scoped MCP key is revoked on completion or after one hour, so long-running prompts can lose MCP access. An uncertain prompt submission stays locked for review instead of being retried automatically. Live sandbox provisioning, Codex credential loading, and dispatch have not been verified.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"guidelinesHash": "b6b776e9d4dacfe8da23a58c9d11ab9cc9c505891c8f6b9fa9cdc69e4266ac37",
|
|
3
|
+
"agentsMdSectionHash": "5934f676ea9a332e7cd4a4f64aa23b59d926e9faca026c758d4b1f87d2101cc3",
|
|
4
|
+
"claudeMdHash": "5934f676ea9a332e7cd4a4f64aa23b59d926e9faca026c758d4b1f87d2101cc3",
|
|
5
|
+
"agentSkillsSha": "191a5c33a7e7a22ec9d5ff13930f84748bbcf8f8"
|
|
6
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
# Convex guidelines
|
|
2
|
+
|
|
3
|
+
These guidelines target Convex `^1.44.0`.
|
|
4
|
+
|
|
5
|
+
## Function guidelines
|
|
6
|
+
|
|
7
|
+
### HTTP endpoints
|
|
8
|
+
|
|
9
|
+
- Define HTTP endpoints in `convex/http.ts` with `httpRouter` and an `httpAction` handler. Routes are registered at the exact `path` supplied.
|
|
10
|
+
- Treat `await req.json()` as `unknown`; narrow each field (e.g. `typeof` checks) before use, and return HTTP 400 for bodies that fail validation.
|
|
11
|
+
|
|
12
|
+
### Validators
|
|
13
|
+
|
|
14
|
+
- Use `v.array`, `v.union`, `v.object`, `v.record`, and the other validators from `convex/values` for function arguments and schemas. `v.object` supports `.pick("a", "b")`, `.omit("c")`, `.partial()`, and `.extend({ d: v.string() })`; use `.fields` when supplying a function's `args`.
|
|
15
|
+
- For a complete stored-document validator, default-import your authored schema using the correct relative path, e.g. `import schema from "./schema"; schema.doc("users")`. `schema.doc` includes `_id` and `_creationTime` and handles union tables. For a bare table definition, use `import { docValidator } from "convex/server"; docValidator("users", usersTable)`. `convex/server` exports `docValidator`, not `doc`; prefer `schema.doc` when the schema is available. Never import your schema from `_generated`.
|
|
16
|
+
- Convex values are: `v.id(tableName)` for `Id` strings, `v.null()` for `null`, `v.int64()` for `bigint`, `v.number()` for IEEE-754 numbers, `v.boolean()`, `v.string()`, `v.bytes()` for `ArrayBuffer`, `v.array(values)`, `v.object({...})`, and `v.record(keys, values)` for dynamic-key records. `undefined` is not a Convex value and is returned to clients as `null`; use `null`. Arrays have at most 8192 values, objects at most 1024 entries, and strings/bytes/documents have the platform size limits. Object and record keys must be valid nonempty names and cannot start with `$` or `_`.
|
|
17
|
+
- Use `v.literal` members in `v.union` validators for discriminated unions.
|
|
18
|
+
|
|
19
|
+
### Function registration
|
|
20
|
+
|
|
21
|
+
- Register private functions with `internalQuery`, `internalMutation`, or `internalAction` from `./_generated/server`; register public API functions with `query`, `mutation`, or `action` from the same module. A function used only by your own code, such as an HTTP action's commit mutation, is internal.
|
|
22
|
+
- Never register a function through `api` or `internal`, and always include argument validators for every function kind.
|
|
23
|
+
|
|
24
|
+
### Function calling
|
|
25
|
+
|
|
26
|
+
- Call queries, mutations, and actions with `ctx.runQuery`, `ctx.runMutation`, and `ctx.runAction` respectively. Pass a `FunctionReference`, never the function itself. Call actions from actions only when crossing runtimes; otherwise call shared code directly.
|
|
27
|
+
- Keep action-to-query/mutation calls few because transactions split across calls can race.
|
|
28
|
+
- Nested `ctx.runQuery` and `ctx.runMutation` calls from a mutation are subtransactions. If a nested call throws, its writes roll back independently and the caller may catch the error and continue its own writes.
|
|
29
|
+
- Convex 1.41+ accepts a third `transactionLimits` argument on nested queries and mutations. These limits can only tighten the caller's global limits. Supported fields are `bytesRead`, `bytesWritten`, `databaseQueries`, `documentsRead`, `documentsWritten`, `functionsScheduled`, and `scheduledFunctionArgsBytes`; a failed nested call rolls back its writes while preserving caller headroom.
|
|
30
|
+
- When using `ctx.runQuery`, `ctx.runMutation`, or `ctx.runAction` to call a function in the same file, specify a type annotation on the return value to work around TypeScript circularity limitations (see the example below). Annotate with what the callee returns; a handler with no return value returns `null`, not `void`.
|
|
31
|
+
|
|
32
|
+
### Function references
|
|
33
|
+
|
|
34
|
+
- Use `api` from `convex/_generated/api.ts` for functions registered with `query`, `mutation`, or `action`, and `internal` for those registered with `internalQuery`, `internalMutation`, or `internalAction`. File routing maps `convex/example.ts` function `f` to `api.example.f` and private `g` to `internal.example.g`; nested files include every directory segment, such as `api.messages.access.h`.
|
|
35
|
+
|
|
36
|
+
### Pagination
|
|
37
|
+
|
|
38
|
+
- Validate `paginationOpts` with `paginationOptsValidator` from `convex/server` and pass `args.paginationOpts` unchanged to `.paginate()`. Do not reconstruct it, because optional native behavior would be lost.
|
|
39
|
+
- The native options are `numItems`, required nullable `cursor`, optional `endCursor`, `maximumRowsRead`, `maximumBytesRead`, and client-managed `id`. Read budgets can produce a short page with `splitCursor` and `pageStatus`.
|
|
40
|
+
- A paginated query returns `page`, `isDone`, and `continueCursor`, with optional `splitCursor` and `pageStatus`. Use `paginationResultValidator(itemValidator)` for its return validator.
|
|
41
|
+
|
|
42
|
+
## Schema guidelines
|
|
43
|
+
|
|
44
|
+
- Define the schema in `convex/schema.ts` and import schema functions from `convex/server`.
|
|
45
|
+
- `_id` and `_creationTime` are automatically added system fields (`v.id(tableName)` and `v.number()`).
|
|
46
|
+
- Include every index field in its name, such as `by_field1_and_field2`; query indexed fields in their declared order, creating separate indexes for another order.
|
|
47
|
+
- Do not put an unbounded list in one document. Use a child table with a foreign key. Keep high-churn heartbeats, online status, and typing indicators in a dedicated table instead of a stable profile document.
|
|
48
|
+
- An index added to a large existing table can block deploy during backfill. Use `.index("by_field", { fields: ["field"], staged: true })`; remove `staged` in a later deploy before querying it.
|
|
49
|
+
|
|
50
|
+
## Authentication guidelines
|
|
51
|
+
|
|
52
|
+
- JWT authentication requires `convex/auth.config.ts`. Its provider `domain` is the JWT issuer, and `applicationID` is checked against the token audience; without the file, `ctx.auth.getUserIdentity()` is always `null`.
|
|
53
|
+
- Read identity with `ctx.auth.getUserIdentity()` in queries, mutations, and actions. It may be `null`; `tokenIdentifier` is the guaranteed canonical stable identity key, so use it for ownership and auth-linked lookups rather than `subject` alone.
|
|
54
|
+
- Never accept a user ID or other identity argument for authorization; derive it server-side.
|
|
55
|
+
- With an external auth provider, use `ConvexProviderWithAuth` from `convex/react`, whose `useAuth` returns `{ isLoading, isAuthenticated, fetchAccessToken }`. Do not use plain `ConvexProvider` for authenticated requests because it will not send tokens.
|
|
56
|
+
|
|
57
|
+
## TypeScript guidelines
|
|
58
|
+
|
|
59
|
+
- Import `Id` and `Doc<"tableName">` from `./_generated/dataModel`; use `Id<"users">` instead of `string` for a users-table ID.
|
|
60
|
+
- Type contexts with `QueryCtx`, `MutationCtx`, and `ActionCtx` from `./_generated/server`; never use `any` for a context parameter.
|
|
61
|
+
- Give `Record` both key and value types, such as `Record<Id<"users">, string>`.
|
|
62
|
+
- For typed app environment variables, declare them in `convex/convex.config.ts` with `defineApp({ env: { MY_KEY: v.optional(v.string()) } })` and read `env` from `./_generated/server`, not `process.env`. `CONVEX_SITE_URL` and `CONVEX_CLOUD_URL` are already on `env`; do not redeclare them.
|
|
63
|
+
|
|
64
|
+
## Full text search guidelines
|
|
65
|
+
|
|
66
|
+
- Use `.withSearchIndex("search_body", q => q.search("body", text).eq("channel", channel))` and then bound results with `.take(n)`.
|
|
67
|
+
|
|
68
|
+
## Vector search guidelines
|
|
69
|
+
|
|
70
|
+
- Store embeddings as `v.array(v.float64())` and declare a vector index with `vectorField`, exact `dimensions`, and any declared `filterFields`.
|
|
71
|
+
- `ctx.vectorSearch` is available only in actions. Its filter supports equality on declared filter fields and `q.or(...)`, not cross-field AND or inequality; apply remaining predicates after hydration.
|
|
72
|
+
- Results contain only `{ _id, _score }` in descending similarity order. Since actions have no `ctx.db`, hydrate all hits through one internal query, preserve search order, and pair each score with its document ID.
|
|
73
|
+
|
|
74
|
+
## Component guidelines
|
|
75
|
+
|
|
76
|
+
- Components are installable building blocks such as `@convex-dev/aggregate` and `@convex-dev/rate-limiter`, with isolated tables and functions. Install and mount them in `convex/convex.config.ts`, then `import { components } from "./_generated/api"` and pass e.g. `components.aggregate` to the component client (there is no `ctx.components`).
|
|
77
|
+
- Component functions are not client-facing. Wrap them in app queries/mutations and authorize in the app function first.
|
|
78
|
+
- Component reads and writes participate in the calling mutation's transaction. If a component mirrors an app table, update it in the same mutation as every insert, patch, replace, or delete.
|
|
79
|
+
- A local component has a directory under `convex/`, its own `convex.config.ts` using `defineComponent("myName")`, its own `schema.ts`, and functions from its own `_generated/server`. Mount with `app.use(myName)` and include the module segment in references: a function in `convex/myName/index.ts` is `components.myName.index.myFunction`, never `components.myName.myFunction`.
|
|
80
|
+
- For per-key quotas, cooldowns, or throttling, use `@convex-dev/rate-limiter`; hand-rolled counters and window scans race under concurrency and lose quota when a mutation fails.
|
|
81
|
+
- For chat or assistant features where an LLM replies inside a durable conversation - per-user resumable histories, recorded tool-call steps, several assistants sharing one conversation - use the `@convex-dev/agent` component: mount it, create one component thread per conversation, and generate/read through it (`createThread(ctx, components.agent, ...)`, `new Agent(components.agent, { name, languageModel, tools }).generateText(ctx, { threadId }, { prompt })`, `listMessages`). Do not hand-roll a messages table or call an LLM SDK directly from your functions for these.
|
|
82
|
+
- For async functions needing bounded parallelism, serialized mutation work, or completion callbacks, use `@convex-dev/workpool`; retry only idempotent actions.
|
|
83
|
+
- For ephemeral presence - who is online/viewing/typing in a room, tracked by client heartbeats with session tokens, multi-session aggregation (one entry per user across tabs), and timeout-to-offline - use `@convex-dev/presence`; hand-rolled lastSeen tables need wall-clock query filters that go stale, and per-session rows break the one-entry-per-user contract.
|
|
84
|
+
- A component mutation is a subtransaction. If it throws and the caller catches it, its writes roll back while the caller can continue and commit.
|
|
85
|
+
- To pass a function across a component boundary, mint a handle in the app with `const handle = await createFunctionHandle(internal.index.myCallback)` from `convex/server`; send it as a string, then invoke it with `await ctx.runMutation(args.handle as FunctionHandle<"mutation">, callbackArgs)`. `getFunctionHandle` and `getFunctionName` are not this API.
|
|
86
|
+
|
|
87
|
+
## Query guidelines
|
|
88
|
+
|
|
89
|
+
- Prefer `.withIndex()` and put every index-supported predicate in the index range. `.filter()` runs after the index scan and does not make an unbounded query scalable.
|
|
90
|
+
- Do not read the wall clock in a query. Pass current time as an argument or materialize time state with scheduled mutations; `Date.now()` is fine in mutations and actions.
|
|
91
|
+
- If the user does not explicitly tell you to return all results from a query you should ALWAYS return a bounded collection instead. So that is instead of using `.collect()` you should use `.take()` or paginate on database queries. This prevents future performance issues when tables grow in an unbounded way.
|
|
92
|
+
- Never use `.collect().length`; Convex has no built-in count operator. A counter document suffices only for a simple total. When queries need counts, sums, ranks/positions, or offsets over many rows, whole-table or within a key range, use `@convex-dev/aggregate` (O(log n) reads), updated in the same mutation as every source-table write.
|
|
93
|
+
- Queries do not support `.delete()`. Read matches in batches or with async iteration and call `ctx.db.delete` for each document.
|
|
94
|
+
- For large mutation work, process a batch and schedule a continuation with `ctx.scheduler.runAfter(0, internal.myModule.myMutation, args)`. For variable document sizes, use async iteration and after each write `await ctx.meta.getTransactionMetrics()`, returning when a needed `.remaining` metric such as `metrics.bytesRead.remaining` reaches a safety reserve.
|
|
95
|
+
- Use `.unique()` for one document; it throws when multiple documents match. With async iteration, use `for await (const row of query)` rather than `.collect()` or `.take(n)`.
|
|
96
|
+
|
|
97
|
+
### Ordering
|
|
98
|
+
|
|
99
|
+
- Queries default to ascending order over the selected index key; a plain scan uses `by_creation_time`. `.order("asc"|"desc")` selects direction. Index queries follow index columns and append `_creationTime` as a tie-breaker, so do not re-sort equal-key rows in JavaScript.
|
|
100
|
+
|
|
101
|
+
## Mutation guidelines
|
|
102
|
+
|
|
103
|
+
- Use `ctx.db.replace(table, id, document)` to replace a whole existing document and `ctx.db.patch(table, id, fields)` for a shallow merge. Both throw when the document does not exist.
|
|
104
|
+
|
|
105
|
+
## Action guidelines
|
|
106
|
+
|
|
107
|
+
- Put `"use node";` at the top of a file containing actions that use Node built-ins. Keep such actions separate from files exporting queries or mutations. `fetch()` works in the default runtime, so it does not require Node.
|
|
108
|
+
- Actions have no `ctx.db`; read and write data through function calls.
|
|
109
|
+
|
|
110
|
+
## Scheduling guidelines
|
|
111
|
+
|
|
112
|
+
### Cron guidelines
|
|
113
|
+
|
|
114
|
+
- Use only `crons.interval` or `crons.cron`, and pass a `FunctionReference`, never a function value. Define a top-level `cronJobs()` object and export it as default.
|
|
115
|
+
- Functions may be registered in `crons.ts`. For an internal target, import `internal` from `./_generated/api` even when the target is registered in the same file.
|
|
116
|
+
|
|
117
|
+
## Testing guidelines
|
|
118
|
+
|
|
119
|
+
- Test Convex functions with `convex-test`, Vitest, and `@edge-runtime/vm`; configure Vitest with `environment: "edge-runtime"` and always install the latest versions of these packages.
|
|
120
|
+
- Test files belong under `convex/`. Pass an `import.meta.glob("./**/*.ts")` module map to `convexTest(schema, modules)` and call functions through generated `api` references.
|
|
121
|
+
- Add `/// <reference types="vite/client" />` only in test files that use `import.meta.glob`.
|
|
122
|
+
- Do not add uninstalled packages to `compilerOptions.types`; leave `types` unset unless the package is installed.
|
|
123
|
+
|
|
124
|
+
## File storage guidelines
|
|
125
|
+
|
|
126
|
+
- `ctx.storage.getUrl(fileId)` returns a signed URL or `null` when absent. Do not use deprecated `ctx.storage.getMetadata`.
|
|
127
|
+
- Read metadata from the `_storage` system table with `ctx.db.system.get("_storage", fileId)` and an `Id<"_storage">`; storage values are `Blob` objects and must be converted to/from `Blob`.
|
|
128
|
+
|
|
129
|
+
## Selected reference patterns
|
|
130
|
+
|
|
131
|
+
HTTP endpoints are registered with this shape:
|
|
132
|
+
|
|
133
|
+
```typescript
|
|
134
|
+
import { httpRouter } from "convex/server";
|
|
135
|
+
import { httpAction } from "./_generated/server";
|
|
136
|
+
const http = httpRouter();
|
|
137
|
+
http.route({
|
|
138
|
+
path: "/echo",
|
|
139
|
+
method: "POST",
|
|
140
|
+
handler: httpAction(async (ctx, req) => {
|
|
141
|
+
const body = await req.bytes();
|
|
142
|
+
return new Response(body, { status: 200 });
|
|
143
|
+
}),
|
|
144
|
+
});
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
An array validator is:
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
import { mutation } from "./_generated/server";
|
|
151
|
+
import { v } from "convex/values";
|
|
152
|
+
export const exampleMutation = mutation({
|
|
153
|
+
args: { simpleArray: v.array(v.union(v.string(), v.number())) },
|
|
154
|
+
handler: async (ctx, args) => {},
|
|
155
|
+
});
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
A discriminated union uses `v.union` with `v.literal` members, for example:
|
|
159
|
+
|
|
160
|
+
```typescript
|
|
161
|
+
export default defineSchema({
|
|
162
|
+
results: defineTable(
|
|
163
|
+
v.union(
|
|
164
|
+
v.object({ kind: v.literal("error"), errorMessage: v.string() }),
|
|
165
|
+
v.object({ kind: v.literal("success"), value: v.number() }),
|
|
166
|
+
),
|
|
167
|
+
),
|
|
168
|
+
});
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Nested limits are the optional third argument:
|
|
172
|
+
|
|
173
|
+
```ts
|
|
174
|
+
try {
|
|
175
|
+
await ctx.runMutation(internal.example.writeBatch, args, {
|
|
176
|
+
transactionLimits: { documentsWritten: 100, bytesWritten: 1024 * 1024 },
|
|
177
|
+
});
|
|
178
|
+
} catch (e) {
|
|
179
|
+
// The nested mutation's writes rolled back; this mutation can still write.
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Same-file calls can use an explicit result annotation:
|
|
184
|
+
|
|
185
|
+
```ts
|
|
186
|
+
const result: string = await ctx.runQuery(api.example.f, { name: "Bob" });
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
Pagination passes the validator and options through unchanged:
|
|
190
|
+
|
|
191
|
+
```ts
|
|
192
|
+
export const listWithExtraArg = query({
|
|
193
|
+
args: { paginationOpts: paginationOptsValidator, author: v.string() },
|
|
194
|
+
handler: async (ctx, args) => {
|
|
195
|
+
return await ctx.db
|
|
196
|
+
.query("messages")
|
|
197
|
+
.withIndex("by_author", (q) => q.eq("author", args.author))
|
|
198
|
+
.order("desc")
|
|
199
|
+
.paginate(args.paginationOpts);
|
|
200
|
+
},
|
|
201
|
+
});
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
An auth provider config has this shape:
|
|
205
|
+
|
|
206
|
+
```typescript
|
|
207
|
+
export default {
|
|
208
|
+
providers: [
|
|
209
|
+
{
|
|
210
|
+
domain: "https://your-auth-provider.com",
|
|
211
|
+
applicationID: "convex",
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
};
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
An external auth client uses `ConvexProviderWithAuth` with `useAuth`:
|
|
218
|
+
|
|
219
|
+
```tsx
|
|
220
|
+
<ConvexProviderWithAuth client={convex} useAuth={useYourAuthHook}>
|
|
221
|
+
{children}
|
|
222
|
+
</ConvexProviderWithAuth>
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
A typed ID-keyed map is:
|
|
226
|
+
|
|
227
|
+
```ts
|
|
228
|
+
const idToUsername: Record<Id<"users">, string> = {};
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
Vector indexes declare the field, dimensions, and filters:
|
|
232
|
+
|
|
233
|
+
```ts
|
|
234
|
+
documents: defineTable({
|
|
235
|
+
title: v.string(),
|
|
236
|
+
category: v.string(),
|
|
237
|
+
embedding: v.array(v.float64()),
|
|
238
|
+
}).vectorIndex("by_embedding", {
|
|
239
|
+
vectorField: "embedding",
|
|
240
|
+
dimensions: 1536,
|
|
241
|
+
filterFields: ["category"],
|
|
242
|
+
}),
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
The vector call is action-only:
|
|
246
|
+
|
|
247
|
+
```ts
|
|
248
|
+
const results = await ctx.vectorSearch("documents", "by_embedding", {
|
|
249
|
+
vector: args.embedding,
|
|
250
|
+
limit: 10,
|
|
251
|
+
filter: (q) => q.eq("category", args.category),
|
|
252
|
+
});
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Mounting a component follows this pattern:
|
|
256
|
+
|
|
257
|
+
```ts
|
|
258
|
+
import { defineApp } from "convex/server";
|
|
259
|
+
import aggregate from "@convex-dev/aggregate/convex.config";
|
|
260
|
+
const app = defineApp();
|
|
261
|
+
app.use(aggregate);
|
|
262
|
+
export default app;
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Cron wiring uses a top-level object and a reference:
|
|
266
|
+
|
|
267
|
+
```ts
|
|
268
|
+
const crons = cronJobs();
|
|
269
|
+
crons.interval("delete inactive users", { hours: 2 }, internal.crons.empty, {});
|
|
270
|
+
export default crons;
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Convex tests require the module map:
|
|
274
|
+
|
|
275
|
+
```typescript
|
|
276
|
+
import { convexTest } from "convex-test";
|
|
277
|
+
const modules = import.meta.glob("./**/*.ts");
|
|
278
|
+
const t = convexTest(schema, modules);
|
|
279
|
+
await t.mutation(api.messages.send, { body: "Hi!", author: "Sarah" });
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Storage metadata comes from the system table:
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
const metadata = await ctx.db.system.get("_storage", fileId);
|
|
286
|
+
```
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `api` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type * as auth from "../auth.js";
|
|
12
|
+
import type * as http from "../http.js";
|
|
13
|
+
import type * as mcp from "../mcp.js";
|
|
14
|
+
import type * as todos_index from "../todos/index.js";
|
|
15
|
+
import type * as todos_internal from "../todos/internal.js";
|
|
16
|
+
import type * as users from "../users.js";
|
|
17
|
+
|
|
18
|
+
import type {
|
|
19
|
+
ApiFromModules,
|
|
20
|
+
FilterApi,
|
|
21
|
+
FunctionReference,
|
|
22
|
+
} from "convex/server";
|
|
23
|
+
|
|
24
|
+
declare const fullApi: ApiFromModules<{
|
|
25
|
+
auth: typeof auth;
|
|
26
|
+
http: typeof http;
|
|
27
|
+
mcp: typeof mcp;
|
|
28
|
+
"todos/index": typeof todos_index;
|
|
29
|
+
"todos/internal": typeof todos_internal;
|
|
30
|
+
users: typeof users;
|
|
31
|
+
}>;
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
35
|
+
*
|
|
36
|
+
* Usage:
|
|
37
|
+
* ```js
|
|
38
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare const api: FilterApi<
|
|
42
|
+
typeof fullApi,
|
|
43
|
+
FunctionReference<any, "public">
|
|
44
|
+
>;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
48
|
+
*
|
|
49
|
+
* Usage:
|
|
50
|
+
* ```js
|
|
51
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export declare const internal: FilterApi<
|
|
55
|
+
typeof fullApi,
|
|
56
|
+
FunctionReference<any, "internal">
|
|
57
|
+
>;
|
|
58
|
+
|
|
59
|
+
export declare const components: {
|
|
60
|
+
auth: import("@convex-dev/auth/_generated/component.js").ComponentApi<"auth">;
|
|
61
|
+
authPassword: import("@convex-dev/auth/components/password/_generated/component.js").ComponentApi<"authPassword">;
|
|
62
|
+
authUsername: import("@convex-dev/auth/components/username/_generated/component.js").ComponentApi<"authUsername">;
|
|
63
|
+
staticHosting: import("@convex-dev/static-hosting/_generated/component.js").ComponentApi<"staticHosting">;
|
|
64
|
+
mcp: import("@convex-dev/mcp/_generated/component.js").ComponentApi<"mcp">;
|
|
65
|
+
workflow: import("@convex-dev/workflow/_generated/component.js").ComponentApi<"workflow">;
|
|
66
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `api` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { anyApi, componentsGeneric } from "convex/server";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A utility for referencing Convex functions in your app's API.
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* ```js
|
|
18
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export const api = anyApi;
|
|
22
|
+
export const internal = anyApi;
|
|
23
|
+
export const components = componentsGeneric();
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated data model types.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {
|
|
12
|
+
DataModelFromSchemaDefinition,
|
|
13
|
+
DocumentByName,
|
|
14
|
+
TableNamesInDataModel,
|
|
15
|
+
SystemTableNames,
|
|
16
|
+
} from "convex/server";
|
|
17
|
+
import type { GenericId } from "convex/values";
|
|
18
|
+
import schema from "../schema.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The names of all of your Convex tables.
|
|
22
|
+
*/
|
|
23
|
+
export type TableNames = TableNamesInDataModel<DataModel>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The type of a document stored in Convex.
|
|
27
|
+
*
|
|
28
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
29
|
+
*/
|
|
30
|
+
export type Doc<TableName extends TableNames> = DocumentByName<
|
|
31
|
+
DataModel,
|
|
32
|
+
TableName
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An identifier for a document in Convex.
|
|
37
|
+
*
|
|
38
|
+
* Convex documents are uniquely identified by their `Id`, which is accessible
|
|
39
|
+
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
|
|
40
|
+
*
|
|
41
|
+
* Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
|
|
42
|
+
*
|
|
43
|
+
* IDs are just strings at runtime, but this type can be used to distinguish them from other
|
|
44
|
+
* strings when type checking.
|
|
45
|
+
*
|
|
46
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
47
|
+
*/
|
|
48
|
+
export type Id<TableName extends TableNames | SystemTableNames> =
|
|
49
|
+
GenericId<TableName>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A type describing your Convex data model.
|
|
53
|
+
*
|
|
54
|
+
* This type includes information about what tables you have, the type of
|
|
55
|
+
* documents stored in those tables, and the indexes defined on them.
|
|
56
|
+
*
|
|
57
|
+
* This type is used to parameterize methods like `queryGeneric` and
|
|
58
|
+
* `mutationGeneric` to make them type-safe.
|
|
59
|
+
*/
|
|
60
|
+
export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
|