gossipcat 0.4.5 → 0.4.7
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-mcp/mcp-server.js +45 -8
- package/package.json +1 -1
package/dist-mcp/mcp-server.js
CHANGED
|
@@ -21314,6 +21314,7 @@ __export(sandbox_exports, {
|
|
|
21314
21314
|
auditDispatchBoundary: () => auditDispatchBoundary,
|
|
21315
21315
|
auditFilesystemSinceSentinel: () => auditFilesystemSinceSentinel,
|
|
21316
21316
|
buildAuditExclusions: () => buildAuditExclusions,
|
|
21317
|
+
buildFindPruneArgs: () => buildFindPruneArgs,
|
|
21317
21318
|
cleanupTaskSentinel: () => cleanupTaskSentinel,
|
|
21318
21319
|
defaultScanRoots: () => defaultScanRoots,
|
|
21319
21320
|
detectBoundaryEscapes: () => detectBoundaryEscapes,
|
|
@@ -21588,8 +21589,15 @@ function canonicalize(p) {
|
|
|
21588
21589
|
return p.replace(/\/+$/, "") || "/";
|
|
21589
21590
|
}
|
|
21590
21591
|
}
|
|
21591
|
-
function defaultScanRoots() {
|
|
21592
|
+
function defaultScanRoots(writeMode, projectRoot) {
|
|
21592
21593
|
const out = /* @__PURE__ */ new Set();
|
|
21594
|
+
if (writeMode === "scoped") {
|
|
21595
|
+
try {
|
|
21596
|
+
out.add(canonicalize(projectRoot));
|
|
21597
|
+
} catch {
|
|
21598
|
+
}
|
|
21599
|
+
return Array.from(out);
|
|
21600
|
+
}
|
|
21593
21601
|
try {
|
|
21594
21602
|
out.add(canonicalize((0, import_os2.homedir)()));
|
|
21595
21603
|
} catch {
|
|
@@ -21617,12 +21625,40 @@ function buildAuditExclusions(projectRoot, ownWorktree) {
|
|
|
21617
21625
|
const root = canonicalize(projectRoot);
|
|
21618
21626
|
for (const v of expandTmpVariants(`${root}/.gossip`)) excl.add(v);
|
|
21619
21627
|
for (const v of expandTmpVariants(`${root}/.claude`)) excl.add(v);
|
|
21628
|
+
for (const v of expandTmpVariants(`${root}/.git`)) excl.add(v);
|
|
21629
|
+
try {
|
|
21630
|
+
const home = canonicalize((0, import_os2.homedir)());
|
|
21631
|
+
for (const sub of ["Library", ".cache", ".npm", ".claude"]) {
|
|
21632
|
+
for (const v of expandTmpVariants(`${home}/${sub}`)) excl.add(v);
|
|
21633
|
+
}
|
|
21634
|
+
} catch {
|
|
21635
|
+
}
|
|
21636
|
+
try {
|
|
21637
|
+
const tmp = canonicalize((0, import_os2.tmpdir)());
|
|
21638
|
+
for (const pat of ["com.apple.*", "itunescloudd", "TemporaryItems"]) {
|
|
21639
|
+
for (const v of expandTmpVariants(`${tmp}/${pat}`)) excl.add(v);
|
|
21640
|
+
}
|
|
21641
|
+
} catch {
|
|
21642
|
+
}
|
|
21620
21643
|
if (ownWorktree) {
|
|
21621
21644
|
const wt = canonicalize(ownWorktree);
|
|
21622
21645
|
for (const v of expandTmpVariants(wt)) excl.add(v);
|
|
21623
21646
|
}
|
|
21624
21647
|
return Array.from(excl);
|
|
21625
21648
|
}
|
|
21649
|
+
function buildFindPruneArgs(scanRoot, exclusions, sentinel) {
|
|
21650
|
+
const args = [scanRoot];
|
|
21651
|
+
if (exclusions.length > 0) {
|
|
21652
|
+
args.push("(");
|
|
21653
|
+
for (let i = 0; i < exclusions.length; i++) {
|
|
21654
|
+
if (i > 0) args.push("-o");
|
|
21655
|
+
args.push("-path", exclusions[i]);
|
|
21656
|
+
}
|
|
21657
|
+
args.push(")", "-prune", "-o");
|
|
21658
|
+
}
|
|
21659
|
+
args.push("-type", "f", "-newer", sentinel, "-print");
|
|
21660
|
+
return args;
|
|
21661
|
+
}
|
|
21626
21662
|
function auditFilesystemSinceSentinel(projectRoot, meta3, options = {}) {
|
|
21627
21663
|
const platform2 = options.platform ?? process.platform;
|
|
21628
21664
|
const logFailures = options.logFailures ?? true;
|
|
@@ -21647,20 +21683,19 @@ function auditFilesystemSinceSentinel(projectRoot, meta3, options = {}) {
|
|
|
21647
21683
|
if (sentinelMtimeMs === 0) {
|
|
21648
21684
|
return { violations: [], skipped: "sentinel stat failed" };
|
|
21649
21685
|
}
|
|
21650
|
-
const scanRoots = options.scanRoots ?? defaultScanRoots(
|
|
21686
|
+
const scanRoots = options.scanRoots ?? defaultScanRoots(
|
|
21687
|
+
options.writeMode ?? meta3.writeMode,
|
|
21688
|
+
projectRoot
|
|
21689
|
+
);
|
|
21651
21690
|
const exclusions = buildAuditExclusions(projectRoot, meta3.worktreePath);
|
|
21652
21691
|
const findBin = options.findBinary ?? "find";
|
|
21653
21692
|
const violations = [];
|
|
21654
21693
|
for (const root of scanRoots) {
|
|
21655
21694
|
if (!(0, import_fs34.existsSync)(root)) continue;
|
|
21656
21695
|
const canonRoot = canonicalize(root);
|
|
21657
|
-
const args = [canonRoot, "-type", "f", "-newer", sentinel];
|
|
21658
21696
|
const sentinelDir = canonicalize((0, import_path38.join)(projectRoot, ".gossip", SENTINEL_DIR));
|
|
21659
21697
|
const allExcl = [...exclusions, ...expandTmpVariants(sentinelDir)];
|
|
21660
|
-
|
|
21661
|
-
args.push("-not", "-path", e);
|
|
21662
|
-
args.push("-not", "-path", `${e}/*`);
|
|
21663
|
-
}
|
|
21698
|
+
const args = buildFindPruneArgs(canonRoot, allExcl, sentinel);
|
|
21664
21699
|
try {
|
|
21665
21700
|
const out = (0, import_child_process5.execFileSync)(findBin, args, {
|
|
21666
21701
|
encoding: "utf-8",
|
|
@@ -21732,7 +21767,9 @@ function runLayer3Audit(projectRoot, taskId) {
|
|
|
21732
21767
|
return { blockError, warnPrefix };
|
|
21733
21768
|
}
|
|
21734
21769
|
try {
|
|
21735
|
-
const l3 = auditFilesystemSinceSentinel(projectRoot, meta3
|
|
21770
|
+
const l3 = auditFilesystemSinceSentinel(projectRoot, meta3, {
|
|
21771
|
+
writeMode: meta3.writeMode
|
|
21772
|
+
});
|
|
21736
21773
|
if (l3.violations && l3.violations.length > 0) {
|
|
21737
21774
|
const list = l3.violations.slice(0, 20).join(", ");
|
|
21738
21775
|
if (enforcement === "block") {
|
package/package.json
CHANGED