@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.
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 readFileSync14 } from "fs";
495
+ import { readFileSync as readFileSync15 } from "fs";
496
496
 
497
497
  // ../../packages/schema/src/exception-scope.ts
498
498
  var MINUTE_MS = 6e4;
@@ -20379,13 +20379,11 @@ var FindingGroup = external_exports.object({
20379
20379
  latestDetectedAt: external_exports.iso.datetime(),
20380
20380
  instances: external_exports.array(FindingInstance),
20381
20381
  // Derived from instances' statuses with open-dominates precedence (see
20382
- // buildFindingGroups). Undefined only when no instance carries a status.
20382
+ // foldGroupStatus). Undefined only when no instance carries a status.
20383
20383
  status: FindingStatus.optional(),
20384
- // The distinct people across the WHOLE group, not just the `instances`
20385
- // preview — from the store's whole-group aggregate when it supplies one,
20386
- // else folded from the rows (see buildFindingGroups). Undefined when no
20387
- // instance carries a user, or when the store supplied whole-group folds
20388
- // without one.
20384
+ // The distinct people across the WHOLE group, not just the instances
20385
+ // carried here. Undefined when no instance carries a user, or when the
20386
+ // store supplied whole-group folds without one.
20389
20387
  users: external_exports.array(FindingUser).optional()
20390
20388
  }).meta({ id: "FindingGroup" });
20391
20389
  var FindingStats = external_exports.object({
@@ -20414,20 +20412,30 @@ var FindingFacets = external_exports.object({
20414
20412
  // counted under no value.
20415
20413
  status: external_exports.array(FindingFacetItem),
20416
20414
  // Host tool (attributes.tool_name). Present only on the instance-level
20417
- // reads, which can filter by it; the grouped read omits the dimension
20415
+ // reads, which can filter by it; the type-level read omits the dimension
20418
20416
  // because a group spans tools.
20419
20417
  tool: external_exports.array(FindingFacetItem).optional()
20420
20418
  }).meta({ id: "FindingFacets" });
20421
- var ListGroupedFindingsQuery = external_exports.object({
20419
+ var FindingTypeSummary = FindingGroup.omit({ instances: true, match: true }).meta({
20420
+ id: "FindingTypeSummary"
20421
+ });
20422
+ var MAX_FINDING_TYPES_LIMIT = 100;
20423
+ var ListFindingTypesQuery = external_exports.object({
20422
20424
  // NOTE: severity filters by Severity (critical/high/medium/low), not by
20423
- // FindingAction.
20425
+ // FindingAction. It narrows TYPES: a type's severity is the one its newest
20426
+ // firing version carries, and this list pages types.
20427
+ //
20428
+ // That is NOT a claim the findings of a type share it. A rule can hold several
20429
+ // definition versions at different severities, so a type kept by this filter
20430
+ // can hold findings that individually do not match — see totals.findings on
20431
+ // ListFindingTypesResponse, which counts them all.
20424
20432
  severity: external_exports.array(Severity).optional(),
20425
20433
  subtype: external_exports.array(external_exports.string()).optional(),
20426
20434
  provider: external_exports.array(FindingProvider).optional(),
20427
20435
  action: external_exports.array(FindingAction).optional(),
20428
- // Matches a group's DERIVED status (see FindingGroup.status), not its
20429
- // individual instances' — so a filtered group's Status column always reads
20430
- // one of the requested values.
20436
+ // Matches a type's DERIVED status (see FindingGroup.status), not its
20437
+ // individual findings' — so a filtered row's status always reads one of the
20438
+ // requested values.
20431
20439
  status: external_exports.array(FindingStatus).optional(),
20432
20440
  q: external_exports.string().optional(),
20433
20441
  // Scope to findings whose event carries this session id (the Activity page's
@@ -20437,23 +20445,37 @@ var ListGroupedFindingsQuery = external_exports.object({
20437
20445
  // from a time-scoped page (Activity's range) can carry that scope. Absent
20438
20446
  // means all time — this list has no default window.
20439
20447
  from: external_exports.iso.datetime().optional(),
20440
- // A group or instance id that must appear in the page even when the cursor
20441
- // has already advanced past its sort position. This is what keeps the
20442
- // Findings page's one-shot ?finding= deep link resolving once the list
20443
- // paginates: the target group is appended out of sort order rather than
20444
- // scanning forward for it. Never affects totals, facets or the cursor.
20448
+ // A RULE id that must appear in the page even when the cursor has already
20449
+ // advanced past its sort position. This is what keeps the selected type
20450
+ // visible in the list once it paginates: the target is appended out of sort
20451
+ // order rather than scanned forward for. Never affects totals, facets or the
20452
+ // cursor. Unlike the grouped read this replaces, it names a rule only — an
20453
+ // instance id is resolved by `findingInstance`, which is a primary-key seek
20454
+ // and so is not bounded by what any page happens to hold.
20445
20455
  includeId: external_exports.string().optional(),
20446
- groupBy: external_exports.literal("type").optional(),
20447
- limit: external_exports.coerce.number().int().min(1).max(100).optional(),
20456
+ limit: external_exports.coerce.number().int().min(1).max(MAX_FINDING_TYPES_LIMIT).optional(),
20448
20457
  cursor: external_exports.string().optional()
20449
20458
  });
20450
- var ListGroupedFindingsResponse = external_exports.object({
20459
+ var ListFindingTypesResponse = external_exports.object({
20451
20460
  totals: external_exports.object({
20461
+ // Findings belonging to the matching TYPES — not findings that each match
20462
+ // the filters. The filters here select types, so a type that survives
20463
+ // contributes its whole instanceCount.
20464
+ //
20465
+ // `status` is the one exception, narrowed per finding via
20466
+ // countInstancesByStatus. `severity`, `provider` and `action` are not, so
20467
+ // this can exceed what the instance read reports for the same filters: a
20468
+ // rule whose severity moved between versions is kept on its newest and
20469
+ // still counts its older findings. Narrowing the other three needs
20470
+ // per-dimension counts the aggregate does not carry today.
20452
20471
  findings: external_exports.number().int().nonnegative(),
20453
- groups: external_exports.number().int().nonnegative()
20472
+ // Counts TYPES, which is the unit this read pages. The instance read's
20473
+ // own totals count findings; the two deliberately answer different
20474
+ // questions and are never summed.
20475
+ types: external_exports.number().int().nonnegative()
20454
20476
  }),
20455
20477
  facets: FindingFacets,
20456
- items: external_exports.array(FindingGroup),
20478
+ items: external_exports.array(FindingTypeSummary),
20457
20479
  nextCursor: external_exports.string().nullable(),
20458
20480
  // Present only on session-scoped queries (`sessionId` set): per ruleId, how
20459
20481
  // many times that rule fired in the session's persisted transcript. Findings
@@ -20461,7 +20483,7 @@ var ListGroupedFindingsResponse = external_exports.object({
20461
20483
  // every firing, so the two numbers legitimately differ — this map lets a
20462
20484
  // session-scoped view show both.
20463
20485
  sessionFirings: external_exports.record(external_exports.string(), external_exports.number().int().nonnegative()).optional()
20464
- }).meta({ id: "ListGroupedFindingsResponse" });
20486
+ }).meta({ id: "ListFindingTypesResponse" });
20465
20487
  var ApplyFindingActionRequest = external_exports.object({
20466
20488
  // 'quarantined' is system-assigned (see FindingAction) — clients may not set
20467
20489
  // it, so it is excluded from the request contract. The mapping helper
@@ -20490,12 +20512,13 @@ var FindingInstanceDetail = FindingInstance.extend({
20490
20512
  var MAX_FLAT_FINDINGS_LIMIT = 200;
20491
20513
  var ListFindingInstancesQuery = external_exports.object({
20492
20514
  severity: external_exports.array(Severity).optional(),
20493
- // Rule ids, the same vocabulary the grouped list's `subtype` carries.
20515
+ // Rule ids, the same vocabulary the types list's `subtype` carries. Pinning
20516
+ // ONE of them is how the master/detail view scopes its right-hand panel.
20494
20517
  subtype: external_exports.array(external_exports.string()).optional(),
20495
20518
  provider: external_exports.array(FindingProvider).optional(),
20496
20519
  action: external_exports.array(FindingAction).optional(),
20497
20520
  // Matches each instance's OWN derived status (deriveFindingStatus), unlike
20498
- // the grouped query's group-level fold.
20521
+ // the types query's type-level fold.
20499
20522
  status: external_exports.array(FindingStatus).optional(),
20500
20523
  // Exact host-tool names (attributes.tool_name, e.g. 'Bash'). A real filter,
20501
20524
  // where the free-text `q` can only match the rendered "via Bash" label.
@@ -20512,37 +20535,46 @@ var ListFindingInstancesQuery = external_exports.object({
20512
20535
  });
20513
20536
  var ListFindingInstancesResponse = external_exports.object({
20514
20537
  // Instances matching the filters across the whole scope, not just this
20515
- // page — cursor-independent, like the grouped list's totals.
20538
+ // page — cursor-independent, like the types list's totals.
20516
20539
  totals: external_exports.object({ findings: external_exports.number().int().nonnegative() }),
20517
- // Counts in INSTANCES here, where the grouped response counts groups. Each
20540
+ // Counts in INSTANCES here, where the types response counts types. Each
20518
20541
  // dimension still excludes its own filter.
20519
20542
  facets: FindingFacets,
20520
20543
  items: external_exports.array(FindingInstanceDetail),
20521
20544
  nextCursor: external_exports.string().nullable()
20522
20545
  }).meta({ id: "ListFindingInstancesResponse" });
20523
- var FindingLocationFile = external_exports.object({
20524
- // Empty when the instances carried no file path (a prompt or a tool call
20525
- // with no file attribution).
20526
- file: external_exports.string(),
20527
- instanceCount: external_exports.number().int().nonnegative(),
20528
- maxSeverity: Severity,
20529
- latestDetectedAt: external_exports.iso.datetime(),
20530
- // Folded from the instances' derived statuses with the same
20531
- // open-dominates precedence a group uses.
20532
- status: FindingStatus.optional(),
20533
- // Distinct rules seen at this location, capped — the row shows them as
20534
- // chips, and the count is what conveys scale.
20535
- ruleIds: external_exports.array(external_exports.string())
20536
- }).meta({ id: "FindingLocationFile" });
20537
- var FindingLocationRepo = external_exports.object({
20546
+ var FindingLocationSummary = external_exports.object({
20547
+ // Opaque, stable, minted from the pair by encodeLocationId. It exists
20548
+ // because a location's identity is two values and a URL param carries one:
20549
+ // `?loc=` names a location the way `?rule=` names a type. Only ever compared
20550
+ // for EQUALITY — the page's selection check, this read's `includeId`, the
20551
+ // client's page dedupe — never decoded, and never a sort key.
20552
+ id: external_exports.string(),
20538
20553
  /** Empty when the instances carried no repo attribute. */
20539
20554
  repo: external_exports.string(),
20555
+ // Empty when the instances carried no file path (a prompt, or a tool call
20556
+ // with no file attribution). Both halves empty is a real location — usually
20557
+ // the largest one in a store — and is selectable like any other.
20558
+ file: external_exports.string(),
20540
20559
  instanceCount: external_exports.number().int().nonnegative(),
20560
+ // The WORST severity present, not the first row's. It is this list's primary
20561
+ // sort key, so it is also what explains why a row is where it is, and it is
20562
+ // how a reader decides what to open without opening everything.
20541
20563
  maxSeverity: Severity,
20542
20564
  latestDetectedAt: external_exports.iso.datetime(),
20565
+ // Folded from the instances' derived statuses with the same open-dominates
20566
+ // precedence a group uses, so it answers "is anything left to do here" and
20567
+ // not much more: a location holding 1 open among 40 resolved reads like one
20568
+ // holding 40 open. That loss is accepted — the panel beside this list
20569
+ // carries each finding's own status, and instanceCount sits next to the
20570
+ // badge.
20543
20571
  status: FindingStatus.optional(),
20544
- files: external_exports.array(FindingLocationFile)
20545
- }).meta({ id: "FindingLocationRepo" });
20572
+ // Every distinct rule seen at this location, UNCAPPED — so the length is a
20573
+ // tally rather than a sample and a row can say how many there are. Bounded
20574
+ // by the ruleset, not by the store. The view bounds what it DISPLAYS.
20575
+ ruleIds: external_exports.array(external_exports.string())
20576
+ }).meta({ id: "FindingLocationSummary" });
20577
+ var MAX_FINDING_LOCATIONS_LIMIT = 100;
20546
20578
  var ListFindingLocationsQuery = external_exports.object({
20547
20579
  severity: external_exports.array(Severity).optional(),
20548
20580
  subtype: external_exports.array(external_exports.string()).optional(),
@@ -20555,18 +20587,42 @@ var ListFindingLocationsQuery = external_exports.object({
20555
20587
  q: external_exports.string().optional(),
20556
20588
  sessionId: external_exports.string().optional(),
20557
20589
  from: external_exports.iso.datetime().optional(),
20558
- limit: external_exports.coerce.number().int().min(1).max(500).optional()
20590
+ // A LOCATION id (see FindingLocationSummary.id) that must appear in the page
20591
+ // even when the cursor has already advanced past its sort position — the
20592
+ // counterpart of ListFindingTypesQuery.includeId, and needed far more often
20593
+ // here. Selecting a row pushes the URL, which re-renders the server and resets
20594
+ // the client's page cache to page 0; with distinct (repo, file) pairs running
20595
+ // into the thousands, a selection sitting off page 0 is the ordinary case
20596
+ // rather than a deep-link corner. Never affects totals, facets or the cursor.
20597
+ includeId: external_exports.string().optional(),
20598
+ limit: external_exports.coerce.number().int().min(1).max(MAX_FINDING_LOCATIONS_LIMIT).optional(),
20599
+ cursor: external_exports.string().optional()
20559
20600
  });
20560
20601
  var ListFindingLocationsResponse = external_exports.object({
20561
20602
  totals: external_exports.object({
20603
+ // Findings matching the filters across the whole scope. Unlike the types
20604
+ // read's same-named field this needs no caveat: the filters here narrow
20605
+ // per finding, so this is the sum of every row's instanceCount.
20562
20606
  findings: external_exports.number().int().nonnegative(),
20563
- repos: external_exports.number().int().nonnegative(),
20564
- files: external_exports.number().int().nonnegative()
20607
+ // Counts LOCATIONS, the unit this read pages — the number the paginator
20608
+ // states. The facets beside it count FINDINGS (see below); a surface
20609
+ // showing both says which is which.
20610
+ locations: external_exports.number().int().nonnegative()
20565
20611
  }),
20566
- /** Sorted by max severity, then most recent. */
20567
- items: external_exports.array(FindingLocationRepo),
20568
- /** Whether `limit` truncated the repo list. */
20569
- hasMore: external_exports.boolean()
20612
+ // Counts in FINDINGS, where the types response counts types, each dimension
20613
+ // still excluding its own filter. Deliberately not locations: counting those
20614
+ // needs a set of location keys per dimension per value — memory tracking the
20615
+ // store times the vocabulary, in a read whose scan promises flat memory —
20616
+ // and the cheap per-location version is not an approximation but WRONG. A
20617
+ // location holding {claudecode, block} and {codex, warn} would survive
20618
+ // provider=claudecode AND action=warn, under which no single finding
20619
+ // matches, so the facet would contradict the instanceCount this whole view
20620
+ // rests on. Findings also keep the toolbar in the same unit as the page
20621
+ // tally and the panel it sits above.
20622
+ facets: FindingFacets,
20623
+ /** Sorted by max severity, then most recent, then (repo, file). */
20624
+ items: external_exports.array(FindingLocationSummary),
20625
+ nextCursor: external_exports.string().nullable()
20570
20626
  }).meta({ id: "ListFindingLocationsResponse" });
20571
20627
 
20572
20628
  // ../../packages/schema/src/zod/meta.ts
@@ -21731,6 +21787,14 @@ var ControlPlaneErrorBody = external_exports.object({
21731
21787
  message: external_exports.string().optional()
21732
21788
  }).optional()
21733
21789
  });
21790
+ var RemoteFailureKind = external_exports.enum([
21791
+ "unauthorized",
21792
+ "forbidden",
21793
+ "route-absent",
21794
+ "invalid-request",
21795
+ "rejected",
21796
+ "unreachable"
21797
+ ]);
21734
21798
  var AttachDeviceRequest = external_exports.object({
21735
21799
  // This machine's own continuity id, so re-attaching ROTATES the credential
21736
21800
  // on one machine record instead of producing a second one. Client-minted
@@ -22741,11 +22805,11 @@ var WorkspaceSettings = external_exports.object({
22741
22805
  // covers the current payload and must be re-granted.
22742
22806
  modelJudgeConsent: ModelJudgeConsent.optional(),
22743
22807
  // Records that the user consented to the DEFERRED send — the outbox — along
22744
- // with the payload shape and the endpoint they agreed to. Since payload v2
22745
- // that covers both the pre-attach backlog and undelivered captures (which
22746
- // carry prompt/reply text in `content`); the key name predates the widening.
22747
- // Absent until granted, and a grant for a different endpoint or an older
22748
- // payload no longer counts.
22808
+ // with the payload shape and the endpoint they agreed to. Since payload v3
22809
+ // that covers the pre-attach backlog AND undelivered captures alike, and both
22810
+ // carry prompt/reply/tool-output text in `content`; the key name predates
22811
+ // both widenings. Absent until granted, and a grant for a different endpoint
22812
+ // or an older payload no longer counts.
22749
22813
  historySyncConsent: HistorySyncConsent.optional()
22750
22814
  });
22751
22815
 
@@ -22761,6 +22825,9 @@ var ManagedSettingKey = external_exports.enum([
22761
22825
  "dataSharesInPlace",
22762
22826
  "redactFallback"
22763
22827
  ]).meta({ id: "ManagedSettingKey" });
22828
+ function isManagedSettingKey(value) {
22829
+ return ManagedSettingKey.safeParse(value).success;
22830
+ }
22764
22831
  var ManagedSettingsValues = external_exports.object({
22765
22832
  runMode: external_exports.enum(["standalone", "attached"]).optional(),
22766
22833
  controlPlane: external_exports.object({
@@ -22785,7 +22852,27 @@ var ManagedSettings = external_exports.object({
22785
22852
  // Which of those the user may not change. A key here with no matching value
22786
22853
  // freezes whatever the user last chose; a value with no lock is a DEFAULT
22787
22854
  // the user may still override. The two are separable on purpose.
22788
- lockedFields: external_exports.array(ManagedSettingKey).default([])
22855
+ //
22856
+ // Parsed as NAMES rather than as the enum, and split below: a name this
22857
+ // build does not know is dropped from the locked set and reported, never a
22858
+ // reason to refuse the file. The same shape reaches an older build whenever
22859
+ // an administrator locks a key a newer build added, and refusing it there
22860
+ // ran that build entirely unmanaged — every pin and lock gone — on exactly
22861
+ // the fleets most likely to carry a version skew. A name outside the enum
22862
+ // is still never HONOURED: the lockable set stays explicit above.
22863
+ lockedFields: external_exports.array(external_exports.string()).default([])
22864
+ }).transform(({ lockedFields, ...rest }) => {
22865
+ const known = [];
22866
+ const unknown2 = [];
22867
+ for (const name of lockedFields) {
22868
+ if (isManagedSettingKey(name)) known.push(name);
22869
+ else unknown2.push(name);
22870
+ }
22871
+ return {
22872
+ ...rest,
22873
+ lockedFields: known,
22874
+ ...unknown2.length > 0 ? { unknownLockedFields: unknown2 } : {}
22875
+ };
22789
22876
  }).meta({ id: "ManagedSettings" });
22790
22877
 
22791
22878
  // ../../packages/schema/src/zod/project-files.ts
@@ -22903,7 +22990,11 @@ var FindingsTimeseriesPoint = external_exports.object({
22903
22990
  timestamp: external_exports.iso.date(),
22904
22991
  critical: external_exports.number().int().nonnegative(),
22905
22992
  high: external_exports.number().int().nonnegative(),
22906
- medium: external_exports.number().int().nonnegative()
22993
+ medium: external_exports.number().int().nonnegative(),
22994
+ // Optional and additive, so a producer written against the earlier
22995
+ // three-series contract keeps validating. A consumer plotting it resolves the
22996
+ // absent case itself — the chart point requires a number.
22997
+ low: external_exports.number().int().nonnegative().optional()
22907
22998
  }).meta({ id: "FindingsTimeseriesPoint" });
22908
22999
  var FindingsTimeseriesResponse = external_exports.object({
22909
23000
  range: TimeRange,
@@ -22929,6 +23020,10 @@ var ResolvedFeedItem = external_exports.object({
22929
23020
  findingKey: external_exports.string(),
22930
23021
  ruleId: external_exports.string(),
22931
23022
  severity: Severity,
23023
+ // Repository slug, and the file path RELATIVE to it. The pair is what
23024
+ // identifies the file: a bare path matches the same name in every repo.
23025
+ // Optional and additive; empty when the event carried no repo.
23026
+ repo: external_exports.string().optional(),
22932
23027
  path: external_exports.string(),
22933
23028
  // ISO-8601 datetime (matches FindingInstance.detectedAt / the rest of the
22934
23029
  // findings domain). The reader `.toISOString()`s the DB epoch-ms values.
@@ -23165,8 +23260,8 @@ import { execFileSync } from "child_process";
23165
23260
  var USE_SHELL = process.platform === "win32";
23166
23261
 
23167
23262
  // ../../packages/plugin-sdk/src/config.ts
23168
- import { existsSync as existsSync7 } from "fs";
23169
- import { join as join13 } from "path";
23263
+ import { existsSync as existsSync8 } from "fs";
23264
+ import { join as join14 } from "path";
23170
23265
 
23171
23266
  // ../../packages/persistence/src/attached-derived.ts
23172
23267
  import { rmSync } from "fs";
@@ -23233,6 +23328,32 @@ var ACTIVE_REVEAL_GRANT_PREDICATE = `capability = 'reveal_to_model'
23233
23328
  AND conditions IS NULL
23234
23329
  AND ${ACTIVE_PREDICATE}`;
23235
23330
 
23331
+ // ../../packages/persistence/src/repositories/resolution-sql.ts
23332
+ function latestResolutionColumnSql(column, findingsAlias) {
23333
+ return `(
23334
+ SELECT fr.${column} FROM finding_resolution fr
23335
+ WHERE fr.finding_key = ${findingsAlias}.finding_key
23336
+ ORDER BY fr.created_at DESC, fr.rowid DESC
23337
+ LIMIT 1
23338
+ )`;
23339
+ }
23340
+ function latestResolutionStatusSql(findingsAlias) {
23341
+ return latestResolutionColumnSql("status", findingsAlias);
23342
+ }
23343
+
23344
+ // ../../packages/persistence/src/repositories/findings.ts
23345
+ var FINDING_ROW_COLUMNS_SQL = `f.id AS id, d.rule_id AS rule_id, d.category AS category,
23346
+ d.severity AS severity, f.masked_match AS masked_match,
23347
+ f.action_taken AS action_taken, f.confidence AS confidence,
23348
+ e.started_at AS occurred_at,
23349
+ e.source_tool AS source_tool,
23350
+ e.repo AS repo,
23351
+ e.file_path AS file,
23352
+ e.tool_name AS tool_name,
23353
+ f.audit_event_id AS event_id, e.root_session_id AS session_id,
23354
+ e.event_type AS kind, f.finding_key AS finding_key,
23355
+ ${latestResolutionStatusSql("f")} AS latest_status`;
23356
+
23236
23357
  // ../../packages/persistence/src/repositories/history-sync.ts
23237
23358
  var STRUCTURAL_EVENT_TYPES = ["session", "llm_call", "tool_call"];
23238
23359
  var TYPE_LIST = STRUCTURAL_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
@@ -23322,23 +23443,30 @@ import { randomUUID as randomUUID10 } from "crypto";
23322
23443
  // ../../packages/persistence/src/database.ts
23323
23444
  var CAPTURE_GRAIN = new Set(EventKind.options);
23324
23445
 
23325
- // ../../packages/persistence/src/finding-key.ts
23446
+ // ../../packages/persistence/src/egress-wire.ts
23326
23447
  import { createHash as createHash3 } from "crypto";
23327
23448
 
23449
+ // ../../packages/persistence/src/finding-key.ts
23450
+ import { createHash as createHash4 } from "crypto";
23451
+
23328
23452
  // ../../packages/persistence/src/fingerprint.ts
23329
23453
  import { createHmac, randomBytes } from "crypto";
23330
23454
  import { existsSync as existsSync3, readFileSync as readFileSync6 } from "fs";
23331
23455
  import { join as join8 } from "path";
23332
23456
  import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
23333
23457
 
23334
- // ../../packages/persistence/src/history-preview.ts
23458
+ // ../../packages/persistence/src/history-backfill.ts
23335
23459
  import { existsSync as existsSync4 } from "fs";
23336
23460
  import { join as join9 } from "path";
23461
+
23462
+ // ../../packages/persistence/src/history-preview.ts
23463
+ import { existsSync as existsSync5 } from "fs";
23464
+ import { join as join10 } from "path";
23337
23465
  import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
23338
23466
 
23339
23467
  // ../../packages/persistence/src/store-symlinks.ts
23340
- import { existsSync as existsSync5, lstatSync as lstatSync3, readlinkSync, realpathSync, statSync as statSync4 } from "fs";
23341
- import { dirname as dirname3, join as join10, resolve } from "path";
23468
+ import { existsSync as existsSync6, lstatSync as lstatSync3, readlinkSync, realpathSync, statSync as statSync4 } from "fs";
23469
+ import { dirname as dirname3, join as join11, resolve } from "path";
23342
23470
 
23343
23471
  // ../../packages/persistence/src/vault/crypto.ts
23344
23472
  import {
@@ -23353,14 +23481,14 @@ import {
23353
23481
  import { execFileSync as execFileSync2 } from "child_process";
23354
23482
  import { randomBytes as randomBytes2 } from "crypto";
23355
23483
  import { chmodSync as chmodSync3, readFileSync as readFileSync7, renameSync as renameSync4, rmSync as rmSync6, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
23356
- import { join as join11 } from "path";
23484
+ import { join as join12 } from "path";
23357
23485
 
23358
23486
  // ../../packages/persistence/src/vault/vault.ts
23359
23487
  import { randomBytes as randomBytes3, randomUUID as randomUUID12 } from "crypto";
23360
23488
 
23361
23489
  // ../../packages/persistence/src/warn-era-cap.ts
23362
- import { existsSync as existsSync6, writeFileSync as writeFileSync4 } from "fs";
23363
- import { join as join12 } from "path";
23490
+ import { existsSync as existsSync7, writeFileSync as writeFileSync4 } from "fs";
23491
+ import { join as join13 } from "path";
23364
23492
 
23365
23493
  // ../../packages/plugin-sdk/src/provider-env.ts
23366
23494
  var booleanish = external_exports.string().optional().transform((v) => {
@@ -23383,7 +23511,7 @@ var ProviderEnvSchema = external_exports.object(providerEnvShape);
23383
23511
  // ../../packages/plugin-sdk/src/config-inventory.ts
23384
23512
  import { readdirSync as readdirSync2, readFileSync as readFileSync9, realpathSync as realpathSync2, statSync as statSync7 } from "fs";
23385
23513
  import { homedir as homedir2 } from "os";
23386
- import { basename as basename3, join as join15 } from "path";
23514
+ import { basename as basename3, join as join16 } from "path";
23387
23515
 
23388
23516
  // ../../packages/detections/src/egress/registry.ts
23389
23517
  var EXTRACTOR_VERSION = "1";
@@ -24141,24 +24269,20 @@ var CPU_CORROBORATION_SHARE = 0.2;
24141
24269
  var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
24142
24270
 
24143
24271
  // ../../packages/plugin-sdk/src/repo.ts
24144
- import { existsSync as existsSync8, readFileSync as readFileSync8, statSync as statSync6 } from "fs";
24145
- import { basename as basename2, dirname as dirname4, isAbsolute, join as join14, sep as sep2 } from "path";
24272
+ import { existsSync as existsSync9, readFileSync as readFileSync8, statSync as statSync6 } from "fs";
24273
+ import { basename as basename2, dirname as dirname4, isAbsolute, join as join15, sep as sep2 } from "path";
24146
24274
 
24147
24275
  // ../../packages/plugin-sdk/src/events.ts
24148
- import { createHash as createHash4, randomUUID as randomUUID13 } from "crypto";
24276
+ import { createHash as createHash5, randomUUID as randomUUID13 } from "crypto";
24149
24277
 
24150
24278
  // ../../packages/plugin-sdk/src/isolated-scan.ts
24151
- import { existsSync as existsSync9 } from "fs";
24279
+ import { existsSync as existsSync10 } from "fs";
24152
24280
  import { fileURLToPath } from "url";
24153
24281
  import { Worker } from "worker_threads";
24154
24282
 
24155
- // ../../packages/plugin-sdk/src/ignore-layers.ts
24156
- var import_ignore = __toESM(require_ignore(), 1);
24157
- import { readFileSync as readFileSync10 } from "fs";
24158
- import { join as join16 } from "path";
24159
-
24160
- // ../../packages/plugin-sdk/src/inventory-resolver.ts
24161
- import { arch, hostname as hostname4, platform, release } from "os";
24283
+ // ../../packages/plugin-sdk/src/host-floor.ts
24284
+ import { readFileSync as readFileSync11 } from "fs";
24285
+ import { join as join18 } from "path";
24162
24286
 
24163
24287
  // ../../packages/plugin-sdk/src/model-governance.ts
24164
24288
  import {
@@ -24166,24 +24290,50 @@ import {
24166
24290
  fstatSync,
24167
24291
  mkdirSync as mkdirSync2,
24168
24292
  openSync as openSync2,
24169
- readFileSync as readFileSync11,
24293
+ readFileSync as readFileSync10,
24170
24294
  readSync,
24171
24295
  writeFileSync as writeFileSync5
24172
24296
  } from "fs";
24173
24297
  import { join as join17 } from "path";
24174
24298
  var TAIL_BYTES = 256 * 1024;
24175
24299
 
24300
+ // ../../packages/plugin-sdk/src/host-floor.ts
24301
+ var HOST_FEATURE = {
24302
+ ModelSwitch: "model-switch",
24303
+ VaultPointerDisplay: "vault-pointer-display"
24304
+ };
24305
+ var HOST_FLOORS = {
24306
+ [HOST_FEATURE.ModelSwitch]: {
24307
+ label: "model-switch protection",
24308
+ hookEvents: ["PreModelSwitch", "PostModelSwitch"],
24309
+ since: "2.1.251"
24310
+ },
24311
+ [HOST_FEATURE.VaultPointerDisplay]: {
24312
+ label: "vault pointer display",
24313
+ hookEvents: ["MessageDisplay"],
24314
+ since: "2.1.152"
24315
+ }
24316
+ };
24317
+
24318
+ // ../../packages/plugin-sdk/src/ignore-layers.ts
24319
+ var import_ignore = __toESM(require_ignore(), 1);
24320
+ import { readFileSync as readFileSync12 } from "fs";
24321
+ import { join as join19 } from "path";
24322
+
24323
+ // ../../packages/plugin-sdk/src/inventory-resolver.ts
24324
+ import { arch, hostname as hostname4, platform, release } from "os";
24325
+
24176
24326
  // ../../packages/plugin-sdk/src/nudge.ts
24177
- import { mkdirSync as mkdirSync3, readFileSync as readFileSync12, writeFileSync as writeFileSync6 } from "fs";
24178
- import { join as join18 } from "path";
24327
+ import { mkdirSync as mkdirSync3, readFileSync as readFileSync13, writeFileSync as writeFileSync6 } from "fs";
24328
+ import { join as join20 } from "path";
24179
24329
 
24180
24330
  // ../../packages/plugin-sdk/src/paths.ts
24181
24331
  import { readdirSync as readdirSync3, realpathSync as realpathSync3 } from "fs";
24182
24332
  import { basename as basename4, dirname as dirname5, sep as sep3 } from "path";
24183
24333
 
24184
24334
  // ../../packages/plugin-sdk/src/project-files.ts
24185
- import { existsSync as existsSync10, readdirSync as readdirSync4 } from "fs";
24186
- import { basename as basename5, join as join19 } from "path";
24335
+ import { existsSync as existsSync11, readdirSync as readdirSync4 } from "fs";
24336
+ import { basename as basename5, join as join21 } from "path";
24187
24337
 
24188
24338
  // ../../packages/plugin-sdk/src/provider-env-antigravity.ts
24189
24339
  var optionalBaseUrl2 = external_exports.preprocess((v) => {
@@ -24219,11 +24369,11 @@ var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
24219
24369
 
24220
24370
  // ../../packages/plugin-sdk/src/throttle.ts
24221
24371
  import { mkdirSync as mkdirSync4, statSync as statSync8, writeFileSync as writeFileSync7 } from "fs";
24222
- import { join as join20 } from "path";
24372
+ import { join as join22 } from "path";
24223
24373
 
24224
24374
  // ../../packages/setup-wizard/src/remediation/rotation-checklist.ts
24225
24375
  import { writeFileSync as writeFileSync8 } from "fs";
24226
- import { join as join21 } from "path";
24376
+ import { join as join23 } from "path";
24227
24377
 
24228
24378
  // ../../packages/setup-wizard/src/triage/merge.ts
24229
24379
  var RANK = Object.fromEntries(
@@ -24231,9 +24381,9 @@ var RANK = Object.fromEntries(
24231
24381
  );
24232
24382
 
24233
24383
  // ../../packages/setup-wizard/src/triage/plan-file.ts
24234
- import { mkdtempSync, readFileSync as readFileSync13, rmdirSync, rmSync as rmSync7, writeFileSync as writeFileSync9 } from "fs";
24384
+ import { mkdtempSync, readFileSync as readFileSync14, rmdirSync, rmSync as rmSync7, writeFileSync as writeFileSync9 } from "fs";
24235
24385
  import { tmpdir } from "os";
24236
- import { basename as basename6, dirname as dirname6, join as join22 } from "path";
24386
+ import { basename as basename6, dirname as dirname6, join as join24 } from "path";
24237
24387
  var SuppressionEntrySchema = external_exports.object({
24238
24388
  ruleId: external_exports.string(),
24239
24389
  category: DetectionCategory,
@@ -24376,7 +24526,7 @@ function buildIntroCard(manifest2, verified) {
24376
24526
  var manifestPath = process.argv[2];
24377
24527
  var manifest = {};
24378
24528
  try {
24379
- manifest = JSON.parse(readFileSync14(manifestPath ?? "", "utf8"));
24529
+ manifest = JSON.parse(readFileSync15(manifestPath ?? "", "utf8"));
24380
24530
  } catch {
24381
24531
  }
24382
24532
  process.stdout.write(show(fenced(buildIntroCard(manifest))));