@solongate/proxy 0.83.56 → 0.83.57
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/dist/commands/index.js +154 -71
- package/dist/global-install.d.ts +28 -0
- package/dist/global-install.js +344 -129
- package/dist/hook-health.d.ts +26 -0
- package/dist/hook-launcher.d.ts +57 -0
- package/dist/index.js +506 -251
- package/dist/tui/index.js +417 -166
- package/hooks/opencode-plugin.mjs +21 -1
- package/package.json +7 -7
|
@@ -48,6 +48,25 @@ const AUDIT = join(HOOKS_DIR, 'audit.mjs');
|
|
|
48
48
|
const NODE_BAKED = '__SOLONGATE_NODE__';
|
|
49
49
|
const NODE = NODE_BAKED.startsWith('__SOLONGATE') || !existsSync(NODE_BAKED) ? 'node' : NODE_BAKED;
|
|
50
50
|
|
|
51
|
+
// On POSIX the spawn goes through the shared launcher instead, which resolves
|
|
52
|
+
// node at RUN time and leaves the beat every other client leaves.
|
|
53
|
+
//
|
|
54
|
+
// The baked path above is `process.execPath` from the install, and on a Mac
|
|
55
|
+
// that is a Homebrew Cellar path or an nvm version directory — both deleted by
|
|
56
|
+
// a routine upgrade. The `'node'` fallback then needs PATH to have one, which
|
|
57
|
+
// is exactly the assumption that does not hold inside a hook environment. The
|
|
58
|
+
// launcher tries the baked path first, then PATH, then everywhere a Mac keeps a
|
|
59
|
+
// node.
|
|
60
|
+
const LAUNCHER = join(HOOKS_DIR, 'sg-run.sh');
|
|
61
|
+
const USE_LAUNCHER = process.platform !== 'win32' && existsSync(LAUNCHER);
|
|
62
|
+
|
|
63
|
+
/** The argv for one hook run: through the launcher when there is one. */
|
|
64
|
+
function spawnArgs(script) {
|
|
65
|
+
return USE_LAUNCHER
|
|
66
|
+
? ['/bin/sh', [LAUNCHER, script, 'opencode', 'OpenCode']]
|
|
67
|
+
: [NODE, [script, 'opencode', 'OpenCode']];
|
|
68
|
+
}
|
|
69
|
+
|
|
51
70
|
// The guard carries its own 8s backstop; this is the outer bound for the whole
|
|
52
71
|
// round trip so a wedged process can never hang the editor.
|
|
53
72
|
const GUARD_TIMEOUT_MS = 15000;
|
|
@@ -63,7 +82,8 @@ function runHook(script, payload, timeoutMs) {
|
|
|
63
82
|
const finish = (v) => { if (!done) { done = true; resolve(v); } };
|
|
64
83
|
let child;
|
|
65
84
|
try {
|
|
66
|
-
|
|
85
|
+
const [bin, argv] = spawnArgs(script);
|
|
86
|
+
child = spawn(bin, argv, {
|
|
67
87
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
68
88
|
windowsHide: true,
|
|
69
89
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solongate/proxy",
|
|
3
|
-
"version": "0.83.
|
|
3
|
+
"version": "0.83.57",
|
|
4
4
|
"description": "AI tool security proxy: protect any AI tool server with customizable policies, path/command constraints, rate limiting, and audit logging. No code changes required.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -61,12 +61,12 @@
|
|
|
61
61
|
"node": ">=20.0.0"
|
|
62
62
|
},
|
|
63
63
|
"optionalDependencies": {
|
|
64
|
-
"@solongate/guard-linux-x64": "0.83.
|
|
65
|
-
"@solongate/guard-linux-arm64": "0.83.
|
|
66
|
-
"@solongate/guard-darwin-x64": "0.83.
|
|
67
|
-
"@solongate/guard-darwin-arm64": "0.83.
|
|
68
|
-
"@solongate/guard-win32-x64": "0.83.
|
|
69
|
-
"@solongate/guard-win32-arm64": "0.83.
|
|
64
|
+
"@solongate/guard-linux-x64": "0.83.57",
|
|
65
|
+
"@solongate/guard-linux-arm64": "0.83.57",
|
|
66
|
+
"@solongate/guard-darwin-x64": "0.83.57",
|
|
67
|
+
"@solongate/guard-darwin-arm64": "0.83.57",
|
|
68
|
+
"@solongate/guard-win32-x64": "0.83.57",
|
|
69
|
+
"@solongate/guard-win32-arm64": "0.83.57"
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
72
|
"@modelcontextprotocol/sdk": "^1.26.0",
|