toolcraft 0.0.117 → 0.0.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/composition.json +2 -17
- package/dist/composition.json +2 -17
- package/node_modules/@poe-code/agent-defs/package.json +0 -2
- package/node_modules/@poe-code/agent-human-in-loop/package.json +0 -2
- package/node_modules/@poe-code/agent-mcp-config/package.json +0 -2
- package/node_modules/@poe-code/config-mutations/package.json +0 -2
- package/node_modules/@poe-code/frontmatter/package.json +0 -2
- package/node_modules/@poe-code/process-runner/package.json +0 -2
- package/node_modules/@poe-code/task-list/package.json +0 -2
- package/node_modules/auth-store/package.json +0 -2
- package/node_modules/tiny-mcp-client/package.json +0 -2
- package/node_modules/tiny-stdio-mcp-server/dist/composition.json +1 -1
- package/node_modules/tiny-stdio-mcp-server/dist/server.js +9 -21
- package/node_modules/tiny-stdio-mcp-server/dist/uri-template.d.ts +6 -0
- package/node_modules/tiny-stdio-mcp-server/dist/uri-template.js +363 -0
- package/node_modules/toolcraft-design/package.json +0 -2
- package/node_modules/toolcraft-schema/package.json +3 -2
- package/package.json +5 -9
- package/node_modules/pct-encode/.travis.yml +0 -7
- package/node_modules/pct-encode/AUTHORS +0 -2
- package/node_modules/pct-encode/LICENSE +0 -11
- package/node_modules/pct-encode/README.md +0 -20
- package/node_modules/pct-encode/index.js +0 -23
- package/node_modules/pct-encode/package.json +0 -23
- package/node_modules/pct-encode/test.js +0 -10
- package/node_modules/uri-template/AUTHORS +0 -2
- package/node_modules/uri-template/LICENSE +0 -19
- package/node_modules/uri-template/README.md +0 -34
- package/node_modules/uri-template/dist/ast.d.ts +0 -28
- package/node_modules/uri-template/dist/ast.js +0 -27
- package/node_modules/uri-template/dist/expander.d.ts +0 -3
- package/node_modules/uri-template/dist/expander.js +0 -165
- package/node_modules/uri-template/dist/grammar.d.ts +0 -13
- package/node_modules/uri-template/dist/grammar.js +0 -749
- package/node_modules/uri-template/dist/index.d.ts +0 -19
- package/node_modules/uri-template/dist/index.js +0 -43
- package/node_modules/uri-template/lib/ast.ts +0 -59
- package/node_modules/uri-template/lib/expander.ts +0 -175
- package/node_modules/uri-template/lib/grammar.js +0 -773
- package/node_modules/uri-template/lib/grammar.pegjs +0 -33
- package/node_modules/uri-template/lib/index.ts +0 -33
- package/node_modules/uri-template/package.json +0 -33
- package/node_modules/uri-template-lite/README.md +0 -86
- package/node_modules/uri-template-lite/index.js +0 -140
- package/node_modules/uri-template-lite/package.json +0 -43
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
template
|
|
2
|
-
= parts:(literal / expression)*
|
|
3
|
-
{ return {type: 'template', parts} }
|
|
4
|
-
|
|
5
|
-
expression
|
|
6
|
-
= '{' operator:operator variables:variables '}'
|
|
7
|
-
{ return {type: 'expression', operator, variables} }
|
|
8
|
-
|
|
9
|
-
operator
|
|
10
|
-
= [/;.?&+#] / ''
|
|
11
|
-
|
|
12
|
-
variables
|
|
13
|
-
= hd:variable rst:(',' v:variable { return v })*
|
|
14
|
-
{ rst.unshift(hd); return rst; }
|
|
15
|
-
|
|
16
|
-
variable
|
|
17
|
-
= name:$([a-zA-Z0-9_.%]+) modifier:(substr / listMarker)? extension:extension?
|
|
18
|
-
{ return { type: 'variable', name, modifier, extension } }
|
|
19
|
-
|
|
20
|
-
listMarker
|
|
21
|
-
= '*'
|
|
22
|
-
{ return { type: 'explode' } }
|
|
23
|
-
|
|
24
|
-
substr
|
|
25
|
-
= ':' digits:$[0-9]+
|
|
26
|
-
{ return { type: 'substr', length: parseInt(digits) } }
|
|
27
|
-
|
|
28
|
-
literal
|
|
29
|
-
= value:$[^{]+
|
|
30
|
-
{ return { type: 'literal', value } }
|
|
31
|
-
|
|
32
|
-
extension
|
|
33
|
-
= '(' text:$[^)]+ ')' { return text }
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as grammar from "./grammar.js";
|
|
2
|
-
import * as AST from "./ast";
|
|
3
|
-
import { expandTemplate } from "./expander";
|
|
4
|
-
|
|
5
|
-
export type RuleToNode = {
|
|
6
|
-
template: AST.Template;
|
|
7
|
-
literal: AST.Literal;
|
|
8
|
-
expression: AST.Expression;
|
|
9
|
-
operator: AST.Operator;
|
|
10
|
-
variables: AST.Variable[];
|
|
11
|
-
variable: AST.Variable;
|
|
12
|
-
listMarker: AST.ExplodeModifier;
|
|
13
|
-
substr: AST.SubstrModifier;
|
|
14
|
-
extension: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export function parse(input: string) {
|
|
18
|
-
const ast = parseRule(input, "template");
|
|
19
|
-
return {
|
|
20
|
-
ast,
|
|
21
|
-
expand: (values: Record<string, unknown>) => expandTemplate(ast, values),
|
|
22
|
-
toString: () => AST.toString(ast),
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export function parseRule<StartRule extends keyof RuleToNode>(
|
|
27
|
-
input: string,
|
|
28
|
-
startRule = "template" as StartRule
|
|
29
|
-
): RuleToNode[StartRule] {
|
|
30
|
-
return grammar.parse(input, { startRule }) as RuleToNode[StartRule];
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export * from "./expander";
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"author": "Stephen Sugden <me@stephensugden.com> (http://stephensugden.com)",
|
|
3
|
-
"name": "uri-template",
|
|
4
|
-
"description": "Parse and expand URI templates as defined by http://tools.ietf.org/html/rfc6570",
|
|
5
|
-
"version": "2.0.0",
|
|
6
|
-
"repository": {
|
|
7
|
-
"type": "git",
|
|
8
|
-
"url": "git://github.com/grncdr/uri-template.git"
|
|
9
|
-
},
|
|
10
|
-
"main": "dist/index.js",
|
|
11
|
-
"types": "dist/index.d.ts",
|
|
12
|
-
"scripts": {
|
|
13
|
-
"prepare": "make clean all",
|
|
14
|
-
"test": "make test"
|
|
15
|
-
},
|
|
16
|
-
"dependencies": {
|
|
17
|
-
"pct-encode": "~1.0.0"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@types/node": "^16.11.0",
|
|
21
|
-
"peggy": "^1.2.0",
|
|
22
|
-
"prettier": "^2.4.1",
|
|
23
|
-
"typescript": "^4.4.4"
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"dist",
|
|
27
|
-
"lib",
|
|
28
|
-
"AUTHORS",
|
|
29
|
-
"LICENSE",
|
|
30
|
-
"README.md"
|
|
31
|
-
],
|
|
32
|
-
"license": "MIT"
|
|
33
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
[1]: https://badgen.net/coveralls/c/github/litejs/uri-template-lite
|
|
3
|
-
[2]: https://coveralls.io/r/litejs/uri-template-lite
|
|
4
|
-
[3]: https://badgen.net/packagephobia/install/uri-template-lite
|
|
5
|
-
[4]: https://packagephobia.now.sh/result?p=uri-template-lite
|
|
6
|
-
[5]: https://badgen.net/badge/icon/Buy%20Me%20A%20Tea/orange?icon=kofi&label
|
|
7
|
-
[6]: https://www.buymeacoffee.com/lauriro
|
|
8
|
-
|
|
9
|
-
[RFC 6570]: http://tools.ietf.org/html/rfc6570
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
URI Template Lite – [![Coverage][1]][2] [![size][3]][4] [![Buy Me A Tea][5]][6]
|
|
13
|
-
=================
|
|
14
|
-
|
|
15
|
-
URI Template [RFC 6570][] expansion and extraction.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Usage
|
|
19
|
-
-----
|
|
20
|
-
|
|
21
|
-
`npm install uri-template-lite`
|
|
22
|
-
|
|
23
|
-
```javascript
|
|
24
|
-
var UriTemplate = require("uri-template-lite")
|
|
25
|
-
|
|
26
|
-
// Call `expand` directly
|
|
27
|
-
var data = {"domain":"example.com", "user":"fred", "query":"mycelium"}
|
|
28
|
-
UriTemplate.expand("http://{domain}/~{user}/foo{?query,number}", data)
|
|
29
|
-
// Returns http://example.com/~fred/foo?query=mycelium
|
|
30
|
-
|
|
31
|
-
// ..or use `Template` constructor
|
|
32
|
-
var template = new UriTemplate("http://{domain}/~{user}/foo{?query,number}")
|
|
33
|
-
template.expand({"domain":"example.com", "user":"fred", "query":"mycelium", "number": 3})
|
|
34
|
-
// Returns http://example.com/~fred/foo?query=mycelium&number=3
|
|
35
|
-
|
|
36
|
-
// Extract variables
|
|
37
|
-
template.match("http://example.com/~fred/foo?query=mycelium&number=3")
|
|
38
|
-
// Returns {"domain":"example.com", "user":"fred", "query":"mycelium", "number": "3"}
|
|
39
|
-
|
|
40
|
-
template.match("http://other.com/?query=mycelium")
|
|
41
|
-
// Returns null
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
About error handling
|
|
47
|
-
--------------------
|
|
48
|
-
|
|
49
|
-
This implementation tries to do a best effort template expansion
|
|
50
|
-
and leaves erroneous expressions in the returned URI
|
|
51
|
-
instead of throwing errors.
|
|
52
|
-
So for example, the incorrect expression
|
|
53
|
-
{unclosed will return {unclosed as output.
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
Browser Support
|
|
58
|
-
---------------
|
|
59
|
-
|
|
60
|
-
It should work IE6 and up but automated testing is currently broken.
|
|
61
|
-
|
|
62
|
-
- For older browsers it requires `browser-upgrade-lite` package
|
|
63
|
-
or other ES5 polyfill.
|
|
64
|
-
- FF3-4 `escape` should be patched to remove non-standard 2nd param,
|
|
65
|
-
`browser-upgrade-lite` does that.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
## External links
|
|
70
|
-
|
|
71
|
-
[GitHub repo](https://github.com/litejs/uri-template-lite) |
|
|
72
|
-
[npm package](https://npmjs.org/package/uri-template-lite) |
|
|
73
|
-
URI Template [RFC 6570][] and
|
|
74
|
-
[Tests](https://github.com/uri-templates/uritemplate-test) |
|
|
75
|
-
[Coveralls coverage][2]
|
|
76
|
-
[Buy Me A Tea][6]
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
## Licence
|
|
80
|
-
|
|
81
|
-
Copyright (c) 2014-2022 Lauri Rooden <lauri@rooden.ee>
|
|
82
|
-
[The MIT License](http://lauri.rooden.ee/mit-license.txt)
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
/* global escape */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/*! litejs.com/MIT-LICENSE.txt */
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
!function() {
|
|
8
|
-
"use strict";
|
|
9
|
-
|
|
10
|
-
module.exports = Template
|
|
11
|
-
module.exports.expand = expand
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* URI Template
|
|
15
|
-
* @see http://tools.ietf.org/html/rfc6570
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
var RESERVED = /[!'()]/g
|
|
19
|
-
// /[[\]:\/!#$&()*+,;='?@]/g
|
|
20
|
-
, SEPARATORS = {"": ",", "+": ",", "#": ",", "?": "&"}
|
|
21
|
-
, escapeRe = /[$-/?[-^{|}]/g
|
|
22
|
-
, expandRe = /\{([#&+./;?]?)((?:[-\w%.]+(\*|:\d+)?(?:,|(?=})))+)\}/g
|
|
23
|
-
, parseRe = RegExp(expandRe.source + "|.[^{]*?", "g")
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function encodeNormal(val) {
|
|
27
|
-
return encodeURIComponent(val).replace(RESERVED, escape)
|
|
28
|
-
}
|
|
29
|
-
function catchDecode(str) {
|
|
30
|
-
try {
|
|
31
|
-
return decodeURIComponent(str)
|
|
32
|
-
} catch(e) {
|
|
33
|
-
return str
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function notNull(s) {
|
|
38
|
-
return s != null
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function mapCleanJoin(arr, mapFn, joinStr) {
|
|
42
|
-
arr = arr.map(mapFn).filter(notNull)
|
|
43
|
-
return arr.length && arr.join(joinStr)
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function expand(template, data, opts) {
|
|
47
|
-
return template.replace(expandRe, function(_, op, vals) {
|
|
48
|
-
var sep = SEPARATORS[op] || op
|
|
49
|
-
, named = sep == ";" || sep == "&"
|
|
50
|
-
, enc = op && sep == "," ? encodeURI : opts && opts.encoder || encodeNormal
|
|
51
|
-
, out = mapCleanJoin(vals.split(","), function(_name) {
|
|
52
|
-
var mod = _name.split(/[*:]/)
|
|
53
|
-
, name = mod[0]
|
|
54
|
-
, val = data[name]
|
|
55
|
-
|
|
56
|
-
if (val == null) return
|
|
57
|
-
|
|
58
|
-
if (typeof val == "object") {
|
|
59
|
-
mod = name != _name
|
|
60
|
-
if (Array.isArray(val)) {
|
|
61
|
-
val = mapCleanJoin(val, enc, mod ? named ? sep + name + "=" : sep : "," )
|
|
62
|
-
} else {
|
|
63
|
-
val = mapCleanJoin(Object.keys(val), function(key) {
|
|
64
|
-
return enc(key) + (mod ? "=" : ",") + enc(val[key])
|
|
65
|
-
}, mod && (named || sep == "/") ? sep : ",")
|
|
66
|
-
if (mod) named = 0
|
|
67
|
-
}
|
|
68
|
-
if (!val) return
|
|
69
|
-
} else {
|
|
70
|
-
val = enc(mod[1] ? val.slice(0, mod[1]) : val)
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return (
|
|
74
|
-
named ?
|
|
75
|
-
name + (val || sep == "&" ? "=" + val : val) :
|
|
76
|
-
val
|
|
77
|
-
)
|
|
78
|
-
}, sep)
|
|
79
|
-
|
|
80
|
-
return out || out === "" ? (op != "+" ? op + out : out) : ""
|
|
81
|
-
}
|
|
82
|
-
)}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
function Template(template, opts_) {
|
|
86
|
-
var self = this
|
|
87
|
-
//if (!(self instanceof Template)) return new Template(template)
|
|
88
|
-
, opts = Object.assign({
|
|
89
|
-
decoder: catchDecode
|
|
90
|
-
}, opts_)
|
|
91
|
-
, pos = 0
|
|
92
|
-
, lengths = {}
|
|
93
|
-
, fnStr = ""
|
|
94
|
-
, reStr = "^" + template.replace(parseRe, function(_, op, vals) {
|
|
95
|
-
if (!vals) return escapeRegExp(_)
|
|
96
|
-
|
|
97
|
-
var sep = SEPARATORS[op] || op
|
|
98
|
-
, named = sep == ";" || sep == "&"
|
|
99
|
-
return vals.split(",").map(function(_name, i) {
|
|
100
|
-
var mod = _name.split(/[*:]/)
|
|
101
|
-
, name = mod[0]
|
|
102
|
-
, re = (lengths[name] || "(") + ".*?)"
|
|
103
|
-
|
|
104
|
-
pos++
|
|
105
|
-
if (mod[1]) {
|
|
106
|
-
re = "((?:%..|.){1," + mod[1] + "})"
|
|
107
|
-
lengths[name] = "(\\" + pos
|
|
108
|
-
}
|
|
109
|
-
fnStr += "t=($[" + pos + "]||'').split('" + (mod[1] ? named ? sep + name + "=" : sep : ",") + "').map(d);"
|
|
110
|
-
fnStr += "o[\"" + name + "\"]=" + (mod[1] === "" ? "t;" : "t.length>1?t:t[0];")
|
|
111
|
-
re = escapeRegExp(i === 0 ? op === "+" ? "" : op : sep) + (
|
|
112
|
-
named ?
|
|
113
|
-
escapeRegExp(name) + "(?:=" + re + ")?" :
|
|
114
|
-
//sep == "&" ?
|
|
115
|
-
//escapeRegExp(name + "=") + re :
|
|
116
|
-
re
|
|
117
|
-
)
|
|
118
|
-
return mod[1] === "" ? "(?:" + re + ")?" : re
|
|
119
|
-
}).join("")
|
|
120
|
-
}) + "$"
|
|
121
|
-
, re = RegExp(reStr)
|
|
122
|
-
, fn = Function("$,d", "var t,o={};" + fnStr + "return o")
|
|
123
|
-
|
|
124
|
-
self.template = template
|
|
125
|
-
self.match = function(uri) {
|
|
126
|
-
var match = re.exec(uri)
|
|
127
|
-
return match && fn(match, opts.decoder)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function escapeRegExp(string) {
|
|
131
|
-
return string.replace(escapeRe, "\\$&")
|
|
132
|
-
}
|
|
133
|
-
self.expand = function(data) {
|
|
134
|
-
return expand(template, data, opts)
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// `this` is `exports` in NodeJS and `window` in browser.
|
|
139
|
-
}(); // jshint ignore:line
|
|
140
|
-
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "uri-template-lite",
|
|
3
|
-
"version": "23.4.0",
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"author": "Lauri Rooden <lauri@rooden.ee>",
|
|
6
|
-
"description": "URI Template [RFC 6570] expansion and extraction",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"uri",
|
|
9
|
-
"url",
|
|
10
|
-
"template",
|
|
11
|
-
"uri-template",
|
|
12
|
-
"rfc6570",
|
|
13
|
-
"litejs"
|
|
14
|
-
],
|
|
15
|
-
"main": "index.js",
|
|
16
|
-
"files": [],
|
|
17
|
-
"scripts": {
|
|
18
|
-
"test": "lj test --coverage --brief test/index.js && jshint *.js",
|
|
19
|
-
"test-fast": "lj test --brief test/index.js"
|
|
20
|
-
},
|
|
21
|
-
"repository": "github:litejs/uri-template-lite",
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@litejs/cli": "23.4.3",
|
|
24
|
-
"jshint": "2.13.6"
|
|
25
|
-
},
|
|
26
|
-
"litejs": {
|
|
27
|
-
"build": false,
|
|
28
|
-
"global": false
|
|
29
|
-
},
|
|
30
|
-
"jshintConfig": {
|
|
31
|
-
"esversion": 5,
|
|
32
|
-
"asi": true,
|
|
33
|
-
"evil": true,
|
|
34
|
-
"laxcomma": true,
|
|
35
|
-
"maxdepth": 6,
|
|
36
|
-
"node": true,
|
|
37
|
-
"nonbsp": true,
|
|
38
|
-
"undef": true,
|
|
39
|
-
"unused": true,
|
|
40
|
-
"shadow": "outer",
|
|
41
|
-
"quotmark": "double"
|
|
42
|
-
}
|
|
43
|
-
}
|