@akasecurity/ai-tc-codex 0.9.15 → 0.9.16
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/.codex-plugin/plugin.json +1 -1
- package/hooks/hooks.json +1 -1
- package/package.json +5 -5
- package/scripts/apply-suppressions.js +1472 -393
- package/scripts/backfill.js +1963 -424
- package/scripts/content-retention.js +825 -227
- package/scripts/filescan.js +1900 -361
- package/scripts/firstrun.js +1406 -301
- package/scripts/history-sync.js +841 -228
- package/scripts/intro.js +328 -170
- package/scripts/onboard.js +823 -219
- package/scripts/post-tool-use.js +1960 -343
- package/scripts/pre-tool-use.js +1864 -338
- package/scripts/query.js +1405 -300
- package/scripts/reconcile.js +1873 -329
- package/scripts/remediate.js +1838 -350
- package/scripts/scan-worker.js +281 -149
- package/scripts/session-start.js +1821 -331
- package/scripts/start-light.js +328 -170
- package/scripts/stop.js +346 -190
- package/scripts/sync.js +1898 -359
- package/scripts/user-prompt-submit.js +1906 -373
- package/skills/setup/SKILL.md +27 -12
package/scripts/intro.js
CHANGED
|
@@ -32,9 +32,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
32
32
|
mod
|
|
33
33
|
));
|
|
34
34
|
|
|
35
|
-
// ../../node_modules/.pnpm/ignore@7.0.
|
|
35
|
+
// ../../node_modules/.pnpm/ignore@7.0.11/node_modules/ignore/index.js
|
|
36
36
|
var require_ignore = __commonJS({
|
|
37
|
-
"../../node_modules/.pnpm/ignore@7.0.
|
|
37
|
+
"../../node_modules/.pnpm/ignore@7.0.11/node_modules/ignore/index.js"(exports, module) {
|
|
38
38
|
"use strict";
|
|
39
39
|
function makeArray(subject) {
|
|
40
40
|
return Array.isArray(subject) ? subject : [subject];
|
|
@@ -169,6 +169,7 @@ var require_ignore = __commonJS({
|
|
|
169
169
|
"g"
|
|
170
170
|
);
|
|
171
171
|
var TRAILING_WILDCARD = "\uE000";
|
|
172
|
+
var TRAILING_DOUBLESTAR = "\uE001";
|
|
172
173
|
var extractBrackets = (pattern) => {
|
|
173
174
|
const sources = [];
|
|
174
175
|
const hold = (source) => `${PLACEHOLDER}${sources.push(source) - 1}${PLACEHOLDER}`;
|
|
@@ -329,7 +330,7 @@ var require_ignore = __commonJS({
|
|
|
329
330
|
// Zero, one or several directories
|
|
330
331
|
// should not use '*', or it will be replaced by the next replacer
|
|
331
332
|
// Check if it is not the last `'/**'`
|
|
332
|
-
(_, index, str) => index + 6 < str.length ? str.slice(index + 6) === "\\/" ? "(?:\\/[^\\/]+)+" : "(?:\\/[^\\/]+)*" :
|
|
333
|
+
(_, index, str) => index + 6 < str.length ? str.slice(index + 6) === "\\/" ? "(?:\\/[^\\/]+)+" : "(?:\\/[^\\/]+)*" : `\\/${TRAILING_DOUBLESTAR}`,
|
|
333
334
|
"*"
|
|
334
335
|
],
|
|
335
336
|
// normal intermediate wildcards
|
|
@@ -407,7 +408,7 @@ var require_ignore = __commonJS({
|
|
|
407
408
|
// 'js' will match 'a.js' and 'a.js/'
|
|
408
409
|
(source) => {
|
|
409
410
|
const last = source[source.length - 1];
|
|
410
|
-
if (!last || last === TRAILING_WILDCARD) {
|
|
411
|
+
if (!last || last === TRAILING_WILDCARD || last === TRAILING_DOUBLESTAR) {
|
|
411
412
|
return source;
|
|
412
413
|
}
|
|
413
414
|
return last === SLASH2 ? `${source}$` : `${source}(?=$|\\/$)`;
|
|
@@ -418,16 +419,12 @@ var require_ignore = __commonJS({
|
|
|
418
419
|
var MODE_IGNORE = "regex";
|
|
419
420
|
var MODE_CHECK_IGNORE = "checkRegex";
|
|
420
421
|
var UNDERSCORE = "_";
|
|
421
|
-
var
|
|
422
|
-
[
|
|
423
|
-
|
|
424
|
-
return `${prefix}(?=$|\\/$)`;
|
|
425
|
-
},
|
|
426
|
-
[MODE_CHECK_IGNORE](_, p1) {
|
|
427
|
-
const prefix = p1 ? `${p1}[^/]*` : "[^/]*";
|
|
428
|
-
return `${prefix}(?=$|\\/$)`;
|
|
429
|
-
}
|
|
422
|
+
var replaceTrailingWildcard = (_, p1) => {
|
|
423
|
+
const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
|
|
424
|
+
return `${prefix}(?=$|\\/$)`;
|
|
430
425
|
};
|
|
426
|
+
var REGEX_REPLACE_TRAILING_DOUBLESTAR = /\uE001$/;
|
|
427
|
+
var replaceTrailingDoublestar = () => ".+(?=$|\\/$)";
|
|
431
428
|
var WILDCARD = "[^\\/]*";
|
|
432
429
|
var separatorAfter = (run, at) => {
|
|
433
430
|
let separator = EMPTY;
|
|
@@ -543,6 +540,14 @@ var require_ignore = __commonJS({
|
|
|
543
540
|
(match, index) => sources[index]
|
|
544
541
|
) : replaced;
|
|
545
542
|
};
|
|
543
|
+
var checkSourceOf = (body, prefix) => {
|
|
544
|
+
if (body[body.length - 1] === SLASH2) {
|
|
545
|
+
prefix = makeRegexPrefix(body.slice(0, -1));
|
|
546
|
+
}
|
|
547
|
+
const head = prefix.slice(0, -1);
|
|
548
|
+
const last = prefix[prefix.length - 1];
|
|
549
|
+
return last === TRAILING_WILDCARD ? `${head}$` : last === TRAILING_DOUBLESTAR ? `${head}.*$` : NEVER_MATCH;
|
|
550
|
+
};
|
|
546
551
|
var matchesBasename = (body) => {
|
|
547
552
|
const index = body.indexOf(SLASH2);
|
|
548
553
|
return index < 0 || index === body.length - 1;
|
|
@@ -603,11 +608,9 @@ var require_ignore = __commonJS({
|
|
|
603
608
|
return this._make(MODE_CHECK_IGNORE, key);
|
|
604
609
|
}
|
|
605
610
|
_make(mode, key) {
|
|
606
|
-
const str = pinWildcards(
|
|
607
|
-
REGEX_REPLACE_TRAILING_WILDCARD,
|
|
608
|
-
|
|
609
|
-
TRAILING_WILD_CARD_REPLACERS[mode]
|
|
610
|
-
));
|
|
611
|
+
const str = pinWildcards(
|
|
612
|
+
mode === MODE_IGNORE ? this.regexPrefix.replace(REGEX_REPLACE_TRAILING_WILDCARD, replaceTrailingWildcard).replace(REGEX_REPLACE_TRAILING_DOUBLESTAR, replaceTrailingDoublestar) : checkSourceOf(this.body, this.regexPrefix)
|
|
613
|
+
);
|
|
611
614
|
const regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
|
|
612
615
|
return define(this, key, regex);
|
|
613
616
|
}
|
|
@@ -666,8 +669,39 @@ var require_ignore = __commonJS({
|
|
|
666
669
|
makeArray(
|
|
667
670
|
isString(pattern) ? splitPattern(pattern) : pattern
|
|
668
671
|
).forEach(this._add, this);
|
|
672
|
+
if (this._added) {
|
|
673
|
+
this._literalRules = UNDEFINED;
|
|
674
|
+
}
|
|
669
675
|
return this._added;
|
|
670
676
|
}
|
|
677
|
+
// Match the literal 'abc/' for `checkIgnore`, last rule wins. Only a rule
|
|
678
|
+
// ending in a wildcard can match it (see `checkSourceOf`), so the rest
|
|
679
|
+
// are left out once, rather than tested or compiled for every path.
|
|
680
|
+
testLiteral(path) {
|
|
681
|
+
const rules = this._literalRules || (this._literalRules = this._rules.filter(
|
|
682
|
+
({ body }) => body[body.length - (body[body.length - 1] === SLASH2 ? 2 : 1)] === "*"
|
|
683
|
+
));
|
|
684
|
+
let ignored = false;
|
|
685
|
+
let unignored = false;
|
|
686
|
+
let matchedRule;
|
|
687
|
+
for (let index = rules.length - 1; index >= 0; index--) {
|
|
688
|
+
const rule = rules[index];
|
|
689
|
+
if (rule.checkRegex.test(path)) {
|
|
690
|
+
ignored = !rule.negative;
|
|
691
|
+
unignored = rule.negative;
|
|
692
|
+
matchedRule = rule.negative ? UNDEFINED : rule;
|
|
693
|
+
break;
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
const ret = {
|
|
697
|
+
ignored,
|
|
698
|
+
unignored
|
|
699
|
+
};
|
|
700
|
+
if (matchedRule) {
|
|
701
|
+
ret.rule = matchedRule;
|
|
702
|
+
}
|
|
703
|
+
return ret;
|
|
704
|
+
}
|
|
671
705
|
// Test one single path without recursively checking parent directories
|
|
672
706
|
//
|
|
673
707
|
// - checkUnignored `boolean` whether should check if the path is unignored,
|
|
@@ -788,14 +822,12 @@ var require_ignore = __commonJS({
|
|
|
788
822
|
if (path.charCodeAt(path.length - 1) !== SLASH_CODE) {
|
|
789
823
|
return this.test(path);
|
|
790
824
|
}
|
|
791
|
-
const
|
|
792
|
-
if (
|
|
793
|
-
|
|
794
|
-
if (parent.ignored) {
|
|
795
|
-
return parent;
|
|
796
|
-
}
|
|
825
|
+
const dir = this._t(path, this._testCache, true);
|
|
826
|
+
if (dir.ignored) {
|
|
827
|
+
return dir;
|
|
797
828
|
}
|
|
798
|
-
|
|
829
|
+
const literal2 = this._rules.testLiteral(path);
|
|
830
|
+
return literal2.ignored || literal2.unignored ? literal2 : dir;
|
|
799
831
|
}
|
|
800
832
|
_t(path, cache, checkUnignored) {
|
|
801
833
|
if (path in cache) {
|
|
@@ -21571,11 +21603,33 @@ var ResolutionMethod = external_exports.enum([
|
|
|
21571
21603
|
"false-positive",
|
|
21572
21604
|
"redetected"
|
|
21573
21605
|
]).meta({ id: "ResolutionMethod" });
|
|
21606
|
+
var FindingContextBasis = external_exports.enum(["file", "excerpt"]).meta({ id: "FindingContextBasis" });
|
|
21607
|
+
var FindingContext = external_exports.object({
|
|
21608
|
+
basis: FindingContextBasis,
|
|
21609
|
+
// 1-based line number of `lines[0]`.
|
|
21610
|
+
firstLine: external_exports.number().int().positive(),
|
|
21611
|
+
lines: external_exports.array(external_exports.string()).min(1).max(5),
|
|
21612
|
+
match: external_exports.object({
|
|
21613
|
+
// 1-based line number, within [firstLine, firstLine + lines.length).
|
|
21614
|
+
line: external_exports.number().int().positive(),
|
|
21615
|
+
// Offsets into that entry of `lines`, end exclusive.
|
|
21616
|
+
start: external_exports.number().int().nonnegative(),
|
|
21617
|
+
end: external_exports.number().int().nonnegative()
|
|
21618
|
+
}).nullable()
|
|
21619
|
+
}).meta({ id: "FindingContext" });
|
|
21620
|
+
var FindingLocation = external_exports.object({
|
|
21621
|
+
line: external_exports.number().int().positive(),
|
|
21622
|
+
col: external_exports.number().int().positive(),
|
|
21623
|
+
context: FindingContext.nullable()
|
|
21624
|
+
});
|
|
21574
21625
|
var FindingMatch = external_exports.object({
|
|
21575
21626
|
// Masked preview of the matched value. Never raw content.
|
|
21576
21627
|
maskedValue: external_exports.string(),
|
|
21577
|
-
//
|
|
21578
|
-
contextPrefix: external_exports.string()
|
|
21628
|
+
// Deprecated: always empty. Superseded by `context`.
|
|
21629
|
+
contextPrefix: external_exports.string(),
|
|
21630
|
+
// The masked lines around the match. Absent when the finding predates
|
|
21631
|
+
// context capture or none could be built safely.
|
|
21632
|
+
context: FindingContext.optional()
|
|
21579
21633
|
}).meta({ id: "FindingMatch" });
|
|
21580
21634
|
var FindingDetectionRef = external_exports.object({
|
|
21581
21635
|
id: external_exports.string(),
|
|
@@ -21595,6 +21649,11 @@ var FindingInstance = external_exports.object({
|
|
|
21595
21649
|
provider: FindingProvider,
|
|
21596
21650
|
repo: external_exports.string(),
|
|
21597
21651
|
file: external_exports.string(),
|
|
21652
|
+
// 1-based line and column of the match start in the scanned text (the
|
|
21653
|
+
// column in UTF-16 code units). Absent for findings that predate location
|
|
21654
|
+
// capture or have no source text.
|
|
21655
|
+
line: external_exports.number().int().positive().optional(),
|
|
21656
|
+
col: external_exports.number().int().positive().optional(),
|
|
21598
21657
|
// Who the capturing event is attributed to. Optional: a single-user store
|
|
21599
21658
|
// has no one to attribute a finding to and never sets it.
|
|
21600
21659
|
user: FindingUser.optional(),
|
|
@@ -21656,6 +21715,13 @@ var FindingStats = external_exports.object({
|
|
|
21656
21715
|
low: external_exports.number().int().nonnegative()
|
|
21657
21716
|
})
|
|
21658
21717
|
}).meta({ id: "FindingStats" });
|
|
21718
|
+
var FindingsOverview = external_exports.object({
|
|
21719
|
+
findings: external_exports.number().int().nonnegative(),
|
|
21720
|
+
open: external_exports.number().int().nonnegative(),
|
|
21721
|
+
handled: external_exports.number().int().nonnegative(),
|
|
21722
|
+
resolved: external_exports.number().int().nonnegative(),
|
|
21723
|
+
dismissed: external_exports.number().int().nonnegative()
|
|
21724
|
+
}).meta({ id: "FindingsOverview" });
|
|
21659
21725
|
var FindingFacetItem = external_exports.object({
|
|
21660
21726
|
value: external_exports.string(),
|
|
21661
21727
|
count: external_exports.number().int().nonnegative()
|
|
@@ -21773,6 +21839,7 @@ var FindingInstanceDetail = FindingInstance.extend({
|
|
|
21773
21839
|
policy: FindingPolicyRef
|
|
21774
21840
|
}).meta({ id: "FindingInstanceDetail" });
|
|
21775
21841
|
var MAX_FLAT_FINDINGS_LIMIT = 200;
|
|
21842
|
+
var FindingContextQuery = external_exports.object({ id: external_exports.string().min(1).max(256) });
|
|
21776
21843
|
var ListFindingInstancesQuery = external_exports.object({
|
|
21777
21844
|
severity: external_exports.array(Severity).optional(),
|
|
21778
21845
|
// Rule ids, the same vocabulary the types list's `subtype` carries. Pinning
|
|
@@ -22104,7 +22171,23 @@ var CaptureAttributes = external_exports.object({
|
|
|
22104
22171
|
// capture denied by another finding's own Block policy carries `block`
|
|
22105
22172
|
// here too. The full statement is on EventMetadata.redactDegradedTo; it is
|
|
22106
22173
|
// repeated rather than referenced because a store reader opens this file.
|
|
22107
|
-
redact_degraded_to: ActionTaken.optional()
|
|
22174
|
+
redact_degraded_to: ActionTaken.optional(),
|
|
22175
|
+
// The scope key this capture was stamped with: the canonical repository
|
|
22176
|
+
// (`host/owner/repo`) of the path the capture names (a relative path is read
|
|
22177
|
+
// against its working directory), else of its own working directory, or a
|
|
22178
|
+
// chat account's identity. The store's local `scope_key` column reads it, so
|
|
22179
|
+
// a scoped attachment has a per-row key to work from. Absent when no key
|
|
22180
|
+
// could be derived.
|
|
22181
|
+
//
|
|
22182
|
+
// LOCAL ONLY. That is the contract for every path that sends a row. Producers
|
|
22183
|
+
// stamp it in every attachment mode, and the two structural choke points strip
|
|
22184
|
+
// it: the attached gateway's `reKeyForForward` on the live path, and the
|
|
22185
|
+
// history drain's `rebuildAuditEvent`, which drops it through `withoutScopeKey`.
|
|
22186
|
+
// A capture row's bag reaches the wire through `rebuildCapture`, which builds
|
|
22187
|
+
// the metadata from named keys and never names this one; `toCaptureAttributes`,
|
|
22188
|
+
// which builds the bag from a wire event, never emits it. What a scoped
|
|
22189
|
+
// attachment does with the key is not part of this shape's contract.
|
|
22190
|
+
scope_key: external_exports.string().optional()
|
|
22108
22191
|
}).catchall(external_exports.unknown());
|
|
22109
22192
|
var CaptureStatusAttributes = external_exports.object({
|
|
22110
22193
|
source_tool: external_exports.string().optional(),
|
|
@@ -22134,6 +22217,12 @@ var ToolCallInspection = external_exports.object({
|
|
|
22134
22217
|
actionTaken: ActionTaken,
|
|
22135
22218
|
confidence: external_exports.number().min(0).max(1)
|
|
22136
22219
|
});
|
|
22220
|
+
var findingLocationFields = {
|
|
22221
|
+
line: external_exports.number().int().positive().optional(),
|
|
22222
|
+
col: external_exports.number().int().positive().optional(),
|
|
22223
|
+
context: FindingContext.nullable().optional()
|
|
22224
|
+
};
|
|
22225
|
+
var ToolCallInspectionInput = ToolCallInspection.extend(findingLocationFields);
|
|
22137
22226
|
var ToolCallInput = external_exports.object({
|
|
22138
22227
|
sessionId: external_exports.string().min(1),
|
|
22139
22228
|
toolUseId: external_exports.string().min(1),
|
|
@@ -22143,7 +22232,7 @@ var ToolCallInput = external_exports.object({
|
|
|
22143
22232
|
attributes: ToolCallAttributes,
|
|
22144
22233
|
// Secrets detected in the tool's (masked) target — written as linked
|
|
22145
22234
|
// `inspection_findings`. Empty for a clean tool call.
|
|
22146
|
-
inspections: external_exports.array(
|
|
22235
|
+
inspections: external_exports.array(ToolCallInspectionInput).default([])
|
|
22147
22236
|
});
|
|
22148
22237
|
var InventoryInput = external_exports.object({
|
|
22149
22238
|
objectType: InventoryObjectType,
|
|
@@ -22217,7 +22306,8 @@ var InspectionFindingInput = external_exports.object({
|
|
|
22217
22306
|
// same findingKey — mirrors the legacy `findings.first_detected_at`.
|
|
22218
22307
|
// Optional: when omitted, the writer derives it from the referenced audit
|
|
22219
22308
|
// event's startedAt on first insert (see SqliteInspectionFindingsRepository).
|
|
22220
|
-
firstDetectedAt: external_exports.iso.datetime().optional()
|
|
22309
|
+
firstDetectedAt: external_exports.iso.datetime().optional(),
|
|
22310
|
+
...findingLocationFields
|
|
22221
22311
|
});
|
|
22222
22312
|
var InventoryContext = external_exports.object({
|
|
22223
22313
|
host: InventoryInput.optional(),
|
|
@@ -22992,6 +23082,17 @@ var AttachedCredential = external_exports.object({
|
|
|
22992
23082
|
keyPrefix: external_exports.string().min(1).max(16).optional(),
|
|
22993
23083
|
mintedAt: external_exports.iso.datetime().optional()
|
|
22994
23084
|
});
|
|
23085
|
+
var AttachmentMode = external_exports.enum(["machine", "scoped"]);
|
|
23086
|
+
var ATTACHED_CREDENTIAL_SCOPED_SPEC_VERSION = 2;
|
|
23087
|
+
var AttachedCredentialV1 = AttachedCredential;
|
|
23088
|
+
var AttachedCredentialV2 = AttachedCredential.extend({
|
|
23089
|
+
specVersion: external_exports.literal(ATTACHED_CREDENTIAL_SCOPED_SPEC_VERSION),
|
|
23090
|
+
mode: external_exports.literal("scoped")
|
|
23091
|
+
});
|
|
23092
|
+
var AttachedCredentialAny = external_exports.discriminatedUnion("specVersion", [
|
|
23093
|
+
AttachedCredentialV1,
|
|
23094
|
+
AttachedCredentialV2
|
|
23095
|
+
]);
|
|
22995
23096
|
var MAX_DATE_MS = 253402300799999;
|
|
22996
23097
|
var MAX_INT4 = 2147483647;
|
|
22997
23098
|
var StorePosturePack = external_exports.object({
|
|
@@ -23273,6 +23374,130 @@ var PackId = external_exports.string().regex(/^[a-z][a-z0-9-]*$/);
|
|
|
23273
23374
|
var SemVer = external_exports.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)?$/);
|
|
23274
23375
|
var PublisherKind = external_exports.enum(["labs", "user", "org"]);
|
|
23275
23376
|
|
|
23377
|
+
// ../../packages/schema/src/zod/builtin-policy-id.ts
|
|
23378
|
+
var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "vault", "block"];
|
|
23379
|
+
var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
|
|
23380
|
+
|
|
23381
|
+
// ../../packages/schema/src/zod/event.ts
|
|
23382
|
+
var EventKind = external_exports.enum(["prompt", "response", "code_change", "tool_use"]).meta({ id: "EventKind" });
|
|
23383
|
+
var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
|
|
23384
|
+
var EventMetadata = external_exports.object({
|
|
23385
|
+
sessionId: external_exports.string().optional(),
|
|
23386
|
+
repo: external_exports.string().optional(),
|
|
23387
|
+
filePath: external_exports.string().optional(),
|
|
23388
|
+
// The host tool whose input/output was scanned (e.g. 'Bash', 'WebFetch'),
|
|
23389
|
+
// set by the tool-scanning hooks. The tool NAME only — never the tool's
|
|
23390
|
+
// arguments or output, which can carry the very value a finding masked
|
|
23391
|
+
// (metadata is stored unredacted). Gives findings on non-file captures a
|
|
23392
|
+
// display location ("via Bash") when no filePath exists.
|
|
23393
|
+
toolName: external_exports.string().optional(),
|
|
23394
|
+
// Set (true) by the worktree scanner when the file is excluded by the
|
|
23395
|
+
// repo's .gitignore. Gitignored files ARE still scanned — local scratch and
|
|
23396
|
+
// generated code can leak real secrets — but the provenance is recorded so
|
|
23397
|
+
// policy/dashboards can treat those findings as informational rather than
|
|
23398
|
+
// blocking. Omitted (not false) for tracked files and non-scan events.
|
|
23399
|
+
gitignored: external_exports.boolean().optional(),
|
|
23400
|
+
// Set (true) ONLY when the event's `content` is the COMPLETE file at
|
|
23401
|
+
// capture time (a worktree scan reading from disk). Hook-captured edits
|
|
23402
|
+
// (e.g. an Edit tool's new_string) are partial fragments and MUST NOT set
|
|
23403
|
+
// this. The resolver-on-ingest keys its fixed-at-source dropout
|
|
23404
|
+
// diff on this marker: only a whole-file snapshot can prove a previously
|
|
23405
|
+
// open finding is gone; a fragment's absence proves nothing (the secret
|
|
23406
|
+
// may live outside the hunk). Omitted (not false) for fragments and
|
|
23407
|
+
// non-scan events, so pre-marker clients safely default to the
|
|
23408
|
+
// non-authoritative path.
|
|
23409
|
+
wholeFile: external_exports.boolean().optional(),
|
|
23410
|
+
model: external_exports.string().optional(),
|
|
23411
|
+
turnIndex: external_exports.number().int().nonnegative().optional(),
|
|
23412
|
+
// Distributed-tracing correlation. `correlationId` ties a recorded event back
|
|
23413
|
+
// to the request that captured/ingested it (a UUID, generated independently of
|
|
23414
|
+
// the trace id); `traceId` is the W3C trace id (32 lowercase hex chars) of the
|
|
23415
|
+
// originating span when telemetry is enabled. Both optional + backward
|
|
23416
|
+
// compatible — populated by the plugin (see @akasecurity/plugin-sdk).
|
|
23417
|
+
correlationId: external_exports.uuid().optional(),
|
|
23418
|
+
traceId: external_exports.string().regex(/^[0-9a-f]{32}$/).optional(),
|
|
23419
|
+
// Ids of the detection exceptions that downgraded findings in this capture
|
|
23420
|
+
// to 'allow' — the enforcement audit trail's link back to the grant that
|
|
23421
|
+
// authorized the bypass. Absent on captures where no exception applied.
|
|
23422
|
+
exceptionIds: external_exports.array(external_exports.guid()).optional(),
|
|
23423
|
+
// The assistant message this capture belongs to, and the conversation it sits
|
|
23424
|
+
// in — set by the browser extension's network capture so a stored `response`
|
|
23425
|
+
// row can be joined to the `llm_call` leaf describing the same turn. Absent
|
|
23426
|
+
// on every other capture path, which has no such id.
|
|
23427
|
+
//
|
|
23428
|
+
// Non-empty for the reason WebExchange.messageId is: it is the join key, and
|
|
23429
|
+
// a blank one matches no `llm_call` leaf. That refusal reaches only the
|
|
23430
|
+
// places an event is PARSED; the local write path types the event and parses
|
|
23431
|
+
// nothing, which is why `toCaptureAttributes` omits a blank one separately.
|
|
23432
|
+
messageId: external_exports.string().min(1).optional(),
|
|
23433
|
+
conversationId: external_exports.string().optional(),
|
|
23434
|
+
// How long THIS capture's inspection blocked its caller, in whole
|
|
23435
|
+
// milliseconds — the plugin's own added latency, NOT the LLM call it sat in
|
|
23436
|
+
// front of. Measured inside `capture()` (@akasecurity/plugin-sdk) across
|
|
23437
|
+
// detection + redaction, the work the host session actually waits on.
|
|
23438
|
+
//
|
|
23439
|
+
// Stamped ONLY on live in-flight captures. A capture that carries its own
|
|
23440
|
+
// `occurredAt` is replaying past work (the transcript backfill, the worktree
|
|
23441
|
+
// scan), and its scan duration is not latency any host session experienced,
|
|
23442
|
+
// so those rows leave this ABSENT rather than reporting a misleading number.
|
|
23443
|
+
// Absent is also what every pre-measurement client writes, and what a
|
|
23444
|
+
// clock failure degrades to — a reader must treat absence as "not measured"
|
|
23445
|
+
// and never as a zero, which would read as "inspection is free".
|
|
23446
|
+
inspectionMs: external_exports.number().int().nonnegative().optional(),
|
|
23447
|
+
// What a `redact` this capture COULD NOT CARRY OUT became instead — the
|
|
23448
|
+
// workspace's `redactFallback`, applied because the field could not be
|
|
23449
|
+
// masked in place (a shell command, a URL, or any argument on a host whose
|
|
23450
|
+
// hook contract offers no rewrite channel).
|
|
23451
|
+
//
|
|
23452
|
+
// It exists because the action alone cannot say why. A finding recorded as
|
|
23453
|
+
// `warn` reads identically whether its detection was ASSIGNED Warn or was
|
|
23454
|
+
// assigned Redact on a field that could not take one — and those are
|
|
23455
|
+
// different facts about the same row: the first is a policy the user chose,
|
|
23456
|
+
// the second is a masking the host could not perform. Absent means no
|
|
23457
|
+
// degrade happened, which is every ordinary capture.
|
|
23458
|
+
//
|
|
23459
|
+
// TWO LIMITS a reader of a stored row has to know, because the grain here
|
|
23460
|
+
// is the CAPTURE while `actionTaken` is per FINDING:
|
|
23461
|
+
//
|
|
23462
|
+
// - It does not say WHICH finding degraded. A capture carrying a degraded
|
|
23463
|
+
// `redact` alongside a finding ASSIGNED the same action stores both
|
|
23464
|
+
// identically and one reason for the pair; attributing it to both
|
|
23465
|
+
// describes the assigned one wrongly, and to neither loses the degrade.
|
|
23466
|
+
// - PRESENCE IS NOT CAUSATION. The value is the action the lost redact
|
|
23467
|
+
// became, not the reason the capture ended as it did — a capture denied
|
|
23468
|
+
// by some other finding's own Block policy still carries `block` here,
|
|
23469
|
+
// and clearing the workspace's fallback would not have let it through.
|
|
23470
|
+
// Gate on the value against what a fallback can produce; never read the
|
|
23471
|
+
// field's presence as "this was the fallback's doing".
|
|
23472
|
+
//
|
|
23473
|
+
// Both are pinned as behaviour in @akasecurity/plugin-sdk's runtime suite.
|
|
23474
|
+
// Closing either means moving the reason onto the finding row, which
|
|
23475
|
+
// already carries its own action.
|
|
23476
|
+
redactDegradedTo: ActionTaken.optional()
|
|
23477
|
+
}).meta({ id: "EventMetadata" });
|
|
23478
|
+
var Event = external_exports.object({
|
|
23479
|
+
id: external_exports.guid(),
|
|
23480
|
+
sourceTool: SourceTool,
|
|
23481
|
+
kind: EventKind,
|
|
23482
|
+
occurredAt: external_exports.iso.datetime(),
|
|
23483
|
+
contentHash: external_exports.string(),
|
|
23484
|
+
content: external_exports.string(),
|
|
23485
|
+
metadata: EventMetadata.optional()
|
|
23486
|
+
}).meta({ id: "Event" });
|
|
23487
|
+
var IngestEvent = Event.meta({ id: "IngestEvent" });
|
|
23488
|
+
var INGEST_BATCH_MAX = 100;
|
|
23489
|
+
var IngestBatch = external_exports.object({
|
|
23490
|
+
events: external_exports.array(IngestEvent).min(1).max(INGEST_BATCH_MAX),
|
|
23491
|
+
// Dedup policy for this batch. Id-dedup ALWAYS applies. 'content-hash'
|
|
23492
|
+
// additionally rejects any event whose contentHash the store has already
|
|
23493
|
+
// recorded — for re-runnable bulk ingest (worktree scan, transcript
|
|
23494
|
+
// backfill), where a re-run mints fresh event ids for identical content and
|
|
23495
|
+
// would otherwise accumulate duplicates. Live hook traffic must NOT set it:
|
|
23496
|
+
// two genuinely separate prompts can be byte-identical and both belong on
|
|
23497
|
+
// the timeline.
|
|
23498
|
+
dedupe: external_exports.literal("content-hash").optional()
|
|
23499
|
+
}).meta({ id: "IngestBatch" });
|
|
23500
|
+
|
|
23276
23501
|
// ../../packages/schema/src/zod/rule.ts
|
|
23277
23502
|
var MatcherType = external_exports.enum(["keyword", "regex"]).meta({ id: "MatcherType" });
|
|
23278
23503
|
var RuleProbeVerdict = external_exports.enum(["safe", "quarantined"]).meta({ id: "RuleProbeVerdict" });
|
|
@@ -23341,7 +23566,10 @@ var Matcher = external_exports.discriminatedUnion("type", [KeywordMatcher, Regex
|
|
|
23341
23566
|
var MATCHER_TYPES = MatcherType.options;
|
|
23342
23567
|
var AppliesTo = external_exports.strictObject({
|
|
23343
23568
|
// Dot-prefixed, e.g. ".py" — matches the scanner's SOURCE_EXTENSIONS shape.
|
|
23344
|
-
extensions: external_exports.array(external_exports.string().regex(/^\.[A-Za-z0-9]+$/)).min(1)
|
|
23569
|
+
extensions: external_exports.array(external_exports.string().regex(/^\.[A-Za-z0-9]+$/)).min(1).optional(),
|
|
23570
|
+
eventKinds: external_exports.array(EventKind).min(1).optional()
|
|
23571
|
+
}).refine((v) => v.extensions !== void 0 || v.eventKinds !== void 0, {
|
|
23572
|
+
message: "appliesTo needs extensions, eventKinds, or both"
|
|
23345
23573
|
}).meta({ id: "AppliesTo" });
|
|
23346
23574
|
var PostValidatorName = external_exports.enum(["entropy", "luhn"]).meta({ id: "PostValidatorName" });
|
|
23347
23575
|
var PostValidatorRef = external_exports.union(
|
|
@@ -23364,6 +23592,7 @@ var PostValidatorRef = external_exports.union(
|
|
|
23364
23592
|
)}) or { "name": ..., "config": { ... } }. An unrecognized name would be a false-positive guard that never runs.`
|
|
23365
23593
|
}
|
|
23366
23594
|
).meta({ id: "PostValidatorRef" });
|
|
23595
|
+
var RuleEvidence = external_exports.enum(["code", "value"]).meta({ id: "RuleEvidence" });
|
|
23367
23596
|
var RequiresNearby = external_exports.strictObject({
|
|
23368
23597
|
// Each array, when present, must be non-empty and contain non-empty strings —
|
|
23369
23598
|
// an empty/blank criterion would either never fire or (for labels) match
|
|
@@ -23386,6 +23615,8 @@ var RuleFixture = external_exports.strictObject({
|
|
|
23386
23615
|
// Simulated file context for the scan, so fixtures can assert `appliesTo`
|
|
23387
23616
|
// gating (e.g. a Python-only pattern must NOT fire in a .ts file).
|
|
23388
23617
|
filePath: external_exports.string().optional(),
|
|
23618
|
+
// Simulated capture kind, so fixtures can assert `appliesTo.eventKinds`.
|
|
23619
|
+
eventKind: EventKind.optional(),
|
|
23389
23620
|
expectedSpans: external_exports.array(external_exports.strictObject({ start: external_exports.number(), end: external_exports.number() })).optional()
|
|
23390
23621
|
}).meta({ id: "RuleFixture" });
|
|
23391
23622
|
var Rule = external_exports.strictObject({
|
|
@@ -23411,7 +23642,9 @@ var Rule = external_exports.strictObject({
|
|
|
23411
23642
|
appliesTo: AppliesTo.optional(),
|
|
23412
23643
|
postValidators: external_exports.array(PostValidatorRef).optional(),
|
|
23413
23644
|
requiresNearby: RequiresNearby.optional(),
|
|
23414
|
-
examples: external_exports.array(external_exports.string()).optional()
|
|
23645
|
+
examples: external_exports.array(external_exports.string()).optional(),
|
|
23646
|
+
// Whether the matched text is itself sensitive. Absent means 'value'.
|
|
23647
|
+
evidence: RuleEvidence.optional()
|
|
23415
23648
|
}).meta({ id: "Rule" });
|
|
23416
23649
|
var Author = external_exports.object({
|
|
23417
23650
|
name: external_exports.string(),
|
|
@@ -23428,7 +23661,11 @@ var PackManifest = external_exports.object({
|
|
|
23428
23661
|
description: external_exports.string().optional(),
|
|
23429
23662
|
author: Author.optional(),
|
|
23430
23663
|
license: external_exports.string().optional(),
|
|
23431
|
-
sourceUrl: external_exports.url().optional()
|
|
23664
|
+
sourceUrl: external_exports.url().optional(),
|
|
23665
|
+
// The built-in policy a FIRST install of this pack assigns
|
|
23666
|
+
// (installed_packs.policy_id). Absent leaves the pack unassigned, so its
|
|
23667
|
+
// rules follow the category policies. An existing install never takes it.
|
|
23668
|
+
defaultPolicy: BuiltinPolicyId.optional()
|
|
23432
23669
|
}).meta({ id: "PackManifest" });
|
|
23433
23670
|
|
|
23434
23671
|
// ../../packages/schema/src/zod/detection.ts
|
|
@@ -23456,10 +23693,12 @@ var DetectionListItem = external_exports.object({
|
|
|
23456
23693
|
// Per-pack enforcement-policy assignment. Holds a BuiltinPolicyId ARCHETYPE
|
|
23457
23694
|
// (monitor|warn|redact|block) — NOT a policies-table Policy.id guid; a
|
|
23458
23695
|
// detection is a PACK, and its policy is the archetype applied to all its
|
|
23459
|
-
// rules. Absent == unassigned, which resolves to Monitor
|
|
23460
|
-
// (DEFAULT_PACK_POLICY_ID)
|
|
23461
|
-
//
|
|
23462
|
-
//
|
|
23696
|
+
// rules. Absent == unassigned, which resolves to Monitor by default
|
|
23697
|
+
// (DEFAULT_PACK_POLICY_ID); a host may resolve it to a policy of its own
|
|
23698
|
+
// (see the dashboard's `unassignedPolicy`). Every enforcement surface
|
|
23699
|
+
// expands it into per-rule policies (see policyIdToAction). Typed
|
|
23700
|
+
// z.string() (not the enum) to keep the OpenAPI response tolerant of a
|
|
23701
|
+
// future custom id.
|
|
23463
23702
|
policyId: external_exports.string().optional(),
|
|
23464
23703
|
// Set ONLY when a newer snapshot is available for this pack (OSS: the
|
|
23465
23704
|
// bundled inventory recorded in available_packs differs from the installed
|
|
@@ -23528,10 +23767,12 @@ var DetectionDetail = external_exports.object({
|
|
|
23528
23767
|
// Per-pack enforcement-policy assignment. Holds a BuiltinPolicyId ARCHETYPE
|
|
23529
23768
|
// (monitor|warn|redact|block) — NOT a policies-table Policy.id guid; a
|
|
23530
23769
|
// detection is a PACK, and its policy is the archetype applied to all its
|
|
23531
|
-
// rules. Absent == unassigned, which resolves to Monitor
|
|
23532
|
-
// (DEFAULT_PACK_POLICY_ID)
|
|
23533
|
-
//
|
|
23534
|
-
//
|
|
23770
|
+
// rules. Absent == unassigned, which resolves to Monitor by default
|
|
23771
|
+
// (DEFAULT_PACK_POLICY_ID); a host may resolve it to a policy of its own
|
|
23772
|
+
// (see the dashboard's `unassignedPolicy`). Every enforcement surface
|
|
23773
|
+
// expands it into per-rule policies (see policyIdToAction). Typed
|
|
23774
|
+
// z.string() (not the enum) to keep the OpenAPI response tolerant of a
|
|
23775
|
+
// future custom id.
|
|
23535
23776
|
policyId: external_exports.string().optional()
|
|
23536
23777
|
}).meta({ id: "DetectionDetail" });
|
|
23537
23778
|
var LibraryItem = external_exports.object({
|
|
@@ -23561,126 +23802,6 @@ var ImportDetectionRequest = external_exports.object({
|
|
|
23561
23802
|
})
|
|
23562
23803
|
}).meta({ id: "ImportDetectionRequest" });
|
|
23563
23804
|
|
|
23564
|
-
// ../../packages/schema/src/zod/event.ts
|
|
23565
|
-
var EventKind = external_exports.enum(["prompt", "response", "code_change", "tool_use"]).meta({ id: "EventKind" });
|
|
23566
|
-
var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
|
|
23567
|
-
var EventMetadata = external_exports.object({
|
|
23568
|
-
sessionId: external_exports.string().optional(),
|
|
23569
|
-
repo: external_exports.string().optional(),
|
|
23570
|
-
filePath: external_exports.string().optional(),
|
|
23571
|
-
// The host tool whose input/output was scanned (e.g. 'Bash', 'WebFetch'),
|
|
23572
|
-
// set by the tool-scanning hooks. The tool NAME only — never the tool's
|
|
23573
|
-
// arguments or output, which can carry the very value a finding masked
|
|
23574
|
-
// (metadata is stored unredacted). Gives findings on non-file captures a
|
|
23575
|
-
// display location ("via Bash") when no filePath exists.
|
|
23576
|
-
toolName: external_exports.string().optional(),
|
|
23577
|
-
// Set (true) by the worktree scanner when the file is excluded by the
|
|
23578
|
-
// repo's .gitignore. Gitignored files ARE still scanned — local scratch and
|
|
23579
|
-
// generated code can leak real secrets — but the provenance is recorded so
|
|
23580
|
-
// policy/dashboards can treat those findings as informational rather than
|
|
23581
|
-
// blocking. Omitted (not false) for tracked files and non-scan events.
|
|
23582
|
-
gitignored: external_exports.boolean().optional(),
|
|
23583
|
-
// Set (true) ONLY when the event's `content` is the COMPLETE file at
|
|
23584
|
-
// capture time (a worktree scan reading from disk). Hook-captured edits
|
|
23585
|
-
// (e.g. an Edit tool's new_string) are partial fragments and MUST NOT set
|
|
23586
|
-
// this. The resolver-on-ingest keys its fixed-at-source dropout
|
|
23587
|
-
// diff on this marker: only a whole-file snapshot can prove a previously
|
|
23588
|
-
// open finding is gone; a fragment's absence proves nothing (the secret
|
|
23589
|
-
// may live outside the hunk). Omitted (not false) for fragments and
|
|
23590
|
-
// non-scan events, so pre-marker clients safely default to the
|
|
23591
|
-
// non-authoritative path.
|
|
23592
|
-
wholeFile: external_exports.boolean().optional(),
|
|
23593
|
-
model: external_exports.string().optional(),
|
|
23594
|
-
turnIndex: external_exports.number().int().nonnegative().optional(),
|
|
23595
|
-
// Distributed-tracing correlation. `correlationId` ties a recorded event back
|
|
23596
|
-
// to the request that captured/ingested it (a UUID, generated independently of
|
|
23597
|
-
// the trace id); `traceId` is the W3C trace id (32 lowercase hex chars) of the
|
|
23598
|
-
// originating span when telemetry is enabled. Both optional + backward
|
|
23599
|
-
// compatible — populated by the plugin (see @akasecurity/plugin-sdk).
|
|
23600
|
-
correlationId: external_exports.uuid().optional(),
|
|
23601
|
-
traceId: external_exports.string().regex(/^[0-9a-f]{32}$/).optional(),
|
|
23602
|
-
// Ids of the detection exceptions that downgraded findings in this capture
|
|
23603
|
-
// to 'allow' — the enforcement audit trail's link back to the grant that
|
|
23604
|
-
// authorized the bypass. Absent on captures where no exception applied.
|
|
23605
|
-
exceptionIds: external_exports.array(external_exports.guid()).optional(),
|
|
23606
|
-
// The assistant message this capture belongs to, and the conversation it sits
|
|
23607
|
-
// in — set by the browser extension's network capture so a stored `response`
|
|
23608
|
-
// row can be joined to the `llm_call` leaf describing the same turn. Absent
|
|
23609
|
-
// on every other capture path, which has no such id.
|
|
23610
|
-
//
|
|
23611
|
-
// Non-empty for the reason WebExchange.messageId is: it is the join key, and
|
|
23612
|
-
// a blank one matches no `llm_call` leaf. That refusal reaches only the
|
|
23613
|
-
// places an event is PARSED; the local write path types the event and parses
|
|
23614
|
-
// nothing, which is why `toCaptureAttributes` omits a blank one separately.
|
|
23615
|
-
messageId: external_exports.string().min(1).optional(),
|
|
23616
|
-
conversationId: external_exports.string().optional(),
|
|
23617
|
-
// How long THIS capture's inspection blocked its caller, in whole
|
|
23618
|
-
// milliseconds — the plugin's own added latency, NOT the LLM call it sat in
|
|
23619
|
-
// front of. Measured inside `capture()` (@akasecurity/plugin-sdk) across
|
|
23620
|
-
// detection + redaction, the work the host session actually waits on.
|
|
23621
|
-
//
|
|
23622
|
-
// Stamped ONLY on live in-flight captures. A capture that carries its own
|
|
23623
|
-
// `occurredAt` is replaying past work (the transcript backfill, the worktree
|
|
23624
|
-
// scan), and its scan duration is not latency any host session experienced,
|
|
23625
|
-
// so those rows leave this ABSENT rather than reporting a misleading number.
|
|
23626
|
-
// Absent is also what every pre-measurement client writes, and what a
|
|
23627
|
-
// clock failure degrades to — a reader must treat absence as "not measured"
|
|
23628
|
-
// and never as a zero, which would read as "inspection is free".
|
|
23629
|
-
inspectionMs: external_exports.number().int().nonnegative().optional(),
|
|
23630
|
-
// What a `redact` this capture COULD NOT CARRY OUT became instead — the
|
|
23631
|
-
// workspace's `redactFallback`, applied because the field could not be
|
|
23632
|
-
// masked in place (a shell command, a URL, or any argument on a host whose
|
|
23633
|
-
// hook contract offers no rewrite channel).
|
|
23634
|
-
//
|
|
23635
|
-
// It exists because the action alone cannot say why. A finding recorded as
|
|
23636
|
-
// `warn` reads identically whether its detection was ASSIGNED Warn or was
|
|
23637
|
-
// assigned Redact on a field that could not take one — and those are
|
|
23638
|
-
// different facts about the same row: the first is a policy the user chose,
|
|
23639
|
-
// the second is a masking the host could not perform. Absent means no
|
|
23640
|
-
// degrade happened, which is every ordinary capture.
|
|
23641
|
-
//
|
|
23642
|
-
// TWO LIMITS a reader of a stored row has to know, because the grain here
|
|
23643
|
-
// is the CAPTURE while `actionTaken` is per FINDING:
|
|
23644
|
-
//
|
|
23645
|
-
// - It does not say WHICH finding degraded. A capture carrying a degraded
|
|
23646
|
-
// `redact` alongside a finding ASSIGNED the same action stores both
|
|
23647
|
-
// identically and one reason for the pair; attributing it to both
|
|
23648
|
-
// describes the assigned one wrongly, and to neither loses the degrade.
|
|
23649
|
-
// - PRESENCE IS NOT CAUSATION. The value is the action the lost redact
|
|
23650
|
-
// became, not the reason the capture ended as it did — a capture denied
|
|
23651
|
-
// by some other finding's own Block policy still carries `block` here,
|
|
23652
|
-
// and clearing the workspace's fallback would not have let it through.
|
|
23653
|
-
// Gate on the value against what a fallback can produce; never read the
|
|
23654
|
-
// field's presence as "this was the fallback's doing".
|
|
23655
|
-
//
|
|
23656
|
-
// Both are pinned as behaviour in @akasecurity/plugin-sdk's runtime suite.
|
|
23657
|
-
// Closing either means moving the reason onto the finding row, which
|
|
23658
|
-
// already carries its own action.
|
|
23659
|
-
redactDegradedTo: ActionTaken.optional()
|
|
23660
|
-
}).meta({ id: "EventMetadata" });
|
|
23661
|
-
var Event = external_exports.object({
|
|
23662
|
-
id: external_exports.guid(),
|
|
23663
|
-
sourceTool: SourceTool,
|
|
23664
|
-
kind: EventKind,
|
|
23665
|
-
occurredAt: external_exports.iso.datetime(),
|
|
23666
|
-
contentHash: external_exports.string(),
|
|
23667
|
-
content: external_exports.string(),
|
|
23668
|
-
metadata: EventMetadata.optional()
|
|
23669
|
-
}).meta({ id: "Event" });
|
|
23670
|
-
var IngestEvent = Event.meta({ id: "IngestEvent" });
|
|
23671
|
-
var INGEST_BATCH_MAX = 100;
|
|
23672
|
-
var IngestBatch = external_exports.object({
|
|
23673
|
-
events: external_exports.array(IngestEvent).min(1).max(INGEST_BATCH_MAX),
|
|
23674
|
-
// Dedup policy for this batch. Id-dedup ALWAYS applies. 'content-hash'
|
|
23675
|
-
// additionally rejects any event whose contentHash the store has already
|
|
23676
|
-
// recorded — for re-runnable bulk ingest (worktree scan, transcript
|
|
23677
|
-
// backfill), where a re-run mints fresh event ids for identical content and
|
|
23678
|
-
// would otherwise accumulate duplicates. Live hook traffic must NOT set it:
|
|
23679
|
-
// two genuinely separate prompts can be byte-identical and both belong on
|
|
23680
|
-
// the timeline.
|
|
23681
|
-
dedupe: external_exports.literal("content-hash").optional()
|
|
23682
|
-
}).meta({ id: "IngestBatch" });
|
|
23683
|
-
|
|
23684
23805
|
// ../../packages/schema/src/zod/exception.ts
|
|
23685
23806
|
var ExceptionScope = external_exports.enum(["once", "temporary", "permanent"]);
|
|
23686
23807
|
var ExceptionConditions = external_exports.object({
|
|
@@ -23841,8 +23962,6 @@ var Policy = external_exports.object({
|
|
|
23841
23962
|
// test `prohibitedModels` passes and `reversibleRuleIds` fails.
|
|
23842
23963
|
provenance: PolicyProvenance.optional()
|
|
23843
23964
|
}).meta({ id: "Policy" });
|
|
23844
|
-
var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "vault", "block"];
|
|
23845
|
-
var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
|
|
23846
23965
|
var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
|
|
23847
23966
|
id: "RedactFallback"
|
|
23848
23967
|
});
|
|
@@ -24198,7 +24317,7 @@ var VaultConsent = external_exports.object({
|
|
|
24198
24317
|
});
|
|
24199
24318
|
|
|
24200
24319
|
// ../../packages/schema/src/zod/local.ts
|
|
24201
|
-
var WORKSPACE_SETTINGS_SPEC_VERSION =
|
|
24320
|
+
var WORKSPACE_SETTINGS_SPEC_VERSION = 9;
|
|
24202
24321
|
var RunMode = external_exports.enum(["standalone", "attached"]);
|
|
24203
24322
|
var ControlPlaneConnection = external_exports.object({
|
|
24204
24323
|
endpoint: external_exports.string().min(1),
|
|
@@ -24217,6 +24336,18 @@ var HistorySyncConsent = external_exports.object({
|
|
|
24217
24336
|
payloadVersion: external_exports.number().int().positive(),
|
|
24218
24337
|
endpoint: external_exports.string()
|
|
24219
24338
|
});
|
|
24339
|
+
var ATTACHMENT_SCOPE_IDENTITY_MAX_LENGTH = 512;
|
|
24340
|
+
var AttachmentScopeEntry = external_exports.object({
|
|
24341
|
+
kind: external_exports.enum(["repo", "account"]),
|
|
24342
|
+
identity: printable(ATTACHMENT_SCOPE_IDENTITY_MAX_LENGTH).min(1),
|
|
24343
|
+
label: printable(80).optional(),
|
|
24344
|
+
enrolledAt: external_exports.iso.datetime()
|
|
24345
|
+
});
|
|
24346
|
+
var AttachmentScope = external_exports.object({
|
|
24347
|
+
endpoint: external_exports.string().min(1),
|
|
24348
|
+
entries: external_exports.array(AttachmentScopeEntry)
|
|
24349
|
+
});
|
|
24350
|
+
var AttachmentScopeEnvelope = AttachmentScope.extend({ entries: external_exports.array(external_exports.unknown()) });
|
|
24220
24351
|
var WebChatCaptureConsent = external_exports.object({
|
|
24221
24352
|
acknowledgedAt: external_exports.iso.datetime(),
|
|
24222
24353
|
version: external_exports.number().int().positive()
|
|
@@ -24287,6 +24418,23 @@ var WorkspaceSettings = external_exports.object({
|
|
|
24287
24418
|
// both widenings. Absent until granted, and a grant for a different endpoint
|
|
24288
24419
|
// or an older payload no longer counts.
|
|
24289
24420
|
historySyncConsent: HistorySyncConsent.optional(),
|
|
24421
|
+
// The identities a SCOPED attachment forwards and the deployment they were
|
|
24422
|
+
// enrolled for (see AttachmentScope). Absent until something is enrolled.
|
|
24423
|
+
//
|
|
24424
|
+
// `z.unknown()`, NOT `AttachmentScope`, and the difference is this field's
|
|
24425
|
+
// whole failure mode. A settings.json that fails this schema reads as the
|
|
24426
|
+
// unonboarded defaults (readUserSettings in @akasecurity/persistence), and the
|
|
24427
|
+
// next save writes those defaults back over it. Typed, one entry with an
|
|
24428
|
+
// unknown `kind`, a control character or a bad timestamp would cost the
|
|
24429
|
+
// attachment, every consent and onboardedAt, permanently. Untyped, the value
|
|
24430
|
+
// is kept exactly as found and validated where it is used: parseAttachmentScope
|
|
24431
|
+
// drops a bad entry by itself, and on a scoped attachment resolveScope reads a
|
|
24432
|
+
// bad envelope as no entries, which keeps every event local.
|
|
24433
|
+
//
|
|
24434
|
+
// No default: absent must stay absent, so defaultWorkspaceSettings() and a
|
|
24435
|
+
// fresh settings.json do not change. No `.meta({ id })`, like every field
|
|
24436
|
+
// here. Not a ManagedSettingKey.
|
|
24437
|
+
attachmentScope: external_exports.unknown().optional(),
|
|
24290
24438
|
// What the browser extension may record from a web chat, and the grant that
|
|
24291
24439
|
// authorizes it. Absent until the user answers: recording something that was
|
|
24292
24440
|
// never recorded before is never an assumed grant on upgrade, so the whole
|
|
@@ -25052,7 +25200,8 @@ var FINDING_ROW_COLUMNS_SQL = `f.id AS id, d.rule_id AS rule_id, d.category AS c
|
|
|
25052
25200
|
${latestResolutionStatusSql("f")} AS latest_status,
|
|
25053
25201
|
e.synced_at AS synced_at, e.sync_claimed_at AS sync_claimed_at,
|
|
25054
25202
|
e.sync_failed_at AS sync_failed_at, e.sync_failure AS sync_failure,
|
|
25055
|
-
e.outbox_owed AS outbox_owed
|
|
25203
|
+
e.outbox_owed AS outbox_owed,
|
|
25204
|
+
f.line AS line, f.col AS col`;
|
|
25056
25205
|
|
|
25057
25206
|
// ../../packages/persistence/src/repositories/installed-packs.ts
|
|
25058
25207
|
import { createHash as createHash2, randomUUID as randomUUID4 } from "crypto";
|
|
@@ -25158,6 +25307,7 @@ var DEFERRED_TAGS = new Set(DEFERRED_MIGRATION_TAGS);
|
|
|
25158
25307
|
// ../../packages/persistence/src/egress-wire.ts
|
|
25159
25308
|
import { createHash as createHash3 } from "crypto";
|
|
25160
25309
|
var SLASH = "/".charCodeAt(0);
|
|
25310
|
+
var SCOPE_KEY = printable(ATTACHMENT_SCOPE_IDENTITY_MAX_LENGTH);
|
|
25161
25311
|
|
|
25162
25312
|
// ../../packages/persistence/src/finding-key.ts
|
|
25163
25313
|
import { createHash as createHash4 } from "crypto";
|
|
@@ -26070,6 +26220,7 @@ var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
|
|
|
26070
26220
|
// ../../packages/plugin-sdk/src/repo.ts
|
|
26071
26221
|
import { existsSync as existsSync9, readFileSync as readFileSync10, statSync as statSync6 } from "fs";
|
|
26072
26222
|
import { basename as basename2, dirname as dirname4, isAbsolute, join as join17, sep as sep2 } from "path";
|
|
26223
|
+
var NO_ATTRIBUTION = Object.freeze({});
|
|
26073
26224
|
|
|
26074
26225
|
// ../../packages/plugin-sdk/src/events.ts
|
|
26075
26226
|
import { createHash as createHash5, randomUUID as randomUUID13 } from "crypto";
|
|
@@ -26144,6 +26295,9 @@ import { join as join23 } from "path";
|
|
|
26144
26295
|
import { readdirSync as readdirSync3, realpathSync as realpathSync3 } from "fs";
|
|
26145
26296
|
import { basename as basename4, dirname as dirname5, sep as sep3 } from "path";
|
|
26146
26297
|
|
|
26298
|
+
// ../../packages/plugin-sdk/src/policy-resolver.ts
|
|
26299
|
+
import { randomUUID as randomUUID14 } from "crypto";
|
|
26300
|
+
|
|
26147
26301
|
// ../../packages/plugin-sdk/src/project-files.ts
|
|
26148
26302
|
import { existsSync as existsSync11, readdirSync as readdirSync4 } from "fs";
|
|
26149
26303
|
import { basename as basename5, join as join24 } from "path";
|
|
@@ -26175,18 +26329,22 @@ var codexProviderEnvShape = {
|
|
|
26175
26329
|
var CodexProviderEnvSchema = external_exports.object(codexProviderEnvShape);
|
|
26176
26330
|
|
|
26177
26331
|
// ../../packages/plugin-sdk/src/runtime.ts
|
|
26178
|
-
import { randomUUID as
|
|
26332
|
+
import { randomUUID as randomUUID15 } from "crypto";
|
|
26333
|
+
|
|
26334
|
+
// ../../packages/plugin-sdk/src/scope-key.ts
|
|
26335
|
+
import { existsSync as existsSync12 } from "fs";
|
|
26336
|
+
import { dirname as dirname6, isAbsolute as isAbsolute2, join as join25, normalize } from "path";
|
|
26179
26337
|
|
|
26180
26338
|
// ../../packages/plugin-sdk/src/suppressions.ts
|
|
26181
26339
|
var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
26182
26340
|
|
|
26183
26341
|
// ../../packages/plugin-sdk/src/throttle.ts
|
|
26184
26342
|
import { mkdirSync as mkdirSync4, statSync as statSync8, writeFileSync as writeFileSync7 } from "fs";
|
|
26185
|
-
import { join as
|
|
26343
|
+
import { join as join26 } from "path";
|
|
26186
26344
|
|
|
26187
26345
|
// ../../packages/setup-wizard/src/remediation/rotation-checklist.ts
|
|
26188
26346
|
import { writeFileSync as writeFileSync8 } from "fs";
|
|
26189
|
-
import { join as
|
|
26347
|
+
import { join as join27 } from "path";
|
|
26190
26348
|
|
|
26191
26349
|
// ../../packages/setup-wizard/src/triage/merge.ts
|
|
26192
26350
|
var RANK = Object.fromEntries(
|
|
@@ -26196,7 +26354,7 @@ var RANK = Object.fromEntries(
|
|
|
26196
26354
|
// ../../packages/setup-wizard/src/triage/plan-file.ts
|
|
26197
26355
|
import { mkdtempSync, readFileSync as readFileSync17, rmdirSync, rmSync as rmSync7, writeFileSync as writeFileSync9 } from "fs";
|
|
26198
26356
|
import { tmpdir } from "os";
|
|
26199
|
-
import { basename as basename6, dirname as
|
|
26357
|
+
import { basename as basename6, dirname as dirname7, join as join28 } from "path";
|
|
26200
26358
|
var SuppressionEntrySchema = external_exports.object({
|
|
26201
26359
|
ruleId: external_exports.string(),
|
|
26202
26360
|
category: DetectionCategory,
|
|
@@ -26239,7 +26397,7 @@ var PersistedPlanSchema = external_exports.object({
|
|
|
26239
26397
|
|
|
26240
26398
|
// src/skills-registry.ts
|
|
26241
26399
|
import { readdirSync as readdirSync5, readFileSync as readFileSync18 } from "fs";
|
|
26242
|
-
import { join as
|
|
26400
|
+
import { join as join29 } from "path";
|
|
26243
26401
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
26244
26402
|
var SKILLS_DIR = fileURLToPath2(new URL("../skills", import.meta.url));
|
|
26245
26403
|
|