toolcraft 0.0.117 → 0.0.118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/composition.json +2 -17
  2. package/dist/composition.json +2 -17
  3. package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
  4. package/node_modules/tiny-stdio-mcp-server/dist/server.js +9 -21
  5. package/node_modules/tiny-stdio-mcp-server/dist/uri-template.d.ts +6 -0
  6. package/node_modules/tiny-stdio-mcp-server/dist/uri-template.js +363 -0
  7. package/node_modules/toolcraft-schema/package.json +3 -2
  8. package/package.json +4 -8
  9. package/node_modules/pct-encode/.travis.yml +0 -7
  10. package/node_modules/pct-encode/AUTHORS +0 -2
  11. package/node_modules/pct-encode/LICENSE +0 -11
  12. package/node_modules/pct-encode/README.md +0 -20
  13. package/node_modules/pct-encode/index.js +0 -23
  14. package/node_modules/pct-encode/package.json +0 -23
  15. package/node_modules/pct-encode/test.js +0 -10
  16. package/node_modules/uri-template/AUTHORS +0 -2
  17. package/node_modules/uri-template/LICENSE +0 -19
  18. package/node_modules/uri-template/README.md +0 -34
  19. package/node_modules/uri-template/dist/ast.d.ts +0 -28
  20. package/node_modules/uri-template/dist/ast.js +0 -27
  21. package/node_modules/uri-template/dist/expander.d.ts +0 -3
  22. package/node_modules/uri-template/dist/expander.js +0 -165
  23. package/node_modules/uri-template/dist/grammar.d.ts +0 -13
  24. package/node_modules/uri-template/dist/grammar.js +0 -749
  25. package/node_modules/uri-template/dist/index.d.ts +0 -19
  26. package/node_modules/uri-template/dist/index.js +0 -43
  27. package/node_modules/uri-template/lib/ast.ts +0 -59
  28. package/node_modules/uri-template/lib/expander.ts +0 -175
  29. package/node_modules/uri-template/lib/grammar.js +0 -773
  30. package/node_modules/uri-template/lib/grammar.pegjs +0 -33
  31. package/node_modules/uri-template/lib/index.ts +0 -33
  32. package/node_modules/uri-template/package.json +0 -33
  33. package/node_modules/uri-template-lite/README.md +0 -86
  34. package/node_modules/uri-template-lite/index.js +0 -140
  35. package/node_modules/uri-template-lite/package.json +0 -43
@@ -1,23 +0,0 @@
1
- {
2
- "name": "pct-encode",
3
- "version": "1.0.3",
4
- "description": "Percent-encode characters in strings matching a regular expression",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "node test.js"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "https://github.com/grncdr/pct-encode"
12
- },
13
- "keywords": [
14
- "uri",
15
- "url",
16
- "pct",
17
- "encode"
18
- ],
19
- "license": "BSD-2-Clause",
20
- "devDependencies": {
21
- "tape": "~2.0.0"
22
- }
23
- }
@@ -1,10 +0,0 @@
1
- var test = require('tape')
2
- var pctEncode = require('./index.js')
3
-
4
- test('Does it work?', function (t) {
5
- t.plan(1)
6
- var encode = pctEncode(/[^\w~.\-]/g);
7
-
8
- t.equal(encode("UTF-8 in your URIs: ✓✓"),
9
- "UTF-8%20in%20your%20URIs%3A%20%E2%9C%93%E2%9C%93");
10
- })
@@ -1,2 +0,0 @@
1
- Stephen Sugden <me@stephensugden.com> (http://stephensugden.com)
2
- Andrei Neculau <andrei.neculau@gmail.com> (http://andreineculau.com)
@@ -1,19 +0,0 @@
1
- Copyright (c) 2013 Stephen Sugden
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
@@ -1,34 +0,0 @@
1
- # URI Template
2
-
3
- [![Node.js CI](https://github.com/grncdr/uri-template/actions/workflows/nodejs.yml/badge.svg)](https://github.com/grncdr/uri-template/actions/workflows/nodejs.yml)
4
-
5
- This is a node.js implementation of the URI template draft standard
6
- defined at http://tools.ietf.org/html/rfc6570
7
-
8
- ## Example
9
-
10
- ```javascript
11
- var parser = require("uri-template");
12
-
13
- var tpl = parser.parse("/{year}/{month}/{day}{?orderBy,direction}");
14
-
15
- tpl.expand({ year: 2006, month: 6, day: 6 });
16
- // /2006/6/6
17
-
18
- tpl.expand({ year: 2006, month: 6, day: 6, orderBy: "size" });
19
- // /2006/6/6?orderBy=size
20
-
21
- tpl.expand({ year: 2006, month: 6, day: 6, orderBy: "time", direction: "asc" });
22
- // /2006/6/6?orderBy=time&direction=asc
23
-
24
- var queryTpl = parser.parse("/search{?q,otherParams*}");
25
- queryTpl.expand({
26
- q: "Bigger office",
27
- otherParams: { prefer: "Sterling's office", accept: "Crane's office" },
28
- });
29
- // /search?q=Bigger%20office&prefer=Sterling%27s%20office&accept=Crane%27s%20office
30
- ```
31
-
32
- For more thorough coverage of the syntax, see the [RFC](https://datatracker.ietf.org/doc/html/rfc6570).
33
-
34
- ##
@@ -1,28 +0,0 @@
1
- export interface Template {
2
- type: "template";
3
- parts: (Literal | Expression)[];
4
- }
5
- export interface Literal {
6
- type: "literal";
7
- value: string;
8
- }
9
- export interface Expression {
10
- type: "expression";
11
- operator: Operator;
12
- variables: Variable[];
13
- }
14
- export declare type Operator = "/" | ";" | "." | "?" | "&" | "+" | "#" | "";
15
- export interface Variable {
16
- type: "variable";
17
- name: string;
18
- modifier?: SubstrModifier | ExplodeModifier;
19
- extension?: string;
20
- }
21
- export interface ExplodeModifier {
22
- type: "explode";
23
- }
24
- export interface SubstrModifier {
25
- type: "substr";
26
- length: number;
27
- }
28
- export declare function toString(node: Template | Literal | Expression | Variable): string;
@@ -1,27 +0,0 @@
1
- "use strict";
2
- exports.__esModule = true;
3
- exports.toString = void 0;
4
- function toString(node) {
5
- var _a, _b;
6
- switch (node.type) {
7
- case "template":
8
- return node.parts.map(toString).join("");
9
- case "literal":
10
- return node.value;
11
- case "expression":
12
- return "{" + node.operator + node.variables.map(toString).join(",") + "}";
13
- case "variable":
14
- var out = node.name;
15
- if (((_a = node.modifier) === null || _a === void 0 ? void 0 : _a.type) == "explode") {
16
- out += "*";
17
- }
18
- else if (((_b = node.modifier) === null || _b === void 0 ? void 0 : _b.type) == "substr") {
19
- out += ":" + node.modifier.length;
20
- }
21
- if (node.extension) {
22
- out += "(" + node.extension + ")";
23
- }
24
- return out;
25
- }
26
- }
27
- exports.toString = toString;
@@ -1,3 +0,0 @@
1
- import { Template, Expression } from "./ast";
2
- export declare function expandTemplate(ast: Template, values: Record<string, unknown>): string;
3
- export declare function expandExpression(expression: Expression, values: Record<string, unknown>): string;
@@ -1,165 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- exports.__esModule = true;
17
- exports.expandExpression = exports.expandTemplate = void 0;
18
- var pct_encode_1 = __importDefault(require("pct-encode"));
19
- var encoders = {
20
- UrlSafe: (0, pct_encode_1["default"])(/[^\w~.-]/g),
21
- Restricted: (0, pct_encode_1["default"])(/[^\w.~:\/\?#\[\]@!\$&'()*+,;=%-]|%(?!\d\d)/g)
22
- };
23
- function expandTemplate(ast, values) {
24
- var strings = ast.parts.map(function (part) {
25
- switch (part.type) {
26
- case "literal":
27
- return part.value;
28
- case "expression":
29
- return expandExpression(part, values);
30
- }
31
- });
32
- return strings.join("");
33
- }
34
- exports.expandTemplate = expandTemplate;
35
- var defaults = {
36
- first: "",
37
- sep: ",",
38
- empty: "",
39
- encode: encoders.UrlSafe,
40
- named: false
41
- };
42
- var OperatorConfigs = {
43
- "": __assign({}, defaults),
44
- "+": __assign(__assign({}, defaults), { encode: encoders.Restricted }),
45
- "#": __assign(__assign({}, defaults), { encode: encoders.Restricted, first: "#", empty: "#" }),
46
- "/": __assign(__assign({}, defaults), { first: "/", sep: "/" }),
47
- ".": __assign(__assign({}, defaults), { first: ".", sep: ".", empty: "." }),
48
- ";": __assign(__assign({}, defaults), { first: ";", sep: ";", named: true }),
49
- "?": __assign(__assign({}, defaults), { first: "?", sep: "&", empty: "=", named: true }),
50
- "&": __assign(__assign({}, defaults), { first: "&", sep: "&", empty: "=", named: true })
51
- };
52
- function expandExpression(expression, values) {
53
- var config = OperatorConfigs[expression.operator];
54
- var strings = [];
55
- expression.variables.forEach(function (variable) {
56
- var value = values[variable.name];
57
- if (!present(value))
58
- return;
59
- var string = expandVariable(variable, value, config);
60
- strings.push(string || "");
61
- });
62
- if (strings.length === 0) {
63
- return "";
64
- }
65
- var expanded = strings.join(config.sep);
66
- if (expanded.length === 0) {
67
- return config.empty;
68
- }
69
- return config.first + expanded;
70
- }
71
- exports.expandExpression = expandExpression;
72
- function expandVariable(variable, value, config) {
73
- var _a;
74
- if (value == null) {
75
- throw new TypeError("tried to expand null value for variable " + variable.name + ", this is a bug in uri-template");
76
- }
77
- if (((_a = variable.modifier) === null || _a === void 0 ? void 0 : _a.type) === "explode") {
78
- return expandValueExplode(variable, value, config);
79
- }
80
- else {
81
- return expandValueSingle(variable, value, config);
82
- }
83
- }
84
- function expandValueSingle(variable, value, _a) {
85
- var _b, _c;
86
- var empty = _a.empty, encode = _a.encode, named = _a.named;
87
- if (typeof value === "object" && ((_b = variable.modifier) === null || _b === void 0 ? void 0 : _b.type) === "substr") {
88
- throw new Error("Prefixed variables do not support lists/maps. Check " + variable.name);
89
- }
90
- var out;
91
- if (Array.isArray(value)) {
92
- out = value.map(encode).join(",");
93
- }
94
- else if (typeof value === "object") {
95
- out = Object.entries(value)
96
- .map(function (entry) { return entry.map(encode).join(","); })
97
- .join(",");
98
- }
99
- else {
100
- out = value.toString();
101
- if (((_c = variable.modifier) === null || _c === void 0 ? void 0 : _c.type) === "substr") {
102
- out = out.substring(0, variable.modifier.length);
103
- }
104
- out = encode(out);
105
- }
106
- if (named) {
107
- if (out) {
108
- out = variable.name + "=" + out;
109
- }
110
- else {
111
- out = "" + variable.name + empty;
112
- }
113
- }
114
- return out;
115
- }
116
- function expandValueExplode(variable, value, _a) {
117
- var encode = _a.encode, named = _a.named, sep = _a.sep;
118
- if (Array.isArray(value)) {
119
- var items = value.map(encode);
120
- if (named) {
121
- items = items.map(function (item) { return variable.name + "=" + item; });
122
- }
123
- return items.join(sep);
124
- }
125
- else if (typeof value === "object") {
126
- var pairs_1 = [];
127
- Object.entries(value).forEach(function (_a) {
128
- var k = _a[0], v = _a[1];
129
- k = encode(k);
130
- if (Array.isArray(v)) {
131
- v.forEach(function (item) {
132
- pairs_1.push(k + "=" + encode(item));
133
- });
134
- }
135
- else {
136
- pairs_1.push(k + "=" + encode(v));
137
- }
138
- });
139
- return pairs_1.join(sep);
140
- }
141
- else {
142
- var s = value.toString();
143
- return encode(s);
144
- }
145
- }
146
- function present(v) {
147
- switch (typeof v) {
148
- case "undefined":
149
- return false;
150
- case "object":
151
- if (v == null) {
152
- return false;
153
- }
154
- if (Array.isArray(v)) {
155
- return v.length > 0;
156
- }
157
- for (var k in v) {
158
- if (v[k] != null)
159
- return true;
160
- }
161
- return false;
162
- default:
163
- return true;
164
- }
165
- }
@@ -1,13 +0,0 @@
1
- declare function peg$SyntaxError(message: any, expected: any, found: any, location: any): Error;
2
- declare class peg$SyntaxError {
3
- constructor(message: any, expected: any, found: any, location: any);
4
- format(sources: any): string;
5
- }
6
- declare namespace peg$SyntaxError {
7
- function buildMessage(expected: any, found: any): string;
8
- }
9
- declare function peg$parse(input: any, options: any): {
10
- type: string;
11
- parts: any;
12
- };
13
- export { peg$SyntaxError as SyntaxError, peg$parse as parse };