@akasecurity/ai-tc-claude-code 0.9.10 → 0.9.11

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,8 +492,8 @@ var require_ignore = __commonJS({
492
492
  });
493
493
 
494
494
  // ../../packages/plugin-sdk/src/config.ts
495
- import { existsSync as existsSync7 } from "fs";
496
- import { join as join13 } from "path";
495
+ import { existsSync as existsSync8 } from "fs";
496
+ import { join as join14 } from "path";
497
497
 
498
498
  // ../../packages/persistence/src/attached-derived.ts
499
499
  import { rmSync } from "fs";
@@ -20385,13 +20385,11 @@ var FindingGroup = external_exports.object({
20385
20385
  latestDetectedAt: external_exports.iso.datetime(),
20386
20386
  instances: external_exports.array(FindingInstance),
20387
20387
  // Derived from instances' statuses with open-dominates precedence (see
20388
- // buildFindingGroups). Undefined only when no instance carries a status.
20388
+ // foldGroupStatus). Undefined only when no instance carries a status.
20389
20389
  status: FindingStatus.optional(),
20390
- // The distinct people across the WHOLE group, not just the `instances`
20391
- // preview — from the store's whole-group aggregate when it supplies one,
20392
- // else folded from the rows (see buildFindingGroups). Undefined when no
20393
- // instance carries a user, or when the store supplied whole-group folds
20394
- // without one.
20390
+ // The distinct people across the WHOLE group, not just the instances
20391
+ // carried here. Undefined when no instance carries a user, or when the
20392
+ // store supplied whole-group folds without one.
20395
20393
  users: external_exports.array(FindingUser).optional()
20396
20394
  }).meta({ id: "FindingGroup" });
20397
20395
  var FindingStats = external_exports.object({
@@ -20420,20 +20418,30 @@ var FindingFacets = external_exports.object({
20420
20418
  // counted under no value.
20421
20419
  status: external_exports.array(FindingFacetItem),
20422
20420
  // Host tool (attributes.tool_name). Present only on the instance-level
20423
- // reads, which can filter by it; the grouped read omits the dimension
20421
+ // reads, which can filter by it; the type-level read omits the dimension
20424
20422
  // because a group spans tools.
20425
20423
  tool: external_exports.array(FindingFacetItem).optional()
20426
20424
  }).meta({ id: "FindingFacets" });
20427
- var ListGroupedFindingsQuery = external_exports.object({
20425
+ var FindingTypeSummary = FindingGroup.omit({ instances: true, match: true }).meta({
20426
+ id: "FindingTypeSummary"
20427
+ });
20428
+ var MAX_FINDING_TYPES_LIMIT = 100;
20429
+ var ListFindingTypesQuery = external_exports.object({
20428
20430
  // NOTE: severity filters by Severity (critical/high/medium/low), not by
20429
- // FindingAction.
20431
+ // FindingAction. It narrows TYPES: a type's severity is the one its newest
20432
+ // firing version carries, and this list pages types.
20433
+ //
20434
+ // That is NOT a claim the findings of a type share it. A rule can hold several
20435
+ // definition versions at different severities, so a type kept by this filter
20436
+ // can hold findings that individually do not match — see totals.findings on
20437
+ // ListFindingTypesResponse, which counts them all.
20430
20438
  severity: external_exports.array(Severity).optional(),
20431
20439
  subtype: external_exports.array(external_exports.string()).optional(),
20432
20440
  provider: external_exports.array(FindingProvider).optional(),
20433
20441
  action: external_exports.array(FindingAction).optional(),
20434
- // Matches a group's DERIVED status (see FindingGroup.status), not its
20435
- // individual instances' — so a filtered group's Status column always reads
20436
- // one of the requested values.
20442
+ // Matches a type's DERIVED status (see FindingGroup.status), not its
20443
+ // individual findings' — so a filtered row's status always reads one of the
20444
+ // requested values.
20437
20445
  status: external_exports.array(FindingStatus).optional(),
20438
20446
  q: external_exports.string().optional(),
20439
20447
  // Scope to findings whose event carries this session id (the Activity page's
@@ -20443,23 +20451,37 @@ var ListGroupedFindingsQuery = external_exports.object({
20443
20451
  // from a time-scoped page (Activity's range) can carry that scope. Absent
20444
20452
  // means all time — this list has no default window.
20445
20453
  from: external_exports.iso.datetime().optional(),
20446
- // A group or instance id that must appear in the page even when the cursor
20447
- // has already advanced past its sort position. This is what keeps the
20448
- // Findings page's one-shot ?finding= deep link resolving once the list
20449
- // paginates: the target group is appended out of sort order rather than
20450
- // scanning forward for it. Never affects totals, facets or the cursor.
20454
+ // A RULE id that must appear in the page even when the cursor has already
20455
+ // advanced past its sort position. This is what keeps the selected type
20456
+ // visible in the list once it paginates: the target is appended out of sort
20457
+ // order rather than scanned forward for. Never affects totals, facets or the
20458
+ // cursor. Unlike the grouped read this replaces, it names a rule only — an
20459
+ // instance id is resolved by `findingInstance`, which is a primary-key seek
20460
+ // and so is not bounded by what any page happens to hold.
20451
20461
  includeId: external_exports.string().optional(),
20452
- groupBy: external_exports.literal("type").optional(),
20453
- limit: external_exports.coerce.number().int().min(1).max(100).optional(),
20462
+ limit: external_exports.coerce.number().int().min(1).max(MAX_FINDING_TYPES_LIMIT).optional(),
20454
20463
  cursor: external_exports.string().optional()
20455
20464
  });
20456
- var ListGroupedFindingsResponse = external_exports.object({
20465
+ var ListFindingTypesResponse = external_exports.object({
20457
20466
  totals: external_exports.object({
20467
+ // Findings belonging to the matching TYPES — not findings that each match
20468
+ // the filters. The filters here select types, so a type that survives
20469
+ // contributes its whole instanceCount.
20470
+ //
20471
+ // `status` is the one exception, narrowed per finding via
20472
+ // countInstancesByStatus. `severity`, `provider` and `action` are not, so
20473
+ // this can exceed what the instance read reports for the same filters: a
20474
+ // rule whose severity moved between versions is kept on its newest and
20475
+ // still counts its older findings. Narrowing the other three needs
20476
+ // per-dimension counts the aggregate does not carry today.
20458
20477
  findings: external_exports.number().int().nonnegative(),
20459
- groups: external_exports.number().int().nonnegative()
20478
+ // Counts TYPES, which is the unit this read pages. The instance read's
20479
+ // own totals count findings; the two deliberately answer different
20480
+ // questions and are never summed.
20481
+ types: external_exports.number().int().nonnegative()
20460
20482
  }),
20461
20483
  facets: FindingFacets,
20462
- items: external_exports.array(FindingGroup),
20484
+ items: external_exports.array(FindingTypeSummary),
20463
20485
  nextCursor: external_exports.string().nullable(),
20464
20486
  // Present only on session-scoped queries (`sessionId` set): per ruleId, how
20465
20487
  // many times that rule fired in the session's persisted transcript. Findings
@@ -20467,7 +20489,7 @@ var ListGroupedFindingsResponse = external_exports.object({
20467
20489
  // every firing, so the two numbers legitimately differ — this map lets a
20468
20490
  // session-scoped view show both.
20469
20491
  sessionFirings: external_exports.record(external_exports.string(), external_exports.number().int().nonnegative()).optional()
20470
- }).meta({ id: "ListGroupedFindingsResponse" });
20492
+ }).meta({ id: "ListFindingTypesResponse" });
20471
20493
  var ApplyFindingActionRequest = external_exports.object({
20472
20494
  // 'quarantined' is system-assigned (see FindingAction) — clients may not set
20473
20495
  // it, so it is excluded from the request contract. The mapping helper
@@ -20496,12 +20518,13 @@ var FindingInstanceDetail = FindingInstance.extend({
20496
20518
  var MAX_FLAT_FINDINGS_LIMIT = 200;
20497
20519
  var ListFindingInstancesQuery = external_exports.object({
20498
20520
  severity: external_exports.array(Severity).optional(),
20499
- // Rule ids, the same vocabulary the grouped list's `subtype` carries.
20521
+ // Rule ids, the same vocabulary the types list's `subtype` carries. Pinning
20522
+ // ONE of them is how the master/detail view scopes its right-hand panel.
20500
20523
  subtype: external_exports.array(external_exports.string()).optional(),
20501
20524
  provider: external_exports.array(FindingProvider).optional(),
20502
20525
  action: external_exports.array(FindingAction).optional(),
20503
20526
  // Matches each instance's OWN derived status (deriveFindingStatus), unlike
20504
- // the grouped query's group-level fold.
20527
+ // the types query's type-level fold.
20505
20528
  status: external_exports.array(FindingStatus).optional(),
20506
20529
  // Exact host-tool names (attributes.tool_name, e.g. 'Bash'). A real filter,
20507
20530
  // where the free-text `q` can only match the rendered "via Bash" label.
@@ -20518,37 +20541,46 @@ var ListFindingInstancesQuery = external_exports.object({
20518
20541
  });
20519
20542
  var ListFindingInstancesResponse = external_exports.object({
20520
20543
  // Instances matching the filters across the whole scope, not just this
20521
- // page — cursor-independent, like the grouped list's totals.
20544
+ // page — cursor-independent, like the types list's totals.
20522
20545
  totals: external_exports.object({ findings: external_exports.number().int().nonnegative() }),
20523
- // Counts in INSTANCES here, where the grouped response counts groups. Each
20546
+ // Counts in INSTANCES here, where the types response counts types. Each
20524
20547
  // dimension still excludes its own filter.
20525
20548
  facets: FindingFacets,
20526
20549
  items: external_exports.array(FindingInstanceDetail),
20527
20550
  nextCursor: external_exports.string().nullable()
20528
20551
  }).meta({ id: "ListFindingInstancesResponse" });
20529
- var FindingLocationFile = external_exports.object({
20530
- // Empty when the instances carried no file path (a prompt or a tool call
20531
- // with no file attribution).
20532
- file: external_exports.string(),
20533
- instanceCount: external_exports.number().int().nonnegative(),
20534
- maxSeverity: Severity,
20535
- latestDetectedAt: external_exports.iso.datetime(),
20536
- // Folded from the instances' derived statuses with the same
20537
- // open-dominates precedence a group uses.
20538
- status: FindingStatus.optional(),
20539
- // Distinct rules seen at this location, capped — the row shows them as
20540
- // chips, and the count is what conveys scale.
20541
- ruleIds: external_exports.array(external_exports.string())
20542
- }).meta({ id: "FindingLocationFile" });
20543
- var FindingLocationRepo = external_exports.object({
20552
+ var FindingLocationSummary = external_exports.object({
20553
+ // Opaque, stable, minted from the pair by encodeLocationId. It exists
20554
+ // because a location's identity is two values and a URL param carries one:
20555
+ // `?loc=` names a location the way `?rule=` names a type. Only ever compared
20556
+ // for EQUALITY — the page's selection check, this read's `includeId`, the
20557
+ // client's page dedupe — never decoded, and never a sort key.
20558
+ id: external_exports.string(),
20544
20559
  /** Empty when the instances carried no repo attribute. */
20545
20560
  repo: external_exports.string(),
20561
+ // Empty when the instances carried no file path (a prompt, or a tool call
20562
+ // with no file attribution). Both halves empty is a real location — usually
20563
+ // the largest one in a store — and is selectable like any other.
20564
+ file: external_exports.string(),
20546
20565
  instanceCount: external_exports.number().int().nonnegative(),
20566
+ // The WORST severity present, not the first row's. It is this list's primary
20567
+ // sort key, so it is also what explains why a row is where it is, and it is
20568
+ // how a reader decides what to open without opening everything.
20547
20569
  maxSeverity: Severity,
20548
20570
  latestDetectedAt: external_exports.iso.datetime(),
20571
+ // Folded from the instances' derived statuses with the same open-dominates
20572
+ // precedence a group uses, so it answers "is anything left to do here" and
20573
+ // not much more: a location holding 1 open among 40 resolved reads like one
20574
+ // holding 40 open. That loss is accepted — the panel beside this list
20575
+ // carries each finding's own status, and instanceCount sits next to the
20576
+ // badge.
20549
20577
  status: FindingStatus.optional(),
20550
- files: external_exports.array(FindingLocationFile)
20551
- }).meta({ id: "FindingLocationRepo" });
20578
+ // Every distinct rule seen at this location, UNCAPPED — so the length is a
20579
+ // tally rather than a sample and a row can say how many there are. Bounded
20580
+ // by the ruleset, not by the store. The view bounds what it DISPLAYS.
20581
+ ruleIds: external_exports.array(external_exports.string())
20582
+ }).meta({ id: "FindingLocationSummary" });
20583
+ var MAX_FINDING_LOCATIONS_LIMIT = 100;
20552
20584
  var ListFindingLocationsQuery = external_exports.object({
20553
20585
  severity: external_exports.array(Severity).optional(),
20554
20586
  subtype: external_exports.array(external_exports.string()).optional(),
@@ -20561,18 +20593,42 @@ var ListFindingLocationsQuery = external_exports.object({
20561
20593
  q: external_exports.string().optional(),
20562
20594
  sessionId: external_exports.string().optional(),
20563
20595
  from: external_exports.iso.datetime().optional(),
20564
- limit: external_exports.coerce.number().int().min(1).max(500).optional()
20596
+ // A LOCATION id (see FindingLocationSummary.id) that must appear in the page
20597
+ // even when the cursor has already advanced past its sort position — the
20598
+ // counterpart of ListFindingTypesQuery.includeId, and needed far more often
20599
+ // here. Selecting a row pushes the URL, which re-renders the server and resets
20600
+ // the client's page cache to page 0; with distinct (repo, file) pairs running
20601
+ // into the thousands, a selection sitting off page 0 is the ordinary case
20602
+ // rather than a deep-link corner. Never affects totals, facets or the cursor.
20603
+ includeId: external_exports.string().optional(),
20604
+ limit: external_exports.coerce.number().int().min(1).max(MAX_FINDING_LOCATIONS_LIMIT).optional(),
20605
+ cursor: external_exports.string().optional()
20565
20606
  });
20566
20607
  var ListFindingLocationsResponse = external_exports.object({
20567
20608
  totals: external_exports.object({
20609
+ // Findings matching the filters across the whole scope. Unlike the types
20610
+ // read's same-named field this needs no caveat: the filters here narrow
20611
+ // per finding, so this is the sum of every row's instanceCount.
20568
20612
  findings: external_exports.number().int().nonnegative(),
20569
- repos: external_exports.number().int().nonnegative(),
20570
- files: external_exports.number().int().nonnegative()
20613
+ // Counts LOCATIONS, the unit this read pages — the number the paginator
20614
+ // states. The facets beside it count FINDINGS (see below); a surface
20615
+ // showing both says which is which.
20616
+ locations: external_exports.number().int().nonnegative()
20571
20617
  }),
20572
- /** Sorted by max severity, then most recent. */
20573
- items: external_exports.array(FindingLocationRepo),
20574
- /** Whether `limit` truncated the repo list. */
20575
- hasMore: external_exports.boolean()
20618
+ // Counts in FINDINGS, where the types response counts types, each dimension
20619
+ // still excluding its own filter. Deliberately not locations: counting those
20620
+ // needs a set of location keys per dimension per value — memory tracking the
20621
+ // store times the vocabulary, in a read whose scan promises flat memory —
20622
+ // and the cheap per-location version is not an approximation but WRONG. A
20623
+ // location holding {claudecode, block} and {codex, warn} would survive
20624
+ // provider=claudecode AND action=warn, under which no single finding
20625
+ // matches, so the facet would contradict the instanceCount this whole view
20626
+ // rests on. Findings also keep the toolbar in the same unit as the page
20627
+ // tally and the panel it sits above.
20628
+ facets: FindingFacets,
20629
+ /** Sorted by max severity, then most recent, then (repo, file). */
20630
+ items: external_exports.array(FindingLocationSummary),
20631
+ nextCursor: external_exports.string().nullable()
20576
20632
  }).meta({ id: "ListFindingLocationsResponse" });
20577
20633
 
20578
20634
  // ../../packages/schema/src/zod/meta.ts
@@ -21737,6 +21793,14 @@ var ControlPlaneErrorBody = external_exports.object({
21737
21793
  message: external_exports.string().optional()
21738
21794
  }).optional()
21739
21795
  });
21796
+ var RemoteFailureKind = external_exports.enum([
21797
+ "unauthorized",
21798
+ "forbidden",
21799
+ "route-absent",
21800
+ "invalid-request",
21801
+ "rejected",
21802
+ "unreachable"
21803
+ ]);
21740
21804
  var AttachDeviceRequest = external_exports.object({
21741
21805
  // This machine's own continuity id, so re-attaching ROTATES the credential
21742
21806
  // on one machine record instead of producing a second one. Client-minted
@@ -22752,11 +22816,11 @@ var WorkspaceSettings = external_exports.object({
22752
22816
  // covers the current payload and must be re-granted.
22753
22817
  modelJudgeConsent: ModelJudgeConsent.optional(),
22754
22818
  // Records that the user consented to the DEFERRED send — the outbox — along
22755
- // with the payload shape and the endpoint they agreed to. Since payload v2
22756
- // that covers both the pre-attach backlog and undelivered captures (which
22757
- // carry prompt/reply text in `content`); the key name predates the widening.
22758
- // Absent until granted, and a grant for a different endpoint or an older
22759
- // payload no longer counts.
22819
+ // with the payload shape and the endpoint they agreed to. Since payload v3
22820
+ // that covers the pre-attach backlog AND undelivered captures alike, and both
22821
+ // carry prompt/reply/tool-output text in `content`; the key name predates
22822
+ // both widenings. Absent until granted, and a grant for a different endpoint
22823
+ // or an older payload no longer counts.
22760
22824
  historySyncConsent: HistorySyncConsent.optional()
22761
22825
  });
22762
22826
 
@@ -22772,6 +22836,9 @@ var ManagedSettingKey = external_exports.enum([
22772
22836
  "dataSharesInPlace",
22773
22837
  "redactFallback"
22774
22838
  ]).meta({ id: "ManagedSettingKey" });
22839
+ function isManagedSettingKey(value) {
22840
+ return ManagedSettingKey.safeParse(value).success;
22841
+ }
22775
22842
  var ManagedSettingsValues = external_exports.object({
22776
22843
  runMode: external_exports.enum(["standalone", "attached"]).optional(),
22777
22844
  controlPlane: external_exports.object({
@@ -22796,7 +22863,27 @@ var ManagedSettings = external_exports.object({
22796
22863
  // Which of those the user may not change. A key here with no matching value
22797
22864
  // freezes whatever the user last chose; a value with no lock is a DEFAULT
22798
22865
  // the user may still override. The two are separable on purpose.
22799
- lockedFields: external_exports.array(ManagedSettingKey).default([])
22866
+ //
22867
+ // Parsed as NAMES rather than as the enum, and split below: a name this
22868
+ // build does not know is dropped from the locked set and reported, never a
22869
+ // reason to refuse the file. The same shape reaches an older build whenever
22870
+ // an administrator locks a key a newer build added, and refusing it there
22871
+ // ran that build entirely unmanaged — every pin and lock gone — on exactly
22872
+ // the fleets most likely to carry a version skew. A name outside the enum
22873
+ // is still never HONOURED: the lockable set stays explicit above.
22874
+ lockedFields: external_exports.array(external_exports.string()).default([])
22875
+ }).transform(({ lockedFields, ...rest }) => {
22876
+ const known = [];
22877
+ const unknown2 = [];
22878
+ for (const name of lockedFields) {
22879
+ if (isManagedSettingKey(name)) known.push(name);
22880
+ else unknown2.push(name);
22881
+ }
22882
+ return {
22883
+ ...rest,
22884
+ lockedFields: known,
22885
+ ...unknown2.length > 0 ? { unknownLockedFields: unknown2 } : {}
22886
+ };
22800
22887
  }).meta({ id: "ManagedSettings" });
22801
22888
 
22802
22889
  // ../../packages/schema/src/zod/project-files.ts
@@ -22914,7 +23001,11 @@ var FindingsTimeseriesPoint = external_exports.object({
22914
23001
  timestamp: external_exports.iso.date(),
22915
23002
  critical: external_exports.number().int().nonnegative(),
22916
23003
  high: external_exports.number().int().nonnegative(),
22917
- medium: external_exports.number().int().nonnegative()
23004
+ medium: external_exports.number().int().nonnegative(),
23005
+ // Optional and additive, so a producer written against the earlier
23006
+ // three-series contract keeps validating. A consumer plotting it resolves the
23007
+ // absent case itself — the chart point requires a number.
23008
+ low: external_exports.number().int().nonnegative().optional()
22918
23009
  }).meta({ id: "FindingsTimeseriesPoint" });
22919
23010
  var FindingsTimeseriesResponse = external_exports.object({
22920
23011
  range: TimeRange,
@@ -22940,6 +23031,10 @@ var ResolvedFeedItem = external_exports.object({
22940
23031
  findingKey: external_exports.string(),
22941
23032
  ruleId: external_exports.string(),
22942
23033
  severity: Severity,
23034
+ // Repository slug, and the file path RELATIVE to it. The pair is what
23035
+ // identifies the file: a bare path matches the same name in every repo.
23036
+ // Optional and additive; empty when the event carried no repo.
23037
+ repo: external_exports.string().optional(),
22943
23038
  path: external_exports.string(),
22944
23039
  // ISO-8601 datetime (matches FindingInstance.detectedAt / the rest of the
22945
23040
  // findings domain). The reader `.toISOString()`s the DB epoch-ms values.
@@ -23228,6 +23323,32 @@ var ACTIVE_REVEAL_GRANT_PREDICATE = `capability = 'reveal_to_model'
23228
23323
  AND conditions IS NULL
23229
23324
  AND ${ACTIVE_PREDICATE}`;
23230
23325
 
23326
+ // ../../packages/persistence/src/repositories/resolution-sql.ts
23327
+ function latestResolutionColumnSql(column, findingsAlias) {
23328
+ return `(
23329
+ SELECT fr.${column} FROM finding_resolution fr
23330
+ WHERE fr.finding_key = ${findingsAlias}.finding_key
23331
+ ORDER BY fr.created_at DESC, fr.rowid DESC
23332
+ LIMIT 1
23333
+ )`;
23334
+ }
23335
+ function latestResolutionStatusSql(findingsAlias) {
23336
+ return latestResolutionColumnSql("status", findingsAlias);
23337
+ }
23338
+
23339
+ // ../../packages/persistence/src/repositories/findings.ts
23340
+ var FINDING_ROW_COLUMNS_SQL = `f.id AS id, d.rule_id AS rule_id, d.category AS category,
23341
+ d.severity AS severity, f.masked_match AS masked_match,
23342
+ f.action_taken AS action_taken, f.confidence AS confidence,
23343
+ e.started_at AS occurred_at,
23344
+ e.source_tool AS source_tool,
23345
+ e.repo AS repo,
23346
+ e.file_path AS file,
23347
+ e.tool_name AS tool_name,
23348
+ f.audit_event_id AS event_id, e.root_session_id AS session_id,
23349
+ e.event_type AS kind, f.finding_key AS finding_key,
23350
+ ${latestResolutionStatusSql("f")} AS latest_status`;
23351
+
23231
23352
  // ../../packages/persistence/src/repositories/history-sync.ts
23232
23353
  var STRUCTURAL_EVENT_TYPES = ["session", "llm_call", "tool_call"];
23233
23354
  var TYPE_LIST = STRUCTURAL_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
@@ -23317,23 +23438,30 @@ import { randomUUID as randomUUID10 } from "crypto";
23317
23438
  // ../../packages/persistence/src/database.ts
23318
23439
  var CAPTURE_GRAIN = new Set(EventKind.options);
23319
23440
 
23320
- // ../../packages/persistence/src/finding-key.ts
23441
+ // ../../packages/persistence/src/egress-wire.ts
23321
23442
  import { createHash as createHash3 } from "crypto";
23322
23443
 
23444
+ // ../../packages/persistence/src/finding-key.ts
23445
+ import { createHash as createHash4 } from "crypto";
23446
+
23323
23447
  // ../../packages/persistence/src/fingerprint.ts
23324
23448
  import { createHmac, randomBytes } from "crypto";
23325
23449
  import { existsSync as existsSync3, readFileSync as readFileSync6 } from "fs";
23326
23450
  import { join as join8 } from "path";
23327
23451
  import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
23328
23452
 
23329
- // ../../packages/persistence/src/history-preview.ts
23453
+ // ../../packages/persistence/src/history-backfill.ts
23330
23454
  import { existsSync as existsSync4 } from "fs";
23331
23455
  import { join as join9 } from "path";
23456
+
23457
+ // ../../packages/persistence/src/history-preview.ts
23458
+ import { existsSync as existsSync5 } from "fs";
23459
+ import { join as join10 } from "path";
23332
23460
  import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
23333
23461
 
23334
23462
  // ../../packages/persistence/src/store-symlinks.ts
23335
- import { existsSync as existsSync5, lstatSync as lstatSync3, readlinkSync, realpathSync, statSync as statSync4 } from "fs";
23336
- import { dirname as dirname3, join as join10, resolve } from "path";
23463
+ import { existsSync as existsSync6, lstatSync as lstatSync3, readlinkSync, realpathSync, statSync as statSync4 } from "fs";
23464
+ import { dirname as dirname3, join as join11, resolve } from "path";
23337
23465
 
23338
23466
  // ../../packages/persistence/src/vault/crypto.ts
23339
23467
  import {
@@ -23348,14 +23476,14 @@ import {
23348
23476
  import { execFileSync } from "child_process";
23349
23477
  import { randomBytes as randomBytes2 } from "crypto";
23350
23478
  import { chmodSync as chmodSync3, readFileSync as readFileSync7, renameSync as renameSync4, rmSync as rmSync6, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
23351
- import { join as join11 } from "path";
23479
+ import { join as join12 } from "path";
23352
23480
 
23353
23481
  // ../../packages/persistence/src/vault/vault.ts
23354
23482
  import { randomBytes as randomBytes3, randomUUID as randomUUID12 } from "crypto";
23355
23483
 
23356
23484
  // ../../packages/persistence/src/warn-era-cap.ts
23357
- import { existsSync as existsSync6, writeFileSync as writeFileSync4 } from "fs";
23358
- import { join as join12 } from "path";
23485
+ import { existsSync as existsSync7, writeFileSync as writeFileSync4 } from "fs";
23486
+ import { join as join13 } from "path";
23359
23487
 
23360
23488
  // ../../packages/plugin-sdk/src/provider-env.ts
23361
23489
  var booleanish = external_exports.string().optional().transform((v) => {
@@ -23378,7 +23506,7 @@ var ProviderEnvSchema = external_exports.object(providerEnvShape);
23378
23506
  // ../../packages/plugin-sdk/src/config-inventory.ts
23379
23507
  import { readdirSync as readdirSync2, readFileSync as readFileSync9, realpathSync as realpathSync2, statSync as statSync7 } from "fs";
23380
23508
  import { homedir as homedir2 } from "os";
23381
- import { basename as basename3, join as join15 } from "path";
23509
+ import { basename as basename3, join as join16 } from "path";
23382
23510
 
23383
23511
  // ../../packages/detections/src/egress/registry.ts
23384
23512
  var EXTRACTOR_VERSION = "1";
@@ -24136,24 +24264,20 @@ var CPU_CORROBORATION_SHARE = 0.2;
24136
24264
  var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
24137
24265
 
24138
24266
  // ../../packages/plugin-sdk/src/repo.ts
24139
- import { existsSync as existsSync8, readFileSync as readFileSync8, statSync as statSync6 } from "fs";
24140
- import { basename as basename2, dirname as dirname4, isAbsolute, join as join14, sep as sep2 } from "path";
24267
+ import { existsSync as existsSync9, readFileSync as readFileSync8, statSync as statSync6 } from "fs";
24268
+ import { basename as basename2, dirname as dirname4, isAbsolute, join as join15, sep as sep2 } from "path";
24141
24269
 
24142
24270
  // ../../packages/plugin-sdk/src/events.ts
24143
- import { createHash as createHash4, randomUUID as randomUUID13 } from "crypto";
24271
+ import { createHash as createHash5, randomUUID as randomUUID13 } from "crypto";
24144
24272
 
24145
24273
  // ../../packages/plugin-sdk/src/isolated-scan.ts
24146
- import { existsSync as existsSync9 } from "fs";
24274
+ import { existsSync as existsSync10 } from "fs";
24147
24275
  import { fileURLToPath } from "url";
24148
24276
  import { Worker } from "worker_threads";
24149
24277
 
24150
- // ../../packages/plugin-sdk/src/ignore-layers.ts
24151
- var import_ignore = __toESM(require_ignore(), 1);
24152
- import { readFileSync as readFileSync10 } from "fs";
24153
- import { join as join16 } from "path";
24154
-
24155
- // ../../packages/plugin-sdk/src/inventory-resolver.ts
24156
- import { arch, hostname as hostname4, platform, release } from "os";
24278
+ // ../../packages/plugin-sdk/src/host-floor.ts
24279
+ import { readFileSync as readFileSync11 } from "fs";
24280
+ import { join as join18 } from "path";
24157
24281
 
24158
24282
  // ../../packages/plugin-sdk/src/model-governance.ts
24159
24283
  import {
@@ -24161,24 +24285,50 @@ import {
24161
24285
  fstatSync,
24162
24286
  mkdirSync as mkdirSync2,
24163
24287
  openSync as openSync2,
24164
- readFileSync as readFileSync11,
24288
+ readFileSync as readFileSync10,
24165
24289
  readSync,
24166
24290
  writeFileSync as writeFileSync5
24167
24291
  } from "fs";
24168
24292
  import { join as join17 } from "path";
24169
24293
  var TAIL_BYTES = 256 * 1024;
24170
24294
 
24295
+ // ../../packages/plugin-sdk/src/host-floor.ts
24296
+ var HOST_FEATURE = {
24297
+ ModelSwitch: "model-switch",
24298
+ VaultPointerDisplay: "vault-pointer-display"
24299
+ };
24300
+ var HOST_FLOORS = {
24301
+ [HOST_FEATURE.ModelSwitch]: {
24302
+ label: "model-switch protection",
24303
+ hookEvents: ["PreModelSwitch", "PostModelSwitch"],
24304
+ since: "2.1.251"
24305
+ },
24306
+ [HOST_FEATURE.VaultPointerDisplay]: {
24307
+ label: "vault pointer display",
24308
+ hookEvents: ["MessageDisplay"],
24309
+ since: "2.1.152"
24310
+ }
24311
+ };
24312
+
24313
+ // ../../packages/plugin-sdk/src/ignore-layers.ts
24314
+ var import_ignore = __toESM(require_ignore(), 1);
24315
+ import { readFileSync as readFileSync12 } from "fs";
24316
+ import { join as join19 } from "path";
24317
+
24318
+ // ../../packages/plugin-sdk/src/inventory-resolver.ts
24319
+ import { arch, hostname as hostname4, platform, release } from "os";
24320
+
24171
24321
  // ../../packages/plugin-sdk/src/nudge.ts
24172
- import { mkdirSync as mkdirSync3, readFileSync as readFileSync12, writeFileSync as writeFileSync6 } from "fs";
24173
- import { join as join18 } from "path";
24322
+ import { mkdirSync as mkdirSync3, readFileSync as readFileSync13, writeFileSync as writeFileSync6 } from "fs";
24323
+ import { join as join20 } from "path";
24174
24324
 
24175
24325
  // ../../packages/plugin-sdk/src/paths.ts
24176
24326
  import { readdirSync as readdirSync3, realpathSync as realpathSync3 } from "fs";
24177
24327
  import { basename as basename4, dirname as dirname5, sep as sep3 } from "path";
24178
24328
 
24179
24329
  // ../../packages/plugin-sdk/src/project-files.ts
24180
- import { existsSync as existsSync10, readdirSync as readdirSync4 } from "fs";
24181
- import { basename as basename5, join as join19 } from "path";
24330
+ import { existsSync as existsSync11, readdirSync as readdirSync4 } from "fs";
24331
+ import { basename as basename5, join as join21 } from "path";
24182
24332
 
24183
24333
  // ../../packages/plugin-sdk/src/provider-env-antigravity.ts
24184
24334
  var optionalBaseUrl2 = external_exports.preprocess((v) => {
@@ -24214,7 +24364,7 @@ var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
24214
24364
 
24215
24365
  // ../../packages/plugin-sdk/src/throttle.ts
24216
24366
  import { mkdirSync as mkdirSync4, statSync as statSync8, writeFileSync as writeFileSync7 } from "fs";
24217
- import { join as join20 } from "path";
24367
+ import { join as join22 } from "path";
24218
24368
 
24219
24369
  // ../../packages/setup-wizard/src/onboard-posture.ts
24220
24370
  function parsePosture(json2) {
@@ -24253,7 +24403,7 @@ function parseCurrent(json2) {
24253
24403
 
24254
24404
  // ../../packages/setup-wizard/src/remediation/rotation-checklist.ts
24255
24405
  import { writeFileSync as writeFileSync8 } from "fs";
24256
- import { join as join21 } from "path";
24406
+ import { join as join23 } from "path";
24257
24407
 
24258
24408
  // ../../packages/setup-wizard/src/triage/gate-display.ts
24259
24409
  var ACTION_RANK = {
@@ -24280,9 +24430,9 @@ var RANK = Object.fromEntries(
24280
24430
  );
24281
24431
 
24282
24432
  // ../../packages/setup-wizard/src/triage/plan-file.ts
24283
- import { mkdtempSync, readFileSync as readFileSync13, rmdirSync, rmSync as rmSync7, writeFileSync as writeFileSync9 } from "fs";
24433
+ import { mkdtempSync, readFileSync as readFileSync14, rmdirSync, rmSync as rmSync7, writeFileSync as writeFileSync9 } from "fs";
24284
24434
  import { tmpdir } from "os";
24285
- import { basename as basename6, dirname as dirname6, join as join22 } from "path";
24435
+ import { basename as basename6, dirname as dirname6, join as join24 } from "path";
24286
24436
  var SuppressionEntrySchema = external_exports.object({
24287
24437
  ruleId: external_exports.string(),
24288
24438
  category: DetectionCategory,