usepaso 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -21
- package/dist/cli.js +37 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/doctor.d.ts +3 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +106 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +17 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/inspect.d.ts.map +1 -1
- package/dist/commands/inspect.js +14 -7
- package/dist/commands/inspect.js.map +1 -1
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +13 -6
- package/dist/commands/serve.js.map +1 -1
- package/dist/commands/shared.d.ts.map +1 -1
- package/dist/commands/shared.js +5 -4
- package/dist/commands/shared.js.map +1 -1
- package/dist/commands/test.d.ts +0 -1
- package/dist/commands/test.d.ts.map +1 -1
- package/dist/commands/test.js +57 -37
- package/dist/commands/test.js.map +1 -1
- package/dist/commands/validate.d.ts.map +1 -1
- package/dist/commands/validate.js +44 -3
- package/dist/commands/validate.js.map +1 -1
- package/dist/executor.d.ts +15 -0
- package/dist/executor.d.ts.map +1 -1
- package/dist/executor.js +104 -4
- package/dist/executor.js.map +1 -1
- package/dist/generators/mcp.d.ts.map +1 -1
- package/dist/generators/mcp.js +4 -8
- package/dist/generators/mcp.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/coerce.d.ts +2 -0
- package/dist/utils/coerce.d.ts.map +1 -0
- package/dist/utils/coerce.js +33 -0
- package/dist/utils/coerce.js.map +1 -0
- package/dist/utils/color.d.ts +19 -0
- package/dist/utils/color.d.ts.map +1 -0
- package/dist/utils/color.js +46 -0
- package/dist/utils/color.js.map +1 -0
- package/dist/utils/redact.d.ts +6 -0
- package/dist/utils/redact.d.ts.map +1 -0
- package/dist/utils/redact.js +37 -0
- package/dist/utils/redact.js.map +1 -0
- package/package.json +2 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coerce.d.ts","sourceRoot":"","sources":["../../src/utils/coerce.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAwB3E"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.coerceValue = coerceValue;
|
|
4
|
+
const INTEGER_RE = /^-?\d+$/;
|
|
5
|
+
const NUMBER_RE = /^-?\d+(\.\d+)?$/;
|
|
6
|
+
function coerceValue(raw, type, key) {
|
|
7
|
+
switch (type) {
|
|
8
|
+
case 'integer': {
|
|
9
|
+
if (!INTEGER_RE.test(raw)) {
|
|
10
|
+
throw new Error(`Parameter "${key}" must be an integer, got "${raw}"`);
|
|
11
|
+
}
|
|
12
|
+
return parseInt(raw, 10);
|
|
13
|
+
}
|
|
14
|
+
case 'number': {
|
|
15
|
+
if (!NUMBER_RE.test(raw)) {
|
|
16
|
+
throw new Error(`Parameter "${key}" must be a number, got "${raw}"`);
|
|
17
|
+
}
|
|
18
|
+
return parseFloat(raw);
|
|
19
|
+
}
|
|
20
|
+
case 'boolean':
|
|
21
|
+
if (raw === 'true')
|
|
22
|
+
return true;
|
|
23
|
+
if (raw === 'false')
|
|
24
|
+
return false;
|
|
25
|
+
throw new Error(`Parameter "${key}" must be true or false, got "${raw}"`);
|
|
26
|
+
case 'string':
|
|
27
|
+
case 'enum':
|
|
28
|
+
return raw;
|
|
29
|
+
default:
|
|
30
|
+
return raw;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=coerce.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coerce.js","sourceRoot":"","sources":["../../src/utils/coerce.ts"],"names":[],"mappings":";;AAGA,kCAwBC;AA3BD,MAAM,UAAU,GAAG,SAAS,CAAC;AAC7B,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAEpC,SAAgB,WAAW,CAAC,GAAW,EAAE,IAAY,EAAE,GAAW;IAChE,QAAQ,IAAI,EAAE,CAAC;QACb,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBAC1B,MAAM,IAAI,KAAK,CAAC,cAAc,GAAG,8BAA8B,GAAG,GAAG,CAAC,CAAC;YACzE,CAAC;YACD,OAAO,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QAC3B,CAAC;QACD,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,MAAM,IAAI,KAAK,CAAC,cAAc,GAAG,4BAA4B,GAAG,GAAG,CAAC,CAAC;YACvE,CAAC;YACD,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;QACD,KAAK,SAAS;YACZ,IAAI,GAAG,KAAK,MAAM;gBAAE,OAAO,IAAI,CAAC;YAChC,IAAI,GAAG,KAAK,OAAO;gBAAE,OAAO,KAAK,CAAC;YAClC,MAAM,IAAI,KAAK,CAAC,cAAc,GAAG,iCAAiC,GAAG,GAAG,CAAC,CAAC;QAC5E,KAAK,QAAQ,CAAC;QACd,KAAK,MAAM;YACT,OAAO,GAAG,CAAC;QACb;YACE,OAAO,GAAG,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ANSI color utilities for CLI output.
|
|
3
|
+
* Uses 24-bit true color (brand palette) when supported, falls back to standard ANSI.
|
|
4
|
+
* Respects NO_COLOR env var (https://no-color.org/) and non-TTY stderr.
|
|
5
|
+
*
|
|
6
|
+
* Brand colors from usepaso.dev/brand tokens.css:
|
|
7
|
+
* success: #4e916a (sage green)
|
|
8
|
+
* error: #c5515c (muted red)
|
|
9
|
+
* warning: #c6813d (amber/rust)
|
|
10
|
+
* info: #86bfcb (teal)
|
|
11
|
+
* muted: #7a7773 (warm gray)
|
|
12
|
+
*/
|
|
13
|
+
export declare const green: (s: string) => string;
|
|
14
|
+
export declare const red: (s: string) => string;
|
|
15
|
+
export declare const yellow: (s: string) => string;
|
|
16
|
+
export declare const cyan: (s: string) => string;
|
|
17
|
+
export declare const dim: (s: string) => string;
|
|
18
|
+
export declare const bold: (s: string) => string;
|
|
19
|
+
//# sourceMappingURL=color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/utils/color.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAwBH,eAAO,MAAM,KAAK,MAZS,MAAM,WAYqB,CAAC;AAGvD,eAAO,MAAM,GAAG,MAfW,MAAM,WAekB,CAAC;AAGpD,eAAO,MAAM,MAAM,MAlBQ,MAAM,WAkBsB,CAAC;AAGxD,eAAO,MAAM,IAAI,MArBU,MAAM,WAqBqB,CAAC;AAGvD,eAAO,MAAM,GAAG,MAxBW,MAAM,WAwBmB,CAAC;AAErD,eAAO,MAAM,IAAI,MAnBU,MAAM,WAmBF,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ANSI color utilities for CLI output.
|
|
4
|
+
* Uses 24-bit true color (brand palette) when supported, falls back to standard ANSI.
|
|
5
|
+
* Respects NO_COLOR env var (https://no-color.org/) and non-TTY stderr.
|
|
6
|
+
*
|
|
7
|
+
* Brand colors from usepaso.dev/brand tokens.css:
|
|
8
|
+
* success: #4e916a (sage green)
|
|
9
|
+
* error: #c5515c (muted red)
|
|
10
|
+
* warning: #c6813d (amber/rust)
|
|
11
|
+
* info: #86bfcb (teal)
|
|
12
|
+
* muted: #7a7773 (warm gray)
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.bold = exports.dim = exports.cyan = exports.yellow = exports.red = exports.green = void 0;
|
|
16
|
+
const enabled = !process.env.NO_COLOR && process.stderr.isTTY !== false;
|
|
17
|
+
const trueColor = enabled &&
|
|
18
|
+
(process.env.COLORTERM === 'truecolor' ||
|
|
19
|
+
process.env.COLORTERM === '24bit' ||
|
|
20
|
+
process.env.TERM_PROGRAM === 'iTerm.app' ||
|
|
21
|
+
process.env.TERM_PROGRAM === 'vscode');
|
|
22
|
+
function rgb(r, g, b) {
|
|
23
|
+
if (!enabled)
|
|
24
|
+
return (s) => s;
|
|
25
|
+
if (trueColor)
|
|
26
|
+
return (s) => `\x1b[38;2;${r};${g};${b}m${s}\x1b[39m`;
|
|
27
|
+
// Fall through to caller's ANSI fallback
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
function ansi(open, close) {
|
|
31
|
+
if (!enabled)
|
|
32
|
+
return (s) => s;
|
|
33
|
+
return (s) => `\x1b[${open}m${s}\x1b[${close}m`;
|
|
34
|
+
}
|
|
35
|
+
// Brand: --color-success #4e916a
|
|
36
|
+
exports.green = rgb(78, 145, 106) ?? ansi(32, 39);
|
|
37
|
+
// Brand: --color-error #c5515c
|
|
38
|
+
exports.red = rgb(197, 81, 92) ?? ansi(31, 39);
|
|
39
|
+
// Brand: --color-warning #c6813d
|
|
40
|
+
exports.yellow = rgb(198, 129, 61) ?? ansi(33, 39);
|
|
41
|
+
// Brand: --teal-bright #86bfcb
|
|
42
|
+
exports.cyan = rgb(134, 191, 203) ?? ansi(36, 39);
|
|
43
|
+
// Brand: --dark-text-muted #7a7773
|
|
44
|
+
exports.dim = rgb(122, 119, 115) ?? ansi(2, 22);
|
|
45
|
+
exports.bold = ansi(1, 22);
|
|
46
|
+
//# sourceM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EAAE,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAEpD,iCAAiC;AACpB,QAAA,MAAM,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAExD,+BAA+B;AAClB,QAAA,IAAI,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;AAEvD,mCAAmC;AACtB,QAAA,GAAG,GAAG,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAExC,QAAA,IAAI,GAAG,IAAI,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.d.ts","sourceRoot":"","sources":["../../src/utils/redact.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAgBH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAc7C"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Redact sensitive query parameter values from URLs for safe logging.
|
|
4
|
+
* Matches common parameter names used for authentication.
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.redactUrl = redactUrl;
|
|
8
|
+
const SENSITIVE_PARAMS = new Set([
|
|
9
|
+
'api_key',
|
|
10
|
+
'apikey',
|
|
11
|
+
'api-key',
|
|
12
|
+
'token',
|
|
13
|
+
'access_token',
|
|
14
|
+
'auth_token',
|
|
15
|
+
'secret',
|
|
16
|
+
'client_secret',
|
|
17
|
+
'password',
|
|
18
|
+
'passwd',
|
|
19
|
+
'key',
|
|
20
|
+
]);
|
|
21
|
+
function redactUrl(url) {
|
|
22
|
+
try {
|
|
23
|
+
const parsed = new URL(url);
|
|
24
|
+
let redacted = false;
|
|
25
|
+
for (const [key] of parsed.searchParams) {
|
|
26
|
+
if (SENSITIVE_PARAMS.has(key.toLowerCase())) {
|
|
27
|
+
parsed.searchParams.set(key, '***');
|
|
28
|
+
redacted = true;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return redacted ? parsed.toString() : url;
|
|
32
|
+
}
|
|
33
|
+
catch {
|
|
34
|
+
return url;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=redact.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redact.js","sourceRoot":"","sources":["../../src/utils/redact.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAgBH,8BAcC;AA5BD,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC;IAC/B,SAAS;IACT,QAAQ;IACR,SAAS;IACT,OAAO;IACP,cAAc;IACd,YAAY;IACZ,QAAQ;IACR,eAAe;IACf,UAAU;IACV,QAAQ;IACR,KAAK;CACN,CAAC,CAAC;AAEH,SAAgB,SAAS,CAAC,GAAW;IACnC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,QAAQ,GAAG,KAAK,CAAC;QACrB,KAAK,MAAM,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACxC,IAAI,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,EAAE,CAAC;gBAC5C,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;gBACpC,QAAQ,GAAG,IAAI,CAAC;YAClB,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IAC5C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "usepaso",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Make your API agent-ready in minutes. One declaration, every protocol.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -24,11 +24,7 @@
|
|
|
24
24
|
"dev": "tsc --watch",
|
|
25
25
|
"lint": "eslint src/",
|
|
26
26
|
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
|
|
27
|
-
"format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\""
|
|
28
|
-
"prepare": "cd ../.. && husky packages/paso-js/.husky"
|
|
29
|
-
},
|
|
30
|
-
"lint-staged": {
|
|
31
|
-
"*.ts": ["eslint --fix", "prettier --write"]
|
|
27
|
+
"format:check": "prettier --check \"src/**/*.ts\" \"tests/**/*.ts\""
|
|
32
28
|
},
|
|
33
29
|
"keywords": [
|
|
34
30
|
"ai",
|
|
@@ -51,13 +47,9 @@
|
|
|
51
47
|
"yaml": "^2.7.1"
|
|
52
48
|
},
|
|
53
49
|
"devDependencies": {
|
|
54
|
-
"@commitlint/cli": "^20.5.0",
|
|
55
|
-
"@commitlint/config-conventional": "^20.5.0",
|
|
56
50
|
"@eslint/js": "^10.0.1",
|
|
57
51
|
"@types/node": "^22.15.3",
|
|
58
52
|
"eslint": "^10.1.0",
|
|
59
|
-
"husky": "^9.1.7",
|
|
60
|
-
"lint-staged": "^16.4.0",
|
|
61
53
|
"prettier": "^3.8.1",
|
|
62
54
|
"typescript": "^5.8.3",
|
|
63
55
|
"typescript-eslint": "^8.57.2",
|