diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b259f9616e1970f21dc1a9c932145b970966d123 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-firefox-class-in-computed-class-key/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-bugfix-firefox-class-in-computed-class-key + +> Wraps classes defined in computed keys of other classes affected by https://bugzilla.mozilla.org/show_bug.cgi?id=1887677 + +See our website [@babel/plugin-bugfix-firefox-class-in-computed-class-key](https://babeljs.io/docs/babel-plugin-bugfix-firefox-class-in-computed-class-key) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-bugfix-firefox-class-in-computed-class-key +``` + +or using yarn: + +```sh +yarn add @babel/plugin-bugfix-firefox-class-in-computed-class-key --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3766c7f6fa3943eaf528dd91361a359212d04602 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-safari-class-field-initializer-scope/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-bugfix-safari-class-field-initializer-scope + +> Wrap class field initializers with IIFE to workaround https://webkit.org/b/236843 + +See our website [@babel/plugin-bugfix-safari-class-field-initializer-scope](https://babeljs.io/docs/babel-plugin-bugfix-safari-class-field-initializer-scope) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-bugfix-safari-class-field-initializer-scope +``` + +or using yarn: + +```sh +yarn add @babel/plugin-bugfix-safari-class-field-initializer-scope --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5a7986b93c787dbbd9817d067e7b526e5206b325 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression + +> Rename destructuring parameter to workaround https://bugs.webkit.org/show_bug.cgi?id=220517 + +See our website [@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression](https://babeljs.io/docs/babel-plugin-bugfix-safari-id-destructuring-collision-in-function-expression) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression +``` + +or using yarn: + +```sh +yarn add @babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-safari-rest-destructuring-rhs-array/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-safari-rest-destructuring-rhs-array/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e8e938d0b786c0f19471583043a3a1ec41debc32 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-safari-rest-destructuring-rhs-array/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-bugfix-safari-rest-destructuring-rhs-array + +> Workaround a Safari bug where rest destructuring with an array literal on the rhs can yield incorrect results + +See our website [@babel/plugin-bugfix-safari-rest-destructuring-rhs-array](https://babeljs.io/docs/babel-plugin-bugfix-safari-rest-destructuring-rhs-array) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-bugfix-safari-rest-destructuring-rhs-array +``` + +or using yarn: + +```sh +yarn add @babel/plugin-bugfix-safari-rest-destructuring-rhs-array --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e1a8655299eb4fbf26398add49900626be322fb4 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining + +> Transform optional chaining operators to workaround https://crbug.com/v8/11558 + +See our website [@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining](https://babeljs.io/docs/babel-plugin-bugfix-v8-spread-parameters-in-optional-chaining) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining +``` + +or using yarn: + +```sh +yarn add @babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cbd44da2f96fc262cb1dcc19656e296f664039b6 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-bugfix-v8-static-class-fields-redefine-readonly + +> Transform static class fields assignments that are affected by https://crbug.com/v8/12421 + +See our website [@babel/plugin-bugfix-v8-static-class-fields-redefine-readonly](https://babeljs.io/docs/babel-plugin-bugfix-v8-static-class-fields-redefine-readonly) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-bugfix-v8-static-class-fields-redefine-readonly +``` + +or using yarn: + +```sh +yarn add @babel/plugin-bugfix-v8-static-class-fields-redefine-readonly --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-proposal-private-property-in-object/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-proposal-private-property-in-object/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d806aee70a5c47606a956400ef927e70ef53865c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-proposal-private-property-in-object/README.md @@ -0,0 +1,23 @@ +# @babel/plugin-proposal-private-property-in-object + +> ⚠️ This version of the package (`v7.21.0-placeholder-for-preset-env.1`) is not meant to +> be imported. Use any other version of this plugin or, even better, the +> [@babel/plugin-transform-private-property-in-object](https://babeljs.io/docs/en/babel-plugin-transform-private-property-in-object) package. + +> This plugin transforms checks for a private property in an object + +See our website [@babel/plugin-proposal-private-property-in-object](https://babeljs.io/docs/en/babel-plugin-proposal-private-property-in-object) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-proposal-private-property-in-object +``` + +or using yarn: + +```sh +yarn add @babel/plugin-proposal-private-property-in-object --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-syntax-import-assertions/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-syntax-import-assertions/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9729e242e88760ee1b001f3265a9024f20f0bb80 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-syntax-import-assertions/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-syntax-import-assertions + +> Allow parsing of the module assertion attributes in the import statement + +See our website [@babel/plugin-syntax-import-assertions](https://babeljs.io/docs/babel-plugin-syntax-import-assertions) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-syntax-import-assertions +``` + +or using yarn: + +```sh +yarn add @babel/plugin-syntax-import-assertions --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-syntax-import-attributes/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-syntax-import-attributes/README.md new file mode 100644 index 0000000000000000000000000000000000000000..91f56a02f336978f44bd89b0b82e2fc8c2bc80bc --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-syntax-import-attributes/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-syntax-import-attributes + +> Allow parsing of the module attributes in the import statement + +See our website [@babel/plugin-syntax-import-attributes](https://babeljs.io/docs/babel-plugin-syntax-import-attributes) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-syntax-import-attributes +``` + +or using yarn: + +```sh +yarn add @babel/plugin-syntax-import-attributes --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-syntax-unicode-sets-regex/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-syntax-unicode-sets-regex/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6d4bae61db39fdab89c8452a1436d10bd33526da --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-syntax-unicode-sets-regex/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-syntax-unicode-sets-regex + +> Parse regular expressions' unicodeSets (v) flag. + +See our website [@babel/plugin-syntax-unicode-sets-regex](https://babeljs.io/docs/en/babel-plugin-syntax-unicode-sets-regex) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-syntax-unicode-sets-regex +``` + +or using yarn: + +```sh +yarn add @babel/plugin-syntax-unicode-sets-regex --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-arrow-functions/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-arrow-functions/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d2c6be31c775bc8b01407c1e252593844c96269e --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-arrow-functions/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-arrow-functions + +> Compile ES2015 arrow functions to ES5 + +See our website [@babel/plugin-transform-arrow-functions](https://babeljs.io/docs/babel-plugin-transform-arrow-functions) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-arrow-functions +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-arrow-functions --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-async-generator-functions/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-async-generator-functions/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6a460d8a8e05120c5a926635984cb036613fa63e --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-async-generator-functions/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-async-generator-functions + +> Turn async generator functions into ES2015 generators + +See our website [@babel/plugin-transform-async-generator-functions](https://babeljs.io/docs/babel-plugin-transform-async-generator-functions) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-async-generator-functions +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-async-generator-functions --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-async-to-generator/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-async-to-generator/README.md new file mode 100644 index 0000000000000000000000000000000000000000..91f9df3fec59cd22094eed97b0de83cca22dee2a --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-async-to-generator/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-async-to-generator + +> Turn async functions into ES2015 generators + +See our website [@babel/plugin-transform-async-to-generator](https://babeljs.io/docs/babel-plugin-transform-async-to-generator) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-async-to-generator +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-async-to-generator --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-block-scoped-functions/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-block-scoped-functions/README.md new file mode 100644 index 0000000000000000000000000000000000000000..872e26a8c1eb7c7892c650aa8310d9f6813317de --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-block-scoped-functions/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-block-scoped-functions + +> Babel plugin to ensure function declarations at the block level are block scoped + +See our website [@babel/plugin-transform-block-scoped-functions](https://babeljs.io/docs/babel-plugin-transform-block-scoped-functions) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-block-scoped-functions +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-block-scoped-functions --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-block-scoping/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-block-scoping/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5750b906b2525afe236f3684b391b4aa75aa6af2 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-block-scoping/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-block-scoping + +> Compile ES2015 block scoping (const and let) to ES5 + +See our website [@babel/plugin-transform-block-scoping](https://babeljs.io/docs/babel-plugin-transform-block-scoping) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-block-scoping +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-block-scoping --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-class-properties/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-class-properties/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7000ec5b11b4db4474197a70be461c50705c9799 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-class-properties/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-class-properties + +> This plugin transforms static class properties as well as properties declared with the property initializer syntax + +See our website [@babel/plugin-transform-class-properties](https://babeljs.io/docs/babel-plugin-transform-class-properties) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-class-properties +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-class-properties --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-class-static-block/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-class-static-block/README.md new file mode 100644 index 0000000000000000000000000000000000000000..20481d26e69b85956a4fa5d768accfb60c5c7b5a --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-class-static-block/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-class-static-block + +> Transform class static blocks + +See our website [@babel/plugin-transform-class-static-block](https://babeljs.io/docs/babel-plugin-transform-class-static-block) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-class-static-block +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-class-static-block --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-classes/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-classes/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b552b0d71744dca323bf6f4b38dc93f72cc59369 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-classes/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-classes + +> Compile ES2015 classes to ES5 + +See our website [@babel/plugin-transform-classes](https://babeljs.io/docs/babel-plugin-transform-classes) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-classes +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-classes --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-computed-properties/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-computed-properties/README.md new file mode 100644 index 0000000000000000000000000000000000000000..397c70732f02b69e162d0c987f333a3f3bb7adec --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-computed-properties/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-computed-properties + +> Compile ES2015 computed properties to ES5 + +See our website [@babel/plugin-transform-computed-properties](https://babeljs.io/docs/babel-plugin-transform-computed-properties) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-computed-properties +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-computed-properties --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-destructuring/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-destructuring/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d057a3251c25ad3ed1bda3b2fd4b24048b4b4616 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-destructuring/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-destructuring + +> Compile ES2015 destructuring to ES5 + +See our website [@babel/plugin-transform-destructuring](https://babeljs.io/docs/babel-plugin-transform-destructuring) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-destructuring +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-destructuring --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-dotall-regex/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-dotall-regex/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ccfbb5e0a8b34f24ff0601c40199e6950cbb8c42 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-dotall-regex/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-dotall-regex + +> Compile regular expressions using the `s` (`dotAll`) flag to ES5. + +See our website [@babel/plugin-transform-dotall-regex](https://babeljs.io/docs/babel-plugin-transform-dotall-regex) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-dotall-regex +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-dotall-regex --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-duplicate-keys/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-duplicate-keys/README.md new file mode 100644 index 0000000000000000000000000000000000000000..05ca68b6225f32beb96c590229639cd5c73398f7 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-duplicate-keys/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-duplicate-keys + +> Compile objects with duplicate keys to valid strict ES5 + +See our website [@babel/plugin-transform-duplicate-keys](https://babeljs.io/docs/babel-plugin-transform-duplicate-keys) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-duplicate-keys +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-duplicate-keys --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8ff227f44e47ac29984051adaede7509ac17596e --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-duplicate-named-capturing-groups-regex + +> Compile regular expressions using duplicate named groups to index-based groups. + +See our website [@babel/plugin-transform-duplicate-named-capturing-groups-regex](https://babeljs.io/docs/babel-plugin-transform-duplicate-named-capturing-groups-regex) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-duplicate-named-capturing-groups-regex +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-duplicate-named-capturing-groups-regex --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-dynamic-import/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-dynamic-import/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ef356d8fbf78fd0883a9ebf354e54f5985b2c409 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-dynamic-import/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-dynamic-import + +> Transform import() expressions + +See our website [@babel/plugin-transform-dynamic-import](https://babeljs.io/docs/babel-plugin-transform-dynamic-import) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-dynamic-import +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-dynamic-import --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-explicit-resource-management/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-explicit-resource-management/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c00ba2bbfbe2989f109e38d81a6199e7b1e3caa4 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-explicit-resource-management/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-explicit-resource-management + +> Compile `using` and `await using` declarations to ES2015 + +See our website [@babel/plugin-transform-explicit-resource-management](https://babeljs.io/docs/babel-plugin-transform-explicit-resource-management) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-explicit-resource-management +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-explicit-resource-management --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-exponentiation-operator/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-exponentiation-operator/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4c3899f2cbd59e8fa8839f6f20412ef54eb3d103 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-exponentiation-operator/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-exponentiation-operator + +> Compile exponentiation operator to ES5 + +See our website [@babel/plugin-transform-exponentiation-operator](https://babeljs.io/docs/babel-plugin-transform-exponentiation-operator) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-exponentiation-operator +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-exponentiation-operator --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-export-namespace-from/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-export-namespace-from/README.md new file mode 100644 index 0000000000000000000000000000000000000000..33aea24e6c872d96073e9e878348209791761c48 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-export-namespace-from/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-export-namespace-from + +> Compile export namespace to ES2015 + +See our website [@babel/plugin-transform-export-namespace-from](https://babeljs.io/docs/babel-plugin-transform-export-namespace-from) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-export-namespace-from +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-export-namespace-from --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-for-of/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-for-of/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ae389e10f56d26fcdd5cc9c15053a31ee2d63a4c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-for-of/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-for-of + +> Compile ES2015 for...of to ES5 + +See our website [@babel/plugin-transform-for-of](https://babeljs.io/docs/babel-plugin-transform-for-of) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-for-of +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-for-of --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-function-name/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-function-name/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ef8beb1c84e51090de83a6991cd5fc58bcf8f545 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-function-name/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-function-name + +> Apply ES2015 function.name semantics to all functions + +See our website [@babel/plugin-transform-function-name](https://babeljs.io/docs/babel-plugin-transform-function-name) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-function-name +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-function-name --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-json-strings/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-json-strings/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7b3cd2c49e1e56929bbb3e4d13f4ca668954653f --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-json-strings/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-json-strings + +> Escape U+2028 LINE SEPARATOR and U+2029 PARAGRAPH SEPARATOR in JS strings + +See our website [@babel/plugin-transform-json-strings](https://babeljs.io/docs/babel-plugin-transform-json-strings) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-json-strings +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-json-strings --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-literals/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-literals/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f9d7bf90545af8c061a6fd169aae92ce6a839633 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-literals/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-literals + +> Compile ES2015 unicode string and number literals to ES5 + +See our website [@babel/plugin-transform-literals](https://babeljs.io/docs/babel-plugin-transform-literals) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-literals +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-literals --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-logical-assignment-operators/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-logical-assignment-operators/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bf3795d7b7e501dd5a748aa897bd10dd3f5feb09 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-logical-assignment-operators/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-logical-assignment-operators + +> Transforms logical assignment operators into short-circuited assignments + +See our website [@babel/plugin-transform-logical-assignment-operators](https://babeljs.io/docs/babel-plugin-transform-logical-assignment-operators) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-logical-assignment-operators +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-logical-assignment-operators --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-member-expression-literals/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-member-expression-literals/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7f8b7f69dd3962393026d1ca34c5dab94e4f5d43 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-member-expression-literals/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-member-expression-literals + +> Ensure that reserved words are quoted in property accesses + +See our website [@babel/plugin-transform-member-expression-literals](https://babeljs.io/docs/babel-plugin-transform-member-expression-literals) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-member-expression-literals +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-member-expression-literals --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-amd/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-amd/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fba7f62dd0204aebdb33e77d21d15de1b9888438 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-amd/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-modules-amd + +> This plugin transforms ES2015 modules to AMD + +See our website [@babel/plugin-transform-modules-amd](https://babeljs.io/docs/babel-plugin-transform-modules-amd) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-modules-amd +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-modules-amd --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-commonjs/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-commonjs/README.md new file mode 100644 index 0000000000000000000000000000000000000000..98145c79e331e39559144a03973846c6b8ce4899 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-commonjs/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-modules-commonjs + +> This plugin transforms ES2015 modules to CommonJS + +See our website [@babel/plugin-transform-modules-commonjs](https://babeljs.io/docs/babel-plugin-transform-modules-commonjs) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-modules-commonjs +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-modules-commonjs --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-systemjs/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-systemjs/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cd4699f468abd6a4c6b3a556724c46a0a7196f2c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-systemjs/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-modules-systemjs + +> This plugin transforms ES2015 modules to SystemJS + +See our website [@babel/plugin-transform-modules-systemjs](https://babeljs.io/docs/babel-plugin-transform-modules-systemjs) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-modules-systemjs +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-modules-systemjs --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-umd/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-umd/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e9f0358ab43fcf28c6015ec704fab94fe1e38624 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-modules-umd/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-modules-umd + +> This plugin transforms ES2015 modules to UMD + +See our website [@babel/plugin-transform-modules-umd](https://babeljs.io/docs/babel-plugin-transform-modules-umd) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-modules-umd +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-modules-umd --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-named-capturing-groups-regex/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-named-capturing-groups-regex/README.md new file mode 100644 index 0000000000000000000000000000000000000000..61fbeb3a14fd36dd3997dc128f9ab60af3276f83 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-named-capturing-groups-regex/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-named-capturing-groups-regex + +> Compile regular expressions using named groups to ES5. + +See our website [@babel/plugin-transform-named-capturing-groups-regex](https://babeljs.io/docs/babel-plugin-transform-named-capturing-groups-regex) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-named-capturing-groups-regex +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-named-capturing-groups-regex --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-new-target/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-new-target/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6dcbcf7089f1dc3302cc1720bd729770e9c2c4d0 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-new-target/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-new-target + +> Transforms new.target meta property + +See our website [@babel/plugin-transform-new-target](https://babeljs.io/docs/babel-plugin-transform-new-target) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-new-target +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-new-target --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-nullish-coalescing-operator/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-nullish-coalescing-operator/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0d98d92c850a10df4ca7eea30246cec0b14da069 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-nullish-coalescing-operator/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-nullish-coalescing-operator + +> Remove nullish coalescing operator + +See our website [@babel/plugin-transform-nullish-coalescing-operator](https://babeljs.io/docs/babel-plugin-transform-nullish-coalescing-operator) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-nullish-coalescing-operator +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-nullish-coalescing-operator --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-numeric-separator/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-numeric-separator/README.md new file mode 100644 index 0000000000000000000000000000000000000000..90c4bf48e957fd01e292de7de74a04f920bccd0d --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-numeric-separator/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-numeric-separator + +> Remove numeric separators from Decimal, Binary, Hex and Octal literals + +See our website [@babel/plugin-transform-numeric-separator](https://babeljs.io/docs/babel-plugin-transform-numeric-separator) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-numeric-separator +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-numeric-separator --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-object-rest-spread/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-object-rest-spread/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cef6d82128f8dc2666fec4c8b6bee3c390cabea6 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-object-rest-spread/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-object-rest-spread + +> Compile object rest and spread to ES5 + +See our website [@babel/plugin-transform-object-rest-spread](https://babeljs.io/docs/babel-plugin-transform-object-rest-spread) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-object-rest-spread +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-object-rest-spread --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-object-super/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-object-super/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1ab1b4d36c3b95c44748b213f4a049c1a9941236 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-object-super/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-object-super + +> Compile ES2015 object super to ES5 + +See our website [@babel/plugin-transform-object-super](https://babeljs.io/docs/babel-plugin-transform-object-super) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-object-super +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-object-super --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-optional-catch-binding/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-optional-catch-binding/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d2ecd426591a4dd0b2bc180076bc37e4e2189d0b --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-optional-catch-binding/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-optional-catch-binding + +> Compile optional catch bindings + +See our website [@babel/plugin-transform-optional-catch-binding](https://babeljs.io/docs/babel-plugin-transform-optional-catch-binding) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-optional-catch-binding +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-optional-catch-binding --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-optional-chaining/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-optional-chaining/README.md new file mode 100644 index 0000000000000000000000000000000000000000..41cdc2b6047478c80c512014b2a56667ecf1b8bd --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-optional-chaining/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-optional-chaining + +> Transform optional chaining operators into a series of nil checks + +See our website [@babel/plugin-transform-optional-chaining](https://babeljs.io/docs/babel-plugin-transform-optional-chaining) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-optional-chaining +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-optional-chaining --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-parameters/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-parameters/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e0541a83f17d620f56b7d869d41d836fcd41ff7a --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-parameters/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-parameters + +> Compile ES2015 default and rest parameters to ES5 + +See our website [@babel/plugin-transform-parameters](https://babeljs.io/docs/babel-plugin-transform-parameters) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-parameters +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-parameters --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-private-methods/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-private-methods/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c7ef0a4a96309b8290700694c853f2070f9e99b2 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-private-methods/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-private-methods + +> This plugin transforms private class methods + +See our website [@babel/plugin-transform-private-methods](https://babeljs.io/docs/babel-plugin-transform-private-methods) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-private-methods +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-private-methods --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-private-property-in-object/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-private-property-in-object/README.md new file mode 100644 index 0000000000000000000000000000000000000000..59a234dafb349cb1bfea81f064bda386ba816788 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-private-property-in-object/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-private-property-in-object + +> This plugin transforms checks for a private property in an object + +See our website [@babel/plugin-transform-private-property-in-object](https://babeljs.io/docs/babel-plugin-transform-private-property-in-object) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-private-property-in-object +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-private-property-in-object --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-property-literals/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-property-literals/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8e490aba61ac7cae1ae15c5dedff7ac4ece7e50f --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-property-literals/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-property-literals + +> Ensure that reserved words are quoted in object property keys + +See our website [@babel/plugin-transform-property-literals](https://babeljs.io/docs/babel-plugin-transform-property-literals) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-property-literals +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-property-literals --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-regenerator/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-regenerator/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0b1fedd9dbe47a31b806762161357156dfbe4b99 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-regenerator/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-regenerator + +> Explode async and generator functions into a state machine. + +See our website [@babel/plugin-transform-regenerator](https://babeljs.io/docs/babel-plugin-transform-regenerator) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-regenerator +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-regenerator --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-regexp-modifiers/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-regexp-modifiers/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f3b8723f56a44b7ff174234bc7081411034e2e7c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-regexp-modifiers/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-regexp-modifiers + +> Compile inline regular expression modifiers + +See our website [@babel/plugin-transform-regexp-modifiers](https://babeljs.io/docs/babel-plugin-transform-regexp-modifiers) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-regexp-modifiers +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-regexp-modifiers --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-reserved-words/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-reserved-words/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ff4b776eb8b3e981f7d98715246836783f3ebad5 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-reserved-words/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-reserved-words + +> Ensure that no reserved words are used. + +See our website [@babel/plugin-transform-reserved-words](https://babeljs.io/docs/babel-plugin-transform-reserved-words) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-reserved-words +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-reserved-words --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-shorthand-properties/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-shorthand-properties/README.md new file mode 100644 index 0000000000000000000000000000000000000000..39f3429145014d07e3ac1c2241267ae46f1b12bd --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-shorthand-properties/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-shorthand-properties + +> Compile ES2015 shorthand properties to ES5 + +See our website [@babel/plugin-transform-shorthand-properties](https://babeljs.io/docs/babel-plugin-transform-shorthand-properties) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-shorthand-properties +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-shorthand-properties --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-spread/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-spread/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c964617f19ec22b0678e2e1443c8b6b46b5785eb --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-spread/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-spread + +> Compile ES2015 spread to ES5 + +See our website [@babel/plugin-transform-spread](https://babeljs.io/docs/babel-plugin-transform-spread) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-spread +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-spread --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-sticky-regex/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-sticky-regex/README.md new file mode 100644 index 0000000000000000000000000000000000000000..16c9fe295f4ee1771faae8f410c5676b9541417a --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-sticky-regex/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-sticky-regex + +> Compile ES2015 sticky regex to an ES5 RegExp constructor + +See our website [@babel/plugin-transform-sticky-regex](https://babeljs.io/docs/babel-plugin-transform-sticky-regex) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-sticky-regex +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-sticky-regex --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-template-literals/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-template-literals/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c4441a160bf03befda811b0156c4767f07812056 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-template-literals/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-template-literals + +> Compile ES2015 template literals to ES5 + +See our website [@babel/plugin-transform-template-literals](https://babeljs.io/docs/babel-plugin-transform-template-literals) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-template-literals +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-template-literals --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-typeof-symbol/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-typeof-symbol/README.md new file mode 100644 index 0000000000000000000000000000000000000000..60eb36aa75cd5e5437b0b4c8d7d804ea441a4453 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-typeof-symbol/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-typeof-symbol + +> This transformer wraps all typeof expressions with a method that replicates native behaviour. (ie. returning “symbol” for symbols) + +See our website [@babel/plugin-transform-typeof-symbol](https://babeljs.io/docs/babel-plugin-transform-typeof-symbol) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-typeof-symbol +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-typeof-symbol --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-escapes/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-escapes/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5bfb07296cf55c4359d5811e73acabf10db0914a --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-escapes/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-unicode-escapes + +> Compile ES2015 Unicode escapes to ES5 + +See our website [@babel/plugin-transform-unicode-escapes](https://babeljs.io/docs/babel-plugin-transform-unicode-escapes) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-unicode-escapes +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-unicode-escapes --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-property-regex/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-property-regex/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5f4b4149c7e9a9c6e9dad86c9e56cf0d4db5ae7a --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-property-regex/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-unicode-property-regex + +> Compile Unicode property escapes in Unicode regular expressions to ES5. + +See our website [@babel/plugin-transform-unicode-property-regex](https://babeljs.io/docs/babel-plugin-transform-unicode-property-regex) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-unicode-property-regex +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-unicode-property-regex --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-regex/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-regex/README.md new file mode 100644 index 0000000000000000000000000000000000000000..606f039b4f63f009ef8e527b32d2370e1325a65a --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-regex/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-unicode-regex + +> Compile ES2015 Unicode regex to ES5 + +See our website [@babel/plugin-transform-unicode-regex](https://babeljs.io/docs/babel-plugin-transform-unicode-regex) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-unicode-regex +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-unicode-regex --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-sets-regex/README.md b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-sets-regex/README.md new file mode 100644 index 0000000000000000000000000000000000000000..67d59dcef61c69f7705465f8d197eaf6a58836f2 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/plugin-transform-unicode-sets-regex/README.md @@ -0,0 +1,19 @@ +# @babel/plugin-transform-unicode-sets-regex + +> Compile regular expressions' unicodeSets (v) flag. + +See our website [@babel/plugin-transform-unicode-sets-regex](https://babeljs.io/docs/babel-plugin-transform-unicode-sets-regex) for more information. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/plugin-transform-unicode-sets-regex +``` + +or using yarn: + +```sh +yarn add @babel/plugin-transform-unicode-sets-regex --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/preset-env/CONTRIBUTING.md b/llama.cpp/tools/ui/node_modules/@babel/preset-env/CONTRIBUTING.md new file mode 100644 index 0000000000000000000000000000000000000000..83800c08800808b7f53c27d298ed67cb50cb4600 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/preset-env/CONTRIBUTING.md @@ -0,0 +1,95 @@ +# Contributing + +## Adding a new plugin or polyfill to support (when approved in the next ECMAScript version) + +### Update [`plugin-features.mjs`](../babel-compat-data/scripts/data/plugin-features.mjs) + +*Example:* + +If you were going to add `**` which is in ES2016: + +Find the relevant entries on [compat-table](https://compat-table.github.io/compat-table/es2016plus/#test-exponentiation_(**)_operator): + +`exponentiation (**) operator` + +Find the corresponding babel plugin: + +`@babel/plugin-transform-exponentiation-operator` + +And add them in this structure: + +```js +// es2016 +"@babel/plugin-transform-exponentiation-operator": { + features: [ + "exponentiation (**) operator", + ], +}, +``` + +### Update data for `core-js@2` polyfilling + +*Example:* + +In case you want to add `Object.values` which is in ES2017: + +Find the relevant feature and subfeature on [compat-table](https://kangax.github.io/compat-table/es2016plus/#test-Object_static_methods_Object.values) +and split it with `/`: + +`Object static methods / Object.values` + +Find the corresponding module on [`core-js@2`](https://github.com/zloirock/core-js/tree/v2/modules): + +`es7.object.values.js` + +Find required ES version in [`corejs2-built-in-features.js`](https://github.com/babel/babel/blob/main/packages/babel-preset-env/data/corejs2-built-in-features.js) and add the new feature: + +```js +const es = { + //... + "es7.object.values": "Object static methods / Object.values" +} +``` + +If you want to transform a new built-in by `useBuiltIns: 'usage'`, add mapping to related `core-js` modules to [this file](https://github.com/babel/babel/blob/main/packages/babel-preset-env/polyfills/corejs2/built-in-definitions.js). + +### Update data for `core-js@3` polyfilling + +Just update the version of [`core-js-compat`](https://github.com/zloirock/core-js/tree/main/packages/core-js-compat) in dependencies. + +If you want to transform a new built-in by `useBuiltIns: 'usage'`, add mapping to related [`core-js`](https://github.com/zloirock/core-js/tree/main/packages/core-js/modules) modules to [this file](https://github.com/babel/babel/blob/main/packages/babel-preset-env/polyfills/corejs3/built-in-definitions.js). + +If you want to mark a new proposal as shipped, add it to [this list](https://github.com/babel/babel/blob/main/packages/babel-preset-env/polyfills/corejs3/shipped-proposals.js). + +### Update [`plugins.json`](../babel-compat-data/data/plugins.json) + +Until `compat-table` is a standalone npm module for data we are using the git commit in `packages/babel-compat-data/scripts/download-compat-table.sh` + +`COMPAT_TABLE_COMMIT=[latest-commit-hash]`, + +So we update and then run `npm run build-data`. If there are no changes, then `plugins.json` will be the same. + +## Tests + +### Running tests + +See general [CONTRIBUTING.md](../../CONTRIBUTING.md#running-lintingtests). + +### Writing tests + +#### General + +All the tests for `@babel/preset-env` exist in the `test/fixtures` folder. The +test setup and conventions are exactly the same as testing a Babel plugin, so +please read our [documentation on writing tests](../../CONTRIBUTING.md#babel-plugin-x). + +#### Testing the `debug` option + +Testing debug output to `stdout` is similar. Under the `test/debug-fixtures`, +create a folder with a descriptive name of your test, and add the following: + +* Add a `options.json` file (just as the other tests, this is essentially a +`.babelrc`) with the desired test configuration (required) +* Add a `stdout.txt` file with the expected debug output. For added +convenience, if there is no `stdout.txt` present, the test runner will +generate one for you. diff --git a/llama.cpp/tools/ui/node_modules/@babel/preset-env/README.md b/llama.cpp/tools/ui/node_modules/@babel/preset-env/README.md new file mode 100644 index 0000000000000000000000000000000000000000..159c37b1b15647012d7a9b37baf8946c975e8eeb --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/preset-env/README.md @@ -0,0 +1,19 @@ +# @babel/preset-env + +> A Babel preset for each environment. + +See our website [@babel/preset-env](https://babeljs.io/docs/babel-preset-env) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20preset-env%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/preset-env +``` + +or using yarn: + +```sh +yarn add @babel/preset-env --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/preset-env/node_modules/semver/README.md b/llama.cpp/tools/ui/node_modules/@babel/preset-env/node_modules/semver/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2293a14fdc3579558dbe9fbc50aa549657948c3e --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/preset-env/node_modules/semver/README.md @@ -0,0 +1,443 @@ +semver(1) -- The semantic versioner for npm +=========================================== + +## Install + +```bash +npm install semver +```` + +## Usage + +As a node module: + +```js +const semver = require('semver') + +semver.valid('1.2.3') // '1.2.3' +semver.valid('a.b.c') // null +semver.clean(' =v1.2.3 ') // '1.2.3' +semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true +semver.gt('1.2.3', '9.8.7') // false +semver.lt('1.2.3', '9.8.7') // true +semver.minVersion('>=1.0.0') // '1.0.0' +semver.valid(semver.coerce('v2')) // '2.0.0' +semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7' +``` + +As a command-line utility: + +``` +$ semver -h + +A JavaScript implementation of the https://semver.org/ specification +Copyright Isaac Z. Schlueter + +Usage: semver [options] [ [...]] +Prints valid versions sorted by SemVer precedence + +Options: +-r --range + Print versions that match the specified range. + +-i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + +--preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + +-l --loose + Interpret versions and ranges loosely + +-p --include-prerelease + Always include prerelease versions in range matching + +-c --coerce + Coerce a string into SemVer if possible + (does not imply --loose) + +--rtl + Coerce version strings right to left + +--ltr + Coerce version strings left to right (default) + +Program exits successfully if any valid version satisfies +all supplied ranges, and prints all satisfying versions. + +If no satisfying versions are found, then exits failure. + +Versions are printed in ascending order, so supplying +multiple versions to the utility will just sort them. +``` + +## Versions + +A "version" is described by the `v2.0.0` specification found at +. + +A leading `"="` or `"v"` character is stripped off and ignored. + +## Ranges + +A `version range` is a set of `comparators` which specify versions +that satisfy the range. + +A `comparator` is composed of an `operator` and a `version`. The set +of primitive `operators` is: + +* `<` Less than +* `<=` Less than or equal to +* `>` Greater than +* `>=` Greater than or equal to +* `=` Equal. If no operator is specified, then equality is assumed, + so this operator is optional, but MAY be included. + +For example, the comparator `>=1.2.7` would match the versions +`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6` +or `1.1.0`. + +Comparators can be joined by whitespace to form a `comparator set`, +which is satisfied by the **intersection** of all of the comparators +it includes. + +A range is composed of one or more comparator sets, joined by `||`. A +version matches a range if and only if every comparator in at least +one of the `||`-separated comparator sets is satisfied by the version. + +For example, the range `>=1.2.7 <1.3.0` would match the versions +`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`, +or `1.1.0`. + +The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`, +`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`. + +### Prerelease Tags + +If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then +it will only be allowed to satisfy comparator sets if at least one +comparator with the same `[major, minor, patch]` tuple also has a +prerelease tag. + +For example, the range `>1.2.3-alpha.3` would be allowed to match the +version `1.2.3-alpha.7`, but it would *not* be satisfied by +`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater +than" `1.2.3-alpha.3` according to the SemVer sort rules. The version +range only accepts prerelease tags on the `1.2.3` version. The +version `3.4.5` *would* satisfy the range, because it does not have a +prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`. + +The purpose for this behavior is twofold. First, prerelease versions +frequently are updated very quickly, and contain many breaking changes +that are (by the author's design) not yet fit for public consumption. +Therefore, by default, they are excluded from range matching +semantics. + +Second, a user who has opted into using a prerelease version has +clearly indicated the intent to use *that specific* set of +alpha/beta/rc versions. By including a prerelease tag in the range, +the user is indicating that they are aware of the risk. However, it +is still not appropriate to assume that they have opted into taking a +similar risk on the *next* set of prerelease versions. + +Note that this behavior can be suppressed (treating all prerelease +versions as if they were normal versions, for the purpose of range +matching) by setting the `includePrerelease` flag on the options +object to any +[functions](https://github.com/npm/node-semver#functions) that do +range matching. + +#### Prerelease Identifiers + +The method `.inc` takes an additional `identifier` string argument that +will append the value of the string as a prerelease identifier: + +```javascript +semver.inc('1.2.3', 'prerelease', 'beta') +// '1.2.4-beta.0' +``` + +command-line example: + +```bash +$ semver 1.2.3 -i prerelease --preid beta +1.2.4-beta.0 +``` + +Which then can be used to increment further: + +```bash +$ semver 1.2.4-beta.0 -i prerelease +1.2.4-beta.1 +``` + +### Advanced Range Syntax + +Advanced range syntax desugars to primitive comparators in +deterministic ways. + +Advanced ranges may be combined in the same way as primitive +comparators using white space or `||`. + +#### Hyphen Ranges `X.Y.Z - A.B.C` + +Specifies an inclusive set. + +* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4` + +If a partial version is provided as the first version in the inclusive +range, then the missing pieces are replaced with zeroes. + +* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4` + +If a partial version is provided as the second version in the +inclusive range, then all versions that start with the supplied parts +of the tuple are accepted, but nothing that would be greater than the +provided tuple parts. + +* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0` +* `1.2.3 - 2` := `>=1.2.3 <3.0.0` + +#### X-Ranges `1.2.x` `1.X` `1.2.*` `*` + +Any of `X`, `x`, or `*` may be used to "stand in" for one of the +numeric values in the `[major, minor, patch]` tuple. + +* `*` := `>=0.0.0` (Any version satisfies) +* `1.x` := `>=1.0.0 <2.0.0` (Matching major version) +* `1.2.x` := `>=1.2.0 <1.3.0` (Matching major and minor versions) + +A partial version range is treated as an X-Range, so the special +character is in fact optional. + +* `""` (empty string) := `*` := `>=0.0.0` +* `1` := `1.x.x` := `>=1.0.0 <2.0.0` +* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0` + +#### Tilde Ranges `~1.2.3` `~1.2` `~1` + +Allows patch-level changes if a minor version is specified on the +comparator. Allows minor-level changes if not. + +* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0` +* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0` (Same as `1.2.x`) +* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0` (Same as `1.x`) +* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0` +* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0` (Same as `0.2.x`) +* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0` (Same as `0.x`) +* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. + +#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4` + +Allows changes that do not modify the left-most non-zero element in the +`[major, minor, patch]` tuple. In other words, this allows patch and +minor updates for versions `1.0.0` and above, patch updates for +versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`. + +Many authors treat a `0.x` version as if the `x` were the major +"breaking-change" indicator. + +Caret ranges are ideal when an author may make breaking changes +between `0.2.4` and `0.3.0` releases, which is a common practice. +However, it presumes that there will *not* be breaking changes between +`0.2.4` and `0.2.5`. It allows for changes that are presumed to be +additive (but non-breaking), according to commonly observed practices. + +* `^1.2.3` := `>=1.2.3 <2.0.0` +* `^0.2.3` := `>=0.2.3 <0.3.0` +* `^0.0.3` := `>=0.0.3 <0.0.4` +* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0` Note that prereleases in + the `1.2.3` version will be allowed, if they are greater than or + equal to `beta.2`. So, `1.2.3-beta.4` would be allowed, but + `1.2.4-beta.2` would not, because it is a prerelease of a + different `[major, minor, patch]` tuple. +* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4` Note that prereleases in the + `0.0.3` version *only* will be allowed, if they are greater than or + equal to `beta`. So, `0.0.3-pr.2` would be allowed. + +When parsing caret ranges, a missing `patch` value desugars to the +number `0`, but will allow flexibility within that value, even if the +major and minor versions are both `0`. + +* `^1.2.x` := `>=1.2.0 <2.0.0` +* `^0.0.x` := `>=0.0.0 <0.1.0` +* `^0.0` := `>=0.0.0 <0.1.0` + +A missing `minor` and `patch` values will desugar to zero, but also +allow flexibility within those values, even if the major version is +zero. + +* `^1.x` := `>=1.0.0 <2.0.0` +* `^0.x` := `>=0.0.0 <1.0.0` + +### Range Grammar + +Putting all this together, here is a Backus-Naur grammar for ranges, +for the benefit of parser authors: + +```bnf +range-set ::= range ( logical-or range ) * +logical-or ::= ( ' ' ) * '||' ( ' ' ) * +range ::= hyphen | simple ( ' ' simple ) * | '' +hyphen ::= partial ' - ' partial +simple ::= primitive | partial | tilde | caret +primitive ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial +partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? +xr ::= 'x' | 'X' | '*' | nr +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * +tilde ::= '~' partial +caret ::= '^' partial +qualifier ::= ( '-' pre )? ( '+' build )? +pre ::= parts +build ::= parts +parts ::= part ( '.' part ) * +part ::= nr | [-0-9A-Za-z]+ +``` + +## Functions + +All methods and classes take a final `options` object argument. All +options in this object are `false` by default. The options supported +are: + +- `loose` Be more forgiving about not-quite-valid semver strings. + (Any resulting output will always be 100% strict compliant, of + course.) For backwards compatibility reasons, if the `options` + argument is a boolean value instead of an object, it is interpreted + to be the `loose` param. +- `includePrerelease` Set to suppress the [default + behavior](https://github.com/npm/node-semver#prerelease-tags) of + excluding prerelease tagged versions from ranges unless they are + explicitly opted into. + +Strict-mode Comparators and Ranges will be strict about the SemVer +strings that they parse. + +* `valid(v)`: Return the parsed version, or null if it's not valid. +* `inc(v, release)`: Return the version incremented by the release + type (`major`, `premajor`, `minor`, `preminor`, `patch`, + `prepatch`, or `prerelease`), or null if it's not valid + * `premajor` in one call will bump the version up to the next major + version and down to a prerelease of that major version. + `preminor`, and `prepatch` work the same way. + * If called from a non-prerelease version, the `prerelease` will work the + same as `prepatch`. It increments the patch version, then makes a + prerelease. If the input version is already a prerelease it simply + increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` +* `major(v)`: Return the major version number. +* `minor(v)`: Return the minor version number. +* `patch(v)`: Return the patch version number. +* `intersects(r1, r2, loose)`: Return true if the two supplied ranges + or comparators intersect. +* `parse(v)`: Attempt to parse a string as a semantic version, returning either + a `SemVer` object or `null`. + +### Comparison + +* `gt(v1, v2)`: `v1 > v2` +* `gte(v1, v2)`: `v1 >= v2` +* `lt(v1, v2)`: `v1 < v2` +* `lte(v1, v2)`: `v1 <= v2` +* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent, + even if they're not the exact same string. You already know how to + compare strings. +* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`. +* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call + the corresponding function above. `"==="` and `"!=="` do simple + string comparison, but are included for completeness. Throws if an + invalid comparison string is provided. +* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `rcompare(v1, v2)`: The reverse of compare. Sorts an array of versions + in descending order when passed to `Array.sort()`. +* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions + are equal. Sorts in ascending order if passed to `Array.sort()`. + `v2` is greater. Sorts in ascending order if passed to `Array.sort()`. +* `diff(v1, v2)`: Returns difference between two versions by the release type + (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`), + or null if the versions are the same. + +### Comparators + +* `intersects(comparator)`: Return true if the comparators intersect + +### Ranges + +* `validRange(range)`: Return the valid range or null if it's not valid +* `satisfies(version, range)`: Return true if the version satisfies the + range. +* `maxSatisfying(versions, range)`: Return the highest version in the list + that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. +* `minVersion(range)`: Return the lowest version that can possibly match + the given range. +* `gtr(version, range)`: Return `true` if version is greater than all the + versions possible in the range. +* `ltr(version, range)`: Return `true` if version is less than all the + versions possible in the range. +* `outside(version, range, hilo)`: Return true if the version is outside + the bounds of the range in either the high or low direction. The + `hilo` argument must be either the string `'>'` or `'<'`. (This is + the function called by `gtr` and `ltr`.) +* `intersects(range)`: Return true if any of the ranges comparators intersect + +Note that, since ranges may be non-contiguous, a version might not be +greater than a range, less than a range, *or* satisfy a range! For +example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9` +until `2.0.0`, so the version `1.2.10` would not be greater than the +range (because `2.0.1` satisfies, which is higher), nor less than the +range (since `1.2.8` satisfies, which is lower), and it also does not +satisfy the range. + +If you want to know if a version satisfies or does not satisfy a +range, use the `satisfies(version, range)` function. + +### Coercion + +* `coerce(version, options)`: Coerces a string to semver if possible + +This aims to provide a very forgiving translation of a non-semver string to +semver. It looks for the first digit in a string, and consumes all +remaining characters which satisfy at least a partial semver (e.g., `1`, +`1.2`, `1.2.3`) up to the max permitted length (256 characters). Longer +versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`). All +surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes +`3.4.0`). Only text which lacks digits will fail coercion (`version one` +is not valid). The maximum length for any semver component considered for +coercion is 16 characters; longer components will be ignored +(`10000000000000000.4.7.4` becomes `4.7.4`). The maximum value for any +semver component is `Integer.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value +components are invalid (`9999999999999999.4.7.4` is likely invalid). + +If the `options.rtl` flag is set, then `coerce` will return the right-most +coercible tuple that does not share an ending index with a longer coercible +tuple. For example, `1.2.3.4` will return `2.3.4` in rtl mode, not +`4.0.0`. `1.2.3/4` will return `4.0.0`, because the `4` is not a part of +any other overlapping SemVer tuple. + +### Clean + +* `clean(version)`: Clean a string to be a valid semver if possible + +This will return a cleaned and trimmed semver version. If the provided version is not valid a null will be returned. This does not work for ranges. + +ex. +* `s.clean(' = v 2.1.5foo')`: `null` +* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean(' = v 2.1.5-foo')`: `null` +* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'` +* `s.clean('=v2.1.5')`: `'2.1.5'` +* `s.clean(' =v2.1.5')`: `2.1.5` +* `s.clean(' 2.1.5 ')`: `'2.1.5'` +* `s.clean('~1.0.0')`: `null` diff --git a/llama.cpp/tools/ui/node_modules/@babel/preset-modules/README.md b/llama.cpp/tools/ui/node_modules/@babel/preset-modules/README.md new file mode 100644 index 0000000000000000000000000000000000000000..eb7517c53299ada818aa3341278748eca14f7485 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/preset-modules/README.md @@ -0,0 +1,171 @@ +# `@babel/preset-modules` + +> ℹ️ Starting from `@babel/preset-env` 7.9.0, you can enable the [`bugfixes: true` option](https://babeljs.io/docs/en/babel-preset-env#bugfixes) to get the same behavior as using `@babel/preset-modules`, but with support for custom `targets`. +> If you need to target browsers with native modules support (like this preset does), you can use `targets: { esmodules: true }`. + +A Babel preset that enables async/await, Tagged Templates, arrow functions, destructured and rest parameters, and more **in all modern browsers** ([88% of traffic](https://caniuse.com/#feat=es6-module)). + +It works around bugs and inconsistencies in modern JavaScript engines by converting broken syntax to the _closest non-broken modern syntax_. Use this in place of `@babel/preset-env`'s [target.esmodules](https://babeljs.io/docs/en/babel-preset-env#targetsesmodules) option for smaller bundle size and improved performance. + +This preset is only useful for browsers. You can serve the output to modern browsers while still supporting older browsers using the [module/nomodule pattern](https://philipwalton.com/articles/deploying-es2015-code-in-production-today/): + +```html + + + + +``` + +### Features Supported + +- JSX spread attributes are compiled to Object.assign() instead of a helper. +- Default, destructured and optional parameters are all natively supported. +- Tagged Templates are fully supported, patched for Safari 10+ and Edge 16+. +- async/await is supported without being transpiled to generators. +- Function name inference works as expected, including Arrow Functions. + +### Installation & Usage + +Install the preset from [npm](https://www.npmjs.com/package/@babel/preset-modules): + +```sh +npm install @babel/preset-modules --save-dev +``` + +To use the preset, add it to your [Babel Configuration](https://babeljs.io/docs/en/configuration): + +```js +{ + "presets": [ + "@babel/preset-modules" + ] +} +``` + +If you're implementing the module/nomodule pattern, your configuration might look something like this: + +```js +{ + "env": { + "modern": { + "presets": [ + "@babel/preset-modules" + ] + }, + "legacy": { + "presets": [ + "@babel/preset-env" + ] + } + } +} +``` + +### Options + +There's a single Boolean `loose` option, which defaults to `false`. Passing `true` further reduces output size. + +The `loose` setting turns off a rarely-needed function name workaround for older versions of Edge. If you're not relying on `Function.prototype.name`, it's worth enabling loose mode. + +### How does it work? + +Babel’s `preset-env` is great, since it lets you define which Babel features are needed based on a browser support target. In order to make that plumbing work automatically, the preset has configuration that groups all of the new JavaScript syntax features into collections of related syntax transforms. These groups are fairly large, for example "function arguments" includes destructured, default and rest parameters. The groupings come from the fact that Babel’s transforms often rely on other transforms, so they can’t always be applied in isolation. + +From this grouping information, Babel enables or disables each group based on the browser support target you specify to preset-env’s [targets](https://babeljs.io/docs/en/babel-preset-env#targets) option. For modern output, the [targets.esmodules](https://babeljs.io/docs/en/babel-preset-env#targetsesmodules) option is effectively an alias for the set of browsers that support ES Modules: Edge 16+, Safari 10.1+, Firefox 60+ and Chrome 61+. + +Here's the problem: if any version of any browser in that list contains a bug triggered by modern syntax, the only solution we have is to enable the corresponding transform group that fixes that bug. This means that fundamentally, preset-env converts code to ES5 in order to get around syntax bugs in ES2017. Since that's the only solution at our disposal, eventually it becomes overused. + +For example, all of the new syntax features relating to function parameters are grouped into the same Babel plugin (`@babel/plugin-transform-function-parameters`). That means because Edge 16 & 17 support ES Modules but have a bug related to parsing shorthand destructured parameters with default values within arrow functions, all functions get compiled from the new compact argument syntaxes down to ES5: + +```js +// this breaks in Edge 16: +const foo = ({ a = 1 }) => {}; + +// .. but this doesn't: +function foo({ a = 1, b }, ...args) {} + +// ... and neither does this: +const foo = ({ a: a = 1 }) => {}; +``` + +In fact, there are 23 syntax improvements for function parameters in ES2017, and only one of them is broken in ES Modules-supporting browsers. It seems unfortunate to transpile all those great features down to ES5 just for one browser! + +This plugin takes a different approach than we've historically taken with JavaScript: it transpiles the broken syntax to the closest _non-broken modern syntax_. In the above case, here's what is generated to fix all ES Modules-supporting browsers: + +**input:** + +```js +const foo = ({ a = 1 }, b = 2, ...args) => [a,b,args]; +``` + +**output:** + +```js +const foo = ({ a: a = 1 }, b = 2, ...args) => [a,b,args]; +``` + +That output works in all ES Modules-supporting browsers, and is only **59 bytes** minified & gzipped. + +> Compare this to `@babel/preset-env`'s `targets.esmodules` output (**147 bytes** minified & gzipped): +> +> ```js +>const foo = function foo(_ref, b) { +> let { a = 1 } = _ref; +> +> if (b === void 0) { b = 2; } +> +> for ( +> var _len = arguments.length, +> args = new Array(_len > 2 ? _len - 2 : 0), +> _key = 2; _key < _len; _key++ +> ) { +> args[_key - 2] = arguments[_key]; +> } +> +> return [a, b, args]; +>}; +>```` + +The result is improved bundle size and performance, while supporting the same browsers. + + +### Important: Minification + +The output generated by this preset includes workarounds for Safari 10, however minifiers like Terser sometimes remove these workarounds. In order to avoid shipping broken code, it's important to tell Terser to preserve the workarounds, which can be done via the `safari10` option. + +It's also generally the case that minifiers are configured to output ES5 by default, so you'll want to change the output syntax to ES2017. + +With [Terser's Node API](https://github.com/terser/terser#minify-options): + +```js +terser.minify({ + ecma: 2017, + safari10: true +}) +``` + +With [Terser CLI](https://npm.im/terser): + +```sh +terser --ecma 2017 --safari10 ... +``` + +With [terser-webpack-plugin](https://webpack.js.org/plugins/terser-webpack-plugin/): + +```js +module.exports = { + optimization: { + minimizer: [ + new TerserPlugin({ + terserOptions: { + ecma: 2017, + safari10: true + } + }) + ] + } +}; +``` + +All of the above configurations also apply to [uglify-es](https://github.com/mishoo/UglifyJS2/tree/harmony). +UglifyJS (2.x and prior) does not support modern JavaScript, so it cannot be used in conjunction with this preset. diff --git a/llama.cpp/tools/ui/node_modules/@babel/runtime/README.md b/llama.cpp/tools/ui/node_modules/@babel/runtime/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2f3368ef58e938d8016e762d4ca91aad338e6f50 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/runtime/README.md @@ -0,0 +1,19 @@ +# @babel/runtime + +> babel's modular runtime helpers + +See our website [@babel/runtime](https://babeljs.io/docs/babel-runtime) for more information. + +## Install + +Using npm: + +```sh +npm install --save @babel/runtime +``` + +or using yarn: + +```sh +yarn add @babel/runtime +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/template/README.md b/llama.cpp/tools/ui/node_modules/@babel/template/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c2980fd943f0f57eb88a27a2f52c5dd2dfa32019 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/template/README.md @@ -0,0 +1,19 @@ +# @babel/template + +> Generate an AST from a string template. + +See our website [@babel/template](https://babeljs.io/docs/babel-template) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20template%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/template +``` + +or using yarn: + +```sh +yarn add @babel/template --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/traverse/README.md b/llama.cpp/tools/ui/node_modules/@babel/traverse/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0bf7744413ba11a2922f07fd1a15d510ef921ebe --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/traverse/README.md @@ -0,0 +1,19 @@ +# @babel/traverse + +> The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes + +See our website [@babel/traverse](https://babeljs.io/docs/babel-traverse) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20traverse%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/traverse +``` + +or using yarn: + +```sh +yarn add @babel/traverse --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@babel/types/README.md b/llama.cpp/tools/ui/node_modules/@babel/types/README.md new file mode 100644 index 0000000000000000000000000000000000000000..54c9f81948972286aad02d0fcdb1bd1566ae0f0b --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@babel/types/README.md @@ -0,0 +1,19 @@ +# @babel/types + +> Babel Types is a Lodash-esque utility library for AST nodes + +See our website [@babel/types](https://babeljs.io/docs/babel-types) for more information or the [issues](https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+label%3A%22pkg%3A%20types%22+is%3Aopen) associated with this package. + +## Install + +Using npm: + +```sh +npm install --save-dev @babel/types +``` + +or using yarn: + +```sh +yarn add @babel/types --dev +``` diff --git a/llama.cpp/tools/ui/node_modules/@bcoe/v8-coverage/LICENSE.md b/llama.cpp/tools/ui/node_modules/@bcoe/v8-coverage/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..d588b5c321e618e63a2991e42544ba151b107b1e --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@bcoe/v8-coverage/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright © 2015-2017 Charles Samborski + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/llama.cpp/tools/ui/node_modules/@bcoe/v8-coverage/README.md b/llama.cpp/tools/ui/node_modules/@bcoe/v8-coverage/README.md new file mode 100644 index 0000000000000000000000000000000000000000..eea761b9dfe8640ece6558db3295a82ca8302405 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@bcoe/v8-coverage/README.md @@ -0,0 +1,11 @@ +# V8 Coverage + +[![npm](https://img.shields.io/npm/v/@c88/v8-coverage.svg?maxAge=2592000)](https://www.npmjs.com/package/@c88/v8-coverage) +[![GitHub repository](https://img.shields.io/badge/Github-demurgos%2Fv8--coverage-blue.svg)](https://github.com/demurgos/v8-coverage) +[![Build status (Travis)](https://img.shields.io/travis/demurgos/v8-coverage/master.svg?maxAge=2592000)](https://travis-ci.org/demurgos/v8-coverage) +[![Build status (AppVeyor)](https://ci.appveyor.com/api/projects/status/qgcbdffyb9e09d0e?svg=true)](https://ci.appveyor.com/project/demurgos/v8-coverage) +[![Codecov](https://codecov.io/gh/demurgos/v8-coverage/branch/master/graph/badge.svg)](https://codecov.io/gh/demurgos/v8-coverage) + +## License + +[MIT License](./LICENSE.md) diff --git a/llama.cpp/tools/ui/node_modules/@blazediff/core/LICENSE.md b/llama.cpp/tools/ui/node_modules/@blazediff/core/LICENSE.md new file mode 100644 index 0000000000000000000000000000000000000000..9cd347bf687003c7b812193793dcc3bbd9754f0c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@blazediff/core/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 Teimur Gasanov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/llama.cpp/tools/ui/node_modules/@blazediff/core/README.md b/llama.cpp/tools/ui/node_modules/@blazediff/core/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e004d58c26f2fbf9b03d6c9bb61d1c4a9c8e902f --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@blazediff/core/README.md @@ -0,0 +1,194 @@ +# @blazediff/core + +
+ +[![npm bundle size](https://img.shields.io/bundlephobia/min/%40blazediff%2Fcore)](https://www.npmjs.com/package/@blazediff/core) +[![NPM Downloads](https://img.shields.io/npm/dy/%40blazediff%2Fcore)](https://www.npmjs.com/package/@blazediff/core) + +
+ +High-performance pixel-by-pixel image comparison with block-based optimization. 20% faster than pixelmatch with zero memory allocation. + +**Features:** +- YIQ color space for perceptual color difference +- Anti-aliasing detection and filtering +- Block-based optimization with 32-bit integer comparison +- Zero memory allocation during comparison +- Support for alpha channel and transparency + +For detailed algorithm explanation and mathematical formulas, see [FORMULA.md](./FORMULA.md). + +## Installation + +```bash +npm install @blazediff/core +``` + +## API + +### blazediff(image1, image2, output, width, height, options) + +Compare two images and return the number of different pixels. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterTypeDescription
image1Uint8Array | Uint8ClampedArrayFirst image data
image2Uint8Array | Uint8ClampedArraySecond image data
outputUint8Array | Uint8ClampedArrayOptional output buffer for diff visualization
widthnumberImage width in pixels
heightnumberImage height in pixels
optionsobjectComparison options (optional)
+ +Returns: Number of different pixels + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OptionTypeDefaultDescriptionHint
thresholdnumber0.1Color difference threshold (0-1)Lower values = more sensitive. 0.05 for strict comparison, 0.2+ for loose comparison
alphanumber0.1Background image opacityControls how faded unchanged pixels appear in diff output
aaColor[number, number, number][255,255,0]Anti-aliasing pixel colorYellow by default. Set to red [255,0,0] to highlight anti-aliasing
diffColor[number, number, number][255,0,0]Different pixel colorRed by default. Use contrasting colors for better visibility
diffColorAlt[number, number, number]-Alternative color for dark differencesHelps distinguish light vs dark pixel changes
includeAAbooleanfalseInclude anti-aliasing in diff countSet true to count anti-aliasing pixels as actual differences
diffMaskbooleanfalseOutput only differences (transparent background)Useful for creating overlay masks or highlighting changes only
fastBufferCheckbooleantrueUse fast buffer check using Buffer.compareSet to false if images are processed differently, but look similiar
+ +## Usage + +```typescript +import { diff } from '@blazediff/core'; + +const diffCount = diff( + image1.data, + image2.data, + outputData, + width, + height, + { + threshold: 0.1, + alpha: 0.1, + aaColor: [255, 255, 0], + diffColor: [255, 0, 0], + includeAA: false, + diffMask: false, + fastBufferCheck: true, + } +); +``` + +## Algorithm + +BlazeDiff uses a sophisticated multi-stage approach for high-performance image comparison: + +1. **Block-Based Pre-filtering**: Divides images into adaptive blocks and uses 32-bit integer comparison to quickly identify unchanged regions +2. **YIQ Color Space**: Converts RGB to YIQ color space for perceptually accurate color difference measurement +3. **Anti-Aliasing Detection**: Implements the Vysniauskas (2009) algorithm to distinguish anti-aliasing artifacts from real differences +4. **Optimized Memory Access**: Zero-allocation design with cache-friendly memory patterns + +See [FORMULA.md](./FORMULA.md) for detailed mathematical formulas and algorithm explanation. + +## Performance + +> **Median: 82%** | Arithmetic mean: 65% | Weighted average: 42% + +Benchmarked against pixelmatch across various image sizes (50 iterations, 5 warmup): + +| Benchmark | Pixelmatch | BlazeDiff | Improvement | +|-----------|------------|-----------|-------------| +| 4k/1 (5600×3200) | 302ms | 212ms | **30%** | +| 4k/1 (identical) | 19ms | 2.4ms | **88%** | +| page/1 (3598×16384) | 332ms | 93ms | **72%** | +| page/1 (identical) | 63ms | 7.7ms | **88%** | +| small images | 0.4-4ms | 0.1-2ms | **55-90%** | + +The block-based optimization provides the most benefit on identical images (~88% faster) and images with large unchanged regions. + +## References + +- **Algorithm Documentation**: [FORMULA.md](./FORMULA.md) - Complete mathematical foundation and formulas +- **YIQ Color Space**: [Kotsarenko & Ramos (2009)](https://doaj.org/article/b2e3b5088ba943eebd9af2927fef08ad) - "Measuring perceived color difference using YIQ NTSC transmission color space" +- **Anti-Aliasing Detection**: [Vysniauskas (2009)](https://www.researchgate.net/publication/234073157_Anti-aliased_Pixel_and_Intensity_Slope_Detector) - "Anti-aliased Pixel and Intensity Slope Detector" +- **Inspiration**: [pixelmatch](https://github.com/mapbox/pixelmatch) - Original pixel-by-pixel diff algorithm diff --git a/llama.cpp/tools/ui/node_modules/@braintree/sanitize-url/.github/pull_request_template.md b/llama.cpp/tools/ui/node_modules/@braintree/sanitize-url/.github/pull_request_template.md new file mode 100644 index 0000000000000000000000000000000000000000..6f5ec50ee4e3899642160a303d1758f4131d5dab --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@braintree/sanitize-url/.github/pull_request_template.md @@ -0,0 +1,17 @@ +# Summary of changes + +- + +## Checklist + +- [ ] Added a changelog entry +- [ ] Relevant test coverage +- [ ] Tested and confirmed flows affected by this change are functioning as expected + +## Authors + +> List GitHub usernames for everyone who contributed to this pull request. + +### Reviewers + +@braintree/team-sdk-js diff --git a/llama.cpp/tools/ui/node_modules/@braintree/sanitize-url/CHANGELOG.md b/llama.cpp/tools/ui/node_modules/@braintree/sanitize-url/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..ce947e1047b3fe38ee05038a1ac1d0276fd2cb04 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@braintree/sanitize-url/CHANGELOG.md @@ -0,0 +1,151 @@ +# CHANGELOG + +## 7.1.2 + +- Update dependencies + - @types/jest to 30.0.0 + - @vitest/coverage-v8 to 4.0.16 + - chai to 6.2.2 + - eslint-plugin-prettier to 5.5.4 + - happy-dom to 20.0.11 + - prettier to 3.7.4 + - typescript to 5.9.3 + - vitest to 4.0.16 +- Update Node to v24 +- Add @types/node 24.0.0 + +## 7.1.1 + +- DevDependency Changes + - happy-dom to 15.11.6 + +- Update (sub-)dependencies + - cross-spawn to 7.0.6 + - micromatch to 4.0.8 + - vite to 4.5.5 + +## 7.1.0 + +- Updated to handle back-slashes + +## 7.0.4 + +- Updates get-func-name to 2.0.2 + +## 7.0.3 + +- Dependencies + - Update braces to 3.0.3 + +## 7.0.2 + +- Improve sanitization of whitespace escapes + +## 7.0.1 + +- Improve sanitization of HTML entities + +## 7.0.0 + +- Move constant declarations from index file to `constants.ts` file +- Update to node v18 + +- Dev Dependency Updates + - Update to TypeScript 5 + - Other minor dependency updates + +## 6.0.4 + +- Add additional null byte sanitization prior to html decoding (#48) + +## 6.0.3 + +- Add null check to beginning of `sanitizeUrl` function ([#54](https://github.com/braintree/sanitize-url/issues/54)) + +## 6.0.2 + +- Fix issue where urls in the form `https://example.com /something` were not properly sanitized + +## 6.0.1 + +- Fix issue where urls in the form `javascript:alert('xss');` were not properly sanitized +- Fix issue where urls in the form `javasc ript:alert('XSS');` were not properly sanitized + +## 6.0.0 + +- BREAKING CHANGES + - Decode HTML characters automatically that would result in an XSS vulnerability when rendering links via a server rendered HTML file + +```js +// decodes to javacript:alert('XSS') +const vulnerableUrl = + "javascript:alert('XSS')"; + +sanitizeUrl(vulnerableUrl); // 'about:blank' + +const okUrl = "https://example.com/" + vulnerableUrl; + +// since the javascript bit is in the path instead of the protocol +// this is successfully sanitized +sanitizeUrl(okUrl); // 'https://example.com/javascript:alert('XSS'); +``` + +## 5.0.2 + +- Fix issue where certain invisible white space characters were not being sanitized (#35) + +## 5.0.1 + +- Fix issue where certain safe characters were being filtered out (#31 thanks @akirchmyer) + +## 5.0.0 + +- BREAKING CHANGES + - Sanitize vbscript urls (thanks @vicnicius) + +## 4.1.1 + +- Fixup path to type declaration (closes #25) + +## 4.1.0 + +- Add typescript types + +## 4.0.1 + +- Fix issue where urls with accented characters were incorrectly sanitized + +## 4.0.0 + +- BREAKING CHANGES + - Protocol-less urls (ie: `www.example.com`) will be sanitised and passed on instead of sending out `about:blank` (Thanks @chawes13 #18) + +## 3.1.0 + +- Trim whitespace from urls + +## 3.0.0 + +- BREAKING CHANGES + - Replace blank strings with about:blank + - Replace null values with about:blank + +## 2.1.0 + +- Allow relative urls to be sanitized + +## 2.0.2 + +- Sanitize malicious URLs that begin with `\s` + +## 2.0.1 + +- Sanitize malicious URLs that begin with %20 + +## 2.0.0 + +- sanitize data: urls + +## 1.0.0 + +- sanitize javascript: urls diff --git a/llama.cpp/tools/ui/node_modules/@braintree/sanitize-url/README.md b/llama.cpp/tools/ui/node_modules/@braintree/sanitize-url/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e64b1874f7698f7fdf79a94b664759ebe3d941c4 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@braintree/sanitize-url/README.md @@ -0,0 +1,39 @@ +# sanitize-url + +## Installation + +```sh +npm install -S @braintree/sanitize-url +``` + +## Usage + +```js +var sanitizeUrl = require("@braintree/sanitize-url").sanitizeUrl; + +sanitizeUrl("https://example.com"); // 'https://example.com' +sanitizeUrl("http://example.com"); // 'http://example.com' +sanitizeUrl("www.example.com"); // 'www.example.com' +sanitizeUrl("mailto:hello@example.com"); // 'mailto:hello@example.com' +sanitizeUrl( + "https://example.com", +); // https://example.com + +sanitizeUrl("javascript:alert(document.domain)"); // 'about:blank' +sanitizeUrl("jAvasCrIPT:alert(document.domain)"); // 'about:blank' +sanitizeUrl(decodeURIComponent("JaVaScRiP%0at:alert(document.domain)")); // 'about:blank' +// HTML encoded javascript:alert('XSS') +sanitizeUrl( + "javascript:alert('XSS')", +); // 'about:blank' +``` + +## Testing + +This library uses [Vitest](https://vitest.dev/). All testing dependencies +will be installed upon `npm install` and the test suite can be executed with +`npm test`. Running the test suite will also run lint checks upon exiting. + + npm test + +To generate a coverage report, use `npm run coverage`. diff --git a/llama.cpp/tools/ui/node_modules/@canvas/image-data/readme.md b/llama.cpp/tools/ui/node_modules/@canvas/image-data/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..68abe5ca3e05baff6adb553e11f693e058d5421d --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@canvas/image-data/readme.md @@ -0,0 +1,30 @@ +# ImageData + +An `ImageData` implementation for usage outside of the browser. + +## Installation + +```sh +npm install --save @canvas/image-data +``` + +## Usage + +```js +const ImageData = require('@canvas/image-data') + +const img = new ImageData(2, 4) + +console.log(img.width) +//=> 2 + +console.log(img.height) +//=> 4 + +console.log(img.data) +//=> Uint8ClampedArray [ 0, 0, 0, 0, 0, ... ] +``` + +## Hacking + +The tests are made to be run against both this implementation and Chrome's implementation to make sure that we behave in the same way. You can run the tests in Chrome by spinning up a local web server and open `test.html`. diff --git a/llama.cpp/tools/ui/node_modules/@chromatic-com/storybook/README.md b/llama.cpp/tools/ui/node_modules/@chromatic-com/storybook/README.md new file mode 100644 index 0000000000000000000000000000000000000000..40ab2babb577adc5c0b93edf0dc5bbf1a6d70fc8 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@chromatic-com/storybook/README.md @@ -0,0 +1,69 @@ +# Visual Tests Addon for Storybook + +Run visual tests on your stories and compare changes with the latest baselines to catch UI regressions early in development. Supports multiple viewports, themes, and browsers. + +## Prerequisites + +- Chromatic [account configured](https://www.chromatic.com/docs/setup#sign-up) with access to a project +- Storybook 7.6 or later + +## Getting Started + +Run the following command to install the addon and automatically configure it for your project via Storybook's CLI: + +```shell +npx storybook add @chromatic-com/storybook +``` + +Start Storybook and navigate to the Visual Tests panel to run your first visual test with Chromatic! + +## Configuration + +By default, the addon offers zero-config support to run visual tests with Storybook and Chromatic. However, if you need, you can customize it by providing a few options. See the [Chromatic documentation](https://www.chromatic.com/docs/visual-tests-addon/) for more information on configuring and using it with your Storybook. + +## Getting Help + +If you have any questions or need help with the addon, please get in touch with the Chromatic team. [Sign in](https://www.chromatic.com/start) to your Chromatic account and click the chat icon in the bottom right corner of the screen to start a conversation with us. + +## Contributing + +We welcome contributions! If you're a maintainer, refer to the following [instructions](./Development.md) to set up your development environment with Chromatic. + +### Updating the GraphQL schema + +The addon uses the Chromatic public GraphQL API. We rely on its schema to generate type definitions. The schema needs to be manually updated whenever it changes. +To update, take https://github.com/chromaui/chromatic/blob/main/lib/schema/public-schema.graphql and save it under `src/gql/public-schema.graphql`. + +## Troubleshooting + +### Running Storybook with the addon enabled throws an error + +When installed, running Storybook may lead to the following error: + +```shell +const stringWidth = require('string-width'); + +Error [ERR_REQUIRE_ESM]: require() of ES Module /my-project/node_modules/string-width/index.js is not supported. +``` + +This is a [known issue](https://github.com/storybookjs/storybook/issues/22431#issuecomment-1630086092) when using an older version of the Yarn package manager (e.g., version 1.x). To solve this issue, you can [upgrade](https://yarnpkg.com/migration/guide) to the latest stable version. However, if you cannot upgrade, adjust your `package.json` file and provide a resolution field to enable the Yarn package manager to install the correct dependencies. In doing so, you may be required to delete your `node_modules` directory and `yarn.lock` file before installing the dependencies again. + +```json + "resolutions": { + "jackspeak": "2.1.1" + } +``` + +Alternatively, you could use a different package manager ([npm](https://www.npmjs.com/), [pnpm](https://pnpm.io/installation)). + +## Version compatibility + +| Addon Version | Storybook Version | +| ------------- | ----------------- | +| `^4.0.0` | `^9.0.0` | +| `^3.0.0` | `^8.2.0` | +| `^2.0.2` | `8.0.0` - `8.1.x` | + +### License + +[MIT](https://github.com/storybookjs/addon-coverage/blob/main/LICENSE) diff --git a/llama.cpp/tools/ui/node_modules/@emnapi/core/README.md b/llama.cpp/tools/ui/node_modules/@emnapi/core/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c98dddca6ea7a4f6665931a1bc713691cca2f34c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@emnapi/core/README.md @@ -0,0 +1 @@ +See [https://github.com/toyobayashi/emnapi](https://github.com/toyobayashi/emnapi) diff --git a/llama.cpp/tools/ui/node_modules/@emnapi/runtime/README.md b/llama.cpp/tools/ui/node_modules/@emnapi/runtime/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c98dddca6ea7a4f6665931a1bc713691cca2f34c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@emnapi/runtime/README.md @@ -0,0 +1 @@ +See [https://github.com/toyobayashi/emnapi](https://github.com/toyobayashi/emnapi) diff --git a/llama.cpp/tools/ui/node_modules/@emnapi/wasi-threads/README.md b/llama.cpp/tools/ui/node_modules/@emnapi/wasi-threads/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d7ab9356061d7fe7754e070e512adcf868c7da57 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@emnapi/wasi-threads/README.md @@ -0,0 +1,203 @@ +# @emnapi/wasi-threads + +This package makes [wasi-threads proposal](https://github.com/WebAssembly/wasi-threads) based WASI modules work in Node.js and browser. + +## Quick Start + +`index.html` + +```html + + + +``` + +If your application will block browser main thread (for example `pthread_join`), please run it in worker instead. + +```html + +``` + +`index.js` + +```js +const ENVIRONMENT_IS_NODE = + typeof process === 'object' && process !== null && + typeof process.versions === 'object' && process.versions !== null && + typeof process.versions.node === 'string'; + +(function (main) { + if (ENVIRONMENT_IS_NODE) { + main(require) + } else { + if (typeof importScripts === 'function') { + importScripts('./node_modules/@tybys/wasm-util/dist/wasm-util.js') + importScripts('./node_modules/@emnapi/wasi-threads/dist/wasi-threads.js') + } + const nodeWasi = { WASI: globalThis.wasmUtil.WASI } + const nodeWorkerThreads = { + Worker: globalThis.Worker + } + const _require = function (request) { + if (request === 'node:wasi' || request === 'wasi') return nodeWasi + if (request === 'node:worker_threads' || request === 'worker_threads') return nodeWorkerThreads + if (request === '@emnapi/wasi-threads') return globalThis.wasiThreads + throw new Error('Can not find module: ' + request) + } + main(_require) + } +})(async function (require) { + const { WASI } = require('wasi') + const { Worker } = require('worker_threads') + const { WASIThreads } = require('@emnapi/wasi-threads') + + const wasi = new WASI({ + version: 'preview1' + }) + const wasiThreads = new WASIThreads({ + wasi, + + /** + * avoid Atomics.wait() deadlock during thread creation in browser + * see https://emscripten.org/docs/tools_reference/settings_reference.html#pthread-pool-size + */ + reuseWorker: ENVIRONMENT_IS_NODE + ? false + : { + size: 4 /** greater than actual needs (2) */, + strict: true + }, + + /** + * Synchronous thread creation + * pthread_create will not return until thread worker actually starts + */ + waitThreadStart: typeof window === 'undefined' ? 1000 : false, + + onCreateWorker: () => { + return new Worker('./worker.js', { + execArgv: ['--experimental-wasi-unstable-preview1'] + }) + } + }) + const memory = new WebAssembly.Memory({ + initial: 16777216 / 65536, + maximum: 2147483648 / 65536, + shared: true + }) + let input + const file = 'path/to/your/wasi-module.wasm' + try { + input = require('fs').readFileSync(require('path').join(__dirname, file)) + } catch (err) { + const response = await fetch(file) + input = await response.arrayBuffer() + } + let { module, instance } = await WebAssembly.instantiate(input, { + env: { memory }, + wasi_snapshot_preview1: wasi.wasiImport, + ...wasiThreads.getImportObject() + }) + + wasiThreads.setup(instance, module, memory) + await wasiThreads.preloadWorkers() + + if (typeof instance.exports._start === 'function') { + return wasi.start(instance) + } else { + wasi.initialize(instance) + // instance.exports.exported_wasm_function() + } +}) +``` + +`worker.js` + +```js +(function (main) { + const ENVIRONMENT_IS_NODE = + typeof process === 'object' && process !== null && + typeof process.versions === 'object' && process.versions !== null && + typeof process.versions.node === 'string' + + if (ENVIRONMENT_IS_NODE) { + const _require = function (request) { + return require(request) + } + + const _init = function () { + const nodeWorkerThreads = require('worker_threads') + const parentPort = nodeWorkerThreads.parentPort + + parentPort.on('message', (data) => { + globalThis.onmessage({ data }) + }) + + Object.assign(globalThis, { + self: globalThis, + require, + Worker: nodeWorkerThreads.Worker, + importScripts: function (f) { + (0, eval)(require('fs').readFileSync(f, 'utf8') + '//# sourceURL=' + f) + }, + postMessage: function (msg) { + parentPort.postMessage(msg) + } + }) + } + + main(_require, _init) + } else { + importScripts('./node_modules/@tybys/wasm-util/dist/wasm-util.js') + importScripts('./node_modules/@emnapi/wasi-threads/dist/wasi-threads.js') + + const nodeWasi = { WASI: globalThis.wasmUtil.WASI } + const _require = function (request) { + if (request === '@emnapi/wasi-threads') return globalThis.wasiThreads + if (request === 'node:wasi' || request === 'wasi') return nodeWasi + throw new Error('Can not find module: ' + request) + } + const _init = function () {} + main(_require, _init) + } +})(function main (require, init) { + init() + + const { WASI } = require('wasi') + const { ThreadMessageHandler, WASIThreads } = require('@emnapi/wasi-threads') + + const handler = new ThreadMessageHandler({ + async onLoad ({ wasmModule, wasmMemory }) { + const wasi = new WASI({ + version: 'preview1' + }) + + const wasiThreads = new WASIThreads({ + wasi, + childThread: true + }) + + const originalInstance = await WebAssembly.instantiate(wasmModule, { + env: { + memory: wasmMemory, + }, + wasi_snapshot_preview1: wasi.wasiImport, + ...wasiThreads.getImportObject() + }) + + // must call `initialize` instead of `start` in child thread + const instance = wasiThreads.initialize(originalInstance, wasmModule, wasmMemory) + + return { module: wasmModule, instance } + } + }) + + globalThis.onmessage = function (e) { + handler.handle(e) + // handle other messages + } +}) +``` diff --git a/llama.cpp/tools/ui/node_modules/@esbuild/linux-arm64/README.md b/llama.cpp/tools/ui/node_modules/@esbuild/linux-arm64/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0d52dd1fc04b7de19884895cdf1dab7c6d62a9a4 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@esbuild/linux-arm64/README.md @@ -0,0 +1,3 @@ +# esbuild + +This is the Linux ARM 64-bit binary for esbuild, a JavaScript bundler and minifier. See https://github.com/evanw/esbuild for details. diff --git a/llama.cpp/tools/ui/node_modules/@eslint-community/eslint-utils/README.md b/llama.cpp/tools/ui/node_modules/@eslint-community/eslint-utils/README.md new file mode 100644 index 0000000000000000000000000000000000000000..257954c9ba9f100a2065cabb512cc6045b3c604b --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint-community/eslint-utils/README.md @@ -0,0 +1,37 @@ +# @eslint-community/eslint-utils + +[![npm version](https://img.shields.io/npm/v/@eslint-community/eslint-utils.svg)](https://www.npmjs.com/package/@eslint-community/eslint-utils) +[![Downloads/month](https://img.shields.io/npm/dm/@eslint-community/eslint-utils.svg)](http://www.npmtrends.com/@eslint-community/eslint-utils) +[![Build Status](https://github.com/eslint-community/eslint-utils/workflows/CI/badge.svg)](https://github.com/eslint-community/eslint-utils/actions) +[![Coverage Status](https://codecov.io/gh/eslint-community/eslint-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/eslint-community/eslint-utils) + +## 🏁 Goal + +This package provides utility functions and classes for make ESLint custom rules. + +For examples: + +- [`getStaticValue`](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue) evaluates static value on AST. +- [`ReferenceTracker`](https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring. + +## 📖 Usage + +See [documentation](https://eslint-community.github.io/eslint-utils). + +## 📰 Changelog + +See [releases](https://github.com/eslint-community/eslint-utils/releases). + +## ❤️ Contributing + +Welcome contributing! + +Please use GitHub's Issues/PRs. + +### Development Tools + +- `npm run test-coverage` runs tests and measures coverage. +- `npm run clean` removes the coverage result of `npm run test-coverage` command. +- `npm run coverage` shows the coverage result of the last `npm run test-coverage` command. +- `npm run lint` runs ESLint. +- `npm run watch` runs tests on each file change. diff --git a/llama.cpp/tools/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/README.md b/llama.cpp/tools/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cab81032030e33e6011feccc4701fbd0d56b47da --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys/README.md @@ -0,0 +1,105 @@ +# eslint-visitor-keys + +[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys) +[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys) +[![Build Status](https://github.com/eslint/eslint-visitor-keys/workflows/CI/badge.svg)](https://github.com/eslint/eslint-visitor-keys/actions) + +Constants and utilities about visitor keys to traverse AST. + +## 💿 Installation + +Use [npm] to install. + +```bash +$ npm install eslint-visitor-keys +``` + +### Requirements + +- [Node.js] `^12.22.0`, `^14.17.0`, or `>=16.0.0` + + +## 📖 Usage + +To use in an ESM file: + +```js +import * as evk from "eslint-visitor-keys" +``` + +To use in a CommonJS file: + +```js +const evk = require("eslint-visitor-keys") +``` + +### evk.KEYS + +> type: `{ [type: string]: string[] | undefined }` + +Visitor keys. This keys are frozen. + +This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes. + +For example: + +``` +console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"] +``` + +### evk.getKeys(node) + +> type: `(node: object) => string[]` + +Get the visitor keys of a given AST node. + +This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`. + +This will be used to traverse unknown nodes. + +For example: + +```js +const node = { + type: "AssignmentExpression", + left: { type: "Identifier", name: "foo" }, + right: { type: "Literal", value: 0 } +} +console.log(evk.getKeys(node)) // → ["type", "left", "right"] +``` + +### evk.unionWith(additionalKeys) + +> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }` + +Make the union set with `evk.KEYS` and the given keys. + +- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that. +- It removes duplicated keys as keeping the first one. + +For example: + +```js +console.log(evk.unionWith({ + MethodDefinition: ["decorators"] +})) // → { ..., MethodDefinition: ["decorators", "key", "value"], ... } +``` + +## 📰 Change log + +See [GitHub releases](https://github.com/eslint/eslint-visitor-keys/releases). + +## 🍻 Contributing + +Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/). + +### Development commands + +- `npm test` runs tests and measures code coverage. +- `npm run lint` checks source codes with ESLint. +- `npm run test:open-coverage` opens the code coverage report of the previous test with your default browser. + + +[npm]: https://www.npmjs.com/ +[Node.js]: https://nodejs.org/ +[ESTree]: https://github.com/estree/estree diff --git a/llama.cpp/tools/ui/node_modules/@eslint-community/regexpp/README.md b/llama.cpp/tools/ui/node_modules/@eslint-community/regexpp/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9728af519c62be6d82c73fabd3f72c7c34bd86a0 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint-community/regexpp/README.md @@ -0,0 +1,177 @@ +# @eslint-community/regexpp + +[![npm version](https://img.shields.io/npm/v/@eslint-community/regexpp.svg)](https://www.npmjs.com/package/@eslint-community/regexpp) +[![Downloads/month](https://img.shields.io/npm/dm/@eslint-community/regexpp.svg)](http://www.npmtrends.com/@eslint-community/regexpp) +[![Build Status](https://github.com/eslint-community/regexpp/workflows/CI/badge.svg)](https://github.com/eslint-community/regexpp/actions) +[![codecov](https://codecov.io/gh/eslint-community/regexpp/branch/main/graph/badge.svg)](https://codecov.io/gh/eslint-community/regexpp) + +A regular expression parser for ECMAScript. + +## 💿 Installation + +```bash +$ npm install @eslint-community/regexpp +``` + +- require Node@^12.0.0 || ^14.0.0 || >=16.0.0. + +## 📖 Usage + +```ts +import { + AST, + RegExpParser, + RegExpValidator, + RegExpVisitor, + parseRegExpLiteral, + validateRegExpLiteral, + visitRegExpAST +} from "@eslint-community/regexpp" +``` + +### parseRegExpLiteral(source, options?) + +Parse a given regular expression literal then make AST object. + +This is equivalent to `new RegExpParser(options).parseLiteral(source)`. + +- **Parameters:** + - `source` (`string | RegExp`) The source code to parse. + - `options?` ([`RegExpParser.Options`]) The options to parse. +- **Return:** + - The AST of the regular expression. + +### validateRegExpLiteral(source, options?) + +Validate a given regular expression literal. + +This is equivalent to `new RegExpValidator(options).validateLiteral(source)`. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `options?` ([`RegExpValidator.Options`]) The options to validate. + +### visitRegExpAST(ast, handlers) + +Visit each node of a given AST. + +This is equivalent to `new RegExpVisitor(handlers).visit(ast)`. + +- **Parameters:** + - `ast` ([`AST.Node`]) The AST to visit. + - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks. + +### RegExpParser + +#### new RegExpParser(options?) + +- **Parameters:** + - `options?` ([`RegExpParser.Options`]) The options to parse. + +#### parser.parseLiteral(source, start?, end?) + +Parse a regular expression literal. + +- **Parameters:** + - `source` (`string`) The source code to parse. E.g. `"/abc/g"`. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. +- **Return:** + - The AST of the regular expression. + +#### parser.parsePattern(source, start?, end?, flags?) + +Parse a regular expression pattern. + +- **Parameters:** + - `source` (`string`) The source code to parse. E.g. `"abc"`. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + - `flags?` (`{ unicode?: boolean, unicodeSets?: boolean }`) The flags to enable Unicode mode, and Unicode Set mode. +- **Return:** + - The AST of the regular expression pattern. + +#### parser.parseFlags(source, start?, end?) + +Parse a regular expression flags. + +- **Parameters:** + - `source` (`string`) The source code to parse. E.g. `"gim"`. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. +- **Return:** + - The AST of the regular expression flags. + +### RegExpValidator + +#### new RegExpValidator(options) + +- **Parameters:** + - `options` ([`RegExpValidator.Options`]) The options to validate. + +#### validator.validateLiteral(source, start, end) + +Validate a regular expression literal. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + +#### validator.validatePattern(source, start, end, flags) + +Validate a regular expression pattern. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + - `flags?` (`{ unicode?: boolean, unicodeSets?: boolean }`) The flags to enable Unicode mode, and Unicode Set mode. + +#### validator.validateFlags(source, start, end) + +Validate a regular expression flags. + +- **Parameters:** + - `source` (`string`) The source code to validate. + - `start?` (`number`) The start index in the source code. Default is `0`. + - `end?` (`number`) The end index in the source code. Default is `source.length`. + +### RegExpVisitor + +#### new RegExpVisitor(handlers) + +- **Parameters:** + - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks. + +#### visitor.visit(ast) + +Validate a regular expression literal. + +- **Parameters:** + - `ast` ([`AST.Node`]) The AST to visit. + +## 📰 Changelog + +- [GitHub Releases](https://github.com/eslint-community/regexpp/releases) + +## 🍻 Contributing + +Welcome contributing! + +Please use GitHub's Issues/PRs. + +### Development Tools + +- `npm test` runs tests and measures coverage. +- `npm run build` compiles TypeScript source code to `index.js`, `index.js.map`, and `index.d.ts`. +- `npm run clean` removes the temporary files which are created by `npm test` and `npm run build`. +- `npm run lint` runs ESLint. +- `npm run update:test` updates test fixtures. +- `npm run update:ids` updates `src/unicode/ids.ts`. +- `npm run watch` runs tests with `--watch` option. + +[`AST.Node`]: src/ast.ts#L4 +[`RegExpParser.Options`]: src/parser.ts#L743 +[`RegExpValidator.Options`]: src/validator.ts#L220 +[`RegExpVisitor.Handlers`]: src/visitor.ts#L291 diff --git a/llama.cpp/tools/ui/node_modules/@eslint/compat/README.md b/llama.cpp/tools/ui/node_modules/@eslint/compat/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1995e2526ce7d638b84363cfa5688165f9f6cf17 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/compat/README.md @@ -0,0 +1,214 @@ +# ESLint Compatibility Utilities + +## Overview + +This packages contains functions that allow you to wrap existing ESLint rules, plugins, and configurations that were intended for use with ESLint v8.x to allow them to work as-is in ESLint v9.x. + +**Note:** All plugins are not guaranteed to work in ESLint v9.x. This package fixes the most common issues but can't fix everything. + +## Installation + +For Node.js and compatible runtimes: + +```shell +npm install @eslint/compat -D +# or +yarn add @eslint/compat -D +# or +pnpm install @eslint/compat -D +# or +bun add @eslint/compat -D +``` + +For Deno: + +```shell +deno add @eslint/compat +``` + +## Usage + +This package exports the following functions in both ESM and CommonJS format: + +- `fixupRule(rule)` - wraps the given rule in a compatibility layer and returns the result +- `fixupPluginRules(plugin)` - wraps each rule in the given plugin using `fixupRule()` and returns a new object that represents the plugin with the fixed-up rules +- `fixupConfigRules(configs)` - wraps all plugins found in an array of config objects using `fixupPluginRules()` +- `includeIgnoreFile(path)` - reads an ignore file (like `.gitignore`) and converts the patterns into the correct format for the config file + +### Fixing Rules + +If you have a rule that you'd like to make compatible with ESLint v9.x, you can do so using the `fixupRule()` function: + +```js +// ESM example +import { fixupRule } from "@eslint/compat"; + +// Step 1: Import your rule +import myRule from "./local-rule.js"; + +// Step 2: Create backwards-compatible rule +const compatRule = fixupRule(myRule); + +// Step 3 (optional): Export fixed rule +export default compatRule; +``` + +Or in CommonJS: + +```js +// CommonJS example +const { fixupRule } = require("@eslint/compat"); + +// Step 1: Import your rule +const myRule = require("./local-rule.js"); + +// Step 2: Create backwards-compatible rule +const compatRule = fixupRule(myRule); + +// Step 3 (optional): Export fixed rule +module.exports = compatRule; +``` + +### Fixing Plugins + +If you are using a plugin in your `eslint.config.js` that is not yet compatible with ESLint 9.x, you can wrap it using the `fixupPluginRules()` function: + +```js +// eslint.config.js - ESM example +import { defineConfig } from "eslint/config"; +import { fixupPluginRules } from "@eslint/compat"; +import somePlugin from "eslint-plugin-some-plugin"; + +export default defineConfig([ + { + plugins: { + // insert the fixed plugin instead of the original + somePlugin: fixupPluginRules(somePlugin), + }, + rules: { + "somePlugin/rule-name": "error", + }, + }, +]); +``` + +Or in CommonJS: + +```js +// eslint.config.js - CommonJS example +const { defineConfig } = require("eslint/config"); +const { fixupPluginRules } = require("@eslint/compat"); +const somePlugin = require("eslint-plugin-some-plugin"); + +module.exports = defineConfig([ + { + plugins: { + // insert the fixed plugin instead of the original + somePlugin: fixupPluginRules(somePlugin), + }, + rules: { + "somePlugin/rule-name": "error", + }, + }, +]); +``` + +### Fixing Configs + +If you are importing other configs into your `eslint.config.js` that use plugins that are not yet compatible with ESLint 9.x, you can wrap the entire array or a single object using the `fixupConfigRules()` function: + +```js +// eslint.config.js - ESM example +import { defineConfig } from "eslint/config"; +import { fixupConfigRules } from "@eslint/compat"; +import someConfig from "eslint-config-some-config"; + +export default defineConfig([ + ...fixupConfigRules(someConfig), + { + // your overrides + }, +]); +``` + +Or in CommonJS: + +```js +// eslint.config.js - CommonJS example +const { defineConfig } = require("eslint/config"); +const { fixupConfigRules } = require("@eslint/compat"); +const someConfig = require("eslint-config-some-config"); + +module.exports = defineConfig([ + ...fixupConfigRules(someConfig), + { + // your overrides + }, +]); +``` + +### Including Ignore Files + +If you were using an alternate ignore file in ESLint v8.x, such as using `--ignore-path .gitignore` on the command line, you can include those patterns programmatically in your config file using the `includeIgnoreFile()` function. + +The `includeIgnoreFile()` function also accepts a second optional `name` parameter that allows you to set a custom name for this configuration object. If not specified, it defaults to `"Imported .gitignore patterns"`. For example: + +```js +// eslint.config.js - ESM example +import { defineConfig } from "eslint/config"; +import { includeIgnoreFile } from "@eslint/compat"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; + +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); +const gitignorePath = path.resolve(__dirname, ".gitignore"); + +export default defineConfig([ + includeIgnoreFile(gitignorePath, "Imported .gitignore patterns"), // second argument is optional. + { + // your overrides + }, +]); +``` + +Or in CommonJS: + +```js +// eslint.config.js - CommonJS example +const { defineConfig } = require("eslint/config"); +const { includeIgnoreFile } = require("@eslint/compat"); +const path = require("node:path"); +const gitignorePath = path.resolve(__dirname, ".gitignore"); + +module.exports = defineConfig([ + includeIgnoreFile(gitignorePath, "Imported .gitignore patterns"), // second argument is optional. + { + // your overrides + }, +]); +``` + +**Limitation:** This works without modification when the ignore file is in the same directory as your config file. If the ignore file is in a different directory, you may need to modify the patterns manually. + +## License + +Apache 2.0 + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

Qlty Software trunk.io Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Syntax Cybozu Sentry Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/llama.cpp/tools/ui/node_modules/@eslint/config-array/README.md b/llama.cpp/tools/ui/node_modules/@eslint/config-array/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1d12bbdb44c78c12ad4eafa3c73e905d56fd47e9 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/config-array/README.md @@ -0,0 +1,368 @@ +# Config Array + +## Description + +A config array is a way of managing configurations that are based on glob pattern matching of filenames. Each config array contains the information needed to determine the correct configuration for any file based on the filename. + +**Note:** This is a generic package that can be used outside of ESLint. It contains no ESLint-specific functionality. + +## Installation + +For Node.js and compatible runtimes: + +```shell +npm install @eslint/config-array +# or +yarn add @eslint/config-array +# or +pnpm install @eslint/config-array +# or +bun add @eslint/config-array +``` + +For Deno: + +```shell +deno add @eslint/config-array +``` + +## Background + +The basic idea is that all configuration, including overrides, can be represented by a single array where each item in the array is a config object. Config objects appearing later in the array override config objects appearing earlier in the array. You can calculate a config for a given file by traversing all config objects in the array to find the ones that match the filename. Matching is done by specifying glob patterns in `files` and `ignores` properties on each config object. Here's an example: + +```js +export default [ + // match all JSON files + { + name: "JSON Handler", + files: ["**/*.json"], + handler: jsonHandler, + }, + + // match only package.json + { + name: "package.json Handler", + files: ["package.json"], + handler: packageJsonHandler, + }, +]; +``` + +In this example, there are two config objects: the first matches all JSON files in all directories and the second matches just `package.json` in the base path directory (all the globs are evaluated as relative to a base path that can be specified). When you retrieve a configuration for `foo.json`, only the first config object matches so `handler` is equal to `jsonHandler`; when you retrieve a configuration for `package.json`, `handler` is equal to `packageJsonHandler` (because both config objects match, the second one wins). + +## Usage + +First, import the `ConfigArray` constructor: + +```js +import { ConfigArray } from "@eslint/config-array"; + +// or using CommonJS + +const { ConfigArray } = require("@eslint/config-array"); +``` + +When you create a new instance of `ConfigArray`, you must pass in two arguments: an array of configs and an options object. The array of configs is most likely read in from a configuration file, so here's a typical example: + +```js +const configFilename = path.resolve(process.cwd(), "my.config.js"); +const { default: rawConfigs } = await import(configFilename); +const configs = new ConfigArray(rawConfigs, { + // the path to match filenames from + basePath: process.cwd(), + + // additional items in each config + schema: mySchema, +}); +``` + +This example reads in an object or array from `my.config.js` and passes it into the `ConfigArray` constructor as the first argument. The second argument is an object specifying the `basePath` (the directory in which `my.config.js` is found) and a `schema` to define the additional properties of a config object beyond `files`, `ignores`, `basePath`, and `name`. + +### Specifying a Schema + +The `schema` option is required for you to use additional properties in config objects. The schema is an object that follows the format of an [`ObjectSchema`](https://npmjs.com/package/@eslint/object-schema). The schema specifies both validation and merge rules that the `ConfigArray` instance needs to combine configs when there are multiple matches. Here's an example: + +```js +const configFilename = path.resolve(process.cwd(), "my.config.js"); +const { default: rawConfigs } = await import(configFilename); + +const mySchema = { + + // define the handler key in configs + handler: { + required: true, + merge(a, b) { + if (!b) return a; + if (!a) return b; + }, + validate(value) { + if (typeof value !== "function") { + throw new TypeError("Function expected."); + } + } + } +}; + +const configs = new ConfigArray(rawConfigs, { + + // the path to match filenames from + basePath: process.cwd(), + + // additional item schemas in each config + schema: mySchema, + + // additional config types supported (default: []) + extraConfigTypes: ["array", "function"]; +}); +``` + +### Config Arrays + +Config arrays can be multidimensional, so it's possible for a config array to contain another config array when `extraConfigTypes` contains `"array"`, such as: + +```js +export default [ + // JS config + { + files: ["**/*.js"], + handler: jsHandler, + }, + + // JSON configs + [ + // match all JSON files + { + name: "JSON Handler", + files: ["**/*.json"], + handler: jsonHandler, + }, + + // match only package.json + { + name: "package.json Handler", + files: ["package.json"], + handler: packageJsonHandler, + }, + ], + + // filename must match function + { + files: [filePath => filePath.endsWith(".md")], + handler: markdownHandler, + }, + + // filename must match all patterns in subarray + { + files: [["*.test.*", "*.js"]], + handler: jsTestHandler, + }, + + // filename must not match patterns beginning with ! + { + name: "Non-JS files", + files: ["!*.js"], + settings: { + js: false, + }, + }, + + // specific settings for files inside `src` directory + { + name: "Source files", + basePath: "src", + files: ["**/*"], + settings: { + source: true, + }, + }, +]; +``` + +In this example, the array contains both config objects and a config array. When a config array is normalized (see details below), it is flattened so only config objects remain. However, the order of evaluation remains the same. + +If the `files` array contains a function, then that function is called with the path of the file as it was passed in. The function is expected to return `true` if there is a match and `false` if not. (The `ignores` array can also contain functions.) + +If the `files` array contains an item that is an array of strings and functions, then all patterns must match in order for the config to match. In the preceding examples, both `*.test.*` and `*.js` must match in order for the config object to be used. + +If a pattern in the files array begins with `!` then it excludes that pattern. In the preceding example, any filename that doesn't end with `.js` will automatically get a `settings.js` property set to `false`. + +You can also specify an `ignores` key that will force files matching those patterns to not be included. If the `ignores` key is in a config object without any other keys, then those ignores will always be applied; otherwise those ignores act as exclusions. Here's an example: + +```js +export default [ + + // Always ignored + { + ignores: ["**/.git/**", "**/node_modules/**"] + }, + + // .eslintrc.js file is ignored only when .js file matches + { + files: ["**/*.js"], + ignores: [".eslintrc.js"] + handler: jsHandler + } +]; +``` + +You can use negated patterns in `ignores` to exclude a file that was already ignored, such as: + +```js +export default [ + // Ignore all JSON files except tsconfig.json + { + files: ["**/*"], + ignores: ["**/*.json", "!tsconfig.json"], + }, +]; +``` + +### Config Functions + +Config arrays can also include config functions when `extraConfigTypes` contains `"function"`. A config function accepts a single parameter, `context` (defined by you), and must return either a config object or a config array (it cannot return another function). Config functions allow end users to execute code in the creation of appropriate config objects. Here's an example: + +```js +export default [ + // JS config + { + files: ["**/*.js"], + handler: jsHandler, + }, + + // JSON configs + function (context) { + return [ + // match all JSON files + { + name: context.name + " JSON Handler", + files: ["**/*.json"], + handler: jsonHandler, + }, + + // match only package.json + { + name: context.name + " package.json Handler", + files: ["package.json"], + handler: packageJsonHandler, + }, + ]; + }, +]; +``` + +When a config array is normalized, each function is executed and replaced in the config array with the return value. + +**Note:** Config functions can also be async. + +### Normalizing Config Arrays + +Once a config array has been created and loaded with all of the raw config data, it must be normalized before it can be used. The normalization process goes through and flattens the config array as well as executing all config functions to get their final values. + +To normalize a config array, call the `normalize()` method and pass in a context object: + +```js +await configs.normalize({ + name: "MyApp", +}); +``` + +The `normalize()` method returns a promise, so be sure to use the `await` operator. The config array instance is normalized in-place, so you don't need to create a new variable. + +If you want to disallow async config functions, you can call `normalizeSync()` instead. This method is completely synchronous and does not require using the `await` operator as it does not return a promise: + +```js +await configs.normalizeSync({ + name: "MyApp", +}); +``` + +**Important:** Once a `ConfigArray` is normalized, it cannot be changed further. You can, however, create a new `ConfigArray` and pass in the normalized instance to create an unnormalized copy. + +### Getting Config for a File + +To get the config for a file, use the `getConfig()` method on a normalized config array and pass in the filename to get a config for: + +```js +// pass in filename +const fileConfig = configs.getConfig( + path.resolve(process.cwd(), "package.json"), +); +``` + +The config array always returns an object, even if there are no configs matching the given filename. You can then inspect the returned config object to determine how to proceed. + +A few things to keep in mind: + +- If a filename is not an absolute path, it will be resolved relative to the base path directory. +- The returned config object never has `files`, `ignores`, `basePath`, or `name` properties; the only properties on the object will be the other configuration options specified. +- The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation. +- A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own). Any config with a `files` key entry that is `*` or ends with `/**` or `/*` will only be applied if another entry in the same `files` key matches or another config matches. + +## Determining Ignored Paths + +You can determine if a file is ignored by using the `isFileIgnored()` method and passing in the path of any file, as in this example: + +```js +const ignored = configs.isFileIgnored("/foo/bar/baz.txt"); +``` + +A file is considered ignored if any of the following is true: + +- **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/a.js` is considered ignored. +- **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/baz/a.js` is considered ignored. +- **It matches an ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +- **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +- **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored. + +For directories, use the `isDirectoryIgnored()` method and pass in the path of any directory, as in this example: + +```js +const ignored = configs.isDirectoryIgnored("/foo/bar/"); +``` + +A directory is considered ignored if any of the following is true: + +- **It's parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/baz` is considered ignored. +- **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/bar/baz/a.js` is considered ignored. +- **It matches and ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +- **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored. +- **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored. + +**Important:** A pattern such as `foo/**` means that `foo` and `foo/` are _not_ ignored whereas `foo/bar` is ignored. If you want to ignore `foo` and all of its subdirectories, use the pattern `foo` or `foo/` in `ignores`. + +## Caching Mechanisms + +Each `ConfigArray` aggressively caches configuration objects to avoid unnecessary work. This caching occurs in two ways: + +1. **File-based Caching.** For each filename that is passed into a method, the resulting config is cached against that filename so you're always guaranteed to get the same object returned from `getConfig()` whenever you pass the same filename in. +2. **Index-based Caching.** Whenever a config is calculated, the config elements that were used to create the config are also cached. So if a given filename matches elements 1, 5, and 7, the resulting config is cached with a key of `1,5,7`. That way, if another file is passed that matches the same config elements, the result is already known and doesn't have to be recalculated. That means two files that match all the same elements will return the same config from `getConfig()`. + +## Acknowledgements + +The design of this project was influenced by feedback on the ESLint RFC, and incorporates ideas from: + +- Teddy Katz (@not-an-aardvark) +- Toru Nagashima (@mysticatea) +- Kai Cataldo (@kaicataldo) + +## License + +Apache 2.0 + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

Qlty Software trunk.io Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Syntax Cybozu Sentry Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/llama.cpp/tools/ui/node_modules/@eslint/config-helpers/README.md b/llama.cpp/tools/ui/node_modules/@eslint/config-helpers/README.md new file mode 100644 index 0000000000000000000000000000000000000000..dab57af0bdc0d9883340a45e8c4376bfa0cabf0c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/config-helpers/README.md @@ -0,0 +1,97 @@ +# @eslint/config-helpers + +## Description + +Helper utilities for creating ESLint configuration. + +## Installation + +For Node.js and compatible runtimes: + +```shell +npm install @eslint/config-helpers +# or +yarn add @eslint/config-helpers +# or +pnpm install @eslint/config-helpers +# or +bun add @eslint/config-helpers +``` + +For Deno: + +```shell +deno add @eslint/config-helpers +``` + +## Usage + +### `defineConfig()` + +The `defineConfig()` function allows you to specify an ESLint configuration with full type checking and additional capabilities, such as `extends`. Here's an example: + +```js +// eslint.config.js +import { defineConfig } from "@eslint/config-helpers"; +import js from "@eslint/js"; + +export default defineConfig([ + { + files: ["src/**/*.js"], + plugins: { js }, + extends: ["js/recommended"], + rules: { + semi: "error", + "prefer-const": "error", + }, + }, + { + files: ["test/**/*.js"], + rules: { + "no-console": "off", + }, + }, +]); +``` + +### `globalIgnores()` + +The `globalIgnores()` function allows you to specify patterns for files and directories that should be globally ignored by ESLint. This is useful for excluding files that you don't want to lint, such as build directories or third-party libraries. Here's an example: + +```js +// eslint.config.js +import { defineConfig, globalIgnores } from "@eslint/config-helpers"; + +export default defineConfig([ + { + files: ["src/**/*.js"], + rules: { + semi: "error", + "prefer-const": "error", + }, + }, + globalIgnores(["node_modules/", "dist/", "coverage/"]), +]); +``` + +## License + +Apache 2.0 + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

Qlty Software trunk.io Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Syntax Cybozu Sentry Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/llama.cpp/tools/ui/node_modules/@eslint/core/README.md b/llama.cpp/tools/ui/node_modules/@eslint/core/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6c7283335daa78b1f1b8f97f0743a61160242b20 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/core/README.md @@ -0,0 +1,29 @@ +# ESLint Core + +## Overview + +This package is the future home of the rewritten, runtime-agnostic ESLint core. + +Right now, it exports the core types necessary to implement language plugins. + +## License + +Apache 2.0 + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

Qlty Software trunk.io Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Syntax Cybozu Sentry Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/README.md b/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..e7301ae48cbf1fb3a8951c5b3902f7c063c24406 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/README.md @@ -0,0 +1,145 @@ +# ESLintRC Library + +This repository contains the legacy ESLintRC configuration file format for ESLint. This package is not intended for use outside of the ESLint ecosystem. It is ESLint-specific and not intended for use in other programs. + +**Note:** This package is frozen except for critical bug fixes as ESLint moves to a new config system. + +## Installation + +You can install the package as follows: + +```shell +npm install @eslint/eslintrc -D +# or +yarn add @eslint/eslintrc -D +# or +pnpm install @eslint/eslintrc -D +# or +bun install @eslint/eslintrc -D +``` + +## Usage (ESM) + +The primary class in this package is `FlatCompat`, which is a utility to translate ESLintRC-style configs into flat configs. Here's how you use it inside of your `eslint.config.js` file: + +```js +import { FlatCompat } from "@eslint/eslintrc"; +import js from "@eslint/js"; +import path from "path"; +import { fileURLToPath } from "url"; + +// mimic CommonJS variables -- not needed if using CommonJS +const __filename = fileURLToPath(import.meta.url); +const __dirname = path.dirname(__filename); + +const compat = new FlatCompat({ + baseDirectory: __dirname, // optional; default: process.cwd() + resolvePluginsRelativeTo: __dirname, // optional + recommendedConfig: js.configs.recommended, // optional unless you're using "eslint:recommended" + allConfig: js.configs.all, // optional unless you're using "eslint:all" +}); + +export default [ + + // mimic ESLintRC-style extends + ...compat.extends("standard", "example", "plugin:react/recommended"), + + // mimic environments + ...compat.env({ + es2020: true, + node: true + }), + + // mimic plugins + ...compat.plugins("jsx-a11y", "react"), + + // translate an entire config + ...compat.config({ + plugins: ["jsx-a11y", "react"], + extends: "standard", + env: { + es2020: true, + node: true + }, + rules: { + semi: "error" + } + }) +]; +``` + +## Usage (CommonJS) + +Using `FlatCompat` in CommonJS files is similar to ESM, but you'll use `require()` and `module.exports` instead of `import` and `export`. Here's how you use it inside of your `eslint.config.js` CommonJS file: + +```js +const { FlatCompat } = require("@eslint/eslintrc"); +const js = require("@eslint/js"); + +const compat = new FlatCompat({ + baseDirectory: __dirname, // optional; default: process.cwd() + resolvePluginsRelativeTo: __dirname, // optional + recommendedConfig: js.configs.recommended, // optional unless using "eslint:recommended" + allConfig: js.configs.all, // optional unless using "eslint:all" +}); + +module.exports = [ + + // mimic ESLintRC-style extends + ...compat.extends("standard", "example", "plugin:react/recommended"), + + // mimic environments + ...compat.env({ + es2020: true, + node: true + }), + + // mimic plugins + ...compat.plugins("jsx-a11y", "react"), + + // translate an entire config + ...compat.config({ + plugins: ["jsx-a11y", "react"], + extends: "standard", + env: { + es2020: true, + node: true + }, + rules: { + semi: "error" + } + }) +]; +``` + +## Troubleshooting + +**TypeError: Missing parameter 'recommendedConfig' in FlatCompat constructor** + +The `recommendedConfig` option is required when any config uses `eslint:recommended`, including any config in an `extends` clause. To fix this, follow the example above using `@eslint/js` to provide the `eslint:recommended` config. + +**TypeError: Missing parameter 'allConfig' in FlatCompat constructor** + +The `allConfig` option is required when any config uses `eslint:all`, including any config in an `extends` clause. To fix this, follow the example above using `@eslint/js` to provide the `eslint:all` config. + +## License + +MIT License + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic

Gold Sponsors

+

Qlty Software

Silver Sponsors

+

Vite Liftoff StackBlitz

Bronze Sponsors

+

Cybozu SAP CrawlJobs Depot N-iX Ltd Icons8 Discord GitBook HeroCoders TestMu AI Open Source Office (Formerly LambdaTest)

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/ajv/README.md b/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/ajv/README.md new file mode 100644 index 0000000000000000000000000000000000000000..65077a0b3197e2c4fdc60c9f4cd81fb261287a1d --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/ajv/README.md @@ -0,0 +1,1505 @@ +Ajv logo + +# Ajv: Another JSON Schema Validator + +The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/07. + +[![Build Status](https://travis-ci.org/ajv-validator/ajv.svg?branch=master)](https://travis-ci.org/ajv-validator/ajv) +[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv) +[![npm (beta)](https://img.shields.io/npm/v/ajv/beta)](https://www.npmjs.com/package/ajv/v/7.0.0-beta.4) +[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv) +[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master) +[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv) +[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin) + + +## Ajv v7 beta is released + +[Ajv version 7 (beta)](https://github.com/ajv-validator/ajv/tree/v7-beta) is released with these changes: + +- support of JSON Schema draft-2019-09 features: [`unevaluatedProperties`](./json-schema.md#unevaluatedproperties) and [`unevaluatedItems`](./json-schema.md#unevaluateditems), [dynamic recursive references](./validation.md#extending-recursive-schemas) and other [additional keywords](./json-schema.md#json-schema-draft-2019-09). +- to reduce the mistakes in JSON schemas and unexpected validation results, [strict mode](./docs/strict-mode.md) is added - it prohibits ignored or ambiguous JSON Schema elements. +- to make code injection from untrusted schemas impossible, [code generation](./docs/codegen.md) is fully re-written to be safe and to allow code optimization (compiled schema code size is reduced by more than 10%). +- to simplify Ajv extensions, the new keyword API that is used by pre-defined keywords is available to user-defined keywords - it is much easier to define any keywords now, especially with subschemas. [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package was updated to use the new API (in [v4.0.0-beta.0](https://github.com/ajv-validator/ajv-keywords/releases/tag/v4.0.0-beta.0)) +- schemas are compiled to ES6 code (ES5 code generation is also supported with an option). +- to improve reliability and maintainability the code is migrated to TypeScript. + +**Please note**: + +- the support for JSON-Schema draft-04 is removed - if you have schemas using "id" attributes you have to replace them with "\$id" (or continue using version 6 that will be supported until 02/28/2021). +- all formats are separated to ajv-formats package - they have to be explicitely added if you use them. + +See [release notes](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0-beta.0) for the details. + +To install the new version: + +```bash +npm install ajv@beta +``` + +See [Getting started with v7](https://github.com/ajv-validator/ajv/tree/v7-beta#usage) for code example. + + +## Mozilla MOSS grant and OpenJS Foundation + +[](https://www.mozilla.org/en-US/moss/)     [](https://openjsf.org/blog/2020/08/14/ajv-joins-openjs-foundation-as-an-incubation-project/) + +Ajv has been awarded a grant from Mozilla’s [Open Source Support (MOSS) program](https://www.mozilla.org/en-US/moss/) in the “Foundational Technology” track! It will sponsor the development of Ajv support of [JSON Schema version 2019-09](https://tools.ietf.org/html/draft-handrews-json-schema-02) and of [JSON Type Definition](https://tools.ietf.org/html/draft-ucarion-json-type-definition-04). + +Ajv also joined [OpenJS Foundation](https://openjsf.org/) – having this support will help ensure the longevity and stability of Ajv for all its users. + +This [blog post](https://www.poberezkin.com/posts/2020-08-14-ajv-json-validator-mozilla-open-source-grant-openjs-foundation.html) has more details. + +I am looking for the long term maintainers of Ajv – working with [ReadySet](https://www.thereadyset.co/), also sponsored by Mozilla, to establish clear guidelines for the role of a "maintainer" and the contribution standards, and to encourage a wider, more inclusive, contribution from the community. + + +## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin) + +Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant! + +Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released. + +Please sponsor Ajv via: +- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it) +- [Ajv Open Collective️](https://opencollective.com/ajv) + +Thank you. + + +#### Open Collective sponsors + + + + + + + + + + + + + + + +## Using version 6 + +[JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html) is published. + +[Ajv version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0) that supports draft-07 is released. It may require either migrating your schemas or updating your code (to continue using draft-04 and v5 schemas, draft-06 schemas will be supported without changes). + +__Please note__: To use Ajv with draft-06 schemas you need to explicitly add the meta-schema to the validator instance: + +```javascript +ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json')); +``` + +To use Ajv with draft-04 schemas in addition to explicitly adding meta-schema you also need to use option schemaId: + +```javascript +var ajv = new Ajv({schemaId: 'id'}); +// If you want to use both draft-04 and draft-06/07 schemas: +// var ajv = new Ajv({schemaId: 'auto'}); +ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json')); +``` + + +## Contents + +- [Performance](#performance) +- [Features](#features) +- [Getting started](#getting-started) +- [Frequently Asked Questions](https://github.com/ajv-validator/ajv/blob/master/FAQ.md) +- [Using in browser](#using-in-browser) + - [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) +- [Command line interface](#command-line-interface) +- Validation + - [Keywords](#validation-keywords) + - [Annotation keywords](#annotation-keywords) + - [Formats](#formats) + - [Combining schemas with $ref](#ref) + - [$data reference](#data-reference) + - NEW: [$merge and $patch keywords](#merge-and-patch-keywords) + - [Defining custom keywords](#defining-custom-keywords) + - [Asynchronous schema compilation](#asynchronous-schema-compilation) + - [Asynchronous validation](#asynchronous-validation) +- [Security considerations](#security-considerations) + - [Security contact](#security-contact) + - [Untrusted schemas](#untrusted-schemas) + - [Circular references in objects](#circular-references-in-javascript-objects) + - [Trusted schemas](#security-risks-of-trusted-schemas) + - [ReDoS attack](#redos-attack) +- Modifying data during validation + - [Filtering data](#filtering-data) + - [Assigning defaults](#assigning-defaults) + - [Coercing data types](#coercing-data-types) +- API + - [Methods](#api) + - [Options](#options) + - [Validation errors](#validation-errors) +- [Plugins](#plugins) +- [Related packages](#related-packages) +- [Some packages using Ajv](#some-packages-using-ajv) +- [Tests, Contributing, Changes history](#tests) +- [Support, Code of conduct, License](#open-source-software-support) + + +## Performance + +Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization. + +Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks: + +- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place +- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster +- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html) +- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html) + + +Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark): + +[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:|djv|ajv|json-schema-validator-generator|jsen|is-my-json-valid|themis|z-schema|jsck|skeemas|json-schema-library|tv4&chd=t:100,98,72.1,66.8,50.1,15.1,6.1,3.8,1.2,0.7,0.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance) + + +## Features + +- Ajv implements full JSON Schema [draft-06/07](http://json-schema.org/) and draft-04 standards: + - all validation keywords (see [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md)) + - full support of remote refs (remote schemas have to be added with `addSchema` or compiled to be available) + - support of circular references between schemas + - correct string lengths for strings with unicode pairs (can be turned off) + - [formats](#formats) defined by JSON Schema draft-07 standard and custom formats (can be turned off) + - [validates schemas against meta-schema](#api-validateschema) +- supports [browsers](#using-in-browser) and Node.js 0.10-14.x +- [asynchronous loading](#asynchronous-schema-compilation) of referenced schemas during compilation +- "All errors" validation mode with [option allErrors](#options) +- [error messages with parameters](#validation-errors) describing error reasons to allow creating custom error messages +- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package +- [filtering data](#filtering-data) from additional properties +- [assigning defaults](#assigning-defaults) to missing properties and items +- [coercing data](#coercing-data-types) to the types specified in `type` keywords +- [custom keywords](#defining-custom-keywords) +- draft-06/07 keywords `const`, `contains`, `propertyNames` and `if/then/else` +- draft-06 boolean schemas (`true`/`false` as a schema to always pass/fail). +- keywords `switch`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package +- [$data reference](#data-reference) to use values from the validated data as values for the schema keywords +- [asynchronous validation](#asynchronous-validation) of custom formats and keywords + + +## Install + +``` +npm install ajv +``` + + +## Getting started + +Try it in the Node.js REPL: https://tonicdev.com/npm/ajv + + +The fastest validation call: + +```javascript +// Node.js require: +var Ajv = require('ajv'); +// or ESM/TypeScript import +import Ajv from 'ajv'; + +var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true} +var validate = ajv.compile(schema); +var valid = validate(data); +if (!valid) console.log(validate.errors); +``` + +or with less code + +```javascript +// ... +var valid = ajv.validate(schema, data); +if (!valid) console.log(ajv.errors); +// ... +``` + +or + +```javascript +// ... +var valid = ajv.addSchema(schema, 'mySchema') + .validate('mySchema', data); +if (!valid) console.log(ajv.errorsText()); +// ... +``` + +See [API](#api) and [Options](#options) for more details. + +Ajv compiles schemas to functions and caches them in all cases (using schema serialized with [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) or a custom function as a key), so that the next time the same schema is used (not necessarily the same object instance) it won't be compiled again. + +The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods (there is no additional function call). + +__Please note__: every time a validation function or `ajv.validate` are called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](#validation-errors) + +__Note for TypeScript users__: `ajv` provides its own TypeScript declarations +out of the box, so you don't need to install the deprecated `@types/ajv` +module. + + +## Using in browser + +You can require Ajv directly from the code you browserify - in this case Ajv will be a part of your bundle. + +If you need to use Ajv in several bundles you can create a separate UMD bundle using `npm run bundle` script (thanks to [siddo420](https://github.com/siddo420)). + +Then you need to load Ajv in the browser: +```html + +``` + +This bundle can be used with different module systems; it creates global `Ajv` if no module system is found. + +The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv). + +Ajv is tested with these browsers: + +[![Sauce Test Status](https://saucelabs.com/browser-matrix/epoberezkin.svg)](https://saucelabs.com/u/epoberezkin) + +__Please note__: some frameworks, e.g. Dojo, may redefine global require in such way that is not compatible with CommonJS module format. In such case Ajv bundle has to be loaded before the framework and then you can use global Ajv (see issue [#234](https://github.com/ajv-validator/ajv/issues/234)). + + +### Ajv and Content Security Policies (CSP) + +If you're using Ajv to compile a schema (the typical use) in a browser document that is loaded with a Content Security Policy (CSP), that policy will require a `script-src` directive that includes the value `'unsafe-eval'`. +:warning: NOTE, however, that `unsafe-eval` is NOT recommended in a secure CSP[[1]](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval), as it has the potential to open the document to cross-site scripting (XSS) attacks. + +In order to make use of Ajv without easing your CSP, you can [pre-compile a schema using the CLI](https://github.com/ajv-validator/ajv-cli#compile-schemas). This will transpile the schema JSON into a JavaScript file that exports a `validate` function that works simlarly to a schema compiled at runtime. + +Note that pre-compilation of schemas is performed using [ajv-pack](https://github.com/ajv-validator/ajv-pack) and there are [some limitations to the schema features it can compile](https://github.com/ajv-validator/ajv-pack#limitations). A successfully pre-compiled schema is equivalent to the same schema compiled at runtime. + + +## Command line interface + +CLI is available as a separate npm package [ajv-cli](https://github.com/ajv-validator/ajv-cli). It supports: + +- compiling JSON Schemas to test their validity +- BETA: generating standalone module exporting a validation function to be used without Ajv (using [ajv-pack](https://github.com/ajv-validator/ajv-pack)) +- migrate schemas to draft-07 (using [json-schema-migrate](https://github.com/epoberezkin/json-schema-migrate)) +- validating data file(s) against JSON Schema +- testing expected validity of data against JSON Schema +- referenced schemas +- custom meta-schemas +- files in JSON, JSON5, YAML, and JavaScript format +- all Ajv options +- reporting changes in data after validation in [JSON-patch](https://tools.ietf.org/html/rfc6902) format + + +## Validation keywords + +Ajv supports all validation keywords from draft-07 of JSON Schema standard: + +- [type](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#type) +- [for numbers](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-numbers) - maximum, minimum, exclusiveMaximum, exclusiveMinimum, multipleOf +- [for strings](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-strings) - maxLength, minLength, pattern, format +- [for arrays](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-arrays) - maxItems, minItems, uniqueItems, items, additionalItems, [contains](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#contains) +- [for objects](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-objects) - maxProperties, minProperties, required, properties, patternProperties, additionalProperties, dependencies, [propertyNames](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#propertynames) +- [for all types](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-all-types) - enum, [const](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#const) +- [compound keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#compound-keywords) - not, oneOf, anyOf, allOf, [if/then/else](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#ifthenelse) + +With [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package Ajv also supports validation keywords from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) for JSON Schema standard: + +- [patternRequired](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#patternrequired-proposed) - like `required` but with patterns that some property should match. +- [formatMaximum, formatMinimum, formatExclusiveMaximum, formatExclusiveMinimum](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#formatmaximum--formatminimum-and-exclusiveformatmaximum--exclusiveformatminimum-proposed) - setting limits for date, time, etc. + +See [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md) for more details. + + +## Annotation keywords + +JSON Schema specification defines several annotation keywords that describe schema itself but do not perform any validation. + +- `title` and `description`: information about the data represented by that schema +- `$comment` (NEW in draft-07): information for developers. With option `$comment` Ajv logs or passes the comment string to the user-supplied function. See [Options](#options). +- `default`: a default value of the data instance, see [Assigning defaults](#assigning-defaults). +- `examples` (NEW in draft-06): an array of data instances. Ajv does not check the validity of these instances against the schema. +- `readOnly` and `writeOnly` (NEW in draft-07): marks data-instance as read-only or write-only in relation to the source of the data (database, api, etc.). +- `contentEncoding`: [RFC 2045](https://tools.ietf.org/html/rfc2045#section-6.1 ), e.g., "base64". +- `contentMediaType`: [RFC 2046](https://tools.ietf.org/html/rfc2046), e.g., "image/png". + +__Please note__: Ajv does not implement validation of the keywords `examples`, `contentEncoding` and `contentMediaType` but it reserves them. If you want to create a plugin that implements some of them, it should remove these keywords from the instance. + + +## Formats + +Ajv implements formats defined by JSON Schema specification and several other formats. It is recommended NOT to use "format" keyword implementations with untrusted data, as they use potentially unsafe regular expressions - see [ReDoS attack](#redos-attack). + +__Please note__: if you need to use "format" keyword to validate untrusted data, you MUST assess their suitability and safety for your validation scenarios. + +The following formats are implemented for string validation with "format" keyword: + +- _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6). +- _time_: time with optional time-zone. +- _date-time_: date-time from the same source (time-zone is mandatory). `date`, `time` and `date-time` validate ranges in `full` mode and only regexp in `fast` mode (see [options](#options)). +- _uri_: full URI. +- _uri-reference_: URI reference, including full and relative URIs. +- _uri-template_: URI template according to [RFC6570](https://tools.ietf.org/html/rfc6570) +- _url_ (deprecated): [URL record](https://url.spec.whatwg.org/#concept-url). +- _email_: email address. +- _hostname_: host name according to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5). +- _ipv4_: IP address v4. +- _ipv6_: IP address v6. +- _regex_: tests whether a string is a valid regular expression by passing it to RegExp constructor. +- _uuid_: Universally Unique IDentifier according to [RFC4122](http://tools.ietf.org/html/rfc4122). +- _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901). +- _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00). + +__Please note__: JSON Schema draft-07 also defines formats `iri`, `iri-reference`, `idn-hostname` and `idn-email` for URLs, hostnames and emails with international characters. Ajv does not implement these formats. If you create Ajv plugin that implements them please make a PR to mention this plugin here. + +There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `uri-reference`, and `email`. See [Options](#options) for details. + +You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method. + +The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can allow specific format(s) that will be ignored. See [Options](#options) for details. + +You can find regular expressions used for format validation and the sources that were used in [formats.js](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js). + + +## Combining schemas with $ref + +You can structure your validation logic across multiple schema files and have schemas reference each other using `$ref` keyword. + +Example: + +```javascript +var schema = { + "$id": "http://example.com/schemas/schema.json", + "type": "object", + "properties": { + "foo": { "$ref": "defs.json#/definitions/int" }, + "bar": { "$ref": "defs.json#/definitions/str" } + } +}; + +var defsSchema = { + "$id": "http://example.com/schemas/defs.json", + "definitions": { + "int": { "type": "integer" }, + "str": { "type": "string" } + } +}; +``` + +Now to compile your schema you can either pass all schemas to Ajv instance: + +```javascript +var ajv = new Ajv({schemas: [schema, defsSchema]}); +var validate = ajv.getSchema('http://example.com/schemas/schema.json'); +``` + +or use `addSchema` method: + +```javascript +var ajv = new Ajv; +var validate = ajv.addSchema(defsSchema) + .compile(schema); +``` + +See [Options](#options) and [addSchema](#api) method. + +__Please note__: +- `$ref` is resolved as the uri-reference using schema $id as the base URI (see the example). +- References can be recursive (and mutually recursive) to implement the schemas for different data structures (such as linked lists, trees, graphs, etc.). +- You don't have to host your schema files at the URIs that you use as schema $id. These URIs are only used to identify the schemas, and according to JSON Schema specification validators should not expect to be able to download the schemas from these URIs. +- The actual location of the schema file in the file system is not used. +- You can pass the identifier of the schema as the second parameter of `addSchema` method or as a property name in `schemas` option. This identifier can be used instead of (or in addition to) schema $id. +- You cannot have the same $id (or the schema identifier) used for more than one schema - the exception will be thrown. +- You can implement dynamic resolution of the referenced schemas using `compileAsync` method. In this way you can store schemas in any system (files, web, database, etc.) and reference them without explicitly adding to Ajv instance. See [Asynchronous schema compilation](#asynchronous-schema-compilation). + + +## $data reference + +With `$data` option you can use values from the validated data as the values for the schema keywords. See [proposal](https://github.com/json-schema-org/json-schema-spec/issues/51) for more information about how it works. + +`$data` reference is supported in the keywords: const, enum, format, maximum/minimum, exclusiveMaximum / exclusiveMinimum, maxLength / minLength, maxItems / minItems, maxProperties / minProperties, formatMaximum / formatMinimum, formatExclusiveMaximum / formatExclusiveMinimum, multipleOf, pattern, required, uniqueItems. + +The value of "$data" should be a [JSON-pointer](https://tools.ietf.org/html/rfc6901) to the data (the root is always the top level data object, even if the $data reference is inside a referenced subschema) or a [relative JSON-pointer](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00) (it is relative to the current point in data; if the $data reference is inside a referenced subschema it cannot point to the data outside of the root level for this subschema). + +Examples. + +This schema requires that the value in property `smaller` is less or equal than the value in the property larger: + +```javascript +var ajv = new Ajv({$data: true}); + +var schema = { + "properties": { + "smaller": { + "type": "number", + "maximum": { "$data": "1/larger" } + }, + "larger": { "type": "number" } + } +}; + +var validData = { + smaller: 5, + larger: 7 +}; + +ajv.validate(schema, validData); // true +``` + +This schema requires that the properties have the same format as their field names: + +```javascript +var schema = { + "additionalProperties": { + "type": "string", + "format": { "$data": "0#" } + } +}; + +var validData = { + 'date-time': '1963-06-19T08:30:06.283185Z', + email: 'joe.bloggs@example.com' +} +``` + +`$data` reference is resolved safely - it won't throw even if some property is undefined. If `$data` resolves to `undefined` the validation succeeds (with the exclusion of `const` keyword). If `$data` resolves to incorrect type (e.g. not "number" for maximum keyword) the validation fails. + + +## $merge and $patch keywords + +With the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) you can use the keywords `$merge` and `$patch` that allow extending JSON Schemas with patches using formats [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) and [JSON Patch (RFC 6902)](https://tools.ietf.org/html/rfc6902). + +To add keywords `$merge` and `$patch` to Ajv instance use this code: + +```javascript +require('ajv-merge-patch')(ajv); +``` + +Examples. + +Using `$merge`: + +```json +{ + "$merge": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": { + "properties": { "q": { "type": "number" } } + } + } +} +``` + +Using `$patch`: + +```json +{ + "$patch": { + "source": { + "type": "object", + "properties": { "p": { "type": "string" } }, + "additionalProperties": false + }, + "with": [ + { "op": "add", "path": "/properties/q", "value": { "type": "number" } } + ] + } +} +``` + +The schemas above are equivalent to this schema: + +```json +{ + "type": "object", + "properties": { + "p": { "type": "string" }, + "q": { "type": "number" } + }, + "additionalProperties": false +} +``` + +The properties `source` and `with` in the keywords `$merge` and `$patch` can use absolute or relative `$ref` to point to other schemas previously added to the Ajv instance or to the fragments of the current schema. + +See the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) for more information. + + +## Defining custom keywords + +The advantages of using custom keywords are: + +- allow creating validation scenarios that cannot be expressed using JSON Schema +- simplify your schemas +- help bringing a bigger part of the validation logic to your schemas +- make your schemas more expressive, less verbose and closer to your application domain +- implement custom data processors that modify your data (`modifying` option MUST be used in keyword definition) and/or create side effects while the data is being validated + +If a keyword is used only for side-effects and its validation result is pre-defined, use option `valid: true/false` in keyword definition to simplify both generated code (no error handling in case of `valid: true`) and your keyword functions (no need to return any validation result). + +The concerns you have to be aware of when extending JSON Schema standard with custom keywords are the portability and understanding of your schemas. You will have to support these custom keywords on other platforms and to properly document these keywords so that everybody can understand them in your schemas. + +You can define custom keywords with [addKeyword](#api-addkeyword) method. Keywords are defined on the `ajv` instance level - new instances will not have previously defined keywords. + +Ajv allows defining keywords with: +- validation function +- compilation function +- macro function +- inline compilation function that should return code (as string) that will be inlined in the currently compiled schema. + +Example. `range` and `exclusiveRange` keywords using compiled schema: + +```javascript +ajv.addKeyword('range', { + type: 'number', + compile: function (sch, parentSchema) { + var min = sch[0]; + var max = sch[1]; + + return parentSchema.exclusiveRange === true + ? function (data) { return data > min && data < max; } + : function (data) { return data >= min && data <= max; } + } +}); + +var schema = { "range": [2, 4], "exclusiveRange": true }; +var validate = ajv.compile(schema); +console.log(validate(2.01)); // true +console.log(validate(3.99)); // true +console.log(validate(2)); // false +console.log(validate(4)); // false +``` + +Several custom keywords (typeof, instanceof, range and propertyNames) are defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package - they can be used for your schemas and as a starting point for your own custom keywords. + +See [Defining custom keywords](https://github.com/ajv-validator/ajv/blob/master/CUSTOM.md) for more details. + + +## Asynchronous schema compilation + +During asynchronous compilation remote references are loaded using supplied function. See `compileAsync` [method](#api-compileAsync) and `loadSchema` [option](#options). + +Example: + +```javascript +var ajv = new Ajv({ loadSchema: loadSchema }); + +ajv.compileAsync(schema).then(function (validate) { + var valid = validate(data); + // ... +}); + +function loadSchema(uri) { + return request.json(uri).then(function (res) { + if (res.statusCode >= 400) + throw new Error('Loading error: ' + res.statusCode); + return res.body; + }); +} +``` + +__Please note__: [Option](#options) `missingRefs` should NOT be set to `"ignore"` or `"fail"` for asynchronous compilation to work. + + +## Asynchronous validation + +Example in Node.js REPL: https://tonicdev.com/esp/ajv-asynchronous-validation + +You can define custom formats and keywords that perform validation asynchronously by accessing database or some other service. You should add `async: true` in the keyword or format definition (see [addFormat](#api-addformat), [addKeyword](#api-addkeyword) and [Defining custom keywords](#defining-custom-keywords)). + +If your schema uses asynchronous formats/keywords or refers to some schema that contains them it should have `"$async": true` keyword so that Ajv can compile it correctly. If asynchronous format/keyword or reference to asynchronous schema is used in the schema without `$async` keyword Ajv will throw an exception during schema compilation. + +__Please note__: all asynchronous subschemas that are referenced from the current or other schemas should have `"$async": true` keyword as well, otherwise the schema compilation will fail. + +Validation function for an asynchronous custom format/keyword should return a promise that resolves with `true` or `false` (or rejects with `new Ajv.ValidationError(errors)` if you want to return custom errors from the keyword function). + +Ajv compiles asynchronous schemas to [es7 async functions](http://tc39.github.io/ecmascript-asyncawait/) that can optionally be transpiled with [nodent](https://github.com/MatAtBread/nodent). Async functions are supported in Node.js 7+ and all modern browsers. You can also supply any other transpiler as a function via `processCode` option. See [Options](#options). + +The compiled validation function has `$async: true` property (if the schema is asynchronous), so you can differentiate these functions if you are using both synchronous and asynchronous schemas. + +Validation result will be a promise that resolves with validated data or rejects with an exception `Ajv.ValidationError` that contains the array of validation errors in `errors` property. + + +Example: + +```javascript +var ajv = new Ajv; +// require('ajv-async')(ajv); + +ajv.addKeyword('idExists', { + async: true, + type: 'number', + validate: checkIdExists +}); + + +function checkIdExists(schema, data) { + return knex(schema.table) + .select('id') + .where('id', data) + .then(function (rows) { + return !!rows.length; // true if record is found + }); +} + +var schema = { + "$async": true, + "properties": { + "userId": { + "type": "integer", + "idExists": { "table": "users" } + }, + "postId": { + "type": "integer", + "idExists": { "table": "posts" } + } + } +}; + +var validate = ajv.compile(schema); + +validate({ userId: 1, postId: 19 }) +.then(function (data) { + console.log('Data is valid', data); // { userId: 1, postId: 19 } +}) +.catch(function (err) { + if (!(err instanceof Ajv.ValidationError)) throw err; + // data is invalid + console.log('Validation errors:', err.errors); +}); +``` + +### Using transpilers with asynchronous validation functions. + +[ajv-async](https://github.com/ajv-validator/ajv-async) uses [nodent](https://github.com/MatAtBread/nodent) to transpile async functions. To use another transpiler you should separately install it (or load its bundle in the browser). + + +#### Using nodent + +```javascript +var ajv = new Ajv; +require('ajv-async')(ajv); +// in the browser if you want to load ajv-async bundle separately you can: +// window.ajvAsync(ajv); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + + +#### Using other transpilers + +```javascript +var ajv = new Ajv({ processCode: transpileFunc }); +var validate = ajv.compile(schema); // transpiled es7 async function +validate(data).then(successFunc).catch(errorFunc); +``` + +See [Options](#options). + + +## Security considerations + +JSON Schema, if properly used, can replace data sanitisation. It doesn't replace other API security considerations. It also introduces additional security aspects to consider. + + +##### Security contact + +To report a security vulnerability, please use the +[Tidelift security contact](https://tidelift.com/security). +Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues. + + +##### Untrusted schemas + +Ajv treats JSON schemas as trusted as your application code. This security model is based on the most common use case, when the schemas are static and bundled together with the application. + +If your schemas are received from untrusted sources (or generated from untrusted data) there are several scenarios you need to prevent: +- compiling schemas can cause stack overflow (if they are too deep) +- compiling schemas can be slow (e.g. [#557](https://github.com/ajv-validator/ajv/issues/557)) +- validating certain data can be slow + +It is difficult to predict all the scenarios, but at the very least it may help to limit the size of untrusted schemas (e.g. limit JSON string length) and also the maximum schema object depth (that can be high for relatively small JSON strings). You also may want to mitigate slow regular expressions in `pattern` and `patternProperties` keywords. + +Regardless the measures you take, using untrusted schemas increases security risks. + + +##### Circular references in JavaScript objects + +Ajv does not support schemas and validated data that have circular references in objects. See [issue #802](https://github.com/ajv-validator/ajv/issues/802). + +An attempt to compile such schemas or validate such data would cause stack overflow (or will not complete in case of asynchronous validation). Depending on the parser you use, untrusted data can lead to circular references. + + +##### Security risks of trusted schemas + +Some keywords in JSON Schemas can lead to very slow validation for certain data. These keywords include (but may be not limited to): + +- `pattern` and `format` for large strings - in some cases using `maxLength` can help mitigate it, but certain regular expressions can lead to exponential validation time even with relatively short strings (see [ReDoS attack](#redos-attack)). +- `patternProperties` for large property names - use `propertyNames` to mitigate, but some regular expressions can have exponential evaluation time as well. +- `uniqueItems` for large non-scalar arrays - use `maxItems` to mitigate + +__Please note__: The suggestions above to prevent slow validation would only work if you do NOT use `allErrors: true` in production code (using it would continue validation after validation errors). + +You can validate your JSON schemas against [this meta-schema](https://github.com/ajv-validator/ajv/blob/master/lib/refs/json-schema-secure.json) to check that these recommendations are followed: + +```javascript +const isSchemaSecure = ajv.compile(require('ajv/lib/refs/json-schema-secure.json')); + +const schema1 = {format: 'email'}; +isSchemaSecure(schema1); // false + +const schema2 = {format: 'email', maxLength: MAX_LENGTH}; +isSchemaSecure(schema2); // true +``` + +__Please note__: following all these recommendation is not a guarantee that validation of untrusted data is safe - it can still lead to some undesirable results. + + +##### Content Security Policies (CSP) +See [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp) + + +## ReDoS attack + +Certain regular expressions can lead to the exponential evaluation time even with relatively short strings. + +Please assess the regular expressions you use in the schemas on their vulnerability to this attack - see [safe-regex](https://github.com/substack/safe-regex), for example. + +__Please note__: some formats that Ajv implements use [regular expressions](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js) that can be vulnerable to ReDoS attack, so if you use Ajv to validate data from untrusted sources __it is strongly recommended__ to consider the following: + +- making assessment of "format" implementations in Ajv. +- using `format: 'fast'` option that simplifies some of the regular expressions (although it does not guarantee that they are safe). +- replacing format implementations provided by Ajv with your own implementations of "format" keyword that either uses different regular expressions or another approach to format validation. Please see [addFormat](#api-addformat) method. +- disabling format validation by ignoring "format" keyword with option `format: false` + +Whatever mitigation you choose, please assume all formats provided by Ajv as potentially unsafe and make your own assessment of their suitability for your validation scenarios. + + +## Filtering data + +With [option `removeAdditional`](#options) (added by [andyscott](https://github.com/andyscott)) you can filter data during the validation. + +This option modifies original data. + +Example: + +```javascript +var ajv = new Ajv({ removeAdditional: true }); +var schema = { + "additionalProperties": false, + "properties": { + "foo": { "type": "number" }, + "bar": { + "additionalProperties": { "type": "number" }, + "properties": { + "baz": { "type": "string" } + } + } + } +} + +var data = { + "foo": 0, + "additional1": 1, // will be removed; `additionalProperties` == false + "bar": { + "baz": "abc", + "additional2": 2 // will NOT be removed; `additionalProperties` != false + }, +} + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 0, "bar": { "baz": "abc", "additional2": 2 } +``` + +If `removeAdditional` option in the example above were `"all"` then both `additional1` and `additional2` properties would have been removed. + +If the option were `"failing"` then property `additional1` would have been removed regardless of its value and property `additional2` would have been removed only if its value were failing the schema in the inner `additionalProperties` (so in the example above it would have stayed because it passes the schema, but any non-number would have been removed). + +__Please note__: If you use `removeAdditional` option with `additionalProperties` keyword inside `anyOf`/`oneOf` keywords your validation can fail with this schema, for example: + +```json +{ + "type": "object", + "oneOf": [ + { + "properties": { + "foo": { "type": "string" } + }, + "required": [ "foo" ], + "additionalProperties": false + }, + { + "properties": { + "bar": { "type": "integer" } + }, + "required": [ "bar" ], + "additionalProperties": false + } + ] +} +``` + +The intention of the schema above is to allow objects with either the string property "foo" or the integer property "bar", but not with both and not with any other properties. + +With the option `removeAdditional: true` the validation will pass for the object `{ "foo": "abc"}` but will fail for the object `{"bar": 1}`. It happens because while the first subschema in `oneOf` is validated, the property `bar` is removed because it is an additional property according to the standard (because it is not included in `properties` keyword in the same schema). + +While this behaviour is unexpected (issues [#129](https://github.com/ajv-validator/ajv/issues/129), [#134](https://github.com/ajv-validator/ajv/issues/134)), it is correct. To have the expected behaviour (both objects are allowed and additional properties are removed) the schema has to be refactored in this way: + +```json +{ + "type": "object", + "properties": { + "foo": { "type": "string" }, + "bar": { "type": "integer" } + }, + "additionalProperties": false, + "oneOf": [ + { "required": [ "foo" ] }, + { "required": [ "bar" ] } + ] +} +``` + +The schema above is also more efficient - it will compile into a faster function. + + +## Assigning defaults + +With [option `useDefaults`](#options) Ajv will assign values from `default` keyword in the schemas of `properties` and `items` (when it is the array of schemas) to the missing properties and items. + +With the option value `"empty"` properties and items equal to `null` or `""` (empty string) will be considered missing and assigned defaults. + +This option modifies original data. + +__Please note__: the default value is inserted in the generated validation code as a literal, so the value inserted in the data will be the deep clone of the default in the schema. + + +Example 1 (`default` in `properties`): + +```javascript +var ajv = new Ajv({ useDefaults: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "string", "default": "baz" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": 1 }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": "baz" } +``` + +Example 2 (`default` in `items`): + +```javascript +var schema = { + "type": "array", + "items": [ + { "type": "number" }, + { "type": "string", "default": "foo" } + ] +} + +var data = [ 1 ]; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // [ 1, "foo" ] +``` + +`default` keywords in other cases are ignored: + +- not in `properties` or `items` subschemas +- in schemas inside `anyOf`, `oneOf` and `not` (see [#42](https://github.com/ajv-validator/ajv/issues/42)) +- in `if` subschema of `switch` keyword +- in schemas generated by custom macro keywords + +The [`strictDefaults` option](#options) customizes Ajv's behavior for the defaults that Ajv ignores (`true` raises an error, and `"log"` outputs a warning). + + +## Coercing data types + +When you are validating user inputs all your data properties are usually strings. The option `coerceTypes` allows you to have your data types coerced to the types specified in your schema `type` keywords, both to pass the validation and to use the correctly typed data afterwards. + +This option modifies original data. + +__Please note__: if you pass a scalar value to the validating function its type will be coerced and it will pass the validation, but the value of the variable you pass won't be updated because scalars are passed by value. + + +Example 1: + +```javascript +var ajv = new Ajv({ coerceTypes: true }); +var schema = { + "type": "object", + "properties": { + "foo": { "type": "number" }, + "bar": { "type": "boolean" } + }, + "required": [ "foo", "bar" ] +}; + +var data = { "foo": "1", "bar": "false" }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": 1, "bar": false } +``` + +Example 2 (array coercions): + +```javascript +var ajv = new Ajv({ coerceTypes: 'array' }); +var schema = { + "properties": { + "foo": { "type": "array", "items": { "type": "number" } }, + "bar": { "type": "boolean" } + } +}; + +var data = { "foo": "1", "bar": ["false"] }; + +var validate = ajv.compile(schema); + +console.log(validate(data)); // true +console.log(data); // { "foo": [1], "bar": false } +``` + +The coercion rules, as you can see from the example, are different from JavaScript both to validate user input as expected and to have the coercion reversible (to correctly validate cases where different types are defined in subschemas of "anyOf" and other compound keywords). + +See [Coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md) for details. + + +## API + +##### new Ajv(Object options) -> Object + +Create Ajv instance. + + +##### .compile(Object schema) -> Function<Object data> + +Generate validating function and cache the compiled schema for future use. + +Validating function returns a boolean value. This function has properties `errors` and `schema`. Errors encountered during the last validation are assigned to `errors` property (it is assigned `null` if there was no errors). `schema` property contains the reference to the original schema. + +The schema passed to this method will be validated against meta-schema unless `validateSchema` option is false. If schema is invalid, an error will be thrown. See [options](#options). + + +##### .compileAsync(Object schema [, Boolean meta] [, Function callback]) -> Promise + +Asynchronous version of `compile` method that loads missing remote schemas using asynchronous function in `options.loadSchema`. This function returns a Promise that resolves to a validation function. An optional callback passed to `compileAsync` will be called with 2 parameters: error (or null) and validating function. The returned promise will reject (and the callback will be called with an error) when: + +- missing schema can't be loaded (`loadSchema` returns a Promise that rejects). +- a schema containing a missing reference is loaded, but the reference cannot be resolved. +- schema (or some loaded/referenced schema) is invalid. + +The function compiles schema and loads the first missing schema (or meta-schema) until all missing schemas are loaded. + +You can asynchronously compile meta-schema by passing `true` as the second parameter. + +See example in [Asynchronous compilation](#asynchronous-schema-compilation). + + +##### .validate(Object schema|String key|String ref, data) -> Boolean + +Validate data using passed schema (it will be compiled and cached). + +Instead of the schema you can use the key that was previously passed to `addSchema`, the schema id if it was present in the schema or any previously resolved reference. + +Validation errors will be available in the `errors` property of Ajv instance (`null` if there were no errors). + +__Please note__: every time this method is called the errors are overwritten so you need to copy them to another variable if you want to use them later. + +If the schema is asynchronous (has `$async` keyword on the top level) this method returns a Promise. See [Asynchronous validation](#asynchronous-validation). + + +##### .addSchema(Array<Object>|Object schema [, String key]) -> Ajv + +Add schema(s) to validator instance. This method does not compile schemas (but it still validates them). Because of that dependencies can be added in any order and circular dependencies are supported. It also prevents unnecessary compilation of schemas that are containers for other schemas but not used as a whole. + +Array of schemas can be passed (schemas should have ids), the second parameter will be ignored. + +Key can be passed that can be used to reference the schema and will be used as the schema id if there is no id inside the schema. If the key is not passed, the schema id will be used as the key. + + +Once the schema is added, it (and all the references inside it) can be referenced in other schemas and used to validate data. + +Although `addSchema` does not compile schemas, explicit compilation is not required - the schema will be compiled when it is used first time. + +By default the schema is validated against meta-schema before it is added, and if the schema does not pass validation the exception is thrown. This behaviour is controlled by `validateSchema` option. + +__Please note__: Ajv uses the [method chaining syntax](https://en.wikipedia.org/wiki/Method_chaining) for all methods with the prefix `add*` and `remove*`. +This allows you to do nice things like the following. + +```javascript +var validate = new Ajv().addSchema(schema).addFormat(name, regex).getSchema(uri); +``` + +##### .addMetaSchema(Array<Object>|Object schema [, String key]) -> Ajv + +Adds meta schema(s) that can be used to validate other schemas. That function should be used instead of `addSchema` because there may be instance options that would compile a meta schema incorrectly (at the moment it is `removeAdditional` option). + +There is no need to explicitly add draft-07 meta schema (http://json-schema.org/draft-07/schema) - it is added by default, unless option `meta` is set to `false`. You only need to use it if you have a changed meta-schema that you want to use to validate your schemas. See `validateSchema`. + + +##### .validateSchema(Object schema) -> Boolean + +Validates schema. This method should be used to validate schemas rather than `validate` due to the inconsistency of `uri` format in JSON Schema standard. + +By default this method is called automatically when the schema is added, so you rarely need to use it directly. + +If schema doesn't have `$schema` property, it is validated against draft 6 meta-schema (option `meta` should not be false). + +If schema has `$schema` property, then the schema with this id (that should be previously added) is used to validate passed schema. + +Errors will be available at `ajv.errors`. + + +##### .getSchema(String key) -> Function<Object data> + +Retrieve compiled schema previously added with `addSchema` by the key passed to `addSchema` or by its full reference (id). The returned validating function has `schema` property with the reference to the original schema. + + +##### .removeSchema([Object schema|String key|String ref|RegExp pattern]) -> Ajv + +Remove added/cached schema. Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references. + +Schema can be removed using: +- key passed to `addSchema` +- it's full reference (id) +- RegExp that should match schema id or key (meta-schemas won't be removed) +- actual schema object that will be stable-stringified to remove schema from cache + +If no parameter is passed all schemas but meta-schemas will be removed and the cache will be cleared. + + +##### .addFormat(String name, String|RegExp|Function|Object format) -> Ajv + +Add custom format to validate strings or numbers. It can also be used to replace pre-defined formats for Ajv instance. + +Strings are converted to RegExp. + +Function should return validation result as `true` or `false`. + +If object is passed it should have properties `validate`, `compare` and `async`: + +- _validate_: a string, RegExp or a function as described above. +- _compare_: an optional comparison function that accepts two strings and compares them according to the format meaning. This function is used with keywords `formatMaximum`/`formatMinimum` (defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package). It should return `1` if the first value is bigger than the second value, `-1` if it is smaller and `0` if it is equal. +- _async_: an optional `true` value if `validate` is an asynchronous function; in this case it should return a promise that resolves with a value `true` or `false`. +- _type_: an optional type of data that the format applies to. It can be `"string"` (default) or `"number"` (see https://github.com/ajv-validator/ajv/issues/291#issuecomment-259923858). If the type of data is different, the validation will pass. + +Custom formats can be also added via `formats` option. + + +##### .addKeyword(String keyword, Object definition) -> Ajv + +Add custom validation keyword to Ajv instance. + +Keyword should be different from all standard JSON Schema keywords and different from previously defined keywords. There is no way to redefine keywords or to remove keyword definition from the instance. + +Keyword must start with a letter, `_` or `$`, and may continue with letters, numbers, `_`, `$`, or `-`. +It is recommended to use an application-specific prefix for keywords to avoid current and future name collisions. + +Example Keywords: +- `"xyz-example"`: valid, and uses prefix for the xyz project to avoid name collisions. +- `"example"`: valid, but not recommended as it could collide with future versions of JSON Schema etc. +- `"3-example"`: invalid as numbers are not allowed to be the first character in a keyword + +Keyword definition is an object with the following properties: + +- _type_: optional string or array of strings with data type(s) that the keyword applies to. If not present, the keyword will apply to all types. +- _validate_: validating function +- _compile_: compiling function +- _macro_: macro function +- _inline_: compiling function that returns code (as string) +- _schema_: an optional `false` value used with "validate" keyword to not pass schema +- _metaSchema_: an optional meta-schema for keyword schema +- _dependencies_: an optional list of properties that must be present in the parent schema - it will be checked during schema compilation +- _modifying_: `true` MUST be passed if keyword modifies data +- _statements_: `true` can be passed in case inline keyword generates statements (as opposed to expression) +- _valid_: pass `true`/`false` to pre-define validation result, the result returned from validation function will be ignored. This option cannot be used with macro keywords. +- _$data_: an optional `true` value to support [$data reference](#data-reference) as the value of custom keyword. The reference will be resolved at validation time. If the keyword has meta-schema it would be extended to allow $data and it will be used to validate the resolved value. Supporting $data reference requires that keyword has validating function (as the only option or in addition to compile, macro or inline function). +- _async_: an optional `true` value if the validation function is asynchronous (whether it is compiled or passed in _validate_ property); in this case it should return a promise that resolves with a value `true` or `false`. This option is ignored in case of "macro" and "inline" keywords. +- _errors_: an optional boolean or string `"full"` indicating whether keyword returns errors. If this property is not set Ajv will determine if the errors were set in case of failed validation. + +_compile_, _macro_ and _inline_ are mutually exclusive, only one should be used at a time. _validate_ can be used separately or in addition to them to support $data reference. + +__Please note__: If the keyword is validating data type that is different from the type(s) in its definition, the validation function will not be called (and expanded macro will not be used), so there is no need to check for data type inside validation function or inside schema returned by macro function (unless you want to enforce a specific type and for some reason do not want to use a separate `type` keyword for that). In the same way as standard keywords work, if the keyword does not apply to the data type being validated, the validation of this keyword will succeed. + +See [Defining custom keywords](#defining-custom-keywords) for more details. + + +##### .getKeyword(String keyword) -> Object|Boolean + +Returns custom keyword definition, `true` for pre-defined keywords and `false` if the keyword is unknown. + + +##### .removeKeyword(String keyword) -> Ajv + +Removes custom or pre-defined keyword so you can redefine them. + +While this method can be used to extend pre-defined keywords, it can also be used to completely change their meaning - it may lead to unexpected results. + +__Please note__: schemas compiled before the keyword is removed will continue to work without changes. To recompile schemas use `removeSchema` method and compile them again. + + +##### .errorsText([Array<Object> errors [, Object options]]) -> String + +Returns the text with all errors in a String. + +Options can have properties `separator` (string used to separate errors, ", " by default) and `dataVar` (the variable name that dataPaths are prefixed with, "data" by default). + + +## Options + +Defaults: + +```javascript +{ + // validation and reporting options: + $data: false, + allErrors: false, + verbose: false, + $comment: false, // NEW in Ajv version 6.0 + jsonPointers: false, + uniqueItems: true, + unicode: true, + nullable: false, + format: 'fast', + formats: {}, + unknownFormats: true, + schemas: {}, + logger: undefined, + // referenced schema options: + schemaId: '$id', + missingRefs: true, + extendRefs: 'ignore', // recommended 'fail' + loadSchema: undefined, // function(uri: string): Promise {} + // options to modify validated data: + removeAdditional: false, + useDefaults: false, + coerceTypes: false, + // strict mode options + strictDefaults: false, + strictKeywords: false, + strictNumbers: false, + // asynchronous validation options: + transpile: undefined, // requires ajv-async package + // advanced options: + meta: true, + validateSchema: true, + addUsedSchema: true, + inlineRefs: true, + passContext: false, + loopRequired: Infinity, + ownProperties: false, + multipleOfPrecision: false, + errorDataPath: 'object', // deprecated + messages: true, + sourceCode: false, + processCode: undefined, // function (str: string, schema: object): string {} + cache: new Cache, + serialize: undefined, + regExp: undefined // custom RegExp engine +} +``` + +##### Validation and reporting options + +- _$data_: support [$data references](#data-reference). Draft 6 meta-schema that is added by default will be extended to allow them. If you want to use another meta-schema you need to use $dataMetaSchema method to add support for $data reference. See [API](#api). +- _allErrors_: check all rules collecting all errors. Default is to return after the first error. +- _verbose_: include the reference to the part of the schema (`schema` and `parentSchema`) and validated data in errors (false by default). +- _$comment_ (NEW in Ajv version 6.0): log or pass the value of `$comment` keyword to a function. Option values: + - `false` (default): ignore $comment keyword. + - `true`: log the keyword value to console. + - function: pass the keyword value, its schema path and root schema to the specified function +- _jsonPointers_: set `dataPath` property of errors using [JSON Pointers](https://tools.ietf.org/html/rfc6901) instead of JavaScript property access notation. +- _uniqueItems_: validate `uniqueItems` keyword (true by default). +- _unicode_: calculate correct length of strings with unicode pairs (true by default). Pass `false` to use `.length` of strings that is faster, but gives "incorrect" lengths of strings with unicode pairs - each unicode pair is counted as two characters. +- _nullable_: support keyword "nullable" from [Open API 3 specification](https://swagger.io/docs/specification/data-models/data-types/). +- _format_: formats validation mode. Option values: + - `"fast"` (default) - simplified and fast validation (see [Formats](#formats) for details of which formats are available and affected by this option). + - `"full"` - more restrictive and slow validation. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode. + - `false` - ignore all format keywords. +- _formats_: an object with custom formats. Keys and values will be passed to `addFormat` method. +- _keywords_: an object with custom keywords. Keys and values will be passed to `addKeyword` method. +- _unknownFormats_: handling of unknown formats. Option values: + - `true` (default) - if an unknown format is encountered the exception is thrown during schema compilation. If `format` keyword value is [$data reference](#data-reference) and it is unknown the validation will fail. + - `[String]` - an array of unknown format names that will be ignored. This option can be used to allow usage of third party schemas with format(s) for which you don't have definitions, but still fail if another unknown format is used. If `format` keyword value is [$data reference](#data-reference) and it is not in this array the validation will fail. + - `"ignore"` - to log warning during schema compilation and always pass validation (the default behaviour in versions before 5.0.0). This option is not recommended, as it allows to mistype format name and it won't be validated without any error message. This behaviour is required by JSON Schema specification. +- _schemas_: an array or object of schemas that will be added to the instance. In case you pass the array the schemas must have IDs in them. When the object is passed the method `addSchema(value, key)` will be called for each schema in this object. +- _logger_: sets the logging method. Default is the global `console` object that should have methods `log`, `warn` and `error`. See [Error logging](#error-logging). Option values: + - custom logger - it should have methods `log`, `warn` and `error`. If any of these methods is missing an exception will be thrown. + - `false` - logging is disabled. + + +##### Referenced schema options + +- _schemaId_: this option defines which keywords are used as schema URI. Option value: + - `"$id"` (default) - only use `$id` keyword as schema URI (as specified in JSON Schema draft-06/07), ignore `id` keyword (if it is present a warning will be logged). + - `"id"` - only use `id` keyword as schema URI (as specified in JSON Schema draft-04), ignore `$id` keyword (if it is present a warning will be logged). + - `"auto"` - use both `$id` and `id` keywords as schema URI. If both are present (in the same schema object) and different the exception will be thrown during schema compilation. +- _missingRefs_: handling of missing referenced schemas. Option values: + - `true` (default) - if the reference cannot be resolved during compilation the exception is thrown. The thrown error has properties `missingRef` (with hash fragment) and `missingSchema` (without it). Both properties are resolved relative to the current base id (usually schema id, unless it was substituted). + - `"ignore"` - to log error during compilation and always pass validation. + - `"fail"` - to log error and successfully compile schema but fail validation if this rule is checked. +- _extendRefs_: validation of other keywords when `$ref` is present in the schema. Option values: + - `"ignore"` (default) - when `$ref` is used other keywords are ignored (as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3) standard). A warning will be logged during the schema compilation. + - `"fail"` (recommended) - if other validation keywords are used together with `$ref` the exception will be thrown when the schema is compiled. This option is recommended to make sure schema has no keywords that are ignored, which can be confusing. + - `true` - validate all keywords in the schemas with `$ref` (the default behaviour in versions before 5.0.0). +- _loadSchema_: asynchronous function that will be used to load remote schemas when `compileAsync` [method](#api-compileAsync) is used and some reference is missing (option `missingRefs` should NOT be 'fail' or 'ignore'). This function should accept remote schema uri as a parameter and return a Promise that resolves to a schema. See example in [Asynchronous compilation](#asynchronous-schema-compilation). + + +##### Options to modify validated data + +- _removeAdditional_: remove additional properties - see example in [Filtering data](#filtering-data). This option is not used if schema is added with `addMetaSchema` method. Option values: + - `false` (default) - not to remove additional properties + - `"all"` - all additional properties are removed, regardless of `additionalProperties` keyword in schema (and no validation is made for them). + - `true` - only additional properties with `additionalProperties` keyword equal to `false` are removed. + - `"failing"` - additional properties that fail schema validation will be removed (where `additionalProperties` keyword is `false` or schema). +- _useDefaults_: replace missing or undefined properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values: + - `false` (default) - do not use defaults + - `true` - insert defaults by value (object literal is used). + - `"empty"` - in addition to missing or undefined, use defaults for properties and items that are equal to `null` or `""` (an empty string). + - `"shared"` (deprecated) - insert defaults by reference. If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well. +- _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md). Option values: + - `false` (default) - no type coercion. + - `true` - coerce scalar data types. + - `"array"` - in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema). + + +##### Strict mode options + +- _strictDefaults_: report ignored `default` keywords in schemas. Option values: + - `false` (default) - ignored defaults are not reported + - `true` - if an ignored default is present, throw an error + - `"log"` - if an ignored default is present, log warning +- _strictKeywords_: report unknown keywords in schemas. Option values: + - `false` (default) - unknown keywords are not reported + - `true` - if an unknown keyword is present, throw an error + - `"log"` - if an unknown keyword is present, log warning +- _strictNumbers_: validate numbers strictly, failing validation for NaN and Infinity. Option values: + - `false` (default) - NaN or Infinity will pass validation for numeric types + - `true` - NaN or Infinity will not pass validation for numeric types + +##### Asynchronous validation options + +- _transpile_: Requires [ajv-async](https://github.com/ajv-validator/ajv-async) package. It determines whether Ajv transpiles compiled asynchronous validation function. Option values: + - `undefined` (default) - transpile with [nodent](https://github.com/MatAtBread/nodent) if async functions are not supported. + - `true` - always transpile with nodent. + - `false` - do not transpile; if async functions are not supported an exception will be thrown. + + +##### Advanced options + +- _meta_: add [meta-schema](http://json-schema.org/documentation.html) so it can be used by other schemas (true by default). If an object is passed, it will be used as the default meta-schema for schemas that have no `$schema` keyword. This default meta-schema MUST have `$schema` keyword. +- _validateSchema_: validate added/compiled schemas against meta-schema (true by default). `$schema` property in the schema can be http://json-schema.org/draft-07/schema or absent (draft-07 meta-schema will be used) or can be a reference to the schema previously added with `addMetaSchema` method. Option values: + - `true` (default) - if the validation fails, throw the exception. + - `"log"` - if the validation fails, log error. + - `false` - skip schema validation. +- _addUsedSchema_: by default methods `compile` and `validate` add schemas to the instance if they have `$id` (or `id`) property that doesn't start with "#". If `$id` is present and it is not unique the exception will be thrown. Set this option to `false` to skip adding schemas to the instance and the `$id` uniqueness check when these methods are used. This option does not affect `addSchema` method. +- _inlineRefs_: Affects compilation of referenced schemas. Option values: + - `true` (default) - the referenced schemas that don't have refs in them are inlined, regardless of their size - that substantially improves performance at the cost of the bigger size of compiled schema functions. + - `false` - to not inline referenced schemas (they will be compiled as separate functions). + - integer number - to limit the maximum number of keywords of the schema that will be inlined. +- _passContext_: pass validation context to custom keyword functions. If this option is `true` and you pass some context to the compiled validation function with `validate.call(context, data)`, the `context` will be available as `this` in your custom keywords. By default `this` is Ajv instance. +- _loopRequired_: by default `required` keyword is compiled into a single expression (or a sequence of statements in `allErrors` mode). In case of a very large number of properties in this keyword it may result in a very big validation function. Pass integer to set the number of properties above which `required` keyword will be validated in a loop - smaller validation function size but also worse performance. +- _ownProperties_: by default Ajv iterates over all enumerable object properties; when this option is `true` only own enumerable object properties (i.e. found directly on the object rather than on its prototype) are iterated. Contributed by @mbroadst. +- _multipleOfPrecision_: by default `multipleOf` keyword is validated by comparing the result of division with parseInt() of that result. It works for dividers that are bigger than 1. For small dividers such as 0.01 the result of the division is usually not integer (even when it should be integer, see issue [#84](https://github.com/ajv-validator/ajv/issues/84)). If you need to use fractional dividers set this option to some positive integer N to have `multipleOf` validated using this formula: `Math.abs(Math.round(division) - division) < 1e-N` (it is slower but allows for float arithmetics deviations). +- _errorDataPath_ (deprecated): set `dataPath` to point to 'object' (default) or to 'property' when validating keywords `required`, `additionalProperties` and `dependencies`. +- _messages_: Include human-readable messages in errors. `true` by default. `false` can be passed when custom messages are used (e.g. with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n)). +- _sourceCode_: add `sourceCode` property to validating function (for debugging; this code can be different from the result of toString call). +- _processCode_: an optional function to process generated code before it is passed to Function constructor. It can be used to either beautify (the validating function is generated without line-breaks) or to transpile code. Starting from version 5.0.0 this option replaced options: + - `beautify` that formatted the generated function using [js-beautify](https://github.com/beautify-web/js-beautify). If you want to beautify the generated code pass a function calling `require('js-beautify').js_beautify` as `processCode: code => js_beautify(code)`. + - `transpile` that transpiled asynchronous validation function. You can still use `transpile` option with [ajv-async](https://github.com/ajv-validator/ajv-async) package. See [Asynchronous validation](#asynchronous-validation) for more information. +- _cache_: an optional instance of cache to store compiled schemas using stable-stringified schema as a key. For example, set-associative cache [sacjs](https://github.com/epoberezkin/sacjs) can be used. If not passed then a simple hash is used which is good enough for the common use case (a limited number of statically defined schemas). Cache should have methods `put(key, value)`, `get(key)`, `del(key)` and `clear()`. +- _serialize_: an optional function to serialize schema to cache key. Pass `false` to use schema itself as a key (e.g., if WeakMap used as a cache). By default [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used. +- _regExp_: an optional function to create RegExp objects. This allows using a custom RegExp engine (e.g., [RE2](https://github.com/uhop/node-re2)) to mitigate ReDoS attacks. The function must have the signature `(pattern: string) => RegExpLike` where `RegExpLike` is an object with a `test(string) => boolean` method. Example with RE2: + ```javascript + var ajv = new Ajv({regExp: require('re2')}); + ``` + By default (`undefined`), native `RegExp` constructor is used. + + +## Validation errors + +In case of validation failure, Ajv assigns the array of errors to `errors` property of validation function (or to `errors` property of Ajv instance when `validate` or `validateSchema` methods were called). In case of [asynchronous validation](#asynchronous-validation), the returned promise is rejected with exception `Ajv.ValidationError` that has `errors` property. + + +### Error objects + +Each error is an object with the following properties: + +- _keyword_: validation keyword. +- _dataPath_: the path to the part of the data that was validated. By default `dataPath` uses JavaScript property access notation (e.g., `".prop[1].subProp"`). When the option `jsonPointers` is true (see [Options](#options)) `dataPath` will be set using JSON pointer standard (e.g., `"/prop/1/subProp"`). +- _schemaPath_: the path (JSON-pointer as a URI fragment) to the schema of the keyword that failed validation. +- _params_: the object with the additional information about error that can be used to create custom error messages (e.g., using [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package). See below for parameters set by all keywords. +- _message_: the standard error message (can be excluded with option `messages` set to false). +- _schema_: the schema of the keyword (added with `verbose` option). +- _parentSchema_: the schema containing the keyword (added with `verbose` option) +- _data_: the data validated by the keyword (added with `verbose` option). + +__Please note__: `propertyNames` keyword schema validation errors have an additional property `propertyName`, `dataPath` points to the object. After schema validation for each property name, if it is invalid an additional error is added with the property `keyword` equal to `"propertyNames"`. + + +### Error parameters + +Properties of `params` object in errors depend on the keyword that failed validation. + +- `maxItems`, `minItems`, `maxLength`, `minLength`, `maxProperties`, `minProperties` - property `limit` (number, the schema of the keyword). +- `additionalItems` - property `limit` (the maximum number of allowed items in case when `items` keyword is an array of schemas and `additionalItems` is false). +- `additionalProperties` - property `additionalProperty` (the property not used in `properties` and `patternProperties` keywords). +- `dependencies` - properties: + - `property` (dependent property), + - `missingProperty` (required missing dependency - only the first one is reported currently) + - `deps` (required dependencies, comma separated list as a string), + - `depsCount` (the number of required dependencies). +- `format` - property `format` (the schema of the keyword). +- `maximum`, `minimum` - properties: + - `limit` (number, the schema of the keyword), + - `exclusive` (boolean, the schema of `exclusiveMaximum` or `exclusiveMinimum`), + - `comparison` (string, comparison operation to compare the data to the limit, with the data on the left and the limit on the right; can be "<", "<=", ">", ">=") +- `multipleOf` - property `multipleOf` (the schema of the keyword) +- `pattern` - property `pattern` (the schema of the keyword) +- `required` - property `missingProperty` (required property that is missing). +- `propertyNames` - property `propertyName` (an invalid property name). +- `patternRequired` (in ajv-keywords) - property `missingPattern` (required pattern that did not match any property). +- `type` - property `type` (required type(s), a string, can be a comma-separated list) +- `uniqueItems` - properties `i` and `j` (indices of duplicate items). +- `const` - property `allowedValue` pointing to the value (the schema of the keyword). +- `enum` - property `allowedValues` pointing to the array of values (the schema of the keyword). +- `$ref` - property `ref` with the referenced schema URI. +- `oneOf` - property `passingSchemas` (array of indices of passing schemas, null if no schema passes). +- custom keywords (in case keyword definition doesn't create errors) - property `keyword` (the keyword name). + + +### Error logging + +Using the `logger` option when initiallizing Ajv will allow you to define custom logging. Here you can build upon the exisiting logging. The use of other logging packages is supported as long as the package or its associated wrapper exposes the required methods. If any of the required methods are missing an exception will be thrown. +- **Required Methods**: `log`, `warn`, `error` + +```javascript +var otherLogger = new OtherLogger(); +var ajv = new Ajv({ + logger: { + log: console.log.bind(console), + warn: function warn() { + otherLogger.logWarn.apply(otherLogger, arguments); + }, + error: function error() { + otherLogger.logError.apply(otherLogger, arguments); + console.error.apply(console, arguments); + } + } +}); +``` + + +## Plugins + +Ajv can be extended with plugins that add custom keywords, formats or functions to process generated code. When such plugin is published as npm package it is recommended that it follows these conventions: + +- it exports a function +- this function accepts ajv instance as the first parameter and returns the same instance to allow chaining +- this function can accept an optional configuration as the second parameter + +If you have published a useful plugin please submit a PR to add it to the next section. + + +## Related packages + +- [ajv-async](https://github.com/ajv-validator/ajv-async) - plugin to configure async validation mode +- [ajv-bsontype](https://github.com/BoLaMN/ajv-bsontype) - plugin to validate mongodb's bsonType formats +- [ajv-cli](https://github.com/jessedc/ajv-cli) - command line interface +- [ajv-errors](https://github.com/ajv-validator/ajv-errors) - plugin for custom error messages +- [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) - internationalised error messages +- [ajv-istanbul](https://github.com/ajv-validator/ajv-istanbul) - plugin to instrument generated validation code to measure test coverage of your schemas +- [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) - plugin with custom validation keywords (select, typeof, etc.) +- [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) - plugin with keywords $merge and $patch +- [ajv-pack](https://github.com/ajv-validator/ajv-pack) - produces a compact module exporting validation functions +- [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) - format validators for draft2019 that aren't already included in ajv (ie. `idn-hostname`, `idn-email`, `iri`, `iri-reference` and `duration`). + +## Some packages using Ajv + +- [webpack](https://github.com/webpack/webpack) - a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser +- [jsonscript-js](https://github.com/JSONScript/jsonscript-js) - the interpreter for [JSONScript](http://www.jsonscript.org) - scripted processing of existing endpoints and services +- [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition +- [har-validator](https://github.com/ahmadnassri/har-validator) - HTTP Archive (HAR) validator +- [jsoneditor](https://github.com/josdejong/jsoneditor) - a web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org +- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON Schema http://jsonschemalint.com +- [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for Node.js +- [table](https://github.com/gajus/table) - formats data into a string table +- [ripple-lib](https://github.com/ripple/ripple-lib) - a JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser +- [restbase](https://github.com/wikimedia/restbase) - distributed storage with REST API & dispatcher for backend services built to provide a low-latency & high-throughput API for Wikipedia / Wikimedia content +- [hippie-swagger](https://github.com/CacheControl/hippie-swagger) - [Hippie](https://github.com/vesln/hippie) wrapper that provides end to end API testing with swagger validation +- [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation +- [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - a schema definition module for RabbitMQ graphs and messages +- [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema +- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON Schema with expect in mocha tests +- [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON Schema +- [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) - extract text from bundle into a file +- [electron-builder](https://github.com/electron-userland/electron-builder) - a solution to package and build a ready for distribution Electron app +- [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter +- [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages +- [ESLint](https://github.com/eslint/eslint) - the pluggable linting utility for JavaScript and JSX +- [Spectral](https://github.com/stoplightio/spectral) - the customizable linting utility for JSON/YAML, OpenAPI, AsyncAPI, and JSON Schema + + +## Tests + +``` +npm install +git submodule update --init +npm test +``` + +## Contributing + +All validation functions are generated using doT templates in [dot](https://github.com/ajv-validator/ajv/tree/master/lib/dot) folder. Templates are precompiled so doT is not a run-time dependency. + +`npm run build` - compiles templates to [dotjs](https://github.com/ajv-validator/ajv/tree/master/lib/dotjs) folder. + +`npm run watch` - automatically compiles templates when files in dot folder change + +Please see [Contributing guidelines](https://github.com/ajv-validator/ajv/blob/master/CONTRIBUTING.md) + + +## Changes history + +See https://github.com/ajv-validator/ajv/releases + +__Please note__: [Changes in version 7.0.0-beta](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0-beta.0) + +[Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0). + +## Code of conduct + +Please review and follow the [Code of conduct](https://github.com/ajv-validator/ajv/blob/master/CODE_OF_CONDUCT.md). + +Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team. + + +## Open-source software support + +Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers. + + +## License + +[MIT](https://github.com/ajv-validator/ajv/blob/master/LICENSE) diff --git a/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/ajv/lib/dotjs/README.md b/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/ajv/lib/dotjs/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4d994846c81f6303d08f97bba685d9c734527c52 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/ajv/lib/dotjs/README.md @@ -0,0 +1,3 @@ +These files are compiled dot templates from dot folder. + +Do NOT edit them directly, edit the templates and run `npm run build` from main ajv folder. diff --git a/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/globals/readme.md b/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/globals/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..29442a85510b95f3134f5e5d62d6db4f7c86fe10 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/globals/readme.md @@ -0,0 +1,44 @@ +# globals + +> Global identifiers from different JavaScript environments + +It's just a [JSON file](globals.json), so use it in any environment. + +This package is used by ESLint. + +**This package [no longer accepts](https://github.com/sindresorhus/globals/issues/82) new environments. If you need it for ESLint, just [create a plugin](http://eslint.org/docs/developer-guide/working-with-plugins#environments-in-plugins).** + +## Install + +```sh +npm install globals +``` + +## Usage + +```js +const globals = require('globals'); + +console.log(globals.browser); +/* +{ + addEventListener: false, + applicationCache: false, + ArrayBuffer: false, + atob: false, + … +} +*/ +``` + +Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise. + +For Node.js this package provides two sets of globals: + +- `globals.nodeBuiltin`: Globals available to all code running in Node.js. + These will usually be available as properties on the `global` object and include `process`, `Buffer`, but not CommonJS arguments like `require`. + See: https://nodejs.org/api/globals.html +- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope"). + See: https://nodejs.org/api/modules.html#modules_the_module_scope + +When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references. diff --git a/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/json-schema-traverse/README.md b/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/json-schema-traverse/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d5ccaf450a2a2bb88e5ae0778ce05712ef25c763 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/eslintrc/node_modules/json-schema-traverse/README.md @@ -0,0 +1,83 @@ +# json-schema-traverse +Traverse JSON Schema passing each schema object to callback + +[![Build Status](https://travis-ci.org/epoberezkin/json-schema-traverse.svg?branch=master)](https://travis-ci.org/epoberezkin/json-schema-traverse) +[![npm version](https://badge.fury.io/js/json-schema-traverse.svg)](https://www.npmjs.com/package/json-schema-traverse) +[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master) + + +## Install + +``` +npm install json-schema-traverse +``` + + +## Usage + +```javascript +const traverse = require('json-schema-traverse'); +const schema = { + properties: { + foo: {type: 'string'}, + bar: {type: 'integer'} + } +}; + +traverse(schema, {cb}); +// cb is called 3 times with: +// 1. root schema +// 2. {type: 'string'} +// 3. {type: 'integer'} + +// Or: + +traverse(schema, {cb: {pre, post}}); +// pre is called 3 times with: +// 1. root schema +// 2. {type: 'string'} +// 3. {type: 'integer'} +// +// post is called 3 times with: +// 1. {type: 'string'} +// 2. {type: 'integer'} +// 3. root schema + +``` + +Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is. Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed. + +Callback is passed these parameters: + +- _schema_: the current schema object +- _JSON pointer_: from the root schema to the current schema object +- _root schema_: the schema passed to `traverse` object +- _parent JSON pointer_: from the root schema to the parent schema object (see below) +- _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.) +- _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema +- _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'` + + +## Traverse objects in all unknown keywords + +```javascript +const traverse = require('json-schema-traverse'); +const schema = { + mySchema: { + minimum: 1, + maximum: 2 + } +}; + +traverse(schema, {allKeys: true, cb}); +// cb is called 2 times with: +// 1. root schema +// 2. mySchema +``` + +Without option `allKeys: true` callback will be called only with root schema. + + +## License + +[MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE) diff --git a/llama.cpp/tools/ui/node_modules/@eslint/js/README.md b/llama.cpp/tools/ui/node_modules/@eslint/js/README.md new file mode 100644 index 0000000000000000000000000000000000000000..eae3d22e06c6fea6599596c25edf8c6b59e29f3b --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/js/README.md @@ -0,0 +1,103 @@ +[![npm version](https://img.shields.io/npm/v/@eslint/js.svg)](https://www.npmjs.com/package/@eslint/js) +[![Downloads](https://img.shields.io/npm/dm/@eslint/js.svg)](https://www.npmjs.com/package/@eslint/js) +[![Build Status](https://github.com/eslint/eslint/workflows/CI/badge.svg)](https://github.com/eslint/eslint/actions) +
+[![Open Collective Backers](https://img.shields.io/opencollective/backers/eslint)](https://opencollective.com/eslint) +[![Open Collective Sponsors](https://img.shields.io/opencollective/sponsors/eslint)](https://opencollective.com/eslint) + +# ESLint JavaScript Plugin + +[Website](https://eslint.org) | +[Configure ESLint](https://eslint.org/docs/latest/use/configure) | +[Rules](https://eslint.org/docs/rules/) | +[Contribute to ESLint](https://eslint.org/docs/latest/contribute) | +[Report Bugs](https://eslint.org/docs/latest/contribute/report-bugs) | +[Code of Conduct](https://eslint.org/conduct) | +[X](https://x.com/geteslint) | +[Discord](https://eslint.org/chat) | +[Mastodon](https://fosstodon.org/@eslint) | +[Bluesky](https://bsky.app/profile/eslint.org) + +The beginnings of separating out JavaScript-specific functionality from ESLint. + +Right now, this plugin contains two configurations: + +- `recommended` - enables the rules recommended by the ESLint team (the replacement for `"eslint:recommended"`) +- `all` - enables all ESLint rules (the replacement for `"eslint:all"`) + +## Installation + +You can install ESLint using npm or other package managers: + +```shell +npm install eslint -D +# or +yarn add eslint -D +# or +pnpm install eslint -D +# or +bun add eslint -D +``` + +Then install this plugin: + +```shell +npm install @eslint/js -D +# or +yarn add @eslint/js -D +# or +pnpm install @eslint/js -D +# or +bun add @eslint/js -D +``` + +## Usage + +Use in your `eslint.config.js` file anytime you want to extend one of the configs: + +```js +import { defineConfig } from "eslint/config"; +import js from "@eslint/js"; + +export default defineConfig([ + // apply recommended rules to JS files + { + name: "your-project/recommended-rules", + files: ["**/*.js"], + plugins: { + js, + }, + extends: ["js/recommended"], + }, + + // apply recommended rules to JS files with an override + { + name: "your-project/recommended-rules-with-override", + files: ["**/*.js"], + plugins: { + js, + }, + extends: ["js/recommended"], + rules: { + "no-unused-vars": "warn", + }, + }, + + // apply all rules to JS files + { + name: "your-project/all-rules", + files: ["**/*.js"], + plugins: { + js, + }, + extends: ["js/all"], + rules: { + "no-unused-vars": "warn", + }, + }, +]); +``` + +## License + +MIT diff --git a/llama.cpp/tools/ui/node_modules/@eslint/object-schema/README.md b/llama.cpp/tools/ui/node_modules/@eslint/object-schema/README.md new file mode 100644 index 0000000000000000000000000000000000000000..edf6eb867cef006c438965373917f29bd642844b --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/object-schema/README.md @@ -0,0 +1,242 @@ +# ObjectSchema Package + +## Overview + +A JavaScript object merge/validation utility where you can define a different merge and validation strategy for each key. This is helpful when you need to validate complex data structures and then merge them in a way that is more complex than `Object.assign()`. This is used in the [`@eslint/config-array`](https://npmjs.com/package/@eslint/config-array) package but can also be used on its own. + +## Installation + +For Node.js and compatible runtimes: + +```shell +npm install @eslint/object-schema +# or +yarn add @eslint/object-schema +# or +pnpm install @eslint/object-schema +# or +bun add @eslint/object-schema +``` + +For Deno: + +```shell +deno add @eslint/object-schema +``` + +## Usage + +Import the `ObjectSchema` constructor: + +```js +// using ESM +import { ObjectSchema } from "@eslint/object-schema"; + +// using CommonJS +const { ObjectSchema } = require("@eslint/object-schema"); + +const schema = new ObjectSchema({ + // define a definition for the "downloads" key + downloads: { + required: true, + merge(value1, value2) { + return value1 + value2; + }, + validate(value) { + if (typeof value !== "number") { + throw new Error("Expected downloads to be a number."); + } + }, + }, + + // define a strategy for the "versions" key + version: { + required: true, + merge(value1, value2) { + return value1.concat(value2); + }, + validate(value) { + if (!Array.isArray(value)) { + throw new Error("Expected versions to be an array."); + } + }, + }, +}); + +const record1 = { + downloads: 25, + versions: ["v1.0.0", "v1.1.0", "v1.2.0"], +}; + +const record2 = { + downloads: 125, + versions: ["v2.0.0", "v2.1.0", "v3.0.0"], +}; + +// make sure the records are valid +schema.validate(record1); +schema.validate(record2); + +// merge together (schema.merge() accepts any number of objects) +const result = schema.merge(record1, record2); + +// result looks like this: + +const result = { + downloads: 75, + versions: ["v1.0.0", "v1.1.0", "v1.2.0", "v2.0.0", "v2.1.0", "v3.0.0"], +}; +``` + +## Tips and Tricks + +### Named merge strategies + +Instead of specifying a `merge()` method, you can specify one of the following strings to use a default merge strategy: + +- `"assign"` - use `Object.assign()` to merge the two values into one object. +- `"overwrite"` - the second value always replaces the first. +- `"replace"` - the second value replaces the first if the second is not `undefined`. + +For example: + +```js +const schema = new ObjectSchema({ + name: { + merge: "replace", + validate() {}, + }, +}); +``` + +### Named validation strategies + +Instead of specifying a `validate()` method, you can specify one of the following strings to use a default validation strategy: + +- `"array"` - value must be an array. +- `"boolean"` - value must be a boolean. +- `"number"` - value must be a number. +- `"object"` - value must be an object. +- `"object?"` - value must be an object or null. +- `"string"` - value must be a string. +- `"string!"` - value must be a non-empty string. + +For example: + +```js +const schema = new ObjectSchema({ + name: { + merge: "replace", + validate: "string", + }, +}); +``` + +### Subschemas + +If you are defining a key that is, itself, an object, you can simplify the process by using a subschema. Instead of defining `merge()` and `validate()`, assign a `schema` key that contains a schema definition, like this: + +```js +const schema = new ObjectSchema({ + name: { + schema: { + first: { + merge: "replace", + validate: "string", + }, + last: { + merge: "replace", + validate: "string", + }, + }, + }, +}); + +schema.validate({ + name: { + first: "n", + last: "z", + }, +}); +``` + +### Remove Keys During Merge + +If the merge strategy for a key returns `undefined`, then the key will not appear in the final object. For example: + +```js +const schema = new ObjectSchema({ + date: { + merge() { + return undefined; + }, + validate(value) { + Date.parse(value); // throws an error when invalid + }, + }, +}); + +const object1 = { date: "5/5/2005" }; +const object2 = { date: "6/6/2006" }; + +const result = schema.merge(object1, object2); + +console.log("date" in result); // false +``` + +### Requiring Another Key Be Present + +If you'd like the presence of one key to require the presence of another key, you can use the `requires` property to specify an array of other properties that any key requires. For example: + +```js +const schema = new ObjectSchema(); + +const schema = new ObjectSchema({ + date: { + merge() { + return undefined; + }, + validate(value) { + Date.parse(value); // throws an error when invalid + }, + }, + time: { + requires: ["date"], + merge(first, second) { + return second; + }, + validate(value) { + // ... + }, + }, +}); + +// throws error: Key "time" requires keys "date" +schema.validate({ + time: "13:45", +}); +``` + +In this example, even though `date` is an optional key, it is required to be present whenever `time` is present. + +## License + +Apache 2.0 + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

Qlty Software trunk.io Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Syntax Cybozu Sentry Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/llama.cpp/tools/ui/node_modules/@eslint/plugin-kit/README.md b/llama.cpp/tools/ui/node_modules/@eslint/plugin-kit/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b7ffb2c1a053dc880f4aff326c41789662b8cd52 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@eslint/plugin-kit/README.md @@ -0,0 +1,273 @@ +# ESLint Plugin Kit + +## Description + +A collection of utilities to help build ESLint plugins. + +## Installation + +For Node.js and compatible runtimes: + +```shell +npm install @eslint/plugin-kit +# or +yarn add @eslint/plugin-kit +# or +pnpm install @eslint/plugin-kit +# or +bun add @eslint/plugin-kit +``` + +For Deno: + +```shell +deno add @eslint/plugin-kit +``` + +## Usage + +This package exports the following utilities: + +- [`ConfigCommentParser`](#configcommentparser) - used to parse ESLint configuration comments (i.e., `/* eslint-disable rule */`) +- [`VisitNodeStep` and `CallMethodStep`](#visitnodestep-and-callmethodstep) - used to help implement `SourceCode#traverse()` +- [`Directive`](#directive) - used to help implement `SourceCode#getDisableDirectives()` +- [`TextSourceCodeBase`](#textsourcecodebase) - base class to help implement the `SourceCode` interface + +### `ConfigCommentParser` + +To use the `ConfigCommentParser` class, import it from the package and create a new instance, such as: + +```js +import { ConfigCommentParser } from "@eslint/plugin-kit"; + +// create a new instance +const commentParser = new ConfigCommentParser(); + +// pass in a comment string without the comment delimiters +const directive = commentParser.parseDirective( + "eslint-disable prefer-const, semi -- I don't want to use these.", +); + +// will be undefined when a directive can't be parsed +if (directive) { + console.log(directive.label); // "eslint-disable" + console.log(directive.value); // "prefer-const, semi" + console.log(directive.justification); // "I don't want to use these." +} +``` + +There are different styles of directive values that you'll need to parse separately to get the correct format: + +```js +import { ConfigCommentParser } from "@eslint/plugin-kit"; + +// create a new instance +const commentParser = new ConfigCommentParser(); + +// list format +const list = commentParser.parseListConfig("prefer-const, semi"); +console.log(Object.entries(list)); // [["prefer-const", true], ["semi", true]] + +// string format +const strings = commentParser.parseStringConfig("foo:off, bar"); +console.log(Object.entries(strings)); // [["foo", "off"], ["bar", null]] + +// JSON-like config format +const jsonLike = commentParser.parseJSONLikeConfig( + "semi:[error, never], prefer-const: warn", +); +console.log(Object.entries(jsonLike.config)); // [["semi", ["error", "never"]], ["prefer-const", "warn"]] +``` + +### `VisitNodeStep` and `CallMethodStep` + +The `VisitNodeStep` and `CallMethodStep` classes represent steps in the traversal of source code. They implement the correct interfaces to return from the `SourceCode#traverse()` method. + +The `VisitNodeStep` class is the more common of the two, where you are describing a visit to a particular node during the traversal. The constructor accepts three arguments: + +- `target` - the node being visited. This is used to determine the method to call inside of a rule. For instance, if the node's type is `Literal` then ESLint will call a method named `Literal()` on the rule (if present). +- `phase` - either 1 for enter or 2 for exit. +- `args` - an array of arguments to pass into the visitor method of a rule. + +For example: + +```js +import { VisitNodeStep } from "@eslint/plugin-kit"; + +class MySourceCode { + traverse() { + const steps = []; + + for (const { node, parent, phase } of iterator(this.ast)) { + steps.push( + new VisitNodeStep({ + target: node, + phase: phase === "enter" ? 1 : 2, + args: [node, parent], + }), + ); + } + + return steps; + } +} +``` + +The `CallMethodStep` class is less common and is used to tell ESLint to call a specific method on the rule. The constructor accepts two arguments: + +- `target` - the name of the method to call, frequently beginning with `"on"` such as `"onCodePathStart"`. +- `args` - an array of arguments to pass to the method. + +For example: + +```js +import { VisitNodeStep, CallMethodStep } from "@eslint/plugin-kit"; + +class MySourceCode { + traverse() { + const steps = []; + + for (const { node, parent, phase } of iterator(this.ast)) { + steps.push( + new VisitNodeStep({ + target: node, + phase: phase === "enter" ? 1 : 2, + args: [node, parent], + }), + ); + + // call a method indicating how many times we've been through the loop + steps.push( + new CallMethodStep({ + target: "onIteration", + args: [steps.length] + }); + ) + } + + return steps; + } +} +``` + +### `Directive` + +The `Directive` class represents a disable directive in the source code and implements the `Directive` interface from `@eslint/core`. You can tell ESLint about disable directives using the `SourceCode#getDisableDirectives()` method, where part of the return value is an array of `Directive` objects. Here's an example: + +```js +import { Directive, ConfigCommentParser } from "@eslint/plugin-kit"; + +class MySourceCode { + getDisableDirectives() { + const directives = []; + const problems = []; + const commentParser = new ConfigCommentParser(); + + // read in the inline config nodes to check each one + this.getInlineConfigNodes().forEach(comment => { + // Step 1: Parse the directive + const { label, value, justification } = + commentParser.parseDirective(comment.value); + + // Step 2: Extract the directive value and create the `Directive` object + switch (label) { + case "eslint-disable": + case "eslint-enable": + case "eslint-disable-next-line": + case "eslint-disable-line": { + const directiveType = label.slice("eslint-".length); + + directives.push( + new Directive({ + type: directiveType, + node: comment, + value, + justification, + }), + ); + } + + // ignore any comments that don't begin with known labels + } + }); + + return { + directives, + problems, + }; + } +} +``` + +### `TextSourceCodeBase` + +The `TextSourceCodeBase` class is intended to be a base class that has several of the common members found in `SourceCode` objects already implemented. Those members are: + +- `lines` - an array of text lines that is created automatically when the constructor is called. +- `getLoc(nodeOrToken)` - gets the location of a node or token. Works for nodes that have the ESLint-style `loc` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different location format, you'll still need to implement this method yourself. +- `getLocFromIndex(index)` - Converts a source text index into a `{ line: number, column: number }` pair. (For this method to work, the root node should always cover the entire source code text, and the `getLoc()` method needs to be implemented correctly.) +- `getIndexFromLoc(loc)` - Converts a `{ line: number, column: number }` pair into a source text index. (For this method to work, the root node should always cover the entire source code text, and the `getLoc()` method needs to be implemented correctly.) +- `getRange(nodeOrToken)` - gets the range of a node or token within the source text. Works for nodes that have the ESLint-style `range` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different range format, you'll still need to implement this method yourself. +- `getText(node, beforeCount, afterCount)` - gets the source text for the given node that has range information attached. Optionally, can return additional characters before and after the given node. As long as `getRange()` is properly implemented, this method will just work. +- `getAncestors(node)` - returns the ancestry of the node. In order for this to work, you must implement the `getParent()` method yourself. + +Here's an example: + +```js +import { TextSourceCodeBase } from "@eslint/plugin-kit"; + +export class MySourceCode extends TextSourceCodeBase { + #parents = new Map(); + + constructor({ ast, text }) { + super({ ast, text }); + } + + getParent(node) { + return this.#parents.get(node); + } + + traverse() { + const steps = []; + + for (const { node, parent, phase } of iterator(this.ast)) { + //save the parent information + this.#parent.set(node, parent); + + steps.push( + new VisitNodeStep({ + target: node, + phase: phase === "enter" ? 1 : 2, + args: [node, parent], + }), + ); + } + + return steps; + } +} +``` + +In general, it's safe to collect the parent information during the `traverse()` method as `getParent()` and `getAncestor()` will only be called from rules once the AST has been traversed at least once. + +## License + +Apache 2.0 + + + + +## Sponsors + +The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate) +to get your logo on our READMEs and [website](https://eslint.org/sponsors). + +

Platinum Sponsors

+

Automattic Airbnb

Gold Sponsors

+

Qlty Software trunk.io Shopify

Silver Sponsors

+

Vite Liftoff American Express StackBlitz

Bronze Sponsors

+

Syntax Cybozu Sentry Icons8 Discord GitBook Nx Mercedes-Benz Group HeroCoders LambdaTest

+

Technology Sponsors

+Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work. +

Netlify Algolia 1Password

+ diff --git a/llama.cpp/tools/ui/node_modules/@floating-ui/core/README.md b/llama.cpp/tools/ui/node_modules/@floating-ui/core/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c4b69b2ea13621bfb0fab5544bc16ad0f6ff4b73 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@floating-ui/core/README.md @@ -0,0 +1,4 @@ +# @floating-ui/core + +This is the platform-agnostic core of Floating UI, exposing the main +`computePosition` function but no platform interface logic. diff --git a/llama.cpp/tools/ui/node_modules/@floating-ui/dom/README.md b/llama.cpp/tools/ui/node_modules/@floating-ui/dom/README.md new file mode 100644 index 0000000000000000000000000000000000000000..47ef9272412a3d2234e03bd59f0daa5bdf8ab5a3 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@floating-ui/dom/README.md @@ -0,0 +1,4 @@ +# @floating-ui/dom + +This is the library to use Floating UI on the web, wrapping `@floating-ui/core` +with DOM interface logic. diff --git a/llama.cpp/tools/ui/node_modules/@floating-ui/utils/README.md b/llama.cpp/tools/ui/node_modules/@floating-ui/utils/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9e9d56e025e32d41815474c1bcce491c642b027d --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@floating-ui/utils/README.md @@ -0,0 +1,4 @@ +# @floating-ui/utils + +Utility functions shared across Floating UI packages. You may use these +functions in your own projects, but are subject to breaking changes. diff --git a/llama.cpp/tools/ui/node_modules/@hono/node-server/README.md b/llama.cpp/tools/ui/node_modules/@hono/node-server/README.md new file mode 100644 index 0000000000000000000000000000000000000000..af0e9311a077b9b72fa2e368fa837598b8b36aaa --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@hono/node-server/README.md @@ -0,0 +1,358 @@ +# Node.js Adapter for Hono + +This adapter `@hono/node-server` allows you to run your Hono application on Node.js. +Initially, Hono wasn't designed for Node.js, but with this adapter, you can now use Hono on Node.js. +It utilizes web standard APIs implemented in Node.js version 18 or higher. + +## Benchmarks + +Hono is 3.5 times faster than Express. + +Express: + +```txt +$ bombardier -d 10s --fasthttp http://localhost:3000/ + +Statistics Avg Stdev Max + Reqs/sec 16438.94 1603.39 19155.47 + Latency 7.60ms 7.51ms 559.89ms + HTTP codes: + 1xx - 0, 2xx - 164494, 3xx - 0, 4xx - 0, 5xx - 0 + others - 0 + Throughput: 4.55MB/s +``` + +Hono + `@hono/node-server`: + +```txt +$ bombardier -d 10s --fasthttp http://localhost:3000/ + +Statistics Avg Stdev Max + Reqs/sec 58296.56 5512.74 74403.56 + Latency 2.14ms 1.46ms 190.92ms + HTTP codes: + 1xx - 0, 2xx - 583059, 3xx - 0, 4xx - 0, 5xx - 0 + others - 0 + Throughput: 12.56MB/s +``` + +## Requirements + +It works on Node.js versions greater than 18.x. The specific required Node.js versions are as follows: + +- 18.x => 18.14.1+ +- 19.x => 19.7.0+ +- 20.x => 20.0.0+ + +Essentially, you can simply use the latest version of each major release. + +## Installation + +You can install it from the npm registry with `npm` command: + +```sh +npm install @hono/node-server +``` + +Or use `yarn`: + +```sh +yarn add @hono/node-server +``` + +## Usage + +Just import `@hono/node-server` at the top and write the code as usual. +The same code that runs on Cloudflare Workers, Deno, and Bun will work. + +```ts +import { serve } from '@hono/node-server' +import { Hono } from 'hono' + +const app = new Hono() +app.get('/', (c) => c.text('Hono meets Node.js')) + +serve(app, (info) => { + console.log(`Listening on http://localhost:${info.port}`) // Listening on http://localhost:3000 +}) +``` + +For example, run it using `ts-node`. Then an HTTP server will be launched. The default port is `3000`. + +```sh +ts-node ./index.ts +``` + +Open `http://localhost:3000` with your browser. + +## Options + +### `port` + +```ts +serve({ + fetch: app.fetch, + port: 8787, // Port number, default is 3000 +}) +``` + +### `createServer` + +```ts +import { createServer } from 'node:https' +import fs from 'node:fs' + +//... + +serve({ + fetch: app.fetch, + createServer: createServer, + serverOptions: { + key: fs.readFileSync('test/fixtures/keys/agent1-key.pem'), + cert: fs.readFileSync('test/fixtures/keys/agent1-cert.pem'), + }, +}) +``` + +### `overrideGlobalObjects` + +The default value is `true`. The Node.js Adapter rewrites the global Request/Response and uses a lightweight Request/Response to improve performance. If you don't want to do that, set `false`. + +```ts +serve({ + fetch: app.fetch, + overrideGlobalObjects: false, +}) +``` + +### `autoCleanupIncoming` + +The default value is `true`. The Node.js Adapter automatically cleans up (explicitly call `destroy()` method) if application is not finished to consume the incoming request. If you don't want to do that, set `false`. + +If the application accepts connections from arbitrary clients, this cleanup must be done otherwise incomplete requests from clients may cause the application to stop responding. If your application only accepts connections from trusted clients, such as in a reverse proxy environment and there is no process that returns a response without reading the body of the POST request all the way through, you can improve performance by setting it to `false`. + +```ts +serve({ + fetch: app.fetch, + autoCleanupIncoming: false, +}) +``` + +## Middleware + +Most built-in middleware also works with Node.js. +Read [the documentation](https://hono.dev/middleware/builtin/basic-auth) and use the Middleware of your liking. + +```ts +import { serve } from '@hono/node-server' +import { Hono } from 'hono' +import { prettyJSON } from 'hono/pretty-json' + +const app = new Hono() + +app.get('*', prettyJSON()) +app.get('/', (c) => c.json({ 'Hono meets': 'Node.js' })) + +serve(app) +``` + +## Serve Static Middleware + +Use Serve Static Middleware that has been created for Node.js. + +```ts +import { serveStatic } from '@hono/node-server/serve-static' + +//... + +app.use('/static/*', serveStatic({ root: './' })) +``` + +If using a relative path, `root` will be relative to the current working directory from which the app was started. + +This can cause confusion when running your application locally. + +Imagine your project structure is: + +``` +my-hono-project/ + src/ + index.ts + static/ + index.html +``` + +Typically, you would run your app from the project's root directory (`my-hono-project`), +so you would need the following code to serve the `static` folder: + +```ts +app.use('/static/*', serveStatic({ root: './static' })) +``` + +Notice that `root` here is not relative to `src/index.ts`, rather to `my-hono-project`. + +### Options + +#### `rewriteRequestPath` + +If you want to serve files in `./.foojs` with the request path `/__foo/*`, you can write like the following. + +```ts +app.use( + '/__foo/*', + serveStatic({ + root: './.foojs/', + rewriteRequestPath: (path: string) => path.replace(/^\/__foo/, ''), + }) +) +``` + +#### `onFound` + +You can specify handling when the requested file is found with `onFound`. + +```ts +app.use( + '/static/*', + serveStatic({ + // ... + onFound: (_path, c) => { + c.header('Cache-Control', `public, immutable, max-age=31536000`) + }, + }) +) +``` + +#### `onNotFound` + +The `onNotFound` is useful for debugging. You can write a handle for when a file is not found. + +```ts +app.use( + '/static/*', + serveStatic({ + root: './non-existent-dir', + onNotFound: (path, c) => { + console.log(`${path} is not found, request to ${c.req.path}`) + }, + }) +) +``` + +#### `precompressed` + +The `precompressed` option checks if files with extensions like `.br` or `.gz` are available and serves them based on the `Accept-Encoding` header. It prioritizes Brotli, then Zstd, and Gzip. If none are available, it serves the original file. + +```ts +app.use( + '/static/*', + serveStatic({ + precompressed: true, + }) +) +``` + +## ConnInfo Helper + +You can use the [ConnInfo Helper](https://hono.dev/docs/helpers/conninfo) by importing `getConnInfo` from `@hono/node-server/conninfo`. + +```ts +import { getConnInfo } from '@hono/node-server/conninfo' + +app.get('/', (c) => { + const info = getConnInfo(c) // info is `ConnInfo` + return c.text(`Your remote address is ${info.remote.address}`) +}) +``` + +## Accessing Node.js API + +You can access the Node.js API from `c.env` in Node.js. For example, if you want to specify a type, you can write the following. + +```ts +import { serve } from '@hono/node-server' +import type { HttpBindings } from '@hono/node-server' +import { Hono } from 'hono' + +const app = new Hono<{ Bindings: HttpBindings }>() + +app.get('/', (c) => { + return c.json({ + remoteAddress: c.env.incoming.socket.remoteAddress, + }) +}) + +serve(app) +``` + +The APIs that you can get from `c.env` are as follows. + +```ts +type HttpBindings = { + incoming: IncomingMessage + outgoing: ServerResponse +} + +type Http2Bindings = { + incoming: Http2ServerRequest + outgoing: Http2ServerResponse +} +``` + +## Direct response from Node.js API + +You can directly respond to the client from the Node.js API. +In that case, the response from Hono should be ignored, so return `RESPONSE_ALREADY_SENT`. + +> [!NOTE] +> This feature can be used when migrating existing Node.js applications to Hono, but we recommend using Hono's API for new applications. + +```ts +import { serve } from '@hono/node-server' +import type { HttpBindings } from '@hono/node-server' +import { RESPONSE_ALREADY_SENT } from '@hono/node-server/utils/response' +import { Hono } from 'hono' + +const app = new Hono<{ Bindings: HttpBindings }>() + +app.get('/', (c) => { + const { outgoing } = c.env + outgoing.writeHead(200, { 'Content-Type': 'text/plain' }) + outgoing.end('Hello World\n') + + return RESPONSE_ALREADY_SENT +}) + +serve(app) +``` + +## Listen to a UNIX domain socket + +You can configure the HTTP server to listen to a UNIX domain socket instead of a TCP port. + +```ts +import { createAdaptorServer } from '@hono/node-server' + +// ... + +const socketPath = '/tmp/example.sock' + +const server = createAdaptorServer(app) +server.listen(socketPath, () => { + console.log(`Listening on ${socketPath}`) +}) +``` + +## Related projects + +- Hono - +- Hono GitHub repository - + +## Authors + +- Yusuke Wada +- Taku Amano + +## License + +MIT diff --git a/llama.cpp/tools/ui/node_modules/@humanfs/core/README.md b/llama.cpp/tools/ui/node_modules/@humanfs/core/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4f86d14d66fd15bff2daecf9be05713639800e1f --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@humanfs/core/README.md @@ -0,0 +1,140 @@ +# `@humanfs/core` + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star. + +## Description + +The core functionality for humanfs that is shared across all implementations for all runtimes. The contents of this package are intentionally runtime agnostic and are not intended to be used alone. + +Currently, this package simply exports the `Hfs` class, which is an abstract base class intended to be inherited from in runtime-specific hfs packages (like `@humanfs/node`). + +> [!WARNING] +> This project is **experimental** and may change significantly before v1.0.0. Use at your own caution and definitely not in production! + +## Installation + +### Node.js + +Install using your favorite package manager for Node.js: + +```shell +npm install @humanfs/core + +# or + +pnpm install @humanfs/core + +# or + +yarn add @humanfs/core + +# or + +bun install @humanfs/core +``` + +Then you can import the `Hfs` and `Path` classes like this: + +```js +import { Hfs, Path } from "@humanfs/core"; +``` + +### Deno + +Install using [JSR](https://jsr.io): + +```shell +deno add @humanfs/core + +# or + +jsr add @humanfs/core +``` + +Then you can import the `Hfs` class like this: + +```js +import { Hfs, Path } from "@humanfs/core"; +``` + +### Browser + +It's recommended to import the minified version to save bandwidth: + +```js +import { Hfs, Path } from "https://cdn.skypack.dev/@humanfs/core?min"; +``` + +However, you can also import the unminified version for debugging purposes: + +```js +import { Hfs, Path } from "https://cdn.skypack.dev/@humanfs/core"; +``` + +## Usage + +### `Hfs` Class + +The `Hfs` class contains all of the basic functionality for an `Hfs` instance *without* a predefined impl. This class is mostly used for creating runtime-specific impls, such as `NodeHfs` and `DenoHfs`. + +You can create your own instance by providing an `impl` directly: + +```js +const hfs = new Hfs({ impl: { async text() {} }}); +``` + +The specified `impl` becomes the base impl for the instance, meaning you can always reset back to it using `resetImpl()`. + +You can also inherit from `Hfs` to create your own class with a preconfigured impl, such as: + +```js +class MyHfs extends Hfs { + constructor() { + super({ + impl: myImpl + }); + } +} +``` + +### `Path` Class + +The `Path` class represents the path to a directory or file within a file system. It's an abstract representation that can be used even outside of traditional file systems where string paths might not make sense. + +```js +const myPath = new Path(["dir", "subdir"]); +console.log(myPath.toString()); // "dir/subdir" + +// add another step +myPath.push("file.txt"); +console.log(myPath.toString()); // "dir/subdir/file.txt" + +// get just the last step +console.log(myPath.name); // "file.txt" + +// change just the last step +myPath.name = "file.json"; +console.log(myPath.name); // "file.json" +console.log(myPath.toString()); // "dir/subdir/file.json" + +// get the size of the path +console.log(myPath.size); // 3 + +// remove the last step +myPath.pop(); +console.log(myPath.toString()); // "dir/subdir" + +// iterate over the steps +for (const step of myPath) { + // do something +} + +// create a new path from a string +const newPath = Path.fromString("/foo/bar"); +``` + +## License + +Apache 2.0 diff --git a/llama.cpp/tools/ui/node_modules/@humanfs/node/README.md b/llama.cpp/tools/ui/node_modules/@humanfs/node/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c3e4be478fa18cf8b05526f394d6c03524ac1949 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@humanfs/node/README.md @@ -0,0 +1,141 @@ +# `@humanfs/node` + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star. + +## Description + +The `hfs` bindings for use in Node.js and Node.js-compatible runtimes. + +> [!WARNING] +> This project is **experimental** and may change significantly before v1.0.0. Use at your own caution and definitely not in production! + +## Installation + +Install using your favorite package manager: + +```shell +npm install @humanfs/node + +# or + +pnpm install @humanfs/node + +# or + +yarn add @humanfs/node + +# or + +bun install @humanfs/node +``` + +## Usage + +The easiest way to use hfs in your project is to import the `hfs` object: + +```js +import { hfs } from "@humanfs/node"; +``` + +Then, you can use the API methods: + +```js +// 1. Files + +// read from a text file +const text = await hfs.text("file.txt"); + +// read from a JSON file +const json = await hfs.json("file.json"); + +// read raw bytes from a text file +const arrayBuffer = await hfs.arrayBuffer("file.txt"); + +// write text to a file +await hfs.write("file.txt", "Hello world!"); + +// write bytes to a file +await hfs.write("file.txt", new TextEncoder().encode("Hello world!")); + +// append text to a file +await hfs.append("file.txt", "Hello world!"); + +// append bytes to a file +await hfs.append("file.txt", new TextEncoder().encode("Hello world!")); + +// does the file exist? +const found = await hfs.isFile("file.txt"); + +// how big is the file? +const size = await hfs.size("file.txt"); + +// when was the file modified? +const mtime = await hfs.lastModified("file.txt"); + +// copy a file from one location to another +await hfs.copy("file.txt", "file-copy.txt"); + +// move a file from one location to another +await hfs.move("file.txt", "renamed.txt"); + +// delete a file +await hfs.delete("file.txt"); + +// 2. Directories + +// create a directory +await hfs.createDirectory("dir"); + +// create a directory recursively +await hfs.createDirectory("dir/subdir"); + +// does the directory exist? +const dirFound = await hfs.isDirectory("dir"); + +// copy the entire directory +hfs.copyAll("from-dir", "to-dir"); + +// move the entire directory +hfs.moveAll("from-dir", "to-dir"); + +// delete a directory +await hfs.delete("dir"); + +// delete a non-empty directory +await hfs.deleteAll("dir"); +``` + +If you'd like to create your own instance, import the `NodeHfs` constructor: + +```js +import { NodeHfs } from "@humanfs/node"; +import fsp from "fs/promises"; + +const hfs = new NodeHfs(); + +// optionally specify the fs/promises object to use +const hfs = new NodeHfs({ fsp }); +``` + +If you'd like to use just the impl, import the `NodeHfsImpl` constructor: + +```js +import { NodeHfsImpl } from "@humanfs/node"; +import fsp from "fs/promises"; + +const hfs = new NodeHfsImpl(); + +// optionally specify the fs/promises object to use +const hfs = new NodeHfsImpl({ fsp }); +``` + +## Errors Handled + +* `ENOENT` - in most cases, these errors are handled silently. +* `ENFILE` and `EMFILE` - calls that result in these errors are retried for up to 60 seconds before giving up for good. + +## License + +Apache 2.0 diff --git a/llama.cpp/tools/ui/node_modules/@humanfs/types/CHANGELOG.md b/llama.cpp/tools/ui/node_modules/@humanfs/types/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..fd9725fa5e278c233b75a2fd90bc698ff11fb2fe --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@humanfs/types/CHANGELOG.md @@ -0,0 +1,150 @@ +# Changelog + +## [0.15.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.14.0...types-v0.15.0) (2024-09-09) + + +### Features + +* Add depth to HfsWalkEntry ([#130](https://github.com/humanwhocodes/humanfs/issues/130)) ([a633452](https://github.com/humanwhocodes/humanfs/commit/a63345260562b798e73c2ea63612e6fe95ac400d)) + +## [0.14.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.13.0...types-v0.14.0) (2024-06-12) + + +### Features + +* Implement Hfs#walk() method ([#119](https://github.com/humanwhocodes/humanfs/issues/119)) ([2aeade0](https://github.com/humanwhocodes/humanfs/commit/2aeade0ffbef886103dc38d16694e9b63191a8df)) + +## [0.13.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.12.0...types-v0.13.0) (2024-03-20) + + +### ⚠ BREAKING CHANGES + +* delete/deleteAll should not throw on ENOENT ([#105](https://github.com/humanwhocodes/humanfs/issues/105)) + +### Features + +* delete/deleteAll should not throw on ENOENT ([#105](https://github.com/humanwhocodes/humanfs/issues/105)) ([b508df1](https://github.com/humanwhocodes/humanfs/commit/b508df19845f7a914895c13cfe47707c0cd1a7c7)) + +## [0.12.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.11.0...types-v0.12.0) (2024-02-27) + + +### Features + +* impl write() method only needs to handle Uint8Arrays ([#92](https://github.com/humanwhocodes/humanfs/issues/92)) ([68bcfb5](https://github.com/humanwhocodes/humanfs/commit/68bcfb59a6684b184c55f97536aad730636299b5)) + +## [0.11.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.10.0...types-v0.11.0) (2024-02-23) + + +### Features + +* Impls only need bytes() method to read data ([#90](https://github.com/humanwhocodes/humanfs/issues/90)) ([c0c3b36](https://github.com/humanwhocodes/humanfs/commit/c0c3b36413c8d10e63a94ad1cc6a5cead7b52e88)) + +## [0.10.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.9.0...types-v0.10.0) (2024-02-16) + + +### ⚠ BREAKING CHANGES + +* Rewrite MemoryHfsImpl to support lastModified() ([#87](https://github.com/humanwhocodes/humanfs/issues/87)) + +### Features + +* Add lastModified() method ([#84](https://github.com/humanwhocodes/humanfs/issues/84)) ([9cbcd03](https://github.com/humanwhocodes/humanfs/commit/9cbcd03c86e4c1bed5985e10da6ab452e8c2b44c)) +* Rewrite MemoryHfsImpl to support lastModified() ([#87](https://github.com/humanwhocodes/humanfs/issues/87)) ([84e9812](https://github.com/humanwhocodes/humanfs/commit/84e98129e48acb3f2ea067b0ea745d591e8d8b91)) + +## [0.9.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.8.0...types-v0.9.0) (2024-02-14) + + +### Features + +* Add append() method ([#82](https://github.com/humanwhocodes/humanfs/issues/82)) ([ab7b978](https://github.com/humanwhocodes/humanfs/commit/ab7b978ff3be84dc3fd2fd4d6fa1131dfdec8134)) +* Add move() and moveAll() methods ([#80](https://github.com/humanwhocodes/humanfs/issues/80)) ([85f100b](https://github.com/humanwhocodes/humanfs/commit/85f100b721c99b920b307779548c2a043e7e18b5)) + +## [0.8.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.7.0...types-v0.8.0) (2024-02-09) + + +### Features + +* Add copyAll() method ([#77](https://github.com/humanwhocodes/humanfs/issues/77)) ([3c0852a](https://github.com/humanwhocodes/humanfs/commit/3c0852af99cb835b3941f58fdc2206e7b1179e21)) + +## [0.7.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.6.0...types-v0.7.0) (2024-02-08) + + +### Features + +* Add copy() method ([#69](https://github.com/humanwhocodes/humanfs/issues/69)) ([f252bac](https://github.com/humanwhocodes/humanfs/commit/f252bac6692a5b5c973ee3c696f5190caa5f12c7)) + +## [0.6.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.5.1...types-v0.6.0) (2024-02-07) + + +### Features + +* Allow URL file and directory paths ([#62](https://github.com/humanwhocodes/humanfs/issues/62)) ([a767e37](https://github.com/humanwhocodes/humanfs/commit/a767e372287b1556c4c9e8bdb26c23ff81866f99)) + +## [0.5.1](https://github.com/humanwhocodes/humanfs/compare/types-v0.5.0...types-v0.5.1) (2024-01-31) + + +### Bug Fixes + +* Order of exports and engines in package.json ([66204c2](https://github.com/humanwhocodes/humanfs/commit/66204c24bc2dd02380aa2fb3c5769ca2cf5238a7)), closes [#61](https://github.com/humanwhocodes/humanfs/issues/61) + +## [0.5.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.4.0...types-v0.5.0) (2024-01-30) + + +### ⚠ BREAKING CHANGES + +* Rename fsx -> humanfs ([#56](https://github.com/humanwhocodes/humanfs/issues/56)) + +### Features + +* Rename fsx -> humanfs ([#56](https://github.com/humanwhocodes/humanfs/issues/56)) ([f5dc533](https://github.com/humanwhocodes/humanfs/commit/f5dc533c8a46d45afd7aad602af39a6074f8a07b)) + +## [0.4.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.3.0...fsx-types-v0.4.0) (2024-01-27) + + +### Features + +* New size() method ([#51](https://github.com/humanwhocodes/fsx/issues/51)) ([ffd12e6](https://github.com/humanwhocodes/fsx/commit/ffd12e6b0db318320dd5a9dbb8eb248106d60afa)) + +## [0.3.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.2.0...fsx-types-v0.3.0) (2024-01-23) + + +### ⚠ BREAKING CHANGES + +* Safer delete(); new deleteAll() method ([#37](https://github.com/humanwhocodes/fsx/issues/37)) + +### Features + +* Safer delete(); new deleteAll() method ([#37](https://github.com/humanwhocodes/fsx/issues/37)) ([2e85142](https://github.com/humanwhocodes/fsx/commit/2e85142e34bdc3cc18e18aa0b051cc9007fca4b8)) +* write() to accept ArrayBuffer views as file contents ([1fd5517](https://github.com/humanwhocodes/fsx/commit/1fd55174a528ef3dcbabc154347006bec799f3f9)) + + +### Bug Fixes + +* **types:** Ensure FsxImpl methods also return undefined ([14eadc6](https://github.com/humanwhocodes/fsx/commit/14eadc66b19e40d7406a166e019004d9888075d3)), closes [#32](https://github.com/humanwhocodes/fsx/issues/32) + +## [0.2.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.1.0...fsx-types-v0.2.0) (2024-01-19) + + +### Features + +* Add list() method ([#25](https://github.com/humanwhocodes/fsx/issues/25)) ([dad841b](https://github.com/humanwhocodes/fsx/commit/dad841b7c9f5312996ff23db9be36774af985157)) + +## [0.1.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.0.3...fsx-types-v0.1.0) (2024-01-18) + + +### Features + +* Add bytes() method, deprecate arrayBuffer() ([718c9c8](https://github.com/humanwhocodes/fsx/commit/718c9c84a0a1dcaef3cc032c882b1308e9cb3273)) + +## [0.0.3](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.0.2...fsx-types-v0.0.3) (2024-01-16) + + +### Bug Fixes + +* Ensure isFile/isDirectory rethrow non-ENOENT errors. ([d31ee56](https://github.com/humanwhocodes/fsx/commit/d31ee56788e898cbc1fc0d6a54d1551f9b17cd45)), closes [#14](https://github.com/humanwhocodes/fsx/issues/14) + +## [0.0.2](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.0.1...fsx-types-v0.0.2) (2024-01-06) + +### Bug Fixes + +- **docs:** Correct package names in READMEs ([6c552ac](https://github.com/humanwhocodes/fsx/commit/6c552ac74542a245cdc2675101858da022336a1a)) diff --git a/llama.cpp/tools/ui/node_modules/@humanfs/types/README.md b/llama.cpp/tools/ui/node_modules/@humanfs/types/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7a476fce766818297091124810ff69e8414032e0 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@humanfs/types/README.md @@ -0,0 +1,13 @@ +# `@humanfs/types` + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star. + +## Description + +Additional type definitions for humanfs. These are used primarily to share type definitions across packages because there is no easy way to export imported type definitions using JavaScript and JSDoc. + +## License + +Apache 2.0 diff --git a/llama.cpp/tools/ui/node_modules/@humanwhocodes/module-importer/CHANGELOG.md b/llama.cpp/tools/ui/node_modules/@humanwhocodes/module-importer/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..1b442a195d9898cfba6c87d1d9212f494af468de --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@humanwhocodes/module-importer/CHANGELOG.md @@ -0,0 +1,15 @@ +# Changelog + +## [1.0.1](https://github.com/humanwhocodes/module-importer/compare/v1.0.0...v1.0.1) (2022-08-18) + + +### Bug Fixes + +* Ensure CommonJS mode works correctly. ([cf54a0b](https://github.com/humanwhocodes/module-importer/commit/cf54a0b998085066fbe1776dd0b4cacd808cc192)), closes [#6](https://github.com/humanwhocodes/module-importer/issues/6) + +## 1.0.0 (2022-08-17) + + +### Features + +* Implement ModuleImporter ([3ce4e82](https://www.github.com/humanwhocodes/module-importer/commit/3ce4e820c30c114e787bfed00a0966ac4772f563)) diff --git a/llama.cpp/tools/ui/node_modules/@humanwhocodes/module-importer/README.md b/llama.cpp/tools/ui/node_modules/@humanwhocodes/module-importer/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3de07a7fb21a01258abb1a6d8703c0269d94ddc0 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@humanwhocodes/module-importer/README.md @@ -0,0 +1,80 @@ +# ModuleImporter + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate). + +## Description + +A utility for seamlessly importing modules in Node.js regardless if they are CommonJS or ESM format. Under the hood, this uses `import()` and relies on Node.js's CommonJS compatibility to work correctly. This ensures that the correct locations and formats are used for CommonJS so you can call one method and not worry about any compatibility issues. + +The problem with the default `import()` is that it always resolves relative to the file location in which it is called. If you want to resolve from a different location, you need to jump through a few hoops to achieve that. This package makes it easy to both resolve and import modules from any directory. + +## Usage + +### Node.js + +Install using [npm][npm] or [yarn][yarn]: + +``` +npm install @humanwhocodes/module-importer + +# or + +yarn add @humanwhocodes/module-importer +``` + +Import into your Node.js project: + +```js +// CommonJS +const { ModuleImporter } = require("@humanwhocodes/module-importer"); + +// ESM +import { ModuleImporter } from "@humanwhocodes/module-importer"; +``` + +### Bun + +Install using this command: + +``` +bun add @humanwhocodes/module-importer +``` + +Import into your Bun project: + +```js +import { ModuleImporter } from "@humanwhocodes/module-importer"; +``` + +## API + +After importing, create a new instance of `ModuleImporter` to start emitting events: + +```js +// cwd can be omitted to use process.cwd() +const importer = new ModuleImporter(cwd); + +// you can resolve the location of any package +const location = importer.resolve("./some-file.cjs"); + +// you can also import directly +const module = importer.import("./some-file.cjs"); +``` + +For both `resolve()` and `import()`, you can pass in package names and filenames. + +## Developer Setup + +1. Fork the repository +2. Clone your fork +3. Run `npm install` to setup dependencies +4. Run `npm test` to run tests + +## License + +Apache 2.0 + +[npm]: https://npmjs.com/ +[yarn]: https://yarnpkg.com/ diff --git a/llama.cpp/tools/ui/node_modules/@humanwhocodes/retry/README.md b/llama.cpp/tools/ui/node_modules/@humanwhocodes/retry/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0ec7a471d19c84cdc2dae982a992055f0f989ffb --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@humanwhocodes/retry/README.md @@ -0,0 +1,177 @@ +# Retry utility + +by [Nicholas C. Zakas](https://humanwhocodes.com) + +If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star. + +## Description + +A utility for retrying failed async JavaScript calls based on the error returned. + +## Usage + +### Node.js + +Install using [npm][npm] or [yarn][yarn]: + +``` +npm install @humanwhocodes/retry + +# or + +yarn add @humanwhocodes/retry +``` + +Import into your Node.js project: + +```js +// CommonJS +const { Retrier } = require("@humanwhocodes/retry"); + +// ESM +import { Retrier } from "@humanwhocodes/retry"; +``` + +### Deno + +Install using [JSR](https://jsr.io): + +```shell +deno add @humanwhocodes/retry + +#or + +jsr add @humanwhocodes/retry +``` + +Then import into your Deno project: + +```js +import { Retrier } from "@humanwhocodes/retry"; +``` + +### Bun + +Install using this command: + +``` +bun add @humanwhocodes/retry +``` + +Import into your Bun project: + +```js +import { Retrier } from "@humanwhocodes/retry"; +``` + +### Browser + +It's recommended to import the minified version to save bandwidth: + +```js +import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry?min"; +``` + +However, you can also import the unminified version for debugging purposes: + +```js +import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry"; +``` + +## API + +After importing, create a new instance of `Retrier` and specify the function to run on the error. This function should return `true` if you want the call retried and `false` if not. + +```js +// this instance will retry if the specific error code is found +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}); +``` + +Then, call the `retry()` method around the function you'd like to retry, such as: + +```js +import fs from "fs/promises"; + +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}); + +const text = await retrier.retry(() => fs.readFile("README.md", "utf8")); +``` + +The `retry()` method will either pass through the result on success or wait and retry on failure. Any error that isn't caught by the retrier is automatically rejected so the end result is a transparent passing through of both success and failure. + +### Setting a Timeout + +You can control how long a task will attempt to retry before giving up by passing the `timeout` option to the `Retrier` constructor. By default, the timeout is one minute. + +```js +import fs from "fs/promises"; + +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}, { timeout: 100_000 }); + +const text = await retrier.retry(() => fs.readFile("README.md", "utf8")); +``` + +When a call times out, it rejects the first error that was received from calling the function. + +### Setting a Concurrency Limit + +When processing a large number of function calls, you can limit the number of concurrent function calls by passing the `concurrency` option to the `Retrier` constructor. By default, `concurrency` is 1000. + +```js +import fs from "fs/promises"; + +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}, { concurrency: 100 }); + +const filenames = getFilenames(); +const contents = await Promise.all( + filenames.map(filename => retrier.retry(() => fs.readFile(filename, "utf8")) +); +``` + +### Aborting with `AbortSignal` + +You can also pass an `AbortSignal` to cancel a retry: + +```js +import fs from "fs/promises"; + +const controller = new AbortController(); +const retrier = new Retrier(error => { + return error.code === "ENFILE" || error.code === "EMFILE"; +}); + +const text = await retrier.retry( + () => fs.readFile("README.md", "utf8"), + { signal: controller.signal } +); +``` + +## Developer Setup + +1. Fork the repository +2. Clone your fork +3. Run `npm install` to setup dependencies +4. Run `npm test` to run tests + +### Debug Output + +Enable debugging output by setting the `DEBUG` environment variable to `"@hwc/retry"` before running. + +## License + +Apache 2.0 + +## Prior Art + +This utility is inspired by, and contains code from [`graceful-fs`](https://github.com/isaacs/node-graceful-fs). + +[npm]: https://npmjs.com/ +[yarn]: https://yarnpkg.com/ diff --git a/llama.cpp/tools/ui/node_modules/@iconify/types/README.md b/llama.cpp/tools/ui/node_modules/@iconify/types/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7480c511c168cb25316e0dfa99abcf110e177666 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@iconify/types/README.md @@ -0,0 +1,459 @@ +# Iconify Types + +Type definitions for using Iconify icon sets with TypeScript. + +## Files structure + +Iconify icon sets are available in several formats: + +- Big JSON files that combine many icons in one file +- Node.js packages split into individual icons + +### Icon format + +Each icon is represented by the `IconifyIcon` type. It is a simple object with multiple string, number or boolean attributes. + +The only required attribute is: + +- `body`: string. Value contains inner HTML of an icon as a string, for example ``. + +Optional attributes are represented by type `IconifyOptional`. They are split into several types: dimensions (`IconifyDimenisons` type) and transformations (`IconifyTransformations` type). + +Dimensions attributes: + +- `width`: number. viewBox width, number. If missing, value is set to 16. +- `height`: number. viewBox height, number. If missing, value is set to 16. +- `left`: number. viewBox left, number. If missing, the value is set to 0. +- `top`: number. viewBox top, number. If missing, the value is set to 0. + +Transformations: + +- `rotate`: number. Icon rotation. Iconify icons can be rotated in 90 degrees increments, allowing to reuse the same source icon for multiple icons, such as arrow-up being a copy of arrow-left rotated by 90 degrees. Values are 0 for 0 degrees, 1 for 90 degrees, 2 for 180 degrees, 3 for 270 degrees. The default value is 0. +- `hFlip`: boolean. Horizontal flip. Similar to the rotation transformation, an icon can be flipped horizontally and vertically. It can be used to quickly create aliases, such as arrow-left being an alias of arrow-right, but with hFlip set to true. The default value is false. +- `vFlip`: boolean. Vertical flip. The default value is false. + +Example of icon object: + +```js +const mdiHandIcon = { + body: '', + width: 24, + height: 24, +}; +``` + +### Icon sets format + +Iconify icon sets format is available from multiple sources: + +- NPM package `@iconify/json` that includes all icon sets +- API responses used by SVG framework + +Icon set format structure is available as the `IconifyJSON` type. It is an object with several fields: + +- `prefix`: string. Icon set prefix. +- `icons`: object. Icons data. Value is an object that represents a set of icons, where the key is an icon name and value is `IconifyIcon` object (see "Icon format" above). +- `aliases`: object. Icon aliases, similar to the `icons` object (see "Aliases" section below). + +Example: + +```json +{ + "prefix": "mdi", + "icons": { + "home": { + "body": "", + "width": 24, + "height": 24 + }, + "arrow-left": { + "body": "", + "width": 24, + "height": 24 + } + } +} +``` + +All icon properties except for `body` are optional and are represented by type `IconifyOptional`. Type `IconifyJSON` also extends type `IconifyOptional`, allowing all optional properties to be placed in the root object. + +If an icon is missing a property, look in the root object for the default value. If the root object does not have the default value, use Iconify default value for that property (see list of properties and default values in the "Icon format" section above). + +Default values in the root object make it possible to reduce duplication. + +Example: + +```json +{ + "prefix": "mdi", + "icons": { + "home": { + "body": "" + }, + "arrow-left": { + "body": "" + } + }, + "width": 24, + "height": 24 +} +``` + +In this example, both icons are 24x24, so width and height have been moved to the root object. + +Another example: + +```json +{ + "prefix": "fa-solid", + "icons": { + "arrow-left": { + "body": "", + "width": 448 + }, + "arrow-circle-left": { + "body": "" + }, + "barcode": { + "body": "" + } + }, + "width": 512, + "height": 512 +} +``` + +In this example `arrow-circle-left` and `barcode` have width of 512, `arrow-left` has width of 448. All icons have a height of 512. + +#### Aliases + +In addition to `icons`, another important field in icon set object is `aliases`. + +Aliases object is similar to icons object, except that instead of icon body icons reference another icon. + +Each entry has the same attributes as an icon, except for `body` and has required attribute `parent` that contains the name of the parent icon. The parent icon must be present in the icon set file. + +Example: + +```json +{ + "prefix": "fa", + "icons": { + "automobile": { + "body": "", + "width": 2048, + "height": 1600 + } + }, + "aliases": { + "car": { + "parent": "automobile" + } + } +} +``` + +In this example `car` is an alias of `automobile`, allowing to use the same icon by multiple names. + +Another example: + +```json +{ + "prefix": "fa", + "icons": { + "caret-left": { + "body": "", + "width": 576, + "height": 1280 + } + }, + "aliases": { + "caret-right": { + "parent": "caret-left", + "hFlip": true + } + } +} +``` + +In this example `caret-right` is alias of `caret-left`, but with additional `hFlip` attribute. It is identical to this: + +```json +{ + "prefix": "fa", + "icons": { + "caret-left": { + "body": "" + }, + "caret-right": { + "body": "", + "hFlip": true + } + }, + "width": 576, + "height": 1280 +} +``` + +##### Merging alias attributes + +If both icon and alias have same attribute, following rules apply: + +- `rotate`: attributes are combined. For example, icon has rotate = 1, alias has rotate = 1. Result will have rotate = 2. To prevent overflow, if rotate > 3, rotate = rotate - 4. +- `hFlip` and `vFlip`: attributes are combined. For example, icon has hFlip = true, alias also has hFlip = true (icon.hFlip !== alias.hFlip). Result is false. false + false = false, false + true = true, true + true = false. +- other attributes are overwritten. + +Example: + +```json +{ + "prefix": "fa", + "icons": { + "caret-left": { + "body": "", + "hFlip": true, + "width": 576, + "height": 1280 + } + }, + "aliases": { + "caret-left-compact": { + "parent": "caret-left", + "left": 64, + "width": 448 + }, + "caret-right": { + "parent": "caret-left", + "hFlip": true + } + } +} +``` + +is identical to: + +```json +{ + "prefix": "fa", + "icons": { + "caret-left": { + "body": "", + "hFlip": true + }, + "caret-left-compact": { + "body": "", + "hFlip": true, // from caret-left + "left": 64, // overwritten + "width": 448 // overwritten + }, + "caret-right": { + "body": "" + // hFlip = false, which is default value, so it was removed + } + }, + "width": 576, + "height": 1280 +} +``` + +#### Metadata + +Icon set files might also contain the metadata. That data is used for browsing icons, searching icons, exporting icon sets as fonts. + +Metadata is a combination of several types, represented as type `IconifyMetaData`. + +##### Icon set information + +Icon set information is part of the metadata, it includes information about an author and license. + +Example: + +```json +{ + "prefix": "dashicons", + "info": { + "name": "Dashicons", + "total": 304, + "author": { + "name": "WordPress", + "url": "https://github.com/WordPress/dashicons" + }, + "license": { + "title": "GPL 2.0", + "spdx": "GPL-2.0-only", + "url": "http://www.gnu.org/licenses/gpl-2.0.html" + }, + "version": "0.9.0", + "samples": ["shortcode", "businessperson", "editor-expand"], + "height": 20, + "category": "General", + "palette": false + }, + "icons": { + // Icons here + } +} +``` + +##### Info + +Information block is part of the metadata, it is used for browsing or searching icon sets. It also contains the license for icons in the icon set and information about the author. + +Info block is represented by the type `IconifyInfo`. You can see an example above in "info" property. + +IconifyInfo type has the following properties, most of them are optional: + +- `name`: string. Icon set name. This field is always set. +- `total`: number. The total number of icons, optional. +- `version`: string. The current version, optional. +- `author`: object. Information about the author, always set. Author information has the following properties: + - `name`: string. Author name. This field is always set. + - `url`: string. Link to icon set, optional. Usually links to GitHub repository. +- `license`: object. Information about the license, always set. License information has the following properties: + - `title`: string. License title. This field is always set. + - `spdx`: string. SPDX license identifier, optional. + - `url`: string. Link to the license, optional. +- `samples`: string[]. Value is an array of icon names that should be used as samples when showing the icon set in an icon sets list. +- `height`: number | number[]. Value is a number or array of numbers, values are pixel grids used in the icon set. If any icons in an icon set do not match the grid, this attribute should not be set. +- `displayHeight`: number. The height value that should be used for displaying samples. Value is a number between 16 and 30 (inclusive). + +##### Characters map + +Characters map is part of the metadata, it is used for icon sets that are either imported from icon fonts or intended to be exported to icon font. + +Characters map allows storing characters for export as well as searching icons by character used in an icon font. + +It is a simple object, where the key is character code in hexadecimal form, value is an icon name. + +Important: each icon can have multiple characters! + +Example: + +```json +{ + "prefix": "fa", + "icons": { + // Icons here + }, + "chars": { + "f000": "glass", + "f001": "music", + "f002": "search", + "f003": "envelope-o", + "f004": "heart", + "f005": "star" + // and so on... + } +} +``` + +##### Categories + +Categories are part of the metadata, used to allow filtering icons when showing the entire icons set. + +Categories list is a simple object, where the key is category name, value is the list of icons. + +Important: each icon can belong to multiple categories! + +```json +{ + "prefix": "fa-solid", + "icons": { + // Icons here + }, + "categories": { + "Accessibility": [ + "american-sign-language-interpreting", + "assistive-listening-systems", + "audio-description", + "blind", + "braille", + "closed-captioning", + "deaf", + "low-vision", + "phone-volume", + "question-circle", + "sign-language", + "tty", + "universal-access", + "wheelchair" + ], + "Alert": [ + "bell", + "bell-slash", + "exclamation", + "exclamation-circle", + "exclamation-triangle", + "radiation", + "radiation-alt", + "skull-crossbones" + ] + // and so on... + } +} +``` + +##### Themes + +Themes are part of the metadata, similar to categories, but using prefixes or suffixes to identify icons that belong to a theme. + +This is useful when icon set has variations of icons, such as "baseline-_", "outline-_". + +Example: + +```json +{ + "prefix": "ic", + "icons": { + // Icons here + }, + "themes": { + "baseline": { + "title": "Baseline", + "prefix": "baseline-" + }, + "outline": { + "title": "Outline", + "prefix": "outline-" + }, + "round": { + "title": "Round", + "prefix": "round-" + }, + "sharp": { + "title": "Sharp", + "prefix": "sharp-" + }, + "twotone": { + "title": "Two-Tone", + "prefix": "twotone-" + } + } +} +``` + +Each theme can have one of the attributes: `prefix` or `suffix`. The prefix must end with `-`, suffix must start with `-`. + +In an example above, all icons that start with "baseline-", such as "baseline-home", are considered part of the "Baseline" theme. + +#### All attributes + +For an example of full icon set files that include metadata, look in icon set files in `@iconify/json` package or browse it at GitHub: [https://github.com/iconify/collections-json](https://github.com/iconify/collections-json) + +For an example of individual icons, look in JavaScript files in NPM packages such as `@iconify/icons-mdi`. + +## Usage + +This repository is intended to be used with any Iconify packages. + +At the moment of writing, multiple Iconify packages are written without TypeScript. At the beginning of the year 2020 plan is to rewrite all of them with TypeScript to make sure data is consistent and avoid duplication, this package will be used for sharing types between Iconify packages. + +## License + +This package is licensed under MIT license. + +`SPDX-License-Identifier: MIT` + +Previous versions of this package were dual-licensed under Apache 2.0 and GPL 2.0 licence, which was messy and confusing. This was later changed to MIT for simplicity. + +© 2021 - 2022 Vjacheslav Trushkin / Iconify OÜ diff --git a/llama.cpp/tools/ui/node_modules/@iconify/utils/readme.md b/llama.cpp/tools/ui/node_modules/@iconify/utils/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..c61784deff3b5dfe993f5c123b84587d4bd5bb1d --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@iconify/utils/readme.md @@ -0,0 +1,23 @@ +# Iconify Utils + +This is a set of helper functions that deal with Iconify icon sets. + +Functions are split into a separate library because they are reused in many projects. + +## Installation + +To install the library run this command: + +``` +npm install @iconify/utils --save +``` + +## Documentation + +Documentation is available at [Iconify documentation website](https://iconify.design/docs/libraries/utils/). + +## License + +The library is released with MIT license. + +© 2021-PRESENT Vjacheslav Trushkin diff --git a/llama.cpp/tools/ui/node_modules/@img/sharp-libvips-linux-arm64/README.md b/llama.cpp/tools/ui/node_modules/@img/sharp-libvips-linux-arm64/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c4a5b999ab55fb410e5ef96b8195cd4ab7a896cb --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@img/sharp-libvips-linux-arm64/README.md @@ -0,0 +1,46 @@ +# `@img/sharp-libvips-linux-arm64` + +Prebuilt libvips and dependencies for use with sharp on Linux (glibc) 64-bit ARM. + +## Licensing + +This software contains third-party libraries +used under the terms of the following licences: + +| Library | Used under the terms of | +|---------------|-----------------------------------------------------------------------------------------------------------| +| aom | BSD 2-Clause + [Alliance for Open Media Patent License 1.0](https://aomedia.org/license/patent-license/) | +| cairo | Mozilla Public License 2.0 | +| cgif | MIT Licence | +| expat | MIT Licence | +| fontconfig | [fontconfig Licence](https://gitlab.freedesktop.org/fontconfig/fontconfig/blob/main/COPYING) (BSD-like) | +| freetype | [freetype Licence](https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/FTL.TXT) (BSD-like) | +| fribidi | LGPLv3 | +| glib | LGPLv3 | +| harfbuzz | MIT Licence | +| highway | Apache-2.0 License, BSD 3-Clause | +| lcms | MIT Licence | +| libarchive | BSD 2-Clause | +| libexif | LGPLv3 | +| libffi | MIT Licence | +| libheif | LGPLv3 | +| libimagequant | [BSD 2-Clause](https://github.com/lovell/libimagequant/blob/main/COPYRIGHT) | +| libnsgif | MIT Licence | +| libpng | [libpng License](https://github.com/pnggroup/libpng/blob/master/LICENSE) | +| librsvg | LGPLv3 | +| libspng | [BSD 2-Clause, libpng License](https://github.com/randy408/libspng/blob/master/LICENSE) | +| libtiff | [libtiff License](https://gitlab.com/libtiff/libtiff/blob/master/LICENSE.md) (BSD-like) | +| libvips | LGPLv3 | +| libwebp | New BSD License | +| libxml2 | MIT Licence | +| mozjpeg | [zlib License, IJG License, BSD-3-Clause](https://github.com/mozilla/mozjpeg/blob/master/LICENSE.md) | +| pango | LGPLv3 | +| pixman | MIT Licence | +| proxy-libintl | LGPLv3 | +| zlib-ng | [zlib Licence](https://github.com/zlib-ng/zlib-ng/blob/develop/LICENSE.md) | + +Use of libraries under the terms of the LGPLv3 is via the +"any later version" clause of the LGPLv2 or LGPLv2.1. + +Please report any errors or omissions via +https://github.com/lovell/sharp-libvips/issues/new diff --git a/llama.cpp/tools/ui/node_modules/@img/sharp-libvips-linuxmusl-arm64/README.md b/llama.cpp/tools/ui/node_modules/@img/sharp-libvips-linuxmusl-arm64/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0aa7fcbd198e14359fc04b909aaca056f3c15ea1 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@img/sharp-libvips-linuxmusl-arm64/README.md @@ -0,0 +1,46 @@ +# `@img/sharp-libvips-linuxmusl-arm64` + +Prebuilt libvips and dependencies for use with sharp on Linux (musl) 64-bit ARM. + +## Licensing + +This software contains third-party libraries +used under the terms of the following licences: + +| Library | Used under the terms of | +|---------------|-----------------------------------------------------------------------------------------------------------| +| aom | BSD 2-Clause + [Alliance for Open Media Patent License 1.0](https://aomedia.org/license/patent-license/) | +| cairo | Mozilla Public License 2.0 | +| cgif | MIT Licence | +| expat | MIT Licence | +| fontconfig | [fontconfig Licence](https://gitlab.freedesktop.org/fontconfig/fontconfig/blob/main/COPYING) (BSD-like) | +| freetype | [freetype Licence](https://git.savannah.gnu.org/cgit/freetype/freetype2.git/tree/docs/FTL.TXT) (BSD-like) | +| fribidi | LGPLv3 | +| glib | LGPLv3 | +| harfbuzz | MIT Licence | +| highway | Apache-2.0 License, BSD 3-Clause | +| lcms | MIT Licence | +| libarchive | BSD 2-Clause | +| libexif | LGPLv3 | +| libffi | MIT Licence | +| libheif | LGPLv3 | +| libimagequant | [BSD 2-Clause](https://github.com/lovell/libimagequant/blob/main/COPYRIGHT) | +| libnsgif | MIT Licence | +| libpng | [libpng License](https://github.com/pnggroup/libpng/blob/master/LICENSE) | +| librsvg | LGPLv3 | +| libspng | [BSD 2-Clause, libpng License](https://github.com/randy408/libspng/blob/master/LICENSE) | +| libtiff | [libtiff License](https://gitlab.com/libtiff/libtiff/blob/master/LICENSE.md) (BSD-like) | +| libvips | LGPLv3 | +| libwebp | New BSD License | +| libxml2 | MIT Licence | +| mozjpeg | [zlib License, IJG License, BSD-3-Clause](https://github.com/mozilla/mozjpeg/blob/master/LICENSE.md) | +| pango | LGPLv3 | +| pixman | MIT Licence | +| proxy-libintl | LGPLv3 | +| zlib-ng | [zlib Licence](https://github.com/zlib-ng/zlib-ng/blob/develop/LICENSE.md) | + +Use of libraries under the terms of the LGPLv3 is via the +"any later version" clause of the LGPLv2 or LGPLv2.1. + +Please report any errors or omissions via +https://github.com/lovell/sharp-libvips/issues/new diff --git a/llama.cpp/tools/ui/node_modules/@img/sharp-linux-arm64/README.md b/llama.cpp/tools/ui/node_modules/@img/sharp-linux-arm64/README.md new file mode 100644 index 0000000000000000000000000000000000000000..aa6aba95758eb3f5ccb6f38b75642be37d38092e --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@img/sharp-linux-arm64/README.md @@ -0,0 +1,18 @@ +# `@img/sharp-linux-arm64` + +Prebuilt sharp for use with Linux (glibc) 64-bit ARM. + +## Licensing + +Copyright 2013 Lovell Fuller and others. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +[https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/llama.cpp/tools/ui/node_modules/@img/sharp-linuxmusl-arm64/README.md b/llama.cpp/tools/ui/node_modules/@img/sharp-linuxmusl-arm64/README.md new file mode 100644 index 0000000000000000000000000000000000000000..24cc3b02ab67248f71d0ed4d325830ee2289a2cd --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@img/sharp-linuxmusl-arm64/README.md @@ -0,0 +1,18 @@ +# `@img/sharp-linuxmusl-arm64` + +Prebuilt sharp for use with Linux (musl) 64-bit ARM. + +## Licensing + +Copyright 2013 Lovell Fuller and others. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at +[https://www.apache.org/licenses/LICENSE-2.0](https://www.apache.org/licenses/LICENSE-2.0) + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/llama.cpp/tools/ui/node_modules/@internationalized/date/README.md b/llama.cpp/tools/ui/node_modules/@internationalized/date/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bbb05ac4f6f08c6946a3893dc799a8d9a6899322 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@internationalized/date/README.md @@ -0,0 +1,44 @@ +# @internationalized/date + +The `@internationalized/date` package provides objects and functions for representing and manipulating dates and times in a locale-aware manner. + +## Features + +* **Typed objects** – Includes immutable objects to represent dates, times, calendars, and more. +* **International calendars** – Support for 13 calendar systems used around the world, including Gregorian, Buddhist, Islamic, Persian, and more. +* **Manipulation** – Add and subtract durations, set and cycle fields, and more. +* **Conversion** – Convert between calendar systems, time zones, string representations, and object types. +* **Queries** – Compare dates and times for ordering or full/partial equality. Determine locale-specific metadata such as day of week, weekend/weekday, etc. +* **Time zone aware** – The [ZonedDateTime](https://react-spectrum.adobe.com/internationalized/date/ZonedDateTime.html) object supports time zone aware date and time manipulation. +* **Predictable** – The API is designed to resolve ambiguity in all operations explicitly, including time zone conversions, arithmetic involving daylight saving time, locale-specific queries, and more. +* **Small bundle size** – The entire library including all calendars and functions is 8 kB minified and compressed with Brotli. +* **Tree shakeable** – Only include the functions and calendar systems you need. For example, if you only use the Gregorian calendar and builtin `CalendarDate` methods, it's just 2.8 kB. + +## Introduction + +Dates and times are represented in many different ways by cultures around the world. This includes differences in calendar systems, time zones, daylight saving time rules, date and time formatting, weekday and weekend rules, and much more. When building applications that support users around the world, it is important to handle these aspects correctly for each locale. The `@internationalized/date` package provides a library of objects and functions to perform date and time related manipulation, queries, and conversions that work across locales and calendars. + +By default, JavaScript represents dates and times using the [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) object. However, `Date` has _many_ problems, including a very difficult to use API, lack of all internationalization support, and more. The [Temporal](https://tc39.es/proposal-temporal/docs/index.html) proposal will eventually address this in the language, and `@internationalized/date` is heavily inspired by it. We hope to back the objects in this package with it once it is implemented in browsers. + +## Package structure + +The `@internationalized/date` package includes the following object types: + +* [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) – An interface which provides calendar conversion and metadata like number of days in month, and number of months in year. Many implementations are provided to support the most commonly used calendar systems. +* [CalendarDate](https://react-spectrum.adobe.com/internationalized/date/CalendarDate.html) – An immutable object that stores a date associated with a specific calendar system, without any time components. +* [CalendarDateTime](https://react-spectrum.adobe.com/internationalized/date/CalendarDateTime.html) – An immutable object that represents a date and time without a time zone, in a specific calendar system. +* [ZonedDateTime](https://react-spectrum.adobe.com/internationalized/date/ZonedDateTime.html) – An immutable object that represents a date and time in a specific time zone and calendar system. +* [Time](https://react-spectrum.adobe.com/internationalized/date/Time.html) – An immutable object that stores a clock time without any date components. + +Each object includes methods to allow basic manipulation and conversion functionality, such as adding and subtracting durations, and formatting as an ISO 8601 string. Additional less commonly used functions can be imported from the `@internationalized/date` package, and passed a date object as a parameter. This includes functions to parse ISO 8601 strings, query properties such as day of week, convert between time zones and much more. See the documentation for each of the objects to learn more about the supported methods and functions. + +This example constructs a `CalendarDate` object, manipulates it to get the start of the next week, and converts it to a string representation. + +```tsx +import {CalendarDate, startOfWeek} from '@internationalized/date'; + +let date = new CalendarDate(2022, 2, 3); +date = date.add({weeks: 1}); +date = startOfWeek(date, 'en-US'); +date.toString(); // 2022-02-06 +``` diff --git a/llama.cpp/tools/ui/node_modules/@isaacs/fs-minipass/README.md b/llama.cpp/tools/ui/node_modules/@isaacs/fs-minipass/README.md new file mode 100644 index 0000000000000000000000000000000000000000..dac96e7dd3d93dd443afaf4e330ad107a7169861 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@isaacs/fs-minipass/README.md @@ -0,0 +1,71 @@ +# fs-minipass + +Filesystem streams based on [minipass](http://npm.im/minipass). + +4 classes are exported: + +- ReadStream +- ReadStreamSync +- WriteStream +- WriteStreamSync + +When using `ReadStreamSync`, all of the data is made available +immediately upon consuming the stream. Nothing is buffered in memory +when the stream is constructed. If the stream is piped to a writer, +then it will synchronously `read()` and emit data into the writer as +fast as the writer can consume it. (That is, it will respect +backpressure.) If you call `stream.read()` then it will read the +entire file and return the contents. + +When using `WriteStreamSync`, every write is flushed to the file +synchronously. If your writes all come in a single tick, then it'll +write it all out in a single tick. It's as synchronous as you are. + +The async versions work much like their node builtin counterparts, +with the exception of introducing significantly less Stream machinery +overhead. + +## USAGE + +It's just streams, you pipe them or read() them or write() to them. + +```js +import { ReadStream, WriteStream } from 'fs-minipass' +// or: const { ReadStream, WriteStream } = require('fs-minipass') +const readStream = new ReadStream('file.txt') +const writeStream = new WriteStream('output.txt') +writeStream.write('some file header or whatever\n') +readStream.pipe(writeStream) +``` + +## ReadStream(path, options) + +Path string is required, but somewhat irrelevant if an open file +descriptor is passed in as an option. + +Options: + +- `fd` Pass in a numeric file descriptor, if the file is already open. +- `readSize` The size of reads to do, defaults to 16MB +- `size` The size of the file, if known. Prevents zero-byte read() + call at the end. +- `autoClose` Set to `false` to prevent the file descriptor from being + closed when the file is done being read. + +## WriteStream(path, options) + +Path string is required, but somewhat irrelevant if an open file +descriptor is passed in as an option. + +Options: + +- `fd` Pass in a numeric file descriptor, if the file is already open. +- `mode` The mode to create the file with. Defaults to `0o666`. +- `start` The position in the file to start reading. If not + specified, then the file will start writing at position zero, and be + truncated by default. +- `autoClose` Set to `false` to prevent the file descriptor from being + closed when the stream is ended. +- `flags` Flags to use when opening the file. Irrelevant if `fd` is + passed in, since file won't be opened in that case. Defaults to + `'a'` if a `pos` is specified, or `'w'` otherwise. diff --git a/llama.cpp/tools/ui/node_modules/@jridgewell/gen-mapping/README.md b/llama.cpp/tools/ui/node_modules/@jridgewell/gen-mapping/README.md new file mode 100644 index 0000000000000000000000000000000000000000..93692b10655a33f4bb4f37c28a576edf83b0c8e2 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@jridgewell/gen-mapping/README.md @@ -0,0 +1,227 @@ +# @jridgewell/gen-mapping + +> Generate source maps + +`gen-mapping` allows you to generate a source map during transpilation or minification. +With a source map, you're able to trace the original location in the source file, either in Chrome's +DevTools or using a library like [`@jridgewell/trace-mapping`][trace-mapping]. + +You may already be familiar with the [`source-map`][source-map] package's `SourceMapGenerator`. This +provides the same `addMapping` and `setSourceContent` API. + +## Installation + +```sh +npm install @jridgewell/gen-mapping +``` + +## Usage + +```typescript +import { GenMapping, addMapping, setSourceContent, toEncodedMap, toDecodedMap } from '@jridgewell/gen-mapping'; + +const map = new GenMapping({ + file: 'output.js', + sourceRoot: 'https://example.com/', +}); + +setSourceContent(map, 'input.js', `function foo() {}`); + +addMapping(map, { + // Lines start at line 1, columns at column 0. + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +addMapping(map, { + generated: { line: 1, column: 9 }, + source: 'input.js', + original: { line: 1, column: 9 }, + name: 'foo', +}); + +assert.deepEqual(toDecodedMap(map), { + version: 3, + file: 'output.js', + names: ['foo'], + sourceRoot: 'https://example.com/', + sources: ['input.js'], + sourcesContent: ['function foo() {}'], + mappings: [ + [ [0, 0, 0, 0], [9, 0, 0, 9, 0] ] + ], +}); + +assert.deepEqual(toEncodedMap(map), { + version: 3, + file: 'output.js', + names: ['foo'], + sourceRoot: 'https://example.com/', + sources: ['input.js'], + sourcesContent: ['function foo() {}'], + mappings: 'AAAA,SAASA', +}); +``` + +### Smaller Sourcemaps + +Not everything needs to be added to a sourcemap, and needless markings can cause signficantly +larger file sizes. `gen-mapping` exposes `maybeAddSegment`/`maybeAddMapping` APIs that will +intelligently determine if this marking adds useful information. If not, the marking will be +skipped. + +```typescript +import { maybeAddMapping } from '@jridgewell/gen-mapping'; + +const map = new GenMapping(); + +// Adding a sourceless marking at the beginning of a line isn't useful. +maybeAddMapping(map, { + generated: { line: 1, column: 0 }, +}); + +// Adding a new source marking is useful. +maybeAddMapping(map, { + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +// But adding another marking pointing to the exact same original location isn't, even if the +// generated column changed. +maybeAddMapping(map, { + generated: { line: 1, column: 9 }, + source: 'input.js', + original: { line: 1, column: 0 }, +}); + +assert.deepEqual(toEncodedMap(map), { + version: 3, + names: [], + sources: ['input.js'], + sourcesContent: [null], + mappings: 'AAAA', +}); +``` + +## Benchmarks + +``` +node v18.0.0 + +amp.js.map +Memory Usage: +gen-mapping: addSegment 5852872 bytes +gen-mapping: addMapping 7716042 bytes +source-map-js 6143250 bytes +source-map-0.6.1 6124102 bytes +source-map-0.8.0 6121173 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 441 ops/sec ±2.07% (90 runs sampled) +gen-mapping: addMapping x 350 ops/sec ±2.40% (86 runs sampled) +source-map-js: addMapping x 169 ops/sec ±2.42% (80 runs sampled) +source-map-0.6.1: addMapping x 167 ops/sec ±2.56% (80 runs sampled) +source-map-0.8.0: addMapping x 168 ops/sec ±2.52% (80 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 150,824,370 ops/sec ±0.07% (102 runs sampled) +gen-mapping: encoded output x 663 ops/sec ±0.22% (98 runs sampled) +source-map-js: encoded output x 197 ops/sec ±0.45% (84 runs sampled) +source-map-0.6.1: encoded output x 198 ops/sec ±0.33% (85 runs sampled) +source-map-0.8.0: encoded output x 197 ops/sec ±0.06% (93 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +babel.min.js.map +Memory Usage: +gen-mapping: addSegment 37578063 bytes +gen-mapping: addMapping 37212897 bytes +source-map-js 47638527 bytes +source-map-0.6.1 47690503 bytes +source-map-0.8.0 47470188 bytes +Smallest memory usage is gen-mapping: addMapping + +Adding speed: +gen-mapping: addSegment x 31.05 ops/sec ±8.31% (43 runs sampled) +gen-mapping: addMapping x 29.83 ops/sec ±7.36% (51 runs sampled) +source-map-js: addMapping x 20.73 ops/sec ±6.22% (38 runs sampled) +source-map-0.6.1: addMapping x 20.03 ops/sec ±10.51% (38 runs sampled) +source-map-0.8.0: addMapping x 19.30 ops/sec ±8.27% (37 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 381,379,234 ops/sec ±0.29% (96 runs sampled) +gen-mapping: encoded output x 95.15 ops/sec ±2.98% (72 runs sampled) +source-map-js: encoded output x 15.20 ops/sec ±7.41% (33 runs sampled) +source-map-0.6.1: encoded output x 16.36 ops/sec ±10.46% (31 runs sampled) +source-map-0.8.0: encoded output x 16.06 ops/sec ±6.45% (31 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +preact.js.map +Memory Usage: +gen-mapping: addSegment 416247 bytes +gen-mapping: addMapping 419824 bytes +source-map-js 1024619 bytes +source-map-0.6.1 1146004 bytes +source-map-0.8.0 1113250 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 13,755 ops/sec ±0.15% (98 runs sampled) +gen-mapping: addMapping x 13,013 ops/sec ±0.11% (101 runs sampled) +source-map-js: addMapping x 4,564 ops/sec ±0.21% (98 runs sampled) +source-map-0.6.1: addMapping x 4,562 ops/sec ±0.11% (99 runs sampled) +source-map-0.8.0: addMapping x 4,593 ops/sec ±0.11% (100 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 379,864,020 ops/sec ±0.23% (93 runs sampled) +gen-mapping: encoded output x 14,368 ops/sec ±4.07% (82 runs sampled) +source-map-js: encoded output x 5,261 ops/sec ±0.21% (99 runs sampled) +source-map-0.6.1: encoded output x 5,124 ops/sec ±0.58% (99 runs sampled) +source-map-0.8.0: encoded output x 5,434 ops/sec ±0.33% (96 runs sampled) +Fastest is gen-mapping: decoded output + + +*** + + +react.js.map +Memory Usage: +gen-mapping: addSegment 975096 bytes +gen-mapping: addMapping 1102981 bytes +source-map-js 2918836 bytes +source-map-0.6.1 2885435 bytes +source-map-0.8.0 2874336 bytes +Smallest memory usage is gen-mapping: addSegment + +Adding speed: +gen-mapping: addSegment x 4,772 ops/sec ±0.15% (100 runs sampled) +gen-mapping: addMapping x 4,456 ops/sec ±0.13% (97 runs sampled) +source-map-js: addMapping x 1,618 ops/sec ±0.24% (97 runs sampled) +source-map-0.6.1: addMapping x 1,622 ops/sec ±0.12% (99 runs sampled) +source-map-0.8.0: addMapping x 1,631 ops/sec ±0.12% (100 runs sampled) +Fastest is gen-mapping: addSegment + +Generate speed: +gen-mapping: decoded output x 379,107,695 ops/sec ±0.07% (99 runs sampled) +gen-mapping: encoded output x 5,421 ops/sec ±1.60% (89 runs sampled) +source-map-js: encoded output x 2,113 ops/sec ±1.81% (98 runs sampled) +source-map-0.6.1: encoded output x 2,126 ops/sec ±0.10% (100 runs sampled) +source-map-0.8.0: encoded output x 2,176 ops/sec ±0.39% (98 runs sampled) +Fastest is gen-mapping: decoded output +``` + +[source-map]: https://www.npmjs.com/package/source-map +[trace-mapping]: https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping diff --git a/llama.cpp/tools/ui/node_modules/@jridgewell/remapping/README.md b/llama.cpp/tools/ui/node_modules/@jridgewell/remapping/README.md new file mode 100644 index 0000000000000000000000000000000000000000..6d092d7eaad3a73a8f094a63b7fe85fe714ef9eb --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@jridgewell/remapping/README.md @@ -0,0 +1,218 @@ +# @jridgewell/remapping + +> Remap sequential sourcemaps through transformations to point at the original source code + +Remapping allows you to take the sourcemaps generated through transforming your code and "remap" +them to the original source locations. Think "my minified code, transformed with babel and bundled +with webpack", all pointing to the correct location in your original source code. + +With remapping, none of your source code transformations need to be aware of the input's sourcemap, +they only need to generate an output sourcemap. This greatly simplifies building custom +transformations (think a find-and-replace). + +## Installation + +```sh +npm install @jridgewell/remapping +``` + +## Usage + +```typescript +function remapping( + map: SourceMap | SourceMap[], + loader: (file: string, ctx: LoaderContext) => (SourceMap | null | undefined), + options?: { excludeContent: boolean, decodedMappings: boolean } +): SourceMap; + +// LoaderContext gives the loader the importing sourcemap, tree depth, the ability to override the +// "source" location (where child sources are resolved relative to, or the location of original +// source), and the ability to override the "content" of an original source for inclusion in the +// output sourcemap. +type LoaderContext = { + readonly importer: string; + readonly depth: number; + source: string; + content: string | null | undefined; +} +``` + +`remapping` takes the final output sourcemap, and a `loader` function. For every source file pointer +in the sourcemap, the `loader` will be called with the resolved path. If the path itself represents +a transformed file (it has a sourcmap associated with it), then the `loader` should return that +sourcemap. If not, the path will be treated as an original, untransformed source code. + +```js +// Babel transformed "helloworld.js" into "transformed.js" +const transformedMap = JSON.stringify({ + file: 'transformed.js', + // 1st column of 2nd line of output file translates into the 1st source + // file, line 3, column 2 + mappings: ';CAEE', + sources: ['helloworld.js'], + version: 3, +}); + +// Uglify minified "transformed.js" into "transformed.min.js" +const minifiedTransformedMap = JSON.stringify({ + file: 'transformed.min.js', + // 0th column of 1st line of output file translates into the 1st source + // file, line 2, column 1. + mappings: 'AACC', + names: [], + sources: ['transformed.js'], + version: 3, +}); + +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + // The "transformed.js" file is an transformed file. + if (file === 'transformed.js') { + // The root importer is empty. + console.assert(ctx.importer === ''); + // The depth in the sourcemap tree we're currently loading. + // The root `minifiedTransformedMap` is depth 0, and its source children are depth 1, etc. + console.assert(ctx.depth === 1); + + return transformedMap; + } + + // Loader will be called to load transformedMap's source file pointers as well. + console.assert(file === 'helloworld.js'); + // `transformed.js`'s sourcemap points into `helloworld.js`. + console.assert(ctx.importer === 'transformed.js'); + // This is a source child of `transformed`, which is a source child of `minifiedTransformedMap`. + console.assert(ctx.depth === 2); + return null; + } +); + +console.log(remapped); +// { +// file: 'transpiled.min.js', +// mappings: 'AAEE', +// sources: ['helloworld.js'], +// version: 3, +// }; +``` + +In this example, `loader` will be called twice: + +1. `"transformed.js"`, the first source file pointer in the `minifiedTransformedMap`. We return the + associated sourcemap for it (its a transformed file, after all) so that sourcemap locations can + be traced through it into the source files it represents. +2. `"helloworld.js"`, our original, unmodified source code. This file does not have a sourcemap, so + we return `null`. + +The `remapped` sourcemap now points from `transformed.min.js` into locations in `helloworld.js`. If +you were to read the `mappings`, it says "0th column of the first line output line points to the 1st +column of the 2nd line of the file `helloworld.js`". + +### Multiple transformations of a file + +As a convenience, if you have multiple single-source transformations of a file, you may pass an +array of sourcemap files in the order of most-recent transformation sourcemap first. Note that this +changes the `importer` and `depth` of each call to our loader. So our above example could have been +written as: + +```js +const remapped = remapping( + [minifiedTransformedMap, transformedMap], + () => null +); + +console.log(remapped); +// { +// file: 'transpiled.min.js', +// mappings: 'AAEE', +// sources: ['helloworld.js'], +// version: 3, +// }; +``` + +### Advanced control of the loading graph + +#### `source` + +The `source` property can overridden to any value to change the location of the current load. Eg, +for an original source file, it allows us to change the location to the original source regardless +of what the sourcemap source entry says. And for transformed files, it allows us to change the +relative resolving location for child sources of the loaded sourcemap. + +```js +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + if (file === 'transformed.js') { + // We pretend the transformed.js file actually exists in the 'src/' directory. When the nested + // source files are loaded, they will now be relative to `src/`. + ctx.source = 'src/transformed.js'; + return transformedMap; + } + + console.assert(file === 'src/helloworld.js'); + // We could futher change the source of this original file, eg, to be inside a nested directory + // itself. This will be reflected in the remapped sourcemap. + ctx.source = 'src/nested/transformed.js'; + return null; + } +); + +console.log(remapped); +// { +// …, +// sources: ['src/nested/helloworld.js'], +// }; +``` + + +#### `content` + +The `content` property can be overridden when we encounter an original source file. Eg, this allows +you to manually provide the source content of the original file regardless of whether the +`sourcesContent` field is present in the parent sourcemap. It can also be set to `null` to remove +the source content. + +```js +const remapped = remapping( + minifiedTransformedMap, + (file, ctx) => { + + if (file === 'transformed.js') { + // transformedMap does not include a `sourcesContent` field, so usually the remapped sourcemap + // would not include any `sourcesContent` values. + return transformedMap; + } + + console.assert(file === 'helloworld.js'); + // We can read the file to provide the source content. + ctx.content = fs.readFileSync(file, 'utf8'); + return null; + } +); + +console.log(remapped); +// { +// …, +// sourcesContent: [ +// 'console.log("Hello world!")', +// ], +// }; +``` + +### Options + +#### excludeContent + +By default, `excludeContent` is `false`. Passing `{ excludeContent: true }` will exclude the +`sourcesContent` field from the returned sourcemap. This is mainly useful when you want to reduce +the size out the sourcemap. + +#### decodedMappings + +By default, `decodedMappings` is `false`. Passing `{ decodedMappings: true }` will leave the +`mappings` field in a [decoded state](https://github.com/rich-harris/sourcemap-codec) instead of +encoding into a VLQ string. diff --git a/llama.cpp/tools/ui/node_modules/@jridgewell/resolve-uri/README.md b/llama.cpp/tools/ui/node_modules/@jridgewell/resolve-uri/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2fe70df77ec8e109faf2bc857e9893d486ad9eb1 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@jridgewell/resolve-uri/README.md @@ -0,0 +1,40 @@ +# @jridgewell/resolve-uri + +> Resolve a URI relative to an optional base URI + +Resolve any combination of absolute URIs, protocol-realtive URIs, absolute paths, or relative paths. + +## Installation + +```sh +npm install @jridgewell/resolve-uri +``` + +## Usage + +```typescript +function resolve(input: string, base?: string): string; +``` + +```js +import resolve from '@jridgewell/resolve-uri'; + +resolve('foo', 'https://example.com'); // => 'https://example.com/foo' +``` + +| Input | Base | Resolution | Explanation | +|-----------------------|-------------------------|--------------------------------|--------------------------------------------------------------| +| `https://example.com` | _any_ | `https://example.com/` | Input is normalized only | +| `//example.com` | `https://base.com/` | `https://example.com/` | Input inherits the base's protocol | +| `//example.com` | _rest_ | `//example.com/` | Input is normalized only | +| `/example` | `https://base.com/` | `https://base.com/example` | Input inherits the base's origin | +| `/example` | `//base.com/` | `//base.com/example` | Input inherits the base's host and remains protocol relative | +| `/example` | _rest_ | `/example` | Input is normalized only | +| `example` | `https://base.com/dir/` | `https://base.com/dir/example` | Input is joined with the base | +| `example` | `https://base.com/file` | `https://base.com/example` | Input is joined with the base without its file | +| `example` | `//base.com/dir/` | `//base.com/dir/example` | Input is joined with the base's last directory | +| `example` | `//base.com/file` | `//base.com/example` | Input is joined with the base without its file | +| `example` | `/base/dir/` | `/base/dir/example` | Input is joined with the base's last directory | +| `example` | `/base/file` | `/base/example` | Input is joined with the base without its file | +| `example` | `base/dir/` | `base/dir/example` | Input is joined with the base's last directory | +| `example` | `base/file` | `base/example` | Input is joined with the base without its file | diff --git a/llama.cpp/tools/ui/node_modules/@jridgewell/source-map/README.md b/llama.cpp/tools/ui/node_modules/@jridgewell/source-map/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f73a326cbbeec3704aa2981fd1d60da602389433 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@jridgewell/source-map/README.md @@ -0,0 +1,184 @@ +# @jridgewell/source-map + +> Packages `@jridgewell/trace-mapping` and `@jridgewell/gen-mapping` into the familiar source-map API + +This isn't the full API, but it's the core functionality. This wraps +[@jridgewell/trace-mapping][trace-mapping] and [@jridgewell/gen-mapping][gen-mapping] +implementations. + +## Installation + +```sh +npm install @jridgewell/source-map +``` + +## Usage + +TODO + +### SourceMapConsumer + +```typescript +import { SourceMapConsumer } from '@jridgewell/source-map'; +const smc = new SourceMapConsumer({ + version: 3, + names: ['foo'], + sources: ['input.js'], + mappings: 'AAAAA', +}); +``` + +#### SourceMapConsumer.fromSourceMap(mapGenerator[, mapUrl]) + +Transforms a `SourceMapGenerator` into a `SourceMapConsumer`. + +```typescript +const smg = new SourceMapGenerator(); + +const smc = SourceMapConsumer.fromSourceMap(map); +smc.originalPositionFor({ line: 1, column: 0 }); +``` + +#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition) + +```typescript +const smc = new SourceMapConsumer(map); +smc.originalPositionFor({ line: 1, column: 0 }); +``` + +#### SourceMapConsumer.prototype.mappings + +```typescript +const smc = new SourceMapConsumer(map); +smc.mappings; // AAAA +``` + +#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition) + +```typescript +const smc = new SourceMapConsumer(map); +smc.allGeneratedpositionsfor({ line: 1, column: 5, source: "baz.ts" }); +// [ +// { line: 2, column: 8 } +// ] +``` + +#### SourceMapConsumer.prototype.eachMapping(callback[, context[, order]]) + +> This implementation currently does not support the "order" parameter. +> This function can only iterate in Generated order. + +```typescript +const smc = new SourceMapConsumer(map); +smc.eachMapping((mapping) => { +// { source: 'baz.ts', +// generatedLine: 4, +// generatedColumn: 5, +// originalLine: 4, +// originalColumn: 5, +// name: null } +}); +``` + +#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition) + +```typescript +const smc = new SourceMapConsumer(map); +smc.generatedPositionFor({ line: 1, column: 5, source: "baz.ts" }); +// { line: 2, column: 8 } +``` + +#### SourceMapConsumer.prototype.hasContentsOfAllSources() + +```typescript +const smc = new SourceMapConsumer(map); +smc.hasContentsOfAllSources(); +// true +``` + +#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing]) + +```typescript +const smc = new SourceMapConsumer(map); +smc.generatedPositionFor("baz.ts"); +// "export default ..." +``` + +#### SourceMapConsumer.prototype.version + +Returns the source map's version + +### SourceMapGenerator + +```typescript +import { SourceMapGenerator } from '@jridgewell/source-map'; +const smg = new SourceMapGenerator({ + file: 'output.js', + sourceRoot: 'https://example.com/', +}); +``` + +#### SourceMapGenerator.fromSourceMap(map) + +Transform a `SourceMapConsumer` into a `SourceMapGenerator`. + +```typescript +const smc = new SourceMapConsumer(); +const smg = SourceMapGenerator.fromSourceMap(smc); +``` + +#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]]) + +> This method is not implemented yet + +#### SourceMapGenerator.prototype.addMapping(mapping) + +```typescript +const smg = new SourceMapGenerator(); +smg.addMapping({ + generated: { line: 1, column: 0 }, + source: 'input.js', + original: { line: 1, column: 0 }, + name: 'foo', +}); +``` + +#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent) + +```typescript +const smg = new SourceMapGenerator(); +smg.setSourceContent('input.js', 'foobar'); +``` + +#### SourceMapGenerator.prototype.toJSON() + +```typescript +const smg = new SourceMapGenerator(); +smg.toJSON(); // { version: 3, names: [], sources: [], mappings: '' } +``` + +#### SourceMapGenerator.prototype.toString() + +```typescript +const smg = new SourceMapGenerator(); +smg.toJSON(); // "{version:3,names:[],sources:[],mappings:''}" +``` + +#### SourceMapGenerator.prototype.toDecodedMap() + +```typescript +const smg = new SourceMapGenerator(); +smg.toDecodedMap(); // { version: 3, names: [], sources: [], mappings: [] } +``` + +## Known differences with other implementations + +This implementation has some differences with `source-map` and `source-map-js`. + +- `SourceMapConsumer.prototype.eachMapping()` + - Does not support the `order` argument +- `SourceMapGenerator.prototype.applySourceMap()` + - Not implemented + +[trace-mapping]: https://github.com/jridgewell/sourcemaps/tree/main/packages/trace-mapping/ +[gen-mapping]: https://github.com/jridgewell/sourcemaps/tree/main/packages/gen-mapping/ diff --git a/llama.cpp/tools/ui/node_modules/@jridgewell/sourcemap-codec/README.md b/llama.cpp/tools/ui/node_modules/@jridgewell/sourcemap-codec/README.md new file mode 100644 index 0000000000000000000000000000000000000000..b3e0708bf93737649c24aefc0cf216f23905908e --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@jridgewell/sourcemap-codec/README.md @@ -0,0 +1,264 @@ +# @jridgewell/sourcemap-codec + +Encode/decode the `mappings` property of a [sourcemap](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit). + + +## Why? + +Sourcemaps are difficult to generate and manipulate, because the `mappings` property – the part that actually links the generated code back to the original source – is encoded using an obscure method called [Variable-length quantity](https://en.wikipedia.org/wiki/Variable-length_quantity). On top of that, each segment in the mapping contains offsets rather than absolute indices, which means that you can't look at a segment in isolation – you have to understand the whole sourcemap. + +This package makes the process slightly easier. + + +## Installation + +```bash +npm install @jridgewell/sourcemap-codec +``` + + +## Usage + +```js +import { encode, decode } from '@jridgewell/sourcemap-codec'; + +var decoded = decode( ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); + +assert.deepEqual( decoded, [ + // the first line (of the generated code) has no mappings, + // as shown by the starting semi-colon (which separates lines) + [], + + // the second line contains four (comma-separated) segments + [ + // segments are encoded as you'd expect: + // [ generatedCodeColumn, sourceIndex, sourceCodeLine, sourceCodeColumn, nameIndex ] + + // i.e. the first segment begins at column 2, and maps back to the second column + // of the second line (both zero-based) of the 0th source, and uses the 0th + // name in the `map.names` array + [ 2, 0, 2, 2, 0 ], + + // the remaining segments are 4-length rather than 5-length, + // because they don't map a name + [ 4, 0, 2, 4 ], + [ 6, 0, 2, 5 ], + [ 7, 0, 2, 7 ] + ], + + // the final line contains two segments + [ + [ 2, 1, 10, 19 ], + [ 12, 1, 11, 20 ] + ] +]); + +var encoded = encode( decoded ); +assert.equal( encoded, ';EAEEA,EAAE,EAAC,CAAE;ECQY,UACC' ); +``` + +## Benchmarks + +``` +node v20.10.0 + +amp.js.map - 45120 segments + +Decode Memory Usage: +local code 5815135 bytes +@jridgewell/sourcemap-codec 1.4.15 5868160 bytes +sourcemap-codec 5492584 bytes +source-map-0.6.1 13569984 bytes +source-map-0.8.0 6390584 bytes +chrome dev tools 8011136 bytes +Smallest memory usage is sourcemap-codec + +Decode speed: +decode: local code x 492 ops/sec ±1.22% (90 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 499 ops/sec ±1.16% (89 runs sampled) +decode: sourcemap-codec x 376 ops/sec ±1.66% (89 runs sampled) +decode: source-map-0.6.1 x 34.99 ops/sec ±0.94% (48 runs sampled) +decode: source-map-0.8.0 x 351 ops/sec ±0.07% (95 runs sampled) +chrome dev tools x 165 ops/sec ±0.91% (86 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 + +Encode Memory Usage: +local code 444248 bytes +@jridgewell/sourcemap-codec 1.4.15 623024 bytes +sourcemap-codec 8696280 bytes +source-map-0.6.1 8745176 bytes +source-map-0.8.0 8736624 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 796 ops/sec ±0.11% (97 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 795 ops/sec ±0.25% (98 runs sampled) +encode: sourcemap-codec x 231 ops/sec ±0.83% (86 runs sampled) +encode: source-map-0.6.1 x 166 ops/sec ±0.57% (86 runs sampled) +encode: source-map-0.8.0 x 203 ops/sec ±0.45% (88 runs sampled) +Fastest is encode: local code,encode: @jridgewell/sourcemap-codec 1.4.15 + + +*** + + +babel.min.js.map - 347793 segments + +Decode Memory Usage: +local code 35424960 bytes +@jridgewell/sourcemap-codec 1.4.15 35424696 bytes +sourcemap-codec 36033464 bytes +source-map-0.6.1 62253704 bytes +source-map-0.8.0 43843920 bytes +chrome dev tools 45111400 bytes +Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15 + +Decode speed: +decode: local code x 38.18 ops/sec ±5.44% (52 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 38.36 ops/sec ±5.02% (52 runs sampled) +decode: sourcemap-codec x 34.05 ops/sec ±4.45% (47 runs sampled) +decode: source-map-0.6.1 x 4.31 ops/sec ±2.76% (15 runs sampled) +decode: source-map-0.8.0 x 55.60 ops/sec ±0.13% (73 runs sampled) +chrome dev tools x 16.94 ops/sec ±3.78% (46 runs sampled) +Fastest is decode: source-map-0.8.0 + +Encode Memory Usage: +local code 2606016 bytes +@jridgewell/sourcemap-codec 1.4.15 2626440 bytes +sourcemap-codec 21152576 bytes +source-map-0.6.1 25023928 bytes +source-map-0.8.0 25256448 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 127 ops/sec ±0.18% (83 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 128 ops/sec ±0.26% (83 runs sampled) +encode: sourcemap-codec x 29.31 ops/sec ±2.55% (53 runs sampled) +encode: source-map-0.6.1 x 18.85 ops/sec ±3.19% (36 runs sampled) +encode: source-map-0.8.0 x 19.34 ops/sec ±1.97% (36 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec 1.4.15 + + +*** + + +preact.js.map - 1992 segments + +Decode Memory Usage: +local code 261696 bytes +@jridgewell/sourcemap-codec 1.4.15 244296 bytes +sourcemap-codec 302816 bytes +source-map-0.6.1 939176 bytes +source-map-0.8.0 336 bytes +chrome dev tools 587368 bytes +Smallest memory usage is source-map-0.8.0 + +Decode speed: +decode: local code x 17,782 ops/sec ±0.32% (97 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 17,863 ops/sec ±0.40% (100 runs sampled) +decode: sourcemap-codec x 12,453 ops/sec ±0.27% (101 runs sampled) +decode: source-map-0.6.1 x 1,288 ops/sec ±1.05% (96 runs sampled) +decode: source-map-0.8.0 x 9,289 ops/sec ±0.27% (101 runs sampled) +chrome dev tools x 4,769 ops/sec ±0.18% (100 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 + +Encode Memory Usage: +local code 262944 bytes +@jridgewell/sourcemap-codec 1.4.15 25544 bytes +sourcemap-codec 323048 bytes +source-map-0.6.1 507808 bytes +source-map-0.8.0 507480 bytes +Smallest memory usage is @jridgewell/sourcemap-codec 1.4.15 + +Encode speed: +encode: local code x 24,207 ops/sec ±0.79% (95 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 24,288 ops/sec ±0.48% (96 runs sampled) +encode: sourcemap-codec x 6,761 ops/sec ±0.21% (100 runs sampled) +encode: source-map-0.6.1 x 5,374 ops/sec ±0.17% (99 runs sampled) +encode: source-map-0.8.0 x 5,633 ops/sec ±0.32% (99 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec 1.4.15,encode: local code + + +*** + + +react.js.map - 5726 segments + +Decode Memory Usage: +local code 678816 bytes +@jridgewell/sourcemap-codec 1.4.15 678816 bytes +sourcemap-codec 816400 bytes +source-map-0.6.1 2288864 bytes +source-map-0.8.0 721360 bytes +chrome dev tools 1012512 bytes +Smallest memory usage is local code + +Decode speed: +decode: local code x 6,178 ops/sec ±0.19% (98 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 6,261 ops/sec ±0.22% (100 runs sampled) +decode: sourcemap-codec x 4,472 ops/sec ±0.90% (99 runs sampled) +decode: source-map-0.6.1 x 449 ops/sec ±0.31% (95 runs sampled) +decode: source-map-0.8.0 x 3,219 ops/sec ±0.13% (100 runs sampled) +chrome dev tools x 1,743 ops/sec ±0.20% (99 runs sampled) +Fastest is decode: @jridgewell/sourcemap-codec 1.4.15 + +Encode Memory Usage: +local code 140960 bytes +@jridgewell/sourcemap-codec 1.4.15 159808 bytes +sourcemap-codec 969304 bytes +source-map-0.6.1 930520 bytes +source-map-0.8.0 930248 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 8,013 ops/sec ±0.19% (100 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 7,989 ops/sec ±0.20% (101 runs sampled) +encode: sourcemap-codec x 2,472 ops/sec ±0.21% (99 runs sampled) +encode: source-map-0.6.1 x 2,200 ops/sec ±0.17% (99 runs sampled) +encode: source-map-0.8.0 x 2,220 ops/sec ±0.37% (99 runs sampled) +Fastest is encode: local code + + +*** + + +vscode.map - 2141001 segments + +Decode Memory Usage: +local code 198955264 bytes +@jridgewell/sourcemap-codec 1.4.15 199175352 bytes +sourcemap-codec 199102688 bytes +source-map-0.6.1 386323432 bytes +source-map-0.8.0 244116432 bytes +chrome dev tools 293734280 bytes +Smallest memory usage is local code + +Decode speed: +decode: local code x 3.90 ops/sec ±22.21% (15 runs sampled) +decode: @jridgewell/sourcemap-codec 1.4.15 x 3.95 ops/sec ±23.53% (15 runs sampled) +decode: sourcemap-codec x 3.82 ops/sec ±17.94% (14 runs sampled) +decode: source-map-0.6.1 x 0.61 ops/sec ±7.81% (6 runs sampled) +decode: source-map-0.8.0 x 9.54 ops/sec ±0.28% (28 runs sampled) +chrome dev tools x 2.18 ops/sec ±10.58% (10 runs sampled) +Fastest is decode: source-map-0.8.0 + +Encode Memory Usage: +local code 13509880 bytes +@jridgewell/sourcemap-codec 1.4.15 13537648 bytes +sourcemap-codec 32540104 bytes +source-map-0.6.1 127531040 bytes +source-map-0.8.0 127535312 bytes +Smallest memory usage is local code + +Encode speed: +encode: local code x 20.10 ops/sec ±0.19% (38 runs sampled) +encode: @jridgewell/sourcemap-codec 1.4.15 x 20.26 ops/sec ±0.32% (38 runs sampled) +encode: sourcemap-codec x 5.44 ops/sec ±1.64% (18 runs sampled) +encode: source-map-0.6.1 x 2.30 ops/sec ±4.79% (10 runs sampled) +encode: source-map-0.8.0 x 2.46 ops/sec ±6.53% (10 runs sampled) +Fastest is encode: @jridgewell/sourcemap-codec 1.4.15 +``` + +# License + +MIT diff --git a/llama.cpp/tools/ui/node_modules/@jridgewell/trace-mapping/README.md b/llama.cpp/tools/ui/node_modules/@jridgewell/trace-mapping/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9fc0ed09cedeb0eea388b5d2b891b87886830776 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@jridgewell/trace-mapping/README.md @@ -0,0 +1,348 @@ +# @jridgewell/trace-mapping + +> Trace the original position through a source map + +`trace-mapping` allows you to take the line and column of an output file and trace it to the +original location in the source file through a source map. + +You may already be familiar with the [`source-map`][source-map] package's `SourceMapConsumer`. This +provides the same `originalPositionFor` and `generatedPositionFor` API, without requiring WASM. + +## Installation + +```sh +npm install @jridgewell/trace-mapping +``` + +## Usage + +```typescript +import { + TraceMap, + originalPositionFor, + generatedPositionFor, + sourceContentFor, + isIgnored, +} from '@jridgewell/trace-mapping'; + +const tracer = new TraceMap({ + version: 3, + sources: ['input.js'], + sourcesContent: ['content of input.js'], + names: ['foo'], + mappings: 'KAyCIA', + ignoreList: [], +}); + +// Lines start at line 1, columns at column 0. +const traced = originalPositionFor(tracer, { line: 1, column: 5 }); +assert.deepEqual(traced, { + source: 'input.js', + line: 42, + column: 4, + name: 'foo', +}); + +const content = sourceContentFor(tracer, traced.source); +assert.strictEqual(content, 'content for input.js'); + +const generated = generatedPositionFor(tracer, { + source: 'input.js', + line: 42, + column: 4, +}); +assert.deepEqual(generated, { + line: 1, + column: 5, +}); + +const ignored = isIgnored(tracer, 'input.js'); +assert.equal(ignored, false); +``` + +We also provide a lower level API to get the actual segment that matches our line and column. Unlike +`originalPositionFor`, `traceSegment` uses a 0-base for `line`: + +```typescript +import { traceSegment } from '@jridgewell/trace-mapping'; + +// line is 0-base. +const traced = traceSegment(tracer, /* line */ 0, /* column */ 5); + +// Segments are [outputColumn, sourcesIndex, sourceLine, sourceColumn, namesIndex] +// Again, line is 0-base and so is sourceLine +assert.deepEqual(traced, [5, 0, 41, 4, 0]); +``` + +### SectionedSourceMaps + +The sourcemap spec defines a special `sections` field that's designed to handle concatenation of +output code with associated sourcemaps. This type of sourcemap is rarely used (no major build tool +produces it), but if you are hand coding a concatenation you may need it. We provide an `AnyMap` +helper that can receive either a regular sourcemap or a `SectionedSourceMap` and returns a +`TraceMap` instance: + +```typescript +import { AnyMap } from '@jridgewell/trace-mapping'; +const fooOutput = 'foo'; +const barOutput = 'bar'; +const output = [fooOutput, barOutput].join('\n'); + +const sectioned = new AnyMap({ + version: 3, + sections: [ + { + // 0-base line and column + offset: { line: 0, column: 0 }, + // fooOutput's sourcemap + map: { + version: 3, + sources: ['foo.js'], + names: ['foo'], + mappings: 'AAAAA', + }, + }, + { + // barOutput's sourcemap will not affect the first line, only the second + offset: { line: 1, column: 0 }, + map: { + version: 3, + sources: ['bar.js'], + names: ['bar'], + mappings: 'AAAAA', + }, + }, + ], +}); + +const traced = originalPositionFor(sectioned, { + line: 2, + column: 0, +}); + +assert.deepEqual(traced, { + source: 'bar.js', + line: 1, + column: 0, + name: 'bar', +}); +``` + +## Benchmarks + +``` +node v20.10.0 + +amp.js.map - 45120 segments + +Memory Usage: +trace-mapping decoded 414164 bytes +trace-mapping encoded 6274352 bytes +source-map-js 10968904 bytes +source-map-0.6.1 17587160 bytes +source-map-0.8.0 8812155 bytes +Chrome dev tools 8672912 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 205 ops/sec ±0.19% (88 runs sampled) +trace-mapping: encoded JSON input x 405 ops/sec ±1.47% (88 runs sampled) +trace-mapping: decoded Object input x 4,645 ops/sec ±0.15% (98 runs sampled) +trace-mapping: encoded Object input x 458 ops/sec ±1.63% (91 runs sampled) +source-map-js: encoded Object input x 75.48 ops/sec ±1.64% (67 runs sampled) +source-map-0.6.1: encoded Object input x 39.37 ops/sec ±1.44% (53 runs sampled) +Chrome dev tools: encoded Object input x 150 ops/sec ±1.76% (79 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 44,946 ops/sec ±0.16% (99 runs sampled) +trace-mapping: encoded originalPositionFor x 37,995 ops/sec ±1.81% (89 runs sampled) +source-map-js: encoded originalPositionFor x 9,230 ops/sec ±1.36% (93 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 8,057 ops/sec ±0.84% (96 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 28,198 ops/sec ±1.12% (91 runs sampled) +Chrome dev tools: encoded originalPositionFor x 46,276 ops/sec ±1.35% (95 runs sampled) +Fastest is Chrome dev tools: encoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 204,406 ops/sec ±0.19% (97 runs sampled) +trace-mapping: encoded originalPositionFor x 196,695 ops/sec ±0.24% (99 runs sampled) +source-map-js: encoded originalPositionFor x 11,948 ops/sec ±0.94% (99 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 10,730 ops/sec ±0.36% (100 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 51,427 ops/sec ±0.21% (98 runs sampled) +Chrome dev tools: encoded originalPositionFor x 162,615 ops/sec ±0.18% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +babel.min.js.map - 347793 segments + +Memory Usage: +trace-mapping decoded 18504 bytes +trace-mapping encoded 35428008 bytes +source-map-js 51676808 bytes +source-map-0.6.1 63367136 bytes +source-map-0.8.0 43158400 bytes +Chrome dev tools 50721552 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 17.82 ops/sec ±6.35% (35 runs sampled) +trace-mapping: encoded JSON input x 31.57 ops/sec ±7.50% (43 runs sampled) +trace-mapping: decoded Object input x 867 ops/sec ±0.74% (94 runs sampled) +trace-mapping: encoded Object input x 33.83 ops/sec ±7.66% (46 runs sampled) +source-map-js: encoded Object input x 6.58 ops/sec ±3.31% (20 runs sampled) +source-map-0.6.1: encoded Object input x 4.23 ops/sec ±3.43% (15 runs sampled) +Chrome dev tools: encoded Object input x 22.14 ops/sec ±3.79% (41 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 78,234 ops/sec ±1.48% (29 runs sampled) +trace-mapping: encoded originalPositionFor x 60,761 ops/sec ±1.35% (21 runs sampled) +source-map-js: encoded originalPositionFor x 51,448 ops/sec ±2.17% (89 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 47,221 ops/sec ±1.99% (15 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 84,002 ops/sec ±1.45% (27 runs sampled) +Chrome dev tools: encoded originalPositionFor x 106,457 ops/sec ±1.38% (37 runs sampled) +Fastest is Chrome dev tools: encoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 930,943 ops/sec ±0.25% (99 runs sampled) +trace-mapping: encoded originalPositionFor x 843,545 ops/sec ±0.34% (97 runs sampled) +source-map-js: encoded originalPositionFor x 114,510 ops/sec ±1.37% (36 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 87,412 ops/sec ±0.72% (92 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 197,709 ops/sec ±0.89% (59 runs sampled) +Chrome dev tools: encoded originalPositionFor x 688,983 ops/sec ±0.33% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +preact.js.map - 1992 segments + +Memory Usage: +trace-mapping decoded 33136 bytes +trace-mapping encoded 254240 bytes +source-map-js 837488 bytes +source-map-0.6.1 961928 bytes +source-map-0.8.0 54384 bytes +Chrome dev tools 709680 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 3,709 ops/sec ±0.13% (99 runs sampled) +trace-mapping: encoded JSON input x 6,447 ops/sec ±0.22% (101 runs sampled) +trace-mapping: decoded Object input x 83,062 ops/sec ±0.23% (100 runs sampled) +trace-mapping: encoded Object input x 14,980 ops/sec ±0.28% (100 runs sampled) +source-map-js: encoded Object input x 2,544 ops/sec ±0.16% (99 runs sampled) +source-map-0.6.1: encoded Object input x 1,221 ops/sec ±0.37% (97 runs sampled) +Chrome dev tools: encoded Object input x 4,241 ops/sec ±0.39% (93 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 91,028 ops/sec ±0.14% (94 runs sampled) +trace-mapping: encoded originalPositionFor x 84,348 ops/sec ±0.26% (98 runs sampled) +source-map-js: encoded originalPositionFor x 26,998 ops/sec ±0.23% (98 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 18,049 ops/sec ±0.26% (100 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 41,916 ops/sec ±0.28% (98 runs sampled) +Chrome dev tools: encoded originalPositionFor x 88,616 ops/sec ±0.14% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 319,960 ops/sec ±0.16% (100 runs sampled) +trace-mapping: encoded originalPositionFor x 302,153 ops/sec ±0.18% (100 runs sampled) +source-map-js: encoded originalPositionFor x 35,574 ops/sec ±0.19% (100 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 19,943 ops/sec ±0.12% (101 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 54,648 ops/sec ±0.20% (99 runs sampled) +Chrome dev tools: encoded originalPositionFor x 278,319 ops/sec ±0.17% (102 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +react.js.map - 5726 segments + +Memory Usage: +trace-mapping decoded 10872 bytes +trace-mapping encoded 681512 bytes +source-map-js 2563944 bytes +source-map-0.6.1 2150864 bytes +source-map-0.8.0 88680 bytes +Chrome dev tools 1149576 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 1,887 ops/sec ±0.28% (99 runs sampled) +trace-mapping: encoded JSON input x 4,749 ops/sec ±0.48% (97 runs sampled) +trace-mapping: decoded Object input x 74,236 ops/sec ±0.11% (99 runs sampled) +trace-mapping: encoded Object input x 5,752 ops/sec ±0.38% (100 runs sampled) +source-map-js: encoded Object input x 806 ops/sec ±0.19% (97 runs sampled) +source-map-0.6.1: encoded Object input x 418 ops/sec ±0.33% (94 runs sampled) +Chrome dev tools: encoded Object input x 1,524 ops/sec ±0.57% (92 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 620,201 ops/sec ±0.33% (96 runs sampled) +trace-mapping: encoded originalPositionFor x 579,548 ops/sec ±0.35% (97 runs sampled) +source-map-js: encoded originalPositionFor x 230,983 ops/sec ±0.62% (54 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 158,145 ops/sec ±0.80% (46 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 343,801 ops/sec ±0.55% (96 runs sampled) +Chrome dev tools: encoded originalPositionFor x 659,649 ops/sec ±0.49% (98 runs sampled) +Fastest is Chrome dev tools: encoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 2,368,079 ops/sec ±0.32% (98 runs sampled) +trace-mapping: encoded originalPositionFor x 2,134,039 ops/sec ±2.72% (87 runs sampled) +source-map-js: encoded originalPositionFor x 290,120 ops/sec ±2.49% (82 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 187,613 ops/sec ±0.86% (49 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 479,569 ops/sec ±0.65% (96 runs sampled) +Chrome dev tools: encoded originalPositionFor x 2,048,414 ops/sec ±0.24% (98 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + + +*** + + +vscode.map - 2141001 segments + +Memory Usage: +trace-mapping decoded 5206584 bytes +trace-mapping encoded 208370336 bytes +source-map-js 278493008 bytes +source-map-0.6.1 391564048 bytes +source-map-0.8.0 257508787 bytes +Chrome dev tools 291053000 bytes +Smallest memory usage is trace-mapping decoded + +Init speed: +trace-mapping: decoded JSON input x 1.63 ops/sec ±33.88% (9 runs sampled) +trace-mapping: encoded JSON input x 3.29 ops/sec ±36.13% (13 runs sampled) +trace-mapping: decoded Object input x 103 ops/sec ±0.93% (77 runs sampled) +trace-mapping: encoded Object input x 5.42 ops/sec ±28.54% (19 runs sampled) +source-map-js: encoded Object input x 1.07 ops/sec ±13.84% (7 runs sampled) +source-map-0.6.1: encoded Object input x 0.60 ops/sec ±2.43% (6 runs sampled) +Chrome dev tools: encoded Object input x 2.61 ops/sec ±22.00% (11 runs sampled) +Fastest is trace-mapping: decoded Object input + +Trace speed (random): +trace-mapping: decoded originalPositionFor x 257,019 ops/sec ±0.97% (93 runs sampled) +trace-mapping: encoded originalPositionFor x 179,163 ops/sec ±0.83% (92 runs sampled) +source-map-js: encoded originalPositionFor x 73,337 ops/sec ±1.35% (87 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 38,797 ops/sec ±1.66% (88 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 107,758 ops/sec ±1.94% (45 runs sampled) +Chrome dev tools: encoded originalPositionFor x 188,550 ops/sec ±1.85% (79 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor + +Trace speed (ascending): +trace-mapping: decoded originalPositionFor x 447,621 ops/sec ±3.64% (94 runs sampled) +trace-mapping: encoded originalPositionFor x 323,698 ops/sec ±5.20% (88 runs sampled) +source-map-js: encoded originalPositionFor x 78,387 ops/sec ±1.69% (89 runs sampled) +source-map-0.6.1: encoded originalPositionFor x 41,016 ops/sec ±3.01% (25 runs sampled) +source-map-0.8.0: encoded originalPositionFor x 124,204 ops/sec ±0.90% (92 runs sampled) +Chrome dev tools: encoded originalPositionFor x 230,087 ops/sec ±2.61% (93 runs sampled) +Fastest is trace-mapping: decoded originalPositionFor +``` + +[source-map]: https://www.npmjs.com/package/source-map diff --git a/llama.cpp/tools/ui/node_modules/@lucide/svelte/README.md b/llama.cpp/tools/ui/node_modules/@lucide/svelte/README.md new file mode 100644 index 0000000000000000000000000000000000000000..806eb3fa13a7e79db869375f0f1f36d17ada2e79 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@lucide/svelte/README.md @@ -0,0 +1,73 @@ +

+ + Lucide icon library for Svelte 5 applications. + +

+ +

+Lucide icon library for Svelte 5 applications. +

+ +
+ + [![npm](https://img.shields.io/npm/v/%40lucide%2Fsvelte?color=blue)](https://www.npmjs.com/package/lucide-svelte) + ![NPM Downloads](https://img.shields.io/npm/dw/%40lucide%2Fsvelte) + [![GitHub](https://img.shields.io/github/license/lucide-icons/lucide)](https://lucide.dev/license) +
+ +

+ About + · + Icons + · + Documentation + · + License +

+ +# Lucide Svelte + +Implementation of the lucide icon library for svelte applications. + +## Installation + +```sh +pnpm add @lucide/svelte +``` + +```sh +npm install @lucide/svelte +``` + +```sh +yarn add @lucide/svelte +``` + +```sh +bun add @lucide/svelte +``` + +## Documentation + +For full documentation, visit [lucide.dev](https://lucide.dev/guide/packages/lucide-svelte) + +## Community + +Join the [Discord server](https://discord.gg/EH6nSts) to chat with the maintainers and other users. + +## License + +Lucide is licensed under the ISC license. See [LICENSE](https://lucide.dev/license). + +## Sponsors + + + Powered by Vercel + + +DigitalOcean Referral Badge + +### Awesome backers 🍺 + +Scipress sponsor badge +pdfme sponsor badge diff --git a/llama.cpp/tools/ui/node_modules/@mdx-js/react/readme.md b/llama.cpp/tools/ui/node_modules/@mdx-js/react/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..89ce50e194dbfaed836156520ce16c10230e878c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@mdx-js/react/readme.md @@ -0,0 +1,275 @@ +# `@mdx-js/react` + +[![Build][build-badge]][build] +[![Coverage][coverage-badge]][coverage] +[![Downloads][downloads-badge]][downloads] +[![Size][size-badge]][size] +[![Sponsors][sponsors-badge]][collective] +[![Backers][backers-badge]][collective] +[![Chat][chat-badge]][chat] + +React context for MDX. + + + +## Contents + +* [What is this?](#what-is-this) +* [When should I use this?](#when-should-i-use-this) +* [Install](#install) +* [Use](#use) +* [API](#api) + * [`MDXProvider(properties?)`](#mdxproviderproperties) + * [`useMDXComponents(components?)`](#usemdxcomponentscomponents) + * [`MergeComponents`](#mergecomponents) + * [`Props`](#props) +* [Types](#types) +* [Compatibility](#compatibility) +* [Security](#security) +* [Contribute](#contribute) +* [License](#license) + +## What is this? + +This package is a *context* based components provider for combining React with +MDX. + +## When should I use this? + +This package is **not needed** for MDX to work with React. +See [¶ MDX provider in § Using MDX][use-provider] for when and how to use an MDX +provider. + +If you use Next.js, **do not use this**. +Add an `mdx-components.tsx` (in `src/` or `/`) file instead. +See [Configuring MDX on `nextjs.org`][next-configuring-mdx] for more info. + +## Install + +This package is [ESM only][esm]. +In Node.js (version 16+), install with [npm][]: + +```sh +npm install @mdx-js/react +``` + +In Deno with [`esm.sh`][esmsh]: + +```tsx +import {MDXProvider} from 'https://esm.sh/@mdx-js/react@3' +``` + +In browsers with [`esm.sh`][esmsh]: + +```html + +``` + +## Use + +```tsx +/** + * @import {MDXComponents} from 'mdx/types.js' + */ + +import {MDXProvider} from '@mdx-js/react' +import Post from './post.mdx' +// ^-- Assumes an integration is used to compile MDX to JS, such as +// `@mdx-js/esbuild`, `@mdx-js/loader`, `@mdx-js/node-loader`, or +// `@mdx-js/rollup`, and that it is configured with +// `options.providerImportSource: '@mdx-js/react'`. + +/** @type {MDXComponents} */ +const components = { + em(properties) { + return + } +} + +console.log( + + + +) +``` + +> 👉 **Note**: you don’t have to use `MDXProvider` and can pass components +> directly: +> +> ```diff +> - +> - +> - +> + +> ``` + +See [¶ React in § Getting started][start-react] for how to get started with MDX +and React. +See [¶ MDX provider in § Using MDX][use-provider] for how to use an MDX +provider. + +## API + +This package exports the identifiers [`MDXProvider`][api-mdx-provider] and +[`useMDXComponents`][api-use-mdx-components]. +There is no default export. + +### `MDXProvider(properties?)` + +Provider for MDX context. + +###### Parameters + +* `properties` ([`Props`][api-props]) + — configuration + +##### Returns + +Element (`ReactElement`). + +### `useMDXComponents(components?)` + +Get current components from the MDX Context. + +###### Parameters + +* `components` ([`MDXComponents` from `mdx/types.js`][mdx-types-components] + or [`MergeComponents`][api-merge-components], optional) + — additional components to use or a function that creates them + +###### Returns + +Current components ([`MDXComponents` from +`mdx/types.js`][mdx-types-components]). + +### `MergeComponents` + +Custom merge function (TypeScript type). + +###### Parameters + +* `components` ([`MDXComponents` from `mdx/types.js`][mdx-types-components]) + — current components from the context + +###### Returns + +Additional components ([`MDXComponents` from +`mdx/types.js`][mdx-types-components]). + +### `Props` + +Configuration for `MDXProvider` (TypeScript type). + +###### Fields + +* `children` ([`ReactNode` from `react`][react-node], + optional) + — children +* `components` ([`MDXComponents` from `mdx/types.js`][mdx-types-components] + or [`MergeComponents`][api-merge-components], optional) + — additional components to use or a function that creates them +* `disableParentContext` (`boolean`, default: `false`) + — turn off outer component context + +## Types + +This package is fully typed with [TypeScript][]. +It exports the additional types [`MergeComponents`][api-merge-components] and +[`Props`][api-props]. + +For types to work, make sure the TypeScript `JSX` namespace is typed. +This is done by installing and using the types of your framework, as in +[`@types/react`](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react). + +## Compatibility + +Projects maintained by the unified collective are compatible with maintained +versions of Node.js. + +When we cut a new major release, we drop support for unmaintained versions of +Node. +This means we try to keep the current release line, `@mdx-js/react@^3`, +compatible with Node.js 16. + +## Security + +See [§ Security][security] on our website for information. + +## Contribute + +See [§ Contribute][contribute] on our website for ways to get started. +See [§ Support][support] for ways to get help. + +This project has a [code of conduct][coc]. +By interacting with this repository, organization, or community you agree to +abide by its terms. + +## License + +[MIT][] © Compositor and [Vercel][] + +[api-mdx-provider]: #mdxproviderproperties + +[api-merge-components]: #mergecomponents + +[api-props]: #props + +[api-use-mdx-components]: #usemdxcomponentscomponents + +[backers-badge]: https://opencollective.com/unified/backers/badge.svg + +[build]: https://github.com/mdx-js/mdx/actions + +[build-badge]: https://github.com/mdx-js/mdx/workflows/main/badge.svg + +[chat]: https://github.com/mdx-js/mdx/discussions + +[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg + +[coc]: https://github.com/mdx-js/.github/blob/main/code-of-conduct.md + +[collective]: https://opencollective.com/unified + +[contribute]: https://mdxjs.com/community/contribute/ + +[coverage]: https://codecov.io/github/mdx-js/mdx + +[coverage-badge]: https://img.shields.io/codecov/c/github/mdx-js/mdx/main.svg + +[downloads]: https://www.npmjs.com/package/@mdx-js/react + +[downloads-badge]: https://img.shields.io/npm/dm/@mdx-js/react.svg + +[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c + +[esmsh]: https://esm.sh + +[mdx-types-components]: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/HEAD/types/mdx/types.d.ts#L65 + +[mit]: https://github.com/mdx-js/mdx/blob/main/packages/react/license + +[next-configuring-mdx]: https://nextjs.org/docs/pages/building-your-application/configuring/mdx + +[npm]: https://docs.npmjs.com/cli/install + +[react-node]: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/HEAD/types/react/index.d.ts#L244 + +[security]: https://mdxjs.com/getting-started/#security + +[size]: https://bundlejs.com/?q=@mdx-js/react + +[size-badge]: https://img.shields.io/bundlejs/size/@mdx-js/react + +[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg + +[start-react]: https://mdxjs.com/getting-started/#react + +[support]: https://mdxjs.com/community/support/ + +[typescript]: https://www.typescriptlang.org + +[use-provider]: https://mdxjs.com/docs/using-mdx/#mdx-provider + +[vercel]: https://vercel.com diff --git a/llama.cpp/tools/ui/node_modules/@mermaid-js/parser/README.md b/llama.cpp/tools/ui/node_modules/@mermaid-js/parser/README.md new file mode 100644 index 0000000000000000000000000000000000000000..763ffc7ed2a9699346236202abf8f6fbb6192235 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@mermaid-js/parser/README.md @@ -0,0 +1,59 @@ +

+ + +

+

+Mermaid Parser +

+ +

+Mermaid parser package +

+ +[![NPM](https://img.shields.io/npm/v/@mermaid-js/parser)](https://www.npmjs.com/package/@mermaid-js/parser) + +## How the package works + +The package exports a `parse` function that has two parameters: + +```ts +declare function parse( + diagramType: keyof typeof initializers, + text: string +): T; +``` + +## How does a Langium-based parser work? + +```mermaid +sequenceDiagram +actor Package +participant Module +participant TokenBuilder +participant Lexer +participant Parser +participant ValueConverter + + +Package ->> Module: Create services +Module ->> TokenBuilder: Override or/and
reorder rules +TokenBuilder ->> Lexer: Read the string and transform
it into a token stream +Lexer ->> Parser: Parse token
stream into AST +Parser ->> ValueConverter: Clean/modify tokenized
rules returned value +ValueConverter -->> Package: Return AST +``` + +- When to override `TokenBuilder`? + - To override keyword rules. + - To override terminal rules that need a custom function. + - To manually reorder the list of rules. + +- When to override `Lexer`? + - To modify input before tokenizing. + - To insert/modify tokens that cannot or have not been parsed. + +- When to override `LangiumParser`? + - To insert or modify attributes that can't be parsed. + +- When to override `ValueConverter`? + - To modify the returned value from the parser. diff --git a/llama.cpp/tools/ui/node_modules/@modelcontextprotocol/sdk/README.md b/llama.cpp/tools/ui/node_modules/@modelcontextprotocol/sdk/README.md new file mode 100644 index 0000000000000000000000000000000000000000..254671c8f3f53459aad684097a4f3f205e0679b9 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@modelcontextprotocol/sdk/README.md @@ -0,0 +1,169 @@ +# MCP TypeScript SDK [![NPM Version](https://img.shields.io/npm/v/%40modelcontextprotocol%2Fsdk)](https://www.npmjs.com/package/@modelcontextprotocol/sdk) [![MIT licensed](https://img.shields.io/npm/l/%40modelcontextprotocol%2Fsdk)](https://github.com/modelcontextprotocol/typescript-sdk/blob/main/LICENSE) + +

+Table of Contents + +- [Overview](#overview) +- [Installation](#installation) +- [Quick Start](#quick-start) +- [Core Concepts](#core-concepts) +- [Examples](#examples) +- [Documentation](#documentation) +- [Contributing](#contributing) +- [License](#license) + +
+ +## Overview + +The Model Context Protocol allows applications to provide context for LLMs in a standardized way, separating the concerns of providing context from the actual LLM interaction. This TypeScript SDK implements +[the full MCP specification](https://modelcontextprotocol.io/specification/draft), making it easy to: + +- Create MCP servers that expose resources, prompts and tools +- Build MCP clients that can connect to any MCP server +- Use standard transports like stdio and Streamable HTTP + +## Installation + +```bash +npm install @modelcontextprotocol/sdk zod +``` + +This SDK has a **required peer dependency** on `zod` for schema validation. The SDK internally imports from `zod/v4`, but maintains backwards compatibility with projects using Zod v3.25 or later. You can use either API in your code by importing from `zod/v3` or `zod/v4`: + +## Quick Start + +To see the SDK in action end-to-end, start from the runnable examples in `src/examples`: + +1. **Install dependencies** (from the SDK repo root): + + ```bash + npm install + ``` + +2. **Run the example Streamable HTTP server**: + + ```bash + npx tsx src/examples/server/simpleStreamableHttp.ts + ``` + +3. **Run the interactive client in another terminal**: + + ```bash + npx tsx src/examples/client/simpleStreamableHttp.ts + ``` + +This pair of examples demonstrates tools, resources, prompts, sampling, elicitation, tasks and logging. For a guided walkthrough and variations (stateless servers, JSON-only responses, SSE compatibility, OAuth, etc.), see [docs/server.md](docs/server.md) and +[docs/client.md](docs/client.md). + +## Core Concepts + +### Servers and transports + +An MCP server is typically created with `McpServer` and connected to a transport such as Streamable HTTP or stdio. The SDK supports: + +- **Streamable HTTP** for remote servers (recommended). +- **HTTP + SSE** for backwards compatibility only. +- **stdio** for local, process-spawned integrations. + +Runnable server examples live under `src/examples/server` and are documented in [docs/server.md](docs/server.md). + +### Tools, resources, prompts + +- **Tools** let LLMs ask your server to take actions (computation, side effects, network calls). +- **Resources** expose read-only data that clients can surface to users or models. +- **Prompts** are reusable templates that help users talk to models in a consistent way. + +The detailed APIs, including `ResourceTemplate`, completions, and display-name metadata, are covered in [docs/server.md](docs/server.md#tools-resources-and-prompts), with runnable implementations in [`simpleStreamableHttp.ts`](src/examples/server/simpleStreamableHttp.ts). + +### Capabilities: sampling, elicitation, and tasks + +The SDK includes higher-level capabilities for richer workflows: + +- **Sampling**: server-side tools can ask connected clients to run LLM completions. +- **Form elicitation**: tools can request non-sensitive input via structured forms. +- **URL elicitation**: servers can ask users to complete secure flows in a browser (e.g., API key entry, payments, OAuth). +- **Tasks (experimental)**: long-running tool calls can be turned into tasks that you poll or resume later. + +Conceptual overviews and links to runnable examples are in: + +- [docs/capabilities.md](docs/capabilities.md) + +Key example servers include: + +- [`toolWithSampleServer.ts`](src/examples/server/toolWithSampleServer.ts) +- [`elicitationFormExample.ts`](src/examples/server/elicitationFormExample.ts) +- [`elicitationUrlExample.ts`](src/examples/server/elicitationUrlExample.ts) + +### Clients + +The high-level `Client` class connects to MCP servers over different transports and exposes helpers like `listTools`, `callTool`, `listResources`, `readResource`, `listPrompts`, and `getPrompt`. + +Runnable clients live under `src/examples/client` and are described in [docs/client.md](docs/client.md), including: + +- Interactive Streamable HTTP client ([`simpleStreamableHttp.ts`](src/examples/client/simpleStreamableHttp.ts)) +- Streamable HTTP client with SSE fallback ([`streamableHttpWithSseFallbackClient.ts`](src/examples/client/streamableHttpWithSseFallbackClient.ts)) +- OAuth-enabled clients and polling/parallel examples + +### Node.js Web Crypto (globalThis.crypto) compatibility + +Some parts of the SDK (for example, JWT-based client authentication in `auth-extensions.ts` via `jose`) rely on the Web Crypto API exposed as `globalThis.crypto`. + +See [docs/faq.md](docs/faq.md) for details on supported Node.js versions and how to polyfill `globalThis.crypto` when running on older Node.js runtimes. + +## Examples + +The SDK ships runnable examples under `src/examples`. Use these tables to find the scenario you care about and jump straight to the corresponding code and docs. + +### Server examples + +| Scenario | Description | Example file(s) | Related docs | +| --------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ | +| Streamable HTTP server (stateful) | Feature-rich server with tools, resources, prompts, logging, tasks, sampling, and optional OAuth. | [`simpleStreamableHttp.ts`](src/examples/server/simpleStreamableHttp.ts) | [`server.md`](docs/server.md), [`capabilities.md`](docs/capabilities.md) | +| Streamable HTTP server (stateless) | No session tracking; good for simple API-style servers. | [`simpleStatelessStreamableHttp.ts`](src/examples/server/simpleStatelessStreamableHttp.ts) | [`server.md`](docs/server.md) | +| JSON response mode (no SSE) | Streamable HTTP with JSON responses only and limited notifications. | [`jsonResponseStreamableHttp.ts`](src/examples/server/jsonResponseStreamableHttp.ts) | [`server.md`](docs/server.md) | +| Server notifications over Streamable HTTP | Demonstrates server-initiated notifications using SSE with Streamable HTTP. | [`standaloneSseWithGetStreamableHttp.ts`](src/examples/server/standaloneSseWithGetStreamableHttp.ts) | [`server.md`](docs/server.md) | +| Deprecated HTTP+SSE server | Legacy HTTP+SSE transport for backwards-compatibility testing. | [`simpleSseServer.ts`](src/examples/server/simpleSseServer.ts) | [`server.md`](docs/server.md) | +| Backwards-compatible server (Streamable HTTP + SSE) | Single server that supports both Streamable HTTP and legacy SSE clients. | [`sseAndStreamableHttpCompatibleServer.ts`](src/examples/server/sseAndStreamableHttpCompatibleServer.ts) | [`server.md`](docs/server.md) | +| Form elicitation server | Uses form elicitation to collect non-sensitive user input. | [`elicitationFormExample.ts`](src/examples/server/elicitationFormExample.ts) | [`capabilities.md`](docs/capabilities.md#elicitation) | +| URL elicitation server | Demonstrates URL-mode elicitation in an OAuth-protected server. | [`elicitationUrlExample.ts`](src/examples/server/elicitationUrlExample.ts) | [`capabilities.md`](docs/capabilities.md#elicitation) | +| Sampling and tasks server | Combines tools, logging, sampling, and experimental task-based execution. | [`toolWithSampleServer.ts`](src/examples/server/toolWithSampleServer.ts) | [`capabilities.md`](docs/capabilities.md) | +| OAuth demo authorization server | In-memory OAuth provider used with the example servers. | [`demoInMemoryOAuthProvider.ts`](src/examples/server/demoInMemoryOAuthProvider.ts) | [`server.md`](docs/server.md) | + +### Client examples + +| Scenario | Description | Example file(s) | Related docs | +| --------------------------------------------------- | ---------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ | +| Interactive Streamable HTTP client | CLI client that exercises tools, resources, prompts, elicitation, and tasks. | [`simpleStreamableHttp.ts`](src/examples/client/simpleStreamableHttp.ts) | [`client.md`](docs/client.md) | +| Backwards-compatible client (Streamable HTTP → SSE) | Tries Streamable HTTP first, then falls back to SSE on 4xx responses. | [`streamableHttpWithSseFallbackClient.ts`](src/examples/client/streamableHttpWithSseFallbackClient.ts) | [`client.md`](docs/client.md), [`server.md`](docs/server.md) | +| SSE polling client | Polls a legacy SSE server and demonstrates notification handling. | [`ssePollingClient.ts`](src/examples/client/ssePollingClient.ts) | [`client.md`](docs/client.md) | +| Parallel tool calls client | Shows how to run multiple tool calls in parallel. | [`parallelToolCallsClient.ts`](src/examples/client/parallelToolCallsClient.ts) | [`client.md`](docs/client.md) | +| Multiple clients in parallel | Demonstrates connecting multiple clients concurrently to the same server. | [`multipleClientsParallel.ts`](src/examples/client/multipleClientsParallel.ts) | [`client.md`](docs/client.md) | +| OAuth clients | Examples of client_credentials (basic and private_key_jwt) and reusable providers. | [`simpleOAuthClient.ts`](src/examples/client/simpleOAuthClient.ts), [`simpleOAuthClientProvider.ts`](src/examples/client/simpleOAuthClientProvider.ts), [`simpleClientCredentials.ts`](src/examples/client/simpleClientCredentials.ts) | [`client.md`](docs/client.md) | +| URL elicitation client | Works with the URL elicitation server to drive secure browser flows. | [`elicitationUrlExample.ts`](src/examples/client/elicitationUrlExample.ts) | [`capabilities.md`](docs/capabilities.md#elicitation) | + +Shared utilities: + +- In-memory event store for resumability: [`inMemoryEventStore.ts`](src/examples/shared/inMemoryEventStore.ts) (see [`server.md`](docs/server.md)). + +For more details on how to run these examples (including recommended commands and deployment diagrams), see `src/examples/README.md`. + +## Documentation + +- Local SDK docs: + - [docs/server.md](docs/server.md) – building and running MCP servers, transports, tools/resources/prompts, CORS, DNS rebinding, and multi-node deployment. + - [docs/client.md](docs/client.md) – using the high-level client, transports, backwards compatibility, and OAuth helpers. + - [docs/capabilities.md](docs/capabilities.md) – sampling, elicitation (form and URL), and experimental task-based execution. + - [docs/faq.md](docs/faq.md) – environment and troubleshooting FAQs (including Node.js Web Crypto support). +- External references: + - [Model Context Protocol documentation](https://modelcontextprotocol.io) + - [MCP Specification](https://spec.modelcontextprotocol.io) + - [Example Servers](https://github.com/modelcontextprotocol/servers) + +## Contributing + +Issues and pull requests are welcome on GitHub at . + +## License + +This project is licensed under the MIT License—see the [LICENSE](LICENSE) file for details. diff --git a/llama.cpp/tools/ui/node_modules/@napi-rs/canvas-linux-arm64-gnu/README.md b/llama.cpp/tools/ui/node_modules/@napi-rs/canvas-linux-arm64-gnu/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f77016bcfe2d234986179305c14eaa548565137c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@napi-rs/canvas-linux-arm64-gnu/README.md @@ -0,0 +1,3 @@ +# `@napi-rs/canvas-linux-arm64-gnu` + +This is the **aarch64-unknown-linux-gnu** binary for `@napi-rs/canvas` diff --git a/llama.cpp/tools/ui/node_modules/@napi-rs/canvas-linux-arm64-musl/README.md b/llama.cpp/tools/ui/node_modules/@napi-rs/canvas-linux-arm64-musl/README.md new file mode 100644 index 0000000000000000000000000000000000000000..addc29d0ea79f451d943b7cf3e6189452ad7a320 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@napi-rs/canvas-linux-arm64-musl/README.md @@ -0,0 +1,3 @@ +# `@napi-rs/canvas-linux-arm64-musl` + +This is the **aarch64-unknown-linux-musl** binary for `@napi-rs/canvas` diff --git a/llama.cpp/tools/ui/node_modules/@napi-rs/canvas/README.md b/llama.cpp/tools/ui/node_modules/@napi-rs/canvas/README.md new file mode 100644 index 0000000000000000000000000000000000000000..ecf2612abcfd8e13b53f218f851e3667deefc14d --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@napi-rs/canvas/README.md @@ -0,0 +1,448 @@ +# `skr canvas` + +[![CI](https://github.com/Brooooooklyn/canvas/actions/workflows/CI.yaml/badge.svg)](https://github.com/Brooooooklyn/canvas/actions/workflows/CI.yaml) +![Skia Version](https://img.shields.io/badge/Skia-chrome%2Fm148-hotpink) +[![install size](https://packagephobia.com/badge?p=@napi-rs/canvas)](https://packagephobia.com/result?p=@napi-rs/canvas) +[![Downloads](https://img.shields.io/npm/dm/@napi-rs/canvas.svg?sanitize=true)](https://npmcharts.com/compare/@napi-rs/canvas?minimal=true) + +> 🚀 Help me to become a full-time open-source developer by [sponsoring me on Github](https://github.com/sponsors/Brooooooklyn) + +Google Skia binding to Node.js via [Node-API](https://napi.rs), **0 System dependencies!** + +⚠️ This project is in pre-release stage. And there may be some bugs.
+For details on planned features and future direction please refer to the [Roadmap](https://github.com/Brooooooklyn/canvas/issues/113). + +[中文文档](./README-zh.md) + +# Install + +```bash +yarn add @napi-rs/canvas +npm install @napi-rs/canvas +``` + +# Support matrix + +## System requirement + +### `arm64` + +[**_cortex-a57_**](https://en.wikipedia.org/wiki/ARM_Cortex-A57) or newer CPU architecture on **Linux**. + +All Apple M chips on **macOS**. + +### `armv7` + +[**_cortex-a7_**](https://en.wikipedia.org/wiki/ARM_Cortex-A7) or newer CPU architecture. + +### glibc + +Since Skia relies on the [glibc](https://www.gnu.org/software/libc/) 2.18 API, you need to have at least glibc version >= 2.18 on your system. + +## AWS Lambda usage + +To use this library on Lambda you will need to use a Lambda layer. + +You can simply attach a lambda layer by getting an ARN from [Canvas-Lambda-Layer](https://github.com/ShivamJoker/Canvas-Lambda-Layer) + +> Make sure to exclude `@napi-rs/canvas` while bundling your Lambda. + +# Usage + +```js +const { promises } = require('node:fs') +const { join } = require('node:path') +const { createCanvas, loadImage } = require('@napi-rs/canvas') + +const canvas = createCanvas(300, 320) +const ctx = canvas.getContext('2d') + +ctx.lineWidth = 10 +ctx.strokeStyle = '#03a9f4' +ctx.fillStyle = '#03a9f4' + +// Wall +ctx.strokeRect(75, 140, 150, 110) + +// Door +ctx.fillRect(130, 190, 40, 60) + +// Roof +ctx.beginPath() +ctx.moveTo(50, 140) +ctx.lineTo(150, 60) +ctx.lineTo(250, 140) +ctx.closePath() +ctx.stroke() + +async function main() { + // load images from disk or from a URL + const catImage = await loadImage('path/to/cat.png') + const dogImage = await loadImage('https://example.com/path/to/dog.jpg') + + ctx.drawImage(catImage, 0, 0, catImage.width, catImage.height) + + ctx.drawImage(dogImage, canvas.width / 2, canvas.height / 2, dogImage.width, dogImage.height) + + // export canvas as image + const pngData = await canvas.encode('png') // JPEG, AVIF and WebP are also supported + // encoding in libuv thread pool, non-blocking + await promises.writeFile(join(__dirname, 'simple.png'), pngData) +} + +main() +``` + +![](./example/simple.png) + +## Emoji text + +```js +const { writeFileSync } = require('fs') +const { join } = require('path') + +const { createCanvas, GlobalFonts } = require('@napi-rs/canvas') + +GlobalFonts.registerFromPath(join(__dirname, '..', 'fonts', 'AppleColorEmoji@2x.ttf'), 'Apple Emoji') +GlobalFonts.registerFromPath(join(__dirname, '..', '__test__', 'fonts', 'COLRv1.ttf'), 'COLRv1') + +console.info(GlobalFonts.families) + +const canvas = createCanvas(760, 360) +const ctx = canvas.getContext('2d') + +ctx.font = '50px Apple Emoji' +ctx.strokeText('😀😃😄😁😆😅😂🤣☺️😊😊😇', 50, 150) + +ctx.font = '100px COLRv1' +ctx.fillText('abc', 50, 300) + +const b = canvas.toBuffer('image/png') + +writeFileSync(join(__dirname, 'draw-emoji.png'), b) +``` + +![](./example/draw-emoji.png) + +# Performance + +See [benchmark](./benchmark) for benchmark code. + +Hardware info: + +``` + ,MMMM. Host - xxxxxxxxxxxxxxxxxxxxxxx + .MMMMMM Machine - Mac15,9 + MMMMM, Kernel - 24.0.0 + .;MMMMM:' MMMMMMMMMM;. OS - macOS 15.0.1 Sequoia + MMMMMMMMMMMMNWMMMMMMMMMMM: DE - Aqua + .MMMMMMMMMMMMMMMMMMMMMMMMWM. WM - Quartz Compositor + MMMMMMMMMMMMMMMMMMMMMMMMM. Packages - 194 (Homebrew), 32 (cargo) + ;MMMMMMMMMMMMMMMMMMMMMMMM: Shell - zsh + :MMMMMMMMMMMMMMMMMMMMMMMM: Terminal - warpterminal (Version v0.2024.10.23.14.49.stable_00) + .MMMMMMMMMMMMMMMMMMMMMMMMM. Resolution - 5120x2880@160fps (as 2560x1440) + MMMMMMMMMMMMMMMMMMMMMMMMMMM. 2992x1934@120fps (as 1496x967) + .MMMMMMMMMMMMMMMMMMMMMMMMMM. 2232x1512@60fps (as 1116x756) + MMMMMMMMMMMMMMMMMMMMMMMM Uptime - 1d 2h 32m + ;MMMMMMMMMMMMMMMMMMMM. CPU - Apple M3 Max (16) + .MMMM,. .MMMM,. CPU Load - 16% + Memory - 50.1 GB / 134.2 GB + Battery - 78% & Discharging + Disk Space - 624.0 GB / 994.7 GB +``` + +``` +❯ yarn bench +Draw a House and export to PNG +┌─────────┬─────────────────┬───────────────────────┬──────────────────────────┬────────────────────────────┬───────────────────────────┬─────────┐ +│ (index) │ Task name │ Latency average (ns) │ Latency median (ns) │ Throughput average (ops/s) │ Throughput median (ops/s) │ Samples │ +├─────────┼─────────────────┼───────────────────────┼──────────────────────────┼────────────────────────────┼───────────────────────────┼─────────┤ +│ 0 │ '@napi-rs/skia' │ '14676992.14 ± 0.68%' │ '14602333.00' │ '68 ± 0.59%' │ '68' │ 69 │ +│ 1 │ 'skia-canvas' │ '21167809.17 ± 2.05%' │ '20960021.00 ± 13646.00' │ '47 ± 1.31%' │ '48' │ 64 │ +│ 2 │ 'node-canvas' │ '16552027.42 ± 0.70%' │ '16451291.50 ± 2208.50' │ '60 ± 0.62%' │ '61' │ 64 │ +└─────────┴─────────────────┴───────────────────────┴──────────────────────────┴────────────────────────────┴───────────────────────────┴─────────┘ +Draw Gradient and export to PNG +┌─────────┬─────────────────┬───────────────────────┬─────────────────────────┬────────────────────────────┬───────────────────────────┬─────────┐ +│ (index) │ Task name │ Latency average (ns) │ Latency median (ns) │ Throughput average (ops/s) │ Throughput median (ops/s) │ Samples │ +├─────────┼─────────────────┼───────────────────────┼─────────────────────────┼────────────────────────────┼───────────────────────────┼─────────┤ +│ 0 │ '@napi-rs/skia' │ '15228495.58 ± 0.53%' │ '15146312.50 ± 1187.50' │ '66 ± 0.48%' │ '66' │ 66 │ +│ 1 │ 'skia-canvas' │ '21725564.41 ± 2.20%' │ '21412520.50 ± 2104.50' │ '46 ± 1.39%' │ '47' │ 64 │ +│ 2 │ 'node-canvas' │ '17976022.14 ± 1.53%' │ '17563479.50 ± 5104.50' │ '56 ± 1.38%' │ '57' │ 64 │ +└─────────┴─────────────────┴───────────────────────┴─────────────────────────┴────────────────────────────┴───────────────────────────┴─────────┘ +``` + +# Features + +## Path2D + +```typescript +new Path2D() +new Path2D(path: Path2D) +// new Path2D('M108.956,403.826c0,0,0.178,3.344-1.276,3.311 c-1.455-0.033-30.507-84.917-66.752-80.957C40.928,326.18,72.326,313.197,108.956,403.826z') +new Path2D(path: string) +``` + +```typescript +export interface DOMMatrix2DInit { + a: number + b: number + c: number + d: number + e: number + f: number +} + +export class Path2D { + constructor(path?: Path2D | string) + + addPath(path: Path2D, transform?: DOMMatrix2DInit): void + arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void + arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void + bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number, y: number): void + closePath(): void + ellipse( + x: number, + y: number, + radiusX: number, + radiusY: number, + rotation: number, + startAngle: number, + endAngle: number, + anticlockwise?: boolean, + ): void + lineTo(x: number, y: number): void + moveTo(x: number, y: number): void + quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void + rect(x: number, y: number, w: number, h: number): void + + // PathKit methods + op(path: Path2D, operation: PathOp): Path2D + toSVGString(): string + getFillType(): FillType + getFillTypeString(): string + setFillType(type: FillType): void + simplify(): Path2D + asWinding(): Path2D + stroke(stroke?: StrokeOptions): Path2D + transform(transform: DOMMatrix2DInit): Path2D + getBounds(): [left: number, top: number, right: number, bottom: number] + computeTightBounds(): [left: number, top: number, right: number, bottom: number] + trim(start: number, end: number, isComplement?: boolean): Path2D + round(radius: number): Path2D + equals(path: Path2D): boolean +} +``` + +## PathKit + +`PathKit` is a toolset for manipulating Path in `Skia`, supporting **_quadratic beziers_**, **_cubic beziers_** and **_conics_**. +The main features are. + +### Path Operation + +`.op(path, PathOp)` + +```js +const pathOne = new Path2D( + 'M8 50H92C96.4183 50 100 53.5817 100 58V142C100 146.418 96.4183 150 92 150H8C3.58172 150 0 146.418 0 142V58C0 53.5817 3.58172 50 8 50Z', +) +const pathTwo = new Path2D( + '"M58 0H142C146.418 0 150 3.58172 150 8V92C150 96.4183 146.418 100 142 100H58C53.5817 100 50 96.4183 50 92V8C50 3.58172 53.5817 0 58 0Z', +) + +pathOne.op(pathTwo, PathOp.Intersect).toSVGString() +// => "M100 100L58 100C53.5817 100 50 96.4183 50 92L50 50L92 50C96.4183 50 100 53.5817 100 58L100 100Z" +``` + +- **Union**, subtract the op path from the first path +- **Difference**, intersect the two paths +- **ReverseDifference**, union (inclusive-or) the two paths +- **Intersect**, exclusive-or the two paths +- **XOR**, subtract the first path from the op path + +![boolean-operations](./docs/imgs/boolean-operations.svg) + +### Covert `FillType` in **_Path_** + +`.asWinding()` + +You can convert `fill-rule="evenodd"` to `fill-rule="nonzero"` in SVG. +This is useful for **OpenType** font-related tools, as `fill-rule="nonzero"` is only supported in **OpenType** fonts. + +![SVG fill-rule](./docs/imgs/asWinding@2x.png) + +```js +const pathCircle = new Path2D( + 'M24.2979 13.6364H129.394V40.9091H24.2979L14.6278 27.2727L24.2979 13.6364ZM21.9592 0C19.0246 0 16.2716 1.42436 14.571 3.82251L1.67756 22.0043C-0.559186 25.1585 -0.559186 29.387 1.67756 32.5411L14.571 50.7227C16.2716 53.1209 19.0246 54.5455 21.9592 54.5455H70.4673V68.1818H16.073C11.0661 68.1818 7.00728 72.2518 7.00728 77.2727V113.636C7.00728 118.657 11.0661 122.727 16.073 122.727H70.4673V150H84.0658V122.727H128.041C130.975 122.727 133.729 121.303 135.429 118.905L148.323 100.723C150.559 97.5686 150.559 93.3405 148.323 90.1864L135.429 72.0045C133.729 69.6064 130.975 68.1818 128.041 68.1818H84.0658V54.5455H133.927C138.934 54.5455 142.993 50.4755 142.993 45.4545V9.09091C142.993 4.07014 138.934 0 133.927 0H21.9592ZM125.702 109.091H20.6058V81.8182H125.702L135.372 95.4545L125.702 109.091Z', +) +pathCircle.setFillType(FillType.EvenOdd) +pathCircle.asWinding().toSVGString() +// => "M24.2979 13.6364L129.394 13.6364L129.394 40.9091L24.2979 40.9091L14.6278 27.2727L24.2979 13.6364ZM21.9592 0C19.0246 0 16.2716 1.42436 14.571 3.82251L1.67756 22.0043C-0.559186 25.1585 -0.559186 29.387 1.67756 32.5411L14.571 50.7227C16.2716 53.1209 19.0246 54.5455 21.9592 54.5455L70.4673 54.5455L70.4673 68.1818L16.073 68.1818C11.0661 68.1818 7.00728 72.2518 7.00728 77.2727L7.00728 113.636C7.00728 118.657 11.0661 122.727 16.073 122.727L70.4673 122.727L70.4673 150L84.0658 150L84.0658 122.727L128.041 122.727C130.975 122.727 133.729 121.303 135.429 118.905L148.323 100.723C150.559 97.5686 150.559 93.3405 148.323 90.1864L135.429 72.0045C133.729 69.6064 130.975 68.1818 128.041 68.1818L84.0658 68.1818L84.0658 54.5455L133.927 54.5455C138.934 54.5455 142.993 50.4755 142.993 45.4545L142.993 9.09091C142.993 4.07014 138.934 0 133.927 0L21.9592 0ZM125.702 109.091L20.6058 109.091L20.6058 81.8182L125.702 81.8182L135.372 95.4545L125.702 109.091Z" +``` + +### Simplify **_Path_** + +`.simplify()` + +Set the path to the same non-overlapping contour as the original path area, which means that it can also remove overlapping paths. + + + +[SVG with overlapping paths](./docs/imgs/overlapping-path.svg) (Left) + +```js +const path = + 'M2.933,89.89 L89.005,3.818 Q90.412,2.411 92.249,1.65 Q94.087,0.889 96.076,0.889 Q98.065,0.889 99.903,1.65 Q101.741,2.411 103.147,3.818 L189.22,89.89 Q190.626,91.296 191.387,93.134 Q192.148,94.972 192.148,96.961 Q192.148,98.95 191.387,100.788 Q190.626,102.625 189.219,104.032 Q187.813,105.439 185.975,106.2 Q184.138,106.961 182.148,106.961 Q180.159,106.961 178.322,106.2 Q176.484,105.439 175.077,104.032 L89.005,17.96 L96.076,10.889 L103.147,17.96 L17.075,104.032 Q15.668,105.439 13.831,106.2 Q11.993,106.961 10.004,106.961 Q8.015,106.961 6.177,106.2 Q4.339,105.439 2.933,104.032 Q1.526,102.625 0.765,100.788 Q0.004,98.95 0.004,96.961 Q0.004,94.972 0.765,93.134 Q1.526,91.296 2.933,89.89 Z' + +path.simplify().toSVGString() +// => "M89.005 3.818L2.933 89.89Q1.526 91.296 0.765 93.134Q0.004 94.972 0.004 96.961Q0.004 98.95 0.765 100.788Q1.526 102.625 2.933 104.032Q4.339 105.439 6.177 106.2Q8.015 106.961 10.004 106.961Q11.993 106.961 13.831 106.2Q15.668 105.439 17.075 104.032L96.076 25.031L175.077 104.032Q176.484 105.439 178.322 106.2Q180.159 106.961 182.148 106.961Q184.138 106.961 185.975 106.2Q187.813 105.439 189.219 104.032Q190.626 102.625 191.387 100.788Q192.148 98.95 192.148 96.961Q192.148 94.972 191.387 93.134Q190.626 91.296 189.22 89.89L103.147 3.818Q101.741 2.411 99.903 1.65Q98.065 0.889 96.076 0.889Q94.087 0.889 92.249 1.65Q90.412 2.411 89.005 3.818Z" +``` + +## Lottie Animation + +Render [Lottie](https://airbnb.io/lottie/) animations using Skia's [Skottie](https://skia.org/docs/user/modules/skottie/) module. + +### Load Animation + +```js +const { LottieAnimation } = require('@napi-rs/canvas') + +// Load from file +const animation = LottieAnimation.loadFromFile('animation.json') + +// Load from JSON string with resource path for external assets +const animation = LottieAnimation.loadFromData(jsonString, { + resourcePath: '/path/to/assets', +}) +``` + +### Animation Properties + +```js +animation.duration // Total duration in seconds +animation.fps // Frames per second +animation.frames // Total frame count +animation.width // Animation width +animation.height // Animation height +animation.version // Lottie format version +``` + +### Playback Control + +```js +animation.seekFrame(30) // Seek to frame 30 +animation.seek(1.5) // Seek to 1.5 seconds +``` + +### Render to Canvas + +```js +const { createCanvas, LottieAnimation } = require('@napi-rs/canvas') + +const animation = LottieAnimation.loadFromFile('animation.json') +const canvas = createCanvas(animation.width, animation.height) +const ctx = canvas.getContext('2d') + +// Render at original size +animation.render(ctx) + +// Render with custom destination rect +animation.render(ctx, { x: 0, y: 0, width: 800, height: 600 }) +``` + +### Supported Features + +- **Embedded images** - Base64-encoded images (`data:image/png;base64,...`) +- **Embedded fonts** - Vector glyph paths for text rendering without system fonts +- **External assets** - Load images from `resourcePath` directory +- **dotLottie format** - Extract `.lottie` ZIP files at runtime (see example) + +### Example: Encode Lottie to Video + +See [`example/lottie-to-video.ts`](./example/lottie-to-video.ts) for encoding Lottie animations to MP4 using [`@napi-rs/webcodecs`](https://github.com/Brooooooklyn/webcodecs-node). + +```js +import { createCanvas, LottieAnimation } from '@napi-rs/canvas' +import { + VideoEncoder, + VideoFrame, + Mp4Muxer, + type EncodedVideoChunk, + type EncodedVideoChunkMetadata, +} from '@napi-rs/webcodecs' + +const animation = LottieAnimation.loadFromFile('animation.json') +const canvas = createCanvas(animation.width, animation.height) +const ctx = canvas.getContext('2d') + +for (let frame = 0; frame < animation.frames; frame++) { + animation.seekFrame(frame) + ctx.fillStyle = '#ffffff' + ctx.fillRect(0, 0, canvas.width, canvas.height) + animation.render(ctx) + // Encode frame to video... +} +``` + +# [Example](./example/tiger.js) + +> The tiger.json was serialized from [gojs/samples/tiger](https://github.com/NorthwoodsSoftware/GoJS/blob/master/samples/tiger.html) + + + +```shell +node example/anime-girl.js +``` + +| SVG | PNG | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +|
[CC-BY-SA 3.0](https://creativecommons.org/licenses/by/3.0) by [Niabot](https://commons.wikimedia.org/wiki/User:Niabot) |
[CC-BY-SA 3.0](https://creativecommons.org/licenses/by/3.0) by [Niabot](https://commons.wikimedia.org/wiki/User:Niabot) | + +# Building + +## Build skia from source + +You can build this project from source, the system requirements are here: https://skia.org/docs/user/build + +```sh +# Clone the code: +$ git clone --recurse-submodules https://github.com/Brooooooklyn/canvas.git +$ cd canvas + +# Build Skia: +$ node scripts/build-skia.js + +# Install NPM packages, build the Node.js addon: +$ npm install -g yarn +$ yarn install --mode=skip-build # Here are modules that are used for benchmarking and are hard to install, you can skip it by specifying `--mode=skip-build` +$ sudo dnf install clang # https://fedora.pkgs.org/34/fedora-x86_64/clang-12.0.0-0.3.rc1.fc34.x86_64.rpm.html +$ yarn build + +# All done! Run test cases or examples now: +$ yarn test +$ node example/tiger.js +``` + +## Pull pre-build skia binary from GitHub + +You can pull skia pre-build binaries if you just care the `Rust` part: + +```sh +# Clone the code: +$ git clone --recurse-submodules https://github.com/Brooooooklyn/canvas.git +$ cd canvas + +# Download Skia binaries: +# It will pull the binaries match the git hash in `./skia` submodule +$ node scripts/release-skia-binary.mjs --download + +# Install NPM packages, build the Node.js addon: +$ npm install -g yarn +$ yarn install --mode=skip-build +$ sudo dnf install clang # https://fedora.pkgs.org/34/fedora-x86_64/clang-12.0.0-0.3.rc1.fc34.x86_64.rpm.html +$ yarn build + +# All done! Run test cases or examples now: +$ yarn test +$ node example/tiger.js +``` diff --git a/llama.cpp/tools/ui/node_modules/@neoconfetti/react/README.md b/llama.cpp/tools/ui/node_modules/@neoconfetti/react/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cbb74f61adc8afe7512371bdb69a256170fda7fa --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@neoconfetti/react/README.md @@ -0,0 +1,202 @@ +# @neoconfetti/react + +Let's party 🎊🎊 with React! `@neoconfetti/react` allows you to show an awesome confetti explosion on your page, with React/Preact/Million! + +## Features + +- 🤏 Tiny - 1.61KB min+br. +- 🐇 Simple - Quite simple to use, and effectively no-config required! +- 🗃️ Customizable - Offers tons of options that you can modify to get different behaviors. +- 🖥️ SSR friendly - Works seamlessly in NextJS/Remix/Gatsby/Redwood and other Server Side Rendering environments! + + + + +## Installing + +```bash +# pnpm +pnpm add @neoconfetti/react + +# bun +bun install @neoconfetti/react + +# npm +npm install @neoconfetti/react +``` + +## Usage + +Basic usage: + +```tsx +import { Confetti } from '@neoconfetti/react'; + +; +``` + +Customizing behavior with options: + +```tsx + +``` + +## Props + +There's tons of options available for this package. All of them are already documented within the code itself, so you'll never have to leave the code editor. + +### particleCount + +Number of confetti particles to create. + +**type:** `number` + +**Default value:** 150 + +**Example:** + +```tsx + +``` + +### particleSize + +Size of the confetti particles in pixels + +**type:** `number` + +**Default value:** 12 + +**Example:** + +```tsx + +``` + +### particleShape + +Shape of particles to use. Can be `mix`, `circles` or `rectangles` + +`mix` will use both circles and rectangles +`circles` will use only circles +`rectangles` will use only rectangles + +**type:** `'mix' | 'circles' | 'rectangles'` + +**Default value:** `'mix'` + +**Example:** + +```tsx + +``` + +### duration + +Duration of the animation in milliseconds + +**type:** `number` + +**Default value:** 3500 + +**Example:** + +```tsx + +``` + +### colors + +Colors to use for the confetti particles. Pass string array of colors. Can use hex colors, named colors, CSS Variables, literally anything valid in plain CSS. + +**type:** `Array` + +**Default value:** `['#FFC700', '#FF0000', '#2E3191', '#41BBC7']` + +**Example:** + +```tsx + +``` + +### force + +Force of the confetti particles. Between 0 and 1. 0 is no force, 1 is maximum force. Will error out if you pass a value outside of this range. + +**type:** `number` + +**Default value:** 0.5 + +**Example:** + +```tsx + +``` + +### stageHeight + +Height of the stage in pixels. Confetti will only fall within this height. + +**type:** `number` + +**Default value:** 800 + +**Example:** + +```tsx + +``` + +### stageWidth + +Width of the stage in pixels. Confetti will only fall within this width. + +**type:** `number` + +**Default value:** 1600 + +**Example:** + +```tsx + +``` + +### destroyAfterDone + +Whether or not destroy all confetti nodes after the `duration` period has passed. By default it destroys all nodes, to free up memory. + +**type:** `boolean` + +**Default value:** `true` + +**Example:** + +```tsx + +``` + + + + + + +## Fine-grained reactivity + +Changing the options will destroy the existing confetti mid-flight, and create a new one with the new options. Exception: If `particlesCount` isn't changed, and properties like `colors` or `particleShape` is changed, the confetti particles will change their colors or shape mid-flight. + +## Performance + +This library functions by creating 2 DOM nodes for every single confetti. By default, if the `particlesCount` is set to 150, it will create 300 nodes. This is a lot of nodes. For most devices, these many nodes are not a big issue, but I recommend checking your target devices' performance if you choose to go with a higher number, like 400 or 500. + +Also, after the specified `duration`, all the confetti DOM nodes will be destroyed. This is to free up memory. If you wish to keep them around, set `destroyAfterDone` to `false`. + +## Credits + +This library is the port of the amazing [react-confetti-explosion](https://www.npmjs.com/package//react-confetti-explosion) package, just **10X** smaller and faster. All the logic is from that package only, optimisation and Svelte code are mine 😉 + +## License + +MIT License +© [Puru Vijay](https://twitter.com/puruvjdev) diff --git a/llama.cpp/tools/ui/node_modules/@oxc-parser/binding-linux-arm64-gnu/README.md b/llama.cpp/tools/ui/node_modules/@oxc-parser/binding-linux-arm64-gnu/README.md new file mode 100644 index 0000000000000000000000000000000000000000..878ab3c4db2bb425f7441cfd72e33e499cc43dfb --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@oxc-parser/binding-linux-arm64-gnu/README.md @@ -0,0 +1,3 @@ +# `@oxc-parser/binding-linux-arm64-gnu` + +This is the **aarch64-unknown-linux-gnu** binary for `@oxc-parser/binding` diff --git a/llama.cpp/tools/ui/node_modules/@oxc-parser/binding-linux-arm64-musl/README.md b/llama.cpp/tools/ui/node_modules/@oxc-parser/binding-linux-arm64-musl/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4e5dee25d451235b5a11ee9ab18d25a2659f9d9a --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@oxc-parser/binding-linux-arm64-musl/README.md @@ -0,0 +1,3 @@ +# `@oxc-parser/binding-linux-arm64-musl` + +This is the **aarch64-unknown-linux-musl** binary for `@oxc-parser/binding` diff --git a/llama.cpp/tools/ui/node_modules/@oxc-project/types/README.md b/llama.cpp/tools/ui/node_modules/@oxc-project/types/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d5b248ac3fc1e8673b6fc55bda1c04e9a0464d02 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@oxc-project/types/README.md @@ -0,0 +1,3 @@ +# Oxc Types + +Typescript definitions for Oxc AST nodes. diff --git a/llama.cpp/tools/ui/node_modules/@oxc-resolver/binding-linux-arm64-gnu/README.md b/llama.cpp/tools/ui/node_modules/@oxc-resolver/binding-linux-arm64-gnu/README.md new file mode 100644 index 0000000000000000000000000000000000000000..9ac50e8d45f0e58bbef237bb290150b229b20fb0 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@oxc-resolver/binding-linux-arm64-gnu/README.md @@ -0,0 +1,3 @@ +# `@oxc-resolver/binding-linux-arm64-gnu` + +This is the **aarch64-unknown-linux-gnu** binary for `@oxc-resolver/binding` diff --git a/llama.cpp/tools/ui/node_modules/@oxc-resolver/binding-linux-arm64-musl/README.md b/llama.cpp/tools/ui/node_modules/@oxc-resolver/binding-linux-arm64-musl/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a4d720f20f47f12ee41d2ce7ae3d96cd9184eb63 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@oxc-resolver/binding-linux-arm64-musl/README.md @@ -0,0 +1,3 @@ +# `@oxc-resolver/binding-linux-arm64-musl` + +This is the **aarch64-unknown-linux-musl** binary for `@oxc-resolver/binding` diff --git a/llama.cpp/tools/ui/node_modules/@parcel/watcher-linux-arm64-glibc/README.md b/llama.cpp/tools/ui/node_modules/@parcel/watcher-linux-arm64-glibc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..c797dacb0789511670390cd4487241e74c677394 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@parcel/watcher-linux-arm64-glibc/README.md @@ -0,0 +1 @@ +This is the linux-arm64-glibc build of @parcel/watcher. See https://github.com/parcel-bundler/watcher for details. \ No newline at end of file diff --git a/llama.cpp/tools/ui/node_modules/@parcel/watcher-linux-arm64-musl/README.md b/llama.cpp/tools/ui/node_modules/@parcel/watcher-linux-arm64-musl/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a776fb0ca97709eea70f7d7539ad857f8b1b52c9 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@parcel/watcher-linux-arm64-musl/README.md @@ -0,0 +1 @@ +This is the linux-arm64-musl build of @parcel/watcher. See https://github.com/parcel-bundler/watcher for details. \ No newline at end of file diff --git a/llama.cpp/tools/ui/node_modules/@parcel/watcher/README.md b/llama.cpp/tools/ui/node_modules/@parcel/watcher/README.md new file mode 100644 index 0000000000000000000000000000000000000000..28e74f063e3c7b7a235de31fe642a3f6e622b7fd --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@parcel/watcher/README.md @@ -0,0 +1,136 @@ +# @parcel/watcher + +A native C++ Node module for querying and subscribing to filesystem events. Used by [Parcel 2](https://github.com/parcel-bundler/parcel). + +## Features + +- **Watch** - subscribe to realtime recursive directory change notifications when files or directories are created, updated, or deleted. +- **Query** - performantly query for historical change events in a directory, even when your program is not running. +- **Native** - implemented in C++ for performance and low-level integration with the operating system. +- **Cross platform** - includes backends for macOS, Linux, Windows, FreeBSD, and Watchman. +- **Performant** - events are throttled in C++ so the JavaScript thread is not overwhelmed during large filesystem changes (e.g. `git checkout` or `npm install`). +- **Scalable** - tens of thousands of files can be watched or queried at once with good performance. + +## Example + +```javascript +const watcher = require('@parcel/watcher'); +const path = require('path'); + +// Subscribe to events +let subscription = await watcher.subscribe(process.cwd(), (err, events) => { + console.log(events); +}); + +// later on... +await subscription.unsubscribe(); + +// Get events since some saved snapshot in the past +let snapshotPath = path.join(process.cwd(), 'snapshot.txt'); +let events = await watcher.getEventsSince(process.cwd(), snapshotPath); + +// Save a snapshot for later +await watcher.writeSnapshot(process.cwd(), snapshotPath); +``` + +## Watching + +`@parcel/watcher` supports subscribing to realtime notifications of changes in a directory. It works recursively, so changes in sub-directories will also be emitted. + +Events are throttled and coalesced for performance during large changes like `git checkout` or `npm install`, and a single notification will be emitted with all of the events at the end. + +Only one notification will be emitted per file. For example, if a file was both created and updated since the last event, you'll get only a `create` event. If a file is both created and deleted, you will not be notifed of that file. Renames cause two events: a `delete` for the old name, and a `create` for the new name. + +```javascript +let subscription = await watcher.subscribe(process.cwd(), (err, events) => { + console.log(events); +}); +``` + +Events have two properties: + +- `type` - the event type: `create`, `update`, or `delete`. +- `path` - the absolute path to the file or directory. + +To unsubscribe from change notifications, call the `unsubscribe` method on the returned subscription object. + +```javascript +await subscription.unsubscribe(); +``` + +`@parcel/watcher` has the following watcher backends, listed in priority order: + +- [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) on macOS +- [Watchman](https://facebook.github.io/watchman/) if installed +- [inotify](http://man7.org/linux/man-pages/man7/inotify.7.html) on Linux +- [ReadDirectoryChangesW](https://msdn.microsoft.com/en-us/library/windows/desktop/aa365465%28v%3Dvs.85%29.aspx) on Windows +- [kqueue](https://man.freebsd.org/cgi/man.cgi?kqueue) on FreeBSD, or as an alternative to FSEvents on macOS + +You can specify the exact backend you wish to use by passing the `backend` option. If that backend is not available on the current platform, the default backend will be used instead. See below for the list of backend names that can be passed to the options. + +## Querying + +`@parcel/watcher` also supports querying for historical changes made in a directory, even when your program is not running. This makes it easy to invalidate a cache and re-build only the files that have changed, for example. It can be **significantly** faster than traversing the entire filesystem to determine what files changed, depending on the platform. + +In order to query for historical changes, you first need a previous snapshot to compare to. This can be saved to a file with the `writeSnapshot` function, e.g. just before your program exits. + +```javascript +await watcher.writeSnapshot(dirPath, snapshotPath); +``` + +When your program starts up, you can query for changes that have occurred since that snapshot using the `getEventsSince` function. + +```javascript +let events = await watcher.getEventsSince(dirPath, snapshotPath); +``` + +The events returned are exactly the same as the events that would be passed to the `subscribe` callback (see above). + +`@parcel/watcher` has the following watcher backends, listed in priority order: + +- [FSEvents](https://developer.apple.com/documentation/coreservices/file_system_events) on macOS +- [Watchman](https://facebook.github.io/watchman/) if installed +- [fts](http://man7.org/linux/man-pages/man3/fts.3.html) (brute force) on Linux and FreeBSD +- [FindFirstFile](https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-findfirstfilea) (brute force) on Windows + +The FSEvents (macOS) and Watchman backends are significantly more performant than the brute force backends used by default on Linux and Windows, for example returning results in miliseconds instead of seconds for large directory trees. This is because a background daemon monitoring filesystem changes on those platforms allows us to query cached data rather than traversing the filesystem manually (brute force). + +macOS has good performance with FSEvents by default. For the best performance on other platforms, install [Watchman](https://facebook.github.io/watchman/) and it will be used by `@parcel/watcher` automatically. + +You can specify the exact backend you wish to use by passing the `backend` option. If that backend is not available on the current platform, the default backend will be used instead. See below for the list of backend names that can be passed to the options. + +## Options + +All of the APIs in `@parcel/watcher` support the following options, which are passed as an object as the last function argument. + +- `ignore` - an array of paths or glob patterns to ignore. uses [`is-glob`](https://github.com/micromatch/is-glob) to distinguish paths from globs. glob patterns are parsed with [`picomatch`](https://github.com/micromatch/picomatch) (see [features](https://github.com/micromatch/picomatch#globbing-features)). + - paths can be relative or absolute and can either be files or directories. No events will be emitted about these files or directories or their children. + - glob patterns match on relative paths from the root that is watched. No events will be emitted for matching paths. +- `backend` - the name of an explicitly chosen backend to use. Allowed options are `"fs-events"`, `"watchman"`, `"inotify"`, `"kqueue"`, `"windows"`, or `"brute-force"` (only for querying). If the specified backend is not available on the current platform, the default backend will be used instead. + +## WASM + +The `@parcel/watcher-wasm` package can be used in place of `@parcel/watcher` on unsupported platforms. It relies on the Node `fs` module, so in non-Node environments such as browsers, an `fs` polyfill will be needed. + +**Note**: the WASM implementation is significantly less efficient than the native implementations because it must crawl the file system to watch each directory individually. Use the native `@parcel/watcher` package wherever possible. + +```js +import {subscribe} from '@parcel/watcher-wasm'; + +// Use the module as documented above. +subscribe(/* ... */); +``` + +## Who is using this? + +- [Parcel 2](https://parceljs.org/) +- [VSCode](https://code.visualstudio.com/updates/v1_62#_file-watching-changes) +- [Tailwind CSS Intellisense](https://github.com/tailwindlabs/tailwindcss-intellisense) +- [Gatsby Cloud](https://twitter.com/chatsidhartha/status/1435647412828196867) +- [Nx](https://nx.dev) +- [Nuxt](https://nuxt.com) +- [Meteor](https://github.com/meteor/meteor) + +## License + +MIT diff --git a/llama.cpp/tools/ui/node_modules/@playwright/test/README.md b/llama.cpp/tools/ui/node_modules/@playwright/test/README.md new file mode 100644 index 0000000000000000000000000000000000000000..2c176f164f0c3e6f3abac3643295769b2f4a92a0 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@playwright/test/README.md @@ -0,0 +1,168 @@ +# 🎭 Playwright + +[![npm version](https://img.shields.io/npm/v/playwright.svg)](https://www.npmjs.com/package/playwright) [![Chromium version](https://img.shields.io/badge/chromium-141.0.7390.37-blue.svg?logo=google-chrome)](https://www.chromium.org/Home) [![Firefox version](https://img.shields.io/badge/firefox-142.0.1-blue.svg?logo=firefoxbrowser)](https://www.mozilla.org/en-US/firefox/new/) [![WebKit version](https://img.shields.io/badge/webkit-26.0-blue.svg?logo=safari)](https://webkit.org/) [![Join Discord](https://img.shields.io/badge/join-discord-informational)](https://aka.ms/playwright/discord) + +## [Documentation](https://playwright.dev) | [API reference](https://playwright.dev/docs/api/class-playwright) + +Playwright is a framework for Web Testing and Automation. It allows testing [Chromium](https://www.chromium.org/Home), [Firefox](https://www.mozilla.org/en-US/firefox/new/) and [WebKit](https://webkit.org/) with a single API. Playwright is built to enable cross-browser web automation that is **ever-green**, **capable**, **reliable** and **fast**. + +| | Linux | macOS | Windows | +| :--- | :---: | :---: | :---: | +| Chromium 141.0.7390.37 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| WebKit 26.0 | :white_check_mark: | :white_check_mark: | :white_check_mark: | +| Firefox 142.0.1 | :white_check_mark: | :white_check_mark: | :white_check_mark: | + +Headless execution is supported for all browsers on all platforms. Check out [system requirements](https://playwright.dev/docs/intro#system-requirements) for details. + +Looking for Playwright for [Python](https://playwright.dev/python/docs/intro), [.NET](https://playwright.dev/dotnet/docs/intro), or [Java](https://playwright.dev/java/docs/intro)? + +## Installation + +Playwright has its own test runner for end-to-end tests, we call it Playwright Test. + +### Using init command + +The easiest way to get started with Playwright Test is to run the init command. + +```Shell +# Run from your project's root directory +npm init playwright@latest +# Or create a new project +npm init playwright@latest new-project +``` + +This will create a configuration file, optionally add examples, a GitHub Action workflow and a first test example.spec.ts. You can now jump directly to writing assertions section. + +### Manually + +Add dependency and install browsers. + +```Shell +npm i -D @playwright/test +# install supported browsers +npx playwright install +``` + +You can optionally install only selected browsers, see [install browsers](https://playwright.dev/docs/cli#install-browsers) for more details. Or you can install no browsers at all and use existing [browser channels](https://playwright.dev/docs/browsers). + +* [Getting started](https://playwright.dev/docs/intro) +* [API reference](https://playwright.dev/docs/api/class-playwright) + +## Capabilities + +### Resilient • No flaky tests + +**Auto-wait**. Playwright waits for elements to be actionable prior to performing actions. It also has a rich set of introspection events. The combination of the two eliminates the need for artificial timeouts - a primary cause of flaky tests. + +**Web-first assertions**. Playwright assertions are created specifically for the dynamic web. Checks are automatically retried until the necessary conditions are met. + +**Tracing**. Configure test retry strategy, capture execution trace, videos and screenshots to eliminate flakes. + +### No trade-offs • No limits + +Browsers run web content belonging to different origins in different processes. Playwright is aligned with the architecture of the modern browsers and runs tests out-of-process. This makes Playwright free of the typical in-process test runner limitations. + +**Multiple everything**. Test scenarios that span multiple tabs, multiple origins and multiple users. Create scenarios with different contexts for different users and run them against your server, all in one test. + +**Trusted events**. Hover elements, interact with dynamic controls and produce trusted events. Playwright uses real browser input pipeline indistinguishable from the real user. + +Test frames, pierce Shadow DOM. Playwright selectors pierce shadow DOM and allow entering frames seamlessly. + +### Full isolation • Fast execution + +**Browser contexts**. Playwright creates a browser context for each test. Browser context is equivalent to a brand new browser profile. This delivers full test isolation with zero overhead. Creating a new browser context only takes a handful of milliseconds. + +**Log in once**. Save the authentication state of the context and reuse it in all the tests. This bypasses repetitive log-in operations in each test, yet delivers full isolation of independent tests. + +### Powerful Tooling + +**[Codegen](https://playwright.dev/docs/codegen)**. Generate tests by recording your actions. Save them into any language. + +**[Playwright inspector](https://playwright.dev/docs/inspector)**. Inspect page, generate selectors, step through the test execution, see click points and explore execution logs. + +**[Trace Viewer](https://playwright.dev/docs/trace-viewer)**. Capture all the information to investigate the test failure. Playwright trace contains test execution screencast, live DOM snapshots, action explorer, test source and many more. + +Looking for Playwright for [TypeScript](https://playwright.dev/docs/intro), [JavaScript](https://playwright.dev/docs/intro), [Python](https://playwright.dev/python/docs/intro), [.NET](https://playwright.dev/dotnet/docs/intro), or [Java](https://playwright.dev/java/docs/intro)? + +## Examples + +To learn how to run these Playwright Test examples, check out our [getting started docs](https://playwright.dev/docs/intro). + +#### Page screenshot + +This code snippet navigates to Playwright homepage and saves a screenshot. + +```TypeScript +import { test } from '@playwright/test'; + +test('Page Screenshot', async ({ page }) => { + await page.goto('https://playwright.dev/'); + await page.screenshot({ path: `example.png` }); +}); +``` + +#### Mobile and geolocation + +This snippet emulates Mobile Safari on a device at given geolocation, navigates to maps.google.com, performs the action and takes a screenshot. + +```TypeScript +import { test, devices } from '@playwright/test'; + +test.use({ + ...devices['iPhone 13 Pro'], + locale: 'en-US', + geolocation: { longitude: 12.492507, latitude: 41.889938 }, + permissions: ['geolocation'], +}) + +test('Mobile and geolocation', async ({ page }) => { + await page.goto('https://maps.google.com'); + await page.getByText('Your location').click(); + await page.waitForRequest(/.*preview\/pwa/); + await page.screenshot({ path: 'colosseum-iphone.png' }); +}); +``` + +#### Evaluate in browser context + +This code snippet navigates to example.com, and executes a script in the page context. + +```TypeScript +import { test } from '@playwright/test'; + +test('Evaluate in browser context', async ({ page }) => { + await page.goto('https://www.example.com/'); + const dimensions = await page.evaluate(() => { + return { + width: document.documentElement.clientWidth, + height: document.documentElement.clientHeight, + deviceScaleFactor: window.devicePixelRatio + } + }); + console.log(dimensions); +}); +``` + +#### Intercept network requests + +This code snippet sets up request routing for a page to log all network requests. + +```TypeScript +import { test } from '@playwright/test'; + +test('Intercept network requests', async ({ page }) => { + // Log and continue all network requests + await page.route('**', route => { + console.log(route.request().url()); + route.continue(); + }); + await page.goto('http://todomvc.com'); +}); +``` + +## Resources + +* [Documentation](https://playwright.dev) +* [API reference](https://playwright.dev/docs/api/class-playwright/) +* [Contribution guide](CONTRIBUTING.md) +* [Changelog](https://github.com/microsoft/playwright/releases) diff --git a/llama.cpp/tools/ui/node_modules/@polka/url/readme.md b/llama.cpp/tools/ui/node_modules/@polka/url/readme.md new file mode 100644 index 0000000000000000000000000000000000000000..e47645ce49177a6e979b2d414e3dc09681bda80c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@polka/url/readme.md @@ -0,0 +1,68 @@ +# @polka/url [![npm](https://badgen.now.sh/npm/v/@polka/url)](https://npmjs.org/package/@polka/url) [![licenses](https://licenses.dev/b/npm/%40polka%2Furl)](https://licenses.dev/npm/%40polka%2Furl) + +> Super fast, memoized `req.url` parser; _not_ limited to [Polka][polka]! + +Parses the `url` from a [`IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) request. The returned object will always only contain the following keys: `search`, `query`, `pathname`, and `raw`. + +> **Note:** This library does not process `protocol`, `hostname`, `port`, etc.
This is because the incoming `req.url` value only begins with the path information. + +Parsed requests will be mutated with a `_parsedUrl` key, containing the returned output. This is used for future memoization, avoiding the need to fully parse the same `url` value multiple times. + +## Install + +``` +$ npm install --save @polka/url +``` + +## Usage + +```js +const parse = require('@polka/url'); + +let req = { + url: '/foo/bar?fizz=buzz' +}; +let output = parse(req); +//=> { +//=> pathname: '/foo/bar', +//=> raw: '/foo/bar?fizz=buzz', +//=> search: '?fizz=buzz', +//=> query: { +//=> fizz: 'buzz' +//=> }, +//=> } + +// Attaches result for future memoization +assert.deepEqual(output, req._parsedUrl); //=> true +``` + +## API + +### url(req) +Returns: `Object` or `undefined` + +> **Important:** The `req` must have a `url` key, otherwise `undefined` will be returned.
If no input is provided at all, a `TypeError` will be thrown. + +#### req +Type: `IncomingMessage` or `{ url: string }` + +The incoming HTTP request (`req`) or a plain `Object` with a `url` key. + +> **Note:** In Node.js servers, the [`req.url`](https://nodejs.org/api/http.html#http_message_url) begins with a pathname & does not include a `hash`. + + +## Benchmarks + +Check out the [`bench`](/bench) directory for in-depth benchmark results and comparisons. + + +## Support + +Any issues or questions can be sent to the [Polka][polka] repository.
However, please specify that your inquiry is about `@polka/url` specifically. + + +## License + +MIT © [Luke Edwards](https://lukeed.com) + +[polka]: https://github.com/lukeed/polka diff --git a/llama.cpp/tools/ui/node_modules/@quansync/fs/README.md b/llama.cpp/tools/ui/node_modules/@quansync/fs/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a69b4cca3391b00a8259a3618697c90f276d43cc --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@quansync/fs/README.md @@ -0,0 +1,50 @@ +# @quansync/fs + +[![npm version][npm-version-src]][npm-version-href] +[![npm downloads][npm-downloads-src]][npm-downloads-href] +[![Unit Test][unit-test-src]][unit-test-href] + +Filesystem utilities for [quansync](https://github.com/quansync-dev/quansync). + +## Install + +```bash +npm i @quansync/fs +``` + +## Usage + +```ts +import { readFile } from '@quansync/fs' +import { quansync } from 'quansync' + +const resultAsync = await readFile('/path', 'utf8') +const resultSync = readFile.sync('/path', 'utf8') + +const readFileTrimmed = quansync(function* (id: string) { + const text = yield* readFile(id, 'utf8').trim() + return text +}) +const readFileTrimmedSync = readFileTrimmed.sync +``` + +## Sponsors + +

+ + + +

+ +## License + +[MIT](./LICENSE) License © 2025-PRESENT [Kevin Deng](https://github.com/sxzz) + + + +[npm-version-src]: https://img.shields.io/npm/v/@quansync/fs.svg +[npm-version-href]: https://npmjs.com/package/@quansync/fs +[npm-downloads-src]: https://img.shields.io/npm/dm/@quansync/fs +[npm-downloads-href]: https://www.npmcharts.com/compare/@quansync/fs?interval=30 +[unit-test-src]: https://github.com/quansync-dev/fs/actions/workflows/unit-test.yml/badge.svg +[unit-test-href]: https://github.com/quansync-dev/fs/actions/workflows/unit-test.yml diff --git a/llama.cpp/tools/ui/node_modules/@rollup/plugin-babel/README.md b/llama.cpp/tools/ui/node_modules/@rollup/plugin-babel/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3b573fbec342ae0960fee6ba22d10e874137dda7 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@rollup/plugin-babel/README.md @@ -0,0 +1,404 @@ +[npm]: https://img.shields.io/npm/v/@rollup/plugin-babel +[npm-url]: https://www.npmjs.com/package/@rollup/plugin-babel +[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-babel +[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-babel + +[![npm][npm]][npm-url] +[![size][size]][size-url] +[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com) + +# @rollup/plugin-babel + +🍣 A Rollup plugin for seamless integration between Rollup and Babel. + +## Why? + +If you're using Babel to transpile your ES6/7 code and Rollup to generate a standalone bundle, you have a couple of options: + +- run the code through Babel first, being careful to exclude the module transformer, or +- run the code through Rollup first, and _then_ pass it to Babel. + +Both approaches have disadvantages – in the first case, on top of the additional configuration complexity, you may end up with Babel's helpers (like `classCallCheck`) repeated throughout your code (once for each module where the helpers are used). In the second case, transpiling is likely to be slower, because transpiling a large bundle is much more work for Babel than transpiling a set of small files. + +Either way, you have to worry about a place to put the intermediate files, and getting sourcemaps to behave becomes a royal pain. + +Using Rollup with `@rollup/plugin-babel` makes the process far easier. + +## Requirements + +This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+. + +## Install + +```bash +npm install @rollup/plugin-babel --save-dev +``` + +## Usage + +Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin: + +```js +import { babel } from '@rollup/plugin-babel'; + +const config = { + input: 'src/index.js', + output: { + dir: 'output', + format: 'es' + }, + plugins: [babel({ babelHelpers: 'bundled' })] +}; + +export default config; +``` + +Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api). + +### Using With `@rollup/plugin-commonjs` + +When using `@rollup/plugin-babel` with `@rollup/plugin-commonjs` in the same Rollup configuration, it's important to note that `@rollup/plugin-commonjs` _must_ be placed before this plugin in the `plugins` array for the two to work together properly. e.g. + +```js +import { babel } from '@rollup/plugin-babel'; +import commonjs from '@rollup/plugin-commonjs'; + +const config = { + ... + plugins: [ + commonjs(), + babel({ babelHelpers: 'bundled' }) + ], +}; +``` + +## Options + +This plugin respects Babel [configuration files](https://babeljs.io/docs/en/configuration) by default and they are generally the best place to put your configuration. + +You can also run Babel on the generated chunks instead of the input files. Even though this is slower, it is the only way to transpile Rollup's auto-generated wrapper code to lower compatibility targets than ES5, see [Running Babel on the generated code](#running-babel-on-the-generated-code) for details. + +All options are as per the [Babel documentation](https://babeljs.io/docs/en/options), plus the following: + +### `exclude` + +Type: `String | RegExp | Array[...String|RegExp]`
+ +A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. When relying on Babel configuration files you can only exclude additional files with this option, you cannot override what you have configured for Babel itself. + +### `include` + +Type: `String | RegExp | Array[...String|RegExp]`
+ +A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should operate on. When relying on Babel configuration files you cannot include files already excluded there. + +### `filter` + +Type: (id: string) => boolean
+ +Custom [filter function](https://github.com/rollup/plugins/tree/master/packages/pluginutils#createfilter) can be used to determine whether or not certain modules should be operated upon. + +Usage: + +```js +import { createFilter } from '@rollup/pluginutils'; +const include = 'include/**.js'; +const exclude = 'exclude/**.js'; +const filter = createFilter(include, exclude, {}); +``` + +### `extensions` + +Type: `Array[...String]`
+Default: `['.js', '.jsx', '.es6', '.es', '.mjs']` + +An array of file extensions that Babel should transpile. If you want to transpile TypeScript files with this plugin it's essential to include `.ts` and `.tsx` in this option. + +### `babelHelpers` + +Type: `'bundled' | 'runtime' | 'inline' | 'external'`
+Default: `'bundled'` + +It is recommended to configure this option explicitly (even if with its default value) so an informed decision is taken on how those babel helpers are inserted into the code. + +We recommend to follow these guidelines to determine the most appropriate value for your project: + +- `'runtime'` - you should use this especially when building libraries with Rollup. It has to be used in combination with `@babel/plugin-transform-runtime` and you should also specify `@babel/runtime` as dependency of your package. Don't forget to tell Rollup to treat the helpers imported from within the `@babel/runtime` module as external dependencies when bundling for `cjs` & `es` formats. This can be accomplished via regex (`external: [/@babel\/runtime/]`) or a function (`external: id => id.includes('@babel/runtime')`). It's important to not only specify `external: ['@babel/runtime']` since the helpers are imported from nested paths (e.g `@babel/runtime/helpers/get`) and [Rollup will only exclude modules that match strings exactly](https://rollupjs.org/guide/en/#peer-dependencies). +- `'bundled'` - you should use this if you want your resulting bundle to contain those helpers (at most one copy of each). Useful especially if you bundle an application code. +- `'external'` - use this only if you know what you are doing. It will reference helpers on **global** `babelHelpers` object. Used in combination with `@babel/plugin-external-helpers`. +- `'inline'` - this is not recommended. Helpers will be inserted in each file using this option. This can cause serious code duplication. This is the default Babel behavior as Babel operates on isolated files - however, as Rollup is a bundler and is project-aware (and therefore likely operating across multiple input files), the default of this plugin is `"bundled"`. + +### `skipPreflightCheck` + +Type: `Boolean`
+Default: `false` + +Before transpiling your input files this plugin also transpile a short piece of code **for each** input file. This is used to validate some misconfiguration errors, but for sufficiently big projects it can slow your build times so if you are confident about your configuration then you might disable those checks with this option. + +### External dependencies + +Ideally, you should only be transforming your source code, rather than running all of your external dependencies through Babel (to ignore external dependencies from being handled by this plugin you might use `exclude: 'node_modules/**'` option). If you have a dependency that exposes untranspiled ES6 source code that doesn't run in your target environment, then you may need to break this rule, but it often causes problems with unusual `.babelrc` files or mismatched versions of Babel. + +We encourage library authors not to distribute code that uses untranspiled ES6 features (other than modules) for this reason. Consumers of your library should _not_ have to transpile your ES6 code, any more than they should have to transpile your CoffeeScript, ClojureScript or TypeScript. + +Use `babelrc: false` to prevent Babel from using local (i.e. to your external dependencies) `.babelrc` files, relying instead on the configuration you pass in. + +### Helpers + +In some cases Babel uses _helpers_ to avoid repeating chunks of code – for example, if you use the `class` keyword, it will use a `classCallCheck` function to ensure that the class is instantiated correctly. + +By default, those helpers will be inserted at the top of the file being transformed, which can lead to duplication. This rollup plugin automatically deduplicates those helpers, keeping only one copy of each one used in the output bundle. Rollup will combine the helpers in a single block at the top of your bundle. + +You can customize how those helpers are being inserted into the transformed file with [`babelHelpers`](#babelhelpers) option. + +### Modules + +This is not needed since Babel 7 - it knows automatically that Rollup understands ES modules & that it shouldn't use any module transform with it. Unless you forcefully include a module transform in your Babel configuration. + +If you have been pointed to this section by an error thrown by this plugin, please check your Babel configuration files and disable any module transforms when running Rollup builds. + +## Running Babel on the generated code + +You can run `@rollup/plugin-babel` on the output files instead of the input files by using `getBabelOutputPlugin(...)`. This can be used to perform code transformations on the resulting chunks and is the only way to transform Rollup's auto-generated code. By default, the plugin will be applied to all outputs: + +```js +// rollup.config.js +import { getBabelOutputPlugin } from '@rollup/plugin-babel'; + +export default { + input: 'main.js', + plugins: [ + getBabelOutputPlugin({ + presets: ['@babel/preset-env'] + }) + ], + output: [ + { file: 'bundle.cjs.js', format: 'cjs' }, + { file: 'bundle.es.js', format: 'es' } + ] +}; +``` + +If you only want to apply it to specific outputs, you can use it as an output plugin (requires at least Rollup v1.27.0): + +```js +// rollup.config.js +import { getBabelOutputPlugin } from '@rollup/plugin-babel'; + +export default { + input: 'main.js', + output: [ + { file: 'bundle.js', format: 'es' }, + { + file: 'bundle.es5.js', + format: 'es', + plugins: [getBabelOutputPlugin({ presets: ['@babel/preset-env'] })] + } + ] +}; +``` + +The `include`, `exclude` and `extensions` options are ignored when using `getBabelOutputPlugin` and `createBabelOutputPluginFactory` will produce warnings, and there are a few more points to note that users should be aware of. + +When transforming generated code, you can instead control which chunks are processed by matching their manual chunk names via the `includeChunks`/`excludeChunks` options. These patterns are matched against `chunk.name` as provided to Rollup's `renderChunk` hook and are especially useful to skip already-transpiled/minified vendor chunks: + +```js +// rollup.config.js +import { getBabelOutputPlugin } from '@rollup/plugin-babel'; + +export default { + input: 'main.js', + manualChunks(id) { + if (id.includes('big-library')) return 'vendor'; + }, + output: { + format: 'es', + plugins: [ + getBabelOutputPlugin({ + presets: ['@babel/preset-env'], + // Do not transform the 'vendor' manual chunk + excludeChunks: ['vendor'] + }) + ] + } +}; +``` + +You can also run the plugin twice on the code, once when processing the input files to transpile special syntax to JavaScript and once on the output to transpile to a lower compatibility target: + +```js +// rollup.config.js +import babel, { getBabelOutputPlugin } from '@rollup/plugin-babel'; + +export default { + input: 'main.js', + plugins: [babel({ presets: ['@babel/preset-react'] })], + output: [ + { + file: 'bundle.js', + format: 'es', + plugins: [getBabelOutputPlugin({ presets: ['@babel/preset-env'] })] + } + ] +}; +``` + +### Babel configuration files + +Unlike the regular `babel` plugin, `getBabelOutputPlugin(...)` will **not** automatically search for [Babel configuration files](https://babeljs.io/docs/en/config-files). Besides passing in Babel options directly, however, you can specify a configuration file manually via Babel's [`configFile`](https://babeljs.io/docs/en/options#configfile) option: + +```js +getBabelOutputPlugin({ + configFile: path.resolve(__dirname, 'babel.config.js') +}); +``` + +### Using formats other than ES modules or CommonJS + +As `getBabelOutputPlugin(...)` will run _after_ Rollup has done all its transformations, it needs to make sure it preserves the semantics of Rollup's output format. This is especially important for Babel plugins that add, modify or remove imports or exports, but also for other transformations that add new variables as they can accidentally become global variables depending on the format. Therefore it is recommended that for formats other than `es` or `cjs`, you set Rollup to use the `es` output format and let Babel handle the transformation to another format, e.g. via + +``` +presets: [['@babel/preset-env', { modules: 'umd' }], ...] +``` + +to create a UMD/IIFE compatible output. If you want to use `getBabelOutputPlugin(...)` with other formats, you need to specify `allowAllFormats: true` as plugin option: + +```js +rollup.rollup({...}) +.then(bundle => bundle.generate({ + format: 'iife', + plugins: [getBabelOutputPlugin({ + allowAllFormats: true, + // ... + })] +})) +``` + +### Injected helpers + +By default, helpers e.g. when transpiling classes will be inserted at the top of each chunk. In contrast to when applying this plugin on the input files, helpers will not be deduplicated across chunks. + +Alternatively, you can use imported runtime helpers by adding the `@babel/transform-runtime` plugin. This will make `@babel/runtime` an external dependency of your project, see [@babel/plugin-transform-runtime](https://babeljs.io/docs/en/babel-plugin-transform-runtime) for details. + +Note that this will only work for `es` and `cjs` formats, and you need to make sure to set the `useESModules` option of `@babel/plugin-transform-runtime` to `true` if you create ES output: + +```js +rollup.rollup({...}) +.then(bundle => bundle.generate({ + format: 'es', + plugins: [getBabelOutputPlugin({ + presets: ['@babel/preset-env'], + plugins: [['@babel/plugin-transform-runtime', { useESModules: true }]] + })] +})) +``` + +```js +// input +export default class Foo {} + +// output +import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck'; + +var Foo = function Foo() { + _classCallCheck(this, Foo); +}; + +export default Foo; +``` + +And for CommonJS: + +```js +rollup.rollup({...}) +.then(bundle => bundle.generate({ + format: 'cjs', + plugins: [getBabelOutputPlugin({ + presets: ['@babel/preset-env'], + plugins: [['@babel/plugin-transform-runtime', { useESModules: false }]] + })] +})) +``` + +```js +// input +export default class Foo {} + +// output +('use strict'); + +var _classCallCheck = require('@babel/runtime/helpers/classCallCheck'); + +var Foo = function Foo() { + _classCallCheck(this, Foo); +}; + +module.exports = Foo; +``` + +Another option is to use `@babel/plugin-external-helpers`, which will reference the global `babelHelpers` object. It is your responsibility to make sure this global variable exists. + +## Custom plugin builder + +`@rollup/plugin-babel` exposes a plugin-builder utility that allows users to add custom handling of Babel's configuration for each file that it processes. + +`createBabelInputPluginFactory` accepts a callback that will be called with the loader's instance of `babel` so that tooling can ensure that it using exactly the same `@babel/core` instance as the loader itself. + +It's main purpose is to allow other tools for configuration of transpilation without forcing people to add extra configuration but still allow for using their own babelrc / babel config files. + +### Example + +```js +import { createBabelInputPluginFactory } from '@rollup/plugin-babel'; + +export default createBabelInputPluginFactory((babelCore) => { + function myPlugin() { + return { + visitor: {} + }; + } + + return { + // Passed the plugin options. + options({ opt1, opt2, ...pluginOptions }) { + return { + // Pull out any custom options that the plugin might have. + customOptions: { opt1, opt2 }, + + // Pass the options back with the two custom options removed. + pluginOptions + }; + }, + + config(cfg /* Passed Babel's 'PartialConfig' object. */, { code, customOptions }) { + if (cfg.hasFilesystemConfig()) { + // Use the normal config + return cfg.options; + } + + return { + ...cfg.options, + plugins: [ + ...(cfg.options.plugins || []), + + // Include a custom plugin in the options. + myPlugin + ] + }; + }, + + result(result, { code, customOptions, config, transformOptions }) { + return { + ...result, + code: result.code + '\n// Generated by some custom plugin' + }; + } + }; +}); +``` + +## Meta + +[CONTRIBUTING](/.github/CONTRIBUTING.md) + +[LICENSE (MIT)](/LICENSE) diff --git a/llama.cpp/tools/ui/node_modules/@rollup/plugin-node-resolve/README.md b/llama.cpp/tools/ui/node_modules/@rollup/plugin-node-resolve/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bf3987e2ff66c680b70cef6aee107055a5fc61d7 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@rollup/plugin-node-resolve/README.md @@ -0,0 +1,296 @@ +[npm]: https://img.shields.io/npm/v/@rollup/plugin-node-resolve +[npm-url]: https://www.npmjs.com/package/@rollup/plugin-node-resolve +[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-node-resolve +[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-node-resolve + +[![npm][npm]][npm-url] +[![size][size]][size-url] +[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com) + +# @rollup/plugin-node-resolve + +🍣 A Rollup plugin which locates modules using the [Node resolution algorithm](https://nodejs.org/api/modules.html#modules_all_together), for using third party modules in `node_modules` + +## Requirements + +This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v2.78.0+. + +## Install + +Using npm: + +```console +npm install @rollup/plugin-node-resolve --save-dev +``` + +## Usage + +Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin: + +```js +import { nodeResolve } from '@rollup/plugin-node-resolve'; + +export default { + input: 'src/index.js', + output: { + dir: 'output', + format: 'cjs' + }, + plugins: [nodeResolve()] +}; +``` + +Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api). + +## Package entrypoints + +This plugin supports the package entrypoints feature from node js, specified in the `exports` or `imports` field of a package. Check the [official documentation](https://nodejs.org/api/packages.html#packages_package_entry_points) for more information on how this works. This is the default behavior. In the abscence of these fields, the fields in `mainFields` will be the ones to be used. + +## Options + +### `exportConditions` + +Type: `Array[...String]`
+Default: `[]` + +Additional conditions of the package.json exports field to match when resolving modules. By default, this plugin looks for the `['default', 'module', 'import', 'development|production']` conditions when resolving imports. If neither the `development` or `production` conditions are provided it will default to `production` - or `development` if `NODE_ENV` is set to a value other than `production`. + +When using `@rollup/plugin-commonjs` v16 or higher, this plugin will use the `['default', 'module', 'require']` conditions when resolving require statements. + +Setting this option will add extra conditions on top of the default conditions. See https://nodejs.org/api/packages.html#packages_conditional_exports for more information. + +In order to get the [resolution behavior of Node.js](https://nodejs.org/api/packages.html#packages_conditional_exports), set this to `['node']`. + +### `browser` + +Type: `Boolean`
+Default: `false` + +If `true`, instructs the plugin to use the browser module resolutions in `package.json` and adds `'browser'` to `exportConditions` if it is not present so browser conditionals in `exports` are applied. If `false`, any browser properties in package files will be ignored. Alternatively, a value of `'browser'` can be added to both the `mainFields` and `exportConditions` options, however this option takes precedence over `mainFields`. + +> This option does not work when a package is using [package entrypoints](https://nodejs.org/api/packages.html#packages_package_entry_points) + +### `moduleDirectories` + +Type: `Array[...String]`
+Default: `['node_modules']` + +A list of directory names in which to recursively look for modules. + +### `modulePaths` + +Type: `Array[...String]`
+Default: `[]` + +A list of absolute paths to additional locations to search for modules. [This is analogous to setting the `NODE_PATH` environment variable for node](https://nodejs.org/api/modules.html#loading-from-the-global-folders). + +### `dedupe` + +Type: `Array[...String]`
+Default: `[]` + +An `Array` of modules names, which instructs the plugin to force resolving for the specified modules to the root `node_modules`. Helps to prevent bundling the same package multiple times if package is imported from dependencies. + +```js +dedupe: ['my-package', '@namespace/my-package']; +``` + +This will deduplicate bare imports such as: + +```js +import 'my-package'; +import '@namespace/my-package'; +``` + +And it will deduplicate deep imports such as: + +```js +import 'my-package/foo.js'; +import '@namespace/my-package/bar.js'; +``` + +### `extensions` + +Type: `Array[...String]`
+Default: `['.mjs', '.js', '.json', '.node']` + +Specifies the extensions of files that the plugin will operate on. + +### `jail` + +Type: `String`
+Default: `'/'` + +Locks the module search within specified path (e.g. chroot). Modules defined outside this path will be ignored by this plugin. + +### `mainFields` + +Type: `Array[...String]`
+Default: `['module', 'main']`
+Valid values: `['browser', 'jsnext:main', 'module', 'main']` + +Specifies the properties to scan within a `package.json`, used to determine the bundle entry point. The order of property names is significant, as the first-found property is used as the resolved entry point. If the array contains `'browser'`, key/values specified in the `package.json` `browser` property will be used. + +### `preferBuiltins` + +Type: `Boolean | (module: string) => boolean`
+Default: `true` (with warnings if a builtin module is used over a local version. Set to `true` to disable warning.) + +If `true`, the plugin will prefer built-in modules (e.g. `fs`, `path`). If `false`, the plugin will look for locally installed modules of the same name. + +Alternatively, you may pass in a function that returns a boolean to confirm whether the plugin should prefer built-in modules. e.g. + +```js +preferBuiltins: (module) => module !== 'punycode'; +``` + +will not treat `punycode` as a built-in module + +### `modulesOnly` + +Type: `Boolean`
+Default: `false` + +If `true`, inspect resolved files to assert that they are ES2015 modules. + +### `resolveOnly` + +Type: `Array[...String|RegExp] | (module: string) => boolean`
+Default: `null` + +An `Array` which instructs the plugin to limit module resolution to those whose names match patterns in the array. _Note: Modules not matching any patterns will be marked as external._ + +Alternatively, you may pass in a function that returns a boolean to confirm whether the module should be included or not. + +Examples: + +- `resolveOnly: ['batman', /^@batcave\/.*$/]` +- `resolveOnly: module => !module.includes('joker')` + +### `rootDir` + +Type: `String`
+Default: `process.cwd()` + +Specifies the root directory from which to resolve modules. Typically used when resolving entry-point imports, and when resolving deduplicated modules. Useful when executing rollup in a package of a mono-repository. + +``` +// Set the root directory to be the parent folder +rootDir: path.join(process.cwd(), '..') +``` + +### `ignoreSideEffectsForRoot` + +Type: `Boolean`
+Default: `false` + +If you use the `sideEffects` property in the package.json, by default this is respected for files in the root package. Set to `true` to ignore the `sideEffects` configuration for the root package. + +### `allowExportsFolderMapping` + +Older Node versions supported exports mappings of folders like + +```json +{ + "exports": { + "./foo/": "./dist/foo/" + } +} +``` + +This was deprecated with Node 14 and removed in Node 17, instead it is recommended to use exports patterns like + +```json +{ + "exports": { + "./foo/*": "./dist/foo/*" + } +} +``` + +But for backwards compatibility this behavior is still supported by enabling the `allowExportsFolderMapping` (defaults to `true`). +The default value might change in a futur major release. + +## Preserving symlinks + +This plugin honours the rollup [`preserveSymlinks`](https://rollupjs.org/guide/en/#preservesymlinks) option. + +## Using with @rollup/plugin-commonjs + +Since most packages in your node_modules folder are probably legacy CommonJS rather than JavaScript modules, you may need to use [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/master/packages/commonjs): + +```js +// rollup.config.js +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import commonjs from '@rollup/plugin-commonjs'; + +export default { + input: 'main.js', + output: { + file: 'bundle.js', + format: 'iife', + name: 'MyModule' + }, + plugins: [nodeResolve(), commonjs()] +}; +``` + +## Resolving Built-Ins (like `fs`) + +By default this plugin will prefer built-ins over local modules, marking them as external. + +See [`preferBuiltins`](#preferbuiltins). + +To provide stubbed versions of Node built-ins, use a plugin like [rollup-plugin-node-polyfills](https://github.com/ionic-team/rollup-plugin-node-polyfills) and set `preferBuiltins` to `false`. e.g. + +```js +import { nodeResolve } from '@rollup/plugin-node-resolve'; +import nodePolyfills from 'rollup-plugin-node-polyfills'; +export default ({ + input: ..., + plugins: [ + nodePolyfills(), + nodeResolve({ preferBuiltins: false }) + ], + external: builtins, + output: ... +}) +``` + +## Resolving Require Statements + +According to [NodeJS module resolution](https://nodejs.org/api/packages.html#packages_package_entry_points) `require` statements should resolve using the `require` condition in the package exports field, while es modules should use the `import` condition. + +The node resolve plugin uses `import` by default, you can opt into using the `require` semantics by passing an extra option to the resolve function: + +```js +this.resolve(importee, importer, { + skipSelf: true, + custom: { 'node-resolve': { isRequire: true } } +}); +``` + +## Resolve Options + +After this plugin resolved an import id to its target file in `node_modules`, it will invoke `this.resolve` again with the resolved id. It will pass the following information in the resolve options: + +```js +this.resolve(resolved.id, importer, { + custom: { + 'node-resolve': { + resolved, // the object with information from node.js resolve + importee // the original import id + } + } +}); +``` + +Your plugin can use the `importee` information to map an original import to its resolved file in `node_modules`, in a plugin hook such as `resolveId`. + +The `resolved` object contains the resolved id, which is passed as the first parameter. It also has a property `moduleSideEffects`, which may contain the value from the npm `package.json` field `sideEffects` or `null`. + +## Meta + +[CONTRIBUTING](/.github/CONTRIBUTING.md) + +[LICENSE (MIT)](/LICENSE) diff --git a/llama.cpp/tools/ui/node_modules/@rollup/plugin-replace/README.md b/llama.cpp/tools/ui/node_modules/@rollup/plugin-replace/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d787d73e827a804c9470940020ced4c7770fd5ac --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@rollup/plugin-replace/README.md @@ -0,0 +1,240 @@ +[npm]: https://img.shields.io/npm/v/@rollup/plugin-replace +[npm-url]: https://www.npmjs.com/package/@rollup/plugin-replace +[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-replace +[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-replace + +[![npm][npm]][npm-url] +[![size][size]][size-url] +[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com) + +# @rollup/plugin-replace + +🍣 A Rollup plugin which replaces targeted strings in files while bundling. + +## Requirements + +This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+. + +## Install + +Using npm: + +```console +npm install @rollup/plugin-replace --save-dev +``` + +## Usage + +Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin: + +```js +import replace from '@rollup/plugin-replace'; + +export default { + input: 'src/index.js', + output: { + dir: 'output', + format: 'cjs' + }, + plugins: [ + replace({ + 'process.env.NODE_ENV': JSON.stringify('production'), + __buildDate__: () => JSON.stringify(new Date()), + __buildVersion: 15 + }) + ] +}; +``` + +Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api). + +The configuration above will replace every instance of `process.env.NODE_ENV` with `"production"` and `__buildDate__` with the result of the given function in any file included in the build. + +_Note: Values must be either primitives (e.g. string, number) or `function` that returns a string. For complex values, use `JSON.stringify`. To replace a target with a value that will be evaluated as a string, set the value to a quoted string (e.g. `"test"`) or use `JSON.stringify` to preprocess the target string safely._ + +Typically, `@rollup/plugin-replace` should be placed in `plugins` _before_ other plugins so that they may apply optimizations, such as dead code removal. + +## Options + +In addition to the properties and values specified for replacement, users may also specify the options below. + +### `delimiters` + +Type: `Array[String, String]`
+Default: `['(? +Default: `false` + +When replacing dot-separated object properties like `process.env.NODE_ENV`, will also replace `typeof process` object guard +checks against the objects with the string `"object"`. + +For example: + +```js +replace({ + values: { + 'process.env.NODE_ENV': '"production"' + } +}); +``` + +```js +// Input +if (typeof process !== 'undefined' && process.env.NODE_ENV === 'production') { + console.log('production'); +} +// Without `objectGuards` +if (typeof process !== 'undefined' && 'production' === 'production') { + console.log('production'); +} +// With `objectGuards` +if ('object' !== 'undefined' && 'production' === 'production') { + console.log('production'); +} +``` + +### `preventAssignment` + +Type: `Boolean`
+Default: `false` + +Prevents replacing strings where they are followed by a single equals sign. For example, where the plugin is called as follows: + +```js +replace({ + values: { + 'process.env.DEBUG': 'false' + } +}); +``` + +Observe the following code: + +```js +// Input +process.env.DEBUG = false; +if (process.env.DEBUG == true) { + // +} +// Without `preventAssignment` +false = false; // this throws an error because false cannot be assigned to +if (false == true) { + // +} +// With `preventAssignment` +process.env.DEBUG = false; +if (false == true) { + // +} +``` + +### `exclude` + +Type: `String` | `Array[...String]`
+Default: `null` + +A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should _ignore_. By default no files are ignored. + +### `include` + +Type: `String` | `Array[...String]`
+Default: `null` + +A [picomatch pattern](https://github.com/micromatch/picomatch), or array of patterns, which specifies the files in the build the plugin should operate on. By default all files are targeted. + +### `sourceMap` or `sourcemap` + +Type: `Boolean`
+Default: `false` + +Enables generating sourcemaps for the bundled code. For example, where the plugin is called as follows: + +```js +replace({ + sourcemap: true +}); +``` + +### `values` + +Type: `{ [key: String]: Replacement }`, where `Replacement` is either a string or a `function` that returns a string. +Default: `{}` + +To avoid mixing replacement strings with the other options, you can specify replacements in the `values` option. For example, the following signature: + +```js +replace({ + include: ['src/**/*.js'], + changed: 'replaced' +}); +``` + +Can be replaced with: + +```js +replace({ + include: ['src/**/*.js'], + values: { + changed: 'replaced' + } +}); +``` + +## Word Boundaries + +By default, values will only match if they are surrounded by _word boundaries_ that respect JavaScript's rules for valid identifiers (including `$` and `_` as valid identifier characters). + +Consider the following options and build file: + +```js +module.exports = { + ... + plugins: [replace({ changed: 'replaced' })] +}; +``` + +```js +// file.js +console.log('changed'); +console.log('unchanged'); +``` + +The result would be: + +```js +// file.js +console.log('replaced'); +console.log('unchanged'); +``` + +To ignore word boundaries and replace every instance of the string, wherever it may be, specify empty strings as delimiters: + +```js +export default { + ... + plugins: [ + replace({ + changed: 'replaced', + delimiters: ['', ''] + }) + ] +}; +``` + +## Meta + +[CONTRIBUTING](/.github/CONTRIBUTING.md) + +[LICENSE (MIT)](/LICENSE) diff --git a/llama.cpp/tools/ui/node_modules/@rollup/plugin-terser/README.md b/llama.cpp/tools/ui/node_modules/@rollup/plugin-terser/README.md new file mode 100644 index 0000000000000000000000000000000000000000..bcc387ed8a637321437637876c097799f09b2534 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@rollup/plugin-terser/README.md @@ -0,0 +1,80 @@ +[npm]: https://img.shields.io/npm/v/@rollup/plugin-terser +[npm-url]: https://www.npmjs.com/package/@rollup/plugin-terser +[size]: https://packagephobia.now.sh/badge?p=@rollup/plugin-terser +[size-url]: https://packagephobia.now.sh/result?p=@rollup/plugin-terser + +[![npm][npm]][npm-url] +[![size][size]][size-url] +[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com) + +# @rollup/plugin-terser + +🍣 A Rollup plugin to generate a minified bundle with terser. + +## Requirements + +This plugin requires an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v2.0+. + +## Install + +Using npm: + +```console +npm install @rollup/plugin-terser --save-dev +``` + +## Usage + +Create a `rollup.config.js` [configuration file](https://www.rollupjs.org/guide/en/#configuration-files) and import the plugin: + +```typescript +import terser from '@rollup/plugin-terser'; + +export default { + input: 'src/index.js', + output: { + dir: 'output', + format: 'cjs' + }, + plugins: [terser()] +}; +``` + +Then call `rollup` either via the [CLI](https://www.rollupjs.org/guide/en/#command-line-reference) or the [API](https://www.rollupjs.org/guide/en/#javascript-api). + +## Options + +The plugin accepts a terser [Options](https://github.com/terser/terser#minify-options) object as input parameter, +to modify the default behaviour. + +In addition to the `terser` options, it is also possible to provide the following options: + +### `maxWorkers` + +Type: `Number`
+Default: `undefined` + +Instructs the plugin to use a specific amount of cpu threads. + +```typescript +import terser from '@rollup/plugin-terser'; + +export default { + input: 'src/index.js', + output: { + dir: 'output', + format: 'cjs' + }, + plugins: [ + terser({ + maxWorkers: 4 + }) + ] +}; +``` + +## Meta + +[CONTRIBUTING](/.github/CONTRIBUTING.md) + +[LICENSE (MIT)](/LICENSE) diff --git a/llama.cpp/tools/ui/node_modules/@rollup/pluginutils/README.md b/llama.cpp/tools/ui/node_modules/@rollup/pluginutils/README.md new file mode 100644 index 0000000000000000000000000000000000000000..8c43672ec084d6ad8b29756933681807767be77c --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@rollup/pluginutils/README.md @@ -0,0 +1,313 @@ +[npm]: https://img.shields.io/npm/v/@rollup/pluginutils +[npm-url]: https://www.npmjs.com/package/@rollup/pluginutils +[size]: https://packagephobia.now.sh/badge?p=@rollup/pluginutils +[size-url]: https://packagephobia.now.sh/result?p=@rollup/pluginutils + +[![npm][npm]][npm-url] +[![size][size]][size-url] +[![libera manifesto](https://img.shields.io/badge/libera-manifesto-lightgrey.svg)](https://liberamanifesto.com) + +# @rollup/pluginutils + +A set of utility functions commonly used by 🍣 Rollup plugins. + +## Requirements + +The plugin utils require an [LTS](https://github.com/nodejs/Release) Node version (v14.0.0+) and Rollup v1.20.0+. + +## Install + +Using npm: + +```console +npm install @rollup/pluginutils --save-dev +``` + +## Usage + +```js +import utils from '@rollup/pluginutils'; +//... +``` + +## API + +Available utility functions are listed below: + +_Note: Parameter names immediately followed by a `?` indicate that the parameter is optional._ + +### addExtension + +Adds an extension to a module ID if one does not exist. + +Parameters: `(filename: String, ext?: String)`
+Returns: `String` + +```js +import { addExtension } from '@rollup/pluginutils'; + +export default function myPlugin(options = {}) { + return { + resolveId(code, id) { + // only adds an extension if there isn't one already + id = addExtension(id); // `foo` -> `foo.js`, `foo.js` -> `foo.js` + id = addExtension(id, '.myext'); // `foo` -> `foo.myext`, `foo.js` -> `foo.js` + } + }; +} +``` + +### attachScopes + +Attaches `Scope` objects to the relevant nodes of an AST. Each `Scope` object has a `scope.contains(name)` method that returns `true` if a given name is defined in the current scope or a parent scope. + +Parameters: `(ast: Node, propertyName?: String)`
+Returns: `Object` + +See [@rollup/plugin-inject](https://github.com/rollup/plugins/tree/master/packages/inject) or [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/master/packages/commonjs) for an example of usage. + +```js +import { attachScopes } from '@rollup/pluginutils'; +import { walk } from 'estree-walker'; + +export default function myPlugin(options = {}) { + return { + transform(code) { + const ast = this.parse(code); + + let scope = attachScopes(ast, 'scope'); + + walk(ast, { + enter(node) { + if (node.scope) scope = node.scope; + + if (!scope.contains('foo')) { + // `foo` is not defined, so if we encounter it, + // we assume it's a global + } + }, + leave(node) { + if (node.scope) scope = scope.parent; + } + }); + } + }; +} +``` + +### createFilter + +Constructs a filter function which can be used to determine whether or not certain modules should be operated upon. + +Parameters: `(include?: , exclude?: , options?: Object)`
+Returns: `(id: string | unknown) => boolean` + +#### `include` and `exclude` + +Type: `String | RegExp | Array[...String|RegExp]`
+ +A valid [`picomatch`](https://github.com/micromatch/picomatch#globbing-features) pattern, or array of patterns. If `options.include` is omitted or has zero length, filter will return `true` by default. Otherwise, an ID must match one or more of the `picomatch` patterns, and must not match any of the `options.exclude` patterns. + +Note that `picomatch` patterns are very similar to [`minimatch`](https://github.com/isaacs/minimatch#readme) patterns, and in most use cases, they are interchangeable. If you have more specific pattern matching needs, you can view [this comparison table](https://github.com/micromatch/picomatch#library-comparisons) to learn more about where the libraries differ. + +#### `options` + +##### `resolve` + +Type: `String | Boolean | null` + +Optionally resolves the patterns against a directory other than `process.cwd()`. If a `String` is specified, then the value will be used as the base directory. Relative paths will be resolved against `process.cwd()` first. If `false`, then the patterns will not be resolved against any directory. This can be useful if you want to create a filter for virtual module names. + +#### Usage + +```js +import { createFilter } from '@rollup/pluginutils'; + +export default function myPlugin(options = {}) { + // assume that the myPlugin accepts options of `options.include` and `options.exclude` + var filter = createFilter(options.include, options.exclude, { + resolve: '/my/base/dir' + }); + + return { + transform(code, id) { + if (!filter(id)) return; + + // proceed with the transformation... + } + }; +} +``` + +### dataToEsm + +Transforms objects into tree-shakable ES Module imports. + +Parameters: `(data: Object, options: DataToEsmOptions)`
+Returns: `String` + +#### `data` + +Type: `Object` + +An object to transform into an ES module. + +#### `options` + +Type: `DataToEsmOptions` + +_Note: Please see the TypeScript definition for complete documentation of these options_ + +#### Usage + +```js +import { dataToEsm } from '@rollup/pluginutils'; + +const esModuleSource = dataToEsm( + { + custom: 'data', + to: ['treeshake'] + }, + { + compact: false, + indent: '\t', + preferConst: true, + objectShorthand: true, + namedExports: true, + includeArbitraryNames: false + } +); +/* +Outputs the string ES module source: + export const custom = 'data'; + export const to = ['treeshake']; + export default { custom, to }; +*/ +``` + +### extractAssignedNames + +Extracts the names of all assignment targets based upon specified patterns. + +Parameters: `(param: Node)`
+Returns: `Array[...String]` + +#### `param` + +Type: `Node` + +An `acorn` AST Node. + +#### Usage + +```js +import { extractAssignedNames } from '@rollup/pluginutils'; +import { walk } from 'estree-walker'; + +export default function myPlugin(options = {}) { + return { + transform(code) { + const ast = this.parse(code); + + walk(ast, { + enter(node) { + if (node.type === 'VariableDeclarator') { + const declaredNames = extractAssignedNames(node.id); + // do something with the declared names + // e.g. for `const {x, y: z} = ...` => declaredNames = ['x', 'z'] + } + } + }); + } + }; +} +``` + +### exactRegex + +Constructs a RegExp that matches the exact string specified. This is useful for plugin hook filters. + +Parameters: `(str: String | Array[...String], flags?: String)`
+Returns: `RegExp` + +#### Usage + +```js +import { exactRegex } from '@rollup/pluginutils'; + +exactRegex('foobar'); // /^foobar$/ +exactRegex(['foo', 'bar']); // /^(?:foo|bar)$/ +exactRegex('foo(bar)', 'i'); // /^foo\(bar\)$/i +``` + +### makeLegalIdentifier + +Constructs a bundle-safe identifier from a `String`. + +Parameters: `(str: String)`
+Returns: `String` + +#### Usage + +```js +import { makeLegalIdentifier } from '@rollup/pluginutils'; + +makeLegalIdentifier('foo-bar'); // 'foo_bar' +makeLegalIdentifier('typeof'); // '_typeof' +``` + +### normalizePath + +Converts path separators to forward slash. + +Parameters: `(filename: String)`
+Returns: `String` + +#### Usage + +```js +import { normalizePath } from '@rollup/pluginutils'; + +normalizePath('foo\\bar'); // 'foo/bar' +normalizePath('foo/bar'); // 'foo/bar' +``` + +### prefixRegex + +Constructs a RegExp that matches a value that has the specified prefix. This is useful for plugin hook filters. + +Parameters: `(str: String | Array[...String], flags?: String)`
+Returns: `RegExp` + +#### Usage + +```js +import { prefixRegex } from '@rollup/pluginutils'; + +prefixRegex('foobar'); // /^foobar/ +prefixRegex(['foo', 'bar']); // /^(?:foo|bar)/ +prefixRegex('foo(bar)', 'i'); // /^foo\(bar\)/i +``` + +### suffixRegex + +Constructs a RegExp that matches a value that has the specified suffix. This is useful for plugin hook filters. + +Parameters: `(str: String | Array[...String], flags?: String)`
+Returns: `RegExp` + +#### Usage + +```js +import { suffixRegex } from '@rollup/pluginutils'; + +suffixRegex('foobar'); // /foobar$/ +suffixRegex(['foo', 'bar']); // /(?:foo|bar)$/ +suffixRegex('foo(bar)', 'i'); // /foo\(bar\)$/i +``` + +## Meta + +[CONTRIBUTING](/.github/CONTRIBUTING.md) + +[LICENSE (MIT)](/LICENSE) diff --git a/llama.cpp/tools/ui/node_modules/@rollup/pluginutils/node_modules/estree-walker/CHANGELOG.md b/llama.cpp/tools/ui/node_modules/@rollup/pluginutils/node_modules/estree-walker/CHANGELOG.md new file mode 100644 index 0000000000000000000000000000000000000000..20e8c7eac55ecaa0e7795fac89c2eb5a087b3208 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@rollup/pluginutils/node_modules/estree-walker/CHANGELOG.md @@ -0,0 +1,92 @@ +# changelog + +## 2.0.2 + +* Internal tidying up (change test runner, convert to JS) + +## 2.0.1 + +* Robustify `this.remove()`, pass current index to walker functions ([#18](https://github.com/Rich-Harris/estree-walker/pull/18)) + +## 2.0.0 + +* Add an `asyncWalk` export ([#20](https://github.com/Rich-Harris/estree-walker/pull/20)) +* Internal rewrite + +## 1.0.1 + +* Relax node type to `BaseNode` ([#17](https://github.com/Rich-Harris/estree-walker/pull/17)) + +## 1.0.0 + +* Don't cache child keys + +## 0.9.0 + +* Add `this.remove()` method + +## 0.8.1 + +* Fix pkg.files + +## 0.8.0 + +* Adopt `estree` types + +## 0.7.0 + +* Add a `this.replace(node)` method + +## 0.6.1 + +* Only traverse nodes that exist and have a type ([#9](https://github.com/Rich-Harris/estree-walker/pull/9)) +* Only cache keys for nodes with a type ([#8](https://github.com/Rich-Harris/estree-walker/pull/8)) + +## 0.6.0 + +* Fix walker context type +* Update deps, remove unncessary Bublé transformation + +## 0.5.2 + +* Add types to package + +## 0.5.1 + +* Prevent context corruption when `walk()` is called during a walk + +## 0.5.0 + +* Export `childKeys`, for manually fixing in case of malformed ASTs + +## 0.4.0 + +* Add TypeScript typings ([#3](https://github.com/Rich-Harris/estree-walker/pull/3)) + +## 0.3.1 + +* Include `pkg.repository` ([#2](https://github.com/Rich-Harris/estree-walker/pull/2)) + +## 0.3.0 + +* More predictable ordering + +## 0.2.1 + +* Keep `context` shape + +## 0.2.0 + +* Add ES6 build + +## 0.1.3 + +* npm snafu + +## 0.1.2 + +* Pass current prop and index to `enter`/`leave` callbacks + +## 0.1.1 + +* First release diff --git a/llama.cpp/tools/ui/node_modules/@rollup/pluginutils/node_modules/estree-walker/README.md b/llama.cpp/tools/ui/node_modules/@rollup/pluginutils/node_modules/estree-walker/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d877af36d496b85410e4e965b0c9be5218b5a3e5 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@rollup/pluginutils/node_modules/estree-walker/README.md @@ -0,0 +1,48 @@ +# estree-walker + +Simple utility for walking an [ESTree](https://github.com/estree/estree)-compliant AST, such as one generated by [acorn](https://github.com/marijnh/acorn). + + +## Installation + +```bash +npm i estree-walker +``` + + +## Usage + +```js +var walk = require( 'estree-walker' ).walk; +var acorn = require( 'acorn' ); + +ast = acorn.parse( sourceCode, options ); // https://github.com/acornjs/acorn + +walk( ast, { + enter: function ( node, parent, prop, index ) { + // some code happens + }, + leave: function ( node, parent, prop, index ) { + // some code happens + } +}); +``` + +Inside the `enter` function, calling `this.skip()` will prevent the node's children being walked, or the `leave` function (which is optional) being called. + +Call `this.replace(new_node)` in either `enter` or `leave` to replace the current node with a new one. + +Call `this.remove()` in either `enter` or `leave` to remove the current node. + +## Why not use estraverse? + +The ESTree spec is evolving to accommodate ES6/7. I've had a couple of experiences where [estraverse](https://github.com/estools/estraverse) was unable to handle an AST generated by recent versions of acorn, because it hard-codes visitor keys. + +estree-walker, by contrast, simply enumerates a node's properties to find child nodes (and child lists of nodes), and is therefore resistant to spec changes. It's also much smaller. (The performance, if you're wondering, is basically identical.) + +None of which should be taken as criticism of estraverse, which has more features and has been battle-tested in many more situations, and for which I'm very grateful. + + +## License + +MIT diff --git a/llama.cpp/tools/ui/node_modules/@rollup/rollup-linux-arm64-gnu/README.md b/llama.cpp/tools/ui/node_modules/@rollup/rollup-linux-arm64-gnu/README.md new file mode 100644 index 0000000000000000000000000000000000000000..48e68cb4cdebd0695f73623ae4e833f58bd945cf --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@rollup/rollup-linux-arm64-gnu/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-linux-arm64-gnu` + +This is the **aarch64-unknown-linux-gnu** binary for `rollup` diff --git a/llama.cpp/tools/ui/node_modules/@rollup/rollup-linux-arm64-musl/README.md b/llama.cpp/tools/ui/node_modules/@rollup/rollup-linux-arm64-musl/README.md new file mode 100644 index 0000000000000000000000000000000000000000..3db2751ae021fc8e7ff8500b66828e86f9529c9f --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@rollup/rollup-linux-arm64-musl/README.md @@ -0,0 +1,3 @@ +# `@rollup/rollup-linux-arm64-musl` + +This is the **aarch64-unknown-linux-musl** binary for `rollup` diff --git a/llama.cpp/tools/ui/node_modules/@standard-schema/spec/README.md b/llama.cpp/tools/ui/node_modules/@standard-schema/spec/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f9813ffa878e7914dc2928ab13db856850e8d83e --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@standard-schema/spec/README.md @@ -0,0 +1,198 @@ +

+ Standard Schema fire logo +
+ Standard Schema

+

+ A family of specs for interoperable TypeScript +
+ standardschema.dev +

+
+ + + +The Standard Schema project is a set of interfaces that standardize the provision and consumption of shared functionality in the TypeScript ecosystem. + +Its goal is to allow tools to accept a single input that includes all the types and capabilities they need— no library-specific adapters, no extra dependencies. The result is an ecosystem that's fair for implementers, friendly for consumers, and open for end users. + +## The specifications + +The specifications can be found below in their entirety. Libraries wishing to implement a spec can copy/paste the code block below into their codebase. They're also available at `@standard-schema/spec` on [npm](https://www.npmjs.com/package/@standard-schema/spec) and [JSR](https://jsr.io/@standard-schema/spec). + +```ts +// ######################### +// ### Standard Typed ### +// ######################### + +/** The Standard Typed interface. This is a base type extended by other specs. */ +export interface StandardTypedV1 { + /** The Standard properties. */ + readonly "~standard": StandardTypedV1.Props; +} + +export declare namespace StandardTypedV1 { + /** The Standard Typed properties interface. */ + export interface Props { + /** The version number of the standard. */ + readonly version: 1; + /** The vendor name of the schema library. */ + readonly vendor: string; + /** Inferred types associated with the schema. */ + readonly types?: Types | undefined; + } + + /** The Standard Typed types interface. */ + export interface Types { + /** The input type of the schema. */ + readonly input: Input; + /** The output type of the schema. */ + readonly output: Output; + } + + /** Infers the input type of a Standard Typed. */ + export type InferInput = NonNullable< + Schema["~standard"]["types"] + >["input"]; + + /** Infers the output type of a Standard Typed. */ + export type InferOutput = NonNullable< + Schema["~standard"]["types"] + >["output"]; +} + +// ########################## +// ### Standard Schema ### +// ########################## + +/** The Standard Schema interface. */ +export interface StandardSchemaV1 { + /** The Standard Schema properties. */ + readonly "~standard": StandardSchemaV1.Props; +} + +export declare namespace StandardSchemaV1 { + /** The Standard Schema properties interface. */ + export interface Props + extends StandardTypedV1.Props { + /** Validates unknown input values. */ + readonly validate: ( + value: unknown, + options?: StandardSchemaV1.Options | undefined + ) => Result | Promise>; + } + + /** The result interface of the validate function. */ + export type Result = SuccessResult | FailureResult; + + /** The result interface if validation succeeds. */ + export interface SuccessResult { + /** The typed output value. */ + readonly value: Output; + /** A falsy value for `issues` indicates success. */ + readonly issues?: undefined; + } + + export interface Options { + /** Explicit support for additional vendor-specific parameters, if needed. */ + readonly libraryOptions?: Record | undefined; + } + + /** The result interface if validation fails. */ + export interface FailureResult { + /** The issues of failed validation. */ + readonly issues: ReadonlyArray; + } + + /** The issue interface of the failure output. */ + export interface Issue { + /** The error message of the issue. */ + readonly message: string; + /** The path of the issue, if any. */ + readonly path?: ReadonlyArray | undefined; + } + + /** The path segment interface of the issue. */ + export interface PathSegment { + /** The key representing a path segment. */ + readonly key: PropertyKey; + } + + /** The Standard types interface. */ + export interface Types + extends StandardTypedV1.Types {} + + /** Infers the input type of a Standard. */ + export type InferInput = + StandardTypedV1.InferInput; + + /** Infers the output type of a Standard. */ + export type InferOutput = + StandardTypedV1.InferOutput; +} + +// ############################### +// ### Standard JSON Schema ### +// ############################### + +/** The Standard JSON Schema interface. */ +export interface StandardJSONSchemaV1 { + /** The Standard JSON Schema properties. */ + readonly "~standard": StandardJSONSchemaV1.Props; +} + +export declare namespace StandardJSONSchemaV1 { + /** The Standard JSON Schema properties interface. */ + export interface Props + extends StandardTypedV1.Props { + /** Methods for generating the input/output JSON Schema. */ + readonly jsonSchema: StandardJSONSchemaV1.Converter; + } + + /** The Standard JSON Schema converter interface. */ + export interface Converter { + /** Converts the input type to JSON Schema. May throw if conversion is not supported. */ + readonly input: ( + options: StandardJSONSchemaV1.Options + ) => Record; + /** Converts the output type to JSON Schema. May throw if conversion is not supported. */ + readonly output: ( + options: StandardJSONSchemaV1.Options + ) => Record; + } + + /** + * The target version of the generated JSON Schema. + * + * It is *strongly recommended* that implementers support `"draft-2020-12"` and `"draft-07"`, as they are both in wide use. All other targets can be implemented on a best-effort basis. Libraries should throw if they don't support a specified target. + * + * The `"openapi-3.0"` target is intended as a standardized specifier for OpenAPI 3.0 which is a superset of JSON Schema `"draft-04"`. + */ + export type Target = + | "draft-2020-12" + | "draft-07" + | "openapi-3.0" + // Accepts any string for future targets while preserving autocomplete + | ({} & string); + + /** The options for the input/output methods. */ + export interface Options { + /** Specifies the target version of the generated JSON Schema. Support for all versions is on a best-effort basis. If a given version is not supported, the library should throw. */ + readonly target: Target; + + /** Explicit support for additional vendor-specific parameters, if needed. */ + readonly libraryOptions?: Record | undefined; + } + + /** The Standard types interface. */ + export interface Types + extends StandardTypedV1.Types {} + + /** Infers the input type of a Standard. */ + export type InferInput = + StandardTypedV1.InferInput; + + /** Infers the output type of a Standard. */ + export type InferOutput = + StandardTypedV1.InferOutput; +} +``` diff --git a/llama.cpp/tools/ui/node_modules/@storybook/addon-a11y/README.md b/llama.cpp/tools/ui/node_modules/@storybook/addon-a11y/README.md new file mode 100644 index 0000000000000000000000000000000000000000..deb43df6f3d2c7f763d7570fd7bdad23916ba1b6 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@storybook/addon-a11y/README.md @@ -0,0 +1,15 @@ +# Storybook Accessibility Addon + +The @storybook/addon-a11y package provides accessibility testing for Storybook stories. It uses axe-core to run the tests. + +## Getting Started + +### Add the addon to an existing Storybook + +```bash +npx storybook add @storybook/addon-a11y +``` + +[More on getting started with the accessibility addon](https://storybook.js.org/docs/writing-tests/accessibility-testing#accessibility-checks-with-a11y-addon?ref=readme) + +Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=readme). diff --git a/llama.cpp/tools/ui/node_modules/@storybook/addon-docs/README.md b/llama.cpp/tools/ui/node_modules/@storybook/addon-docs/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1fbebfb1e4460799c27ccf57d348457a5da94ed0 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@storybook/addon-docs/README.md @@ -0,0 +1,156 @@ +
+ +
+ +# Storybook Docs + +> migration guide: This page documents the method to configure Storybook introduced recently in 7.0.0, consult the [migration guide](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md) if you want to migrate to this format of configuring Storybook. + +Storybook Docs transforms your Storybook stories into world-class component documentation. + +**DocsPage.** Out of the box, all your stories get a `DocsPage`. `DocsPage` is a zero-config aggregation of your component stories, text descriptions, docgen comments, props tables, and code examples into clean, readable pages. + +**MDX.** If you want more control, `MDX` allows you to write long-form markdown documentation and include stories in one file. You can also use it to write pure documentation pages and embed them inside your Storybook alongside your stories. + +Just like Storybook, Docs supports every major view layer including React, Vue 3, Angular, HTML, Web components, Svelte, and many more. + +Read on to learn more: + +- [Storybook Docs](#storybook-docs) + - [DocsPage](#docspage) + - [MDX](#mdx) + - [Framework support](#framework-support) + - [Installation](#installation) + - [Be sure to check framework specific installation needs](#be-sure-to-check-framework-specific-installation-needs) + - [Preset options](#preset-options) + - [TypeScript configuration](#typescript-configuration) + - [More resources](#more-resources) + +## DocsPage + +When you [install Docs](#installation), every story gets a `DocsPage`. `DocsPage` pulls information from your stories, components, source code, and story metadata to construct a sensible, zero-config default. + +Click on the `Docs` tab to see it: + +
+ +
+ +For more information on how it works, see the [`DocsPage` reference](https://github.com/storybookjs/storybook/blob/next/code/addons/docs/docs/docspage.md). + +## MDX + +`MDX` is a syntax for writing long-form documentation with stories side-by-side in the same file. In contrast to `DocsPage`, which provides smart documentation out of the box, `MDX` gives you full control over your component documentation. + +Here's an example file: + + + +```md +import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks'; +import * as CheckboxStories from './Checkbox.stories'; + + + +# Checkbox + +With `MDX` we can include a story for `Checkbox` right in the middle of our +markdown documentation. + + + + +``` + + + +And here's how that's rendered in Storybook: + +
+ +
+ +For more information on `MDX`, see the [`MDX` reference](https://github.com/storybookjs/storybook/blob/next/code/addons/docs/docs/mdx.md). + +## Framework support + +Storybook Docs supports all view layers that Storybook supports except for React Native (currently). There are some framework-specific features as well, such as props tables and inline story rendering. The following page captures the current state of support: + +[Framework Support](https://storybook.js.org/docs/configure/integration/frameworks-feature-support?ref=readme) + +**Note:** `#` = WIP support + +Want to add enhanced features to your favorite framework? Check out this [dev guide](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/multiframework.md) + +## Installation + +First add the package. Make sure that the versions for your `@storybook/*` packages match: + +```sh +yarn add -D @storybook/addon-docs +``` + +Docs has peer dependencies on `react`. If you want to write stories in MDX, you may need to add this dependency as well: + +```sh +yarn add -D react +``` + +Then add the following to your `.storybook/main.js`: + +```js +export default { + stories: [ + '../src/**/*.mdx', // 👈 Add this, to match your project's structure + '../src/**/*.stories.@(js|jsx|ts|tsx)', + ], + addons: [ + '@storybook/addon-docs', // 👈 Also add this + ], +}; +``` + +### Be sure to check framework specific installation needs + +- [React](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/react) (covered here) +- [Vue 3](https://github.com/storybookjs/storybook/blob/next/code/addons/docs/vue3) +- [Angular](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/angular) +- [Ember](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/ember) +- [Web Components](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/web-components) +- [Common setup (all other frameworks)](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/common) + +## Preset options + +The `addon-docs` preset has a few configuration options that can be used to configure its babel/webpack loading behavior. Here's an example of how to use the preset with options: + +```js +export default { + addons: [ + { + name: '@storybook/addon-docs', + options: { + csfPluginOptions: null, + mdxPluginOptions: {}, + }, + }, + ], +}; +``` + +`csfPluginOptions` is an object for configuring `@storybook/csf-plugin`. When set to `null` it tells docs not to run the `csf-plugin` at all, which can be used as an optimization, or if you're already using `csf-plugin` in your `main.js`. + +> With the release of version 7.0, it is no longer possible to import `.md` files directly into Storybook using the `transcludeMarkdown` [option](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#importing-plain-markdown-files-with-transcludemarkdown-has-changed). Instead, we recommend using the [`Markdown`](https://storybook.js.org/docs/api/doc-blocks/doc-block-markdown?ref=readme) Doc Block for importing Markdown files into your Storybook documentation. + +## TypeScript configuration + +As of SB6 [TypeScript is zero-config](https://storybook.js.org/docs/configure/integration/typescript?ref=readme) and should work with SB Docs out of the box. For advanced configuration options, refer to the [Props documentation](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/props-tables.md). + +## More resources + +Want to learn more? Here are some more articles on Storybook Docs: + +- References: [DocsPage](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/docspage.md) / [MDX](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/mdx.md) / [FAQ](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/faq.md) / [Recipes](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/recipes.md) / [Theming](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/theming.md) / [Props](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/props-tables.md) +- Announcements: [Vision](https://medium.com/storybookjs/storybook-docs-sneak-peak-5be78445094a) / [DocsPage](https://medium.com/storybookjs/storybook-docspage-e185bc3622bf) / [MDX](https://medium.com/storybookjs/rich-docs-with-storybook-mdx-61bc145ae7bc) / [Framework support](https://medium.com/storybookjs/storybook-docs-for-new-frameworks-b1f6090ee0ea) +- Example: [Storybook Design System](https://github.com/storybookjs/design-system) + +Learn more about Storybook at [storybook.js.org](https://storybook.js.org/?ref=readme). diff --git a/llama.cpp/tools/ui/node_modules/@storybook/addon-svelte-csf/README.md b/llama.cpp/tools/ui/node_modules/@storybook/addon-svelte-csf/README.md new file mode 100644 index 0000000000000000000000000000000000000000..0f271c7a31dca11532adf7993bb1f7feffc2ced0 --- /dev/null +++ b/llama.cpp/tools/ui/node_modules/@storybook/addon-svelte-csf/README.md @@ -0,0 +1,387 @@ +# Svelte CSF + +This Storybook addon allows you to write Storybook stories using the Svelte language instead of ESM that regular CSF is based on. + +```bash +npx storybook@latest add @storybook/addon-svelte-csf +``` + +Using the Svelte language makes it easier to write stories for composed components that rely on snippets or slots, which aren't easily re-created outside of Svelte files. + +## 🐣 Getting Started + +> [!TIP] +> If you've initialized your Storybook project with Storybook version 8.2.0 or above, this addon is already set up for you! + +> [!IMPORTANT] +> Not running the latest and greatest versions of Storybook or Svelte? Be sure to check [the version compatibility section below](#version-compatibility). + +The easiest way to install the addon is with `storybook add`: + +```bash +npx storybook@latest add @storybook/addon-svelte-csf +``` + +You can also add the addon manually. First, install the package: + +```bash +npm install --save-dev @storybook/addon-svelte-csf +``` + +Then modify your `main.ts` Storybook configuration to include the addon and include `*.stories.svelte` files: + +```diff +export default { +- stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx)', ++ stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|mjs|ts|tsx|svelte)'], + addons: [ ++ '@storybook/addon-svelte-csf', + ... + ], + ... +} +``` + +Restart your Storybook server for the changes to take effect. + +## 🐓 Usage + +> [!NOTE] +> The documentation here does not cover all of Storybook's features, only the aspects that are specific to the addon and Svelte CSF. We recommend that you familiarize yourself with Storybook's core concepts at . + +The [`examples`](./examples/) directory contains examples describing each feature of the addon. The [`Button.stories.svelte` example](./examples/Button.stories.svelte) is a good one to get started with. [The Storybook with all the examples is published on Chromatic here](https://next--667492d3e52064f1d418ec95.chromatic.com). + +Svelte CSF stories files must always have the `.stories.svelte` extension. + +### Defining the meta + +All stories files must have a "meta" (aka. "default export") defined, and its structure follows what's described in [the official docs on the subject](https://storybook.js.org/docs/api/csf#default-export). To define the meta in Svelte CSF, call the `defineMeta` function **within the module context**, with the meta properties you want: + +```svelte + +``` + +`defineMeta` returns an object with a `Story` component (see [Defining stories](#defining-stories) below) that you must destructure out to use. + +### Defining stories + +To define stories, you use the `Story` component returned from the `defineMeta` function. Depending on what you want the story to contain, [there are multiple ways to use the `Story` component](./examples/Templating.stories.svelte). Common for all the use case is that all properties of [a regular CSF story](https://storybook.js.org/docs/api/csf#named-story-exports) are passed as props to the `Story` component, with the exception of the `render` function, which does not have any effect in Svelte CSF. + +All story requires either the `name` prop or [`exportName` prop](#custom-export-name). + +> [!TIP] +> In versions prior to v5 of this addon, it was always required to define a template story with the `