@regle/mcp-server 1.28.0-beta.1 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/regle-mcp-server.js +2 -2
- package/package.json +3 -1
package/dist/regle-mcp-server.js
CHANGED
|
@@ -131,7 +131,7 @@ const rawData = {
|
|
|
131
131
|
"title": "Modifiers",
|
|
132
132
|
"category": "core-concepts",
|
|
133
133
|
"path": "core-concepts/modifiers.md",
|
|
134
|
-
"content": "# Modifiers\n\nModifiers allow you to control the behavior and settings of validation rules in your application. They can be applied globally to all fields or customized per field.\n\n## Deep modifiers\n\nDeep modifiers are specified as the third argument of the `useRegle` composable. They apply recursively to all fields within your state.\n\n```ts\nconst { r$ } = useRegle({}, {}, {\n /* modifiers */\n})\n```\n\n### `autoDirty`\n\n__Type__: `boolean`\n\n__Default__: `true`\n\nAutomatically set the dirty state to `true` when the value changes.\n\n### `immediateDirty`\n\n__Type__: `boolean | 'eager' | 'non-empty' | 'lazy-non-empty'`\n\n__Default__: `false`\n\nSet the dirty state to `true` when the form is initialized.\n\n- `true` or `'eager'`: touch the whole form on mount.\n- `'non-empty'`: touch the whole form on mount only if
|
|
134
|
+
"content": "# Modifiers\n\nModifiers allow you to control the behavior and settings of validation rules in your application. They can be applied globally to all fields or customized per field.\n\n## Deep modifiers\n\nDeep modifiers are specified as the third argument of the `useRegle` composable. They apply recursively to all fields within your state.\n\n```ts\nconst { r$ } = useRegle({}, {}, {\n /* modifiers */\n})\n```\n\n### `autoDirty`\n\n__Type__: `boolean`\n\n__Default__: `true`\n\nAutomatically set the dirty state to `true` when the value changes.\n\n### `immediateDirty`\n\n__Type__: `boolean | 'eager' | 'non-empty' | 'lazy-non-empty'`\n\n__Default__: `false`\n\nSet the dirty state to `true` when the form is initialized.\n\n- `true` or `'eager'`: touch the whole form on mount.\n- `'non-empty'`: touch the whole form on mount only if an **active** field (a field with rules) has a non-empty initial value. Inactive fields — fields without rules — are ignored, so a prefilled field with no rules will not trigger a touch.\n- `'lazy-non-empty'`: touch only the fields that are non-empty on mount.\n\n### `disabled`\n\n__Type__: `boolean`\n\n__Default__: `false`\n\nTemporarily pauses Regle reactivity and validation computation.\n\nWhen `disabled` is `true`, state changes still happen, but validation status does not update until you enable it again.\n\n```ts\nimport { ref } from 'vue';\nimport { useRegle } from '@regle/core';\nimport { required } from '@regle/rules';\n\nconst disabled = ref(false);\n\nconst { r$ } = useRegle(\n { name: '' },\n { name: { required } },\n { disabled }\n);\n\ndisabled.value = true;\nr$.$value.name = 'John'; // value updates, validation is paused\n\ndisabled.value = false; // validation reactivity resumes\n```\n\n### `silent`\n\n__Type__: `boolean`\n\n__Default__: `false`\n\nRegle Automatically tracks changes in the state for all nested rules. If set to `true`, you must manually call `$touch` or `$validate` to display errors.\n\n### `lazy`\n\n__Type__: `boolean`\n\n__Default__: `false`\n\nUsage:\n\nWhen set to false, tells the rules to be called on init, otherwise they are lazy and only called when the field is dirty.\n\n### `debounce`\n\n__Type__: `number` (ms)\n\n__Default__: `200` (for fields with async rules)\n\nNumber of milliseconds every async field should wait before executing its rules. It applies to every async field in your form.\n\nThe per-field [`$debounce`](#debounce-1) modifier always takes priority over this global value.\n\nSet to `0` to disable the default debounce on async rules.\n\n### `externalErrors`\n\n__Type__: `RegleExternalErrorTree<State>` \n\nPass an object, matching your error state, that holds external validation errors. These can be from a backend validations or something else.\n\nCheck the [External errors](/common-usage/external-errors) section for more details.\n\n### `externalIssues`\n\n__Type__: `RegleExternalIssueTree<State>`\n\nPass an object, matching your state, that holds structured external validation issues. Each issue keeps its metadata in `$issues`, and its `$message` is also exposed through `$errors`.\n\n`externalIssues` and `externalErrors` are mutually exclusive. Setting one clears the other.\n\nCheck the [External errors and issues](/common-usage/external-errors) section for more details.\n\n### `rewardEarly`\n\n__Type__: `boolean`\n\n__Default__: `false`\n\n__Side effect__: disable `$autoDirty` when `true`.\n\nEnables the `reward-early-punish-late` mode of Regle. This mode will not set fields as invalid once they are valid, unless manually triggered by `$validate` method.\n\nThis has no effect when `autoDirty` is set to `true` (the default). Set `autoDirty: false` for `rewardEarly` to take effect.\n\n### `clearExternalErrorsOnChange`\n\n__Type__: `boolean`\n\n__Default__: `true`\n\nThis mode is similar to `rewardEarly`, but only applies to external errors.\nSetting it to `false` will keep the server errors and issues until `$clearExternalErrors` or `$clearExternalIssues` is called.\n\n### `clearExternalErrorsOnValidate`\n\n__Type__: `boolean`\n\n__Default__: `false`\n\nThis mode is similar to `clearExternalErrorsOnChange`, but for the `$validate` and `$validateSync` methods.\nSetting it to `false` will keep the server errors and issues until `$clearExternalErrors` or `$clearExternalIssues` is called manually, or `externalErrors` / `externalIssues` is set again.\n\n### `validationGroups`\n\n__Type__: `(fields) => Record<string, (RegleFieldStatus |RegleCollectionStatus)[]>`\n\nValidation groups let you merge field properties under one, to better handle validation status.\n\nYou will have access to your declared groups in the `r$.$groups` object.\n\n```ts twoslash\n\nimport { ref } from 'vue';\n// ---cut---\nimport { useRegle } from '@regle/core';\nimport { required } from '@regle/rules';\n\nconst { r$ } = useRegle({ email: '', user: { firstName: '' } }, {\n email: { required },\n user: {\n firstName: { required },\n }\n}, {\n validationGroups: (fields) => ({\n group1: [fields.email, fields.user.firstName]\n })\n})\n\nr$.$groups.group1.\n\n```\n<br><br><br><br>\n\n## Per-field modifiers\n\nPer-field modifiers allow to customize more precisely which behavior you want for each field.\n\n```ts twoslash\n\nimport { useRegle } from '@regle/core';\n// ---cut---\nconst { r$ } = useRegle({ name: '' }, {\n name: { $ }\n\n})\n```\n\n<br><br>\n\n`$autoDirty` `$lazy`, `$silent`, `$immediateDirty` and `$rewardEarly` work the same as the deep modifiers.\n\n### `$debounce`\nType: `number` (ms)\n\nThis let you declare the number of milliseconds the rule needs to wait before executing. Useful for async or heavy computations.\n\nIt takes priority over the global [`debounce`](#debounce) deep modifier.\n\n:::tip\nAll async rules have a default debounce of `200ms`, you can disable or modify this setting with `$debounce`\n:::\n\n### `$isEdited`\nType: `(currentValue: MaybeInput<TValue>, initialValue: MaybeInput<TValue>, defaultHandlerFn: (currentValue: unknown, initialValue: unknown) => boolean) => boolean`\n\nOverride the default `$edited` property handler. Useful to handle custom comparisons for complex object types.\n\n:::warning\nIt's highly recommended to use this modifier with the [`markStatic`](/advanced-usage/immutable-constructors) helper to handle immutable constructors.\n:::\n\n```ts\nimport { markStatic, useRegle } from '@regle/core';\nimport { Decimal } from 'decimal.js';\nimport { required } from '@regle/rules';\n\nconst { r$ } = useRegle({ decimal: markStatic(new Decimal(1)) }, {\n decimal: {\n required,\n $isEdited(currentValue, initialValue, defaultHandlerFn) {\n if (currentValue != null && initialValue != null) {\n return currentValue.toNearest(0.01).toString() !== initialValue.toNearest(0.01).toString();\n }\n // fallback to the default handler\n return defaultHandlerFn(currentValue, initialValue);\n },\n },\n})\n```\n\n## Array specific modifiers\n\nThis modifiers are only impacting Array collections.\n\n```ts\nconst { r$ } = useRegle({ collection: [] }, {\n collection: { /** Deep modifiers */ }\n})\n```\n\n### `$deepCompare`\nType: `boolean`\n\nDefault: `false`\n\nAllow deep compare of array children to compute the `$edited` property.\n\nIt's disabled by default for performance reasons."
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
"id": "core-concepts-rules-built-in-rules",
|
|
@@ -2002,7 +2002,7 @@ function searchApi(query) {
|
|
|
2002
2002
|
});
|
|
2003
2003
|
return results;
|
|
2004
2004
|
}
|
|
2005
|
-
var version = "1.28.
|
|
2005
|
+
var version = "1.28.1";
|
|
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.28.
|
|
3
|
+
"version": "1.28.1",
|
|
4
4
|
"description": "MCP Server for Regle",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -53,9 +53,11 @@
|
|
|
53
53
|
"zod": "4.4.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
+
"@arethetypeswrong/core": "0.18.3",
|
|
56
57
|
"@types/node": "24.13.2",
|
|
57
58
|
"@typescript/native-preview": "7.0.0-dev.20260616.1",
|
|
58
59
|
"dotenv": "17.4.2",
|
|
60
|
+
"publint": "0.3.21",
|
|
59
61
|
"tsdown": "0.22.2",
|
|
60
62
|
"tsx": "4.22.4",
|
|
61
63
|
"typescript": "6.0.3"
|