@node9/proxy 1.0.2 → 1.0.3
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 +1 -1
- package/dist/cli.js +4 -5
- package/dist/cli.mjs +4 -5
- package/dist/index.js +4 -5
- package/dist/index.mjs +4 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ While others try to _guess_ if a prompt is malicious (Semantic Security), Node9
|
|
|
16
16
|
**AIs are literal.** When you ask an agent to "Fix my disk space," it might decide to run `docker system prune -af`.
|
|
17
17
|
|
|
18
18
|
<p align="center">
|
|
19
|
-
<img src="https://github.com/user-attachments/assets/
|
|
19
|
+
<img src="https://github.com/user-attachments/assets/0e45e843-4cf7-408e-95ce-23fb09525ee4" width="100%">
|
|
20
20
|
</p>
|
|
21
21
|
|
|
22
22
|
**With Node9, the interaction looks like this:**
|
package/dist/cli.js
CHANGED
|
@@ -789,8 +789,7 @@ async function authorizeHeadless(toolName, args, allowTerminalFallback = false,
|
|
|
789
789
|
const cloudEnforced = approvers.cloud && !!creds?.apiKey;
|
|
790
790
|
if (cloudEnforced) {
|
|
791
791
|
try {
|
|
792
|
-
const
|
|
793
|
-
const initResult = await initNode9SaaS(toolName, args, creds, envConfig?.slackChannel, meta);
|
|
792
|
+
const initResult = await initNode9SaaS(toolName, args, creds, meta);
|
|
794
793
|
if (!initResult.pending) {
|
|
795
794
|
return {
|
|
796
795
|
approved: !!initResult.approved,
|
|
@@ -1044,6 +1043,7 @@ function getConfig() {
|
|
|
1044
1043
|
if (s.enableHookLogDebug !== void 0)
|
|
1045
1044
|
mergedSettings.enableHookLogDebug = s.enableHookLogDebug;
|
|
1046
1045
|
if (s.approvers) mergedSettings.approvers = { ...mergedSettings.approvers, ...s.approvers };
|
|
1046
|
+
if (s.environment !== void 0) mergedSettings.environment = s.environment;
|
|
1047
1047
|
if (p.sandboxPaths) mergedPolicy.sandboxPaths.push(...p.sandboxPaths);
|
|
1048
1048
|
if (p.ignoredTools) mergedPolicy.ignoredTools.push(...p.ignoredTools);
|
|
1049
1049
|
if (p.dangerousWords) mergedPolicy.dangerousWords = [...p.dangerousWords];
|
|
@@ -1073,7 +1073,7 @@ function tryLoadConfig(filePath) {
|
|
|
1073
1073
|
}
|
|
1074
1074
|
}
|
|
1075
1075
|
function getActiveEnvironment(config) {
|
|
1076
|
-
const env = process.env.NODE_ENV || "development";
|
|
1076
|
+
const env = config.settings.environment || process.env.NODE_ENV || "development";
|
|
1077
1077
|
return config.environments[env] ?? null;
|
|
1078
1078
|
}
|
|
1079
1079
|
function getCredentials() {
|
|
@@ -1129,7 +1129,7 @@ function auditLocalAllow(toolName, args, checkedBy, creds, meta) {
|
|
|
1129
1129
|
}).catch(() => {
|
|
1130
1130
|
});
|
|
1131
1131
|
}
|
|
1132
|
-
async function initNode9SaaS(toolName, args, creds,
|
|
1132
|
+
async function initNode9SaaS(toolName, args, creds, meta) {
|
|
1133
1133
|
const controller = new AbortController();
|
|
1134
1134
|
const timeout = setTimeout(() => controller.abort(), 1e4);
|
|
1135
1135
|
try {
|
|
@@ -1139,7 +1139,6 @@ async function initNode9SaaS(toolName, args, creds, slackChannel, meta) {
|
|
|
1139
1139
|
body: JSON.stringify({
|
|
1140
1140
|
toolName,
|
|
1141
1141
|
args,
|
|
1142
|
-
slackChannel,
|
|
1143
1142
|
context: {
|
|
1144
1143
|
agent: meta?.agent,
|
|
1145
1144
|
mcpServer: meta?.mcpServer,
|
package/dist/cli.mjs
CHANGED
|
@@ -766,8 +766,7 @@ async function authorizeHeadless(toolName, args, allowTerminalFallback = false,
|
|
|
766
766
|
const cloudEnforced = approvers.cloud && !!creds?.apiKey;
|
|
767
767
|
if (cloudEnforced) {
|
|
768
768
|
try {
|
|
769
|
-
const
|
|
770
|
-
const initResult = await initNode9SaaS(toolName, args, creds, envConfig?.slackChannel, meta);
|
|
769
|
+
const initResult = await initNode9SaaS(toolName, args, creds, meta);
|
|
771
770
|
if (!initResult.pending) {
|
|
772
771
|
return {
|
|
773
772
|
approved: !!initResult.approved,
|
|
@@ -1021,6 +1020,7 @@ function getConfig() {
|
|
|
1021
1020
|
if (s.enableHookLogDebug !== void 0)
|
|
1022
1021
|
mergedSettings.enableHookLogDebug = s.enableHookLogDebug;
|
|
1023
1022
|
if (s.approvers) mergedSettings.approvers = { ...mergedSettings.approvers, ...s.approvers };
|
|
1023
|
+
if (s.environment !== void 0) mergedSettings.environment = s.environment;
|
|
1024
1024
|
if (p.sandboxPaths) mergedPolicy.sandboxPaths.push(...p.sandboxPaths);
|
|
1025
1025
|
if (p.ignoredTools) mergedPolicy.ignoredTools.push(...p.ignoredTools);
|
|
1026
1026
|
if (p.dangerousWords) mergedPolicy.dangerousWords = [...p.dangerousWords];
|
|
@@ -1050,7 +1050,7 @@ function tryLoadConfig(filePath) {
|
|
|
1050
1050
|
}
|
|
1051
1051
|
}
|
|
1052
1052
|
function getActiveEnvironment(config) {
|
|
1053
|
-
const env = process.env.NODE_ENV || "development";
|
|
1053
|
+
const env = config.settings.environment || process.env.NODE_ENV || "development";
|
|
1054
1054
|
return config.environments[env] ?? null;
|
|
1055
1055
|
}
|
|
1056
1056
|
function getCredentials() {
|
|
@@ -1106,7 +1106,7 @@ function auditLocalAllow(toolName, args, checkedBy, creds, meta) {
|
|
|
1106
1106
|
}).catch(() => {
|
|
1107
1107
|
});
|
|
1108
1108
|
}
|
|
1109
|
-
async function initNode9SaaS(toolName, args, creds,
|
|
1109
|
+
async function initNode9SaaS(toolName, args, creds, meta) {
|
|
1110
1110
|
const controller = new AbortController();
|
|
1111
1111
|
const timeout = setTimeout(() => controller.abort(), 1e4);
|
|
1112
1112
|
try {
|
|
@@ -1116,7 +1116,6 @@ async function initNode9SaaS(toolName, args, creds, slackChannel, meta) {
|
|
|
1116
1116
|
body: JSON.stringify({
|
|
1117
1117
|
toolName,
|
|
1118
1118
|
args,
|
|
1119
|
-
slackChannel,
|
|
1120
1119
|
context: {
|
|
1121
1120
|
agent: meta?.agent,
|
|
1122
1121
|
mcpServer: meta?.mcpServer,
|
package/dist/index.js
CHANGED
|
@@ -760,8 +760,7 @@ async function authorizeHeadless(toolName, args, allowTerminalFallback = false,
|
|
|
760
760
|
const cloudEnforced = approvers.cloud && !!creds?.apiKey;
|
|
761
761
|
if (cloudEnforced) {
|
|
762
762
|
try {
|
|
763
|
-
const
|
|
764
|
-
const initResult = await initNode9SaaS(toolName, args, creds, envConfig?.slackChannel, meta);
|
|
763
|
+
const initResult = await initNode9SaaS(toolName, args, creds, meta);
|
|
765
764
|
if (!initResult.pending) {
|
|
766
765
|
return {
|
|
767
766
|
approved: !!initResult.approved,
|
|
@@ -1015,6 +1014,7 @@ function getConfig() {
|
|
|
1015
1014
|
if (s.enableHookLogDebug !== void 0)
|
|
1016
1015
|
mergedSettings.enableHookLogDebug = s.enableHookLogDebug;
|
|
1017
1016
|
if (s.approvers) mergedSettings.approvers = { ...mergedSettings.approvers, ...s.approvers };
|
|
1017
|
+
if (s.environment !== void 0) mergedSettings.environment = s.environment;
|
|
1018
1018
|
if (p.sandboxPaths) mergedPolicy.sandboxPaths.push(...p.sandboxPaths);
|
|
1019
1019
|
if (p.ignoredTools) mergedPolicy.ignoredTools.push(...p.ignoredTools);
|
|
1020
1020
|
if (p.dangerousWords) mergedPolicy.dangerousWords = [...p.dangerousWords];
|
|
@@ -1044,7 +1044,7 @@ function tryLoadConfig(filePath) {
|
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
1046
|
function getActiveEnvironment(config) {
|
|
1047
|
-
const env = process.env.NODE_ENV || "development";
|
|
1047
|
+
const env = config.settings.environment || process.env.NODE_ENV || "development";
|
|
1048
1048
|
return config.environments[env] ?? null;
|
|
1049
1049
|
}
|
|
1050
1050
|
function getCredentials() {
|
|
@@ -1104,7 +1104,7 @@ function auditLocalAllow(toolName, args, checkedBy, creds, meta) {
|
|
|
1104
1104
|
}).catch(() => {
|
|
1105
1105
|
});
|
|
1106
1106
|
}
|
|
1107
|
-
async function initNode9SaaS(toolName, args, creds,
|
|
1107
|
+
async function initNode9SaaS(toolName, args, creds, meta) {
|
|
1108
1108
|
const controller = new AbortController();
|
|
1109
1109
|
const timeout = setTimeout(() => controller.abort(), 1e4);
|
|
1110
1110
|
try {
|
|
@@ -1114,7 +1114,6 @@ async function initNode9SaaS(toolName, args, creds, slackChannel, meta) {
|
|
|
1114
1114
|
body: JSON.stringify({
|
|
1115
1115
|
toolName,
|
|
1116
1116
|
args,
|
|
1117
|
-
slackChannel,
|
|
1118
1117
|
context: {
|
|
1119
1118
|
agent: meta?.agent,
|
|
1120
1119
|
mcpServer: meta?.mcpServer,
|
package/dist/index.mjs
CHANGED
|
@@ -724,8 +724,7 @@ async function authorizeHeadless(toolName, args, allowTerminalFallback = false,
|
|
|
724
724
|
const cloudEnforced = approvers.cloud && !!creds?.apiKey;
|
|
725
725
|
if (cloudEnforced) {
|
|
726
726
|
try {
|
|
727
|
-
const
|
|
728
|
-
const initResult = await initNode9SaaS(toolName, args, creds, envConfig?.slackChannel, meta);
|
|
727
|
+
const initResult = await initNode9SaaS(toolName, args, creds, meta);
|
|
729
728
|
if (!initResult.pending) {
|
|
730
729
|
return {
|
|
731
730
|
approved: !!initResult.approved,
|
|
@@ -979,6 +978,7 @@ function getConfig() {
|
|
|
979
978
|
if (s.enableHookLogDebug !== void 0)
|
|
980
979
|
mergedSettings.enableHookLogDebug = s.enableHookLogDebug;
|
|
981
980
|
if (s.approvers) mergedSettings.approvers = { ...mergedSettings.approvers, ...s.approvers };
|
|
981
|
+
if (s.environment !== void 0) mergedSettings.environment = s.environment;
|
|
982
982
|
if (p.sandboxPaths) mergedPolicy.sandboxPaths.push(...p.sandboxPaths);
|
|
983
983
|
if (p.ignoredTools) mergedPolicy.ignoredTools.push(...p.ignoredTools);
|
|
984
984
|
if (p.dangerousWords) mergedPolicy.dangerousWords = [...p.dangerousWords];
|
|
@@ -1008,7 +1008,7 @@ function tryLoadConfig(filePath) {
|
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
1010
|
function getActiveEnvironment(config) {
|
|
1011
|
-
const env = process.env.NODE_ENV || "development";
|
|
1011
|
+
const env = config.settings.environment || process.env.NODE_ENV || "development";
|
|
1012
1012
|
return config.environments[env] ?? null;
|
|
1013
1013
|
}
|
|
1014
1014
|
function getCredentials() {
|
|
@@ -1068,7 +1068,7 @@ function auditLocalAllow(toolName, args, checkedBy, creds, meta) {
|
|
|
1068
1068
|
}).catch(() => {
|
|
1069
1069
|
});
|
|
1070
1070
|
}
|
|
1071
|
-
async function initNode9SaaS(toolName, args, creds,
|
|
1071
|
+
async function initNode9SaaS(toolName, args, creds, meta) {
|
|
1072
1072
|
const controller = new AbortController();
|
|
1073
1073
|
const timeout = setTimeout(() => controller.abort(), 1e4);
|
|
1074
1074
|
try {
|
|
@@ -1078,7 +1078,6 @@ async function initNode9SaaS(toolName, args, creds, slackChannel, meta) {
|
|
|
1078
1078
|
body: JSON.stringify({
|
|
1079
1079
|
toolName,
|
|
1080
1080
|
args,
|
|
1081
|
-
slackChannel,
|
|
1082
1081
|
context: {
|
|
1083
1082
|
agent: meta?.agent,
|
|
1084
1083
|
mcpServer: meta?.mcpServer,
|