@node9/proxy 2.19.0 → 2.19.2
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/cli.js +16 -4
- package/dist/cli.mjs +16 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -11285,11 +11285,15 @@ function printInlineAskNotice() {
|
|
|
11285
11285
|
)
|
|
11286
11286
|
);
|
|
11287
11287
|
}
|
|
11288
|
-
function fullPathCommand(subcommand) {
|
|
11288
|
+
function fullPathCommand(subcommand, platform = process.platform) {
|
|
11289
11289
|
if (process.env.NODE9_TESTING === "1") return `node9 ${subcommand}`;
|
|
11290
11290
|
const nodeExec = toForwardSlashes(process.execPath);
|
|
11291
11291
|
const cliScript = toForwardSlashes(process.argv[1]);
|
|
11292
|
-
|
|
11292
|
+
const isWindows = platform === "win32";
|
|
11293
|
+
if (!cliScript.endsWith(".js")) {
|
|
11294
|
+
return isWindows ? `node9 ${subcommand}` : `"${cliScript}" ${subcommand}`;
|
|
11295
|
+
}
|
|
11296
|
+
if (isWindows) return `node "${cliScript}" ${subcommand}`;
|
|
11293
11297
|
return `"${nodeExec}" "${cliScript}" ${subcommand}`;
|
|
11294
11298
|
}
|
|
11295
11299
|
function toForwardSlashes(p) {
|
|
@@ -11316,8 +11320,13 @@ function isLegacyHookFormat(command) {
|
|
|
11316
11320
|
if (!command) return false;
|
|
11317
11321
|
return command.includes("\\");
|
|
11318
11322
|
}
|
|
11319
|
-
function
|
|
11320
|
-
|
|
11323
|
+
function isWindowsQuoteBrokenHook(command, platform = process.platform) {
|
|
11324
|
+
if (!command) return false;
|
|
11325
|
+
if (platform !== "win32") return false;
|
|
11326
|
+
return command.trimStart().startsWith('"');
|
|
11327
|
+
}
|
|
11328
|
+
function needsRewrite(command, platform = process.platform) {
|
|
11329
|
+
return isStaleHookCommand(command) || isLegacyHookFormat(command) || isWindowsQuoteBrokenHook(command, platform);
|
|
11321
11330
|
}
|
|
11322
11331
|
function readJson(filePath) {
|
|
11323
11332
|
try {
|
|
@@ -12278,6 +12287,9 @@ async function setupCodex() {
|
|
|
12278
12287
|
hooks: [{ type: "command", command: fullPathCommand("check"), timeout: 600 }]
|
|
12279
12288
|
});
|
|
12280
12289
|
hooksChanged = true;
|
|
12290
|
+
} else if (!existing.hooks.some((h) => isNode9Hook(h.command ?? ""))) {
|
|
12291
|
+
existing.hooks.push({ type: "command", command: fullPathCommand("check"), timeout: 600 });
|
|
12292
|
+
hooksChanged = true;
|
|
12281
12293
|
} else {
|
|
12282
12294
|
for (const h of existing.hooks) {
|
|
12283
12295
|
const cmd = h.command ?? "";
|
package/dist/cli.mjs
CHANGED
|
@@ -11291,11 +11291,15 @@ function printInlineAskNotice() {
|
|
|
11291
11291
|
)
|
|
11292
11292
|
);
|
|
11293
11293
|
}
|
|
11294
|
-
function fullPathCommand(subcommand) {
|
|
11294
|
+
function fullPathCommand(subcommand, platform = process.platform) {
|
|
11295
11295
|
if (process.env.NODE9_TESTING === "1") return `node9 ${subcommand}`;
|
|
11296
11296
|
const nodeExec = toForwardSlashes(process.execPath);
|
|
11297
11297
|
const cliScript = toForwardSlashes(process.argv[1]);
|
|
11298
|
-
|
|
11298
|
+
const isWindows = platform === "win32";
|
|
11299
|
+
if (!cliScript.endsWith(".js")) {
|
|
11300
|
+
return isWindows ? `node9 ${subcommand}` : `"${cliScript}" ${subcommand}`;
|
|
11301
|
+
}
|
|
11302
|
+
if (isWindows) return `node "${cliScript}" ${subcommand}`;
|
|
11299
11303
|
return `"${nodeExec}" "${cliScript}" ${subcommand}`;
|
|
11300
11304
|
}
|
|
11301
11305
|
function toForwardSlashes(p) {
|
|
@@ -11322,8 +11326,13 @@ function isLegacyHookFormat(command) {
|
|
|
11322
11326
|
if (!command) return false;
|
|
11323
11327
|
return command.includes("\\");
|
|
11324
11328
|
}
|
|
11325
|
-
function
|
|
11326
|
-
|
|
11329
|
+
function isWindowsQuoteBrokenHook(command, platform = process.platform) {
|
|
11330
|
+
if (!command) return false;
|
|
11331
|
+
if (platform !== "win32") return false;
|
|
11332
|
+
return command.trimStart().startsWith('"');
|
|
11333
|
+
}
|
|
11334
|
+
function needsRewrite(command, platform = process.platform) {
|
|
11335
|
+
return isStaleHookCommand(command) || isLegacyHookFormat(command) || isWindowsQuoteBrokenHook(command, platform);
|
|
11327
11336
|
}
|
|
11328
11337
|
function readJson(filePath) {
|
|
11329
11338
|
try {
|
|
@@ -12284,6 +12293,9 @@ async function setupCodex() {
|
|
|
12284
12293
|
hooks: [{ type: "command", command: fullPathCommand("check"), timeout: 600 }]
|
|
12285
12294
|
});
|
|
12286
12295
|
hooksChanged = true;
|
|
12296
|
+
} else if (!existing.hooks.some((h) => isNode9Hook(h.command ?? ""))) {
|
|
12297
|
+
existing.hooks.push({ type: "command", command: fullPathCommand("check"), timeout: 600 });
|
|
12298
|
+
hooksChanged = true;
|
|
12287
12299
|
} else {
|
|
12288
12300
|
for (const h of existing.hooks) {
|
|
12289
12301
|
const cmd = h.command ?? "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node9/proxy",
|
|
3
|
-
"version": "2.19.
|
|
3
|
+
"version": "2.19.2",
|
|
4
4
|
"description": "IAM for your AI agents. Set what Claude Code, Codex, Gemini, Cursor and any MCP server are allowed to do, review risky actions before they run, and keep every action on the record.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|