@akasecurity/ai-tc-codex 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.
package/scripts/intro.js CHANGED
@@ -492,7 +492,7 @@ var require_ignore = __commonJS({
492
492
  });
493
493
 
494
494
  // src/intro.ts
495
- import { readFileSync as readFileSync15 } from "fs";
495
+ import { readFileSync as readFileSync16 } from "fs";
496
496
 
497
497
  // src/present.ts
498
498
  var SHADE = {
@@ -548,8 +548,8 @@ function fenced(body) {
548
548
  }
549
549
 
550
550
  // ../../packages/plugin-sdk/src/config.ts
551
- import { existsSync as existsSync7 } from "fs";
552
- import { join as join13 } from "path";
551
+ import { existsSync as existsSync8 } from "fs";
552
+ import { join as join14 } from "path";
553
553
 
554
554
  // ../../packages/persistence/src/attached-derived.ts
555
555
  import { rmSync } from "fs";
@@ -20441,13 +20441,11 @@ var FindingGroup = external_exports.object({
20441
20441
  latestDetectedAt: external_exports.iso.datetime(),
20442
20442
  instances: external_exports.array(FindingInstance),
20443
20443
  // Derived from instances' statuses with open-dominates precedence (see
20444
- // buildFindingGroups). Undefined only when no instance carries a status.
20444
+ // foldGroupStatus). Undefined only when no instance carries a status.
20445
20445
  status: FindingStatus.optional(),
20446
- // The distinct people across the WHOLE group, not just the `instances`
20447
- // preview — from the store's whole-group aggregate when it supplies one,
20448
- // else folded from the rows (see buildFindingGroups). Undefined when no
20449
- // instance carries a user, or when the store supplied whole-group folds
20450
- // without one.
20446
+ // The distinct people across the WHOLE group, not just the instances
20447
+ // carried here. Undefined when no instance carries a user, or when the
20448
+ // store supplied whole-group folds without one.
20451
20449
  users: external_exports.array(FindingUser).optional()
20452
20450
  }).meta({ id: "FindingGroup" });
20453
20451
  var FindingStats = external_exports.object({
@@ -20476,20 +20474,30 @@ var FindingFacets = external_exports.object({
20476
20474
  // counted under no value.
20477
20475
  status: external_exports.array(FindingFacetItem),
20478
20476
  // Host tool (attributes.tool_name). Present only on the instance-level
20479
- // reads, which can filter by it; the grouped read omits the dimension
20477
+ // reads, which can filter by it; the type-level read omits the dimension
20480
20478
  // because a group spans tools.
20481
20479
  tool: external_exports.array(FindingFacetItem).optional()
20482
20480
  }).meta({ id: "FindingFacets" });
20483
- var ListGroupedFindingsQuery = external_exports.object({
20481
+ var FindingTypeSummary = FindingGroup.omit({ instances: true, match: true }).meta({
20482
+ id: "FindingTypeSummary"
20483
+ });
20484
+ var MAX_FINDING_TYPES_LIMIT = 100;
20485
+ var ListFindingTypesQuery = external_exports.object({
20484
20486
  // NOTE: severity filters by Severity (critical/high/medium/low), not by
20485
- // FindingAction.
20487
+ // FindingAction. It narrows TYPES: a type's severity is the one its newest
20488
+ // firing version carries, and this list pages types.
20489
+ //
20490
+ // That is NOT a claim the findings of a type share it. A rule can hold several
20491
+ // definition versions at different severities, so a type kept by this filter
20492
+ // can hold findings that individually do not match — see totals.findings on
20493
+ // ListFindingTypesResponse, which counts them all.
20486
20494
  severity: external_exports.array(Severity).optional(),
20487
20495
  subtype: external_exports.array(external_exports.string()).optional(),
20488
20496
  provider: external_exports.array(FindingProvider).optional(),
20489
20497
  action: external_exports.array(FindingAction).optional(),
20490
- // Matches a group's DERIVED status (see FindingGroup.status), not its
20491
- // individual instances' — so a filtered group's Status column always reads
20492
- // one of the requested values.
20498
+ // Matches a type's DERIVED status (see FindingGroup.status), not its
20499
+ // individual findings' — so a filtered row's status always reads one of the
20500
+ // requested values.
20493
20501
  status: external_exports.array(FindingStatus).optional(),
20494
20502
  q: external_exports.string().optional(),
20495
20503
  // Scope to findings whose event carries this session id (the Activity page's
@@ -20499,23 +20507,37 @@ var ListGroupedFindingsQuery = external_exports.object({
20499
20507
  // from a time-scoped page (Activity's range) can carry that scope. Absent
20500
20508
  // means all time — this list has no default window.
20501
20509
  from: external_exports.iso.datetime().optional(),
20502
- // A group or instance id that must appear in the page even when the cursor
20503
- // has already advanced past its sort position. This is what keeps the
20504
- // Findings page's one-shot ?finding= deep link resolving once the list
20505
- // paginates: the target group is appended out of sort order rather than
20506
- // scanning forward for it. Never affects totals, facets or the cursor.
20510
+ // A RULE id that must appear in the page even when the cursor has already
20511
+ // advanced past its sort position. This is what keeps the selected type
20512
+ // visible in the list once it paginates: the target is appended out of sort
20513
+ // order rather than scanned forward for. Never affects totals, facets or the
20514
+ // cursor. Unlike the grouped read this replaces, it names a rule only — an
20515
+ // instance id is resolved by `findingInstance`, which is a primary-key seek
20516
+ // and so is not bounded by what any page happens to hold.
20507
20517
  includeId: external_exports.string().optional(),
20508
- groupBy: external_exports.literal("type").optional(),
20509
- limit: external_exports.coerce.number().int().min(1).max(100).optional(),
20518
+ limit: external_exports.coerce.number().int().min(1).max(MAX_FINDING_TYPES_LIMIT).optional(),
20510
20519
  cursor: external_exports.string().optional()
20511
20520
  });
20512
- var ListGroupedFindingsResponse = external_exports.object({
20521
+ var ListFindingTypesResponse = external_exports.object({
20513
20522
  totals: external_exports.object({
20523
+ // Findings belonging to the matching TYPES — not findings that each match
20524
+ // the filters. The filters here select types, so a type that survives
20525
+ // contributes its whole instanceCount.
20526
+ //
20527
+ // `status` is the one exception, narrowed per finding via
20528
+ // countInstancesByStatus. `severity`, `provider` and `action` are not, so
20529
+ // this can exceed what the instance read reports for the same filters: a
20530
+ // rule whose severity moved between versions is kept on its newest and
20531
+ // still counts its older findings. Narrowing the other three needs
20532
+ // per-dimension counts the aggregate does not carry today.
20514
20533
  findings: external_exports.number().int().nonnegative(),
20515
- groups: external_exports.number().int().nonnegative()
20534
+ // Counts TYPES, which is the unit this read pages. The instance read's
20535
+ // own totals count findings; the two deliberately answer different
20536
+ // questions and are never summed.
20537
+ types: external_exports.number().int().nonnegative()
20516
20538
  }),
20517
20539
  facets: FindingFacets,
20518
- items: external_exports.array(FindingGroup),
20540
+ items: external_exports.array(FindingTypeSummary),
20519
20541
  nextCursor: external_exports.string().nullable(),
20520
20542
  // Present only on session-scoped queries (`sessionId` set): per ruleId, how
20521
20543
  // many times that rule fired in the session's persisted transcript. Findings
@@ -20523,7 +20545,7 @@ var ListGroupedFindingsResponse = external_exports.object({
20523
20545
  // every firing, so the two numbers legitimately differ — this map lets a
20524
20546
  // session-scoped view show both.
20525
20547
  sessionFirings: external_exports.record(external_exports.string(), external_exports.number().int().nonnegative()).optional()
20526
- }).meta({ id: "ListGroupedFindingsResponse" });
20548
+ }).meta({ id: "ListFindingTypesResponse" });
20527
20549
  var ApplyFindingActionRequest = external_exports.object({
20528
20550
  // 'quarantined' is system-assigned (see FindingAction) — clients may not set
20529
20551
  // it, so it is excluded from the request contract. The mapping helper
@@ -20552,12 +20574,13 @@ var FindingInstanceDetail = FindingInstance.extend({
20552
20574
  var MAX_FLAT_FINDINGS_LIMIT = 200;
20553
20575
  var ListFindingInstancesQuery = external_exports.object({
20554
20576
  severity: external_exports.array(Severity).optional(),
20555
- // Rule ids, the same vocabulary the grouped list's `subtype` carries.
20577
+ // Rule ids, the same vocabulary the types list's `subtype` carries. Pinning
20578
+ // ONE of them is how the master/detail view scopes its right-hand panel.
20556
20579
  subtype: external_exports.array(external_exports.string()).optional(),
20557
20580
  provider: external_exports.array(FindingProvider).optional(),
20558
20581
  action: external_exports.array(FindingAction).optional(),
20559
20582
  // Matches each instance's OWN derived status (deriveFindingStatus), unlike
20560
- // the grouped query's group-level fold.
20583
+ // the types query's type-level fold.
20561
20584
  status: external_exports.array(FindingStatus).optional(),
20562
20585
  // Exact host-tool names (attributes.tool_name, e.g. 'Bash'). A real filter,
20563
20586
  // where the free-text `q` can only match the rendered "via Bash" label.
@@ -20574,37 +20597,46 @@ var ListFindingInstancesQuery = external_exports.object({
20574
20597
  });
20575
20598
  var ListFindingInstancesResponse = external_exports.object({
20576
20599
  // Instances matching the filters across the whole scope, not just this
20577
- // page — cursor-independent, like the grouped list's totals.
20600
+ // page — cursor-independent, like the types list's totals.
20578
20601
  totals: external_exports.object({ findings: external_exports.number().int().nonnegative() }),
20579
- // Counts in INSTANCES here, where the grouped response counts groups. Each
20602
+ // Counts in INSTANCES here, where the types response counts types. Each
20580
20603
  // dimension still excludes its own filter.
20581
20604
  facets: FindingFacets,
20582
20605
  items: external_exports.array(FindingInstanceDetail),
20583
20606
  nextCursor: external_exports.string().nullable()
20584
20607
  }).meta({ id: "ListFindingInstancesResponse" });
20585
- var FindingLocationFile = external_exports.object({
20586
- // Empty when the instances carried no file path (a prompt or a tool call
20587
- // with no file attribution).
20588
- file: external_exports.string(),
20589
- instanceCount: external_exports.number().int().nonnegative(),
20590
- maxSeverity: Severity,
20591
- latestDetectedAt: external_exports.iso.datetime(),
20592
- // Folded from the instances' derived statuses with the same
20593
- // open-dominates precedence a group uses.
20594
- status: FindingStatus.optional(),
20595
- // Distinct rules seen at this location, capped — the row shows them as
20596
- // chips, and the count is what conveys scale.
20597
- ruleIds: external_exports.array(external_exports.string())
20598
- }).meta({ id: "FindingLocationFile" });
20599
- var FindingLocationRepo = external_exports.object({
20608
+ var FindingLocationSummary = external_exports.object({
20609
+ // Opaque, stable, minted from the pair by encodeLocationId. It exists
20610
+ // because a location's identity is two values and a URL param carries one:
20611
+ // `?loc=` names a location the way `?rule=` names a type. Only ever compared
20612
+ // for EQUALITY — the page's selection check, this read's `includeId`, the
20613
+ // client's page dedupe — never decoded, and never a sort key.
20614
+ id: external_exports.string(),
20600
20615
  /** Empty when the instances carried no repo attribute. */
20601
20616
  repo: external_exports.string(),
20617
+ // Empty when the instances carried no file path (a prompt, or a tool call
20618
+ // with no file attribution). Both halves empty is a real location — usually
20619
+ // the largest one in a store — and is selectable like any other.
20620
+ file: external_exports.string(),
20602
20621
  instanceCount: external_exports.number().int().nonnegative(),
20622
+ // The WORST severity present, not the first row's. It is this list's primary
20623
+ // sort key, so it is also what explains why a row is where it is, and it is
20624
+ // how a reader decides what to open without opening everything.
20603
20625
  maxSeverity: Severity,
20604
20626
  latestDetectedAt: external_exports.iso.datetime(),
20627
+ // Folded from the instances' derived statuses with the same open-dominates
20628
+ // precedence a group uses, so it answers "is anything left to do here" and
20629
+ // not much more: a location holding 1 open among 40 resolved reads like one
20630
+ // holding 40 open. That loss is accepted — the panel beside this list
20631
+ // carries each finding's own status, and instanceCount sits next to the
20632
+ // badge.
20605
20633
  status: FindingStatus.optional(),
20606
- files: external_exports.array(FindingLocationFile)
20607
- }).meta({ id: "FindingLocationRepo" });
20634
+ // Every distinct rule seen at this location, UNCAPPED — so the length is a
20635
+ // tally rather than a sample and a row can say how many there are. Bounded
20636
+ // by the ruleset, not by the store. The view bounds what it DISPLAYS.
20637
+ ruleIds: external_exports.array(external_exports.string())
20638
+ }).meta({ id: "FindingLocationSummary" });
20639
+ var MAX_FINDING_LOCATIONS_LIMIT = 100;
20608
20640
  var ListFindingLocationsQuery = external_exports.object({
20609
20641
  severity: external_exports.array(Severity).optional(),
20610
20642
  subtype: external_exports.array(external_exports.string()).optional(),
@@ -20617,18 +20649,42 @@ var ListFindingLocationsQuery = external_exports.object({
20617
20649
  q: external_exports.string().optional(),
20618
20650
  sessionId: external_exports.string().optional(),
20619
20651
  from: external_exports.iso.datetime().optional(),
20620
- limit: external_exports.coerce.number().int().min(1).max(500).optional()
20652
+ // A LOCATION id (see FindingLocationSummary.id) that must appear in the page
20653
+ // even when the cursor has already advanced past its sort position — the
20654
+ // counterpart of ListFindingTypesQuery.includeId, and needed far more often
20655
+ // here. Selecting a row pushes the URL, which re-renders the server and resets
20656
+ // the client's page cache to page 0; with distinct (repo, file) pairs running
20657
+ // into the thousands, a selection sitting off page 0 is the ordinary case
20658
+ // rather than a deep-link corner. Never affects totals, facets or the cursor.
20659
+ includeId: external_exports.string().optional(),
20660
+ limit: external_exports.coerce.number().int().min(1).max(MAX_FINDING_LOCATIONS_LIMIT).optional(),
20661
+ cursor: external_exports.string().optional()
20621
20662
  });
20622
20663
  var ListFindingLocationsResponse = external_exports.object({
20623
20664
  totals: external_exports.object({
20665
+ // Findings matching the filters across the whole scope. Unlike the types
20666
+ // read's same-named field this needs no caveat: the filters here narrow
20667
+ // per finding, so this is the sum of every row's instanceCount.
20624
20668
  findings: external_exports.number().int().nonnegative(),
20625
- repos: external_exports.number().int().nonnegative(),
20626
- files: external_exports.number().int().nonnegative()
20669
+ // Counts LOCATIONS, the unit this read pages — the number the paginator
20670
+ // states. The facets beside it count FINDINGS (see below); a surface
20671
+ // showing both says which is which.
20672
+ locations: external_exports.number().int().nonnegative()
20627
20673
  }),
20628
- /** Sorted by max severity, then most recent. */
20629
- items: external_exports.array(FindingLocationRepo),
20630
- /** Whether `limit` truncated the repo list. */
20631
- hasMore: external_exports.boolean()
20674
+ // Counts in FINDINGS, where the types response counts types, each dimension
20675
+ // still excluding its own filter. Deliberately not locations: counting those
20676
+ // needs a set of location keys per dimension per value — memory tracking the
20677
+ // store times the vocabulary, in a read whose scan promises flat memory —
20678
+ // and the cheap per-location version is not an approximation but WRONG. A
20679
+ // location holding {claudecode, block} and {codex, warn} would survive
20680
+ // provider=claudecode AND action=warn, under which no single finding
20681
+ // matches, so the facet would contradict the instanceCount this whole view
20682
+ // rests on. Findings also keep the toolbar in the same unit as the page
20683
+ // tally and the panel it sits above.
20684
+ facets: FindingFacets,
20685
+ /** Sorted by max severity, then most recent, then (repo, file). */
20686
+ items: external_exports.array(FindingLocationSummary),
20687
+ nextCursor: external_exports.string().nullable()
20632
20688
  }).meta({ id: "ListFindingLocationsResponse" });
20633
20689
 
20634
20690
  // ../../packages/schema/src/zod/meta.ts
@@ -21793,6 +21849,14 @@ var ControlPlaneErrorBody = external_exports.object({
21793
21849
  message: external_exports.string().optional()
21794
21850
  }).optional()
21795
21851
  });
21852
+ var RemoteFailureKind = external_exports.enum([
21853
+ "unauthorized",
21854
+ "forbidden",
21855
+ "route-absent",
21856
+ "invalid-request",
21857
+ "rejected",
21858
+ "unreachable"
21859
+ ]);
21796
21860
  var AttachDeviceRequest = external_exports.object({
21797
21861
  // This machine's own continuity id, so re-attaching ROTATES the credential
21798
21862
  // on one machine record instead of producing a second one. Client-minted
@@ -22803,11 +22867,11 @@ var WorkspaceSettings = external_exports.object({
22803
22867
  // covers the current payload and must be re-granted.
22804
22868
  modelJudgeConsent: ModelJudgeConsent.optional(),
22805
22869
  // Records that the user consented to the DEFERRED send — the outbox — along
22806
- // with the payload shape and the endpoint they agreed to. Since payload v2
22807
- // that covers both the pre-attach backlog and undelivered captures (which
22808
- // carry prompt/reply text in `content`); the key name predates the widening.
22809
- // Absent until granted, and a grant for a different endpoint or an older
22810
- // payload no longer counts.
22870
+ // with the payload shape and the endpoint they agreed to. Since payload v3
22871
+ // that covers the pre-attach backlog AND undelivered captures alike, and both
22872
+ // carry prompt/reply/tool-output text in `content`; the key name predates
22873
+ // both widenings. Absent until granted, and a grant for a different endpoint
22874
+ // or an older payload no longer counts.
22811
22875
  historySyncConsent: HistorySyncConsent.optional()
22812
22876
  });
22813
22877
 
@@ -22823,6 +22887,9 @@ var ManagedSettingKey = external_exports.enum([
22823
22887
  "dataSharesInPlace",
22824
22888
  "redactFallback"
22825
22889
  ]).meta({ id: "ManagedSettingKey" });
22890
+ function isManagedSettingKey(value) {
22891
+ return ManagedSettingKey.safeParse(value).success;
22892
+ }
22826
22893
  var ManagedSettingsValues = external_exports.object({
22827
22894
  runMode: external_exports.enum(["standalone", "attached"]).optional(),
22828
22895
  controlPlane: external_exports.object({
@@ -22847,7 +22914,27 @@ var ManagedSettings = external_exports.object({
22847
22914
  // Which of those the user may not change. A key here with no matching value
22848
22915
  // freezes whatever the user last chose; a value with no lock is a DEFAULT
22849
22916
  // the user may still override. The two are separable on purpose.
22850
- lockedFields: external_exports.array(ManagedSettingKey).default([])
22917
+ //
22918
+ // Parsed as NAMES rather than as the enum, and split below: a name this
22919
+ // build does not know is dropped from the locked set and reported, never a
22920
+ // reason to refuse the file. The same shape reaches an older build whenever
22921
+ // an administrator locks a key a newer build added, and refusing it there
22922
+ // ran that build entirely unmanaged — every pin and lock gone — on exactly
22923
+ // the fleets most likely to carry a version skew. A name outside the enum
22924
+ // is still never HONOURED: the lockable set stays explicit above.
22925
+ lockedFields: external_exports.array(external_exports.string()).default([])
22926
+ }).transform(({ lockedFields, ...rest }) => {
22927
+ const known = [];
22928
+ const unknown2 = [];
22929
+ for (const name of lockedFields) {
22930
+ if (isManagedSettingKey(name)) known.push(name);
22931
+ else unknown2.push(name);
22932
+ }
22933
+ return {
22934
+ ...rest,
22935
+ lockedFields: known,
22936
+ ...unknown2.length > 0 ? { unknownLockedFields: unknown2 } : {}
22937
+ };
22851
22938
  }).meta({ id: "ManagedSettings" });
22852
22939
 
22853
22940
  // ../../packages/schema/src/zod/project-files.ts
@@ -22965,7 +23052,11 @@ var FindingsTimeseriesPoint = external_exports.object({
22965
23052
  timestamp: external_exports.iso.date(),
22966
23053
  critical: external_exports.number().int().nonnegative(),
22967
23054
  high: external_exports.number().int().nonnegative(),
22968
- medium: external_exports.number().int().nonnegative()
23055
+ medium: external_exports.number().int().nonnegative(),
23056
+ // Optional and additive, so a producer written against the earlier
23057
+ // three-series contract keeps validating. A consumer plotting it resolves the
23058
+ // absent case itself — the chart point requires a number.
23059
+ low: external_exports.number().int().nonnegative().optional()
22969
23060
  }).meta({ id: "FindingsTimeseriesPoint" });
22970
23061
  var FindingsTimeseriesResponse = external_exports.object({
22971
23062
  range: TimeRange,
@@ -22991,6 +23082,10 @@ var ResolvedFeedItem = external_exports.object({
22991
23082
  findingKey: external_exports.string(),
22992
23083
  ruleId: external_exports.string(),
22993
23084
  severity: Severity,
23085
+ // Repository slug, and the file path RELATIVE to it. The pair is what
23086
+ // identifies the file: a bare path matches the same name in every repo.
23087
+ // Optional and additive; empty when the event carried no repo.
23088
+ repo: external_exports.string().optional(),
22994
23089
  path: external_exports.string(),
22995
23090
  // ISO-8601 datetime (matches FindingInstance.detectedAt / the rest of the
22996
23091
  // findings domain). The reader `.toISOString()`s the DB epoch-ms values.
@@ -23279,6 +23374,32 @@ var ACTIVE_REVEAL_GRANT_PREDICATE = `capability = 'reveal_to_model'
23279
23374
  AND conditions IS NULL
23280
23375
  AND ${ACTIVE_PREDICATE}`;
23281
23376
 
23377
+ // ../../packages/persistence/src/repositories/resolution-sql.ts
23378
+ function latestResolutionColumnSql(column, findingsAlias) {
23379
+ return `(
23380
+ SELECT fr.${column} FROM finding_resolution fr
23381
+ WHERE fr.finding_key = ${findingsAlias}.finding_key
23382
+ ORDER BY fr.created_at DESC, fr.rowid DESC
23383
+ LIMIT 1
23384
+ )`;
23385
+ }
23386
+ function latestResolutionStatusSql(findingsAlias) {
23387
+ return latestResolutionColumnSql("status", findingsAlias);
23388
+ }
23389
+
23390
+ // ../../packages/persistence/src/repositories/findings.ts
23391
+ var FINDING_ROW_COLUMNS_SQL = `f.id AS id, d.rule_id AS rule_id, d.category AS category,
23392
+ d.severity AS severity, f.masked_match AS masked_match,
23393
+ f.action_taken AS action_taken, f.confidence AS confidence,
23394
+ e.started_at AS occurred_at,
23395
+ e.source_tool AS source_tool,
23396
+ e.repo AS repo,
23397
+ e.file_path AS file,
23398
+ e.tool_name AS tool_name,
23399
+ f.audit_event_id AS event_id, e.root_session_id AS session_id,
23400
+ e.event_type AS kind, f.finding_key AS finding_key,
23401
+ ${latestResolutionStatusSql("f")} AS latest_status`;
23402
+
23282
23403
  // ../../packages/persistence/src/repositories/history-sync.ts
23283
23404
  var STRUCTURAL_EVENT_TYPES = ["session", "llm_call", "tool_call"];
23284
23405
  var TYPE_LIST = STRUCTURAL_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
@@ -23368,23 +23489,30 @@ import { randomUUID as randomUUID10 } from "crypto";
23368
23489
  // ../../packages/persistence/src/database.ts
23369
23490
  var CAPTURE_GRAIN = new Set(EventKind.options);
23370
23491
 
23371
- // ../../packages/persistence/src/finding-key.ts
23492
+ // ../../packages/persistence/src/egress-wire.ts
23372
23493
  import { createHash as createHash3 } from "crypto";
23373
23494
 
23495
+ // ../../packages/persistence/src/finding-key.ts
23496
+ import { createHash as createHash4 } from "crypto";
23497
+
23374
23498
  // ../../packages/persistence/src/fingerprint.ts
23375
23499
  import { createHmac, randomBytes } from "crypto";
23376
23500
  import { existsSync as existsSync3, readFileSync as readFileSync6 } from "fs";
23377
23501
  import { join as join8 } from "path";
23378
23502
  import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
23379
23503
 
23380
- // ../../packages/persistence/src/history-preview.ts
23504
+ // ../../packages/persistence/src/history-backfill.ts
23381
23505
  import { existsSync as existsSync4 } from "fs";
23382
23506
  import { join as join9 } from "path";
23507
+
23508
+ // ../../packages/persistence/src/history-preview.ts
23509
+ import { existsSync as existsSync5 } from "fs";
23510
+ import { join as join10 } from "path";
23383
23511
  import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
23384
23512
 
23385
23513
  // ../../packages/persistence/src/store-symlinks.ts
23386
- import { existsSync as existsSync5, lstatSync as lstatSync3, readlinkSync, realpathSync, statSync as statSync4 } from "fs";
23387
- import { dirname as dirname3, join as join10, resolve } from "path";
23514
+ import { existsSync as existsSync6, lstatSync as lstatSync3, readlinkSync, realpathSync, statSync as statSync4 } from "fs";
23515
+ import { dirname as dirname3, join as join11, resolve } from "path";
23388
23516
 
23389
23517
  // ../../packages/persistence/src/vault/crypto.ts
23390
23518
  import {
@@ -23399,14 +23527,14 @@ import {
23399
23527
  import { execFileSync } from "child_process";
23400
23528
  import { randomBytes as randomBytes2 } from "crypto";
23401
23529
  import { chmodSync as chmodSync3, readFileSync as readFileSync7, renameSync as renameSync4, rmSync as rmSync6, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
23402
- import { join as join11 } from "path";
23530
+ import { join as join12 } from "path";
23403
23531
 
23404
23532
  // ../../packages/persistence/src/vault/vault.ts
23405
23533
  import { randomBytes as randomBytes3, randomUUID as randomUUID12 } from "crypto";
23406
23534
 
23407
23535
  // ../../packages/persistence/src/warn-era-cap.ts
23408
- import { existsSync as existsSync6, writeFileSync as writeFileSync4 } from "fs";
23409
- import { join as join12 } from "path";
23536
+ import { existsSync as existsSync7, writeFileSync as writeFileSync4 } from "fs";
23537
+ import { join as join13 } from "path";
23410
23538
 
23411
23539
  // ../../packages/plugin-sdk/src/provider-env.ts
23412
23540
  var booleanish = external_exports.string().optional().transform((v) => {
@@ -23429,7 +23557,7 @@ var ProviderEnvSchema = external_exports.object(providerEnvShape);
23429
23557
  // ../../packages/plugin-sdk/src/config-inventory.ts
23430
23558
  import { readdirSync as readdirSync2, readFileSync as readFileSync9, realpathSync as realpathSync2, statSync as statSync7 } from "fs";
23431
23559
  import { homedir as homedir2 } from "os";
23432
- import { basename as basename3, join as join15 } from "path";
23560
+ import { basename as basename3, join as join16 } from "path";
23433
23561
 
23434
23562
  // ../../packages/detections/src/egress/registry.ts
23435
23563
  var EXTRACTOR_VERSION = "1";
@@ -24187,24 +24315,20 @@ var CPU_CORROBORATION_SHARE = 0.2;
24187
24315
  var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
24188
24316
 
24189
24317
  // ../../packages/plugin-sdk/src/repo.ts
24190
- import { existsSync as existsSync8, readFileSync as readFileSync8, statSync as statSync6 } from "fs";
24191
- import { basename as basename2, dirname as dirname4, isAbsolute, join as join14, sep as sep2 } from "path";
24318
+ import { existsSync as existsSync9, readFileSync as readFileSync8, statSync as statSync6 } from "fs";
24319
+ import { basename as basename2, dirname as dirname4, isAbsolute, join as join15, sep as sep2 } from "path";
24192
24320
 
24193
24321
  // ../../packages/plugin-sdk/src/events.ts
24194
- import { createHash as createHash4, randomUUID as randomUUID13 } from "crypto";
24322
+ import { createHash as createHash5, randomUUID as randomUUID13 } from "crypto";
24195
24323
 
24196
24324
  // ../../packages/plugin-sdk/src/isolated-scan.ts
24197
- import { existsSync as existsSync9 } from "fs";
24325
+ import { existsSync as existsSync10 } from "fs";
24198
24326
  import { fileURLToPath } from "url";
24199
24327
  import { Worker } from "worker_threads";
24200
24328
 
24201
- // ../../packages/plugin-sdk/src/ignore-layers.ts
24202
- var import_ignore = __toESM(require_ignore(), 1);
24203
- import { readFileSync as readFileSync10 } from "fs";
24204
- import { join as join16 } from "path";
24205
-
24206
- // ../../packages/plugin-sdk/src/inventory-resolver.ts
24207
- import { arch, hostname as hostname4, platform, release } from "os";
24329
+ // ../../packages/plugin-sdk/src/host-floor.ts
24330
+ import { readFileSync as readFileSync11 } from "fs";
24331
+ import { join as join18 } from "path";
24208
24332
 
24209
24333
  // ../../packages/plugin-sdk/src/model-governance.ts
24210
24334
  import {
@@ -24212,24 +24336,50 @@ import {
24212
24336
  fstatSync,
24213
24337
  mkdirSync as mkdirSync2,
24214
24338
  openSync as openSync2,
24215
- readFileSync as readFileSync11,
24339
+ readFileSync as readFileSync10,
24216
24340
  readSync,
24217
24341
  writeFileSync as writeFileSync5
24218
24342
  } from "fs";
24219
24343
  import { join as join17 } from "path";
24220
24344
  var TAIL_BYTES = 256 * 1024;
24221
24345
 
24346
+ // ../../packages/plugin-sdk/src/host-floor.ts
24347
+ var HOST_FEATURE = {
24348
+ ModelSwitch: "model-switch",
24349
+ VaultPointerDisplay: "vault-pointer-display"
24350
+ };
24351
+ var HOST_FLOORS = {
24352
+ [HOST_FEATURE.ModelSwitch]: {
24353
+ label: "model-switch protection",
24354
+ hookEvents: ["PreModelSwitch", "PostModelSwitch"],
24355
+ since: "2.1.251"
24356
+ },
24357
+ [HOST_FEATURE.VaultPointerDisplay]: {
24358
+ label: "vault pointer display",
24359
+ hookEvents: ["MessageDisplay"],
24360
+ since: "2.1.152"
24361
+ }
24362
+ };
24363
+
24364
+ // ../../packages/plugin-sdk/src/ignore-layers.ts
24365
+ var import_ignore = __toESM(require_ignore(), 1);
24366
+ import { readFileSync as readFileSync12 } from "fs";
24367
+ import { join as join19 } from "path";
24368
+
24369
+ // ../../packages/plugin-sdk/src/inventory-resolver.ts
24370
+ import { arch, hostname as hostname4, platform, release } from "os";
24371
+
24222
24372
  // ../../packages/plugin-sdk/src/nudge.ts
24223
- import { mkdirSync as mkdirSync3, readFileSync as readFileSync12, writeFileSync as writeFileSync6 } from "fs";
24224
- import { join as join18 } from "path";
24373
+ import { mkdirSync as mkdirSync3, readFileSync as readFileSync13, writeFileSync as writeFileSync6 } from "fs";
24374
+ import { join as join20 } from "path";
24225
24375
 
24226
24376
  // ../../packages/plugin-sdk/src/paths.ts
24227
24377
  import { readdirSync as readdirSync3, realpathSync as realpathSync3 } from "fs";
24228
24378
  import { basename as basename4, dirname as dirname5, sep as sep3 } from "path";
24229
24379
 
24230
24380
  // ../../packages/plugin-sdk/src/project-files.ts
24231
- import { existsSync as existsSync10, readdirSync as readdirSync4 } from "fs";
24232
- import { basename as basename5, join as join19 } from "path";
24381
+ import { existsSync as existsSync11, readdirSync as readdirSync4 } from "fs";
24382
+ import { basename as basename5, join as join21 } from "path";
24233
24383
 
24234
24384
  // ../../packages/plugin-sdk/src/provider-env-antigravity.ts
24235
24385
  var optionalBaseUrl2 = external_exports.preprocess((v) => {
@@ -24265,11 +24415,11 @@ var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
24265
24415
 
24266
24416
  // ../../packages/plugin-sdk/src/throttle.ts
24267
24417
  import { mkdirSync as mkdirSync4, statSync as statSync8, writeFileSync as writeFileSync7 } from "fs";
24268
- import { join as join20 } from "path";
24418
+ import { join as join22 } from "path";
24269
24419
 
24270
24420
  // ../../packages/setup-wizard/src/remediation/rotation-checklist.ts
24271
24421
  import { writeFileSync as writeFileSync8 } from "fs";
24272
- import { join as join21 } from "path";
24422
+ import { join as join23 } from "path";
24273
24423
 
24274
24424
  // ../../packages/setup-wizard/src/triage/merge.ts
24275
24425
  var RANK = Object.fromEntries(
@@ -24277,9 +24427,9 @@ var RANK = Object.fromEntries(
24277
24427
  );
24278
24428
 
24279
24429
  // ../../packages/setup-wizard/src/triage/plan-file.ts
24280
- import { mkdtempSync, readFileSync as readFileSync13, rmdirSync, rmSync as rmSync7, writeFileSync as writeFileSync9 } from "fs";
24430
+ import { mkdtempSync, readFileSync as readFileSync14, rmdirSync, rmSync as rmSync7, writeFileSync as writeFileSync9 } from "fs";
24281
24431
  import { tmpdir } from "os";
24282
- import { basename as basename6, dirname as dirname6, join as join22 } from "path";
24432
+ import { basename as basename6, dirname as dirname6, join as join24 } from "path";
24283
24433
  var SuppressionEntrySchema = external_exports.object({
24284
24434
  ruleId: external_exports.string(),
24285
24435
  category: DetectionCategory,
@@ -24321,8 +24471,8 @@ var PersistedPlanSchema = external_exports.object({
24321
24471
  });
24322
24472
 
24323
24473
  // src/skills-registry.ts
24324
- import { readdirSync as readdirSync5, readFileSync as readFileSync14 } from "fs";
24325
- import { join as join23 } from "path";
24474
+ import { readdirSync as readdirSync5, readFileSync as readFileSync15 } from "fs";
24475
+ import { join as join25 } from "path";
24326
24476
  import { fileURLToPath as fileURLToPath2 } from "url";
24327
24477
  var SKILLS_DIR = fileURLToPath2(new URL("../skills", import.meta.url));
24328
24478
 
@@ -24362,7 +24512,7 @@ function authorName(author) {
24362
24512
  var manifestPath = process.argv[2];
24363
24513
  var manifest = {};
24364
24514
  try {
24365
- manifest = JSON.parse(readFileSync15(manifestPath ?? "", "utf8"));
24515
+ manifest = JSON.parse(readFileSync16(manifestPath ?? "", "utf8"));
24366
24516
  } catch {
24367
24517
  }
24368
24518
  process.stdout.write(