@node9/proxy 1.42.0 → 1.43.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/dist/cli.js +53 -2
- package/dist/cli.mjs +53 -2
- package/dist/dashboard.mjs +4 -0
- package/dist/index.js +5 -0
- package/dist/index.mjs +5 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -298,6 +298,10 @@ var init_config_schema = __esm({
|
|
|
298
298
|
// node9's own approver (terminal/native/cloud). Unset → smart default
|
|
299
299
|
// (ask for ask-capable agents unless a cloud approver is configured).
|
|
300
300
|
reviewChannel: import_zod.z.enum(["ask", "approver"]).optional(),
|
|
301
|
+
// When true, agents may call WEAKENING node9 MCP tools (shield_disable,
|
|
302
|
+
// approver_set). Default (unset/false): those tools refuse over MCP — a human
|
|
303
|
+
// must run them from the CLI. node9's threat model is the agent itself.
|
|
304
|
+
mcpAllowWeakening: import_zod.z.boolean().optional(),
|
|
301
305
|
cloudSyncIntervalHours: import_zod.z.number().positive().optional(),
|
|
302
306
|
// Outbox shipper (audit.log → SaaS batch ingest). enabled defaults
|
|
303
307
|
// to true; set false to fall back to local-only auditing.
|
|
@@ -4203,6 +4207,7 @@ function getConfig(cwd) {
|
|
|
4203
4207
|
mergedSettings.approvalTimeoutMs = s.approvalTimeoutSeconds * 1e3;
|
|
4204
4208
|
if (s.environment !== void 0) mergedSettings.environment = s.environment;
|
|
4205
4209
|
if (s.reviewChannel !== void 0) mergedSettings.reviewChannel = s.reviewChannel;
|
|
4210
|
+
if (s.mcpAllowWeakening !== void 0) mergedSettings.mcpAllowWeakening = s.mcpAllowWeakening;
|
|
4206
4211
|
if (s.cloudSyncIntervalHours !== void 0)
|
|
4207
4212
|
mergedSettings.cloudSyncIntervalHours = s.cloudSyncIntervalHours;
|
|
4208
4213
|
if (s.hud !== void 0) mergedSettings.hud = { ...mergedSettings.hud, ...s.hud };
|
|
@@ -23244,6 +23249,34 @@ function ok(id, result) {
|
|
|
23244
23249
|
function err(id, code, message) {
|
|
23245
23250
|
return JSON.stringify({ jsonrpc: "2.0", id: id ?? null, error: { code, message } });
|
|
23246
23251
|
}
|
|
23252
|
+
var TOOL_CAPABILITY = {
|
|
23253
|
+
// weaken — gated over MCP
|
|
23254
|
+
node9_shield_disable: "weaken",
|
|
23255
|
+
node9_approver_set: "weaken",
|
|
23256
|
+
// add / restorative — always allowed
|
|
23257
|
+
node9_shield_enable: "add",
|
|
23258
|
+
node9_rule_add: "add",
|
|
23259
|
+
// already block/review-only — handleRuleAdd rejects "allow"
|
|
23260
|
+
node9_undo_revert: "add",
|
|
23261
|
+
// restorative
|
|
23262
|
+
// readonly
|
|
23263
|
+
node9_status: "readonly",
|
|
23264
|
+
node9_config_get: "readonly",
|
|
23265
|
+
node9_policy_get: "readonly",
|
|
23266
|
+
node9_audit_get: "readonly",
|
|
23267
|
+
node9_session: "readonly",
|
|
23268
|
+
node9_scan: "readonly",
|
|
23269
|
+
node9_report: "readonly",
|
|
23270
|
+
node9_posture: "readonly",
|
|
23271
|
+
node9_explain: "readonly",
|
|
23272
|
+
node9_shield_list: "readonly",
|
|
23273
|
+
node9_approver_list: "readonly",
|
|
23274
|
+
node9_undo_list: "readonly",
|
|
23275
|
+
node9_undo_detail: "readonly"
|
|
23276
|
+
};
|
|
23277
|
+
function capabilityOf(tool) {
|
|
23278
|
+
return TOOL_CAPABILITY[tool] ?? "readonly";
|
|
23279
|
+
}
|
|
23247
23280
|
var TOOLS = [
|
|
23248
23281
|
{
|
|
23249
23282
|
name: "node9_status",
|
|
@@ -23276,7 +23309,7 @@ var TOOLS = [
|
|
|
23276
23309
|
},
|
|
23277
23310
|
{
|
|
23278
23311
|
name: "node9_shield_disable",
|
|
23279
|
-
description:
|
|
23312
|
+
description: 'Disable a node9 shield. WEAKENING action \u2014 refused over MCP by default (a human must run "node9 shield disable <name>" from the CLI). Use node9_shield_list to see active shields.',
|
|
23280
23313
|
inputSchema: {
|
|
23281
23314
|
type: "object",
|
|
23282
23315
|
properties: {
|
|
@@ -23295,7 +23328,7 @@ var TOOLS = [
|
|
|
23295
23328
|
},
|
|
23296
23329
|
{
|
|
23297
23330
|
name: "node9_approver_set",
|
|
23298
|
-
description: "Enable or disable a specific node9 approver channel in the global config (~/.node9/config.json). Use this to turn individual channels on or off without touching other settings. Channels: native, browser, cloud, terminal. WARNING: disabling all approvers means node9 cannot prompt for human approval \u2014 use with care.",
|
|
23331
|
+
description: "Enable or disable a specific node9 approver channel in the global config (~/.node9/config.json). Use this to turn individual channels on or off without touching other settings. Channels: native, browser, cloud, terminal. WEAKENING action \u2014 refused over MCP by default (a human must run it from the CLI). WARNING: disabling all approvers means node9 cannot prompt for human approval \u2014 use with care.",
|
|
23299
23332
|
inputSchema: {
|
|
23300
23333
|
type: "object",
|
|
23301
23334
|
properties: {
|
|
@@ -23878,6 +23911,24 @@ function runMcpServer() {
|
|
|
23878
23911
|
const p = params ?? {};
|
|
23879
23912
|
const toolName = p.name;
|
|
23880
23913
|
const toolArgs = p.arguments ?? {};
|
|
23914
|
+
if (capabilityOf(toolName ?? "") === "weaken") {
|
|
23915
|
+
let allowed = false;
|
|
23916
|
+
try {
|
|
23917
|
+
allowed = getConfig().settings.mcpAllowWeakening === true;
|
|
23918
|
+
} catch {
|
|
23919
|
+
allowed = false;
|
|
23920
|
+
}
|
|
23921
|
+
if (!allowed) {
|
|
23922
|
+
process.stdout.write(
|
|
23923
|
+
err(
|
|
23924
|
+
id,
|
|
23925
|
+
-32e3,
|
|
23926
|
+
`${toolName} weakens node9 and is disabled over MCP. A human must run it from the CLI (e.g. "node9 shield disable <name>"), or set "mcpAllowWeakening": true in ~/.node9/config.json to allow agent-driven weakening.`
|
|
23927
|
+
) + "\n"
|
|
23928
|
+
);
|
|
23929
|
+
return;
|
|
23930
|
+
}
|
|
23931
|
+
}
|
|
23881
23932
|
try {
|
|
23882
23933
|
let text;
|
|
23883
23934
|
if (toolName === "node9_status") {
|
package/dist/cli.mjs
CHANGED
|
@@ -276,6 +276,10 @@ var init_config_schema = __esm({
|
|
|
276
276
|
// node9's own approver (terminal/native/cloud). Unset → smart default
|
|
277
277
|
// (ask for ask-capable agents unless a cloud approver is configured).
|
|
278
278
|
reviewChannel: z.enum(["ask", "approver"]).optional(),
|
|
279
|
+
// When true, agents may call WEAKENING node9 MCP tools (shield_disable,
|
|
280
|
+
// approver_set). Default (unset/false): those tools refuse over MCP — a human
|
|
281
|
+
// must run them from the CLI. node9's threat model is the agent itself.
|
|
282
|
+
mcpAllowWeakening: z.boolean().optional(),
|
|
279
283
|
cloudSyncIntervalHours: z.number().positive().optional(),
|
|
280
284
|
// Outbox shipper (audit.log → SaaS batch ingest). enabled defaults
|
|
281
285
|
// to true; set false to fall back to local-only auditing.
|
|
@@ -4184,6 +4188,7 @@ function getConfig(cwd) {
|
|
|
4184
4188
|
mergedSettings.approvalTimeoutMs = s.approvalTimeoutSeconds * 1e3;
|
|
4185
4189
|
if (s.environment !== void 0) mergedSettings.environment = s.environment;
|
|
4186
4190
|
if (s.reviewChannel !== void 0) mergedSettings.reviewChannel = s.reviewChannel;
|
|
4191
|
+
if (s.mcpAllowWeakening !== void 0) mergedSettings.mcpAllowWeakening = s.mcpAllowWeakening;
|
|
4187
4192
|
if (s.cloudSyncIntervalHours !== void 0)
|
|
4188
4193
|
mergedSettings.cloudSyncIntervalHours = s.cloudSyncIntervalHours;
|
|
4189
4194
|
if (s.hud !== void 0) mergedSettings.hud = { ...mergedSettings.hud, ...s.hud };
|
|
@@ -23216,6 +23221,34 @@ function ok(id, result) {
|
|
|
23216
23221
|
function err(id, code, message) {
|
|
23217
23222
|
return JSON.stringify({ jsonrpc: "2.0", id: id ?? null, error: { code, message } });
|
|
23218
23223
|
}
|
|
23224
|
+
var TOOL_CAPABILITY = {
|
|
23225
|
+
// weaken — gated over MCP
|
|
23226
|
+
node9_shield_disable: "weaken",
|
|
23227
|
+
node9_approver_set: "weaken",
|
|
23228
|
+
// add / restorative — always allowed
|
|
23229
|
+
node9_shield_enable: "add",
|
|
23230
|
+
node9_rule_add: "add",
|
|
23231
|
+
// already block/review-only — handleRuleAdd rejects "allow"
|
|
23232
|
+
node9_undo_revert: "add",
|
|
23233
|
+
// restorative
|
|
23234
|
+
// readonly
|
|
23235
|
+
node9_status: "readonly",
|
|
23236
|
+
node9_config_get: "readonly",
|
|
23237
|
+
node9_policy_get: "readonly",
|
|
23238
|
+
node9_audit_get: "readonly",
|
|
23239
|
+
node9_session: "readonly",
|
|
23240
|
+
node9_scan: "readonly",
|
|
23241
|
+
node9_report: "readonly",
|
|
23242
|
+
node9_posture: "readonly",
|
|
23243
|
+
node9_explain: "readonly",
|
|
23244
|
+
node9_shield_list: "readonly",
|
|
23245
|
+
node9_approver_list: "readonly",
|
|
23246
|
+
node9_undo_list: "readonly",
|
|
23247
|
+
node9_undo_detail: "readonly"
|
|
23248
|
+
};
|
|
23249
|
+
function capabilityOf(tool) {
|
|
23250
|
+
return TOOL_CAPABILITY[tool] ?? "readonly";
|
|
23251
|
+
}
|
|
23219
23252
|
var TOOLS = [
|
|
23220
23253
|
{
|
|
23221
23254
|
name: "node9_status",
|
|
@@ -23248,7 +23281,7 @@ var TOOLS = [
|
|
|
23248
23281
|
},
|
|
23249
23282
|
{
|
|
23250
23283
|
name: "node9_shield_disable",
|
|
23251
|
-
description:
|
|
23284
|
+
description: 'Disable a node9 shield. WEAKENING action \u2014 refused over MCP by default (a human must run "node9 shield disable <name>" from the CLI). Use node9_shield_list to see active shields.',
|
|
23252
23285
|
inputSchema: {
|
|
23253
23286
|
type: "object",
|
|
23254
23287
|
properties: {
|
|
@@ -23267,7 +23300,7 @@ var TOOLS = [
|
|
|
23267
23300
|
},
|
|
23268
23301
|
{
|
|
23269
23302
|
name: "node9_approver_set",
|
|
23270
|
-
description: "Enable or disable a specific node9 approver channel in the global config (~/.node9/config.json). Use this to turn individual channels on or off without touching other settings. Channels: native, browser, cloud, terminal. WARNING: disabling all approvers means node9 cannot prompt for human approval \u2014 use with care.",
|
|
23303
|
+
description: "Enable or disable a specific node9 approver channel in the global config (~/.node9/config.json). Use this to turn individual channels on or off without touching other settings. Channels: native, browser, cloud, terminal. WEAKENING action \u2014 refused over MCP by default (a human must run it from the CLI). WARNING: disabling all approvers means node9 cannot prompt for human approval \u2014 use with care.",
|
|
23271
23304
|
inputSchema: {
|
|
23272
23305
|
type: "object",
|
|
23273
23306
|
properties: {
|
|
@@ -23850,6 +23883,24 @@ function runMcpServer() {
|
|
|
23850
23883
|
const p = params ?? {};
|
|
23851
23884
|
const toolName = p.name;
|
|
23852
23885
|
const toolArgs = p.arguments ?? {};
|
|
23886
|
+
if (capabilityOf(toolName ?? "") === "weaken") {
|
|
23887
|
+
let allowed = false;
|
|
23888
|
+
try {
|
|
23889
|
+
allowed = getConfig().settings.mcpAllowWeakening === true;
|
|
23890
|
+
} catch {
|
|
23891
|
+
allowed = false;
|
|
23892
|
+
}
|
|
23893
|
+
if (!allowed) {
|
|
23894
|
+
process.stdout.write(
|
|
23895
|
+
err(
|
|
23896
|
+
id,
|
|
23897
|
+
-32e3,
|
|
23898
|
+
`${toolName} weakens node9 and is disabled over MCP. A human must run it from the CLI (e.g. "node9 shield disable <name>"), or set "mcpAllowWeakening": true in ~/.node9/config.json to allow agent-driven weakening.`
|
|
23899
|
+
) + "\n"
|
|
23900
|
+
);
|
|
23901
|
+
return;
|
|
23902
|
+
}
|
|
23903
|
+
}
|
|
23853
23904
|
try {
|
|
23854
23905
|
let text;
|
|
23855
23906
|
if (toolName === "node9_status") {
|
package/dist/dashboard.mjs
CHANGED
|
@@ -2270,6 +2270,10 @@ var init_config_schema = __esm({
|
|
|
2270
2270
|
// node9's own approver (terminal/native/cloud). Unset → smart default
|
|
2271
2271
|
// (ask for ask-capable agents unless a cloud approver is configured).
|
|
2272
2272
|
reviewChannel: z.enum(["ask", "approver"]).optional(),
|
|
2273
|
+
// When true, agents may call WEAKENING node9 MCP tools (shield_disable,
|
|
2274
|
+
// approver_set). Default (unset/false): those tools refuse over MCP — a human
|
|
2275
|
+
// must run them from the CLI. node9's threat model is the agent itself.
|
|
2276
|
+
mcpAllowWeakening: z.boolean().optional(),
|
|
2273
2277
|
cloudSyncIntervalHours: z.number().positive().optional(),
|
|
2274
2278
|
// Outbox shipper (audit.log → SaaS batch ingest). enabled defaults
|
|
2275
2279
|
// to true; set false to fall back to local-only auditing.
|
package/dist/index.js
CHANGED
|
@@ -283,6 +283,10 @@ var ConfigFileSchema = import_zod.z.object({
|
|
|
283
283
|
// node9's own approver (terminal/native/cloud). Unset → smart default
|
|
284
284
|
// (ask for ask-capable agents unless a cloud approver is configured).
|
|
285
285
|
reviewChannel: import_zod.z.enum(["ask", "approver"]).optional(),
|
|
286
|
+
// When true, agents may call WEAKENING node9 MCP tools (shield_disable,
|
|
287
|
+
// approver_set). Default (unset/false): those tools refuse over MCP — a human
|
|
288
|
+
// must run them from the CLI. node9's threat model is the agent itself.
|
|
289
|
+
mcpAllowWeakening: import_zod.z.boolean().optional(),
|
|
286
290
|
cloudSyncIntervalHours: import_zod.z.number().positive().optional(),
|
|
287
291
|
// Outbox shipper (audit.log → SaaS batch ingest). enabled defaults
|
|
288
292
|
// to true; set false to fall back to local-only auditing.
|
|
@@ -3737,6 +3741,7 @@ function getConfig(cwd) {
|
|
|
3737
3741
|
mergedSettings.approvalTimeoutMs = s.approvalTimeoutSeconds * 1e3;
|
|
3738
3742
|
if (s.environment !== void 0) mergedSettings.environment = s.environment;
|
|
3739
3743
|
if (s.reviewChannel !== void 0) mergedSettings.reviewChannel = s.reviewChannel;
|
|
3744
|
+
if (s.mcpAllowWeakening !== void 0) mergedSettings.mcpAllowWeakening = s.mcpAllowWeakening;
|
|
3740
3745
|
if (s.cloudSyncIntervalHours !== void 0)
|
|
3741
3746
|
mergedSettings.cloudSyncIntervalHours = s.cloudSyncIntervalHours;
|
|
3742
3747
|
if (s.hud !== void 0) mergedSettings.hud = { ...mergedSettings.hud, ...s.hud };
|
package/dist/index.mjs
CHANGED
|
@@ -253,6 +253,10 @@ var ConfigFileSchema = z.object({
|
|
|
253
253
|
// node9's own approver (terminal/native/cloud). Unset → smart default
|
|
254
254
|
// (ask for ask-capable agents unless a cloud approver is configured).
|
|
255
255
|
reviewChannel: z.enum(["ask", "approver"]).optional(),
|
|
256
|
+
// When true, agents may call WEAKENING node9 MCP tools (shield_disable,
|
|
257
|
+
// approver_set). Default (unset/false): those tools refuse over MCP — a human
|
|
258
|
+
// must run them from the CLI. node9's threat model is the agent itself.
|
|
259
|
+
mcpAllowWeakening: z.boolean().optional(),
|
|
256
260
|
cloudSyncIntervalHours: z.number().positive().optional(),
|
|
257
261
|
// Outbox shipper (audit.log → SaaS batch ingest). enabled defaults
|
|
258
262
|
// to true; set false to fall back to local-only auditing.
|
|
@@ -3707,6 +3711,7 @@ function getConfig(cwd) {
|
|
|
3707
3711
|
mergedSettings.approvalTimeoutMs = s.approvalTimeoutSeconds * 1e3;
|
|
3708
3712
|
if (s.environment !== void 0) mergedSettings.environment = s.environment;
|
|
3709
3713
|
if (s.reviewChannel !== void 0) mergedSettings.reviewChannel = s.reviewChannel;
|
|
3714
|
+
if (s.mcpAllowWeakening !== void 0) mergedSettings.mcpAllowWeakening = s.mcpAllowWeakening;
|
|
3710
3715
|
if (s.cloudSyncIntervalHours !== void 0)
|
|
3711
3716
|
mergedSettings.cloudSyncIntervalHours = s.cloudSyncIntervalHours;
|
|
3712
3717
|
if (s.hud !== void 0) mergedSettings.hud = { ...mergedSettings.hud, ...s.hud };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node9/proxy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.43.0",
|
|
4
4
|
"description": "The Sudo Command for AI Agents. Execution Security for Claude Code, Codex, Gemini, Cursor, Opencode, Pi, and any MCP server.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|