@akasecurity/ai-tc-antigravity 0.9.4 → 0.9.6
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/package.json +4 -4
- package/plugin.json +1 -1
- package/scripts/apply-suppressions.js +61 -13
- package/scripts/backfill.js +62 -13
- package/scripts/filescan.js +73 -24
- package/scripts/firstrun.js +52 -8
- package/scripts/intro.js +49 -5
- package/scripts/onboard.js +49 -5
- package/scripts/post-tool-use.js +49 -5
- package/scripts/pre-invocation.js +86 -32
- package/scripts/pre-tool-use.js +62 -13
- package/scripts/query.js +54 -10
- package/scripts/reconcile.js +58 -10
- package/scripts/remediate.js +67 -18
- package/scripts/scan-worker.js +61 -12
- package/scripts/start-light.js +52 -8
- package/scripts/stop.js +49 -5
- package/skills/setup/SKILL.md +17 -0
package/scripts/reconcile.js
CHANGED
|
@@ -25932,6 +25932,40 @@ function escapeRegExp2(value) {
|
|
|
25932
25932
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
25933
25933
|
}
|
|
25934
25934
|
|
|
25935
|
+
// ../../packages/detections/src/regex-cache.ts
|
|
25936
|
+
var singles = /* @__PURE__ */ new WeakMap();
|
|
25937
|
+
var keywordLists = /* @__PURE__ */ new WeakMap();
|
|
25938
|
+
var labelLists = /* @__PURE__ */ new WeakMap();
|
|
25939
|
+
function listCache(kind) {
|
|
25940
|
+
return kind === "keyword" ? keywordLists : labelLists;
|
|
25941
|
+
}
|
|
25942
|
+
function memoizedRegExp(owner, build) {
|
|
25943
|
+
const cached2 = singles.get(owner);
|
|
25944
|
+
if (cached2 !== void 0) {
|
|
25945
|
+
cached2.lastIndex = 0;
|
|
25946
|
+
return cached2;
|
|
25947
|
+
}
|
|
25948
|
+
const compiled = build();
|
|
25949
|
+
singles.set(owner, compiled);
|
|
25950
|
+
return compiled;
|
|
25951
|
+
}
|
|
25952
|
+
function memoizedRegExpList(kind, owner, build) {
|
|
25953
|
+
const cache = listCache(kind);
|
|
25954
|
+
const cached2 = cache.get(owner);
|
|
25955
|
+
if (cached2 !== void 0) {
|
|
25956
|
+
if (cached2.stateful) {
|
|
25957
|
+
for (const re of cached2.entries) if (re !== void 0) re.lastIndex = 0;
|
|
25958
|
+
}
|
|
25959
|
+
return cached2.entries;
|
|
25960
|
+
}
|
|
25961
|
+
const entries = build();
|
|
25962
|
+
cache.set(owner, {
|
|
25963
|
+
entries,
|
|
25964
|
+
stateful: entries.some((re) => re !== void 0 && (re.global || re.sticky))
|
|
25965
|
+
});
|
|
25966
|
+
return entries;
|
|
25967
|
+
}
|
|
25968
|
+
|
|
25935
25969
|
// ../../packages/detections/src/matchers/limits.ts
|
|
25936
25970
|
var MAX_MATCHES_PER_RULE = 1e4;
|
|
25937
25971
|
var MAX_REGEX_INPUT_LENGTH = 2e5;
|
|
@@ -25942,10 +25976,17 @@ var KeywordMatcher2 = class {
|
|
|
25942
25976
|
if (rule.matcher.type !== "keyword") return [];
|
|
25943
25977
|
const { keywords, caseSensitive } = rule.matcher;
|
|
25944
25978
|
const spans = [];
|
|
25945
|
-
|
|
25946
|
-
|
|
25979
|
+
const compiled = memoizedRegExpList(
|
|
25980
|
+
"keyword",
|
|
25981
|
+
rule.matcher,
|
|
25982
|
+
() => keywords.map((kw) => {
|
|
25983
|
+
if (kw.length === 0) return void 0;
|
|
25984
|
+
return new RegExp(escapeRegExp2(kw), caseSensitive ? "gu" : "giu");
|
|
25985
|
+
})
|
|
25986
|
+
);
|
|
25987
|
+
for (const re of compiled) {
|
|
25988
|
+
if (re === void 0) continue;
|
|
25947
25989
|
if (spans.length >= MAX_MATCHES_PER_RULE) break;
|
|
25948
|
-
const re = new RegExp(escapeRegExp2(kw), caseSensitive ? "gu" : "giu");
|
|
25949
25990
|
let m;
|
|
25950
25991
|
while ((m = re.exec(text)) !== null) {
|
|
25951
25992
|
spans.push({ start: m.index, end: m.index + m[0].length });
|
|
@@ -25961,7 +26002,10 @@ var RegexMatcher2 = class {
|
|
|
25961
26002
|
match(text, rule) {
|
|
25962
26003
|
if (rule.matcher.type !== "regex") return [];
|
|
25963
26004
|
const { pattern, flags, captureGroup } = rule.matcher;
|
|
25964
|
-
const re =
|
|
26005
|
+
const re = memoizedRegExp(
|
|
26006
|
+
rule.matcher,
|
|
26007
|
+
() => new RegExp(pattern, flags.includes("d") ? flags : `${flags}d`)
|
|
26008
|
+
);
|
|
25965
26009
|
const scanText2 = text.length > MAX_REGEX_INPUT_LENGTH ? text.slice(0, MAX_REGEX_INPUT_LENGTH) : text;
|
|
25966
26010
|
const spans = [];
|
|
25967
26011
|
let m;
|
|
@@ -26069,11 +26113,15 @@ function isCorroborated(candidate, candidates, text) {
|
|
|
26069
26113
|
const labels = req.labels;
|
|
26070
26114
|
if (labels && labels.length > 0) {
|
|
26071
26115
|
const haystack = text.slice(Math.max(0, winStart), winEnd);
|
|
26072
|
-
for (const
|
|
26073
|
-
|
|
26074
|
-
|
|
26075
|
-
|
|
26076
|
-
|
|
26116
|
+
for (const re of memoizedRegExpList(
|
|
26117
|
+
"label",
|
|
26118
|
+
req,
|
|
26119
|
+
() => labels.map((label) => {
|
|
26120
|
+
const trimmed = label.trim();
|
|
26121
|
+
return trimmed.length === 0 ? void 0 : new RegExp(`(?<![A-Za-z0-9])${escapeRegExp2(trimmed)}(?![A-Za-z0-9])`, "i");
|
|
26122
|
+
})
|
|
26123
|
+
)) {
|
|
26124
|
+
if (re?.test(haystack)) return true;
|
|
26077
26125
|
}
|
|
26078
26126
|
}
|
|
26079
26127
|
return false;
|
|
@@ -28492,7 +28540,7 @@ import { basename as basename4, dirname as dirname3, sep as sep3 } from "path";
|
|
|
28492
28540
|
// ../../packages/plugin-sdk/src/project-files.ts
|
|
28493
28541
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
28494
28542
|
import { existsSync as existsSync8, readdirSync as readdirSync4, readFileSync as readFileSync8 } from "fs";
|
|
28495
|
-
import { basename as basename5, join as join12
|
|
28543
|
+
import { basename as basename5, join as join12 } from "path";
|
|
28496
28544
|
|
|
28497
28545
|
// ../../packages/plugin-sdk/src/provider-env-antigravity.ts
|
|
28498
28546
|
var optionalBaseUrl2 = external_exports.preprocess((v) => {
|
package/scripts/remediate.js
CHANGED
|
@@ -26081,6 +26081,40 @@ function escapeRegExp2(value) {
|
|
|
26081
26081
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
26082
26082
|
}
|
|
26083
26083
|
|
|
26084
|
+
// ../../packages/detections/src/regex-cache.ts
|
|
26085
|
+
var singles = /* @__PURE__ */ new WeakMap();
|
|
26086
|
+
var keywordLists = /* @__PURE__ */ new WeakMap();
|
|
26087
|
+
var labelLists = /* @__PURE__ */ new WeakMap();
|
|
26088
|
+
function listCache(kind) {
|
|
26089
|
+
return kind === "keyword" ? keywordLists : labelLists;
|
|
26090
|
+
}
|
|
26091
|
+
function memoizedRegExp(owner, build) {
|
|
26092
|
+
const cached2 = singles.get(owner);
|
|
26093
|
+
if (cached2 !== void 0) {
|
|
26094
|
+
cached2.lastIndex = 0;
|
|
26095
|
+
return cached2;
|
|
26096
|
+
}
|
|
26097
|
+
const compiled = build();
|
|
26098
|
+
singles.set(owner, compiled);
|
|
26099
|
+
return compiled;
|
|
26100
|
+
}
|
|
26101
|
+
function memoizedRegExpList(kind, owner, build) {
|
|
26102
|
+
const cache = listCache(kind);
|
|
26103
|
+
const cached2 = cache.get(owner);
|
|
26104
|
+
if (cached2 !== void 0) {
|
|
26105
|
+
if (cached2.stateful) {
|
|
26106
|
+
for (const re of cached2.entries) if (re !== void 0) re.lastIndex = 0;
|
|
26107
|
+
}
|
|
26108
|
+
return cached2.entries;
|
|
26109
|
+
}
|
|
26110
|
+
const entries = build();
|
|
26111
|
+
cache.set(owner, {
|
|
26112
|
+
entries,
|
|
26113
|
+
stateful: entries.some((re) => re !== void 0 && (re.global || re.sticky))
|
|
26114
|
+
});
|
|
26115
|
+
return entries;
|
|
26116
|
+
}
|
|
26117
|
+
|
|
26084
26118
|
// ../../packages/detections/src/matchers/limits.ts
|
|
26085
26119
|
var MAX_MATCHES_PER_RULE = 1e4;
|
|
26086
26120
|
var MAX_REGEX_INPUT_LENGTH = 2e5;
|
|
@@ -26091,10 +26125,17 @@ var KeywordMatcher2 = class {
|
|
|
26091
26125
|
if (rule.matcher.type !== "keyword") return [];
|
|
26092
26126
|
const { keywords, caseSensitive } = rule.matcher;
|
|
26093
26127
|
const spans = [];
|
|
26094
|
-
|
|
26095
|
-
|
|
26128
|
+
const compiled = memoizedRegExpList(
|
|
26129
|
+
"keyword",
|
|
26130
|
+
rule.matcher,
|
|
26131
|
+
() => keywords.map((kw) => {
|
|
26132
|
+
if (kw.length === 0) return void 0;
|
|
26133
|
+
return new RegExp(escapeRegExp2(kw), caseSensitive ? "gu" : "giu");
|
|
26134
|
+
})
|
|
26135
|
+
);
|
|
26136
|
+
for (const re of compiled) {
|
|
26137
|
+
if (re === void 0) continue;
|
|
26096
26138
|
if (spans.length >= MAX_MATCHES_PER_RULE) break;
|
|
26097
|
-
const re = new RegExp(escapeRegExp2(kw), caseSensitive ? "gu" : "giu");
|
|
26098
26139
|
let m;
|
|
26099
26140
|
while ((m = re.exec(text)) !== null) {
|
|
26100
26141
|
spans.push({ start: m.index, end: m.index + m[0].length });
|
|
@@ -26110,7 +26151,10 @@ var RegexMatcher2 = class {
|
|
|
26110
26151
|
match(text, rule) {
|
|
26111
26152
|
if (rule.matcher.type !== "regex") return [];
|
|
26112
26153
|
const { pattern, flags, captureGroup } = rule.matcher;
|
|
26113
|
-
const re =
|
|
26154
|
+
const re = memoizedRegExp(
|
|
26155
|
+
rule.matcher,
|
|
26156
|
+
() => new RegExp(pattern, flags.includes("d") ? flags : `${flags}d`)
|
|
26157
|
+
);
|
|
26114
26158
|
const scanText2 = text.length > MAX_REGEX_INPUT_LENGTH ? text.slice(0, MAX_REGEX_INPUT_LENGTH) : text;
|
|
26115
26159
|
const spans = [];
|
|
26116
26160
|
let m;
|
|
@@ -26218,11 +26262,15 @@ function isCorroborated(candidate, candidates, text) {
|
|
|
26218
26262
|
const labels = req.labels;
|
|
26219
26263
|
if (labels && labels.length > 0) {
|
|
26220
26264
|
const haystack = text.slice(Math.max(0, winStart), winEnd);
|
|
26221
|
-
for (const
|
|
26222
|
-
|
|
26223
|
-
|
|
26224
|
-
|
|
26225
|
-
|
|
26265
|
+
for (const re of memoizedRegExpList(
|
|
26266
|
+
"label",
|
|
26267
|
+
req,
|
|
26268
|
+
() => labels.map((label) => {
|
|
26269
|
+
const trimmed = label.trim();
|
|
26270
|
+
return trimmed.length === 0 ? void 0 : new RegExp(`(?<![A-Za-z0-9])${escapeRegExp2(trimmed)}(?![A-Za-z0-9])`, "i");
|
|
26271
|
+
})
|
|
26272
|
+
)) {
|
|
26273
|
+
if (re?.test(haystack)) return true;
|
|
26226
26274
|
}
|
|
26227
26275
|
}
|
|
26228
26276
|
return false;
|
|
@@ -26490,13 +26538,14 @@ function probesFor(rule) {
|
|
|
26490
26538
|
const derived = rule.matcher.type === "regex" ? derivedProbes(rule.matcher.pattern) : [];
|
|
26491
26539
|
return [...derived, ...EXPONENTIAL_PROBES, ...POLYNOMIAL_PROBES];
|
|
26492
26540
|
}
|
|
26493
|
-
|
|
26541
|
+
var wallClock = () => performance.now();
|
|
26542
|
+
function worstProbeMs(rule, now = wallClock) {
|
|
26494
26543
|
let ms = 0;
|
|
26495
26544
|
let probe = "";
|
|
26496
26545
|
for (const text of probesFor(rule)) {
|
|
26497
|
-
const start =
|
|
26546
|
+
const start = now();
|
|
26498
26547
|
scan(text, [rule]);
|
|
26499
|
-
const elapsed =
|
|
26548
|
+
const elapsed = now() - start;
|
|
26500
26549
|
if (elapsed > ms) {
|
|
26501
26550
|
ms = elapsed;
|
|
26502
26551
|
probe = text;
|
|
@@ -29131,7 +29180,7 @@ function applyCategoryPosture(posture, repo, mode = "fill-gaps") {
|
|
|
29131
29180
|
// ../../packages/plugin-sdk/src/project-files.ts
|
|
29132
29181
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
29133
29182
|
import { existsSync as existsSync8, readdirSync as readdirSync4, readFileSync as readFileSync8 } from "fs";
|
|
29134
|
-
import { basename as basename5, join as join12
|
|
29183
|
+
import { basename as basename5, join as join12 } from "path";
|
|
29135
29184
|
|
|
29136
29185
|
// ../../packages/plugin-sdk/src/provider-env-antigravity.ts
|
|
29137
29186
|
var optionalBaseUrl2 = external_exports.preprocess((v) => {
|
|
@@ -29878,8 +29927,8 @@ function table(headers, rows, opts = {}) {
|
|
|
29878
29927
|
const widths = headers.map(
|
|
29879
29928
|
(h, i) => Math.max(visibleLength(h), ...rows.map((r) => visibleLength(r[i] ?? "")))
|
|
29880
29929
|
);
|
|
29881
|
-
const
|
|
29882
|
-
const fmt = (cells) => cells.map((cell, i) => padEnd(cell, widths[i] ?? 0)).join(
|
|
29930
|
+
const sep4 = " ".repeat(gap);
|
|
29931
|
+
const fmt = (cells) => cells.map((cell, i) => padEnd(cell, widths[i] ?? 0)).join(sep4);
|
|
29883
29932
|
const headerLine = fmt(headers.map((h) => h.toUpperCase()));
|
|
29884
29933
|
if (opts.rowSep === true) {
|
|
29885
29934
|
const fullWidth = widths.reduce((n, w) => n + w, 0) + gap * Math.max(0, widths.length - 1);
|
|
@@ -29891,7 +29940,7 @@ function table(headers, rows, opts = {}) {
|
|
|
29891
29940
|
});
|
|
29892
29941
|
return [headerLine, rule, ...body].join("\n");
|
|
29893
29942
|
}
|
|
29894
|
-
const ruleLine = widths.map((w) => "\u2500".repeat(w)).join(
|
|
29943
|
+
const ruleLine = widths.map((w) => "\u2500".repeat(w)).join(sep4);
|
|
29895
29944
|
return [headerLine, ruleLine, ...rows.map(fmt)].join("\n");
|
|
29896
29945
|
}
|
|
29897
29946
|
function fenced(body) {
|
|
@@ -30311,7 +30360,7 @@ var DAY_MS5 = 24 * 60 * 60 * 1e3;
|
|
|
30311
30360
|
|
|
30312
30361
|
// src/remediation/redact.ts
|
|
30313
30362
|
import { readFileSync as readFileSync12, realpathSync as realpathSync3, renameSync as renameSync5, rmSync as rmSync6, writeFileSync as writeFileSync9 } from "fs";
|
|
30314
|
-
import { isAbsolute as isAbsolute2, relative
|
|
30363
|
+
import { isAbsolute as isAbsolute2, relative, resolve } from "path";
|
|
30315
30364
|
var REDACTED_PLACEHOLDER = "[REDACTED:SECRET]";
|
|
30316
30365
|
function platformRedactionScope(home) {
|
|
30317
30366
|
return { artifactRoots: [transcriptsDir(home)] };
|
|
@@ -30326,7 +30375,7 @@ function realPathOrNull(path) {
|
|
|
30326
30375
|
function isWithinRoot(realTarget, root) {
|
|
30327
30376
|
const realRoot = realPathOrNull(root);
|
|
30328
30377
|
if (realRoot === null) return false;
|
|
30329
|
-
const rel =
|
|
30378
|
+
const rel = relative(realRoot, realTarget);
|
|
30330
30379
|
return rel !== "" && !rel.startsWith("..") && !isAbsolute2(rel);
|
|
30331
30380
|
}
|
|
30332
30381
|
function resolveRedactableArtifact(filePath, scope) {
|
package/scripts/scan-worker.js
CHANGED
|
@@ -579,6 +579,40 @@ function escapeRegExp2(value) {
|
|
|
579
579
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
580
580
|
}
|
|
581
581
|
|
|
582
|
+
// ../../packages/detections/src/regex-cache.ts
|
|
583
|
+
var singles = /* @__PURE__ */ new WeakMap();
|
|
584
|
+
var keywordLists = /* @__PURE__ */ new WeakMap();
|
|
585
|
+
var labelLists = /* @__PURE__ */ new WeakMap();
|
|
586
|
+
function listCache(kind) {
|
|
587
|
+
return kind === "keyword" ? keywordLists : labelLists;
|
|
588
|
+
}
|
|
589
|
+
function memoizedRegExp(owner, build) {
|
|
590
|
+
const cached2 = singles.get(owner);
|
|
591
|
+
if (cached2 !== void 0) {
|
|
592
|
+
cached2.lastIndex = 0;
|
|
593
|
+
return cached2;
|
|
594
|
+
}
|
|
595
|
+
const compiled = build();
|
|
596
|
+
singles.set(owner, compiled);
|
|
597
|
+
return compiled;
|
|
598
|
+
}
|
|
599
|
+
function memoizedRegExpList(kind, owner, build) {
|
|
600
|
+
const cache = listCache(kind);
|
|
601
|
+
const cached2 = cache.get(owner);
|
|
602
|
+
if (cached2 !== void 0) {
|
|
603
|
+
if (cached2.stateful) {
|
|
604
|
+
for (const re of cached2.entries) if (re !== void 0) re.lastIndex = 0;
|
|
605
|
+
}
|
|
606
|
+
return cached2.entries;
|
|
607
|
+
}
|
|
608
|
+
const entries = build();
|
|
609
|
+
cache.set(owner, {
|
|
610
|
+
entries,
|
|
611
|
+
stateful: entries.some((re) => re !== void 0 && (re.global || re.sticky))
|
|
612
|
+
});
|
|
613
|
+
return entries;
|
|
614
|
+
}
|
|
615
|
+
|
|
582
616
|
// ../../packages/detections/src/matchers/limits.ts
|
|
583
617
|
var MAX_MATCHES_PER_RULE = 1e4;
|
|
584
618
|
var MAX_REGEX_INPUT_LENGTH = 2e5;
|
|
@@ -589,10 +623,17 @@ var KeywordMatcher = class {
|
|
|
589
623
|
if (rule.matcher.type !== "keyword") return [];
|
|
590
624
|
const { keywords, caseSensitive } = rule.matcher;
|
|
591
625
|
const spans = [];
|
|
592
|
-
|
|
593
|
-
|
|
626
|
+
const compiled = memoizedRegExpList(
|
|
627
|
+
"keyword",
|
|
628
|
+
rule.matcher,
|
|
629
|
+
() => keywords.map((kw) => {
|
|
630
|
+
if (kw.length === 0) return void 0;
|
|
631
|
+
return new RegExp(escapeRegExp2(kw), caseSensitive ? "gu" : "giu");
|
|
632
|
+
})
|
|
633
|
+
);
|
|
634
|
+
for (const re of compiled) {
|
|
635
|
+
if (re === void 0) continue;
|
|
594
636
|
if (spans.length >= MAX_MATCHES_PER_RULE) break;
|
|
595
|
-
const re = new RegExp(escapeRegExp2(kw), caseSensitive ? "gu" : "giu");
|
|
596
637
|
let m;
|
|
597
638
|
while ((m = re.exec(text)) !== null) {
|
|
598
639
|
spans.push({ start: m.index, end: m.index + m[0].length });
|
|
@@ -608,7 +649,10 @@ var RegexMatcher = class {
|
|
|
608
649
|
match(text, rule) {
|
|
609
650
|
if (rule.matcher.type !== "regex") return [];
|
|
610
651
|
const { pattern, flags, captureGroup } = rule.matcher;
|
|
611
|
-
const re =
|
|
652
|
+
const re = memoizedRegExp(
|
|
653
|
+
rule.matcher,
|
|
654
|
+
() => new RegExp(pattern, flags.includes("d") ? flags : `${flags}d`)
|
|
655
|
+
);
|
|
612
656
|
const scanText = text.length > MAX_REGEX_INPUT_LENGTH ? text.slice(0, MAX_REGEX_INPUT_LENGTH) : text;
|
|
613
657
|
const spans = [];
|
|
614
658
|
let m;
|
|
@@ -713,11 +757,15 @@ function isCorroborated(candidate, candidates, text) {
|
|
|
713
757
|
const labels = req.labels;
|
|
714
758
|
if (labels && labels.length > 0) {
|
|
715
759
|
const haystack = text.slice(Math.max(0, winStart), winEnd);
|
|
716
|
-
for (const
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
760
|
+
for (const re of memoizedRegExpList(
|
|
761
|
+
"label",
|
|
762
|
+
req,
|
|
763
|
+
() => labels.map((label) => {
|
|
764
|
+
const trimmed = label.trim();
|
|
765
|
+
return trimmed.length === 0 ? void 0 : new RegExp(`(?<![A-Za-z0-9])${escapeRegExp2(trimmed)}(?![A-Za-z0-9])`, "i");
|
|
766
|
+
})
|
|
767
|
+
)) {
|
|
768
|
+
if (re?.test(haystack)) return true;
|
|
721
769
|
}
|
|
722
770
|
}
|
|
723
771
|
return false;
|
|
@@ -17951,13 +17999,14 @@ function probesFor(rule) {
|
|
|
17951
17999
|
const derived = rule.matcher.type === "regex" ? derivedProbes(rule.matcher.pattern) : [];
|
|
17952
18000
|
return [...derived, ...EXPONENTIAL_PROBES, ...POLYNOMIAL_PROBES];
|
|
17953
18001
|
}
|
|
17954
|
-
|
|
18002
|
+
var wallClock = () => performance.now();
|
|
18003
|
+
function worstProbeMs(rule, now = wallClock) {
|
|
17955
18004
|
let ms = 0;
|
|
17956
18005
|
let probe = "";
|
|
17957
18006
|
for (const text of probesFor(rule)) {
|
|
17958
|
-
const start =
|
|
18007
|
+
const start = now();
|
|
17959
18008
|
scan(text, [rule]);
|
|
17960
|
-
const elapsed =
|
|
18009
|
+
const elapsed = now() - start;
|
|
17961
18010
|
if (elapsed > ms) {
|
|
17962
18011
|
ms = elapsed;
|
|
17963
18012
|
probe = text;
|
package/scripts/start-light.js
CHANGED
|
@@ -18255,6 +18255,40 @@ function escapeRegExp2(value) {
|
|
|
18255
18255
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
18256
18256
|
}
|
|
18257
18257
|
|
|
18258
|
+
// ../../packages/detections/src/regex-cache.ts
|
|
18259
|
+
var singles = /* @__PURE__ */ new WeakMap();
|
|
18260
|
+
var keywordLists = /* @__PURE__ */ new WeakMap();
|
|
18261
|
+
var labelLists = /* @__PURE__ */ new WeakMap();
|
|
18262
|
+
function listCache(kind) {
|
|
18263
|
+
return kind === "keyword" ? keywordLists : labelLists;
|
|
18264
|
+
}
|
|
18265
|
+
function memoizedRegExp(owner, build) {
|
|
18266
|
+
const cached2 = singles.get(owner);
|
|
18267
|
+
if (cached2 !== void 0) {
|
|
18268
|
+
cached2.lastIndex = 0;
|
|
18269
|
+
return cached2;
|
|
18270
|
+
}
|
|
18271
|
+
const compiled = build();
|
|
18272
|
+
singles.set(owner, compiled);
|
|
18273
|
+
return compiled;
|
|
18274
|
+
}
|
|
18275
|
+
function memoizedRegExpList(kind, owner, build) {
|
|
18276
|
+
const cache = listCache(kind);
|
|
18277
|
+
const cached2 = cache.get(owner);
|
|
18278
|
+
if (cached2 !== void 0) {
|
|
18279
|
+
if (cached2.stateful) {
|
|
18280
|
+
for (const re of cached2.entries) if (re !== void 0) re.lastIndex = 0;
|
|
18281
|
+
}
|
|
18282
|
+
return cached2.entries;
|
|
18283
|
+
}
|
|
18284
|
+
const entries = build();
|
|
18285
|
+
cache.set(owner, {
|
|
18286
|
+
entries,
|
|
18287
|
+
stateful: entries.some((re) => re !== void 0 && (re.global || re.sticky))
|
|
18288
|
+
});
|
|
18289
|
+
return entries;
|
|
18290
|
+
}
|
|
18291
|
+
|
|
18258
18292
|
// ../../packages/detections/src/matchers/limits.ts
|
|
18259
18293
|
var MAX_MATCHES_PER_RULE = 1e4;
|
|
18260
18294
|
var MAX_REGEX_INPUT_LENGTH = 2e5;
|
|
@@ -18265,10 +18299,17 @@ var KeywordMatcher2 = class {
|
|
|
18265
18299
|
if (rule.matcher.type !== "keyword") return [];
|
|
18266
18300
|
const { keywords, caseSensitive } = rule.matcher;
|
|
18267
18301
|
const spans = [];
|
|
18268
|
-
|
|
18269
|
-
|
|
18302
|
+
const compiled = memoizedRegExpList(
|
|
18303
|
+
"keyword",
|
|
18304
|
+
rule.matcher,
|
|
18305
|
+
() => keywords.map((kw) => {
|
|
18306
|
+
if (kw.length === 0) return void 0;
|
|
18307
|
+
return new RegExp(escapeRegExp2(kw), caseSensitive ? "gu" : "giu");
|
|
18308
|
+
})
|
|
18309
|
+
);
|
|
18310
|
+
for (const re of compiled) {
|
|
18311
|
+
if (re === void 0) continue;
|
|
18270
18312
|
if (spans.length >= MAX_MATCHES_PER_RULE) break;
|
|
18271
|
-
const re = new RegExp(escapeRegExp2(kw), caseSensitive ? "gu" : "giu");
|
|
18272
18313
|
let m;
|
|
18273
18314
|
while ((m = re.exec(text)) !== null) {
|
|
18274
18315
|
spans.push({ start: m.index, end: m.index + m[0].length });
|
|
@@ -18284,7 +18325,10 @@ var RegexMatcher2 = class {
|
|
|
18284
18325
|
match(text, rule) {
|
|
18285
18326
|
if (rule.matcher.type !== "regex") return [];
|
|
18286
18327
|
const { pattern, flags, captureGroup } = rule.matcher;
|
|
18287
|
-
const re =
|
|
18328
|
+
const re = memoizedRegExp(
|
|
18329
|
+
rule.matcher,
|
|
18330
|
+
() => new RegExp(pattern, flags.includes("d") ? flags : `${flags}d`)
|
|
18331
|
+
);
|
|
18288
18332
|
const scanText2 = text.length > MAX_REGEX_INPUT_LENGTH ? text.slice(0, MAX_REGEX_INPUT_LENGTH) : text;
|
|
18289
18333
|
const spans = [];
|
|
18290
18334
|
let m;
|
|
@@ -18417,7 +18461,7 @@ import { basename as basename4, dirname as dirname3, sep as sep3 } from "path";
|
|
|
18417
18461
|
// ../../packages/plugin-sdk/src/project-files.ts
|
|
18418
18462
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
18419
18463
|
import { existsSync as existsSync8, readdirSync as readdirSync4, readFileSync as readFileSync8 } from "fs";
|
|
18420
|
-
import { basename as basename5, join as join12
|
|
18464
|
+
import { basename as basename5, join as join12 } from "path";
|
|
18421
18465
|
|
|
18422
18466
|
// ../../packages/plugin-sdk/src/provider-env-antigravity.ts
|
|
18423
18467
|
var optionalBaseUrl2 = external_exports.preprocess((v) => {
|
|
@@ -18615,8 +18659,8 @@ function table(headers, rows, opts = {}) {
|
|
|
18615
18659
|
const widths = headers.map(
|
|
18616
18660
|
(h, i) => Math.max(visibleLength(h), ...rows.map((r) => visibleLength(r[i] ?? "")))
|
|
18617
18661
|
);
|
|
18618
|
-
const
|
|
18619
|
-
const fmt = (cells) => cells.map((cell, i) => padEnd(cell, widths[i] ?? 0)).join(
|
|
18662
|
+
const sep4 = " ".repeat(gap);
|
|
18663
|
+
const fmt = (cells) => cells.map((cell, i) => padEnd(cell, widths[i] ?? 0)).join(sep4);
|
|
18620
18664
|
const headerLine = fmt(headers.map((h) => h.toUpperCase()));
|
|
18621
18665
|
if (opts.rowSep === true) {
|
|
18622
18666
|
const fullWidth = widths.reduce((n, w) => n + w, 0) + gap * Math.max(0, widths.length - 1);
|
|
@@ -18628,7 +18672,7 @@ function table(headers, rows, opts = {}) {
|
|
|
18628
18672
|
});
|
|
18629
18673
|
return [headerLine, rule, ...body].join("\n");
|
|
18630
18674
|
}
|
|
18631
|
-
const ruleLine = widths.map((w) => "\u2500".repeat(w)).join(
|
|
18675
|
+
const ruleLine = widths.map((w) => "\u2500".repeat(w)).join(sep4);
|
|
18632
18676
|
return [headerLine, ruleLine, ...rows.map(fmt)].join("\n");
|
|
18633
18677
|
}
|
|
18634
18678
|
function fenced(body) {
|
package/scripts/stop.js
CHANGED
|
@@ -18395,6 +18395,40 @@ function escapeRegExp2(value) {
|
|
|
18395
18395
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
18396
18396
|
}
|
|
18397
18397
|
|
|
18398
|
+
// ../../packages/detections/src/regex-cache.ts
|
|
18399
|
+
var singles = /* @__PURE__ */ new WeakMap();
|
|
18400
|
+
var keywordLists = /* @__PURE__ */ new WeakMap();
|
|
18401
|
+
var labelLists = /* @__PURE__ */ new WeakMap();
|
|
18402
|
+
function listCache(kind) {
|
|
18403
|
+
return kind === "keyword" ? keywordLists : labelLists;
|
|
18404
|
+
}
|
|
18405
|
+
function memoizedRegExp(owner, build) {
|
|
18406
|
+
const cached2 = singles.get(owner);
|
|
18407
|
+
if (cached2 !== void 0) {
|
|
18408
|
+
cached2.lastIndex = 0;
|
|
18409
|
+
return cached2;
|
|
18410
|
+
}
|
|
18411
|
+
const compiled = build();
|
|
18412
|
+
singles.set(owner, compiled);
|
|
18413
|
+
return compiled;
|
|
18414
|
+
}
|
|
18415
|
+
function memoizedRegExpList(kind, owner, build) {
|
|
18416
|
+
const cache = listCache(kind);
|
|
18417
|
+
const cached2 = cache.get(owner);
|
|
18418
|
+
if (cached2 !== void 0) {
|
|
18419
|
+
if (cached2.stateful) {
|
|
18420
|
+
for (const re of cached2.entries) if (re !== void 0) re.lastIndex = 0;
|
|
18421
|
+
}
|
|
18422
|
+
return cached2.entries;
|
|
18423
|
+
}
|
|
18424
|
+
const entries = build();
|
|
18425
|
+
cache.set(owner, {
|
|
18426
|
+
entries,
|
|
18427
|
+
stateful: entries.some((re) => re !== void 0 && (re.global || re.sticky))
|
|
18428
|
+
});
|
|
18429
|
+
return entries;
|
|
18430
|
+
}
|
|
18431
|
+
|
|
18398
18432
|
// ../../packages/detections/src/matchers/limits.ts
|
|
18399
18433
|
var MAX_MATCHES_PER_RULE = 1e4;
|
|
18400
18434
|
var MAX_REGEX_INPUT_LENGTH = 2e5;
|
|
@@ -18405,10 +18439,17 @@ var KeywordMatcher2 = class {
|
|
|
18405
18439
|
if (rule.matcher.type !== "keyword") return [];
|
|
18406
18440
|
const { keywords, caseSensitive } = rule.matcher;
|
|
18407
18441
|
const spans = [];
|
|
18408
|
-
|
|
18409
|
-
|
|
18442
|
+
const compiled = memoizedRegExpList(
|
|
18443
|
+
"keyword",
|
|
18444
|
+
rule.matcher,
|
|
18445
|
+
() => keywords.map((kw) => {
|
|
18446
|
+
if (kw.length === 0) return void 0;
|
|
18447
|
+
return new RegExp(escapeRegExp2(kw), caseSensitive ? "gu" : "giu");
|
|
18448
|
+
})
|
|
18449
|
+
);
|
|
18450
|
+
for (const re of compiled) {
|
|
18451
|
+
if (re === void 0) continue;
|
|
18410
18452
|
if (spans.length >= MAX_MATCHES_PER_RULE) break;
|
|
18411
|
-
const re = new RegExp(escapeRegExp2(kw), caseSensitive ? "gu" : "giu");
|
|
18412
18453
|
let m;
|
|
18413
18454
|
while ((m = re.exec(text)) !== null) {
|
|
18414
18455
|
spans.push({ start: m.index, end: m.index + m[0].length });
|
|
@@ -18424,7 +18465,10 @@ var RegexMatcher2 = class {
|
|
|
18424
18465
|
match(text, rule) {
|
|
18425
18466
|
if (rule.matcher.type !== "regex") return [];
|
|
18426
18467
|
const { pattern, flags, captureGroup } = rule.matcher;
|
|
18427
|
-
const re =
|
|
18468
|
+
const re = memoizedRegExp(
|
|
18469
|
+
rule.matcher,
|
|
18470
|
+
() => new RegExp(pattern, flags.includes("d") ? flags : `${flags}d`)
|
|
18471
|
+
);
|
|
18428
18472
|
const scanText2 = text.length > MAX_REGEX_INPUT_LENGTH ? text.slice(0, MAX_REGEX_INPUT_LENGTH) : text;
|
|
18429
18473
|
const spans = [];
|
|
18430
18474
|
let m;
|
|
@@ -18557,7 +18601,7 @@ import { basename as basename4, dirname as dirname3, sep as sep3 } from "path";
|
|
|
18557
18601
|
// ../../packages/plugin-sdk/src/project-files.ts
|
|
18558
18602
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
18559
18603
|
import { existsSync as existsSync8, readdirSync as readdirSync4, readFileSync as readFileSync8 } from "fs";
|
|
18560
|
-
import { basename as basename5, join as join12
|
|
18604
|
+
import { basename as basename5, join as join12 } from "path";
|
|
18561
18605
|
|
|
18562
18606
|
// ../../packages/plugin-sdk/src/provider-env-antigravity.ts
|
|
18563
18607
|
var optionalBaseUrl2 = external_exports.preprocess((v) => {
|
package/skills/setup/SKILL.md
CHANGED
|
@@ -926,3 +926,20 @@ pointer inside a shell command is denied rather than executed or substituted.
|
|
|
926
926
|
If the user asks about recovering a redacted value, point them at the vault
|
|
927
927
|
surfaces that do exist on this machine (`aka vault show`, the dashboard's
|
|
928
928
|
Vault page) rather than implying this plugin can reveal anything.
|
|
929
|
+
|
|
930
|
+
**The model-judge step cannot run on native Windows.** The judge spawns the
|
|
931
|
+
`agy` CLI through a shell-free `execFileSync`, and an npm-installed CLI is a
|
|
932
|
+
`.cmd` shim on Windows, which Node has refused to spawn without a shell since
|
|
933
|
+
the CVE-2024-27980 fix. So a user who grants model-judge consent gets a spawn
|
|
934
|
+
failure at that step rather than a rated set of findings, and the step exits
|
|
935
|
+
non-zero instead of completing. Everything before it is unaffected — the
|
|
936
|
+
calibration questions, the consent-gated historical read, and the local ruleset
|
|
937
|
+
scan all run, and every finding is still detected and redacted locally. What is
|
|
938
|
+
unavailable is only the model pass that rates false positives and severity.
|
|
939
|
+
|
|
940
|
+
Say this plainly if a Windows user asks why setup stopped there, and do not
|
|
941
|
+
offer to retry it: the fix is a code change, tracked separately. Two things
|
|
942
|
+
worth getting right if it comes up — running under WSL2 is Linux rather than
|
|
943
|
+
Windows and is not affected, and declining model-judge consent is not a
|
|
944
|
+
workaround so much as the other supported path, since the local scan is what
|
|
945
|
+
produces the findings in the first place.
|