@akasecurity/ai-tc-codex 0.9.14 → 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/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.9/node_modules/ignore/index.js
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.9/node_modules/ignore/index.js"(exports, module) {
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,17 +419,20 @@ var require_ignore = __commonJS({
418
419
  var MODE_IGNORE = "regex";
419
420
  var MODE_CHECK_IGNORE = "checkRegex";
420
421
  var UNDERSCORE = "_";
421
- var TRAILING_WILD_CARD_REPLACERS = {
422
- [MODE_IGNORE](_, p1) {
423
- const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
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 = "[^\\/]*";
429
+ var separatorAfter = (run, at) => {
430
+ let separator = EMPTY;
431
+ for (let index = at + 1; index < run.length && !run[index].wildcard; index++) {
432
+ separator += run[index].single;
433
+ }
434
+ return separator;
435
+ };
432
436
  var pinWildcards = (source) => {
433
437
  if (source.indexOf(WILDCARD) < 0) {
434
438
  return source;
@@ -498,7 +502,7 @@ var require_ignore = __commonJS({
498
502
  out += token.single;
499
503
  return;
500
504
  }
501
- out += at === lastWildcard ? WILDCARD : `(?:(?!${run[at + 1].single})[^\\/])*`;
505
+ out += at === lastWildcard ? WILDCARD : `(?:(?!${separatorAfter(run, at)})[^\\/])*`;
502
506
  });
503
507
  run = [];
504
508
  };
@@ -536,6 +540,14 @@ var require_ignore = __commonJS({
536
540
  (match, index) => sources[index]
537
541
  ) : replaced;
538
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
+ };
539
551
  var matchesBasename = (body) => {
540
552
  const index = body.indexOf(SLASH2);
541
553
  return index < 0 || index === body.length - 1;
@@ -596,11 +608,9 @@ var require_ignore = __commonJS({
596
608
  return this._make(MODE_CHECK_IGNORE, key);
597
609
  }
598
610
  _make(mode, key) {
599
- const str = pinWildcards(this.regexPrefix.replace(
600
- REGEX_REPLACE_TRAILING_WILDCARD,
601
- // It does not need to bind pattern
602
- TRAILING_WILD_CARD_REPLACERS[mode]
603
- ));
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
+ );
604
614
  const regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
605
615
  return define(this, key, regex);
606
616
  }
@@ -659,8 +669,39 @@ var require_ignore = __commonJS({
659
669
  makeArray(
660
670
  isString(pattern) ? splitPattern(pattern) : pattern
661
671
  ).forEach(this._add, this);
672
+ if (this._added) {
673
+ this._literalRules = UNDEFINED;
674
+ }
662
675
  return this._added;
663
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
+ }
664
705
  // Test one single path without recursively checking parent directories
665
706
  //
666
707
  // - checkUnignored `boolean` whether should check if the path is unignored,
@@ -781,14 +822,12 @@ var require_ignore = __commonJS({
781
822
  if (path.charCodeAt(path.length - 1) !== SLASH_CODE) {
782
823
  return this.test(path);
783
824
  }
784
- const parentPath = parentOf(path);
785
- if (parentPath) {
786
- const parent = this._t(parentPath, this._testCache, true);
787
- if (parent.ignored) {
788
- return parent;
789
- }
825
+ const dir = this._t(path, this._testCache, true);
826
+ if (dir.ignored) {
827
+ return dir;
790
828
  }
791
- return this._rules.test(path, false, MODE_CHECK_IGNORE);
829
+ const literal2 = this._rules.testLiteral(path);
830
+ return literal2.ignored || literal2.unignored ? literal2 : dir;
792
831
  }
793
832
  _t(path, cache, checkUnignored) {
794
833
  if (path in cache) {
@@ -21564,11 +21603,33 @@ var ResolutionMethod = external_exports.enum([
21564
21603
  "false-positive",
21565
21604
  "redetected"
21566
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
+ });
21567
21625
  var FindingMatch = external_exports.object({
21568
21626
  // Masked preview of the matched value. Never raw content.
21569
21627
  maskedValue: external_exports.string(),
21570
- // Redacted source-line prefix. Currently empty (pending privacy review).
21571
- 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()
21572
21633
  }).meta({ id: "FindingMatch" });
21573
21634
  var FindingDetectionRef = external_exports.object({
21574
21635
  id: external_exports.string(),
@@ -21588,6 +21649,11 @@ var FindingInstance = external_exports.object({
21588
21649
  provider: FindingProvider,
21589
21650
  repo: external_exports.string(),
21590
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(),
21591
21657
  // Who the capturing event is attributed to. Optional: a single-user store
21592
21658
  // has no one to attribute a finding to and never sets it.
21593
21659
  user: FindingUser.optional(),
@@ -21649,6 +21715,13 @@ var FindingStats = external_exports.object({
21649
21715
  low: external_exports.number().int().nonnegative()
21650
21716
  })
21651
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" });
21652
21725
  var FindingFacetItem = external_exports.object({
21653
21726
  value: external_exports.string(),
21654
21727
  count: external_exports.number().int().nonnegative()
@@ -21766,6 +21839,7 @@ var FindingInstanceDetail = FindingInstance.extend({
21766
21839
  policy: FindingPolicyRef
21767
21840
  }).meta({ id: "FindingInstanceDetail" });
21768
21841
  var MAX_FLAT_FINDINGS_LIMIT = 200;
21842
+ var FindingContextQuery = external_exports.object({ id: external_exports.string().min(1).max(256) });
21769
21843
  var ListFindingInstancesQuery = external_exports.object({
21770
21844
  severity: external_exports.array(Severity).optional(),
21771
21845
  // Rule ids, the same vocabulary the types list's `subtype` carries. Pinning
@@ -22097,7 +22171,23 @@ var CaptureAttributes = external_exports.object({
22097
22171
  // capture denied by another finding's own Block policy carries `block`
22098
22172
  // here too. The full statement is on EventMetadata.redactDegradedTo; it is
22099
22173
  // repeated rather than referenced because a store reader opens this file.
22100
- 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()
22101
22191
  }).catchall(external_exports.unknown());
22102
22192
  var CaptureStatusAttributes = external_exports.object({
22103
22193
  source_tool: external_exports.string().optional(),
@@ -22127,6 +22217,12 @@ var ToolCallInspection = external_exports.object({
22127
22217
  actionTaken: ActionTaken,
22128
22218
  confidence: external_exports.number().min(0).max(1)
22129
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);
22130
22226
  var ToolCallInput = external_exports.object({
22131
22227
  sessionId: external_exports.string().min(1),
22132
22228
  toolUseId: external_exports.string().min(1),
@@ -22136,7 +22232,7 @@ var ToolCallInput = external_exports.object({
22136
22232
  attributes: ToolCallAttributes,
22137
22233
  // Secrets detected in the tool's (masked) target — written as linked
22138
22234
  // `inspection_findings`. Empty for a clean tool call.
22139
- inspections: external_exports.array(ToolCallInspection).default([])
22235
+ inspections: external_exports.array(ToolCallInspectionInput).default([])
22140
22236
  });
22141
22237
  var InventoryInput = external_exports.object({
22142
22238
  objectType: InventoryObjectType,
@@ -22210,7 +22306,8 @@ var InspectionFindingInput = external_exports.object({
22210
22306
  // same findingKey — mirrors the legacy `findings.first_detected_at`.
22211
22307
  // Optional: when omitted, the writer derives it from the referenced audit
22212
22308
  // event's startedAt on first insert (see SqliteInspectionFindingsRepository).
22213
- firstDetectedAt: external_exports.iso.datetime().optional()
22309
+ firstDetectedAt: external_exports.iso.datetime().optional(),
22310
+ ...findingLocationFields
22214
22311
  });
22215
22312
  var InventoryContext = external_exports.object({
22216
22313
  host: InventoryInput.optional(),
@@ -22985,6 +23082,17 @@ var AttachedCredential = external_exports.object({
22985
23082
  keyPrefix: external_exports.string().min(1).max(16).optional(),
22986
23083
  mintedAt: external_exports.iso.datetime().optional()
22987
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
+ ]);
22988
23096
  var MAX_DATE_MS = 253402300799999;
22989
23097
  var MAX_INT4 = 2147483647;
22990
23098
  var StorePosturePack = external_exports.object({
@@ -23041,7 +23149,29 @@ var StorePosturePlugin = external_exports.object({
23041
23149
  */
23042
23150
  policyBundleVersion: external_exports.string().max(200).nullable(),
23043
23151
  /** Epoch millis, on the CLIENT clock, of that fetch. */
23044
- policyFetchedAt: external_exports.number().int().min(0).max(MAX_DATE_MS).nullable()
23152
+ policyFetchedAt: external_exports.number().int().min(0).max(MAX_DATE_MS).nullable(),
23153
+ /**
23154
+ * The newest version the host's own install record holds for this plugin —
23155
+ * what is on disk. After an update it leads `version` (the running copy) by
23156
+ * one launch. Null when no usable version can be read: no install record
23157
+ * (a plugin run from a checkout), no entry with a valid version, or every
23158
+ * such entry names an `installPath` that no longer exists; OPTIONAL, not
23159
+ * required, so a build that predates the member keeps getting its 200.
23160
+ * Bounded like `version`.
23161
+ */
23162
+ installedVersion: external_exports.string().max(64).nullable().optional(),
23163
+ /**
23164
+ * The local-store schema version this running build migrates a store to:
23165
+ * the number of store migrations it carries, the count it stamps into
23166
+ * `PRAGMA user_version`. A snapshot whose `schemaVersion` is above it
23167
+ * usually describes a store a newer build migrated. It is a hint, not a
23168
+ * verdict: the stamp is write-only, so a store whose count ran past this
23169
+ * build's while this build knows every migration in its ledger reads above
23170
+ * it too, which is why describeStoreSkew decides skew on ledger tags and
23171
+ * never on the count. OPTIONAL for the same reason as `installedVersion`;
23172
+ * bounded like `schemaVersion`.
23173
+ */
23174
+ buildSchemaVersion: external_exports.number().int().min(0).max(MAX_INT4).optional()
23045
23175
  }).meta({ id: "StorePosturePlugin" });
23046
23176
  var StorePostureSnapshot = external_exports.object({
23047
23177
  deviceId: external_exports.guid(),
@@ -23244,6 +23374,130 @@ var PackId = external_exports.string().regex(/^[a-z][a-z0-9-]*$/);
23244
23374
  var SemVer = external_exports.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z-.]+)?$/);
23245
23375
  var PublisherKind = external_exports.enum(["labs", "user", "org"]);
23246
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
+
23247
23501
  // ../../packages/schema/src/zod/rule.ts
23248
23502
  var MatcherType = external_exports.enum(["keyword", "regex"]).meta({ id: "MatcherType" });
23249
23503
  var RuleProbeVerdict = external_exports.enum(["safe", "quarantined"]).meta({ id: "RuleProbeVerdict" });
@@ -23312,7 +23566,10 @@ var Matcher = external_exports.discriminatedUnion("type", [KeywordMatcher, Regex
23312
23566
  var MATCHER_TYPES = MatcherType.options;
23313
23567
  var AppliesTo = external_exports.strictObject({
23314
23568
  // Dot-prefixed, e.g. ".py" — matches the scanner's SOURCE_EXTENSIONS shape.
23315
- 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"
23316
23573
  }).meta({ id: "AppliesTo" });
23317
23574
  var PostValidatorName = external_exports.enum(["entropy", "luhn"]).meta({ id: "PostValidatorName" });
23318
23575
  var PostValidatorRef = external_exports.union(
@@ -23335,6 +23592,7 @@ var PostValidatorRef = external_exports.union(
23335
23592
  )}) or { "name": ..., "config": { ... } }. An unrecognized name would be a false-positive guard that never runs.`
23336
23593
  }
23337
23594
  ).meta({ id: "PostValidatorRef" });
23595
+ var RuleEvidence = external_exports.enum(["code", "value"]).meta({ id: "RuleEvidence" });
23338
23596
  var RequiresNearby = external_exports.strictObject({
23339
23597
  // Each array, when present, must be non-empty and contain non-empty strings —
23340
23598
  // an empty/blank criterion would either never fire or (for labels) match
@@ -23357,6 +23615,8 @@ var RuleFixture = external_exports.strictObject({
23357
23615
  // Simulated file context for the scan, so fixtures can assert `appliesTo`
23358
23616
  // gating (e.g. a Python-only pattern must NOT fire in a .ts file).
23359
23617
  filePath: external_exports.string().optional(),
23618
+ // Simulated capture kind, so fixtures can assert `appliesTo.eventKinds`.
23619
+ eventKind: EventKind.optional(),
23360
23620
  expectedSpans: external_exports.array(external_exports.strictObject({ start: external_exports.number(), end: external_exports.number() })).optional()
23361
23621
  }).meta({ id: "RuleFixture" });
23362
23622
  var Rule = external_exports.strictObject({
@@ -23382,7 +23642,9 @@ var Rule = external_exports.strictObject({
23382
23642
  appliesTo: AppliesTo.optional(),
23383
23643
  postValidators: external_exports.array(PostValidatorRef).optional(),
23384
23644
  requiresNearby: RequiresNearby.optional(),
23385
- 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()
23386
23648
  }).meta({ id: "Rule" });
23387
23649
  var Author = external_exports.object({
23388
23650
  name: external_exports.string(),
@@ -23399,7 +23661,11 @@ var PackManifest = external_exports.object({
23399
23661
  description: external_exports.string().optional(),
23400
23662
  author: Author.optional(),
23401
23663
  license: external_exports.string().optional(),
23402
- 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()
23403
23669
  }).meta({ id: "PackManifest" });
23404
23670
 
23405
23671
  // ../../packages/schema/src/zod/detection.ts
@@ -23427,10 +23693,12 @@ var DetectionListItem = external_exports.object({
23427
23693
  // Per-pack enforcement-policy assignment. Holds a BuiltinPolicyId ARCHETYPE
23428
23694
  // (monitor|warn|redact|block) — NOT a policies-table Policy.id guid; a
23429
23695
  // detection is a PACK, and its policy is the archetype applied to all its
23430
- // rules. Absent == unassigned, which resolves to Monitor everywhere
23431
- // (DEFAULT_PACK_POLICY_ID). Every enforcement surface expands it into
23432
- // per-rule policies (see policyIdToAction). Typed z.string() (not
23433
- // the enum) to keep the OpenAPI response tolerant of a future custom id.
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.
23434
23702
  policyId: external_exports.string().optional(),
23435
23703
  // Set ONLY when a newer snapshot is available for this pack (OSS: the
23436
23704
  // bundled inventory recorded in available_packs differs from the installed
@@ -23499,10 +23767,12 @@ var DetectionDetail = external_exports.object({
23499
23767
  // Per-pack enforcement-policy assignment. Holds a BuiltinPolicyId ARCHETYPE
23500
23768
  // (monitor|warn|redact|block) — NOT a policies-table Policy.id guid; a
23501
23769
  // detection is a PACK, and its policy is the archetype applied to all its
23502
- // rules. Absent == unassigned, which resolves to Monitor everywhere
23503
- // (DEFAULT_PACK_POLICY_ID). Every enforcement surface expands it into
23504
- // per-rule policies (see policyIdToAction). Typed z.string() (not
23505
- // the enum) to keep the OpenAPI response tolerant of a future custom id.
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.
23506
23776
  policyId: external_exports.string().optional()
23507
23777
  }).meta({ id: "DetectionDetail" });
23508
23778
  var LibraryItem = external_exports.object({
@@ -23532,126 +23802,6 @@ var ImportDetectionRequest = external_exports.object({
23532
23802
  })
23533
23803
  }).meta({ id: "ImportDetectionRequest" });
23534
23804
 
23535
- // ../../packages/schema/src/zod/event.ts
23536
- var EventKind = external_exports.enum(["prompt", "response", "code_change", "tool_use"]).meta({ id: "EventKind" });
23537
- var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
23538
- var EventMetadata = external_exports.object({
23539
- sessionId: external_exports.string().optional(),
23540
- repo: external_exports.string().optional(),
23541
- filePath: external_exports.string().optional(),
23542
- // The host tool whose input/output was scanned (e.g. 'Bash', 'WebFetch'),
23543
- // set by the tool-scanning hooks. The tool NAME only — never the tool's
23544
- // arguments or output, which can carry the very value a finding masked
23545
- // (metadata is stored unredacted). Gives findings on non-file captures a
23546
- // display location ("via Bash") when no filePath exists.
23547
- toolName: external_exports.string().optional(),
23548
- // Set (true) by the worktree scanner when the file is excluded by the
23549
- // repo's .gitignore. Gitignored files ARE still scanned — local scratch and
23550
- // generated code can leak real secrets — but the provenance is recorded so
23551
- // policy/dashboards can treat those findings as informational rather than
23552
- // blocking. Omitted (not false) for tracked files and non-scan events.
23553
- gitignored: external_exports.boolean().optional(),
23554
- // Set (true) ONLY when the event's `content` is the COMPLETE file at
23555
- // capture time (a worktree scan reading from disk). Hook-captured edits
23556
- // (e.g. an Edit tool's new_string) are partial fragments and MUST NOT set
23557
- // this. The resolver-on-ingest keys its fixed-at-source dropout
23558
- // diff on this marker: only a whole-file snapshot can prove a previously
23559
- // open finding is gone; a fragment's absence proves nothing (the secret
23560
- // may live outside the hunk). Omitted (not false) for fragments and
23561
- // non-scan events, so pre-marker clients safely default to the
23562
- // non-authoritative path.
23563
- wholeFile: external_exports.boolean().optional(),
23564
- model: external_exports.string().optional(),
23565
- turnIndex: external_exports.number().int().nonnegative().optional(),
23566
- // Distributed-tracing correlation. `correlationId` ties a recorded event back
23567
- // to the request that captured/ingested it (a UUID, generated independently of
23568
- // the trace id); `traceId` is the W3C trace id (32 lowercase hex chars) of the
23569
- // originating span when telemetry is enabled. Both optional + backward
23570
- // compatible — populated by the plugin (see @akasecurity/plugin-sdk).
23571
- correlationId: external_exports.uuid().optional(),
23572
- traceId: external_exports.string().regex(/^[0-9a-f]{32}$/).optional(),
23573
- // Ids of the detection exceptions that downgraded findings in this capture
23574
- // to 'allow' — the enforcement audit trail's link back to the grant that
23575
- // authorized the bypass. Absent on captures where no exception applied.
23576
- exceptionIds: external_exports.array(external_exports.guid()).optional(),
23577
- // The assistant message this capture belongs to, and the conversation it sits
23578
- // in — set by the browser extension's network capture so a stored `response`
23579
- // row can be joined to the `llm_call` leaf describing the same turn. Absent
23580
- // on every other capture path, which has no such id.
23581
- //
23582
- // Non-empty for the reason WebExchange.messageId is: it is the join key, and
23583
- // a blank one matches no `llm_call` leaf. That refusal reaches only the
23584
- // places an event is PARSED; the local write path types the event and parses
23585
- // nothing, which is why `toCaptureAttributes` omits a blank one separately.
23586
- messageId: external_exports.string().min(1).optional(),
23587
- conversationId: external_exports.string().optional(),
23588
- // How long THIS capture's inspection blocked its caller, in whole
23589
- // milliseconds — the plugin's own added latency, NOT the LLM call it sat in
23590
- // front of. Measured inside `capture()` (@akasecurity/plugin-sdk) across
23591
- // detection + redaction, the work the host session actually waits on.
23592
- //
23593
- // Stamped ONLY on live in-flight captures. A capture that carries its own
23594
- // `occurredAt` is replaying past work (the transcript backfill, the worktree
23595
- // scan), and its scan duration is not latency any host session experienced,
23596
- // so those rows leave this ABSENT rather than reporting a misleading number.
23597
- // Absent is also what every pre-measurement client writes, and what a
23598
- // clock failure degrades to — a reader must treat absence as "not measured"
23599
- // and never as a zero, which would read as "inspection is free".
23600
- inspectionMs: external_exports.number().int().nonnegative().optional(),
23601
- // What a `redact` this capture COULD NOT CARRY OUT became instead — the
23602
- // workspace's `redactFallback`, applied because the field could not be
23603
- // masked in place (a shell command, a URL, or any argument on a host whose
23604
- // hook contract offers no rewrite channel).
23605
- //
23606
- // It exists because the action alone cannot say why. A finding recorded as
23607
- // `warn` reads identically whether its detection was ASSIGNED Warn or was
23608
- // assigned Redact on a field that could not take one — and those are
23609
- // different facts about the same row: the first is a policy the user chose,
23610
- // the second is a masking the host could not perform. Absent means no
23611
- // degrade happened, which is every ordinary capture.
23612
- //
23613
- // TWO LIMITS a reader of a stored row has to know, because the grain here
23614
- // is the CAPTURE while `actionTaken` is per FINDING:
23615
- //
23616
- // - It does not say WHICH finding degraded. A capture carrying a degraded
23617
- // `redact` alongside a finding ASSIGNED the same action stores both
23618
- // identically and one reason for the pair; attributing it to both
23619
- // describes the assigned one wrongly, and to neither loses the degrade.
23620
- // - PRESENCE IS NOT CAUSATION. The value is the action the lost redact
23621
- // became, not the reason the capture ended as it did — a capture denied
23622
- // by some other finding's own Block policy still carries `block` here,
23623
- // and clearing the workspace's fallback would not have let it through.
23624
- // Gate on the value against what a fallback can produce; never read the
23625
- // field's presence as "this was the fallback's doing".
23626
- //
23627
- // Both are pinned as behaviour in @akasecurity/plugin-sdk's runtime suite.
23628
- // Closing either means moving the reason onto the finding row, which
23629
- // already carries its own action.
23630
- redactDegradedTo: ActionTaken.optional()
23631
- }).meta({ id: "EventMetadata" });
23632
- var Event = external_exports.object({
23633
- id: external_exports.guid(),
23634
- sourceTool: SourceTool,
23635
- kind: EventKind,
23636
- occurredAt: external_exports.iso.datetime(),
23637
- contentHash: external_exports.string(),
23638
- content: external_exports.string(),
23639
- metadata: EventMetadata.optional()
23640
- }).meta({ id: "Event" });
23641
- var IngestEvent = Event.meta({ id: "IngestEvent" });
23642
- var INGEST_BATCH_MAX = 100;
23643
- var IngestBatch = external_exports.object({
23644
- events: external_exports.array(IngestEvent).min(1).max(INGEST_BATCH_MAX),
23645
- // Dedup policy for this batch. Id-dedup ALWAYS applies. 'content-hash'
23646
- // additionally rejects any event whose contentHash the store has already
23647
- // recorded — for re-runnable bulk ingest (worktree scan, transcript
23648
- // backfill), where a re-run mints fresh event ids for identical content and
23649
- // would otherwise accumulate duplicates. Live hook traffic must NOT set it:
23650
- // two genuinely separate prompts can be byte-identical and both belong on
23651
- // the timeline.
23652
- dedupe: external_exports.literal("content-hash").optional()
23653
- }).meta({ id: "IngestBatch" });
23654
-
23655
23805
  // ../../packages/schema/src/zod/exception.ts
23656
23806
  var ExceptionScope = external_exports.enum(["once", "temporary", "permanent"]);
23657
23807
  var ExceptionConditions = external_exports.object({
@@ -23812,8 +23962,6 @@ var Policy = external_exports.object({
23812
23962
  // test `prohibitedModels` passes and `reversibleRuleIds` fails.
23813
23963
  provenance: PolicyProvenance.optional()
23814
23964
  }).meta({ id: "Policy" });
23815
- var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "vault", "block"];
23816
- var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
23817
23965
  var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
23818
23966
  id: "RedactFallback"
23819
23967
  });
@@ -24020,10 +24168,15 @@ var ParsedPointer = external_exports.object({
24020
24168
  });
24021
24169
  var VaultEntry = external_exports.object({
24022
24170
  pointerId: external_exports.string(),
24023
- // The keyed HMAC of the raw value under `exception.key`, and the epoch it was
24024
- // derived under. This is what a reveal-to-model grant matches on, and it rotates
24025
- // independently of the vault encryption key below.
24171
+ // The keyed HMAC of the EXACT raw bytes under `exception.key`, and the epoch it
24172
+ // was derived under. The vault's own dedupe key: a value and its invisibly
24173
+ // padded twin are two rows. It rotates independently of the vault encryption
24174
+ // key below. Never matched against an exception or grant.
24026
24175
  valueFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/),
24176
+ // The same HMAC over the raw with invisible padding removed: the identity a
24177
+ // reveal-to-model grant and every exception match on. Shared by a value and
24178
+ // its padded twin.
24179
+ valueIdentityFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/),
24027
24180
  fingerprintKeyVersion: external_exports.number().int().positive(),
24028
24181
  // The vault-key epoch this row's ciphertext was sealed under.
24029
24182
  keyVersion: external_exports.number().int().positive(),
@@ -24164,7 +24317,7 @@ var VaultConsent = external_exports.object({
24164
24317
  });
24165
24318
 
24166
24319
  // ../../packages/schema/src/zod/local.ts
24167
- var WORKSPACE_SETTINGS_SPEC_VERSION = 8;
24320
+ var WORKSPACE_SETTINGS_SPEC_VERSION = 9;
24168
24321
  var RunMode = external_exports.enum(["standalone", "attached"]);
24169
24322
  var ControlPlaneConnection = external_exports.object({
24170
24323
  endpoint: external_exports.string().min(1),
@@ -24183,6 +24336,18 @@ var HistorySyncConsent = external_exports.object({
24183
24336
  payloadVersion: external_exports.number().int().positive(),
24184
24337
  endpoint: external_exports.string()
24185
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()) });
24186
24351
  var WebChatCaptureConsent = external_exports.object({
24187
24352
  acknowledgedAt: external_exports.iso.datetime(),
24188
24353
  version: external_exports.number().int().positive()
@@ -24253,6 +24418,23 @@ var WorkspaceSettings = external_exports.object({
24253
24418
  // both widenings. Absent until granted, and a grant for a different endpoint
24254
24419
  // or an older payload no longer counts.
24255
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(),
24256
24438
  // What the browser extension may record from a web chat, and the grant that
24257
24439
  // authorizes it. Absent until the user answers: recording something that was
24258
24440
  // never recorded before is never an assumed grant on upgrade, so the whole
@@ -24465,10 +24647,18 @@ var SeveritySummaryItem = external_exports.object({
24465
24647
  count: external_exports.number().int().nonnegative(),
24466
24648
  // Resolution-aware breakdown (optional, additive). Populated once findings
24467
24649
  // carry lifecycle state: `caught` = handled in-flight (enforced); `openAtRest`
24468
- // = still open with no in-flight enforcement (needs remediation). Absent on the
24469
- // legacy count-only response until the resolution feature lands.
24650
+ // = still open with no in-flight enforcement (needs remediation); `dismissed`
24651
+ // = closed by a human judgement rather than a fix — visible, but not counted as
24652
+ // needing remediation. The three are disjoint. Absent on the legacy count-only
24653
+ // response until the resolution feature lands.
24470
24654
  caught: external_exports.number().int().nonnegative().optional(),
24471
- openAtRest: external_exports.number().int().nonnegative().optional()
24655
+ openAtRest: external_exports.number().int().nonnegative().optional(),
24656
+ dismissed: external_exports.number().int().nonnegative().optional(),
24657
+ // The two halves of `caught`, for a reader that wants them apart: `handled` =
24658
+ // in-flight findings an enforcement action already contained; `resolved` =
24659
+ // at-rest findings closed out by fixing them. `handled + resolved === caught`.
24660
+ handled: external_exports.number().int().nonnegative().optional(),
24661
+ resolved: external_exports.number().int().nonnegative().optional()
24472
24662
  }).meta({ id: "SeveritySummaryItem" });
24473
24663
  var SeveritySummaryResponse = external_exports.object({
24474
24664
  // Sum of bySeverity[].count.
@@ -24476,6 +24666,9 @@ var SeveritySummaryResponse = external_exports.object({
24476
24666
  // Findings still open at rest (sum of bySeverity[].openAtRest). Optional and
24477
24667
  // additive — absent on the legacy response until the resolution feature lands.
24478
24668
  needsRemediation: external_exports.number().int().nonnegative().optional(),
24669
+ // Findings a user dismissed (sum of bySeverity[].dismissed). Excluded from
24670
+ // needsRemediation, and kept visible here so an accepted risk is not erased.
24671
+ dismissed: external_exports.number().int().nonnegative().optional(),
24479
24672
  // All four severity levels are always present (count may be 0).
24480
24673
  bySeverity: external_exports.array(SeveritySummaryItem)
24481
24674
  }).meta({ id: "SeveritySummaryResponse" });
@@ -25007,7 +25200,8 @@ var FINDING_ROW_COLUMNS_SQL = `f.id AS id, d.rule_id AS rule_id, d.category AS c
25007
25200
  ${latestResolutionStatusSql("f")} AS latest_status,
25008
25201
  e.synced_at AS synced_at, e.sync_claimed_at AS sync_claimed_at,
25009
25202
  e.sync_failed_at AS sync_failed_at, e.sync_failure AS sync_failure,
25010
- e.outbox_owed AS outbox_owed`;
25203
+ e.outbox_owed AS outbox_owed,
25204
+ f.line AS line, f.col AS col`;
25011
25205
 
25012
25206
  // ../../packages/persistence/src/repositories/installed-packs.ts
25013
25207
  import { createHash as createHash2, randomUUID as randomUUID4 } from "crypto";
@@ -25113,6 +25307,7 @@ var DEFERRED_TAGS = new Set(DEFERRED_MIGRATION_TAGS);
25113
25307
  // ../../packages/persistence/src/egress-wire.ts
25114
25308
  import { createHash as createHash3 } from "crypto";
25115
25309
  var SLASH = "/".charCodeAt(0);
25310
+ var SCOPE_KEY = printable(ATTACHMENT_SCOPE_IDENTITY_MAX_LENGTH);
25116
25311
 
25117
25312
  // ../../packages/persistence/src/finding-key.ts
25118
25313
  import { createHash as createHash4 } from "crypto";
@@ -25785,6 +25980,10 @@ function escapeRegExp2(value) {
25785
25980
  return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
25786
25981
  }
25787
25982
 
25983
+ // ../../packages/detections/src/format-chars.ts
25984
+ var HAS_FORMAT_CHAR = new RegExp("\\p{Cf}", "u");
25985
+ var FORMAT_CHAR_GLOBAL = new RegExp("\\p{Cf}", "gu");
25986
+
25788
25987
  // ../../packages/detections/src/regex-cache.ts
25789
25988
  var singles = /* @__PURE__ */ new WeakMap();
25790
25989
  var keywordLists = /* @__PURE__ */ new WeakMap();
@@ -26021,6 +26220,7 @@ var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
26021
26220
  // ../../packages/plugin-sdk/src/repo.ts
26022
26221
  import { existsSync as existsSync9, readFileSync as readFileSync10, statSync as statSync6 } from "fs";
26023
26222
  import { basename as basename2, dirname as dirname4, isAbsolute, join as join17, sep as sep2 } from "path";
26223
+ var NO_ATTRIBUTION = Object.freeze({});
26024
26224
 
26025
26225
  // ../../packages/plugin-sdk/src/events.ts
26026
26226
  import { createHash as createHash5, randomUUID as randomUUID13 } from "crypto";
@@ -26095,6 +26295,9 @@ import { join as join23 } from "path";
26095
26295
  import { readdirSync as readdirSync3, realpathSync as realpathSync3 } from "fs";
26096
26296
  import { basename as basename4, dirname as dirname5, sep as sep3 } from "path";
26097
26297
 
26298
+ // ../../packages/plugin-sdk/src/policy-resolver.ts
26299
+ import { randomUUID as randomUUID14 } from "crypto";
26300
+
26098
26301
  // ../../packages/plugin-sdk/src/project-files.ts
26099
26302
  import { existsSync as existsSync11, readdirSync as readdirSync4 } from "fs";
26100
26303
  import { basename as basename5, join as join24 } from "path";
@@ -26126,18 +26329,22 @@ var codexProviderEnvShape = {
26126
26329
  var CodexProviderEnvSchema = external_exports.object(codexProviderEnvShape);
26127
26330
 
26128
26331
  // ../../packages/plugin-sdk/src/runtime.ts
26129
- import { randomUUID as randomUUID14 } from "crypto";
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";
26130
26337
 
26131
26338
  // ../../packages/plugin-sdk/src/suppressions.ts
26132
26339
  var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
26133
26340
 
26134
26341
  // ../../packages/plugin-sdk/src/throttle.ts
26135
26342
  import { mkdirSync as mkdirSync4, statSync as statSync8, writeFileSync as writeFileSync7 } from "fs";
26136
- import { join as join25 } from "path";
26343
+ import { join as join26 } from "path";
26137
26344
 
26138
26345
  // ../../packages/setup-wizard/src/remediation/rotation-checklist.ts
26139
26346
  import { writeFileSync as writeFileSync8 } from "fs";
26140
- import { join as join26 } from "path";
26347
+ import { join as join27 } from "path";
26141
26348
 
26142
26349
  // ../../packages/setup-wizard/src/triage/merge.ts
26143
26350
  var RANK = Object.fromEntries(
@@ -26147,7 +26354,7 @@ var RANK = Object.fromEntries(
26147
26354
  // ../../packages/setup-wizard/src/triage/plan-file.ts
26148
26355
  import { mkdtempSync, readFileSync as readFileSync17, rmdirSync, rmSync as rmSync7, writeFileSync as writeFileSync9 } from "fs";
26149
26356
  import { tmpdir } from "os";
26150
- import { basename as basename6, dirname as dirname6, join as join27 } from "path";
26357
+ import { basename as basename6, dirname as dirname7, join as join28 } from "path";
26151
26358
  var SuppressionEntrySchema = external_exports.object({
26152
26359
  ruleId: external_exports.string(),
26153
26360
  category: DetectionCategory,
@@ -26190,7 +26397,7 @@ var PersistedPlanSchema = external_exports.object({
26190
26397
 
26191
26398
  // src/skills-registry.ts
26192
26399
  import { readdirSync as readdirSync5, readFileSync as readFileSync18 } from "fs";
26193
- import { join as join28 } from "path";
26400
+ import { join as join29 } from "path";
26194
26401
  import { fileURLToPath as fileURLToPath2 } from "url";
26195
26402
  var SKILLS_DIR = fileURLToPath2(new URL("../skills", import.meta.url));
26196
26403