@akasecurity/ai-tc-claude-code 0.9.3 → 0.9.5

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.
@@ -492,13 +492,12 @@ var require_ignore = __commonJS({
492
492
  });
493
493
 
494
494
  // ../../packages/plugin-sdk/src/config.ts
495
- import { existsSync as existsSync4 } from "fs";
496
- import { join as join6 } from "path";
495
+ import { existsSync as existsSync5 } from "fs";
496
+ import { join as join8 } from "path";
497
497
 
498
498
  // ../../packages/persistence/src/database.ts
499
- import { randomUUID as randomUUID8 } from "crypto";
500
- import { existsSync, renameSync as renameSync2, rmSync as rmSync2 } from "fs";
501
- import { join, sep } from "path";
499
+ import { randomUUID as randomUUID10 } from "crypto";
500
+ import { join as join2, sep } from "path";
502
501
  import { DatabaseSync } from "node:sqlite";
503
502
 
504
503
  // ../../packages/schema/src/exception-scope.ts
@@ -15093,7 +15092,17 @@ var Finding = external_exports.object({
15093
15092
  }).meta({ id: "Finding" });
15094
15093
  var DetectedFinding = Finding.meta({ id: "DetectedFinding" });
15095
15094
  var FindingAction = external_exports.enum(["blocked", "redacted", "warned", "allowed", "quarantined", "monitored"]).meta({ id: "FindingAction" });
15096
- var FindingProvider = external_exports.enum(["claudecode", "claudedesktop", "cursor", "copilot", "chatgpt", "api"]).meta({ id: "FindingProvider" });
15095
+ var FindingProvider = external_exports.enum([
15096
+ "claudecode",
15097
+ "claudedesktop",
15098
+ "cursor",
15099
+ "copilot",
15100
+ "chatgpt",
15101
+ "claudeai",
15102
+ "codex",
15103
+ "antigravity",
15104
+ "api"
15105
+ ]).meta({ id: "FindingProvider" });
15097
15106
  var FindingCategory = external_exports.enum([
15098
15107
  "secret",
15099
15108
  "pii",
@@ -15147,7 +15156,16 @@ var FindingInstance = external_exports.object({
15147
15156
  confidence: external_exports.number().min(0).max(1),
15148
15157
  // Lifecycle status (see FindingStatus). Optional so legacy callers/rows
15149
15158
  // that predate the resolution feature stay valid.
15150
- status: FindingStatus.optional()
15159
+ status: FindingStatus.optional(),
15160
+ // The audit event this finding was captured from. Optional so callers that
15161
+ // do not project it stay valid. An at-rest finding is content-addressed by
15162
+ // finding_key and its row is upserted on re-detection, so this names the
15163
+ // MOST RECENT detection event, not the first.
15164
+ eventId: external_exports.string().optional(),
15165
+ // The session that event belongs to, when it has one — the seam a
15166
+ // per-instance "view session" link needs. Absent for events captured
15167
+ // outside a session.
15168
+ sessionId: external_exports.string().optional()
15151
15169
  }).meta({ id: "FindingInstance" });
15152
15170
  var FindingGroup = external_exports.object({
15153
15171
  id: external_exports.string(),
@@ -15191,7 +15209,11 @@ var FindingFacets = external_exports.object({
15191
15209
  // for every instance, so every group lands in a bucket; a status-less
15192
15210
  // group (possible only for callers whose rows carry no statuses) is
15193
15211
  // counted under no value.
15194
- status: external_exports.array(FindingFacetItem)
15212
+ status: external_exports.array(FindingFacetItem),
15213
+ // Host tool (attributes.tool_name). Present only on the instance-level
15214
+ // reads, which can filter by it; the grouped read omits the dimension
15215
+ // because a group spans tools.
15216
+ tool: external_exports.array(FindingFacetItem).optional()
15195
15217
  }).meta({ id: "FindingFacets" });
15196
15218
  var ListGroupedFindingsQuery = external_exports.object({
15197
15219
  // NOTE: severity filters by Severity (critical/high/medium/low), not by
@@ -15208,6 +15230,16 @@ var ListGroupedFindingsQuery = external_exports.object({
15208
15230
  // Scope to findings whose event carries this session id (the Activity page's
15209
15231
  // session → findings drilldown). Findings without a session never match.
15210
15232
  sessionId: external_exports.string().optional(),
15233
+ // Inclusive lower bound on the parent event's timestamp, so a caller arriving
15234
+ // from a time-scoped page (Activity's range) can carry that scope. Absent
15235
+ // means all time — this list has no default window.
15236
+ from: external_exports.iso.datetime().optional(),
15237
+ // A group or instance id that must appear in the page even when the cursor
15238
+ // has already advanced past its sort position. This is what keeps the
15239
+ // Findings page's one-shot ?finding= deep link resolving once the list
15240
+ // paginates: the target group is appended out of sort order rather than
15241
+ // scanning forward for it. Never affects totals, facets or the cursor.
15242
+ includeId: external_exports.string().optional(),
15211
15243
  groupBy: external_exports.literal("type").optional(),
15212
15244
  limit: external_exports.coerce.number().int().min(1).max(100).optional(),
15213
15245
  cursor: external_exports.string().optional()
@@ -15252,9 +15284,100 @@ var FindingInstanceDetail = FindingInstance.extend({
15252
15284
  detection: FindingDetectionRef,
15253
15285
  policy: FindingPolicyRef
15254
15286
  }).meta({ id: "FindingInstanceDetail" });
15287
+ var ListFindingInstancesQuery = external_exports.object({
15288
+ severity: external_exports.array(Severity).optional(),
15289
+ // Rule ids, the same vocabulary the grouped list's `subtype` carries.
15290
+ subtype: external_exports.array(external_exports.string()).optional(),
15291
+ provider: external_exports.array(FindingProvider).optional(),
15292
+ action: external_exports.array(FindingAction).optional(),
15293
+ // Matches each instance's OWN derived status (deriveFindingStatus), unlike
15294
+ // the grouped query's group-level fold.
15295
+ status: external_exports.array(FindingStatus).optional(),
15296
+ // Exact host-tool names (attributes.tool_name, e.g. 'Bash'). A real filter,
15297
+ // where the free-text `q` can only match the rendered "via Bash" label.
15298
+ tool: external_exports.array(external_exports.string()).optional(),
15299
+ // Exact repository / file-path matches, for the drill-down out of the
15300
+ // locations view. A row whose event carries no repo/file matches neither.
15301
+ repo: external_exports.string().optional(),
15302
+ file: external_exports.string().optional(),
15303
+ q: external_exports.string().optional(),
15304
+ sessionId: external_exports.string().optional(),
15305
+ from: external_exports.iso.datetime().optional(),
15306
+ limit: external_exports.coerce.number().int().min(1).max(200).optional(),
15307
+ cursor: external_exports.string().optional()
15308
+ });
15309
+ var ListFindingInstancesResponse = external_exports.object({
15310
+ // Instances matching the filters across the whole scope, not just this
15311
+ // page — cursor-independent, like the grouped list's totals.
15312
+ totals: external_exports.object({ findings: external_exports.number().int().nonnegative() }),
15313
+ // Counts in INSTANCES here, where the grouped response counts groups. Each
15314
+ // dimension still excludes its own filter.
15315
+ facets: FindingFacets,
15316
+ items: external_exports.array(FindingInstanceDetail),
15317
+ nextCursor: external_exports.string().nullable()
15318
+ }).meta({ id: "ListFindingInstancesResponse" });
15319
+ var FindingLocationFile = external_exports.object({
15320
+ // Empty when the instances carried no file path (a prompt or a tool call
15321
+ // with no file attribution).
15322
+ file: external_exports.string(),
15323
+ instanceCount: external_exports.number().int().nonnegative(),
15324
+ maxSeverity: Severity,
15325
+ latestDetectedAt: external_exports.iso.datetime(),
15326
+ // Folded from the instances' derived statuses with the same
15327
+ // open-dominates precedence a group uses.
15328
+ status: FindingStatus.optional(),
15329
+ // Distinct rules seen at this location, capped — the row shows them as
15330
+ // chips, and the count is what conveys scale.
15331
+ ruleIds: external_exports.array(external_exports.string())
15332
+ }).meta({ id: "FindingLocationFile" });
15333
+ var FindingLocationRepo = external_exports.object({
15334
+ /** Empty when the instances carried no repo attribute. */
15335
+ repo: external_exports.string(),
15336
+ instanceCount: external_exports.number().int().nonnegative(),
15337
+ maxSeverity: Severity,
15338
+ latestDetectedAt: external_exports.iso.datetime(),
15339
+ status: FindingStatus.optional(),
15340
+ files: external_exports.array(FindingLocationFile)
15341
+ }).meta({ id: "FindingLocationRepo" });
15342
+ var ListFindingLocationsQuery = external_exports.object({
15343
+ severity: external_exports.array(Severity).optional(),
15344
+ subtype: external_exports.array(external_exports.string()).optional(),
15345
+ provider: external_exports.array(FindingProvider).optional(),
15346
+ action: external_exports.array(FindingAction).optional(),
15347
+ // Per-instance, as in ListFindingInstancesQuery: a location keeps the
15348
+ // instances that match, and folds its status from those.
15349
+ status: external_exports.array(FindingStatus).optional(),
15350
+ tool: external_exports.array(external_exports.string()).optional(),
15351
+ q: external_exports.string().optional(),
15352
+ sessionId: external_exports.string().optional(),
15353
+ from: external_exports.iso.datetime().optional(),
15354
+ limit: external_exports.coerce.number().int().min(1).max(500).optional()
15355
+ });
15356
+ var ListFindingLocationsResponse = external_exports.object({
15357
+ totals: external_exports.object({
15358
+ findings: external_exports.number().int().nonnegative(),
15359
+ repos: external_exports.number().int().nonnegative(),
15360
+ files: external_exports.number().int().nonnegative()
15361
+ }),
15362
+ /** Sorted by max severity, then most recent. */
15363
+ items: external_exports.array(FindingLocationRepo),
15364
+ /** Whether `limit` truncated the repo list. */
15365
+ hasMore: external_exports.boolean()
15366
+ }).meta({ id: "ListFindingLocationsResponse" });
15255
15367
 
15256
15368
  // ../../packages/schema/src/zod/harness-map.ts
15257
- var Harness = external_exports.enum(["claudecode", "cursor", "copilot", "codex", "windsurf", "claudedesktop", "chatgpt", "api"]).meta({ id: "Harness" });
15369
+ var Harness = external_exports.enum([
15370
+ "claudecode",
15371
+ "cursor",
15372
+ "copilot",
15373
+ "codex",
15374
+ "antigravity",
15375
+ "windsurf",
15376
+ "claudedesktop",
15377
+ "chatgpt",
15378
+ "claudeai",
15379
+ "api"
15380
+ ]).meta({ id: "Harness" });
15258
15381
 
15259
15382
  // ../../packages/schema/src/zod/meta.ts
15260
15383
  var InventoryObjectType = external_exports.enum(["host", "harness", "user", "skill", "hook", "mcp_server", "config_file"]).meta({ id: "InventoryObjectType" });
@@ -15708,7 +15831,18 @@ var ActivityOverviewResponse = external_exports.object({
15708
15831
  // ../../packages/schema/src/zod/event.ts
15709
15832
  var EventKind = external_exports.enum(["prompt", "response", "code_change", "tool_use"]).meta({ id: "EventKind" });
15710
15833
  var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
15711
- var SourceTool = external_exports.enum(["claude-code", "claude-desktop", "cursor", "chatgpt", "github-copilot", "cli", "unknown"]).meta({ id: "SourceTool" });
15834
+ var SourceTool = external_exports.enum([
15835
+ "claude-code",
15836
+ "claude-desktop",
15837
+ "cursor",
15838
+ "chatgpt",
15839
+ "claude-ai",
15840
+ "github-copilot",
15841
+ "codex",
15842
+ "antigravity",
15843
+ "cli",
15844
+ "unknown"
15845
+ ]).meta({ id: "SourceTool" });
15712
15846
  var EventMetadata = external_exports.object({
15713
15847
  sessionId: external_exports.string().optional(),
15714
15848
  repo: external_exports.string().optional(),
@@ -15779,7 +15913,7 @@ var TrustLevel = external_exports.enum(["known-good", "risky", "unapproved"]).me
15779
15913
  var Flag = external_exports.enum(["update", "stale", "conflict", "unknown", "change", "untracked", "risk", "findings"]).meta({ id: "Flag" });
15780
15914
  var Visibility = external_exports.enum(["public", "private"]).meta({ id: "Visibility" });
15781
15915
  var HarnessEventKind = external_exports.enum(["block", "redact", "warn"]).meta({ id: "HarnessEventKind" });
15782
- var HarnessId = external_exports.enum(["claudecode", "cursor", "codex"]).meta({ id: "HarnessId" });
15916
+ var HarnessId = external_exports.enum(["claudecode", "cursor", "codex", "antigravity"]).meta({ id: "HarnessId" });
15783
15917
  var AccessCounts = external_exports.object({
15784
15918
  open: external_exports.number().int().nonnegative(),
15785
15919
  approved: external_exports.number().int().nonnegative(),
@@ -16001,6 +16135,7 @@ var ExceptionConditions = external_exports.object({
16001
16135
  sourceTool: external_exports.string().optional(),
16002
16136
  provider: external_exports.string().optional()
16003
16137
  }).strict();
16138
+ var ExceptionCapability = external_exports.enum(["suppress", "reveal_to_model"]);
16004
16139
  var DetectionException = external_exports.object({
16005
16140
  id: external_exports.guid(),
16006
16141
  ruleId: external_exports.string(),
@@ -16017,6 +16152,7 @@ var DetectionException = external_exports.object({
16017
16152
  keyVersion: external_exports.number().int().positive(),
16018
16153
  // maskMatch() preview of the approved value — never the raw value.
16019
16154
  maskedValue: external_exports.string(),
16155
+ capability: ExceptionCapability.default("suppress"),
16020
16156
  scope: ExceptionScope,
16021
16157
  expiresAt: external_exports.iso.datetime().nullable(),
16022
16158
  maxUses: external_exports.number().int().positive().nullable(),
@@ -16040,11 +16176,13 @@ var ExceptionBundleEntry = DetectionException.pick({
16040
16176
  ruleId: true,
16041
16177
  valueFingerprint: true,
16042
16178
  keyVersion: true,
16179
+ capability: true,
16043
16180
  expiresAt: true,
16044
16181
  maxUses: true,
16045
16182
  useCount: true,
16046
16183
  conditions: true
16047
16184
  });
16185
+ var ExceptionDescriptor = DetectionException.omit({ valueFingerprint: true });
16048
16186
 
16049
16187
  // ../../packages/schema/src/zod/rule.ts
16050
16188
  var MatcherType = external_exports.enum(["keyword", "regex", "validator"]).meta({ id: "MatcherType" });
@@ -16776,6 +16914,35 @@ var EgressWriteSummary = external_exports.object({
16776
16914
  droppedFiles: external_exports.array(external_exports.string()).default([])
16777
16915
  }).meta({ id: "EgressWriteSummary" });
16778
16916
 
16917
+ // ../../packages/schema/src/zod/exception-action.ts
16918
+ var confirmation = external_exports.string().optional();
16919
+ var ApproveBlockedInput = external_exports.object({
16920
+ reference: external_exports.string(),
16921
+ scope: external_exports.string(),
16922
+ reason: external_exports.string(),
16923
+ confirmation
16924
+ });
16925
+ var AddExceptionInput = external_exports.object({
16926
+ ruleId: external_exports.string(),
16927
+ value: external_exports.string(),
16928
+ scope: external_exports.string(),
16929
+ reason: external_exports.string(),
16930
+ confirmation
16931
+ });
16932
+ var GrantRevealInput = external_exports.object({
16933
+ pointer: external_exports.string(),
16934
+ scope: external_exports.string(),
16935
+ justification: external_exports.string(),
16936
+ confirmation
16937
+ });
16938
+ var RevokeExceptionInput = external_exports.object({
16939
+ id: external_exports.string(),
16940
+ reason: external_exports.string()
16941
+ });
16942
+ var RotateKeyInput = external_exports.object({
16943
+ confirmation: external_exports.string()
16944
+ });
16945
+
16779
16946
  // ../../packages/schema/src/zod/installed-pack.ts
16780
16947
  var InstalledPack = external_exports.object({
16781
16948
  id: external_exports.guid(),
@@ -16806,8 +16973,158 @@ var PatchInstalledPackRequest = external_exports.object({
16806
16973
  message: "At least one field must be provided"
16807
16974
  }).meta({ id: "PatchInstalledPackRequest" });
16808
16975
 
16976
+ // ../../packages/schema/src/zod/vault.ts
16977
+ var CATEGORY_ALTERNATION = DetectionCategory.options.join("|");
16978
+ var POINTER_TOKEN_PATTERN = new RegExp(
16979
+ `\\[\\[aka:(?:${CATEGORY_ALTERNATION}):[A-Z2-7]{2,7}\\.[A-Z2-7]{26}\\.[A-Z2-7]{16}\\]\\]`
16980
+ );
16981
+ var POINTER_TOKEN_ANCHORED = new RegExp(`^${POINTER_TOKEN_PATTERN.source}$`);
16982
+ var PointerToken = external_exports.string().regex(POINTER_TOKEN_ANCHORED);
16983
+ var ParsedPointer = external_exports.object({
16984
+ category: DetectionCategory,
16985
+ keyVersion: external_exports.number().int().positive(),
16986
+ pointerId: external_exports.string(),
16987
+ tag: external_exports.string()
16988
+ });
16989
+ var VaultEntry = external_exports.object({
16990
+ pointerId: external_exports.string(),
16991
+ // The keyed HMAC of the raw value under `exception.key`, and the epoch it was
16992
+ // derived under. This is what a reveal-to-model grant matches on, and it rotates
16993
+ // independently of the vault encryption key below.
16994
+ valueFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/),
16995
+ fingerprintKeyVersion: external_exports.number().int().positive(),
16996
+ // The vault-key epoch this row's ciphertext was sealed under.
16997
+ keyVersion: external_exports.number().int().positive(),
16998
+ // Fixed at first mint and never updated: the same value detected later under a
16999
+ // different rule's category keeps the category it was minted with, so one
17000
+ // value always produces exactly one wire token.
17001
+ category: DetectionCategory,
17002
+ ruleId: external_exports.string(),
17003
+ // Partial-reveal preview for badges and listings. Never the raw value.
17004
+ maskedMatch: external_exports.string(),
17005
+ provider: external_exports.string().optional(),
17006
+ ciphertext: external_exports.string(),
17007
+ nonce: external_exports.string(),
17008
+ authTag: external_exports.string(),
17009
+ // How many times this value has been detected on this machine — the reuse
17010
+ // signal the vault dashboard reads. Distinct from VaultDeref.pointerCount.
17011
+ occurrenceCount: external_exports.number().int().nonnegative(),
17012
+ firstSeen: external_exports.string(),
17013
+ lastSeen: external_exports.string()
17014
+ });
17015
+ var PointerDescriptor = external_exports.object({
17016
+ category: DetectionCategory,
17017
+ provider: external_exports.string().optional(),
17018
+ maskedMatch: external_exports.string(),
17019
+ occurrences: external_exports.number().int().nonnegative(),
17020
+ firstSeen: external_exports.string(),
17021
+ lastSeen: external_exports.string()
17022
+ });
17023
+ var PointerIdentity = external_exports.object({
17024
+ ruleId: external_exports.string(),
17025
+ valueFingerprint: external_exports.string().regex(/^[0-9a-f]{64}$/),
17026
+ fingerprintKeyVersion: external_exports.number().int().positive()
17027
+ });
17028
+ var DetokenizeTarget = external_exports.enum(["human", "model"]);
17029
+ var VaultDerefReason = external_exports.enum([
17030
+ "display",
17031
+ "explicit-reveal",
17032
+ "view-render",
17033
+ "model-input",
17034
+ "remediation",
17035
+ "purge"
17036
+ ]);
17037
+ var VaultDerefOutcome = external_exports.enum(["revealed", "refused", "unavailable"]);
17038
+ var VaultDeref = external_exports.object({
17039
+ id: external_exports.guid(),
17040
+ pointerId: external_exports.string(),
17041
+ at: external_exports.string(),
17042
+ target: DetokenizeTarget,
17043
+ reason: VaultDerefReason,
17044
+ outcome: VaultDerefOutcome,
17045
+ // Present only on a model-target crossing that a reveal grant authorized.
17046
+ grantId: external_exports.string().optional(),
17047
+ // How many pointers ONE batched render resolved. 1 for unbatched rows. Named
17048
+ // apart from VaultEntry.occurrenceCount, which counts detections of a value.
17049
+ pointerCount: external_exports.number().int().positive().default(1)
17050
+ });
17051
+ var VaultSightingKind = external_exports.enum([
17052
+ "prompt",
17053
+ "tool-input",
17054
+ "tool-output",
17055
+ "file",
17056
+ "transcript"
17057
+ ]);
17058
+ var VaultSighting = external_exports.object({
17059
+ location: external_exports.string(),
17060
+ kind: VaultSightingKind,
17061
+ firstSeen: external_exports.string(),
17062
+ lastSeen: external_exports.string()
17063
+ });
17064
+ var VaultInventoryEntry = external_exports.object({
17065
+ pointerId: external_exports.string(),
17066
+ category: DetectionCategory,
17067
+ provider: external_exports.string().optional(),
17068
+ maskedMatch: external_exports.string(),
17069
+ occurrences: external_exports.number().int().nonnegative(),
17070
+ firstSeen: external_exports.string(),
17071
+ lastSeen: external_exports.string(),
17072
+ // The active reveal-to-model grant covering this value, when one exists —
17073
+ // the inventory badges it, the row links to revocation.
17074
+ revealGrantId: external_exports.string().nullable(),
17075
+ sightings: external_exports.array(VaultSighting)
17076
+ });
17077
+ var MAX_VAULT_PAGE_LIMIT = 200;
17078
+ var ListVaultInventoryQuery = external_exports.object({
17079
+ limit: external_exports.coerce.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
17080
+ // Opaque; names the last row of the page just served.
17081
+ cursor: external_exports.string().optional()
17082
+ });
17083
+ var ListVaultInventoryResponse = external_exports.object({
17084
+ // Vaulted values across the whole store, not just this page — cursor-
17085
+ // independent, so paging never changes what the count claims.
17086
+ totals: external_exports.object({ values: external_exports.number().int().nonnegative() }),
17087
+ items: external_exports.array(VaultInventoryEntry),
17088
+ // `null` once the last page is reached.
17089
+ nextCursor: external_exports.string().nullable()
17090
+ });
17091
+ var ListVaultReuseQuery = external_exports.object({
17092
+ limit: external_exports.coerce.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
17093
+ cursor: external_exports.string().optional()
17094
+ });
17095
+ var ListVaultReuseResponse = external_exports.object({
17096
+ // Reused values across the whole store — the number the section's claim
17097
+ // ("values detected in more than one place") is about.
17098
+ totals: external_exports.object({ reused: external_exports.number().int().nonnegative() }),
17099
+ items: external_exports.array(VaultInventoryEntry),
17100
+ nextCursor: external_exports.string().nullable()
17101
+ });
17102
+ var ListVaultDerefsQuery = external_exports.object({
17103
+ // Include the batched, high-volume reasons (display, view-render). Omitted
17104
+ // hides them and counts them into `hiddenBatched` instead, so the model
17105
+ // crossings stay visible. A real boolean, not `z.stringbool()`: this arrives
17106
+ // over a Server Action, which preserves the type, never as a URL param.
17107
+ includeBatched: external_exports.boolean().optional(),
17108
+ limit: external_exports.coerce.number().int().min(1).max(MAX_VAULT_PAGE_LIMIT).optional(),
17109
+ cursor: external_exports.string().optional()
17110
+ });
17111
+ var ListVaultDerefsResponse = external_exports.object({
17112
+ items: external_exports.array(VaultDeref),
17113
+ nextCursor: external_exports.string().nullable(),
17114
+ // Display/view-render rows the query hid, over the WHOLE trail rather than
17115
+ // this page — it is the count the "N hidden" line and its toggle speak for.
17116
+ // Always 0 when `includeBatched` was set, since nothing was hidden.
17117
+ hiddenBatched: external_exports.number().int().nonnegative()
17118
+ });
17119
+ var VaultKeyCustody = external_exports.string();
17120
+ var VaultInlineReveal = external_exports.enum(["masked", "full", "off"]);
17121
+ var VaultConsent = external_exports.object({
17122
+ acknowledgedAt: external_exports.iso.datetime(),
17123
+ version: external_exports.number().int().positive()
17124
+ });
17125
+
16809
17126
  // ../../packages/schema/src/zod/local.ts
16810
- var WORKSPACE_SETTINGS_SPEC_VERSION = 4;
17127
+ var WORKSPACE_SETTINGS_SPEC_VERSION = 5;
16811
17128
  var RunMode = external_exports.enum(["standalone"]);
16812
17129
  var SimpleDetectionPolicy = external_exports.enum(["redact", "warn"]);
16813
17130
  var HistoricalAccess = external_exports.enum(["full", "session-only"]);
@@ -16829,6 +17146,16 @@ var WorkspaceSettings = external_exports.object({
16829
17146
  // In-place egress extraction on the scan paths; disable to stop all Data
16830
17147
  // Shares writes.
16831
17148
  dataSharesInPlace: external_exports.boolean().default(true),
17149
+ // Consent to keep a RECOVERABLE encrypted copy of detected values in the local
17150
+ // vault, instead of destroying them. Absent by default: this is a custody
17151
+ // change from one-way redaction, so it is never an assumed grant on upgrade.
17152
+ // Revoking stops future vaulting; it does not erase what is already stored —
17153
+ // purging the vault is the eraser.
17154
+ vaultConsent: VaultConsent.optional(),
17155
+ // Where the vault master key lives.
17156
+ vaultKeyCustody: VaultKeyCustody.default("file"),
17157
+ // How a pointer renders in assistant prose on screen (see VaultInlineReveal).
17158
+ vaultInlineReveal: VaultInlineReveal.default("masked"),
16832
17159
  // Absent until /aka:setup completes; its presence is what "onboarded" means.
16833
17160
  onboardedAt: external_exports.iso.datetime().optional(),
16834
17161
  // Records that the user consented to sending findings to the model API for
@@ -17045,7 +17372,7 @@ var TopSourcesQuery = external_exports.object({
17045
17372
  // Omit for both kinds.
17046
17373
  kind: external_exports.enum(SOURCE_KINDS).optional()
17047
17374
  });
17048
- var Provider = external_exports.enum(["claudecode", "cursor", "codex", "chatgpt", "copilot", "api"]).meta({ id: "Provider" });
17375
+ var Provider = external_exports.enum(["claudecode", "cursor", "codex", "antigravity", "claudeai", "chatgpt", "copilot", "api"]).meta({ id: "Provider" });
17049
17376
  var ScanCoverageProvider = external_exports.object({
17050
17377
  provider: Provider,
17051
17378
  // Percent of that provider's traffic scanned in the window. 0 when unsupported.
@@ -17213,59 +17540,125 @@ var SetupHandoffOffer = external_exports.object({
17213
17540
  // ../../packages/persistence/src/ids.ts
17214
17541
  import { createHash } from "crypto";
17215
17542
 
17543
+ // ../../packages/persistence/src/internal/snapshot.ts
17544
+ import { randomUUID } from "crypto";
17545
+ import { existsSync, readdirSync, renameSync as renameSync2, rmSync as rmSync2, statSync } from "fs";
17546
+ import { basename, dirname, join } from "path";
17547
+
17216
17548
  // ../../packages/persistence/src/paths.ts
17217
- import { chmodSync, lstatSync, mkdirSync, renameSync, rmSync, writeFileSync } from "fs";
17549
+ import {
17550
+ chmodSync,
17551
+ linkSync,
17552
+ lstatSync,
17553
+ mkdirSync,
17554
+ renameSync,
17555
+ rmSync,
17556
+ writeFileSync
17557
+ } from "fs";
17558
+ import { threadId } from "worker_threads";
17559
+
17560
+ // ../../packages/persistence/src/internal/snapshot.ts
17561
+ var STALE_PARTIAL_MS = 5 * 6e4;
17218
17562
 
17219
17563
  // ../../packages/persistence/src/repositories/activity.ts
17220
17564
  var LIVE_ACTIVITY_WINDOW_MS = 30 * 6e4;
17221
17565
 
17222
17566
  // ../../packages/persistence/src/repositories/exceptions.ts
17223
- import { randomUUID } from "crypto";
17567
+ import { randomUUID as randomUUID2 } from "crypto";
17224
17568
  var BLOCKED_DETECTIONS_TTL_MS = 30 * 60 * 1e3;
17225
17569
  var BLOCKED_DETECTIONS_RETENTION_MS = 24 * 60 * 60 * 1e3;
17570
+ var ACTIVE_PREDICATE = `revoked_at IS NULL
17571
+ AND (expires_at IS NULL OR expires_at > :now)
17572
+ AND (max_uses IS NULL OR use_count < max_uses)`;
17573
+ var ACTIVE_REVEAL_GRANT_PREDICATE = `capability = 'reveal_to_model'
17574
+ AND conditions IS NULL
17575
+ AND ${ACTIVE_PREDICATE}`;
17226
17576
 
17227
17577
  // ../../packages/persistence/src/repositories/installed-packs.ts
17228
- import { createHash as createHash2, randomUUID as randomUUID2 } from "crypto";
17578
+ import { createHash as createHash2, randomUUID as randomUUID3 } from "crypto";
17229
17579
 
17230
17580
  // ../../packages/persistence/src/repositories/inventory-assets.ts
17231
- import { randomUUID as randomUUID3 } from "crypto";
17581
+ import { randomUUID as randomUUID4 } from "crypto";
17232
17582
  var VALID_HARNESS_IDS = new Set(HarnessId.options);
17233
17583
  var HARNESS_LIVENESS_WINDOW_MS = 30 * 24 * 60 * 60 * 1e3;
17234
17584
 
17235
17585
  // ../../packages/persistence/src/repositories/policies.ts
17236
- import { randomUUID as randomUUID4 } from "crypto";
17586
+ import { randomUUID as randomUUID5 } from "crypto";
17237
17587
 
17238
17588
  // ../../packages/persistence/src/repositories/project-files.ts
17239
- import { randomUUID as randomUUID5 } from "crypto";
17589
+ import { randomUUID as randomUUID6 } from "crypto";
17240
17590
 
17241
17591
  // ../../packages/persistence/src/repositories/resolutions.ts
17242
- import { randomUUID as randomUUID6 } from "crypto";
17592
+ import { randomUUID as randomUUID7 } from "crypto";
17593
+
17594
+ // ../../packages/persistence/src/repositories/secret-vault.ts
17595
+ import { randomUUID as randomUUID8 } from "crypto";
17243
17596
 
17244
17597
  // ../../packages/persistence/src/repositories/shares.ts
17245
- import { randomUUID as randomUUID7 } from "crypto";
17598
+ import { randomUUID as randomUUID9 } from "crypto";
17599
+
17600
+ // ../../packages/persistence/src/file-lock.ts
17601
+ import { randomUUID as randomUUID11 } from "crypto";
17602
+ import {
17603
+ closeSync,
17604
+ existsSync as existsSync2,
17605
+ openSync,
17606
+ readFileSync,
17607
+ rmSync as rmSync3,
17608
+ statSync as statSync2,
17609
+ writeFileSync as writeFileSync2
17610
+ } from "fs";
17611
+ import { hostname as hostname3 } from "os";
17612
+ var PARK = new Int32Array(new SharedArrayBuffer(4));
17246
17613
 
17247
17614
  // ../../packages/persistence/src/finding-key.ts
17248
17615
  import { createHash as createHash3 } from "crypto";
17249
17616
 
17250
17617
  // ../../packages/persistence/src/fingerprint.ts
17251
17618
  import { createHmac, randomBytes } from "crypto";
17252
- import { existsSync as existsSync2, readFileSync } from "fs";
17253
- import { join as join2 } from "path";
17619
+ import { existsSync as existsSync3, readFileSync as readFileSync2 } from "fs";
17620
+ import { join as join3 } from "path";
17254
17621
  import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
17255
17622
 
17256
17623
  // ../../packages/persistence/src/local-layout.ts
17257
17624
  import { renameSync as renameSync3 } from "fs";
17258
17625
  import { mkdir } from "fs/promises";
17259
17626
  import { homedir } from "os";
17260
- import { join as join3 } from "path";
17627
+ import { join as join4 } from "path";
17261
17628
 
17262
17629
  // ../../packages/persistence/src/settings.ts
17263
- import { readFileSync as readFileSync2 } from "fs";
17264
- import { join as join4 } from "path";
17630
+ import { readFileSync as readFileSync3 } from "fs";
17631
+ import { join as join5 } from "path";
17632
+
17633
+ // ../../packages/persistence/src/vault/crypto.ts
17634
+ import {
17635
+ createCipheriv,
17636
+ createDecipheriv,
17637
+ createHmac as createHmac2,
17638
+ hkdfSync,
17639
+ timingSafeEqual
17640
+ } from "crypto";
17641
+
17642
+ // ../../packages/persistence/src/vault/key-provider.ts
17643
+ import { execFileSync } from "child_process";
17644
+ import { randomBytes as randomBytes2 } from "crypto";
17645
+ import {
17646
+ chmodSync as chmodSync2,
17647
+ mkdirSync as mkdirSync2,
17648
+ readFileSync as readFileSync4,
17649
+ renameSync as renameSync4,
17650
+ rmSync as rmSync4,
17651
+ statSync as statSync3,
17652
+ writeFileSync as writeFileSync3
17653
+ } from "fs";
17654
+ import { join as join6 } from "path";
17655
+
17656
+ // ../../packages/persistence/src/vault/vault.ts
17657
+ import { randomBytes as randomBytes3, randomUUID as randomUUID12 } from "crypto";
17265
17658
 
17266
17659
  // ../../packages/persistence/src/warn-era-cap.ts
17267
- import { existsSync as existsSync3, writeFileSync as writeFileSync2 } from "fs";
17268
- import { join as join5 } from "path";
17660
+ import { existsSync as existsSync4, writeFileSync as writeFileSync4 } from "fs";
17661
+ import { join as join7 } from "path";
17269
17662
 
17270
17663
  // ../../packages/plugin-sdk/src/provider-env.ts
17271
17664
  var booleanish = external_exports.string().optional().transform((v) => {
@@ -17286,9 +17679,9 @@ var providerEnvShape = {
17286
17679
  var ProviderEnvSchema = external_exports.object(providerEnvShape);
17287
17680
 
17288
17681
  // ../../packages/plugin-sdk/src/config-inventory.ts
17289
- import { readdirSync, readFileSync as readFileSync4, realpathSync, statSync as statSync2 } from "fs";
17682
+ import { readdirSync as readdirSync2, readFileSync as readFileSync6, realpathSync, statSync as statSync5 } from "fs";
17290
17683
  import { homedir as homedir2 } from "os";
17291
- import { basename as basename2, join as join8 } from "path";
17684
+ import { basename as basename3, join as join10 } from "path";
17292
17685
 
17293
17686
  // ../../packages/detections/src/egress/registry.ts
17294
17687
  var EXTRACTOR_VERSION = "1";
@@ -17999,39 +18392,70 @@ var POLYNOMIAL_PROBES = ["abc-", "a.", "a ", "a=", "x", "0", "a@", "a/", "ab"].m
17999
18392
  );
18000
18393
 
18001
18394
  // ../../packages/plugin-sdk/src/repo.ts
18002
- import { existsSync as existsSync5, readFileSync as readFileSync3, statSync } from "fs";
18003
- import { basename, dirname, isAbsolute, join as join7, sep as sep2 } from "path";
18395
+ import { existsSync as existsSync6, readFileSync as readFileSync5, statSync as statSync4 } from "fs";
18396
+ import { basename as basename2, dirname as dirname2, isAbsolute, join as join9, sep as sep2 } from "path";
18004
18397
 
18005
18398
  // ../../packages/plugin-sdk/src/events.ts
18006
- import { createHash as createHash4, randomUUID as randomUUID9 } from "crypto";
18399
+ import { createHash as createHash4, randomUUID as randomUUID13 } from "crypto";
18400
+
18401
+ // ../../packages/plugin-sdk/src/isolated-scan.ts
18402
+ import { existsSync as existsSync7 } from "fs";
18403
+ import { fileURLToPath } from "url";
18404
+ import { Worker } from "worker_threads";
18007
18405
 
18008
18406
  // ../../packages/plugin-sdk/src/inventory-resolver.ts
18009
- import { arch, hostname as hostname3, platform, release } from "os";
18407
+ import { arch, hostname as hostname4, platform, release } from "os";
18010
18408
 
18011
18409
  // ../../packages/plugin-sdk/src/nudge.ts
18012
- import { mkdirSync as mkdirSync2, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
18013
- import { join as join9 } from "path";
18410
+ import { mkdirSync as mkdirSync3, readFileSync as readFileSync7, writeFileSync as writeFileSync5 } from "fs";
18411
+ import { join as join11 } from "path";
18014
18412
 
18015
18413
  // ../../packages/plugin-sdk/src/paths.ts
18016
- import { readdirSync as readdirSync2, realpathSync as realpathSync2 } from "fs";
18017
- import { basename as basename3, dirname as dirname2, sep as sep3 } from "path";
18414
+ import { readdirSync as readdirSync3, realpathSync as realpathSync2 } from "fs";
18415
+ import { basename as basename4, dirname as dirname3, sep as sep3 } from "path";
18018
18416
 
18019
18417
  // ../../packages/plugin-sdk/src/project-files.ts
18020
18418
  var import_ignore = __toESM(require_ignore(), 1);
18021
- import { existsSync as existsSync6, readdirSync as readdirSync3, readFileSync as readFileSync6 } from "fs";
18022
- import { basename as basename4, join as join10, relative, sep as sep4 } from "path";
18419
+ import { existsSync as existsSync8, readdirSync as readdirSync4, readFileSync as readFileSync8 } from "fs";
18420
+ import { basename as basename5, join as join12, relative, sep as sep4 } from "path";
18421
+
18422
+ // ../../packages/plugin-sdk/src/provider-env-antigravity.ts
18423
+ var optionalBaseUrl2 = external_exports.preprocess((v) => {
18424
+ if (typeof v === "string" && v.trim() === "") return void 0;
18425
+ return v;
18426
+ }, external_exports.string().optional()).catch(void 0);
18427
+ var optionalFlag = external_exports.preprocess((v) => {
18428
+ if (typeof v !== "string") return false;
18429
+ const normalized = v.trim().toLowerCase();
18430
+ return normalized !== "" && normalized !== "0" && normalized !== "false";
18431
+ }, external_exports.boolean()).catch(false);
18432
+ var antigravityProviderEnvShape = {
18433
+ GOOGLE_GENAI_USE_VERTEXAI: optionalFlag,
18434
+ GOOGLE_GEMINI_BASE_URL: optionalBaseUrl2
18435
+ };
18436
+ var AntigravityProviderEnvSchema = external_exports.object(antigravityProviderEnvShape);
18437
+
18438
+ // ../../packages/plugin-sdk/src/provider-env-codex.ts
18439
+ var optionalBaseUrl3 = external_exports.preprocess((v) => {
18440
+ if (typeof v === "string" && v.trim() === "") return void 0;
18441
+ return v;
18442
+ }, external_exports.string().optional()).catch(void 0);
18443
+ var codexProviderEnvShape = {
18444
+ OPENAI_BASE_URL: optionalBaseUrl3
18445
+ };
18446
+ var CodexProviderEnvSchema = external_exports.object(codexProviderEnvShape);
18023
18447
 
18024
18448
  // ../../packages/plugin-sdk/src/runtime.ts
18025
- import { randomUUID as randomUUID10 } from "crypto";
18449
+ import { randomUUID as randomUUID14 } from "crypto";
18026
18450
 
18027
18451
  // ../../packages/plugin-sdk/src/suppressions.ts
18028
18452
  var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
18029
18453
 
18030
18454
  // ../../packages/plugin-sdk/src/throttle.ts
18031
- import { mkdirSync as mkdirSync3, statSync as statSync3, writeFileSync as writeFileSync4 } from "fs";
18032
- import { join as join11 } from "path";
18455
+ import { mkdirSync as mkdirSync4, statSync as statSync6, writeFileSync as writeFileSync6 } from "fs";
18456
+ import { join as join13 } from "path";
18033
18457
 
18034
- // src/onboard-posture.ts
18458
+ // ../../packages/setup-wizard/src/onboard-posture.ts
18035
18459
  function parsePosture(json2) {
18036
18460
  const raw = JSON.parse(json2);
18037
18461
  if (typeof raw !== "object" || raw === null) throw new Error("posture must be a JSON object");
@@ -18066,6 +18490,73 @@ function parseCurrent(json2) {
18066
18490
  return out;
18067
18491
  }
18068
18492
 
18493
+ // ../../packages/setup-wizard/src/remediation/rotation-checklist.ts
18494
+ import { writeFileSync as writeFileSync7 } from "fs";
18495
+ import { join as join14 } from "path";
18496
+
18497
+ // ../../packages/setup-wizard/src/triage/gate-display.ts
18498
+ var ACTION_RANK = {
18499
+ allow: 0,
18500
+ log: 1,
18501
+ warn: 2,
18502
+ redact: 3,
18503
+ block: 4
18504
+ };
18505
+ function isDowngrade(planned, current) {
18506
+ if (current === void 0) return false;
18507
+ return ACTION_RANK[builtinPolicyToAction(planned)] < ACTION_RANK[current];
18508
+ }
18509
+ function downgradeWarning(downgrades) {
18510
+ if (downgrades.length === 0) return "";
18511
+ return `
18512
+
18513
+ Heads up \u2014 this would lower ${String(downgrades.length)} detection level${downgrades.length === 1 ? "" : "s"} (${downgrades.join(", ")}) below what you've already set. Confirm you mean to lower ${downgrades.length === 1 ? "it" : "them"} before I apply.`;
18514
+ }
18515
+
18516
+ // ../../packages/setup-wizard/src/triage/plan-file.ts
18517
+ import { mkdtempSync, readFileSync as readFileSync9, rmdirSync, rmSync as rmSync5, writeFileSync as writeFileSync8 } from "fs";
18518
+ import { tmpdir } from "os";
18519
+ import { basename as basename6, dirname as dirname4, join as join15 } from "path";
18520
+ var SuppressionEntrySchema = external_exports.object({
18521
+ ruleId: external_exports.string(),
18522
+ category: DetectionCategory,
18523
+ valueFingerprint: external_exports.string(),
18524
+ keyVersion: external_exports.number(),
18525
+ maskedValue: external_exports.string(),
18526
+ justification: external_exports.string()
18527
+ });
18528
+ var ShowcaseCategorySchema = external_exports.object({
18529
+ category: DetectionCategory,
18530
+ action: BuiltinPolicyId,
18531
+ genuineCount: external_exports.number(),
18532
+ fpCount: external_exports.number(),
18533
+ reasoning: external_exports.string()
18534
+ });
18535
+ var JoinEntrySchema = external_exports.object({
18536
+ id: external_exports.string(),
18537
+ ruleId: external_exports.string(),
18538
+ category: DetectionCategory,
18539
+ valueFingerprint: external_exports.string().optional(),
18540
+ keyVersion: external_exports.number().optional(),
18541
+ maskedMatch: external_exports.string(),
18542
+ maskedContext: external_exports.string()
18543
+ });
18544
+ var PLAN_FILE_VERSION = 3;
18545
+ var PersistedPlanSchema = external_exports.object({
18546
+ version: external_exports.literal(PLAN_FILE_VERSION),
18547
+ // partialRecord (not record): a posture only covers the categories present in
18548
+ // the evidence, so an exhaustive-key record would reject every real plan.
18549
+ posture: external_exports.partialRecord(DetectionCategory, BuiltinPolicyId),
18550
+ entries: external_exports.array(SuppressionEntrySchema),
18551
+ showcase: external_exports.array(ShowcaseCategorySchema),
18552
+ join: external_exports.array(JoinEntrySchema),
18553
+ notes: external_exports.string(),
18554
+ // The store's per-category action at preview time. The downgrade view is
18555
+ // rendered from it at PREVIEW (renderPosturePlan); confirm reads it back ONLY to
18556
+ // compare against the live store and reject a stale plan (runConfirm's drift gate).
18557
+ current: external_exports.partialRecord(DetectionCategory, ActionTaken)
18558
+ });
18559
+
18069
18560
  // src/setup-show.ts
18070
18561
  var SHOW_BEGIN = "<<<AKA_SHOW";
18071
18562
  var SHOW_END = "AKA_SHOW>>>";
@@ -18150,28 +18641,9 @@ function show(body) {
18150
18641
  }
18151
18642
 
18152
18643
  // src/command-registry.ts
18153
- import { readdirSync as readdirSync4 } from "fs";
18154
- import { fileURLToPath } from "url";
18155
- var COMMANDS_DIR = fileURLToPath(new URL("../commands", import.meta.url));
18156
-
18157
- // src/triage/gate-display.ts
18158
- var ACTION_RANK = {
18159
- allow: 0,
18160
- log: 1,
18161
- warn: 2,
18162
- redact: 3,
18163
- block: 4
18164
- };
18165
- function isDowngrade(planned, current) {
18166
- if (current === void 0) return false;
18167
- return ACTION_RANK[builtinPolicyToAction(planned)] < ACTION_RANK[current];
18168
- }
18169
- function downgradeWarning(downgrades) {
18170
- if (downgrades.length === 0) return "";
18171
- return `
18172
-
18173
- Heads up \u2014 this would lower ${String(downgrades.length)} detection level${downgrades.length === 1 ? "" : "s"} (${downgrades.join(", ")}) below what you've already set. Confirm you mean to lower ${downgrades.length === 1 ? "it" : "them"} before I apply.`;
18174
- }
18644
+ import { readdirSync as readdirSync5 } from "fs";
18645
+ import { fileURLToPath as fileURLToPath2 } from "url";
18646
+ var COMMANDS_DIR = fileURLToPath2(new URL("../commands", import.meta.url));
18175
18647
 
18176
18648
  // src/render.ts
18177
18649
  var SEVERITY_GLYPH = {
@@ -18263,7 +18735,7 @@ function postureArg() {
18263
18735
  if (value === void 0) throw new Error("--adjust-confirm requires --posture <json>");
18264
18736
  return value;
18265
18737
  }
18266
- function recommendedPosture() {
18738
+ function recommendedPosture2() {
18267
18739
  const raw = jsonArg("--recommended");
18268
18740
  return raw === void 0 ? severityFloorPosture() : parsePosture(raw);
18269
18741
  }
@@ -18272,7 +18744,7 @@ function currentPosture() {
18272
18744
  return raw === void 0 ? {} : parseCurrent(raw);
18273
18745
  }
18274
18746
  try {
18275
- const card = argv.includes("--adjust-confirm") ? renderAdjustConfirm(recommendedPosture(), parsePosture(postureArg()), currentPosture()) : renderStartLight(severityFloorPosture());
18747
+ const card = argv.includes("--adjust-confirm") ? renderAdjustConfirm(recommendedPosture2(), parsePosture(postureArg()), currentPosture()) : renderStartLight(severityFloorPosture());
18276
18748
  process.stdout.write(show(fenced(card)));
18277
18749
  } catch (err) {
18278
18750
  const message = err instanceof Error ? err.message : String(err);