convex 1.34.1 → 1.35.0
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/CHANGELOG.md +86 -43
- package/dist/browser.bundle.js +8 -2
- package/dist/browser.bundle.js.map +3 -3
- package/dist/cjs/browser/index-node.js +3 -1
- package/dist/cjs/browser/index.js +3 -1
- package/dist/cjs/browser/index.js.map +2 -2
- package/dist/cjs/browser/query_options.js.map +2 -2
- package/dist/cjs/cli/aiFiles.js +31 -13
- package/dist/cjs/cli/aiFiles.js.map +3 -3
- package/dist/cjs/cli/codegen_templates/readme.js +14 -1
- package/dist/cjs/cli/codegen_templates/readme.js.map +2 -2
- package/dist/cjs/cli/configure.js +21 -24
- package/dist/cjs/cli/configure.js.map +2 -2
- package/dist/cjs/cli/deploy.js +7 -8
- package/dist/cjs/cli/deploy.js.map +2 -2
- package/dist/cjs/cli/deploymentCreate.js +225 -40
- package/dist/cjs/cli/deploymentCreate.js.map +3 -3
- package/dist/cjs/cli/deploymentSelect.js +14 -13
- package/dist/cjs/cli/deploymentSelect.js.map +2 -2
- package/dist/cjs/cli/dev.js +30 -11
- package/dist/cjs/cli/dev.js.map +2 -2
- package/dist/cjs/cli/docs.js +1 -1
- package/dist/cjs/cli/docs.js.map +2 -2
- package/dist/cjs/cli/init.js +1 -1
- package/dist/cjs/cli/init.js.map +2 -2
- package/dist/cjs/cli/lib/aiFiles/agentsmd.js +14 -10
- package/dist/cjs/cli/lib/aiFiles/agentsmd.js.map +2 -2
- package/dist/cjs/cli/lib/aiFiles/claudemd.js +14 -10
- package/dist/cjs/cli/lib/aiFiles/claudemd.js.map +2 -2
- package/dist/cjs/cli/lib/aiFiles/guidelinesmd.js +10 -3
- package/dist/cjs/cli/lib/aiFiles/guidelinesmd.js.map +2 -2
- package/dist/cjs/cli/lib/aiFiles/index.js +70 -86
- package/dist/cjs/cli/lib/aiFiles/index.js.map +3 -3
- package/dist/cjs/cli/lib/aiFiles/skills.js +28 -12
- package/dist/cjs/cli/lib/aiFiles/skills.js.map +2 -2
- package/dist/cjs/cli/lib/aiFiles/state.js +96 -0
- package/dist/cjs/cli/lib/aiFiles/state.js.map +7 -0
- package/dist/cjs/cli/lib/aiFiles/status.js +31 -28
- package/dist/cjs/cli/lib/aiFiles/status.js.map +2 -2
- package/dist/cjs/cli/lib/aiFiles/utils.js +31 -14
- package/dist/cjs/cli/lib/aiFiles/utils.js.map +2 -2
- package/dist/cjs/cli/lib/api.js +70 -7
- package/dist/cjs/cli/lib/api.js.map +2 -2
- package/dist/cjs/cli/lib/command.js +4 -5
- package/dist/cjs/cli/lib/command.js.map +2 -2
- package/dist/cjs/cli/lib/config.js +41 -4
- package/dist/cjs/cli/lib/config.js.map +3 -3
- package/dist/cjs/cli/lib/deploy2.js +9 -26
- package/dist/cjs/cli/lib/deploy2.js.map +2 -2
- package/dist/cjs/cli/lib/deployApi/componentDefinition.js +4 -1
- package/dist/cjs/cli/lib/deployApi/componentDefinition.js.map +2 -2
- package/dist/cjs/cli/lib/deploymentSelection.js +45 -2
- package/dist/cjs/cli/lib/deploymentSelection.js.map +2 -2
- package/dist/cjs/cli/lib/deploymentSelector.js +1 -0
- package/dist/cjs/cli/lib/deploymentSelector.js.map +2 -2
- package/dist/cjs/cli/lib/dev.js +162 -117
- package/dist/cjs/cli/lib/dev.js.map +2 -2
- package/dist/cjs/cli/lib/env.js +1 -13
- package/dist/cjs/cli/lib/env.js.map +2 -2
- package/dist/cjs/cli/lib/expiration.js +104 -0
- package/dist/cjs/cli/lib/expiration.js.map +7 -0
- package/dist/cjs/cli/lib/generatedFunctionLogsApi.js.map +1 -1
- package/dist/cjs/cli/lib/init.js +4 -3
- package/dist/cjs/cli/lib/init.js.map +2 -2
- package/dist/cjs/cli/lib/insights.js +1 -1
- package/dist/cjs/cli/lib/insights.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/anonymous.js +14 -7
- package/dist/cjs/cli/lib/localDeployment/anonymous.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/localDeployment.js +8 -10
- package/dist/cjs/cli/lib/localDeployment/localDeployment.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/run.js +1 -0
- package/dist/cjs/cli/lib/localDeployment/run.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/upgrade.js +2 -2
- package/dist/cjs/cli/lib/localDeployment/upgrade.js.map +2 -2
- package/dist/cjs/cli/lib/localDeployment/utils.js +9 -0
- package/dist/cjs/cli/lib/localDeployment/utils.js.map +2 -2
- package/dist/cjs/cli/lib/mcp/tools/status.js +1 -1
- package/dist/cjs/cli/lib/mcp/tools/status.js.map +2 -2
- package/dist/cjs/cli/lib/updates.js +8 -9
- package/dist/cjs/cli/lib/updates.js.map +2 -2
- package/dist/cjs/cli/lib/usage.js +2 -1
- package/dist/cjs/cli/lib/usage.js.map +2 -2
- package/dist/cjs/cli/lib/utils/prompts.js +2 -1
- package/dist/cjs/cli/lib/utils/prompts.js.map +2 -2
- package/dist/cjs/cli/lib/utils/utils.js +46 -20
- package/dist/cjs/cli/lib/utils/utils.js.map +3 -3
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/react/client.js +43 -6
- package/dist/cjs/react/client.js.map +2 -2
- package/dist/cjs/react/index.js +2 -0
- package/dist/cjs/react/index.js.map +2 -2
- package/dist/cjs/react-clerk/ConvexProviderWithClerk.js.map +1 -1
- package/dist/cjs/server/api.js.map +2 -2
- package/dist/cjs/server/components/definition.js.map +1 -1
- package/dist/cjs/server/components/index.js +40 -4
- package/dist/cjs/server/components/index.js.map +2 -2
- package/dist/cjs/server/data_model.js.map +1 -1
- package/dist/cjs/server/impl/meta_impl.js +78 -0
- package/dist/cjs/server/impl/meta_impl.js.map +7 -0
- package/dist/cjs/server/impl/registration_impl.js +16 -11
- package/dist/cjs/server/impl/registration_impl.js.map +2 -2
- package/dist/cjs/server/index.js.map +2 -2
- package/dist/cjs/server/meta.js +17 -0
- package/dist/cjs/server/meta.js.map +7 -0
- package/dist/cjs/server/registration.js.map +1 -1
- package/dist/cjs-types/browser/index.d.ts +1 -0
- package/dist/cjs-types/browser/index.d.ts.map +1 -1
- package/dist/cjs-types/browser/query_options.d.ts +12 -9
- package/dist/cjs-types/browser/query_options.d.ts.map +1 -1
- package/dist/cjs-types/cli/aiFiles.d.ts.map +1 -1
- package/dist/cjs-types/cli/codegen_templates/readme.d.ts.map +1 -1
- package/dist/cjs-types/cli/configure.d.ts.map +1 -1
- package/dist/cjs-types/cli/configure.test.d.ts +2 -0
- package/dist/cjs-types/cli/configure.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/deploy.d.ts.map +1 -1
- package/dist/cjs-types/cli/deploymentCreate.d.ts +1 -0
- package/dist/cjs-types/cli/deploymentCreate.d.ts.map +1 -1
- package/dist/cjs-types/cli/deploymentSelect.d.ts +2 -1
- package/dist/cjs-types/cli/deploymentSelect.d.ts.map +1 -1
- package/dist/cjs-types/cli/dev.d.ts +3 -1
- package/dist/cjs-types/cli/dev.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/aiFiles/agentsmd.d.ts +5 -5
- package/dist/cjs-types/cli/lib/aiFiles/agentsmd.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/aiFiles/claudemd.d.ts +5 -5
- package/dist/cjs-types/cli/lib/aiFiles/claudemd.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.d.ts +3 -3
- package/dist/cjs-types/cli/lib/aiFiles/guidelinesmd.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/aiFiles/index.d.ts +20 -18
- package/dist/cjs-types/cli/lib/aiFiles/index.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/aiFiles/skills.d.ts +6 -4
- package/dist/cjs-types/cli/lib/aiFiles/skills.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/aiFiles/state.d.ts +38 -0
- package/dist/cjs-types/cli/lib/aiFiles/state.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/state.test.d.ts +2 -0
- package/dist/cjs-types/cli/lib/aiFiles/state.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/aiFiles/status.d.ts +4 -1
- package/dist/cjs-types/cli/lib/aiFiles/status.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/aiFiles/utils.d.ts +13 -3
- package/dist/cjs-types/cli/lib/aiFiles/utils.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/aiFiles/utils.test.d.ts +2 -0
- package/dist/cjs-types/cli/lib/aiFiles/utils.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/api.d.ts +3 -3
- package/dist/cjs-types/cli/lib/api.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/command.d.ts +2 -1
- package/dist/cjs-types/cli/lib/command.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/config.d.ts +17 -6
- package/dist/cjs-types/cli/lib/config.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deploy2.d.ts +5 -2
- package/dist/cjs-types/cli/lib/deploy2.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deployApi/componentDefinition.d.ts +27 -12
- package/dist/cjs-types/cli/lib/deployApi/componentDefinition.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deployApi/definitionConfig.d.ts +24 -24
- package/dist/cjs-types/cli/lib/deployApi/modules.d.ts +14 -14
- package/dist/cjs-types/cli/lib/deployApi/startPush.d.ts +61 -52
- package/dist/cjs-types/cli/lib/deployApi/startPush.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deploymentSelection.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/deploymentSelector.d.ts +2 -0
- package/dist/cjs-types/cli/lib/deploymentSelector.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/dev.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/env.d.ts +0 -4
- package/dist/cjs-types/cli/lib/env.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/expiration.d.ts +35 -0
- package/dist/cjs-types/cli/lib/expiration.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/expiration.test.d.ts +2 -0
- package/dist/cjs-types/cli/lib/expiration.test.d.ts.map +1 -0
- package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts +16 -1
- package/dist/cjs-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/init.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/anonymous.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/localDeployment.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/run.d.ts +15 -0
- package/dist/cjs-types/cli/lib/localDeployment/run.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/upgrade.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/localDeployment/utils.d.ts +7 -0
- package/dist/cjs-types/cli/lib/localDeployment/utils.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/mcp/requestContext.d.ts +3 -3
- package/dist/cjs-types/cli/lib/mcp/tools/insights.d.ts +2 -2
- package/dist/cjs-types/cli/lib/updates.d.ts +4 -3
- package/dist/cjs-types/cli/lib/updates.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/usage.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/utils/prompts.d.ts +1 -0
- package/dist/cjs-types/cli/lib/utils/prompts.d.ts.map +1 -1
- package/dist/cjs-types/cli/lib/utils/utils.d.ts +16 -2
- package/dist/cjs-types/cli/lib/utils/utils.d.ts.map +1 -1
- package/dist/cjs-types/index.d.ts +1 -1
- package/dist/cjs-types/react/client.d.ts +54 -2
- package/dist/cjs-types/react/client.d.ts.map +1 -1
- package/dist/cjs-types/react/index.d.ts +7 -2
- package/dist/cjs-types/react/index.d.ts.map +1 -1
- package/dist/cjs-types/react/use_query_object_options.test.d.ts +5 -0
- package/dist/cjs-types/react/use_query_object_options.test.d.ts.map +1 -0
- package/dist/cjs-types/react/use_query_result.test.d.ts +5 -0
- package/dist/cjs-types/react/use_query_result.test.d.ts.map +1 -0
- package/dist/cjs-types/react-clerk/ConvexProviderWithClerk.d.ts +1 -1
- package/dist/cjs-types/server/api.d.ts +5 -1
- package/dist/cjs-types/server/api.d.ts.map +1 -1
- package/dist/cjs-types/server/components/definition.d.ts +1 -0
- package/dist/cjs-types/server/components/definition.d.ts.map +1 -1
- package/dist/cjs-types/server/components/index.d.ts +5 -1
- package/dist/cjs-types/server/components/index.d.ts.map +1 -1
- package/dist/cjs-types/server/data_model.d.ts +2 -1
- package/dist/cjs-types/server/data_model.d.ts.map +1 -1
- package/dist/cjs-types/server/impl/meta_impl.d.ts +5 -0
- package/dist/cjs-types/server/impl/meta_impl.d.ts.map +1 -0
- package/dist/cjs-types/server/impl/registration_impl.d.ts.map +1 -1
- package/dist/cjs-types/server/index.d.ts +1 -0
- package/dist/cjs-types/server/index.d.ts.map +1 -1
- package/dist/cjs-types/server/meta.d.ts +72 -0
- package/dist/cjs-types/server/meta.d.ts.map +1 -0
- package/dist/cjs-types/server/registration.d.ts.map +1 -1
- package/dist/cli.bundle.cjs +1670 -1214
- package/dist/cli.bundle.cjs.map +4 -4
- package/dist/esm/browser/index-node.js +1 -0
- package/dist/esm/browser/index.js +1 -0
- package/dist/esm/browser/index.js.map +2 -2
- package/dist/esm/browser/query_options.js.map +2 -2
- package/dist/esm/cli/aiFiles.js +33 -15
- package/dist/esm/cli/aiFiles.js.map +2 -2
- package/dist/esm/cli/codegen_templates/readme.js +14 -1
- package/dist/esm/cli/codegen_templates/readme.js.map +2 -2
- package/dist/esm/cli/configure.js +23 -26
- package/dist/esm/cli/configure.js.map +2 -2
- package/dist/esm/cli/deploy.js +11 -10
- package/dist/esm/cli/deploy.js.map +2 -2
- package/dist/esm/cli/deploymentCreate.js +238 -42
- package/dist/esm/cli/deploymentCreate.js.map +2 -2
- package/dist/esm/cli/deploymentSelect.js +13 -12
- package/dist/esm/cli/deploymentSelect.js.map +2 -2
- package/dist/esm/cli/dev.js +34 -13
- package/dist/esm/cli/dev.js.map +2 -2
- package/dist/esm/cli/docs.js +1 -1
- package/dist/esm/cli/docs.js.map +2 -2
- package/dist/esm/cli/init.js +2 -2
- package/dist/esm/cli/init.js.map +2 -2
- package/dist/esm/cli/lib/aiFiles/agentsmd.js +13 -9
- package/dist/esm/cli/lib/aiFiles/agentsmd.js.map +2 -2
- package/dist/esm/cli/lib/aiFiles/claudemd.js +13 -9
- package/dist/esm/cli/lib/aiFiles/claudemd.js.map +2 -2
- package/dist/esm/cli/lib/aiFiles/guidelinesmd.js +12 -5
- package/dist/esm/cli/lib/aiFiles/guidelinesmd.js.map +2 -2
- package/dist/esm/cli/lib/aiFiles/index.js +72 -89
- package/dist/esm/cli/lib/aiFiles/index.js.map +2 -2
- package/dist/esm/cli/lib/aiFiles/skills.js +29 -13
- package/dist/esm/cli/lib/aiFiles/skills.js.map +2 -2
- package/dist/esm/cli/lib/aiFiles/state.js +60 -0
- package/dist/esm/cli/lib/aiFiles/state.js.map +7 -0
- package/dist/esm/cli/lib/aiFiles/status.js +32 -29
- package/dist/esm/cli/lib/aiFiles/status.js.map +2 -2
- package/dist/esm/cli/lib/aiFiles/utils.js +25 -10
- package/dist/esm/cli/lib/aiFiles/utils.js.map +2 -2
- package/dist/esm/cli/lib/api.js +70 -7
- package/dist/esm/cli/lib/api.js.map +2 -2
- package/dist/esm/cli/lib/command.js +4 -5
- package/dist/esm/cli/lib/command.js.map +2 -2
- package/dist/esm/cli/lib/config.js +39 -3
- package/dist/esm/cli/lib/config.js.map +2 -2
- package/dist/esm/cli/lib/deploy2.js +13 -26
- package/dist/esm/cli/lib/deploy2.js.map +2 -2
- package/dist/esm/cli/lib/deployApi/componentDefinition.js +4 -1
- package/dist/esm/cli/lib/deployApi/componentDefinition.js.map +2 -2
- package/dist/esm/cli/lib/deploymentSelection.js +46 -2
- package/dist/esm/cli/lib/deploymentSelection.js.map +2 -2
- package/dist/esm/cli/lib/deploymentSelector.js +1 -0
- package/dist/esm/cli/lib/deploymentSelector.js.map +2 -2
- package/dist/esm/cli/lib/dev.js +162 -118
- package/dist/esm/cli/lib/dev.js.map +2 -2
- package/dist/esm/cli/lib/env.js +0 -11
- package/dist/esm/cli/lib/env.js.map +2 -2
- package/dist/esm/cli/lib/expiration.js +80 -0
- package/dist/esm/cli/lib/expiration.js.map +7 -0
- package/dist/esm/cli/lib/init.js +4 -3
- package/dist/esm/cli/lib/init.js.map +2 -2
- package/dist/esm/cli/lib/insights.js +1 -1
- package/dist/esm/cli/lib/insights.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/anonymous.js +16 -9
- package/dist/esm/cli/lib/localDeployment/anonymous.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/localDeployment.js +9 -11
- package/dist/esm/cli/lib/localDeployment/localDeployment.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/run.js +1 -1
- package/dist/esm/cli/lib/localDeployment/run.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/upgrade.js +2 -2
- package/dist/esm/cli/lib/localDeployment/upgrade.js.map +2 -2
- package/dist/esm/cli/lib/localDeployment/utils.js +8 -0
- package/dist/esm/cli/lib/localDeployment/utils.js.map +2 -2
- package/dist/esm/cli/lib/mcp/tools/status.js +1 -1
- package/dist/esm/cli/lib/mcp/tools/status.js.map +2 -2
- package/dist/esm/cli/lib/updates.js +11 -9
- package/dist/esm/cli/lib/updates.js.map +2 -2
- package/dist/esm/cli/lib/usage.js +2 -1
- package/dist/esm/cli/lib/usage.js.map +2 -2
- package/dist/esm/cli/lib/utils/prompts.js +2 -1
- package/dist/esm/cli/lib/utils/prompts.js.map +2 -2
- package/dist/esm/cli/lib/utils/utils.js +45 -20
- package/dist/esm/cli/lib/utils/utils.js.map +3 -3
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/react/client.js +43 -6
- package/dist/esm/react/client.js.map +2 -2
- package/dist/esm/react/index.js +1 -0
- package/dist/esm/react/index.js.map +2 -2
- package/dist/esm/react-clerk/ConvexProviderWithClerk.js.map +1 -1
- package/dist/esm/server/api.js.map +2 -2
- package/dist/esm/server/components/index.js +40 -4
- package/dist/esm/server/components/index.js.map +2 -2
- package/dist/esm/server/impl/meta_impl.js +54 -0
- package/dist/esm/server/impl/meta_impl.js.map +7 -0
- package/dist/esm/server/impl/registration_impl.js +20 -11
- package/dist/esm/server/impl/registration_impl.js.map +2 -2
- package/dist/esm/server/index.js.map +2 -2
- package/dist/esm/server/meta.js +2 -0
- package/dist/esm/server/meta.js.map +7 -0
- package/dist/esm-types/browser/index.d.ts +1 -0
- package/dist/esm-types/browser/index.d.ts.map +1 -1
- package/dist/esm-types/browser/query_options.d.ts +12 -9
- package/dist/esm-types/browser/query_options.d.ts.map +1 -1
- package/dist/esm-types/cli/aiFiles.d.ts.map +1 -1
- package/dist/esm-types/cli/codegen_templates/readme.d.ts.map +1 -1
- package/dist/esm-types/cli/configure.d.ts.map +1 -1
- package/dist/esm-types/cli/configure.test.d.ts +2 -0
- package/dist/esm-types/cli/configure.test.d.ts.map +1 -0
- package/dist/esm-types/cli/deploy.d.ts.map +1 -1
- package/dist/esm-types/cli/deploymentCreate.d.ts +1 -0
- package/dist/esm-types/cli/deploymentCreate.d.ts.map +1 -1
- package/dist/esm-types/cli/deploymentSelect.d.ts +2 -1
- package/dist/esm-types/cli/deploymentSelect.d.ts.map +1 -1
- package/dist/esm-types/cli/dev.d.ts +3 -1
- package/dist/esm-types/cli/dev.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/aiFiles/agentsmd.d.ts +5 -5
- package/dist/esm-types/cli/lib/aiFiles/agentsmd.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/aiFiles/claudemd.d.ts +5 -5
- package/dist/esm-types/cli/lib/aiFiles/claudemd.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.d.ts +3 -3
- package/dist/esm-types/cli/lib/aiFiles/guidelinesmd.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/aiFiles/index.d.ts +20 -18
- package/dist/esm-types/cli/lib/aiFiles/index.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/aiFiles/skills.d.ts +6 -4
- package/dist/esm-types/cli/lib/aiFiles/skills.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/aiFiles/state.d.ts +38 -0
- package/dist/esm-types/cli/lib/aiFiles/state.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/state.test.d.ts +2 -0
- package/dist/esm-types/cli/lib/aiFiles/state.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/aiFiles/status.d.ts +4 -1
- package/dist/esm-types/cli/lib/aiFiles/status.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/aiFiles/utils.d.ts +13 -3
- package/dist/esm-types/cli/lib/aiFiles/utils.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/aiFiles/utils.test.d.ts +2 -0
- package/dist/esm-types/cli/lib/aiFiles/utils.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/api.d.ts +3 -3
- package/dist/esm-types/cli/lib/api.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/command.d.ts +2 -1
- package/dist/esm-types/cli/lib/command.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/config.d.ts +17 -6
- package/dist/esm-types/cli/lib/config.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deploy2.d.ts +5 -2
- package/dist/esm-types/cli/lib/deploy2.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deployApi/componentDefinition.d.ts +27 -12
- package/dist/esm-types/cli/lib/deployApi/componentDefinition.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deployApi/definitionConfig.d.ts +24 -24
- package/dist/esm-types/cli/lib/deployApi/modules.d.ts +14 -14
- package/dist/esm-types/cli/lib/deployApi/startPush.d.ts +61 -52
- package/dist/esm-types/cli/lib/deployApi/startPush.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deploymentSelection.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/deploymentSelector.d.ts +2 -0
- package/dist/esm-types/cli/lib/deploymentSelector.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/dev.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/env.d.ts +0 -4
- package/dist/esm-types/cli/lib/env.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/expiration.d.ts +35 -0
- package/dist/esm-types/cli/lib/expiration.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/expiration.test.d.ts +2 -0
- package/dist/esm-types/cli/lib/expiration.test.d.ts.map +1 -0
- package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts +16 -1
- package/dist/esm-types/cli/lib/generatedFunctionLogsApi.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/init.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/anonymous.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/localDeployment.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/run.d.ts +15 -0
- package/dist/esm-types/cli/lib/localDeployment/run.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/upgrade.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/localDeployment/utils.d.ts +7 -0
- package/dist/esm-types/cli/lib/localDeployment/utils.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/mcp/requestContext.d.ts +3 -3
- package/dist/esm-types/cli/lib/mcp/tools/insights.d.ts +2 -2
- package/dist/esm-types/cli/lib/updates.d.ts +4 -3
- package/dist/esm-types/cli/lib/updates.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/usage.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/utils/prompts.d.ts +1 -0
- package/dist/esm-types/cli/lib/utils/prompts.d.ts.map +1 -1
- package/dist/esm-types/cli/lib/utils/utils.d.ts +16 -2
- package/dist/esm-types/cli/lib/utils/utils.d.ts.map +1 -1
- package/dist/esm-types/index.d.ts +1 -1
- package/dist/esm-types/react/client.d.ts +54 -2
- package/dist/esm-types/react/client.d.ts.map +1 -1
- package/dist/esm-types/react/index.d.ts +7 -2
- package/dist/esm-types/react/index.d.ts.map +1 -1
- package/dist/esm-types/react/use_query_object_options.test.d.ts +5 -0
- package/dist/esm-types/react/use_query_object_options.test.d.ts.map +1 -0
- package/dist/esm-types/react/use_query_result.test.d.ts +5 -0
- package/dist/esm-types/react/use_query_result.test.d.ts.map +1 -0
- package/dist/esm-types/react-clerk/ConvexProviderWithClerk.d.ts +1 -1
- package/dist/esm-types/server/api.d.ts +5 -1
- package/dist/esm-types/server/api.d.ts.map +1 -1
- package/dist/esm-types/server/components/definition.d.ts +1 -0
- package/dist/esm-types/server/components/definition.d.ts.map +1 -1
- package/dist/esm-types/server/components/index.d.ts +5 -1
- package/dist/esm-types/server/components/index.d.ts.map +1 -1
- package/dist/esm-types/server/data_model.d.ts +2 -1
- package/dist/esm-types/server/data_model.d.ts.map +1 -1
- package/dist/esm-types/server/impl/meta_impl.d.ts +5 -0
- package/dist/esm-types/server/impl/meta_impl.d.ts.map +1 -0
- package/dist/esm-types/server/impl/registration_impl.d.ts.map +1 -1
- package/dist/esm-types/server/index.d.ts +1 -0
- package/dist/esm-types/server/index.d.ts.map +1 -1
- package/dist/esm-types/server/meta.d.ts +72 -0
- package/dist/esm-types/server/meta.d.ts.map +1 -0
- package/dist/esm-types/server/registration.d.ts.map +1 -1
- package/dist/react.bundle.js +50 -7
- package/dist/react.bundle.js.map +3 -3
- package/package.json +11 -7
- package/schemas/convex.schema.json +15 -2
- package/src/browser/index.ts +3 -0
- package/src/browser/query_options.test.ts +0 -9
- package/src/browser/query_options.ts +36 -15
- package/src/cli/aiFiles.ts +44 -14
- package/src/cli/codegen_templates/readme.ts +14 -1
- package/src/cli/configure.test.ts +138 -0
- package/src/cli/configure.ts +48 -47
- package/src/cli/deploy.ts +12 -9
- package/src/cli/deploymentCreate.test.ts +349 -14
- package/src/cli/deploymentCreate.ts +268 -41
- package/src/cli/deploymentSelect.test.ts +136 -27
- package/src/cli/deploymentSelect.ts +50 -41
- package/src/cli/deploymentSelection.test.ts +343 -35
- package/src/cli/dev.ts +49 -14
- package/src/cli/docs.ts +1 -1
- package/src/cli/init.ts +2 -2
- package/src/cli/lib/aiFiles/agentsmd.ts +15 -11
- package/src/cli/lib/aiFiles/claudemd.ts +15 -11
- package/src/cli/lib/aiFiles/guidelinesmd.test.ts +12 -2
- package/src/cli/lib/aiFiles/guidelinesmd.ts +15 -7
- package/src/cli/lib/aiFiles/index.test.ts +188 -222
- package/src/cli/lib/aiFiles/index.ts +119 -125
- package/src/cli/lib/aiFiles/integration.test.ts +112 -45
- package/src/cli/lib/aiFiles/prompt.test.ts +6 -6
- package/src/cli/lib/aiFiles/skills.ts +46 -16
- package/src/cli/lib/aiFiles/state.test.ts +280 -0
- package/src/cli/lib/aiFiles/state.ts +82 -0
- package/src/cli/lib/aiFiles/status.ts +45 -39
- package/src/cli/lib/aiFiles/utils.test.ts +50 -0
- package/src/cli/lib/aiFiles/utils.ts +38 -10
- package/src/cli/lib/api.ts +88 -7
- package/src/cli/lib/command.ts +12 -7
- package/src/cli/lib/config.test.ts +184 -7
- package/src/cli/lib/config.ts +67 -7
- package/src/cli/lib/deploy2.ts +14 -27
- package/src/cli/lib/deployApi/componentDefinition.ts +4 -1
- package/src/cli/lib/deploymentSelection.ts +59 -6
- package/src/cli/lib/deploymentSelector.test.ts +6 -0
- package/src/cli/lib/deploymentSelector.ts +2 -0
- package/src/cli/lib/dev.ts +202 -153
- package/src/cli/lib/env.ts +0 -15
- package/src/cli/lib/expiration.test.ts +159 -0
- package/src/cli/lib/expiration.ts +124 -0
- package/src/cli/lib/generatedFunctionLogsApi.ts +16 -1
- package/src/cli/lib/init.ts +6 -2
- package/src/cli/lib/insights.ts +1 -1
- package/src/cli/lib/localDeployment/anonymous.ts +19 -9
- package/src/cli/lib/localDeployment/localDeployment.ts +9 -11
- package/src/cli/lib/localDeployment/run.ts +1 -1
- package/src/cli/lib/localDeployment/upgrade.ts +12 -10
- package/src/cli/lib/localDeployment/utils.ts +12 -0
- package/src/cli/lib/mcp/tools/status.ts +1 -1
- package/src/cli/lib/updates.test.ts +102 -75
- package/src/cli/lib/updates.ts +14 -12
- package/src/cli/lib/usage.ts +3 -1
- package/src/cli/lib/utils/prompts.ts +2 -0
- package/src/cli/lib/utils/utils.test.ts +6 -6
- package/src/cli/lib/utils/utils.ts +66 -27
- package/src/index.ts +1 -1
- package/src/react/client.test.tsx +65 -0
- package/src/react/client.ts +129 -13
- package/src/react/index.ts +9 -1
- package/src/react/use_query_object_options.test.ts +50 -0
- package/src/react/use_query_result.test.ts +41 -0
- package/src/react-clerk/ConvexProviderWithClerk.test.tsx +1 -1
- package/src/react-clerk/ConvexProviderWithClerk.tsx +1 -1
- package/src/server/api.ts +5 -1
- package/src/server/components/definition.ts +3 -0
- package/src/server/components/index.ts +62 -5
- package/src/server/data_model.ts +2 -1
- package/src/server/impl/meta_impl.ts +74 -0
- package/src/server/impl/registration_impl.ts +21 -9
- package/src/server/index.ts +8 -0
- package/src/server/meta.ts +76 -0
- package/src/server/registration.ts +10 -0
- package/src/server/schema.test.ts +78 -1
- package/dist/cjs/cli/lib/aiFiles/config.js +0 -171
- package/dist/cjs/cli/lib/aiFiles/config.js.map +0 -7
- package/dist/cjs-types/cli/lib/aiFiles/config.d.ts +0 -46
- package/dist/cjs-types/cli/lib/aiFiles/config.d.ts.map +0 -1
- package/dist/cjs-types/cli/lib/aiFiles/config.test.d.ts +0 -2
- package/dist/cjs-types/cli/lib/aiFiles/config.test.d.ts.map +0 -1
- package/dist/esm/cli/lib/aiFiles/config.js +0 -135
- package/dist/esm/cli/lib/aiFiles/config.js.map +0 -7
- package/dist/esm-types/cli/lib/aiFiles/config.d.ts +0 -46
- package/dist/esm-types/cli/lib/aiFiles/config.d.ts.map +0 -1
- package/dist/esm-types/cli/lib/aiFiles/config.test.d.ts +0 -2
- package/dist/esm-types/cli/lib/aiFiles/config.test.d.ts.map +0 -1
- package/src/cli/lib/aiFiles/config.test.ts +0 -460
- package/src/cli/lib/aiFiles/config.ts +0 -188
- package/src/values/.claude/settings.local.json +0 -10
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/server/registration.ts"],
|
|
4
|
-
"sourcesContent": ["import {\n Auth,\n GenericDatabaseReader,\n GenericDatabaseReaderWithTable,\n GenericDatabaseWriter,\n GenericDatabaseWriterWithTable,\n StorageActionWriter,\n StorageReader,\n StorageWriter,\n} from \"./index.js\";\nimport {\n FunctionReference,\n FunctionReturnType,\n OptionalRestArgs,\n ValidatorTypeToReturnType,\n} from \"../server/api.js\";\nimport {\n GenericValidator,\n Infer,\n ObjectType,\n PropertyValidators,\n} from \"../values/validator.js\";\nimport { Id } from \"../values/value.js\";\nimport {\n GenericDataModel,\n NamedTableInfo,\n TableNamesInDataModel,\n VectorIndexNames,\n} from \"./data_model.js\";\nimport { Scheduler } from \"./scheduler.js\";\nimport { VectorSearchQuery } from \"./vector_search.js\";\nimport { Expand } from \"../type_utils.js\";\nimport { Validator } from \"../values/validators.js\";\n\n/**\n * A set of services for use within Convex mutation functions.\n *\n * The mutation context is passed as the first argument to any Convex mutation\n * function run on the server. Mutations run **transactionally**, all reads\n * and writes within a single mutation are atomic and isolated.\n *\n * You should generally use the `MutationCtx` type from\n * `\"./_generated/server\"`.\n *\n * @example\n * ```typescript\n * import { mutation } from \"./_generated/server\";\n * import { internal } from \"./_generated/api\";\n * import { v } from \"convex/values\";\n *\n * export const createTask = mutation({\n * args: { text: v.string() },\n * returns: v.id(\"tasks\"),\n * handler: async (ctx, args) => {\n * // ctx.db: read and write documents\n * const taskId = await ctx.db.insert(\"tasks\", { text: args.text, completed: false });\n *\n * // ctx.auth: check the authenticated user\n * const identity = await ctx.auth.getUserIdentity();\n *\n * // ctx.scheduler: schedule functions for later\n * await ctx.scheduler.runAfter(0, internal.notifications.send, { taskId });\n *\n * return taskId;\n * },\n * });\n * ```\n *\n * @public\n */\nexport interface GenericMutationCtx<DataModel extends GenericDataModel> {\n /**\n * A utility for reading and writing data in the database.\n *\n * Use `ctx.db.insert()`, `ctx.db.patch()`, `ctx.db.replace()`, and\n * `ctx.db.delete()` to write data. Use `ctx.db.get()` and `ctx.db.query()`\n * to read data. All operations within a mutation are atomic.\n */\n db: GenericDatabaseWriter<DataModel>;\n\n /**\n * Information about the currently authenticated user.\n *\n * Call `await ctx.auth.getUserIdentity()` to get the current user's identity,\n * or `null` if the user is not authenticated.\n */\n auth: Auth;\n\n /**\n * A utility for reading and writing files in storage.\n *\n * Use `ctx.storage.generateUploadUrl()` to create an upload URL for clients,\n * `ctx.storage.getUrl(storageId)` to get a URL for a stored file,\n * or `ctx.storage.delete(storageId)` to remove one.\n */\n storage: StorageWriter;\n\n /**\n * A utility for scheduling Convex functions to run in the future.\n *\n * @example\n * ```typescript\n * // Schedule an action to run immediately after this mutation commits:\n * await ctx.scheduler.runAfter(0, internal.emails.sendWelcome, { userId });\n *\n * // Schedule a cleanup to run in 24 hours:\n * await ctx.scheduler.runAfter(24 * 60 * 60 * 1000, internal.tasks.cleanup, {});\n * ```\n */\n scheduler: Scheduler;\n\n /**\n * Call a query function within the same transaction.\n *\n * The query runs within the same transaction as the calling mutation,\n * seeing a consistent snapshot of the database. Requires a\n * {@link FunctionReference} (e.g., `api.myModule.myQuery` or\n * `internal.myModule.myQuery`).\n *\n * NOTE: Often you can extract shared logic into a helper function instead.\n * `runQuery` incurs overhead of running argument and return value validation,\n * and creating a new isolated JS context.\n *\n * @example\n * ```typescript\n * const user = await ctx.runQuery(internal.users.getUser, { userId });\n * ```\n */\n runQuery: <Query extends FunctionReference<\"query\", \"public\" | \"internal\">>(\n query: Query,\n ...args: OptionalRestArgs<Query>\n ) => Promise<FunctionReturnType<Query>>;\n\n /**\n * Call a mutation function within the same transaction.\n *\n * The mutation runs in a sub-transaction, so if it throws an error, all of\n * its writes will be rolled back. Requires a {@link FunctionReference}.\n *\n * NOTE: Often you can extract shared logic into a helper function instead.\n * `runMutation` incurs overhead of running argument and return value\n * validation, and creating a new isolated JS context.\n */\n runMutation: <\n Mutation extends FunctionReference<\"mutation\", \"public\" | \"internal\">,\n >(\n mutation: Mutation,\n ...args: OptionalRestArgs<Mutation>\n ) => Promise<FunctionReturnType<Mutation>>;\n}\n\n/**\n * A set of services for use within Convex mutation functions.\n *\n * The mutation context is passed as the first argument to any Convex mutation\n * function run on the server.\n *\n * You should generally use the `MutationCtx` type from\n * `\"./_generated/server\"`.\n *\n * @public\n */\nexport type GenericMutationCtxWithTable<DataModel extends GenericDataModel> =\n Omit<GenericMutationCtx<DataModel>, \"db\"> & {\n db: GenericDatabaseWriterWithTable<DataModel>;\n };\n\n/**\n * A set of services for use within Convex query functions.\n *\n * The query context is passed as the first argument to any Convex query\n * function run on the server. Queries are **read-only**, they can read from\n * the database but cannot write. They are also **reactive**, when used with\n * `useQuery` on the client, the result automatically updates when data changes.\n *\n * You should generally use the `QueryCtx` type from\n * `\"./_generated/server\"`.\n *\n * @example\n * ```typescript\n * import { query } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * export const listTasks = query({\n * args: {},\n * returns: v.array(v.object({\n * _id: v.id(\"tasks\"),\n * _creationTime: v.number(),\n * text: v.string(),\n * completed: v.boolean(),\n * })),\n * handler: async (ctx, args) => {\n * // ctx.db: read-only database access\n * return await ctx.db.query(\"tasks\").order(\"desc\").take(100);\n * },\n * });\n * ```\n *\n * @public\n */\nexport interface GenericQueryCtx<DataModel extends GenericDataModel> {\n /**\n * A utility for reading data in the database.\n *\n * Use `ctx.db.get(table, id)` to fetch a single document by ID, or\n * `ctx.db.query(\"tableName\")` to query multiple documents with filtering\n * and ordering. Queries are read-only, no write methods are available.\n */\n db: GenericDatabaseReader<DataModel>;\n\n /**\n * Information about the currently authenticated user.\n *\n * Call `await ctx.auth.getUserIdentity()` to get the current user's identity,\n * or `null` if the user is not authenticated.\n */\n auth: Auth;\n\n /**\n * A utility for reading files in storage.\n *\n * Use `ctx.storage.getUrl(storageId)` to get a URL for a stored file.\n */\n storage: StorageReader;\n\n /**\n * Call a query function within the same transaction.\n *\n * The query runs within the same read snapshot. Requires a\n * {@link FunctionReference} (e.g., `api.myModule.myQuery` or\n * `internal.myModule.myQuery`).\n *\n * NOTE: Often you can extract shared logic into a helper function instead.\n * `runQuery` incurs overhead of running argument and return value validation,\n * and creating a new isolated JS context.\n */\n runQuery: <Query extends FunctionReference<\"query\", \"public\" | \"internal\">>(\n query: Query,\n ...args: OptionalRestArgs<Query>\n ) => Promise<FunctionReturnType<Query>>;\n}\n\n/**\n * A set of services for use within Convex query functions.\n *\n * The query context is passed as the first argument to any Convex query\n * function run on the server.\n *\n * This differs from the {@link MutationCtx} because all of the services are\n * read-only.\n *\n *\n * @public\n */\nexport type GenericQueryCtxWithTable<DataModel extends GenericDataModel> = Omit<\n GenericQueryCtx<DataModel>,\n \"db\"\n> & {\n db: GenericDatabaseReaderWithTable<DataModel>;\n};\n\n/**\n * A set of services for use within Convex action functions.\n *\n * The action context is passed as the first argument to any Convex action\n * run on the server. Actions can call external APIs and use Node.js libraries,\n * but do **not** have direct database access (`ctx.db` is not available).\n * Use `ctx.runQuery` and `ctx.runMutation` to interact with the database.\n *\n * You should generally use the `ActionCtx` type from\n * `\"./_generated/server\"`.\n *\n * @example\n * ```typescript\n * import { action } from \"./_generated/server\";\n * import { internal } from \"./_generated/api\";\n * import { v } from \"convex/values\";\n *\n * export const processPayment = action({\n * args: { orderId: v.id(\"orders\"), amount: v.number() },\n * returns: v.null(),\n * handler: async (ctx, args) => {\n * // Read data via ctx.runQuery:\n * const order = await ctx.runQuery(internal.orders.get, { id: args.orderId });\n *\n * // Call external API:\n * const result = await fetch(\"https://api.stripe.com/v1/charges\", { ... });\n *\n * // Write results back via ctx.runMutation:\n * await ctx.runMutation(internal.orders.markPaid, { id: args.orderId });\n *\n * return null;\n * },\n * });\n * ```\n *\n * **Common mistake:** `ctx.db` is not available in actions. Do not try to\n * access it, use `ctx.runQuery` and `ctx.runMutation` instead.\n *\n * @public\n */\nexport interface GenericActionCtx<DataModel extends GenericDataModel> {\n /**\n * Run the Convex query with the given name and arguments.\n *\n * Each `runQuery` call is a separate read transaction. Consider using an\n * {@link internalQuery} to prevent users from calling the query directly.\n *\n * @example\n * ```typescript\n * const user = await ctx.runQuery(internal.users.get, { userId });\n * ```\n *\n * @param query - A {@link FunctionReference} for the query to run.\n * @param args - The arguments to the query function.\n * @returns A promise of the query's result.\n */\n runQuery<Query extends FunctionReference<\"query\", \"public\" | \"internal\">>(\n query: Query,\n ...args: OptionalRestArgs<Query>\n ): Promise<FunctionReturnType<Query>>;\n\n /**\n * Run the Convex mutation with the given name and arguments.\n *\n * Each `runMutation` call is a separate write transaction. Consider using\n * an {@link internalMutation} to prevent users from calling it directly.\n *\n * @example\n * ```typescript\n * await ctx.runMutation(internal.orders.markPaid, { id: orderId });\n * ```\n *\n * @param mutation - A {@link FunctionReference} for the mutation to run.\n * @param args - The arguments to the mutation function.\n * @returns A promise of the mutation's result.\n */\n runMutation<\n Mutation extends FunctionReference<\"mutation\", \"public\" | \"internal\">,\n >(\n mutation: Mutation,\n ...args: OptionalRestArgs<Mutation>\n ): Promise<FunctionReturnType<Mutation>>;\n\n /**\n * Run the Convex action with the given name and arguments.\n *\n * **Important:** Only use `runAction` when you need to cross runtimes\n * (e.g., calling a `\"use node\"` action from the default Convex runtime).\n * For code in the same runtime, extract shared logic into a plain\n * TypeScript helper function instead, `runAction` has significant\n * overhead (separate function call, separate resource allocation).\n *\n * Consider using an {@link internalAction} to prevent users from calling the\n * action directly.\n *\n * @param action - A {@link FunctionReference} for the action to run.\n * @param args - The arguments to the action function.\n * @returns A promise of the action's result.\n */\n runAction<Action extends FunctionReference<\"action\", \"public\" | \"internal\">>(\n action: Action,\n ...args: OptionalRestArgs<Action>\n ): Promise<FunctionReturnType<Action>>;\n\n /**\n * A utility for scheduling Convex functions to run in the future.\n */\n scheduler: Scheduler;\n\n /**\n * Information about the currently authenticated user.\n */\n auth: Auth;\n\n /**\n * A utility for reading and writing files in storage.\n */\n storage: StorageActionWriter;\n\n /**\n * Run a vector search on the given table and index.\n *\n * @param tableName - The name of the table to query.\n * @param indexName - The name of the vector index on the table to query.\n * @param query - A {@link VectorSearchQuery} containing the vector to query,\n * the number of results to return, and any filters.\n * @returns A promise of IDs and scores for the documents with the nearest\n * vectors\n */\n vectorSearch<\n TableName extends TableNamesInDataModel<DataModel>,\n IndexName extends VectorIndexNames<NamedTableInfo<DataModel, TableName>>,\n >(\n tableName: TableName,\n indexName: IndexName,\n query: Expand<\n VectorSearchQuery<NamedTableInfo<DataModel, TableName>, IndexName>\n >,\n ): Promise<Array<{ _id: Id<TableName>; _score: number }>>;\n}\n\n/**\n * The default arguments type for a Convex query, mutation, or action function.\n *\n * Convex functions always take an arguments object that maps the argument\n * names to their values.\n *\n * @public\n */\nexport type DefaultFunctionArgs = Record<string, unknown>;\n\n/**\n * The arguments array for a function that takes arguments.\n *\n * This is an array of a single {@link DefaultFunctionArgs} element.\n */\ntype OneArgArray<ArgsObject extends DefaultFunctionArgs = DefaultFunctionArgs> =\n [ArgsObject];\n\n/**\n * The arguments to a function that takes no arguments (just an empty array).\n */\ntype NoArgsArray = [];\n\n/**\n * An array of arguments to a Convex function.\n *\n * Convex functions can take either a single {@link DefaultFunctionArgs} object or no\n * args at all.\n *\n * @public\n */\nexport type ArgsArray = OneArgArray | NoArgsArray;\n\n/**\n * A type for the empty object `{}`.\n *\n * Note that we don't use `type EmptyObject = {}` because that matches every object.\n */\nexport type EmptyObject = Record<string, never>;\n\n/**\n * Convert an {@link ArgsArray} into a single object type.\n *\n * Empty arguments arrays are converted to {@link EmptyObject}.\n * @public\n */\nexport type ArgsArrayToObject<Args extends ArgsArray> =\n Args extends OneArgArray<infer ArgsObject> ? ArgsObject : EmptyObject;\n\n/**\n * A type representing the visibility of a Convex function.\n *\n * @public\n */\nexport type FunctionVisibility = \"public\" | \"internal\";\n\n/**\n * Given a {@link FunctionVisibility}, should this function have `isPublic: true`\n * or `isInternal: true`?\n */\ntype VisibilityProperties<Visiblity extends FunctionVisibility> =\n Visiblity extends \"public\"\n ? {\n isPublic: true;\n }\n : {\n isInternal: true;\n };\n\n/**\n * A mutation function that is part of this app.\n *\n * You can create a mutation by wrapping your function in\n * {@link mutationGeneric} or {@link internalMutationGeneric} and exporting it.\n *\n * @public\n */\nexport type RegisteredMutation<\n Visibility extends FunctionVisibility,\n Args extends DefaultFunctionArgs,\n Returns,\n> = {\n isConvexFunction: true;\n isMutation: true;\n\n /** @internal */\n invokeMutation(argsStr: string): Promise<string>;\n\n /** @internal */\n exportArgs(): string;\n\n /** @internal */\n exportReturns(): string;\n\n /** @internal */\n _handler: (ctx: GenericMutationCtx<any>, args: Args) => Returns;\n} & VisibilityProperties<Visibility>;\n\n/**\n * A query function that is part of this app.\n *\n * You can create a query by wrapping your function in\n * {@link queryGeneric} or {@link internalQueryGeneric} and exporting it.\n *\n * @public\n */\nexport type RegisteredQuery<\n Visibility extends FunctionVisibility,\n Args extends DefaultFunctionArgs,\n Returns,\n> = {\n isConvexFunction: true;\n isQuery: true;\n\n /** @internal */\n invokeQuery(argsStr: string): Promise<string>;\n\n /** @internal */\n exportArgs(): string;\n\n /** @internal */\n exportReturns(): string;\n\n /** @internal */\n _handler: (ctx: GenericQueryCtx<any>, args: Args) => Returns;\n} & VisibilityProperties<Visibility>;\n\n/**\n * An action that is part of this app.\n *\n * You can create an action by wrapping your function in\n * {@link actionGeneric} or {@link internalActionGeneric} and exporting it.\n *\n * @public\n */\nexport type RegisteredAction<\n Visibility extends FunctionVisibility,\n Args extends DefaultFunctionArgs,\n Returns,\n> = {\n isConvexFunction: true;\n isAction: true;\n\n /** @internal */\n invokeAction(requestId: string, argsStr: string): Promise<string>;\n\n /** @internal */\n exportArgs(): string;\n\n /** @internal */\n exportReturns(): string;\n\n /** @internal */\n _handler: (ctx: GenericActionCtx<any>, args: Args) => Returns;\n} & VisibilityProperties<Visibility>;\n\n/**\n * An HTTP action that is part of this app's public API.\n *\n * You can create public HTTP actions by wrapping your function in\n * {@link httpActionGeneric} and exporting it.\n *\n * @public\n */\nexport type PublicHttpAction = {\n isHttp: true;\n\n /** @internal */\n invokeHttpAction(request: Request): Promise<Response>;\n /** @internal */\n _handler: (ctx: GenericActionCtx<any>, request: Request) => Promise<Response>;\n};\n\n/**\n * @deprecated -- See the type definition for `MutationBuilder` or similar for\n * the types used for defining Convex functions.\n *\n * The definition of a Convex query, mutation, or action function without\n * argument validation.\n *\n * Convex functions always take a context object as their first argument\n * and an (optional) args object as their second argument.\n *\n * This can be written as a function like:\n * ```js\n * import { query } from \"./_generated/server\";\n *\n * export const func = query(({ db }, { arg }) => {...});\n * ```\n * or as an object like:\n *\n * ```js\n * import { query } from \"./_generated/server\";\n *\n * export const func = query({\n * handler: ({ db }, { arg }) => {...},\n * });\n * ```\n * See {@link ValidatedFunction} to add argument validation.\n *\n * @public\n */\nexport type UnvalidatedFunction<Ctx, Args extends ArgsArray, Returns> =\n | ((ctx: Ctx, ...args: Args) => Returns)\n | {\n handler: (ctx: Ctx, ...args: Args) => Returns;\n };\n\n/**\n * @deprecated -- See the type definition for `MutationBuilder` or similar for\n * the types used for defining Convex functions.\n *\n * The definition of a Convex query, mutation, or action function with argument\n * validation.\n *\n * Argument validation allows you to assert that the arguments to this function\n * are the expected type.\n *\n * Example:\n *\n * ```js\n * import { query } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * export const func = query({\n * args: {\n * arg: v.string()\n * },\n * handler: ({ db }, { arg }) => {...},\n * });\n * ```\n *\n * **For security, argument validation should be added to all public functions in\n * production apps.**\n *\n * See {@link UnvalidatedFunction} for functions without argument validation.\n * @public\n */\nexport interface ValidatedFunction<\n Ctx,\n ArgsValidator extends PropertyValidators,\n Returns,\n> {\n /**\n * A validator for the arguments of this function.\n *\n * This is an object mapping argument names to validators constructed with\n * {@link values.v}.\n *\n * ```js\n * import { v } from \"convex/values\";\n *\n * const args = {\n * stringArg: v.string(),\n * optionalNumberArg: v.optional(v.number()),\n * }\n * ```\n */\n args: ArgsValidator;\n\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator.\n * @returns\n */\n handler: (ctx: Ctx, args: ObjectType<ArgsValidator>) => Returns;\n}\n\n/**\n * There are multiple syntaxes for defining a Convex function:\n * ```\n * - query(async (ctx, args) => {...})\n * - query({ handler: async (ctx, args) => {...} })\n * - query({ args: { a: v.string }, handler: async (ctx, args) => {...} } })\n * - query({ args: { a: v.string }, returns: v.string(), handler: async (ctx, args) => {...} } })\n *```\n *\n * In each of these, we want to correctly infer the type for the arguments and\n * return value, preferring the type derived from a validator if it's provided.\n *\n * To avoid having a separate overload for each, which would show up in error messages,\n * we use the type params -- ArgsValidator, ReturnsValidator, ReturnValue, OneOrZeroArgs.\n *\n * The type for ReturnValue and OneOrZeroArgs are constrained by the type or ArgsValidator and\n * ReturnsValidator if they're present, and inferred from any explicit type annotations to the\n * arguments or return value of the function.\n *\n * Below are a few utility types to get the appropriate type constraints based on\n * an optional validator.\n *\n * Additional tricks:\n * - We use Validator | void instead of Validator | undefined because the latter does\n * not work with `strictNullChecks` since it's equivalent to just `Validator`.\n * - We use a tuple type of length 1 to avoid distribution over the union\n * https://github.com/microsoft/TypeScript/issues/29368#issuecomment-453529532\n */\n\nexport type ReturnValueForOptionalValidator<\n ReturnsValidator extends Validator<any, any, any> | PropertyValidators | void,\n> = [ReturnsValidator] extends [Validator<any, any, any>]\n ? ValidatorTypeToReturnType<Infer<ReturnsValidator>>\n : [ReturnsValidator] extends [PropertyValidators]\n ? ValidatorTypeToReturnType<ObjectType<ReturnsValidator>>\n : any;\n\nexport type ArgsArrayForOptionalValidator<\n ArgsValidator extends GenericValidator | PropertyValidators | void,\n> = [ArgsValidator] extends [Validator<any, any, any>]\n ? OneArgArray<Infer<ArgsValidator>>\n : [ArgsValidator] extends [PropertyValidators]\n ? OneArgArray<ObjectType<ArgsValidator>>\n : ArgsArray;\n\nexport type DefaultArgsForOptionalValidator<\n ArgsValidator extends GenericValidator | PropertyValidators | void,\n> = [ArgsValidator] extends [Validator<any, any, any>]\n ? [Infer<ArgsValidator>]\n : [ArgsValidator] extends [PropertyValidators]\n ? [ObjectType<ArgsValidator>]\n : OneArgArray;\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link mutationGeneric} a type specific to your data model.\n * @public\n */\nexport type MutationBuilder<\n DataModel extends GenericDataModel,\n Visibility extends FunctionVisibility,\n> = {\n <\n ArgsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,\n OneOrZeroArgs extends\n ArgsArrayForOptionalValidator<ArgsValidator> = DefaultArgsForOptionalValidator<ArgsValidator>,\n >(\n mutation:\n | {\n /**\n * Argument validation.\n *\n * Examples:\n *\n * ```\n * args: {}\n * args: { input: v.optional(v.number()) }\n * args: { message: v.string(), author: v.id(\"authors\") }\n * args: { messages: v.array(v.string()) }\n * ```\n */\n args?: ArgsValidator;\n /**\n * The return value validator.\n *\n * Examples:\n *\n * ```\n * returns: v.null()\n * returns: v.string()\n * returns: { message: v.string(), author: v.id(\"authors\") }\n * returns: v.array(v.string())\n * ```\n */\n returns?: ReturnsValidator;\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n handler: (\n ctx: GenericMutationCtx<DataModel>,\n ...args: OneOrZeroArgs\n ) => ReturnValue;\n }\n | {\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n (\n ctx: GenericMutationCtx<DataModel>,\n ...args: OneOrZeroArgs\n ): ReturnValue;\n },\n ): RegisteredMutation<\n Visibility,\n ArgsArrayToObject<OneOrZeroArgs>,\n ReturnValue\n >;\n};\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link mutationGeneric} a type specific to your data model.\n * @public\n */\nexport type MutationBuilderWithTable<\n DataModel extends GenericDataModel,\n Visibility extends FunctionVisibility,\n> = {\n <\n ArgsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,\n OneOrZeroArgs extends\n ArgsArrayForOptionalValidator<ArgsValidator> = DefaultArgsForOptionalValidator<ArgsValidator>,\n >(\n mutation:\n | {\n /**\n * Argument validation.\n *\n * Examples:\n *\n * ```\n * args: {}\n * args: { input: v.optional(v.number()) }\n * args: { message: v.string(), author: v.id(\"authors\") }\n * args: { messages: v.array(v.string()) }\n * ```\n */\n args?: ArgsValidator;\n /**\n * The return value validator.\n *\n * Examples:\n *\n * ```\n * returns: v.null()\n * returns: v.string()\n * returns: { message: v.string(), author: v.id(\"authors\") }\n * returns: v.array(v.string())\n * ```\n */\n returns?: ReturnsValidator;\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n handler: (\n ctx: GenericMutationCtxWithTable<DataModel>,\n ...args: OneOrZeroArgs\n ) => ReturnValue;\n }\n | {\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n (\n ctx: GenericMutationCtxWithTable<DataModel>,\n ...args: OneOrZeroArgs\n ): ReturnValue;\n },\n ): RegisteredMutation<\n Visibility,\n ArgsArrayToObject<OneOrZeroArgs>,\n ReturnValue\n >;\n};\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link queryGeneric} a type specific to your data model.\n * @public\n */\nexport type QueryBuilder<\n DataModel extends GenericDataModel,\n Visibility extends FunctionVisibility,\n> = {\n <\n ArgsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,\n OneOrZeroArgs extends\n ArgsArrayForOptionalValidator<ArgsValidator> = DefaultArgsForOptionalValidator<ArgsValidator>,\n >(\n query:\n | {\n /**\n * Argument validation.\n *\n * Examples:\n *\n * ```\n * args: {}\n * args: { input: v.optional(v.number()) }\n * args: { message: v.string(), author: v.id(\"authors\") }\n * args: { messages: v.array(v.string()) }\n * ```\n */\n args?: ArgsValidator;\n /**\n * The return value validator.\n *\n * Examples:\n *\n * ```\n * returns: v.null()\n * returns: v.string()\n * returns: { message: v.string(), author: v.id(\"authors\") }\n * returns: v.array(v.string())\n * ```\n */\n returns?: ReturnsValidator;\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n handler: (\n ctx: GenericQueryCtx<DataModel>,\n ...args: OneOrZeroArgs\n ) => ReturnValue;\n }\n | {\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n (\n ctx: GenericQueryCtx<DataModel>,\n ...args: OneOrZeroArgs\n ): ReturnValue;\n },\n ): RegisteredQuery<Visibility, ArgsArrayToObject<OneOrZeroArgs>, ReturnValue>;\n};\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link queryGeneric} a type specific to your data model.\n * @public\n */\nexport type QueryBuilderWithTable<\n DataModel extends GenericDataModel,\n Visibility extends FunctionVisibility,\n> = {\n <\n ArgsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,\n OneOrZeroArgs extends\n ArgsArrayForOptionalValidator<ArgsValidator> = DefaultArgsForOptionalValidator<ArgsValidator>,\n >(\n query:\n | {\n /**\n * Argument validation.\n *\n * Examples:\n *\n * ```\n * args: {}\n * args: { input: v.optional(v.number()) }\n * args: { message: v.string(), author: v.id(\"authors\") }\n * args: { messages: v.array(v.string()) }\n * ```\n */\n args?: ArgsValidator;\n /**\n * The return value validator.\n *\n * Examples:\n *\n * ```\n * returns: v.null()\n * returns: v.string()\n * returns: { message: v.string(), author: v.id(\"authors\") }\n * returns: v.array(v.string())\n * ```\n */\n returns?: ReturnsValidator;\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n handler: (\n ctx: GenericQueryCtxWithTable<DataModel>,\n ...args: OneOrZeroArgs\n ) => ReturnValue;\n }\n | {\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n (\n ctx: GenericQueryCtxWithTable<DataModel>,\n ...args: OneOrZeroArgs\n ): ReturnValue;\n },\n ): RegisteredQuery<Visibility, ArgsArrayToObject<OneOrZeroArgs>, ReturnValue>;\n};\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link actionGeneric} a type specific to your data model.\n * @public\n */\nexport type ActionBuilder<\n DataModel extends GenericDataModel,\n Visibility extends FunctionVisibility,\n> = {\n <\n ArgsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,\n OneOrZeroArgs extends\n ArgsArrayForOptionalValidator<ArgsValidator> = DefaultArgsForOptionalValidator<ArgsValidator>,\n >(\n func:\n | {\n /**\n * Argument validation.\n *\n * Examples:\n *\n * ```\n * args: {}\n * args: { input: v.optional(v.number()) }\n * args: { message: v.string(), author: v.id(\"authors\") }\n * args: { messages: v.array(v.string()) }\n * ```\n *\n */\n args?: ArgsValidator;\n /**\n * The return value validator.\n *\n * Examples:\n *\n * ```\n * returns: v.null()\n * returns: v.string()\n * returns: { message: v.string(), author: v.id(\"authors\") }\n * returns: v.array(v.string())\n * ```\n */\n returns?: ReturnsValidator;\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n handler: (\n ctx: GenericActionCtx<DataModel>,\n ...args: OneOrZeroArgs\n ) => ReturnValue;\n }\n | {\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n (\n ctx: GenericActionCtx<DataModel>,\n ...args: OneOrZeroArgs\n ): ReturnValue;\n },\n ): RegisteredAction<\n Visibility,\n ArgsArrayToObject<OneOrZeroArgs>,\n ReturnValue\n >;\n};\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link httpActionGeneric} a type specific to your data model\n * and functions.\n * @public\n */\nexport type HttpActionBuilder = (\n func: (ctx: GenericActionCtx<any>, request: Request) => Promise<Response>,\n) => PublicHttpAction;\n"],
|
|
4
|
+
"sourcesContent": ["import {\n Auth,\n GenericDatabaseReader,\n GenericDatabaseReaderWithTable,\n GenericDatabaseWriter,\n GenericDatabaseWriterWithTable,\n StorageActionWriter,\n StorageReader,\n StorageWriter,\n} from \"./index.js\";\nimport { ActionMeta, MutationMeta, QueryMeta } from \"./meta.js\";\nimport {\n FunctionReference,\n FunctionReturnType,\n OptionalRestArgs,\n ValidatorTypeToReturnType,\n} from \"../server/api.js\";\nimport {\n GenericValidator,\n Infer,\n ObjectType,\n PropertyValidators,\n} from \"../values/validator.js\";\nimport { Id } from \"../values/value.js\";\nimport {\n GenericDataModel,\n NamedTableInfo,\n TableNamesInDataModel,\n VectorIndexNames,\n} from \"./data_model.js\";\nimport { Scheduler } from \"./scheduler.js\";\nimport { VectorSearchQuery } from \"./vector_search.js\";\nimport { Expand } from \"../type_utils.js\";\nimport { Validator } from \"../values/validators.js\";\n\n/**\n * A set of services for use within Convex mutation functions.\n *\n * The mutation context is passed as the first argument to any Convex mutation\n * function run on the server. Mutations run **transactionally**, all reads\n * and writes within a single mutation are atomic and isolated.\n *\n * You should generally use the `MutationCtx` type from\n * `\"./_generated/server\"`.\n *\n * @example\n * ```typescript\n * import { mutation } from \"./_generated/server\";\n * import { internal } from \"./_generated/api\";\n * import { v } from \"convex/values\";\n *\n * export const createTask = mutation({\n * args: { text: v.string() },\n * returns: v.id(\"tasks\"),\n * handler: async (ctx, args) => {\n * // ctx.db: read and write documents\n * const taskId = await ctx.db.insert(\"tasks\", { text: args.text, completed: false });\n *\n * // ctx.auth: check the authenticated user\n * const identity = await ctx.auth.getUserIdentity();\n *\n * // ctx.scheduler: schedule functions for later\n * await ctx.scheduler.runAfter(0, internal.notifications.send, { taskId });\n *\n * return taskId;\n * },\n * });\n * ```\n *\n * @public\n */\nexport interface GenericMutationCtx<DataModel extends GenericDataModel> {\n /**\n * A utility for reading and writing data in the database.\n *\n * Use `ctx.db.insert()`, `ctx.db.patch()`, `ctx.db.replace()`, and\n * `ctx.db.delete()` to write data. Use `ctx.db.get()` and `ctx.db.query()`\n * to read data. All operations within a mutation are atomic.\n */\n db: GenericDatabaseWriter<DataModel>;\n\n /**\n * Information about the currently authenticated user.\n *\n * Call `await ctx.auth.getUserIdentity()` to get the current user's identity,\n * or `null` if the user is not authenticated.\n */\n auth: Auth;\n\n /**\n * A utility for reading and writing files in storage.\n *\n * Use `ctx.storage.generateUploadUrl()` to create an upload URL for clients,\n * `ctx.storage.getUrl(storageId)` to get a URL for a stored file,\n * or `ctx.storage.delete(storageId)` to remove one.\n */\n storage: StorageWriter;\n\n /**\n * A utility for scheduling Convex functions to run in the future.\n *\n * @example\n * ```typescript\n * // Schedule an action to run immediately after this mutation commits:\n * await ctx.scheduler.runAfter(0, internal.emails.sendWelcome, { userId });\n *\n * // Schedule a cleanup to run in 24 hours:\n * await ctx.scheduler.runAfter(24 * 60 * 60 * 1000, internal.tasks.cleanup, {});\n * ```\n */\n scheduler: Scheduler;\n\n /**\n * Call a query function within the same transaction.\n *\n * The query runs within the same transaction as the calling mutation,\n * seeing a consistent snapshot of the database. Requires a\n * {@link FunctionReference} (e.g., `api.myModule.myQuery` or\n * `internal.myModule.myQuery`).\n *\n * NOTE: Often you can extract shared logic into a helper function instead.\n * `runQuery` incurs overhead of running argument and return value validation,\n * and creating a new isolated JS context.\n *\n * @example\n * ```typescript\n * const user = await ctx.runQuery(internal.users.getUser, { userId });\n * ```\n */\n runQuery: <Query extends FunctionReference<\"query\", \"public\" | \"internal\">>(\n query: Query,\n ...args: OptionalRestArgs<Query>\n ) => Promise<FunctionReturnType<Query>>;\n\n /**\n * Call a mutation function within the same transaction.\n *\n * The mutation runs in a sub-transaction, so if it throws an error, all of\n * its writes will be rolled back. Requires a {@link FunctionReference}.\n *\n * NOTE: Often you can extract shared logic into a helper function instead.\n * `runMutation` incurs overhead of running argument and return value\n * validation, and creating a new isolated JS context.\n */\n runMutation: <\n Mutation extends FunctionReference<\"mutation\", \"public\" | \"internal\">,\n >(\n mutation: Mutation,\n ...args: OptionalRestArgs<Mutation>\n ) => Promise<FunctionReturnType<Mutation>>;\n\n /** @internal */\n meta: MutationMeta;\n}\n\n/**\n * A set of services for use within Convex mutation functions.\n *\n * The mutation context is passed as the first argument to any Convex mutation\n * function run on the server.\n *\n * You should generally use the `MutationCtx` type from\n * `\"./_generated/server\"`.\n *\n * @public\n */\nexport type GenericMutationCtxWithTable<DataModel extends GenericDataModel> =\n Omit<GenericMutationCtx<DataModel>, \"db\"> & {\n db: GenericDatabaseWriterWithTable<DataModel>;\n };\n\n/**\n * A set of services for use within Convex query functions.\n *\n * The query context is passed as the first argument to any Convex query\n * function run on the server. Queries are **read-only**, they can read from\n * the database but cannot write. They are also **reactive**, when used with\n * `useQuery` on the client, the result automatically updates when data changes.\n *\n * You should generally use the `QueryCtx` type from\n * `\"./_generated/server\"`.\n *\n * @example\n * ```typescript\n * import { query } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * export const listTasks = query({\n * args: {},\n * returns: v.array(v.object({\n * _id: v.id(\"tasks\"),\n * _creationTime: v.number(),\n * text: v.string(),\n * completed: v.boolean(),\n * })),\n * handler: async (ctx, args) => {\n * // ctx.db: read-only database access\n * return await ctx.db.query(\"tasks\").order(\"desc\").take(100);\n * },\n * });\n * ```\n *\n * @public\n */\nexport interface GenericQueryCtx<DataModel extends GenericDataModel> {\n /**\n * A utility for reading data in the database.\n *\n * Use `ctx.db.get(table, id)` to fetch a single document by ID, or\n * `ctx.db.query(\"tableName\")` to query multiple documents with filtering\n * and ordering. Queries are read-only, no write methods are available.\n */\n db: GenericDatabaseReader<DataModel>;\n\n /**\n * Information about the currently authenticated user.\n *\n * Call `await ctx.auth.getUserIdentity()` to get the current user's identity,\n * or `null` if the user is not authenticated.\n */\n auth: Auth;\n\n /**\n * A utility for reading files in storage.\n *\n * Use `ctx.storage.getUrl(storageId)` to get a URL for a stored file.\n */\n storage: StorageReader;\n\n /**\n * Call a query function within the same transaction.\n *\n * The query runs within the same read snapshot. Requires a\n * {@link FunctionReference} (e.g., `api.myModule.myQuery` or\n * `internal.myModule.myQuery`).\n *\n * NOTE: Often you can extract shared logic into a helper function instead.\n * `runQuery` incurs overhead of running argument and return value validation,\n * and creating a new isolated JS context.\n */\n runQuery: <Query extends FunctionReference<\"query\", \"public\" | \"internal\">>(\n query: Query,\n ...args: OptionalRestArgs<Query>\n ) => Promise<FunctionReturnType<Query>>;\n\n /** @internal */\n meta: QueryMeta;\n}\n\n/**\n * A set of services for use within Convex query functions.\n *\n * The query context is passed as the first argument to any Convex query\n * function run on the server.\n *\n * This differs from the {@link MutationCtx} because all of the services are\n * read-only.\n *\n *\n * @public\n */\nexport type GenericQueryCtxWithTable<DataModel extends GenericDataModel> = Omit<\n GenericQueryCtx<DataModel>,\n \"db\"\n> & {\n db: GenericDatabaseReaderWithTable<DataModel>;\n};\n\n/**\n * A set of services for use within Convex action functions.\n *\n * The action context is passed as the first argument to any Convex action\n * run on the server. Actions can call external APIs and use Node.js libraries,\n * but do **not** have direct database access (`ctx.db` is not available).\n * Use `ctx.runQuery` and `ctx.runMutation` to interact with the database.\n *\n * You should generally use the `ActionCtx` type from\n * `\"./_generated/server\"`.\n *\n * @example\n * ```typescript\n * import { action } from \"./_generated/server\";\n * import { internal } from \"./_generated/api\";\n * import { v } from \"convex/values\";\n *\n * export const processPayment = action({\n * args: { orderId: v.id(\"orders\"), amount: v.number() },\n * returns: v.null(),\n * handler: async (ctx, args) => {\n * // Read data via ctx.runQuery:\n * const order = await ctx.runQuery(internal.orders.get, { id: args.orderId });\n *\n * // Call external API:\n * const result = await fetch(\"https://api.stripe.com/v1/charges\", { ... });\n *\n * // Write results back via ctx.runMutation:\n * await ctx.runMutation(internal.orders.markPaid, { id: args.orderId });\n *\n * return null;\n * },\n * });\n * ```\n *\n * **Common mistake:** `ctx.db` is not available in actions. Do not try to\n * access it, use `ctx.runQuery` and `ctx.runMutation` instead.\n *\n * @public\n */\nexport interface GenericActionCtx<DataModel extends GenericDataModel> {\n /**\n * Run the Convex query with the given name and arguments.\n *\n * Each `runQuery` call is a separate read transaction. Consider using an\n * {@link internalQuery} to prevent users from calling the query directly.\n *\n * @example\n * ```typescript\n * const user = await ctx.runQuery(internal.users.get, { userId });\n * ```\n *\n * @param query - A {@link FunctionReference} for the query to run.\n * @param args - The arguments to the query function.\n * @returns A promise of the query's result.\n */\n runQuery<Query extends FunctionReference<\"query\", \"public\" | \"internal\">>(\n query: Query,\n ...args: OptionalRestArgs<Query>\n ): Promise<FunctionReturnType<Query>>;\n\n /**\n * Run the Convex mutation with the given name and arguments.\n *\n * Each `runMutation` call is a separate write transaction. Consider using\n * an {@link internalMutation} to prevent users from calling it directly.\n *\n * @example\n * ```typescript\n * await ctx.runMutation(internal.orders.markPaid, { id: orderId });\n * ```\n *\n * @param mutation - A {@link FunctionReference} for the mutation to run.\n * @param args - The arguments to the mutation function.\n * @returns A promise of the mutation's result.\n */\n runMutation<\n Mutation extends FunctionReference<\"mutation\", \"public\" | \"internal\">,\n >(\n mutation: Mutation,\n ...args: OptionalRestArgs<Mutation>\n ): Promise<FunctionReturnType<Mutation>>;\n\n /**\n * Run the Convex action with the given name and arguments.\n *\n * **Important:** Only use `runAction` when you need to cross runtimes\n * (e.g., calling a `\"use node\"` action from the default Convex runtime).\n * For code in the same runtime, extract shared logic into a plain\n * TypeScript helper function instead, `runAction` has significant\n * overhead (separate function call, separate resource allocation).\n *\n * Consider using an {@link internalAction} to prevent users from calling the\n * action directly.\n *\n * @param action - A {@link FunctionReference} for the action to run.\n * @param args - The arguments to the action function.\n * @returns A promise of the action's result.\n */\n runAction<Action extends FunctionReference<\"action\", \"public\" | \"internal\">>(\n action: Action,\n ...args: OptionalRestArgs<Action>\n ): Promise<FunctionReturnType<Action>>;\n\n /**\n * A utility for scheduling Convex functions to run in the future.\n */\n scheduler: Scheduler;\n\n /**\n * Information about the currently authenticated user.\n */\n auth: Auth;\n\n /**\n * A utility for reading and writing files in storage.\n */\n storage: StorageActionWriter;\n\n /**\n * Run a vector search on the given table and index.\n *\n * @param tableName - The name of the table to query.\n * @param indexName - The name of the vector index on the table to query.\n * @param query - A {@link VectorSearchQuery} containing the vector to query,\n * the number of results to return, and any filters.\n * @returns A promise of IDs and scores for the documents with the nearest\n * vectors\n */\n vectorSearch<\n TableName extends TableNamesInDataModel<DataModel>,\n IndexName extends VectorIndexNames<NamedTableInfo<DataModel, TableName>>,\n >(\n tableName: TableName,\n indexName: IndexName,\n query: Expand<\n VectorSearchQuery<NamedTableInfo<DataModel, TableName>, IndexName>\n >,\n ): Promise<Array<{ _id: Id<TableName>; _score: number }>>;\n\n /** @internal */\n meta: ActionMeta;\n}\n\n/**\n * The default arguments type for a Convex query, mutation, or action function.\n *\n * Convex functions always take an arguments object that maps the argument\n * names to their values.\n *\n * @public\n */\nexport type DefaultFunctionArgs = Record<string, unknown>;\n\n/**\n * The arguments array for a function that takes arguments.\n *\n * This is an array of a single {@link DefaultFunctionArgs} element.\n */\ntype OneArgArray<ArgsObject extends DefaultFunctionArgs = DefaultFunctionArgs> =\n [ArgsObject];\n\n/**\n * The arguments to a function that takes no arguments (just an empty array).\n */\ntype NoArgsArray = [];\n\n/**\n * An array of arguments to a Convex function.\n *\n * Convex functions can take either a single {@link DefaultFunctionArgs} object or no\n * args at all.\n *\n * @public\n */\nexport type ArgsArray = OneArgArray | NoArgsArray;\n\n/**\n * A type for the empty object `{}`.\n *\n * Note that we don't use `type EmptyObject = {}` because that matches every object.\n */\nexport type EmptyObject = Record<string, never>;\n\n/**\n * Convert an {@link ArgsArray} into a single object type.\n *\n * Empty arguments arrays are converted to {@link EmptyObject}.\n * @public\n */\nexport type ArgsArrayToObject<Args extends ArgsArray> =\n Args extends OneArgArray<infer ArgsObject> ? ArgsObject : EmptyObject;\n\n/**\n * A type representing the visibility of a Convex function.\n *\n * @public\n */\nexport type FunctionVisibility = \"public\" | \"internal\";\n\n/**\n * Given a {@link FunctionVisibility}, should this function have `isPublic: true`\n * or `isInternal: true`?\n */\ntype VisibilityProperties<Visiblity extends FunctionVisibility> =\n Visiblity extends \"public\"\n ? {\n isPublic: true;\n }\n : {\n isInternal: true;\n };\n\n/**\n * A mutation function that is part of this app.\n *\n * You can create a mutation by wrapping your function in\n * {@link mutationGeneric} or {@link internalMutationGeneric} and exporting it.\n *\n * @public\n */\nexport type RegisteredMutation<\n Visibility extends FunctionVisibility,\n Args extends DefaultFunctionArgs,\n Returns,\n> = {\n isConvexFunction: true;\n isMutation: true;\n\n /** @internal */\n invokeMutation(argsStr: string): Promise<string>;\n\n /** @internal */\n exportArgs(): string;\n\n /** @internal */\n exportReturns(): string;\n\n /** @internal */\n _handler: (ctx: GenericMutationCtx<any>, args: Args) => Returns;\n} & VisibilityProperties<Visibility>;\n\n/**\n * A query function that is part of this app.\n *\n * You can create a query by wrapping your function in\n * {@link queryGeneric} or {@link internalQueryGeneric} and exporting it.\n *\n * @public\n */\nexport type RegisteredQuery<\n Visibility extends FunctionVisibility,\n Args extends DefaultFunctionArgs,\n Returns,\n> = {\n isConvexFunction: true;\n isQuery: true;\n\n /** @internal */\n invokeQuery(argsStr: string): Promise<string>;\n\n /** @internal */\n exportArgs(): string;\n\n /** @internal */\n exportReturns(): string;\n\n /** @internal */\n _handler: (ctx: GenericQueryCtx<any>, args: Args) => Returns;\n} & VisibilityProperties<Visibility>;\n\n/**\n * An action that is part of this app.\n *\n * You can create an action by wrapping your function in\n * {@link actionGeneric} or {@link internalActionGeneric} and exporting it.\n *\n * @public\n */\nexport type RegisteredAction<\n Visibility extends FunctionVisibility,\n Args extends DefaultFunctionArgs,\n Returns,\n> = {\n isConvexFunction: true;\n isAction: true;\n\n /** @internal */\n invokeAction(requestId: string, argsStr: string): Promise<string>;\n\n /** @internal */\n exportArgs(): string;\n\n /** @internal */\n exportReturns(): string;\n\n /** @internal */\n _handler: (ctx: GenericActionCtx<any>, args: Args) => Returns;\n} & VisibilityProperties<Visibility>;\n\n/**\n * An HTTP action that is part of this app's public API.\n *\n * You can create public HTTP actions by wrapping your function in\n * {@link httpActionGeneric} and exporting it.\n *\n * @public\n */\nexport type PublicHttpAction = {\n isHttp: true;\n\n /** @internal */\n invokeHttpAction(request: Request): Promise<Response>;\n /** @internal */\n _handler: (ctx: GenericActionCtx<any>, request: Request) => Promise<Response>;\n};\n\n/**\n * @deprecated -- See the type definition for `MutationBuilder` or similar for\n * the types used for defining Convex functions.\n *\n * The definition of a Convex query, mutation, or action function without\n * argument validation.\n *\n * Convex functions always take a context object as their first argument\n * and an (optional) args object as their second argument.\n *\n * This can be written as a function like:\n * ```js\n * import { query } from \"./_generated/server\";\n *\n * export const func = query(({ db }, { arg }) => {...});\n * ```\n * or as an object like:\n *\n * ```js\n * import { query } from \"./_generated/server\";\n *\n * export const func = query({\n * handler: ({ db }, { arg }) => {...},\n * });\n * ```\n * See {@link ValidatedFunction} to add argument validation.\n *\n * @public\n */\nexport type UnvalidatedFunction<Ctx, Args extends ArgsArray, Returns> =\n | ((ctx: Ctx, ...args: Args) => Returns)\n | {\n handler: (ctx: Ctx, ...args: Args) => Returns;\n };\n\n/**\n * @deprecated -- See the type definition for `MutationBuilder` or similar for\n * the types used for defining Convex functions.\n *\n * The definition of a Convex query, mutation, or action function with argument\n * validation.\n *\n * Argument validation allows you to assert that the arguments to this function\n * are the expected type.\n *\n * Example:\n *\n * ```js\n * import { query } from \"./_generated/server\";\n * import { v } from \"convex/values\";\n *\n * export const func = query({\n * args: {\n * arg: v.string()\n * },\n * handler: ({ db }, { arg }) => {...},\n * });\n * ```\n *\n * **For security, argument validation should be added to all public functions in\n * production apps.**\n *\n * See {@link UnvalidatedFunction} for functions without argument validation.\n * @public\n */\nexport interface ValidatedFunction<\n Ctx,\n ArgsValidator extends PropertyValidators,\n Returns,\n> {\n /**\n * A validator for the arguments of this function.\n *\n * This is an object mapping argument names to validators constructed with\n * {@link values.v}.\n *\n * ```js\n * import { v } from \"convex/values\";\n *\n * const args = {\n * stringArg: v.string(),\n * optionalNumberArg: v.optional(v.number()),\n * }\n * ```\n */\n args: ArgsValidator;\n\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator.\n * @returns\n */\n handler: (ctx: Ctx, args: ObjectType<ArgsValidator>) => Returns;\n}\n\n/**\n * There are multiple syntaxes for defining a Convex function:\n * ```\n * - query(async (ctx, args) => {...})\n * - query({ handler: async (ctx, args) => {...} })\n * - query({ args: { a: v.string }, handler: async (ctx, args) => {...} } })\n * - query({ args: { a: v.string }, returns: v.string(), handler: async (ctx, args) => {...} } })\n *```\n *\n * In each of these, we want to correctly infer the type for the arguments and\n * return value, preferring the type derived from a validator if it's provided.\n *\n * To avoid having a separate overload for each, which would show up in error messages,\n * we use the type params -- ArgsValidator, ReturnsValidator, ReturnValue, OneOrZeroArgs.\n *\n * The type for ReturnValue and OneOrZeroArgs are constrained by the type or ArgsValidator and\n * ReturnsValidator if they're present, and inferred from any explicit type annotations to the\n * arguments or return value of the function.\n *\n * Below are a few utility types to get the appropriate type constraints based on\n * an optional validator.\n *\n * Additional tricks:\n * - We use Validator | void instead of Validator | undefined because the latter does\n * not work with `strictNullChecks` since it's equivalent to just `Validator`.\n * - We use a tuple type of length 1 to avoid distribution over the union\n * https://github.com/microsoft/TypeScript/issues/29368#issuecomment-453529532\n */\n\nexport type ReturnValueForOptionalValidator<\n ReturnsValidator extends Validator<any, any, any> | PropertyValidators | void,\n> = [ReturnsValidator] extends [Validator<any, any, any>]\n ? ValidatorTypeToReturnType<Infer<ReturnsValidator>>\n : [ReturnsValidator] extends [PropertyValidators]\n ? ValidatorTypeToReturnType<ObjectType<ReturnsValidator>>\n : any;\n\nexport type ArgsArrayForOptionalValidator<\n ArgsValidator extends GenericValidator | PropertyValidators | void,\n> = [ArgsValidator] extends [Validator<any, any, any>]\n ? OneArgArray<Infer<ArgsValidator>>\n : [ArgsValidator] extends [PropertyValidators]\n ? OneArgArray<ObjectType<ArgsValidator>>\n : ArgsArray;\n\nexport type DefaultArgsForOptionalValidator<\n ArgsValidator extends GenericValidator | PropertyValidators | void,\n> = [ArgsValidator] extends [Validator<any, any, any>]\n ? [Infer<ArgsValidator>]\n : [ArgsValidator] extends [PropertyValidators]\n ? [ObjectType<ArgsValidator>]\n : OneArgArray;\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link mutationGeneric} a type specific to your data model.\n * @public\n */\nexport type MutationBuilder<\n DataModel extends GenericDataModel,\n Visibility extends FunctionVisibility,\n> = {\n <\n ArgsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,\n OneOrZeroArgs extends\n ArgsArrayForOptionalValidator<ArgsValidator> = DefaultArgsForOptionalValidator<ArgsValidator>,\n >(\n mutation:\n | {\n /**\n * Argument validation.\n *\n * Examples:\n *\n * ```\n * args: {}\n * args: { input: v.optional(v.number()) }\n * args: { message: v.string(), author: v.id(\"authors\") }\n * args: { messages: v.array(v.string()) }\n * ```\n */\n args?: ArgsValidator;\n /**\n * The return value validator.\n *\n * Examples:\n *\n * ```\n * returns: v.null()\n * returns: v.string()\n * returns: { message: v.string(), author: v.id(\"authors\") }\n * returns: v.array(v.string())\n * ```\n */\n returns?: ReturnsValidator;\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n handler: (\n ctx: GenericMutationCtx<DataModel>,\n ...args: OneOrZeroArgs\n ) => ReturnValue;\n }\n | {\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n (\n ctx: GenericMutationCtx<DataModel>,\n ...args: OneOrZeroArgs\n ): ReturnValue;\n },\n ): RegisteredMutation<\n Visibility,\n ArgsArrayToObject<OneOrZeroArgs>,\n ReturnValue\n >;\n};\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link mutationGeneric} a type specific to your data model.\n * @public\n */\nexport type MutationBuilderWithTable<\n DataModel extends GenericDataModel,\n Visibility extends FunctionVisibility,\n> = {\n <\n ArgsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,\n OneOrZeroArgs extends\n ArgsArrayForOptionalValidator<ArgsValidator> = DefaultArgsForOptionalValidator<ArgsValidator>,\n >(\n mutation:\n | {\n /**\n * Argument validation.\n *\n * Examples:\n *\n * ```\n * args: {}\n * args: { input: v.optional(v.number()) }\n * args: { message: v.string(), author: v.id(\"authors\") }\n * args: { messages: v.array(v.string()) }\n * ```\n */\n args?: ArgsValidator;\n /**\n * The return value validator.\n *\n * Examples:\n *\n * ```\n * returns: v.null()\n * returns: v.string()\n * returns: { message: v.string(), author: v.id(\"authors\") }\n * returns: v.array(v.string())\n * ```\n */\n returns?: ReturnsValidator;\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n handler: (\n ctx: GenericMutationCtxWithTable<DataModel>,\n ...args: OneOrZeroArgs\n ) => ReturnValue;\n }\n | {\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n (\n ctx: GenericMutationCtxWithTable<DataModel>,\n ...args: OneOrZeroArgs\n ): ReturnValue;\n },\n ): RegisteredMutation<\n Visibility,\n ArgsArrayToObject<OneOrZeroArgs>,\n ReturnValue\n >;\n};\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link queryGeneric} a type specific to your data model.\n * @public\n */\nexport type QueryBuilder<\n DataModel extends GenericDataModel,\n Visibility extends FunctionVisibility,\n> = {\n <\n ArgsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,\n OneOrZeroArgs extends\n ArgsArrayForOptionalValidator<ArgsValidator> = DefaultArgsForOptionalValidator<ArgsValidator>,\n >(\n query:\n | {\n /**\n * Argument validation.\n *\n * Examples:\n *\n * ```\n * args: {}\n * args: { input: v.optional(v.number()) }\n * args: { message: v.string(), author: v.id(\"authors\") }\n * args: { messages: v.array(v.string()) }\n * ```\n */\n args?: ArgsValidator;\n /**\n * The return value validator.\n *\n * Examples:\n *\n * ```\n * returns: v.null()\n * returns: v.string()\n * returns: { message: v.string(), author: v.id(\"authors\") }\n * returns: v.array(v.string())\n * ```\n */\n returns?: ReturnsValidator;\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n handler: (\n ctx: GenericQueryCtx<DataModel>,\n ...args: OneOrZeroArgs\n ) => ReturnValue;\n }\n | {\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n (\n ctx: GenericQueryCtx<DataModel>,\n ...args: OneOrZeroArgs\n ): ReturnValue;\n },\n ): RegisteredQuery<Visibility, ArgsArrayToObject<OneOrZeroArgs>, ReturnValue>;\n};\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link queryGeneric} a type specific to your data model.\n * @public\n */\nexport type QueryBuilderWithTable<\n DataModel extends GenericDataModel,\n Visibility extends FunctionVisibility,\n> = {\n <\n ArgsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,\n OneOrZeroArgs extends\n ArgsArrayForOptionalValidator<ArgsValidator> = DefaultArgsForOptionalValidator<ArgsValidator>,\n >(\n query:\n | {\n /**\n * Argument validation.\n *\n * Examples:\n *\n * ```\n * args: {}\n * args: { input: v.optional(v.number()) }\n * args: { message: v.string(), author: v.id(\"authors\") }\n * args: { messages: v.array(v.string()) }\n * ```\n */\n args?: ArgsValidator;\n /**\n * The return value validator.\n *\n * Examples:\n *\n * ```\n * returns: v.null()\n * returns: v.string()\n * returns: { message: v.string(), author: v.id(\"authors\") }\n * returns: v.array(v.string())\n * ```\n */\n returns?: ReturnsValidator;\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n handler: (\n ctx: GenericQueryCtxWithTable<DataModel>,\n ...args: OneOrZeroArgs\n ) => ReturnValue;\n }\n | {\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n (\n ctx: GenericQueryCtxWithTable<DataModel>,\n ...args: OneOrZeroArgs\n ): ReturnValue;\n },\n ): RegisteredQuery<Visibility, ArgsArrayToObject<OneOrZeroArgs>, ReturnValue>;\n};\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link actionGeneric} a type specific to your data model.\n * @public\n */\nexport type ActionBuilder<\n DataModel extends GenericDataModel,\n Visibility extends FunctionVisibility,\n> = {\n <\n ArgsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnsValidator extends\n | PropertyValidators\n | Validator<any, \"required\", any>\n | void,\n ReturnValue extends ReturnValueForOptionalValidator<ReturnsValidator> = any,\n OneOrZeroArgs extends\n ArgsArrayForOptionalValidator<ArgsValidator> = DefaultArgsForOptionalValidator<ArgsValidator>,\n >(\n func:\n | {\n /**\n * Argument validation.\n *\n * Examples:\n *\n * ```\n * args: {}\n * args: { input: v.optional(v.number()) }\n * args: { message: v.string(), author: v.id(\"authors\") }\n * args: { messages: v.array(v.string()) }\n * ```\n *\n */\n args?: ArgsValidator;\n /**\n * The return value validator.\n *\n * Examples:\n *\n * ```\n * returns: v.null()\n * returns: v.string()\n * returns: { message: v.string(), author: v.id(\"authors\") }\n * returns: v.array(v.string())\n * ```\n */\n returns?: ReturnsValidator;\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n handler: (\n ctx: GenericActionCtx<DataModel>,\n ...args: OneOrZeroArgs\n ) => ReturnValue;\n }\n | {\n /**\n * The implementation of this function.\n *\n * This is a function that takes in the appropriate context and arguments\n * and produces some result.\n *\n * @param ctx - The context object. This is one of {@link QueryCtx},\n * {@link MutationCtx}, or {@link ActionCtx} depending on the function type.\n * @param args - The arguments object for this function. This will match\n * the type defined by the argument validator if provided.\n * @returns\n */\n (\n ctx: GenericActionCtx<DataModel>,\n ...args: OneOrZeroArgs\n ): ReturnValue;\n },\n ): RegisteredAction<\n Visibility,\n ArgsArrayToObject<OneOrZeroArgs>,\n ReturnValue\n >;\n};\n\n/**\n * Internal type helper used by Convex code generation.\n *\n * Used to give {@link httpActionGeneric} a type specific to your data model\n * and functions.\n * @public\n */\nexport type HttpActionBuilder = (\n func: (ctx: GenericActionCtx<any>, request: Request) => Promise<Response>,\n) => PublicHttpAction;\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -27,4 +27,5 @@ export { ConvexHttpClient } from "./http_client.js";
|
|
|
27
27
|
export type { HttpMutationOptions } from "./http_client.js";
|
|
28
28
|
export type { QueryJournal } from "./sync/protocol.js";
|
|
29
29
|
export type { FunctionResult } from "./sync/function_result.js";
|
|
30
|
+
export type { QueryOptions } from "./query_options.js";
|
|
30
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EACV,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/browser/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EACV,uBAAuB,EACvB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,gBAAgB,GACjB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,YAAY,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,YAAY,EACV,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAGvD,YAAY,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGhE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Query options are a potential new API for a variety of functions, but in particular a new overload of the React hook for queries.
|
|
3
|
-
*
|
|
4
|
-
* Inspired by https://tanstack.com/query/v5/docs/framework/react/guides/query-options
|
|
5
|
-
*/
|
|
6
1
|
import type { FunctionArgs, FunctionReference } from "../server/api.js";
|
|
7
2
|
/**
|
|
8
|
-
*
|
|
3
|
+
* Options for a Convex query: the query function reference and its arguments.
|
|
4
|
+
*
|
|
5
|
+
* Used with the object-form overload of {@link useQuery}.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
9
8
|
*/
|
|
10
|
-
export type
|
|
9
|
+
export type QueryOptions<Query extends FunctionReference<"query">> = {
|
|
10
|
+
/**
|
|
11
|
+
* The query function to run.
|
|
12
|
+
*/
|
|
11
13
|
query: Query;
|
|
14
|
+
/**
|
|
15
|
+
* The arguments to the query function.
|
|
16
|
+
*/
|
|
12
17
|
args: FunctionArgs<Query>;
|
|
13
|
-
extendSubscriptionFor?: number;
|
|
14
18
|
};
|
|
15
|
-
export declare function convexQueryOptions<Query extends FunctionReference<"query">>(options: ConvexQueryOptions<Query>): ConvexQueryOptions<Query>;
|
|
16
19
|
//# sourceMappingURL=query_options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query_options.d.ts","sourceRoot":"","sources":["../../../src/browser/query_options.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"query_options.d.ts","sourceRoot":"","sources":["../../../src/browser/query_options.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,CAAC,KAAK,SAAS,iBAAiB,CAAC,OAAO,CAAC,IAAI;IACnE;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IACb;;OAEG;IACH,IAAI,EAAE,YAAY,CAAC,KAAK,CAAC,CAAC;CAC3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aiFiles.d.ts","sourceRoot":"","sources":["../../../src/cli/aiFiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"aiFiles.d.ts","sourceRoot":"","sources":["../../../src/cli/aiFiles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAgJtD,eAAO,MAAM,OAAO,qBAaI,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readme.d.ts","sourceRoot":"","sources":["../../../../src/cli/codegen_templates/readme.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,
|
|
1
|
+
{"version":3,"file":"readme.d.ts","sourceRoot":"","sources":["../../../../src/cli/codegen_templates/readme.ts"],"names":[],"mappings":"AAAA,wBAAgB,aAAa,WAqG5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../src/cli/configure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,OAAO,EACL,cAAc,EACd,cAAc,EAMf,MAAM,cAAc,CAAC;AA8BtB,OAAO,EACL,mBAAmB,EAGpB,MAAM,8BAA8B,CAAC;AAItC,KAAK,qBAAqB,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,mBAAmB,GAEpB,KAAK,GAEL,UAAU,GAEV,KAAK,GAEL,IAAI,CAAC;AAET,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE;QACZ,KAAK,CAAC,EAAE;YACN,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACpC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACtC,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IAC9C,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,gCAAgC,CACpD,GAAG,EAAE,OAAO,EACZ,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,mBAAmB,GAC9B,OAAO,CACR,qBAAqB,GAAG;IACtB,gBAAgB,EAAE;QAChB,cAAc,EAAE,cAAc,CAAC;QAC/B,cAAc,EAAE,cAAc,CAAC;QAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;KACxB,GAAG,IAAI,CAAC;CACV,CACF,CA2CA;AAED,wBAAsB,iCAAiC,CACrD,GAAG,EAAE,OAAO,EACZ,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,mBAAmB,GAC9B,OAAO,CACR,qBAAqB,GAAG;IACtB,gBAAgB,EAAE;QAChB,cAAc,EAAE,cAAc,CAAC;QAC/B,cAAc,EAAE,cAAc,CAAC;QAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;KACzB,GAAG,IAAI,CAAC;CACV,CACF,
|
|
1
|
+
{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["../../../src/cli/configure.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAQhD,OAAO,EACL,cAAc,EACd,cAAc,EAMf,MAAM,cAAc,CAAC;AA8BtB,OAAO,EACL,mBAAmB,EAGpB,MAAM,8BAA8B,CAAC;AAItC,KAAK,qBAAqB,GAAG;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,KAAK,mBAAmB,GAEpB,KAAK,GAEL,UAAU,GAEV,KAAK,GAEL,IAAI,CAAC;AAET,KAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE;QACZ,KAAK,CAAC,EAAE;YACN,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;QACF,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACpC,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QACtC,YAAY,EAAE,OAAO,CAAC;KACvB,CAAC;IACF,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IAC9C,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3C,CAAC;AAEF;;;;;;GAMG;AACH,wBAAsB,gCAAgC,CACpD,GAAG,EAAE,OAAO,EACZ,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,mBAAmB,GAC9B,OAAO,CACR,qBAAqB,GAAG;IACtB,gBAAgB,EAAE;QAChB,cAAc,EAAE,cAAc,CAAC;QAC/B,cAAc,EAAE,cAAc,CAAC;QAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;KACxB,GAAG,IAAI,CAAC;CACV,CACF,CA2CA;AAED,wBAAsB,iCAAiC,CACrD,GAAG,EAAE,OAAO,EACZ,mBAAmB,EAAE,mBAAmB,EACxC,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE,mBAAmB,GAC9B,OAAO,CACR,qBAAqB,GAAG;IACtB,gBAAgB,EAAE;QAChB,cAAc,EAAE,cAAc,CAAC;QAC/B,cAAc,EAAE,cAAc,CAAC;QAC/B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;KACzB,GAAG,IAAI,CAAC;CACV,CACF,CAqIA;AA8LD,wBAAsB,aAAa,CACjC,GAAG,EAAE,OAAO,EACZ,mBAAmB,EAAE,mBAAmB,EACxC,UAAU,EAAE;IACV,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,aAAa,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IAC9C,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC,GACA,OAAO,CAAC;IACT,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,OAAO,GAAG,OAAO,CAAC;CAClC,CAAC,CAkBD;AAiPD,wBAAsB,wCAAwC,CAC5D,GAAG,EAAE,OAAO,EACZ,OAAO,EAAE;IACP,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,cAAc,CAAC;CAChC,EACD,aAAa,EAAE,MAAM,GAAG,IAAI,iBA2B7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"configure.test.d.ts","sourceRoot":"","sources":["../../../src/cli/configure.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/cli/deploy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy.d.ts","sourceRoot":"","sources":["../../../src/cli/deploy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAiC9D,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;MAwJf,CAAC"}
|
|
@@ -5,6 +5,7 @@ export declare const deploymentCreate: Command<[string | undefined], {
|
|
|
5
5
|
region?: string;
|
|
6
6
|
select?: true;
|
|
7
7
|
default?: true;
|
|
8
|
+
expiration?: string;
|
|
8
9
|
}, {}>;
|
|
9
10
|
export declare function fetchAvailableRegions(ctx: Context, teamId: number): Promise<{
|
|
10
11
|
available: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploymentCreate.d.ts","sourceRoot":"","sources":["../../../src/cli/deploymentCreate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAiB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"deploymentCreate.d.ts","sourceRoot":"","sources":["../../../src/cli/deploymentCreate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAiB,MAAM,uBAAuB,CAAC;AA2C/D,eAAO,MAAM,gBAAgB;;;;;;MAkKzB,CAAC;AA2ZL,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM;;;;KAYvE;AAED,KAAK,eAAe,GAAG,OAAO,CAC5B,UAAU,CAAC,OAAO,qBAAqB,CAAC,CACzC,CAAC,MAAM,CAAC,CAAC;AAEV,wBAAgB,oBAAoB,CAClC,gBAAgB,EAAE,eAAe,EAAE,EACnC,MAAM,EAAE,MAAM;;;;SAIf"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Command } from "@commander-js/extra-typings";
|
|
2
2
|
import { Context } from "../bundler/context.js";
|
|
3
|
+
import { DeploymentSelection } from "./lib/deploymentSelection.js";
|
|
3
4
|
export declare const deploymentSelect: Command<[string], {}, {}>;
|
|
4
|
-
export declare function
|
|
5
|
+
export declare function saveSelectedDeployment(ctx: Context, selector: string, selection: DeploymentSelection, previousDeploymentName: string | null): Promise<void>;
|
|
5
6
|
//# sourceMappingURL=deploymentSelect.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploymentSelect.d.ts","sourceRoot":"","sources":["../../../src/cli/deploymentSelect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAiB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"deploymentSelect.d.ts","sourceRoot":"","sources":["../../../src/cli/deploymentSelect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAiB,MAAM,uBAAuB,CAAC;AAE/D,OAAO,EACL,mBAAmB,EAGpB,MAAM,8BAA8B,CAAC;AAMtC,eAAO,MAAM,gBAAgB,2BAqDzB,CAAC;AAEL,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,OAAO,EACZ,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,mBAAmB,EAC9B,sBAAsB,EAAE,MAAM,GAAG,IAAI,GACpC,OAAO,CAAC,IAAI,CAAC,CA4Cf"}
|
|
@@ -7,9 +7,10 @@ export declare const dev: Command<[], {
|
|
|
7
7
|
pushAllModules: boolean;
|
|
8
8
|
once: boolean;
|
|
9
9
|
untilSuccess: boolean;
|
|
10
|
+
start?: string;
|
|
11
|
+
runSh?: string;
|
|
10
12
|
run?: string;
|
|
11
13
|
runComponent?: string;
|
|
12
|
-
runSh?: string;
|
|
13
14
|
tailLogs: true | "disable" | "always" | "pause-on-deploy";
|
|
14
15
|
traceEvents: boolean;
|
|
15
16
|
debugBundlePath?: string;
|
|
@@ -32,6 +33,7 @@ export declare const dev: Command<[], {
|
|
|
32
33
|
localSitePort?: string;
|
|
33
34
|
localBackendVersion?: string;
|
|
34
35
|
localForceUpgrade: boolean;
|
|
36
|
+
deployment?: string;
|
|
35
37
|
local: boolean;
|
|
36
38
|
cloud: boolean;
|
|
37
39
|
}, {}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/cli/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/cli/dev.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,6BAA6B,CAAC;AAkB9D,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2RZ,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AiFilesState } from "./state.js";
|
|
2
2
|
import { type InjectResult, type StripResult } from "./utils.js";
|
|
3
3
|
export declare function injectAgentsMdSection({ section, projectDir, }: {
|
|
4
4
|
section: string;
|
|
5
5
|
projectDir?: string;
|
|
6
6
|
}): Promise<InjectResult>;
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
7
|
+
export declare function attemptToStripAgentsMdSection(projectDir: string): Promise<StripResult>;
|
|
8
|
+
export declare function attemptToRemoveAgentsMdSection(projectDir: string): Promise<boolean>;
|
|
9
9
|
export declare function hasAgentsMdInstalled(projectDir: string): Promise<boolean>;
|
|
10
10
|
/**
|
|
11
11
|
* Inject (or update) the Convex section in AGENTS.md and record the hash.
|
|
12
12
|
* Returns true if the file was actually written.
|
|
13
13
|
*/
|
|
14
|
-
export declare function applyAgentsMdSection({ projectDir,
|
|
14
|
+
export declare function applyAgentsMdSection({ projectDir, state, convexDirName, }: {
|
|
15
15
|
projectDir: string;
|
|
16
|
-
|
|
16
|
+
state: AiFilesState;
|
|
17
17
|
convexDirName: string;
|
|
18
18
|
}): Promise<boolean>;
|
|
19
19
|
//# sourceMappingURL=agentsmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agentsmd.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/agentsmd.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"agentsmd.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/agentsmd.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EAKjB,MAAM,YAAY,CAAC;AAYpB,wBAAsB,qBAAqB,CAAC,EAC1C,OAAO,EACP,UAAU,GACX,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,YAAY,CAAC,CAExB;AAED,wBAAsB,6BAA6B,CACjD,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC,CAEtB;AAED,wBAAsB,8BAA8B,CAClD,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,OAAO,CAAC,CAMlB;AAED,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,UAAU,EACV,KAAK,EACL,aAAa,GACd,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,OAAO,CAAC,CASnB"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AiFilesState } from "./state.js";
|
|
2
2
|
import { type InjectResult, type StripResult } from "./utils.js";
|
|
3
3
|
export declare function injectClaudeMdSection({ section, projectDir, }: {
|
|
4
4
|
section: string;
|
|
5
5
|
projectDir?: string;
|
|
6
6
|
}): Promise<InjectResult>;
|
|
7
|
-
export declare function
|
|
8
|
-
export declare function
|
|
7
|
+
export declare function attemptToStripClaudeMdSection(projectDir: string): Promise<StripResult>;
|
|
8
|
+
export declare function attemptToRemoveClaudeMdSection(projectDir: string): Promise<boolean>;
|
|
9
9
|
export declare function hasClaudeMdInstalled(projectDir: string): Promise<boolean>;
|
|
10
10
|
/**
|
|
11
11
|
* Inject (or update) the Convex section in CLAUDE.md and record the hash.
|
|
12
12
|
* Returns true if the file was actually written.
|
|
13
13
|
*/
|
|
14
|
-
export declare function applyClaudeMdSection({ projectDir,
|
|
14
|
+
export declare function applyClaudeMdSection({ projectDir, state, convexDirName, }: {
|
|
15
15
|
projectDir: string;
|
|
16
|
-
|
|
16
|
+
state: AiFilesState;
|
|
17
17
|
convexDirName: string;
|
|
18
18
|
}): Promise<boolean>;
|
|
19
19
|
//# sourceMappingURL=claudemd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"claudemd.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/claudemd.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"claudemd.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/claudemd.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,WAAW,EAKjB,MAAM,YAAY,CAAC;AAYpB,wBAAsB,qBAAqB,CAAC,EAC1C,OAAO,EACP,UAAU,GACX,EAAE;IACD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,YAAY,CAAC,CAExB;AAED,wBAAsB,6BAA6B,CACjD,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,CAAC,CAEtB;AAED,wBAAsB,8BAA8B,CAClD,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,OAAO,CAAC,CAMlB;AAED,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CAAC,EACzC,UAAU,EACV,KAAK,EACL,aAAa,GACd,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,OAAO,CAAC,OAAO,CAAC,CASnB"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AiFilesState } from "./state.js";
|
|
2
2
|
export declare function hasGuidelinesInstalled(convexDir: string): Promise<boolean>;
|
|
3
3
|
/**
|
|
4
4
|
* Download and write the guidelines file.
|
|
5
5
|
* Guidelines live in `_generated/` so local edits are not expected and are
|
|
6
6
|
* not preserved.
|
|
7
7
|
*/
|
|
8
|
-
export declare function installGuidelinesFile({ convexDir,
|
|
8
|
+
export declare function installGuidelinesFile({ convexDir, state, }: {
|
|
9
9
|
convexDir: string;
|
|
10
|
-
|
|
10
|
+
state: AiFilesState;
|
|
11
11
|
}): Promise<void>;
|
|
12
12
|
//# sourceMappingURL=guidelinesmd.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guidelinesmd.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/guidelinesmd.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"guidelinesmd.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/guidelinesmd.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,wBAAsB,sBAAsB,CAC1C,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,SAAS,EACT,KAAK,GACN,EAAE;IACD,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,YAAY,CAAC;CACrB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBhB"}
|
|
@@ -1,40 +1,42 @@
|
|
|
1
1
|
import { Context } from "../../../bundler/context.js";
|
|
2
2
|
import { type AiFilesPaths } from "./paths.js";
|
|
3
|
+
import { type AiFilesProjectConfig } from "../config.js";
|
|
3
4
|
/**
|
|
4
5
|
* Install or refresh all Convex AI files.
|
|
5
6
|
*
|
|
6
|
-
* Reads the existing
|
|
7
|
-
* fresh install.
|
|
8
|
-
* flags (all default to true).
|
|
7
|
+
* Reads the existing state if present, or starts from a blank one for a
|
|
8
|
+
* fresh install.
|
|
9
9
|
*/
|
|
10
|
-
export declare function installAiFiles({ projectDir, convexDir,
|
|
11
|
-
|
|
12
|
-
shouldWriteAgentsMd?: boolean;
|
|
13
|
-
shouldWriteClaudeMd?: boolean;
|
|
14
|
-
shouldWriteSkills?: boolean;
|
|
10
|
+
export declare function installAiFiles({ projectDir, convexDir, aiFilesConfig, }: AiFilesPaths & {
|
|
11
|
+
aiFilesConfig?: AiFilesProjectConfig | undefined;
|
|
15
12
|
}): Promise<void>;
|
|
13
|
+
export declare function isAiFilesDisabled(aiFilesConfig: AiFilesProjectConfig | undefined): boolean;
|
|
16
14
|
/**
|
|
17
15
|
* Check whether the Convex AI files are out of date and log a nag message
|
|
18
16
|
* if so.
|
|
19
17
|
*/
|
|
20
|
-
export declare function
|
|
18
|
+
export declare function checkAiFilesStalenessAndLog(opts: {
|
|
21
19
|
canonicalGuidelinesHash: string | null;
|
|
22
20
|
canonicalAgentSkillsSha: string | null;
|
|
21
|
+
aiFilesConfig?: AiFilesProjectConfig | undefined;
|
|
23
22
|
} & AiFilesPaths): Promise<void>;
|
|
24
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Installs AI files and returns the aiFiles config to write.
|
|
25
|
+
*/
|
|
26
|
+
export declare function enableAiFiles({ projectDir, convexDir, aiFilesConfig, }: AiFilesPaths & {
|
|
27
|
+
aiFilesConfig?: AiFilesProjectConfig | undefined;
|
|
28
|
+
}): Promise<AiFilesProjectConfig>;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the aiFiles config to write when disabling AI files.
|
|
31
|
+
*/
|
|
32
|
+
export declare function disableAiFiles(aiFilesConfig?: AiFilesProjectConfig | undefined): AiFilesProjectConfig;
|
|
25
33
|
/**
|
|
26
34
|
* Remove all Convex AI files from the project.
|
|
27
35
|
* Called by `npx convex ai-files remove`.
|
|
28
36
|
*/
|
|
29
37
|
export declare function removeAiFiles({ projectDir, convexDir, }: AiFilesPaths): Promise<void>;
|
|
30
|
-
|
|
31
|
-
* Called by `npx convex ai-files disable`.
|
|
32
|
-
*
|
|
33
|
-
* Writes a suppression flag into `convex.json` so `npx convex dev` stops
|
|
34
|
-
* showing AI files install/staleness messages. Files are left in place.
|
|
35
|
-
*/
|
|
36
|
-
export declare function safelyAttemptToDisableAiFiles(projectDir: string): Promise<void>;
|
|
37
|
-
export declare function maybeSetupAiFiles({ ctx, convexDir, projectDir, }: {
|
|
38
|
+
export declare function attemptSetupAiFiles({ ctx, convexDir, projectDir, aiFilesConfig, }: {
|
|
38
39
|
ctx: Context;
|
|
40
|
+
aiFilesConfig?: AiFilesProjectConfig | undefined;
|
|
39
41
|
} & AiFilesPaths): Promise<void>;
|
|
40
42
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAMtD,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAMtD,OAAO,EAAE,KAAK,YAAY,EAAqB,MAAM,YAAY,CAAC;AAWlE,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AA0BzD;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,EACnC,UAAU,EACV,SAAS,EACT,aAAa,GACd,EAAE,YAAY,GAAG;IAChB,aAAa,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAClD,GAAG,OAAO,CAAC,IAAI,CAAC,CAUhB;AAcD,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,oBAAoB,GAAG,SAAS,GAC9C,OAAO,CAIT;AA+CD;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,IAAI,EAAE;IACJ,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,uBAAuB,EAAE,MAAM,GAAG,IAAI,CAAC;IACvC,aAAa,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAClD,GAAG,YAAY,GACf,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED;;GAEG;AACH,wBAAsB,aAAa,CAAC,EAClC,UAAU,EACV,SAAS,EACT,aAAa,GACd,EAAE,YAAY,GAAG;IAChB,aAAa,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAClD,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAKhC;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC5B,aAAa,CAAC,EAAE,oBAAoB,GAAG,SAAS,GAC/C,oBAAoB,CAItB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,EAClC,UAAU,EACV,SAAS,GACV,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA0B9B;AAoCD,wBAAsB,mBAAmB,CAAC,EACxC,GAAG,EACH,SAAS,EACT,UAAU,EACV,aAAa,GACd,EAAE;IACD,GAAG,EAAE,OAAO,CAAC;IACb,aAAa,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAClD,GAAG,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAsB/B"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type AiFilesState } from "./state.js";
|
|
2
|
+
import { type AiFilesProjectConfig } from "../config.js";
|
|
2
3
|
/**
|
|
3
|
-
* Install Convex agent skills and record the SHA and names into the
|
|
4
|
+
* Install Convex agent skills and record the SHA and names into the state.
|
|
4
5
|
* Handles the kill-switch check and all logging internally.
|
|
5
6
|
*/
|
|
6
|
-
export declare function installSkills({ projectDir,
|
|
7
|
+
export declare function installSkills({ projectDir, state, aiFilesConfig, }: {
|
|
7
8
|
projectDir: string;
|
|
8
|
-
|
|
9
|
+
state: AiFilesState;
|
|
10
|
+
aiFilesConfig?: AiFilesProjectConfig | undefined;
|
|
9
11
|
}): Promise<void>;
|
|
10
12
|
/**
|
|
11
13
|
* Remove Convex-managed agent skills and clean up the lock file if empty.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/skills.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/skills.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG/C,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAkIzD;;;GAGG;AACH,wBAAsB,aAAa,CAAC,EAClC,UAAU,EACV,KAAK,EACL,aAAa,GACd,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;IACpB,aAAa,CAAC,EAAE,oBAAoB,GAAG,SAAS,CAAC;CAClD,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBhB;AAED;;;GAGG;AACH,wBAAsB,qBAAqB,CAAC,EAC1C,UAAU,EACV,UAAU,GACX,EAAE;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB,GAAG,OAAO,CAAC,OAAO,CAAC,CAwBnB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const aiFilesStateSchema: z.ZodObject<{
|
|
3
|
+
guidelinesHash: z.ZodNullable<z.ZodString>;
|
|
4
|
+
agentsMdSectionHash: z.ZodNullable<z.ZodString>;
|
|
5
|
+
claudeMdHash: z.ZodNullable<z.ZodString>;
|
|
6
|
+
agentSkillsSha: z.ZodNullable<z.ZodString>;
|
|
7
|
+
installedSkillNames: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
guidelinesHash: string | null;
|
|
10
|
+
agentsMdSectionHash: string | null;
|
|
11
|
+
claudeMdHash: string | null;
|
|
12
|
+
agentSkillsSha: string | null;
|
|
13
|
+
installedSkillNames: string[];
|
|
14
|
+
}, {
|
|
15
|
+
guidelinesHash: string | null;
|
|
16
|
+
agentsMdSectionHash: string | null;
|
|
17
|
+
claudeMdHash: string | null;
|
|
18
|
+
agentSkillsSha: string | null;
|
|
19
|
+
installedSkillNames?: string[] | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export type AiFilesState = z.infer<typeof aiFilesStateSchema>;
|
|
22
|
+
export type AttemptReadAiStateResult = {
|
|
23
|
+
kind: "no-file";
|
|
24
|
+
} | {
|
|
25
|
+
kind: "ok";
|
|
26
|
+
state: AiFilesState;
|
|
27
|
+
} | {
|
|
28
|
+
kind: "parse-error";
|
|
29
|
+
error: unknown;
|
|
30
|
+
};
|
|
31
|
+
export declare function attemptReadAiState(convexDir: string): Promise<AttemptReadAiStateResult>;
|
|
32
|
+
export declare function readAiStateOrDefault(convexDir: string): Promise<AiFilesState>;
|
|
33
|
+
export declare function hasAiState(convexDir: string): Promise<boolean>;
|
|
34
|
+
export declare function writeAiState({ state, convexDir, }: {
|
|
35
|
+
state: AiFilesState;
|
|
36
|
+
convexDir: string;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/state.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;EAU7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAU9D,MAAM,MAAM,wBAAwB,GAChC;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,YAAY,CAAA;CAAE,GACnC;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5C,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,wBAAwB,CAAC,CAYnC;AAED,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,YAAY,CAAC,CAMvB;AAED,wBAAsB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAGpE;AAED,wBAAsB,YAAY,CAAC,EACjC,KAAK,EACL,SAAS,GACV,EAAE;IACD,KAAK,EAAE,YAAY,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQhB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.test.d.ts","sourceRoot":"","sources":["../../../../../src/cli/lib/aiFiles/state.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { type AiFilesPaths } from "./paths.js";
|
|
2
|
-
|
|
2
|
+
import { type AiFilesProjectConfig } from "../config.js";
|
|
3
|
+
export declare function statusAiFiles({ projectDir, convexDir, aiFilesConfig, }: AiFilesPaths & {
|
|
4
|
+
aiFilesConfig?: AiFilesProjectConfig | undefined;
|
|
5
|
+
}): Promise<void>;
|
|
3
6
|
//# sourceMappingURL=status.d.ts.map
|