@regle/mcp-server 1.27.0-beta.2 → 1.27.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/dist/regle-mcp-server.js +3 -3
- package/package.json +4 -1
package/dist/regle-mcp-server.js
CHANGED
|
@@ -250,7 +250,7 @@ const rawData = {
|
|
|
250
250
|
"title": "Agent Skills",
|
|
251
251
|
"category": "integrations",
|
|
252
252
|
"path": "integrations/agent-skills.md",
|
|
253
|
-
"content": "# Agent Skills\n\n[Agent Skills](https://skills.sh/) are reusable capabilities for AI coding agents. They provide procedural knowledge that helps agents write Regle validation code more effectively.\n\nRegle provides
|
|
253
|
+
"content": "# Agent Skills\n\n[Agent Skills](https://skills.sh/) are reusable capabilities for AI coding agents. They provide procedural knowledge that helps agents write Regle validation code more effectively.\n\nRegle provides six skills covering core usage, validation rules, advanced patterns, schema integration, TypeScript, and migrating from Vuelidate.\n\n## Install\n\n```bash\nnpx skills add victorgarciaesgi/regle\n```\n\nThis installs all Regle skills and configures them for your AI agent.\n\n## Available skills\n\n### `regle`\n\nCore Regle usage:\n\n- `useRegle` composable (state, rules, `r$` object)\n- Validation properties (`$invalid`, `$dirty`, `$error`, `$errors`, `$pending`)\n- Displaying errors (`getErrors`, `flatErrors`)\n- Modifiers (`autoDirty`, `lazy`, `silent`, `rewardEarly`, `validationGroups`)\n\n### `regle-rules`\n\nValidation rules:\n\n- Built-in validation rules (`required`, `email`, `minLength`, etc.)\n- Custom rules (`createRule`, inline rules, async rules)\n- Rule wrappers (`withMessage`, `withParams`, `withAsync`, `withTooltip`)\n- Rule operators (`and`, `or`, `xor`, `not`, `pipe`, `applyIf`, `assignIf`)\n\n### `regle-advanced`\n\nAdvanced patterns:\n\n- Collections (`$each`, array validation)\n- Async validation (`$pending`, debouncing)\n- Server errors (`externalErrors`, dot-path errors)\n- Reset forms (`$reset` options)\n- Global configuration (`defineRegleConfig`, i18n)\n- Variants (`createVariant`, `narrowVariant`, discriminated unions)\n- Scoped validation (`useScopedRegle`, `useCollectScope`)\n- Merge multiple Regles (`mergeRegles`)\n- Object self validation (`$self`)\n\n### `regle-schemas`\n\nSchema integration:\n\n- Schema libraries (`useRegleSchema` with Zod, Valibot, ArkType)\n- Standard Schema spec (`useRules`, `refineRules`, `InferInput`)\n\n### `regle-typescript`\n\nTypeScript integration:\n\n- Type-safe output (`$validate` return type, `InferSafeOutput`)\n- Typing rules (`inferRules`, `RegleComputedRules`)\n- Typing component props (`InferRegleRoot`, `RegleFieldStatus`)\n\n### `regle-migrate-vuelidate`\n\nStep-by-step migration guide to port Vuelidate forms (`useVuelidate`) to Regle (`useRegle` / `useScopedRegle`), covering imports, renamed helpers and properties, rules, validation properties, scoped validation, and parent-child form propagation. See [Migrate from Vuelidate](/introduction/migrate-from-vuelidate)."
|
|
254
254
|
},
|
|
255
255
|
{
|
|
256
256
|
"id": "integrations-mcp-server",
|
|
@@ -306,7 +306,7 @@ const rawData = {
|
|
|
306
306
|
"title": "Migrate from Vuelidate",
|
|
307
307
|
"category": "introduction",
|
|
308
308
|
"path": "introduction/migrate-from-vuelidate.md",
|
|
309
|
-
"content": "# Migrate from Vuelidate\n\nMigrating from Vuelidate is really simple. Regle API is similar to Vuelidate's one on purpose, so the mental model stays the same.\n\nRegle type safety will ensure you make no mistakes while making the migration.\n\n## Imports\n\n```ts\nimport { useVuelidate } from '@vuelidate/core'; // [!code --]\nimport { required } from '@vuelidate/validators'; // [!code --]\nimport { useRegle } from '@regle/core'; // [!code ++]\nimport { required } from '@regle/rules'; // [!code ++]\n```\n\n```ts\nconst v$ = useVuelidate(rules, state, options); // [!code --]\nconst { r$ } = useRegle(state, rules, options); // [!code ++]\n```\n\n## Helpers\n\n```ts\nimport { helpers } from '@vuelidate/validators'; // [!code --]\nimport { withMessage, withParams, withAsync, isEmpty, ... } from '@regle/rules'; // [!code ++]\n```\n\nHelpers which have been renamed:\n\n- `req` -> `isFilled`\n- `len` -> `getSize`\n- `regex` -> `matchRegex`\n- `forEach` -> Deleted, you can use `$each` directly.\n- `unwrap` -> use `toValue` from [Vue](https://vuejs.org/api/reactivity-utilities#tovalue)\n - Parameters are automatically unwrapped when using `createRule`\n\n## Displaying errors\n\nVuelidate:\n```vue\n<template> \n <p \n v-for=\"error of v$.name.$errors\"\n :key=\"error.$uid\" \n >\n {{error.$message}}\n </p>\n</template>\n```\n\nRegle: \n```vue\n<template>\n <p\n v-for=\"(error, index) of r$.$errors.name\"\n :key=\"index\"\n >\n {{ error }} \n </p>\n</template>\n```\n\n### `withMessage`\n\nOrder of parameters are swapped\n\n```ts\nconst rule = helpers.withMessage('This field cannot be empty', required) // [!code --]\nconst rule = withMessage(required, 'This field cannot be empty') // [!code ++]\n```\n\n### `withParams`\n\nYou can create rules with parameters with [createRule](/core-concepts/rules/reusable-rules#createrule) helper\n\n```ts\nconst contains = (param) => // [!code --]\n helpers.withParams( // [!code --]\n { type: 'contains', value: param }, // [!code --]\n (value) => !helpers.req(value) || value.includes(param) // [!code --]\n ) // [!code --]\n\nconst contains = createRule({ // [!code ++]\n validator(value: Maybe<string>, param: Maybe<string>) { // [!code ++]\n return isEmpty(value) || value.includes(param); // [!code ++]\n }, // [!code ++]\n message: ({$params: [param]}) => `Value must contain ${param}`, // [!code ++]\n}) // [!code ++]\n```\n\n## Properties\n\nSome properties have been renamed\n\n- `$model` -> `$value`\n- `$response` -> `$metadata` [Using metadata from rules](/advanced-usage/rule-metadata#using-metadata-from-rules)\n- `$externalResults` -> `$externalErrors`\n\n### Accessing nested fields\n\n```ts\nv$.nested.child.$error // [!code --]\nr$.nested.child.$error // [!code ++]\n```\n\n## Collections\n\nSee [docs for validating arrays](/common-usage/collections)\n\n```ts\nconst v$ = useVuelidate({ // [!code --]\n collection: { // [!code --]\n $each: helpers.forEach({ // [!code --]\n name: { // [!code --]\n required // [!code --]\n } // [!code --]\n }) // [!code --]\n } // [!code --]\n}, {collection: [{name: ''}]}) // [!code --]\nconst { r$ } = useRegle({ collection: [{name: ''}]}, { // [!code ++]\n collection: {// [!code ++]\n $each: {// [!code ++]\n name: {// [!code ++]\n required// [!code ++]\n }// [!code ++]\n }// [!code ++]\n }// [!code ++]\n})// [!code ++]\n```\n\n## Methods\n\nSee [docs for type safe output](/typescript/type-safe-output)\n\n```ts\nconst result = await v$.$validate(); // [!code --]\nconst { valid, data } = await r$.$validate(); // [!code ++]\n```\n\n## Custom messages\n\nIf you used to declare this kind of helper methods with Vuelidate:\n\n```ts\nimport {helpers, required, numeric, minLength} from '@vuelidate/validators';\n\nexport const requiredValidator = helpers.withMessage(\n 'This field is required.',\n required\n);\nexport const numericValidator = helpers.withMessage(\n 'Please enter a valid value.',\n numeric\n);\n\nexport const minLengthValidator = (value) =>\n helpers.withMessage(\n ({ $model, $params }) =>\n `Please enter a value greater than or equal to ${$params.max}.`,\n minLength(value)\n );\n```\n\nYou can remove it and configure it with [global config](/advanced-usage/global-config#replace-built-in-rules-messages).\n\n:::tip\nIf you use Nuxt <span data-title=\"nuxt\"></span>, check the [Nuxt module documentation](/integrations/nuxt) for even easier error message sharing.\n:::\n\n```ts\nimport { defineRegleConfig } from '@regle/core';\nimport { withMessage, minLength, required, numeric } from '@regle/rules';\n\nconst { useRegle: useCustomRegle } = defineRegleConfig({\n rules: () => ({\n required: withMessage(required, 'This field is required.'),\n numeric: withMessage(numeric, 'Please enter a valid value.'),\n minLength: withMessage(minLength, ({ $value, $params: [max] }) => {\n return `Minimum length is ${max}. Current length: ${$value?.length}`;\n })\n })\n})\n\nconst { r$ } = useCustomRegle({ name: '' }, {\n name: {\n required,\n numeric,\n minLength: minLength(6)\n }\n})\n```\n\n## Nested component validation\n\n__**Nested component**__ validation is replaced by __**Scoped validation**__.\n\nSee [docs for scoped validation](/advanced-usage/scoped-validation) for more details\n\n```ts\n// [scoped-config.ts]\nimport { useScopedRegle, useCollectScope, useRegle } from '@regle/core'; // [!code ++]\n\n// Parent.vue\nconst v$ = useVuelidate(); // [!code --]\nconst v$ = useVuelidate({}, {}, {$scope: 'foo'}); // [!code --]\n\nconst { r$ } = useCollectScope(); // [!code ++]\nconst { r$ } = useCollectScope('foo'); // [!code ++]\n\n// Child.vue\n\nconst v$ = useVuelidate(validations, state); // [!code --]\nconst v$ = useVuelidate(validations, state, { $scope: false }); // [!code --]\nconst v$ = useVuelidate(validations, state, { $scope: 'foo' }); // [!code --]\nconst v$ = useVuelidate(validations, state, { $stopPropagation: true }); // [!code --]\n\nconst { r$ } = useScopedRegle(state, validations); // [!code ++]\nconst { r$ } = useRegle(state, validations); // [!code ++]\nconst { r$ } = useScopedRegle(state, validations, {namespace: 'foo'}); // [!code ++]\nconst { r$ } = useScopedRegle(state, validations); // [!code ++]\n```\n\n## Validation groups\n\n```ts\nconst rules = { // [!code --]\n number: { isEven },// [!code --]\n nested: {// [!code --]\n word: { required: v => !!v }// [!code --]\n },// [!code --]\n $validationGroups: {// [!code --]\n firstGroup: ['number', 'nested.word']// [!code --]\n }// [!code --]\n}// [!code --]\nconst v$ = useVuelidate(rules, ...);// [!code --]\n\nconst { r$ } = useRegle(..., { // [!code ++]\n number: {isEven},// [!code ++]\n nested: {// [!code ++]\n word: { required: v => !!v }// [!code ++]\n }// [!code ++]\n}, {// [!code ++]\n validationGroups: (fields) => ({// [!code ++]\n firstGroup: [fields.number, fields.nested.word]// [!code ++]\n })// [!code ++]\n})// [!code ++]\nr$.$groups.firstGroup// [!code ++]\n```"
|
|
309
|
+
"content": "# Migrate from Vuelidate\n\nMigrating from Vuelidate is really simple. Regle API is similar to Vuelidate's one on purpose, so the mental model stays the same.\n\nRegle type safety will ensure you make no mistakes while making the migration.\n\n:::tip\nThere is a dedicated **`regle-migrate-vuelidate`** [Agent Skill](/integrations/agent-skills) that walks an AI coding agent through this migration step by step. Install it with `npx skills add victorgarciaesgi/regle`.\n:::\n\n## Imports\n\n```ts\nimport { useVuelidate } from '@vuelidate/core'; // [!code --]\nimport { required } from '@vuelidate/validators'; // [!code --]\nimport { useRegle } from '@regle/core'; // [!code ++]\nimport { required } from '@regle/rules'; // [!code ++]\n```\n\n```ts\nconst v$ = useVuelidate(rules, state, options); // [!code --]\nconst { r$ } = useRegle(state, rules, options); // [!code ++]\n```\n\n## Helpers\n\n```ts\nimport { helpers } from '@vuelidate/validators'; // [!code --]\nimport { withMessage, withParams, withAsync, isEmpty, ... } from '@regle/rules'; // [!code ++]\n```\n\nHelpers which have been renamed:\n\n- `req` -> `isFilled`\n- `len` -> `getSize`\n- `regex` -> `matchRegex`\n- `forEach` -> Deleted, you can use `$each` directly.\n- `unwrap` -> use `toValue` from [Vue](https://vuejs.org/api/reactivity-utilities#tovalue)\n - Parameters are automatically unwrapped when using `createRule`\n\n## Displaying errors\n\nVuelidate:\n```vue\n<template> \n <p \n v-for=\"error of v$.name.$errors\"\n :key=\"error.$uid\" \n >\n {{error.$message}}\n </p>\n</template>\n```\n\nRegle: \n```vue\n<template>\n <p\n v-for=\"(error, index) of r$.$errors.name\"\n :key=\"index\"\n >\n {{ error }} \n </p>\n</template>\n```\n\n### `withMessage`\n\nOrder of parameters are swapped\n\n```ts\nconst rule = helpers.withMessage('This field cannot be empty', required) // [!code --]\nconst rule = withMessage(required, 'This field cannot be empty') // [!code ++]\n```\n\n### `withParams`\n\nYou can create rules with parameters with [createRule](/core-concepts/rules/reusable-rules#createrule) helper\n\n```ts\nconst contains = (param) => // [!code --]\n helpers.withParams( // [!code --]\n { type: 'contains', value: param }, // [!code --]\n (value) => !helpers.req(value) || value.includes(param) // [!code --]\n ) // [!code --]\n\nconst contains = createRule({ // [!code ++]\n validator(value: Maybe<string>, param: Maybe<string>) { // [!code ++]\n return isEmpty(value) || value.includes(param); // [!code ++]\n }, // [!code ++]\n message: ({$params: [param]}) => `Value must contain ${param}`, // [!code ++]\n}) // [!code ++]\n```\n\n## Properties\n\nSome properties have been renamed\n\n- `$model` -> `$value`\n- `$response` -> `$metadata` [Using metadata from rules](/advanced-usage/rule-metadata#using-metadata-from-rules)\n- `$externalResults` -> `$externalErrors`\n\n### Accessing nested fields\n\n```ts\nv$.nested.child.$error // [!code --]\nr$.nested.child.$error // [!code ++]\n```\n\n## Collections\n\nSee [docs for validating arrays](/common-usage/collections)\n\n```ts\nconst v$ = useVuelidate({ // [!code --]\n collection: { // [!code --]\n $each: helpers.forEach({ // [!code --]\n name: { // [!code --]\n required // [!code --]\n } // [!code --]\n }) // [!code --]\n } // [!code --]\n}, {collection: [{name: ''}]}) // [!code --]\nconst { r$ } = useRegle({ collection: [{name: ''}]}, { // [!code ++]\n collection: {// [!code ++]\n $each: {// [!code ++]\n name: {// [!code ++]\n required// [!code ++]\n }// [!code ++]\n }// [!code ++]\n }// [!code ++]\n})// [!code ++]\n```\n\n## Methods\n\nSee [docs for type safe output](/typescript/type-safe-output)\n\n```ts\nconst result = await v$.$validate(); // [!code --]\nconst { valid, data } = await r$.$validate(); // [!code ++]\n```\n\n## Custom messages\n\nIf you used to declare this kind of helper methods with Vuelidate:\n\n```ts\nimport {helpers, required, numeric, minLength} from '@vuelidate/validators';\n\nexport const requiredValidator = helpers.withMessage(\n 'This field is required.',\n required\n);\nexport const numericValidator = helpers.withMessage(\n 'Please enter a valid value.',\n numeric\n);\n\nexport const minLengthValidator = (value) =>\n helpers.withMessage(\n ({ $model, $params }) =>\n `Please enter a value greater than or equal to ${$params.max}.`,\n minLength(value)\n );\n```\n\nYou can remove it and configure it with [global config](/advanced-usage/global-config#replace-built-in-rules-messages).\n\n:::tip\nIf you use Nuxt <span data-title=\"nuxt\"></span>, check the [Nuxt module documentation](/integrations/nuxt) for even easier error message sharing.\n:::\n\n```ts\nimport { defineRegleConfig } from '@regle/core';\nimport { withMessage, minLength, required, numeric } from '@regle/rules';\n\nconst { useRegle: useCustomRegle } = defineRegleConfig({\n rules: () => ({\n required: withMessage(required, 'This field is required.'),\n numeric: withMessage(numeric, 'Please enter a valid value.'),\n minLength: withMessage(minLength, ({ $value, $params: [max] }) => {\n return `Minimum length is ${max}. Current length: ${$value?.length}`;\n })\n })\n})\n\nconst { r$ } = useCustomRegle({ name: '' }, {\n name: {\n required,\n numeric,\n minLength: minLength(6)\n }\n})\n```\n\n## Nested component validation\n\n__**Nested component**__ validation is replaced by __**Scoped validation**__.\n\nSee [docs for scoped validation](/advanced-usage/scoped-validation) for more details\n\n```ts\n// [scoped-config.ts]\nimport { useScopedRegle, useCollectScope, useRegle } from '@regle/core'; // [!code ++]\n\n// Parent.vue\nconst v$ = useVuelidate(); // [!code --]\nconst v$ = useVuelidate({}, {}, {$scope: 'foo'}); // [!code --]\n\nconst { r$ } = useCollectScope(); // [!code ++]\nconst { r$ } = useCollectScope('foo'); // [!code ++]\n\n// Child.vue\n\nconst v$ = useVuelidate(validations, state); // [!code --]\nconst v$ = useVuelidate(validations, state, { $scope: false }); // [!code --]\nconst v$ = useVuelidate(validations, state, { $scope: 'foo' }); // [!code --]\nconst v$ = useVuelidate(validations, state, { $stopPropagation: true }); // [!code --]\n\nconst { r$ } = useScopedRegle(state, validations); // [!code ++]\nconst { r$ } = useRegle(state, validations); // [!code ++]\nconst { r$ } = useScopedRegle(state, validations, {namespace: 'foo'}); // [!code ++]\nconst { r$ } = useScopedRegle(state, validations); // [!code ++]\n```\n\n## Validation groups\n\n```ts\nconst rules = { // [!code --]\n number: { isEven },// [!code --]\n nested: {// [!code --]\n word: { required: v => !!v }// [!code --]\n },// [!code --]\n $validationGroups: {// [!code --]\n firstGroup: ['number', 'nested.word']// [!code --]\n }// [!code --]\n}// [!code --]\nconst v$ = useVuelidate(rules, ...);// [!code --]\n\nconst { r$ } = useRegle(..., { // [!code ++]\n number: {isEven},// [!code ++]\n nested: {// [!code ++]\n word: { required: v => !!v }// [!code ++]\n }// [!code ++]\n}, {// [!code ++]\n validationGroups: (fields) => ({// [!code ++]\n firstGroup: [fields.number, fields.nested.word]// [!code ++]\n })// [!code ++]\n})// [!code ++]\nr$.$groups.firstGroup// [!code ++]\n```"
|
|
310
310
|
},
|
|
311
311
|
{
|
|
312
312
|
"id": "troubleshooting-reactivity",
|
|
@@ -2002,7 +2002,7 @@ function searchApi(query) {
|
|
|
2002
2002
|
});
|
|
2003
2003
|
return results;
|
|
2004
2004
|
}
|
|
2005
|
-
var version = "1.27.0
|
|
2005
|
+
var version = "1.27.0";
|
|
2006
2006
|
let posthogClient = null;
|
|
2007
2007
|
posthogClient = new PostHog("phc_kqgJoylCpKkGkkRGxb4MyN2mViehoQcUFEGwVkk4l8E", {
|
|
2008
2008
|
host: "https://eu.i.posthog.com",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@regle/mcp-server",
|
|
3
|
-
"version": "1.27.0
|
|
3
|
+
"version": "1.27.0",
|
|
4
4
|
"description": "MCP Server for Regle",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -21,6 +21,9 @@
|
|
|
21
21
|
"type": "git",
|
|
22
22
|
"url": "git+https://github.com/victorgarciaesgi/regle.git"
|
|
23
23
|
},
|
|
24
|
+
"bugs": {
|
|
25
|
+
"url": "https://github.com/victorgarciaesgi/regle/issues"
|
|
26
|
+
},
|
|
24
27
|
"bin": {
|
|
25
28
|
"regle-mcp-server": "./dist/regle-mcp-server.js"
|
|
26
29
|
},
|