pkg-gate 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/bin/cli.js +3 -0
- package/package.json +9 -1
package/README.md
CHANGED
|
@@ -4,6 +4,7 @@ Pre-install security gate for npm lifecycle scripts using TypeSafe System One.
|
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npm install pkg-gate
|
|
7
|
+
export TYPESAFE_API_KEY="ts_..." # get a key at typesafe.ai
|
|
7
8
|
```
|
|
8
9
|
|
|
9
10
|
## Quick start
|
|
@@ -21,7 +22,7 @@ if (!report.isSafe()) {
|
|
|
21
22
|
console.log(report.inspect());
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
`pkgGate()` evaluates a package or script against TypeSafe System One. `report.isSafe()` returns a boolean verdict. `report.inspect()` renders the TUI card.
|
|
25
|
+
`pkgGate()` evaluates a package or script against TypeSafe System One. `report.isSafe()` returns a boolean verdict. `report.inspect()` renders the TUI card. Without `TYPESAFE_API_KEY`, it falls back to an offline calibrated simulator.
|
|
25
26
|
|
|
26
27
|
## Check local package
|
|
27
28
|
|
package/bin/cli.js
CHANGED
|
@@ -9,6 +9,7 @@ const helpText = `
|
|
|
9
9
|
$ pkg-gate [package-name | path | script]
|
|
10
10
|
|
|
11
11
|
Options
|
|
12
|
+
--api-key, -k TypeSafe API key (or set TYPESAFE_API_KEY env var)
|
|
12
13
|
--script, -s Evaluate a raw shell command string
|
|
13
14
|
--json Output strictly typed structured JSON
|
|
14
15
|
--plain Output plain text summary (no TUI boxes)
|
|
@@ -36,6 +37,7 @@ async function main() {
|
|
|
36
37
|
plain: { type: 'boolean' },
|
|
37
38
|
mock: { type: 'boolean' },
|
|
38
39
|
yes: { type: 'boolean', short: 'y' },
|
|
40
|
+
'api-key': { type: 'string', short: 'k' },
|
|
39
41
|
'block-score': { type: 'string' },
|
|
40
42
|
'warn-score': { type: 'string' },
|
|
41
43
|
};
|
|
@@ -86,6 +88,7 @@ async function main() {
|
|
|
86
88
|
|
|
87
89
|
try {
|
|
88
90
|
const report = await pkgGate(target, {
|
|
91
|
+
apiKey: args.values['api-key'] || process.env.TYPESAFE_API_KEY,
|
|
89
92
|
script: args.values.script,
|
|
90
93
|
mock: args.values.mock,
|
|
91
94
|
blockScore: args.values['block-score'] ? parseFloat(args.values['block-score']) : undefined,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pkg-gate",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Pre-install security gate for npm lifecycle scripts using TypeSafe System One.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.js",
|
|
@@ -36,6 +36,14 @@
|
|
|
36
36
|
],
|
|
37
37
|
"author": "Hemanth HM <hemanth@h3manth.com> (https://h3manth.com)",
|
|
38
38
|
"license": "MIT",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/hemanth/pkg-gate.git"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/hemanth/pkg-gate/issues"
|
|
45
|
+
},
|
|
46
|
+
"homepage": "https://github.com/hemanth/pkg-gate#readme",
|
|
39
47
|
"dependencies": {
|
|
40
48
|
"@typesafe-ai/sdk": "^0.6.0"
|
|
41
49
|
}
|