codiedev 0.10.0-beta.13 → 0.10.0-beta.14
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/hook.js +3 -2
- package/dist/localScrub.js +22 -0
- package/package.json +1 -1
package/dist/hook.js
CHANGED
|
@@ -445,8 +445,9 @@ async function main() {
|
|
|
445
445
|
}
|
|
446
446
|
if (process.argv[2] === "local-scrub") {
|
|
447
447
|
try {
|
|
448
|
-
const { runAndReport } = await Promise.resolve().then(() => __importStar(require("./localScrub")));
|
|
449
|
-
await
|
|
448
|
+
const { runAndReport, scrubAllowed } = await Promise.resolve().then(() => __importStar(require("./localScrub")));
|
|
449
|
+
if (await scrubAllowed())
|
|
450
|
+
await runAndReport();
|
|
450
451
|
}
|
|
451
452
|
catch {
|
|
452
453
|
}
|
package/dist/localScrub.js
CHANGED
|
@@ -47,6 +47,7 @@ exports.cleanOpenCodeDb = cleanOpenCodeDb;
|
|
|
47
47
|
exports.countCursorDb = countCursorDb;
|
|
48
48
|
exports.runLocalScrub = runLocalScrub;
|
|
49
49
|
exports.runAndReport = runAndReport;
|
|
50
|
+
exports.scrubAllowed = scrubAllowed;
|
|
50
51
|
exports.maybeSpawnLocalScrub = maybeSpawnLocalScrub;
|
|
51
52
|
const fs = __importStar(require("fs"));
|
|
52
53
|
const os = __importStar(require("os"));
|
|
@@ -656,6 +657,27 @@ async function runAndReport(opts = {}) {
|
|
|
656
657
|
}
|
|
657
658
|
return { ...summary, reported };
|
|
658
659
|
}
|
|
660
|
+
async function scrubAllowed(fetchImpl = fetch, getConfig = () => {
|
|
661
|
+
const { readConfig } = require("./utils");
|
|
662
|
+
return readConfig();
|
|
663
|
+
}) {
|
|
664
|
+
try {
|
|
665
|
+
const config = getConfig();
|
|
666
|
+
if (!config?.token || !config.backendUrl)
|
|
667
|
+
return false;
|
|
668
|
+
const res = await fetchImpl(`${config.backendUrl}/api/cli/localScrubPolicy`, {
|
|
669
|
+
headers: { Authorization: `Bearer ${config.token}` },
|
|
670
|
+
signal: AbortSignal.timeout(10_000),
|
|
671
|
+
});
|
|
672
|
+
if (!res.ok)
|
|
673
|
+
return false;
|
|
674
|
+
const body = (await res.json());
|
|
675
|
+
return body.enabled === true;
|
|
676
|
+
}
|
|
677
|
+
catch {
|
|
678
|
+
return false;
|
|
679
|
+
}
|
|
680
|
+
}
|
|
659
681
|
function maybeSpawnLocalScrub(opts = {}) {
|
|
660
682
|
try {
|
|
661
683
|
const env = opts.env ?? process.env;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codiedev",
|
|
3
|
-
"version": "0.10.0-beta.
|
|
3
|
+
"version": "0.10.0-beta.14",
|
|
4
4
|
"description": "Connect Claude Code, Codex, Cursor, OpenCode, or VS Code Copilot to Codiedev for team session capture and artifact collaboration — and run the governed Codie harness",
|
|
5
5
|
"bin": {
|
|
6
6
|
"codiedev": "dist/cli.js",
|