noisegate-hermes 0.1.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 +31 -0
- package/bin/noisegate-hermes-installer.js +56 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# noisegate on npm
|
|
2
|
+
|
|
3
|
+
This npm package is only a thin installer wrapper for the Python package [`noisegate-hermes`](https://github.com/Tosko4/noisegate).
|
|
4
|
+
|
|
5
|
+
Noisegate itself is a Python Hermes Agent plugin and CLI. The Python package is canonical.
|
|
6
|
+
|
|
7
|
+
## Install Noisegate for Hermes
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx noisegate install-hermes
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
If your npm client does not resolve the single-bin shortcut, use the explicit bin name:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx -p noisegate noisegate-hermes-installer install-hermes
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The wrapper delegates to:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
uvx --from noisegate-hermes==<this npm package version> noisegate install-hermes
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Security posture
|
|
26
|
+
|
|
27
|
+
- No `postinstall` scripts.
|
|
28
|
+
- No bundled Python implementation.
|
|
29
|
+
- No long-lived npm token is required when published through npm trusted publishing.
|
|
30
|
+
- Publish provenance should be enabled in CI.
|
|
31
|
+
- The package exists to reserve the public `noisegate` npm name and provide a safe install entrypoint.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
|
|
7
|
+
const args = process.argv.slice(2);
|
|
8
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
const packageJson = JSON.parse(readFileSync(join(here, '..', 'package.json'), 'utf8'));
|
|
10
|
+
const pythonPackageSpec = `noisegate-hermes==${packageJson.version}`;
|
|
11
|
+
|
|
12
|
+
function help() {
|
|
13
|
+
console.log(`Noisegate npm installer wrapper
|
|
14
|
+
|
|
15
|
+
This npm package is a thin installer for the Python package noisegate-hermes.
|
|
16
|
+
The Python package remains the canonical Noisegate implementation.
|
|
17
|
+
|
|
18
|
+
Usage:
|
|
19
|
+
npx noisegate install-hermes [--dry-run] [noisegate install-hermes options]
|
|
20
|
+
npx -p noisegate noisegate-hermes-installer install-hermes [options]
|
|
21
|
+
|
|
22
|
+
Security model:
|
|
23
|
+
- no postinstall scripts
|
|
24
|
+
- no bundled Python code
|
|
25
|
+
- delegates to: uvx --from ${pythonPackageSpec} noisegate install-hermes ...
|
|
26
|
+
`);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (args.length === 0 || args[0] === '--help' || args[0] === '-h') {
|
|
30
|
+
help();
|
|
31
|
+
process.exit(0);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (args[0] !== 'install-hermes') {
|
|
35
|
+
console.error('noisegate npm wrapper only supports: install-hermes');
|
|
36
|
+
console.error('For the full CLI, install the Python package: noisegate-hermes');
|
|
37
|
+
process.exit(2);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const uvx = process.env.NOISEGATE_UVX || 'uvx';
|
|
41
|
+
const result = spawnSync(
|
|
42
|
+
uvx,
|
|
43
|
+
['--from', pythonPackageSpec, 'noisegate', 'install-hermes', ...args.slice(1)],
|
|
44
|
+
{ stdio: 'inherit' },
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
if (result.error) {
|
|
48
|
+
if (result.error.code === 'ENOENT') {
|
|
49
|
+
console.error('uvx was not found. Install uv first: https://docs.astral.sh/uv/');
|
|
50
|
+
} else {
|
|
51
|
+
console.error(`failed to run uvx: ${result.error.message}`);
|
|
52
|
+
}
|
|
53
|
+
process.exit(127);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
process.exit(result.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "noisegate-hermes",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Thin npm installer wrapper for the Noisegate Hermes Agent plugin and CLI.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"noisegate": "bin/noisegate-hermes-installer.js",
|
|
9
|
+
"noisegate-hermes-installer": "bin/noisegate-hermes-installer.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"bin/",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/Tosko4/noisegate.git",
|
|
18
|
+
"directory": "npm/noisegate"
|
|
19
|
+
},
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/Tosko4/noisegate/issues"
|
|
22
|
+
},
|
|
23
|
+
"homepage": "https://github.com/Tosko4/noisegate#readme",
|
|
24
|
+
"keywords": [
|
|
25
|
+
"hermes-agent",
|
|
26
|
+
"noisegate",
|
|
27
|
+
"installer",
|
|
28
|
+
"cli",
|
|
29
|
+
"agent"
|
|
30
|
+
],
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
},
|
|
34
|
+
"scripts": {
|
|
35
|
+
"test": "node --check bin/noisegate-hermes-installer.js && node --check test-wrapper.js && node test-wrapper.js"
|
|
36
|
+
},
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": ">=18"
|
|
39
|
+
}
|
|
40
|
+
}
|