@node9/proxy 1.67.5 → 2.0.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 +575 -938
- package/dist/cli.mjs +568 -931
- package/dist/dashboard.mjs +0 -60
- package/dist/index.js +0 -50
- package/dist/index.mjs +0 -50
- package/package.json +1 -1
package/dist/dashboard.mjs
CHANGED
|
@@ -2596,19 +2596,6 @@ var init_config = __esm({
|
|
|
2596
2596
|
settings: {
|
|
2597
2597
|
mode: "standard",
|
|
2598
2598
|
autoStartDaemon: true,
|
|
2599
|
-
// The undo feature was REMOVED. This default is one of two places that say
|
|
2600
|
-
// so; the other is the pin further down, which overwrites whatever a config
|
|
2601
|
-
// file, the dashboard or the cloud supplies. Setting `enableUndo` anywhere
|
|
2602
|
-
// has no effect — do not restore the advice that used to live here, because
|
|
2603
|
-
// a comment recommending a knob that is silently discarded is the same lie
|
|
2604
|
-
// on disk the pin exists to prevent.
|
|
2605
|
-
//
|
|
2606
|
-
// Why it went: the store was a per-project bare git repo with no size
|
|
2607
|
-
// ceiling, and eviction dropped the index row without deleting the objects.
|
|
2608
|
-
// On one machine it reached 378G (352G of it orphaned tmp_pack_* from an
|
|
2609
|
-
// interrupted `git gc`) and filled the disk. A security tool must not be
|
|
2610
|
-
// what fills a customer's disk. Leftovers: `node9 undo --purge`.
|
|
2611
|
-
enableUndo: false,
|
|
2612
2599
|
enableHookLogDebug: true,
|
|
2613
2600
|
approvalTimeoutMs: 12e4,
|
|
2614
2601
|
// 120-second auto-deny timeout
|
|
@@ -2649,25 +2636,6 @@ var init_config = __esm({
|
|
|
2649
2636
|
"terminal.execute": "command",
|
|
2650
2637
|
"postgres:query": "sql"
|
|
2651
2638
|
},
|
|
2652
|
-
snapshot: {
|
|
2653
|
-
tools: [
|
|
2654
|
-
"str_replace_based_edit_tool",
|
|
2655
|
-
"write_file",
|
|
2656
|
-
"edit_file",
|
|
2657
|
-
"create_file",
|
|
2658
|
-
"edit",
|
|
2659
|
-
"replace",
|
|
2660
|
-
// Claude / canonicalised Hermes — shouldSnapshot lowercases the
|
|
2661
|
-
// incoming name before set-membership, so we list the lowercase
|
|
2662
|
-
// forms of `Bash`/`Write`/`Edit`/`MultiEdit`. Without these,
|
|
2663
|
-
// post-canonicalisation Hermes `patch` / `write_file` (which now
|
|
2664
|
-
// arrive as `Edit` / `Write`) silently skipped snapshotting.
|
|
2665
|
-
"write",
|
|
2666
|
-
"multiedit"
|
|
2667
|
-
],
|
|
2668
|
-
onlyPaths: [],
|
|
2669
|
-
ignorePaths: ["**/node_modules/**", "dist/**", "build/**", ".next/**", "**/*.log"]
|
|
2670
|
-
},
|
|
2671
2639
|
smartRules: [
|
|
2672
2640
|
// ── rm safety (critical — always evaluated first) ──────────────────────
|
|
2673
2641
|
{
|
|
@@ -3919,7 +3887,6 @@ var init_provenance = __esm({
|
|
|
3919
3887
|
});
|
|
3920
3888
|
|
|
3921
3889
|
// src/policy/index.ts
|
|
3922
|
-
import pm2 from "picomatch";
|
|
3923
3890
|
var init_policy = __esm({
|
|
3924
3891
|
"src/policy/index.ts"() {
|
|
3925
3892
|
"use strict";
|
|
@@ -5442,17 +5409,6 @@ function subscribeToSse(onEvent, onResolve, onForensic, onError) {
|
|
|
5442
5409
|
function toActivityEvent(eventName, data) {
|
|
5443
5410
|
const payload = data.activity ?? data;
|
|
5444
5411
|
const ts = normalizeTs(payload.ts);
|
|
5445
|
-
if (eventName === "snapshot") {
|
|
5446
|
-
const rawSummary = payload.argsSummary ?? payload.tool ?? "snapshot";
|
|
5447
|
-
return {
|
|
5448
|
-
kind: "snapshot",
|
|
5449
|
-
id: payload.id ?? `${ts}-snapshot`,
|
|
5450
|
-
ts,
|
|
5451
|
-
hash: payload.hash ?? "",
|
|
5452
|
-
summary: compactPath(rawSummary),
|
|
5453
|
-
fileCount: typeof payload.fileCount === "number" ? payload.fileCount : 0
|
|
5454
|
-
};
|
|
5455
|
-
}
|
|
5456
5412
|
if (eventName !== "activity" && eventName !== "add") return null;
|
|
5457
5413
|
const toolName = payload.tool ?? payload.toolName;
|
|
5458
5414
|
if (!toolName) return null;
|
|
@@ -5843,9 +5799,6 @@ function applyFilter(events, filter) {
|
|
|
5843
5799
|
if (!filter) return events;
|
|
5844
5800
|
const needle = filter.toLowerCase();
|
|
5845
5801
|
return events.filter((e) => {
|
|
5846
|
-
if (e.kind === "snapshot") {
|
|
5847
|
-
return e.hash.toLowerCase().includes(needle) || e.summary.toLowerCase().includes(needle);
|
|
5848
|
-
}
|
|
5849
5802
|
if (e.tool.toLowerCase().includes(needle)) return true;
|
|
5850
5803
|
if (e.agent && e.agent.toLowerCase().includes(needle)) return true;
|
|
5851
5804
|
if (e.preview.toLowerCase().includes(needle)) return true;
|
|
@@ -5856,19 +5809,6 @@ function applyFilter(events, filter) {
|
|
|
5856
5809
|
}
|
|
5857
5810
|
function ActivityRow({ event }) {
|
|
5858
5811
|
const t = localTimeOf(event.ts);
|
|
5859
|
-
if (event.kind === "snapshot") {
|
|
5860
|
-
const filesSuffix = event.fileCount > 0 ? ` \xB7 ${event.fileCount} file${event.fileCount === 1 ? "" : "s"}` : "";
|
|
5861
|
-
return /* @__PURE__ */ jsxs(Text, { wrap: "truncate-end", children: [
|
|
5862
|
-
/* @__PURE__ */ jsxs(Text, { dimColor: true, children: [
|
|
5863
|
-
t,
|
|
5864
|
-
" "
|
|
5865
|
-
] }),
|
|
5866
|
-
/* @__PURE__ */ jsx(Text, { color: COL.agentClaude, children: "\u{1F4F8} snapshot" }),
|
|
5867
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: ` ${event.hash} ` }),
|
|
5868
|
-
/* @__PURE__ */ jsx(Text, { children: event.summary }),
|
|
5869
|
-
/* @__PURE__ */ jsx(Text, { dimColor: true, children: filesSuffix })
|
|
5870
|
-
] });
|
|
5871
|
-
}
|
|
5872
5812
|
const agentLabel = event.agent ? `[${truncate(capitalize(event.agent), 8)}]`.padEnd(10) : " ".repeat(10);
|
|
5873
5813
|
const isLoop = event.checkedBy === "loop-detected";
|
|
5874
5814
|
const verdictIcon = isLoop ? "\u{1F501}" : event.verdict === "block" ? "\u{1F6D1}" : event.verdict === "review" ? "\u{1F7E1}" : event.verdict === "allow" ? "\u2713 " : "\u2026 ";
|
package/dist/index.js
CHANGED
|
@@ -4180,19 +4180,6 @@ var DEFAULT_CONFIG = {
|
|
|
4180
4180
|
settings: {
|
|
4181
4181
|
mode: "standard",
|
|
4182
4182
|
autoStartDaemon: true,
|
|
4183
|
-
// The undo feature was REMOVED. This default is one of two places that say
|
|
4184
|
-
// so; the other is the pin further down, which overwrites whatever a config
|
|
4185
|
-
// file, the dashboard or the cloud supplies. Setting `enableUndo` anywhere
|
|
4186
|
-
// has no effect — do not restore the advice that used to live here, because
|
|
4187
|
-
// a comment recommending a knob that is silently discarded is the same lie
|
|
4188
|
-
// on disk the pin exists to prevent.
|
|
4189
|
-
//
|
|
4190
|
-
// Why it went: the store was a per-project bare git repo with no size
|
|
4191
|
-
// ceiling, and eviction dropped the index row without deleting the objects.
|
|
4192
|
-
// On one machine it reached 378G (352G of it orphaned tmp_pack_* from an
|
|
4193
|
-
// interrupted `git gc`) and filled the disk. A security tool must not be
|
|
4194
|
-
// what fills a customer's disk. Leftovers: `node9 undo --purge`.
|
|
4195
|
-
enableUndo: false,
|
|
4196
4183
|
enableHookLogDebug: true,
|
|
4197
4184
|
approvalTimeoutMs: 12e4,
|
|
4198
4185
|
// 120-second auto-deny timeout
|
|
@@ -4233,25 +4220,6 @@ var DEFAULT_CONFIG = {
|
|
|
4233
4220
|
"terminal.execute": "command",
|
|
4234
4221
|
"postgres:query": "sql"
|
|
4235
4222
|
},
|
|
4236
|
-
snapshot: {
|
|
4237
|
-
tools: [
|
|
4238
|
-
"str_replace_based_edit_tool",
|
|
4239
|
-
"write_file",
|
|
4240
|
-
"edit_file",
|
|
4241
|
-
"create_file",
|
|
4242
|
-
"edit",
|
|
4243
|
-
"replace",
|
|
4244
|
-
// Claude / canonicalised Hermes — shouldSnapshot lowercases the
|
|
4245
|
-
// incoming name before set-membership, so we list the lowercase
|
|
4246
|
-
// forms of `Bash`/`Write`/`Edit`/`MultiEdit`. Without these,
|
|
4247
|
-
// post-canonicalisation Hermes `patch` / `write_file` (which now
|
|
4248
|
-
// arrive as `Edit` / `Write`) silently skipped snapshotting.
|
|
4249
|
-
"write",
|
|
4250
|
-
"multiedit"
|
|
4251
|
-
],
|
|
4252
|
-
onlyPaths: [],
|
|
4253
|
-
ignorePaths: ["**/node_modules/**", "dist/**", "build/**", ".next/**", "**/*.log"]
|
|
4254
|
-
},
|
|
4255
4223
|
smartRules: [
|
|
4256
4224
|
// ── rm safety (critical — always evaluated first) ──────────────────────
|
|
4257
4225
|
{
|
|
@@ -4562,11 +4530,6 @@ function getConfig(cwd) {
|
|
|
4562
4530
|
ignoredTools: [...DEFAULT_CONFIG.policy.ignoredTools],
|
|
4563
4531
|
toolInspection: { ...DEFAULT_CONFIG.policy.toolInspection },
|
|
4564
4532
|
smartRules: [...DEFAULT_CONFIG.policy.smartRules],
|
|
4565
|
-
snapshot: {
|
|
4566
|
-
tools: [...DEFAULT_CONFIG.policy.snapshot.tools],
|
|
4567
|
-
onlyPaths: [...DEFAULT_CONFIG.policy.snapshot.onlyPaths],
|
|
4568
|
-
ignorePaths: [...DEFAULT_CONFIG.policy.snapshot.ignorePaths]
|
|
4569
|
-
},
|
|
4570
4533
|
dlp: { ...DEFAULT_CONFIG.policy.dlp },
|
|
4571
4534
|
egress: {
|
|
4572
4535
|
...DEFAULT_CONFIG.policy.egress,
|
|
@@ -4634,12 +4597,6 @@ function getConfig(cwd) {
|
|
|
4634
4597
|
);
|
|
4635
4598
|
mergedPolicy.smartRules = [...filteredBlocks, ...localRules, ...filteredNonBlocks];
|
|
4636
4599
|
}
|
|
4637
|
-
if (p.snapshot) {
|
|
4638
|
-
const s2 = p.snapshot;
|
|
4639
|
-
if (s2.tools) mergedPolicy.snapshot.tools.push(...s2.tools);
|
|
4640
|
-
if (s2.onlyPaths) mergedPolicy.snapshot.onlyPaths.push(...s2.onlyPaths);
|
|
4641
|
-
if (s2.ignorePaths) mergedPolicy.snapshot.ignorePaths.push(...s2.ignorePaths);
|
|
4642
|
-
}
|
|
4643
4600
|
if (p.dlp) {
|
|
4644
4601
|
const d = p.dlp;
|
|
4645
4602
|
if (d.enabled !== void 0) mergedPolicy.dlp.enabled = d.enabled;
|
|
@@ -4974,10 +4931,6 @@ function getConfig(cwd) {
|
|
|
4974
4931
|
mergedPolicy.dangerousWords = [...new Set(mergedPolicy.dangerousWords)];
|
|
4975
4932
|
mergedPolicy.ignoredTools = [...new Set(mergedPolicy.ignoredTools)];
|
|
4976
4933
|
mergedPolicy.skillPinning.roots = [...new Set(mergedPolicy.skillPinning.roots)];
|
|
4977
|
-
mergedPolicy.snapshot.tools = [...new Set(mergedPolicy.snapshot.tools)];
|
|
4978
|
-
mergedPolicy.snapshot.onlyPaths = [...new Set(mergedPolicy.snapshot.onlyPaths)];
|
|
4979
|
-
mergedPolicy.snapshot.ignorePaths = [...new Set(mergedPolicy.snapshot.ignorePaths)];
|
|
4980
|
-
mergedSettings.enableUndo = false;
|
|
4981
4934
|
const result = {
|
|
4982
4935
|
settings: mergedSettings,
|
|
4983
4936
|
policy: mergedPolicy,
|
|
@@ -5040,9 +4993,6 @@ ${error.replace("Invalid config:\n", "")}
|
|
|
5040
4993
|
return sanitized;
|
|
5041
4994
|
}
|
|
5042
4995
|
|
|
5043
|
-
// src/policy/index.ts
|
|
5044
|
-
var import_picomatch2 = __toESM(require("picomatch"));
|
|
5045
|
-
|
|
5046
4996
|
// src/dlp.ts
|
|
5047
4997
|
var import_fs5 = __toESM(require("fs"));
|
|
5048
4998
|
var import_path5 = __toESM(require("path"));
|
package/dist/index.mjs
CHANGED
|
@@ -4150,19 +4150,6 @@ var DEFAULT_CONFIG = {
|
|
|
4150
4150
|
settings: {
|
|
4151
4151
|
mode: "standard",
|
|
4152
4152
|
autoStartDaemon: true,
|
|
4153
|
-
// The undo feature was REMOVED. This default is one of two places that say
|
|
4154
|
-
// so; the other is the pin further down, which overwrites whatever a config
|
|
4155
|
-
// file, the dashboard or the cloud supplies. Setting `enableUndo` anywhere
|
|
4156
|
-
// has no effect — do not restore the advice that used to live here, because
|
|
4157
|
-
// a comment recommending a knob that is silently discarded is the same lie
|
|
4158
|
-
// on disk the pin exists to prevent.
|
|
4159
|
-
//
|
|
4160
|
-
// Why it went: the store was a per-project bare git repo with no size
|
|
4161
|
-
// ceiling, and eviction dropped the index row without deleting the objects.
|
|
4162
|
-
// On one machine it reached 378G (352G of it orphaned tmp_pack_* from an
|
|
4163
|
-
// interrupted `git gc`) and filled the disk. A security tool must not be
|
|
4164
|
-
// what fills a customer's disk. Leftovers: `node9 undo --purge`.
|
|
4165
|
-
enableUndo: false,
|
|
4166
4153
|
enableHookLogDebug: true,
|
|
4167
4154
|
approvalTimeoutMs: 12e4,
|
|
4168
4155
|
// 120-second auto-deny timeout
|
|
@@ -4203,25 +4190,6 @@ var DEFAULT_CONFIG = {
|
|
|
4203
4190
|
"terminal.execute": "command",
|
|
4204
4191
|
"postgres:query": "sql"
|
|
4205
4192
|
},
|
|
4206
|
-
snapshot: {
|
|
4207
|
-
tools: [
|
|
4208
|
-
"str_replace_based_edit_tool",
|
|
4209
|
-
"write_file",
|
|
4210
|
-
"edit_file",
|
|
4211
|
-
"create_file",
|
|
4212
|
-
"edit",
|
|
4213
|
-
"replace",
|
|
4214
|
-
// Claude / canonicalised Hermes — shouldSnapshot lowercases the
|
|
4215
|
-
// incoming name before set-membership, so we list the lowercase
|
|
4216
|
-
// forms of `Bash`/`Write`/`Edit`/`MultiEdit`. Without these,
|
|
4217
|
-
// post-canonicalisation Hermes `patch` / `write_file` (which now
|
|
4218
|
-
// arrive as `Edit` / `Write`) silently skipped snapshotting.
|
|
4219
|
-
"write",
|
|
4220
|
-
"multiedit"
|
|
4221
|
-
],
|
|
4222
|
-
onlyPaths: [],
|
|
4223
|
-
ignorePaths: ["**/node_modules/**", "dist/**", "build/**", ".next/**", "**/*.log"]
|
|
4224
|
-
},
|
|
4225
4193
|
smartRules: [
|
|
4226
4194
|
// ── rm safety (critical — always evaluated first) ──────────────────────
|
|
4227
4195
|
{
|
|
@@ -4532,11 +4500,6 @@ function getConfig(cwd) {
|
|
|
4532
4500
|
ignoredTools: [...DEFAULT_CONFIG.policy.ignoredTools],
|
|
4533
4501
|
toolInspection: { ...DEFAULT_CONFIG.policy.toolInspection },
|
|
4534
4502
|
smartRules: [...DEFAULT_CONFIG.policy.smartRules],
|
|
4535
|
-
snapshot: {
|
|
4536
|
-
tools: [...DEFAULT_CONFIG.policy.snapshot.tools],
|
|
4537
|
-
onlyPaths: [...DEFAULT_CONFIG.policy.snapshot.onlyPaths],
|
|
4538
|
-
ignorePaths: [...DEFAULT_CONFIG.policy.snapshot.ignorePaths]
|
|
4539
|
-
},
|
|
4540
4503
|
dlp: { ...DEFAULT_CONFIG.policy.dlp },
|
|
4541
4504
|
egress: {
|
|
4542
4505
|
...DEFAULT_CONFIG.policy.egress,
|
|
@@ -4604,12 +4567,6 @@ function getConfig(cwd) {
|
|
|
4604
4567
|
);
|
|
4605
4568
|
mergedPolicy.smartRules = [...filteredBlocks, ...localRules, ...filteredNonBlocks];
|
|
4606
4569
|
}
|
|
4607
|
-
if (p.snapshot) {
|
|
4608
|
-
const s2 = p.snapshot;
|
|
4609
|
-
if (s2.tools) mergedPolicy.snapshot.tools.push(...s2.tools);
|
|
4610
|
-
if (s2.onlyPaths) mergedPolicy.snapshot.onlyPaths.push(...s2.onlyPaths);
|
|
4611
|
-
if (s2.ignorePaths) mergedPolicy.snapshot.ignorePaths.push(...s2.ignorePaths);
|
|
4612
|
-
}
|
|
4613
4570
|
if (p.dlp) {
|
|
4614
4571
|
const d = p.dlp;
|
|
4615
4572
|
if (d.enabled !== void 0) mergedPolicy.dlp.enabled = d.enabled;
|
|
@@ -4944,10 +4901,6 @@ function getConfig(cwd) {
|
|
|
4944
4901
|
mergedPolicy.dangerousWords = [...new Set(mergedPolicy.dangerousWords)];
|
|
4945
4902
|
mergedPolicy.ignoredTools = [...new Set(mergedPolicy.ignoredTools)];
|
|
4946
4903
|
mergedPolicy.skillPinning.roots = [...new Set(mergedPolicy.skillPinning.roots)];
|
|
4947
|
-
mergedPolicy.snapshot.tools = [...new Set(mergedPolicy.snapshot.tools)];
|
|
4948
|
-
mergedPolicy.snapshot.onlyPaths = [...new Set(mergedPolicy.snapshot.onlyPaths)];
|
|
4949
|
-
mergedPolicy.snapshot.ignorePaths = [...new Set(mergedPolicy.snapshot.ignorePaths)];
|
|
4950
|
-
mergedSettings.enableUndo = false;
|
|
4951
4904
|
const result = {
|
|
4952
4905
|
settings: mergedSettings,
|
|
4953
4906
|
policy: mergedPolicy,
|
|
@@ -5010,9 +4963,6 @@ ${error.replace("Invalid config:\n", "")}
|
|
|
5010
4963
|
return sanitized;
|
|
5011
4964
|
}
|
|
5012
4965
|
|
|
5013
|
-
// src/policy/index.ts
|
|
5014
|
-
import pm2 from "picomatch";
|
|
5015
|
-
|
|
5016
4966
|
// src/dlp.ts
|
|
5017
4967
|
import fs5 from "fs";
|
|
5018
4968
|
import path5 from "path";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@node9/proxy",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.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",
|