@akasecurity/cli 0.9.11 → 0.9.12

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.
Files changed (118) hide show
  1. package/dist/cli.js +4764 -3653
  2. package/extension/content.js +1 -1
  3. package/extension/manifest.json +1 -1
  4. package/native-host/host.js +1576 -870
  5. package/native-host/scan-worker.js +237 -18
  6. package/native-host/sync.js +333 -65
  7. package/package.json +5 -5
  8. package/web-ui/web-ui/.next/BUILD_ID +1 -1
  9. package/web-ui/web-ui/.next/app-build-manifest.json +87 -87
  10. package/web-ui/web-ui/.next/app-path-routes-manifest.json +5 -5
  11. package/web-ui/web-ui/.next/build-manifest.json +2 -2
  12. package/web-ui/web-ui/.next/prerender-manifest.json +3 -3
  13. package/web-ui/web-ui/.next/server/app/(app)/activity/page.js +2 -2
  14. package/web-ui/web-ui/.next/server/app/(app)/activity/page.js.nft.json +1 -1
  15. package/web-ui/web-ui/.next/server/app/(app)/activity/page_client-reference-manifest.js +1 -1
  16. package/web-ui/web-ui/.next/server/app/(app)/data-shares/page.js +2 -2
  17. package/web-ui/web-ui/.next/server/app/(app)/data-shares/page.js.nft.json +1 -1
  18. package/web-ui/web-ui/.next/server/app/(app)/data-shares/page_client-reference-manifest.js +1 -1
  19. package/web-ui/web-ui/.next/server/app/(app)/detections/page.js +2 -2
  20. package/web-ui/web-ui/.next/server/app/(app)/detections/page.js.nft.json +1 -1
  21. package/web-ui/web-ui/.next/server/app/(app)/detections/page_client-reference-manifest.js +1 -1
  22. package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page.js +2 -2
  23. package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page.js.nft.json +1 -1
  24. package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page_client-reference-manifest.js +1 -1
  25. package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page.js +1 -1
  26. package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page.js.nft.json +1 -1
  27. package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page_client-reference-manifest.js +1 -1
  28. package/web-ui/web-ui/.next/server/app/(app)/exceptions/page.js +1 -1
  29. package/web-ui/web-ui/.next/server/app/(app)/exceptions/page.js.nft.json +1 -1
  30. package/web-ui/web-ui/.next/server/app/(app)/exceptions/page_client-reference-manifest.js +1 -1
  31. package/web-ui/web-ui/.next/server/app/(app)/findings/page.js +2 -2
  32. package/web-ui/web-ui/.next/server/app/(app)/findings/page.js.nft.json +1 -1
  33. package/web-ui/web-ui/.next/server/app/(app)/findings/page_client-reference-manifest.js +1 -1
  34. package/web-ui/web-ui/.next/server/app/(app)/inventory/page.js +2 -2
  35. package/web-ui/web-ui/.next/server/app/(app)/inventory/page.js.nft.json +1 -1
  36. package/web-ui/web-ui/.next/server/app/(app)/inventory/page_client-reference-manifest.js +1 -1
  37. package/web-ui/web-ui/.next/server/app/(app)/policies/page.js +2 -2
  38. package/web-ui/web-ui/.next/server/app/(app)/policies/page.js.nft.json +1 -1
  39. package/web-ui/web-ui/.next/server/app/(app)/policies/page_client-reference-manifest.js +1 -1
  40. package/web-ui/web-ui/.next/server/app/(app)/scan/page.js +3 -3
  41. package/web-ui/web-ui/.next/server/app/(app)/scan/page.js.nft.json +1 -1
  42. package/web-ui/web-ui/.next/server/app/(app)/scan/page_client-reference-manifest.js +1 -1
  43. package/web-ui/web-ui/.next/server/app/(app)/security/page.js +2 -2
  44. package/web-ui/web-ui/.next/server/app/(app)/security/page.js.nft.json +1 -1
  45. package/web-ui/web-ui/.next/server/app/(app)/security/page_client-reference-manifest.js +1 -1
  46. package/web-ui/web-ui/.next/server/app/(app)/settings/page.js +2 -2
  47. package/web-ui/web-ui/.next/server/app/(app)/settings/page.js.nft.json +1 -1
  48. package/web-ui/web-ui/.next/server/app/(app)/settings/page_client-reference-manifest.js +1 -1
  49. package/web-ui/web-ui/.next/server/app/(app)/updates/page.js +2 -2
  50. package/web-ui/web-ui/.next/server/app/(app)/updates/page.js.nft.json +1 -1
  51. package/web-ui/web-ui/.next/server/app/(app)/updates/page_client-reference-manifest.js +1 -1
  52. package/web-ui/web-ui/.next/server/app/(app)/vault/page.js +2 -2
  53. package/web-ui/web-ui/.next/server/app/(app)/vault/page.js.nft.json +1 -1
  54. package/web-ui/web-ui/.next/server/app/(app)/vault/page_client-reference-manifest.js +1 -1
  55. package/web-ui/web-ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  56. package/web-ui/web-ui/.next/server/app/_not-found.html +1 -1
  57. package/web-ui/web-ui/.next/server/app/_not-found.rsc +2 -2
  58. package/web-ui/web-ui/.next/server/app/index.html +1 -1
  59. package/web-ui/web-ui/.next/server/app/index.rsc +2 -2
  60. package/web-ui/web-ui/.next/server/app/page_client-reference-manifest.js +1 -1
  61. package/web-ui/web-ui/.next/server/app-paths-manifest.json +5 -5
  62. package/web-ui/web-ui/.next/server/chunks/{739.js → 121.js} +1 -1
  63. package/web-ui/web-ui/.next/server/chunks/290.js +6 -0
  64. package/web-ui/web-ui/.next/server/chunks/475.js +1 -1
  65. package/web-ui/web-ui/.next/server/chunks/589.js +1 -1
  66. package/web-ui/web-ui/.next/server/chunks/611.js +1015 -0
  67. package/web-ui/web-ui/.next/server/chunks/7.js +1 -1
  68. package/web-ui/web-ui/.next/server/chunks/816.js +1 -0
  69. package/web-ui/web-ui/.next/server/chunks/935.js +1 -1
  70. package/web-ui/web-ui/.next/server/chunks/968.js +1006 -0
  71. package/web-ui/web-ui/.next/server/functions-config-manifest.json +6 -6
  72. package/web-ui/web-ui/.next/server/middleware-manifest.json +5 -5
  73. package/web-ui/web-ui/.next/server/pages/404.html +1 -1
  74. package/web-ui/web-ui/.next/server/pages/500.html +1 -1
  75. package/web-ui/web-ui/.next/server/server-reference-manifest.js +1 -1
  76. package/web-ui/web-ui/.next/server/server-reference-manifest.json +1 -1
  77. package/web-ui/web-ui/.next/static/chunks/{526-026c69b926a17dbb.js → 526-f0156de7831566b3.js} +1 -1
  78. package/web-ui/web-ui/.next/static/chunks/674-d8237c5d0faa4a53.js +1 -0
  79. package/web-ui/web-ui/.next/static/chunks/app/(app)/activity/page-a27c8937989448e4.js +1 -0
  80. package/web-ui/web-ui/.next/static/chunks/app/(app)/data-shares/page-2b805f9e1f995092.js +1 -0
  81. package/web-ui/web-ui/.next/static/chunks/app/(app)/detections/page-a87cfee370c4e0f4.js +1 -0
  82. package/web-ui/web-ui/.next/static/chunks/app/(app)/{error-dead9507fc349f26.js → error-190085728a856072.js} +1 -1
  83. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/[id]/page-4e214491c7be8d43.js +1 -0
  84. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/new/page-c1bb992ee1f12566.js +1 -0
  85. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/page-f16ba40d88e414b1.js +1 -0
  86. package/web-ui/web-ui/.next/static/chunks/app/(app)/findings/page-59c76da638f22b0e.js +1 -0
  87. package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/page-c37447caf89a86e1.js +1 -0
  88. package/web-ui/web-ui/.next/static/chunks/app/(app)/{layout-dc7ae7664dcdc3c5.js → layout-cb3c8c7b6b33414c.js} +1 -1
  89. package/web-ui/web-ui/.next/static/chunks/app/(app)/policies/page-ab639e48f60ad7ee.js +1 -0
  90. package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/page-494614fccc8c62cc.js +1 -0
  91. package/web-ui/web-ui/.next/static/chunks/app/(app)/security/page-a3095119b3e87341.js +1 -0
  92. package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/page-469613d499e41093.js +1 -0
  93. package/web-ui/web-ui/.next/static/chunks/app/(app)/updates/page-5b32bd569c9569d9.js +1 -0
  94. package/web-ui/web-ui/.next/static/chunks/app/(app)/vault/page-3152ceb31f024b8d.js +1 -0
  95. package/web-ui/web-ui/.next/static/css/6e72259eccdf4435.css +2 -0
  96. package/web-ui/web-ui/dist/scan-worker.js +237 -18
  97. package/web-ui/web-ui/.next/server/chunks/471.js +0 -950
  98. package/web-ui/web-ui/.next/server/chunks/766.js +0 -6
  99. package/web-ui/web-ui/.next/server/chunks/851.js +0 -1
  100. package/web-ui/web-ui/.next/server/chunks/905.js +0 -959
  101. package/web-ui/web-ui/.next/static/chunks/907-2ba9428e7818b656.js +0 -1
  102. package/web-ui/web-ui/.next/static/chunks/app/(app)/activity/page-c5a55618d187c906.js +0 -1
  103. package/web-ui/web-ui/.next/static/chunks/app/(app)/data-shares/page-b1c76b8c00e1ae2a.js +0 -1
  104. package/web-ui/web-ui/.next/static/chunks/app/(app)/detections/page-159167b47a005b33.js +0 -1
  105. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/[id]/page-5e872a82af85ef64.js +0 -1
  106. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/new/page-0695d0006518b2cb.js +0 -1
  107. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/page-adec99f2f4bbc180.js +0 -1
  108. package/web-ui/web-ui/.next/static/chunks/app/(app)/findings/page-d013384d2ddb3036.js +0 -1
  109. package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/page-42c1b48a01fdecb0.js +0 -1
  110. package/web-ui/web-ui/.next/static/chunks/app/(app)/policies/page-9b6d7cc4ce9fb33e.js +0 -1
  111. package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/page-f3ee9ecde06df153.js +0 -1
  112. package/web-ui/web-ui/.next/static/chunks/app/(app)/security/page-24a003c709776317.js +0 -1
  113. package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/page-4ea49ce2e765fffb.js +0 -1
  114. package/web-ui/web-ui/.next/static/chunks/app/(app)/updates/page-6c7b94b070de8986.js +0 -1
  115. package/web-ui/web-ui/.next/static/chunks/app/(app)/vault/page-f37ab8e1edc67663.js +0 -1
  116. package/web-ui/web-ui/.next/static/css/c6954dd65f2115e6.css +0 -2
  117. /package/web-ui/web-ui/.next/static/{osEmGZG6yEV-XkQlklt-B → PMeePXfXsQ2xxrXppySG_}/_buildManifest.js +0 -0
  118. /package/web-ui/web-ui/.next/static/{osEmGZG6yEV-XkQlklt-B → PMeePXfXsQ2xxrXppySG_}/_ssgManifest.js +0 -0
@@ -50,7 +50,7 @@ var require_ignore = __commonJS({
50
50
  var REGEX_SPLITALL_CRLF = /\r?\n/g;
51
51
  var REGEX_TEST_INVALID_PATH = /^\.{0,2}\/|^\.{1,2}$/;
52
52
  var REGEX_TEST_TRAILING_SLASH = /\/$/;
53
- var SLASH2 = "/";
53
+ var SLASH3 = "/";
54
54
  var TMP_KEY_IGNORE = "node-ignore";
55
55
  if (typeof Symbol !== "undefined") {
56
56
  TMP_KEY_IGNORE = /* @__PURE__ */ Symbol.for("node-ignore");
@@ -422,11 +422,11 @@ var require_ignore = __commonJS({
422
422
  if (!REGEX_TEST_TRAILING_SLASH.test(path)) {
423
423
  return this.test(path);
424
424
  }
425
- const slices = path.split(SLASH2).filter(Boolean);
425
+ const slices = path.split(SLASH3).filter(Boolean);
426
426
  slices.pop();
427
427
  if (slices.length) {
428
428
  const parent = this._t(
429
- slices.join(SLASH2) + SLASH2,
429
+ slices.join(SLASH3) + SLASH3,
430
430
  this._testCache,
431
431
  true,
432
432
  slices
@@ -442,14 +442,14 @@ var require_ignore = __commonJS({
442
442
  return cache[path];
443
443
  }
444
444
  if (!slices) {
445
- slices = path.split(SLASH2).filter(Boolean);
445
+ slices = path.split(SLASH3).filter(Boolean);
446
446
  }
447
447
  slices.pop();
448
448
  if (!slices.length) {
449
449
  return cache[path] = this._rules.test(path, checkUnignored, MODE_IGNORE);
450
450
  }
451
451
  const parent = this._t(
452
- slices.join(SLASH2) + SLASH2,
452
+ slices.join(SLASH3) + SLASH3,
453
453
  cache,
454
454
  checkUnignored,
455
455
  slices
@@ -500,6 +500,14 @@ var ATTACHED_SYNC_STATE_FILENAME = "attached-sync-state.json";
500
500
  import { chmodSync as chmodSync2, lstatSync as lstatSync2, readFileSync, rmSync as rmSync3, statSync } from "fs";
501
501
  import { join as join2 } from "path";
502
502
 
503
+ // ../../packages/schema/src/drizzle/deferred-migrations.ts
504
+ var DEFERRED_MIGRATION_TAGS = [
505
+ "0031_audit_capture_by_time_index",
506
+ "0032_audit_capture_by_id_index",
507
+ "0033_audit_capture_location_index",
508
+ "0034_findings_read_indexes"
509
+ ];
510
+
503
511
  // ../../packages/schema/src/exception-scope.ts
504
512
  var MINUTE_MS = 6e4;
505
513
  var HOUR_MS = 60 * MINUTE_MS;
@@ -20309,6 +20317,15 @@ var FindingCategory = external_exports.enum([
20309
20317
  ]).meta({ id: "FindingCategory" });
20310
20318
  var FindingOrigin = external_exports.enum(["in-flight", "at-rest"]).meta({ id: "FindingOrigin" });
20311
20319
  var FindingStatus = external_exports.enum(["open", "handled", "resolved", "dismissed"]).meta({ id: "FindingStatus" });
20320
+ var SyncFailureReason = external_exports.enum(["deployment_refused", "payload_invalid", "detached_undelivered"]).meta({ id: "SyncFailureReason" });
20321
+ var FindingDeliveryState = external_exports.enum(["sent", "queued", "not_sent", "never_offered", "local_scan"]).meta({ id: "FindingDeliveryState" });
20322
+ var FindingDelivery = external_exports.object({
20323
+ state: FindingDeliveryState,
20324
+ // The delivery time for `sent`; the failure time for `not_sent` when recorded.
20325
+ at: external_exports.iso.datetime().optional(),
20326
+ // Only on `not_sent`, and only when a known reason was recorded.
20327
+ reason: SyncFailureReason.optional()
20328
+ }).meta({ id: "FindingDelivery" });
20312
20329
  var ResolutionMethod = external_exports.enum([
20313
20330
  "enforced-in-flight",
20314
20331
  "fixed-at-source",
@@ -20365,7 +20382,10 @@ var FindingInstance = external_exports.object({
20365
20382
  // The session that event belongs to, when it has one — the seam a
20366
20383
  // per-instance "view session" link needs. Absent for events captured
20367
20384
  // outside a session.
20368
- sessionId: external_exports.string().optional()
20385
+ sessionId: external_exports.string().optional(),
20386
+ // The delivery state of the event above (see FindingDelivery). Optional so
20387
+ // readers that do not project it stay valid.
20388
+ delivery: FindingDelivery.optional()
20369
20389
  }).meta({ id: "FindingInstance" });
20370
20390
  var FindingGroup = external_exports.object({
20371
20391
  id: external_exports.string(),
@@ -20417,7 +20437,10 @@ var FindingFacets = external_exports.object({
20417
20437
  // Host tool (attributes.tool_name). Present only on the instance-level
20418
20438
  // reads, which can filter by it; the type-level read omits the dimension
20419
20439
  // because a group spans tools.
20420
- tool: external_exports.array(FindingFacetItem).optional()
20440
+ tool: external_exports.array(FindingFacetItem).optional(),
20441
+ // Delivery states (FindingDeliveryState). Present only on the
20442
+ // instance-level reads, like `tool`.
20443
+ deployment: external_exports.array(FindingFacetItem).optional()
20421
20444
  }).meta({ id: "FindingFacets" });
20422
20445
  var FindingTypeSummary = FindingGroup.omit({ instances: true, match: true }).meta({
20423
20446
  id: "FindingTypeSummary"
@@ -20526,6 +20549,8 @@ var ListFindingInstancesQuery = external_exports.object({
20526
20549
  // Exact host-tool names (attributes.tool_name, e.g. 'Bash'). A real filter,
20527
20550
  // where the free-text `q` can only match the rendered "via Bash" label.
20528
20551
  tool: external_exports.array(external_exports.string()).optional(),
20552
+ // The delivery state of each finding's event (see FindingDelivery).
20553
+ deployment: external_exports.array(FindingDeliveryState).optional(),
20529
20554
  // Exact repository / file-path matches, for the drill-down out of the
20530
20555
  // locations view. A row whose event carries no repo/file matches neither.
20531
20556
  repo: external_exports.string().optional(),
@@ -20546,6 +20571,10 @@ var ListFindingInstancesResponse = external_exports.object({
20546
20571
  items: external_exports.array(FindingInstanceDetail),
20547
20572
  nextCursor: external_exports.string().nullable()
20548
20573
  }).meta({ id: "ListFindingInstancesResponse" });
20574
+ var ListFindingInstancesPage = external_exports.object({
20575
+ items: external_exports.array(FindingInstanceDetail),
20576
+ nextCursor: external_exports.string().nullable()
20577
+ }).meta({ id: "ListFindingInstancesPage" });
20549
20578
  var FindingLocationSummary = external_exports.object({
20550
20579
  // Opaque, stable, minted from the pair by encodeLocationId. It exists
20551
20580
  // because a location's identity is two values and a URL param carries one:
@@ -20587,6 +20616,8 @@ var ListFindingLocationsQuery = external_exports.object({
20587
20616
  // instances that match, and folds its status from those.
20588
20617
  status: external_exports.array(FindingStatus).optional(),
20589
20618
  tool: external_exports.array(external_exports.string()).optional(),
20619
+ // The delivery state of each finding's event (see FindingDelivery).
20620
+ deployment: external_exports.array(FindingDeliveryState).optional(),
20590
20621
  q: external_exports.string().optional(),
20591
20622
  sessionId: external_exports.string().optional(),
20592
20623
  from: external_exports.iso.datetime().optional(),
@@ -20789,6 +20820,10 @@ var CaptureAttributes = external_exports.object({
20789
20820
  // to 'allow' — the enforcement audit trail's link back to the grant that
20790
20821
  // authorized the bypass.
20791
20822
  exception_ids: external_exports.array(external_exports.guid()).optional(),
20823
+ // The persisted spellings of EventMetadata's messageId/conversationId — the
20824
+ // join back to the `llm_call` leaf for the same assistant turn.
20825
+ message_id: external_exports.string().optional(),
20826
+ conversation_id: external_exports.string().optional(),
20792
20827
  // Whole milliseconds this capture's inspection blocked its caller — the
20793
20828
  // plugin's own added latency (see EventMetadata.inspectionMs, whose value
20794
20829
  // this is). Promoted to the `inspection_ms` generated column so the facet is
@@ -20797,7 +20832,19 @@ var CaptureAttributes = external_exports.object({
20797
20832
  // inline json_extract and is not itself an optimization.
20798
20833
  // ABSENT on replayed captures (backfill / worktree scan) and on rows written
20799
20834
  // before the measurement shipped — never present as a placeholder 0.
20800
- inspection_ms: external_exports.number().int().nonnegative().optional()
20835
+ inspection_ms: external_exports.number().int().nonnegative().optional(),
20836
+ // What a `redact` this capture could not carry out became instead (see
20837
+ // EventMetadata.redactDegradedTo, whose value this is). Present only when a
20838
+ // degrade actually happened, so absence is the ordinary case rather than a
20839
+ // reader having to distinguish it from a zero.
20840
+ //
20841
+ // PER CAPTURE, while `inspection_findings.action_taken` is per finding —
20842
+ // so on a multi-finding row this does not say which finding degraded, and
20843
+ // its presence does not mean the fallback decided the capture's action. A
20844
+ // capture denied by another finding's own Block policy carries `block`
20845
+ // here too. The full statement is on EventMetadata.redactDegradedTo; it is
20846
+ // repeated rather than referenced because a store reader opens this file.
20847
+ redact_degraded_to: ActionTaken.optional()
20801
20848
  }).catchall(external_exports.unknown());
20802
20849
  var ToolCallInspection = external_exports.object({
20803
20850
  ruleId: external_exports.string().min(1),
@@ -20993,7 +21040,17 @@ var AuditEvent = external_exports.object({
20993
21040
  /** `share` to a first-party/internal destination. */
20994
21041
  internal: external_exports.boolean(),
20995
21042
  /** Event needs review (e.g. unverified egress). */
20996
- flagged: external_exports.boolean()
21043
+ flagged: external_exports.boolean(),
21044
+ /**
21045
+ * The body this event's `title` is drawn from was cleared by local body
21046
+ * expiry, so an EMPTY title here means "gone", not "never had one".
21047
+ *
21048
+ * A separate flag rather than a sentinel written into `title`: the title is
21049
+ * rendered text, and a store-layer module that invented display copy for it
21050
+ * would be choosing words the view is supposed to choose. Additive and
21051
+ * defaulted, so an older producer still validates.
21052
+ */
21053
+ bodyExpired: external_exports.boolean().default(false)
20997
21054
  }).meta({ id: "ActivityAuditEvent" });
20998
21055
  var ActivitySessionSummary = external_exports.object({
20999
21056
  id: external_exports.string(),
@@ -22217,6 +22274,12 @@ var EventMetadata = external_exports.object({
22217
22274
  // to 'allow' — the enforcement audit trail's link back to the grant that
22218
22275
  // authorized the bypass. Absent on captures where no exception applied.
22219
22276
  exceptionIds: external_exports.array(external_exports.guid()).optional(),
22277
+ // The assistant message this capture belongs to, and the conversation it sits
22278
+ // in — set by the browser extension's network capture so a stored `response`
22279
+ // row can be joined to the `llm_call` leaf describing the same turn. Absent
22280
+ // on every other capture path, which has no such id.
22281
+ messageId: external_exports.string().optional(),
22282
+ conversationId: external_exports.string().optional(),
22220
22283
  // How long THIS capture's inspection blocked its caller, in whole
22221
22284
  // milliseconds — the plugin's own added latency, NOT the LLM call it sat in
22222
22285
  // front of. Measured inside `capture()` (@akasecurity/plugin-sdk) across
@@ -22229,7 +22292,37 @@ var EventMetadata = external_exports.object({
22229
22292
  // Absent is also what every pre-measurement client writes, and what a
22230
22293
  // clock failure degrades to — a reader must treat absence as "not measured"
22231
22294
  // and never as a zero, which would read as "inspection is free".
22232
- inspectionMs: external_exports.number().int().nonnegative().optional()
22295
+ inspectionMs: external_exports.number().int().nonnegative().optional(),
22296
+ // What a `redact` this capture COULD NOT CARRY OUT became instead — the
22297
+ // workspace's `redactFallback`, applied because the field could not be
22298
+ // masked in place (a shell command, a URL, or any argument on a host whose
22299
+ // hook contract offers no rewrite channel).
22300
+ //
22301
+ // It exists because the action alone cannot say why. A finding recorded as
22302
+ // `warn` reads identically whether its detection was ASSIGNED Warn or was
22303
+ // assigned Redact on a field that could not take one — and those are
22304
+ // different facts about the same row: the first is a policy the user chose,
22305
+ // the second is a masking the host could not perform. Absent means no
22306
+ // degrade happened, which is every ordinary capture.
22307
+ //
22308
+ // TWO LIMITS a reader of a stored row has to know, because the grain here
22309
+ // is the CAPTURE while `actionTaken` is per FINDING:
22310
+ //
22311
+ // - It does not say WHICH finding degraded. A capture carrying a degraded
22312
+ // `redact` alongside a finding ASSIGNED the same action stores both
22313
+ // identically and one reason for the pair; attributing it to both
22314
+ // describes the assigned one wrongly, and to neither loses the degrade.
22315
+ // - PRESENCE IS NOT CAUSATION. The value is the action the lost redact
22316
+ // became, not the reason the capture ended as it did — a capture denied
22317
+ // by some other finding's own Block policy still carries `block` here,
22318
+ // and clearing the workspace's fallback would not have let it through.
22319
+ // Gate on the value against what a fallback can produce; never read the
22320
+ // field's presence as "this was the fallback's doing".
22321
+ //
22322
+ // Both are pinned as behaviour in @akasecurity/plugin-sdk's runtime suite.
22323
+ // Closing either means moving the reason onto the finding row, which
22324
+ // already carries its own action.
22325
+ redactDegradedTo: ActionTaken.optional()
22233
22326
  }).meta({ id: "EventMetadata" });
22234
22327
  var Event = external_exports.object({
22235
22328
  id: external_exports.guid(),
@@ -22339,6 +22432,15 @@ var RotateKeyInput = external_exports.object({
22339
22432
  confirmation: external_exports.string()
22340
22433
  });
22341
22434
 
22435
+ // ../../packages/schema/src/zod/finding-delivery.ts
22436
+ var KNOWN_REASONS = SyncFailureReason.options;
22437
+
22438
+ // ../../packages/schema/src/zod/findings-group-build.ts
22439
+ function rankByOrder(members2) {
22440
+ return Object.fromEntries(members2.map((member, index) => [member, index]));
22441
+ }
22442
+ var SEVERITY_RANK = rankByOrder(Severity.options);
22443
+
22342
22444
  // ../../packages/schema/src/zod/installed-pack.ts
22343
22445
  var InstalledPack = external_exports.object({
22344
22446
  id: external_exports.guid(),
@@ -22405,6 +22507,11 @@ var Policy = external_exports.object({
22405
22507
  // test `prohibitedModels` passes and `reversibleRuleIds` fails.
22406
22508
  provenance: PolicyProvenance.optional()
22407
22509
  }).meta({ id: "Policy" });
22510
+ var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "vault", "block"];
22511
+ var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
22512
+ var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
22513
+ id: "RedactFallback"
22514
+ });
22408
22515
  var PolicyBundle = external_exports.object({
22409
22516
  version: external_exports.string(),
22410
22517
  policies: external_exports.array(Policy),
@@ -22452,6 +22559,16 @@ var PolicyBundle = external_exports.object({
22452
22559
  // control plane), so no name resolution stands between the decision and the
22453
22560
  // comparison.
22454
22561
  prohibitedModels: external_exports.array(external_exports.string()).optional(),
22562
+ // What a resolved `redact` becomes on a field the host cannot rewrite, as
22563
+ // the ORGANIZATION would have it. Merged raise-only against the device's own
22564
+ // `WorkspaceSettings.redactFallback` (see strongerRedactFallback below), so
22565
+ // a control plane can tighten a machine and never loosen one — the same
22566
+ // direction `mergeRaiseOnly` enforces for policies.
22567
+ //
22568
+ // Optional so an older backend, and an older on-disk cache, still parses;
22569
+ // absent leaves the device's own setting in force, which is the behaviour
22570
+ // that predates the field and the safe direction to default.
22571
+ redactFallback: RedactFallback.optional(),
22455
22572
  customKeywords: external_exports.array(external_exports.string()),
22456
22573
  fetchedAt: external_exports.iso.datetime()
22457
22574
  }).meta({ id: "PolicyBundle" });
@@ -22481,11 +22598,6 @@ function severityFloorPolicy(category) {
22481
22598
  const peak = CATEGORY_PEAK_SEVERITY[category];
22482
22599
  return peak === "critical" || peak === "high" ? "warn" : "monitor";
22483
22600
  }
22484
- var KNOWN_BUILTIN_IDS = ["monitor", "warn", "redact", "vault", "block"];
22485
- var BuiltinPolicyId = external_exports.enum(KNOWN_BUILTIN_IDS).meta({ id: "BuiltinPolicyId" });
22486
- var RedactFallback = BuiltinPolicyId.extract(["monitor", "warn", "block"]).meta({
22487
- id: "RedactFallback"
22488
- });
22489
22601
  var BUILTIN_POLICY_SPECS = {
22490
22602
  monitor: {
22491
22603
  name: "Monitor",
@@ -22748,7 +22860,7 @@ var VaultConsent = external_exports.object({
22748
22860
  });
22749
22861
 
22750
22862
  // ../../packages/schema/src/zod/local.ts
22751
- var WORKSPACE_SETTINGS_SPEC_VERSION = 7;
22863
+ var WORKSPACE_SETTINGS_SPEC_VERSION = 8;
22752
22864
  var MODEL_JUDGE_PAYLOAD_VERSION = 1;
22753
22865
  var RunMode = external_exports.enum(["standalone", "attached"]);
22754
22866
  var ControlPlaneConnection = external_exports.object({
@@ -22768,6 +22880,15 @@ var HistorySyncConsent = external_exports.object({
22768
22880
  payloadVersion: external_exports.number().int().positive(),
22769
22881
  endpoint: external_exports.string()
22770
22882
  });
22883
+ var BODY_RETENTION_DEFAULT_DAYS = 30;
22884
+ var BodyRetention = external_exports.object({
22885
+ enabled: external_exports.boolean().default(false),
22886
+ // Never 0, and the ceiling is a fat-finger guard rather than a policy
22887
+ // limit — `enabled` is the real gate. A low value cannot reach a row the
22888
+ // sync ledger still owes: the sweep's age filter only ever NARROWS a
22889
+ // candidate set that is already bounded by "delivered, or never owed".
22890
+ retainDays: external_exports.number().int().min(1).max(3650).default(BODY_RETENTION_DEFAULT_DAYS)
22891
+ }).meta({ id: "BodyRetention" });
22771
22892
  var WorkspaceSettings = external_exports.object({
22772
22893
  specVersion: external_exports.number().int().positive().default(WORKSPACE_SETTINGS_SPEC_VERSION),
22773
22894
  runMode: RunMode.default("standalone"),
@@ -22816,7 +22937,13 @@ var WorkspaceSettings = external_exports.object({
22816
22937
  // carry prompt/reply/tool-output text in `content`; the key name predates
22817
22938
  // both widenings. Absent until granted, and a grant for a different endpoint
22818
22939
  // or an older payload no longer counts.
22819
- historySyncConsent: HistorySyncConsent.optional()
22940
+ historySyncConsent: HistorySyncConsent.optional(),
22941
+ // Local body expiry (see BodyRetention). Off until switched on; expiring a
22942
+ // body never removes the row or its findings.
22943
+ bodyRetention: BodyRetention.default({
22944
+ enabled: false,
22945
+ retainDays: BODY_RETENTION_DEFAULT_DAYS
22946
+ })
22820
22947
  });
22821
22948
  function defaultWorkspaceSettings() {
22822
22949
  return WorkspaceSettings.parse({});
@@ -22836,13 +22963,22 @@ var ManagedSettingKey = external_exports.enum([
22836
22963
  "vaultInlineReveal",
22837
22964
  "modelJudgeConsent",
22838
22965
  "dataSharesInPlace",
22839
- "redactFallback"
22966
+ "redactFallback",
22967
+ // Pins the toggle and the day count together — see BodyRetention on why the
22968
+ // two are one unit. An administrator mandating a window wants the count
22969
+ // enforced with it, not one a user can widen while the toggle stays on.
22970
+ "bodyRetention"
22840
22971
  ]).meta({ id: "ManagedSettingKey" });
22841
22972
  function isManagedSettingKey(value) {
22842
22973
  return ManagedSettingKey.safeParse(value).success;
22843
22974
  }
22844
22975
  var ManagedSettingsValues = external_exports.object({
22845
22976
  runMode: external_exports.enum(["standalone", "attached"]).optional(),
22977
+ // `controlPlane` and `bodyRetention` are the two nested values, and both are
22978
+ // plain, non-strict objects: a key under either that this build does not know
22979
+ // is stripped and nothing reports it. The unknown-value split in
22980
+ // ManagedSettings below classifies top-level names only, so it stops at
22981
+ // these boundaries.
22846
22982
  controlPlane: external_exports.object({
22847
22983
  endpoint: external_exports.string().min(1),
22848
22984
  label: external_exports.string().min(1).optional()
@@ -22853,7 +22989,8 @@ var ManagedSettingsValues = external_exports.object({
22853
22989
  vaultInlineReveal: external_exports.enum(["masked", "full", "off"]).optional(),
22854
22990
  modelJudgeConsent: external_exports.boolean().optional(),
22855
22991
  dataSharesInPlace: external_exports.boolean().optional(),
22856
- redactFallback: RedactFallback.optional()
22992
+ redactFallback: RedactFallback.optional(),
22993
+ bodyRetention: BodyRetention.optional()
22857
22994
  }).meta({ id: "ManagedSettingsValues" });
22858
22995
  var ManagedSettings = external_exports.object({
22859
22996
  specVersion: external_exports.number().int().positive().default(MANAGED_SETTINGS_SPEC_VERSION),
@@ -22861,7 +22998,21 @@ var ManagedSettings = external_exports.object({
22861
22998
  // decision from a bug. Absent renders as a generic "your organization".
22862
22999
  organization: external_exports.string().min(1).optional(),
22863
23000
  // What the administrator pinned.
22864
- values: ManagedSettingsValues.default({}),
23001
+ //
23002
+ // Parsed as a RECORD rather than as the nested schema, and split below for
23003
+ // the same reason `lockedFields` is parsed as names: a plain `z.object`
23004
+ // drops an unrecognised key and succeeds, so a pin this build does not know
23005
+ // vanished and nothing anywhere said so. A pin with no lock is a supported
23006
+ // shape — it is a DEFAULT the user may still change — so that silence hit
23007
+ // exactly the file an administrator is most likely to write while a fleet
23008
+ // is mid-upgrade.
23009
+ //
23010
+ // Splitting here rather than calling `.strict()`: strict would REFUSE the
23011
+ // file, which is the outcome the lock half already rejected — an older
23012
+ // build then runs entirely unmanaged, every pin and lock gone. A bad KNOWN
23013
+ // value still fails, because the nested schema is re-run over the known
23014
+ // subset and its issues are re-raised on this parse.
23015
+ values: external_exports.record(external_exports.string(), external_exports.unknown()).default({}),
22865
23016
  // Which of those the user may not change. A key here with no matching value
22866
23017
  // freezes whatever the user last chose; a value with no lock is a DEFAULT
22867
23018
  // the user may still override. The two are separable on purpose.
@@ -22874,17 +23025,31 @@ var ManagedSettings = external_exports.object({
22874
23025
  // the fleets most likely to carry a version skew. A name outside the enum
22875
23026
  // is still never HONOURED: the lockable set stays explicit above.
22876
23027
  lockedFields: external_exports.array(external_exports.string()).default([])
22877
- }).transform(({ lockedFields, ...rest }) => {
23028
+ }).transform(({ lockedFields, values, ...rest }, ctx) => {
22878
23029
  const known = [];
22879
23030
  const unknown2 = [];
22880
23031
  for (const name of lockedFields) {
22881
23032
  if (isManagedSettingKey(name)) known.push(name);
22882
23033
  else unknown2.push(name);
22883
23034
  }
23035
+ const knownValues = /* @__PURE__ */ Object.create(null);
23036
+ const unknownValues = [];
23037
+ for (const [name, value] of Object.entries(values)) {
23038
+ if (Object.hasOwn(ManagedSettingsValues.shape, name)) knownValues[name] = value;
23039
+ else unknownValues.push(name);
23040
+ }
23041
+ const pinned = ManagedSettingsValues.safeParse(knownValues);
23042
+ if (!pinned.success) {
23043
+ for (const issue2 of pinned.error.issues)
23044
+ ctx.addIssue({ ...issue2, path: ["values", ...issue2.path] });
23045
+ return external_exports.NEVER;
23046
+ }
22884
23047
  return {
22885
23048
  ...rest,
23049
+ values: pinned.data,
22886
23050
  lockedFields: known,
22887
- ...unknown2.length > 0 ? { unknownLockedFields: unknown2 } : {}
23051
+ ...unknown2.length > 0 ? { unknownLockedFields: unknown2 } : {},
23052
+ ...unknownValues.length > 0 ? { unknownValueFields: unknownValues } : {}
22888
23053
  };
22889
23054
  }).meta({ id: "ManagedSettings" });
22890
23055
 
@@ -23142,7 +23307,23 @@ var SaveSettingsInput = external_exports.object({
23142
23307
  modelJudgeConsent: ModelJudgeConsentChoice,
23143
23308
  historySyncConsent: HistorySyncConsentChoice,
23144
23309
  vaultConsent: external_exports.string(),
23145
- vaultInlineReveal: external_exports.string()
23310
+ vaultInlineReveal: external_exports.string(),
23311
+ // Widened to `string` like its neighbours rather than typed as
23312
+ // `RedactFallback`, on this module's own layering rule: shape here, VALUE at
23313
+ // the call site, so the domain check receives the type it was written for.
23314
+ //
23315
+ // NOT because a narrower schema would reject differently. `parseActionInput`
23316
+ // is a `safeParse` wrapper and throws for no field schema, so either spelling
23317
+ // reaches a recoverable `{ ok: false }` and there is no rejected promise to
23318
+ // trade against. The real cost runs the other way and is the part worth
23319
+ // knowing: a value this schema admits and the domain enum then rejects lands
23320
+ // on the action's shared refusal, which names NO field, where a shape
23321
+ // rejection reaches `malformedInput` and names the schema key.
23322
+ redactFallback: external_exports.string(),
23323
+ // Shape only, the way the enum fields above are strings only: the RANGE is
23324
+ // `BodyRetention`'s and the action checks it there, so there is one place
23325
+ // that decides what a legal horizon is rather than two that can drift.
23326
+ bodyRetention: external_exports.object({ enabled: external_exports.boolean(), retainDays: external_exports.number() })
23146
23327
  });
23147
23328
  var AttachInput = external_exports.object({
23148
23329
  endpoint: external_exports.string(),
@@ -23268,6 +23449,52 @@ var SetupHandoffOffer = external_exports.object({
23268
23449
  path: ["liveKeys"]
23269
23450
  });
23270
23451
 
23452
+ // ../../packages/schema/src/zod/web-capture.ts
23453
+ var WebUsageSource = external_exports.enum(["site", "estimated", "none"]);
23454
+ var WebUsage = external_exports.object({
23455
+ inputTokens: external_exports.number().int().nonnegative().optional(),
23456
+ outputTokens: external_exports.number().int().nonnegative().optional(),
23457
+ cacheReadInputTokens: external_exports.number().int().nonnegative().optional(),
23458
+ cacheCreationInputTokens: external_exports.number().int().nonnegative().optional()
23459
+ });
23460
+ var WebToolCall = external_exports.object({
23461
+ toolUseId: external_exports.string().min(1),
23462
+ toolName: external_exports.string().min(1),
23463
+ target: external_exports.string().optional(),
23464
+ isError: external_exports.boolean().optional(),
23465
+ inputSize: external_exports.number().int().nonnegative().optional(),
23466
+ outputSize: external_exports.number().int().nonnegative().optional()
23467
+ });
23468
+ var WebExchange = external_exports.object({
23469
+ messageId: external_exports.string().min(1),
23470
+ startedAt: external_exports.iso.datetime(),
23471
+ model: external_exports.string().optional(),
23472
+ usage: WebUsage.optional(),
23473
+ usageSource: WebUsageSource,
23474
+ stopReason: external_exports.string().optional(),
23475
+ conversationId: external_exports.string().optional(),
23476
+ turnIndex: external_exports.number().int().nonnegative().optional(),
23477
+ toolCalls: external_exports.array(WebToolCall).default([]),
23478
+ // Absent when the adapter recovered no text. Capped by the caller at
23479
+ // RESPONSE_TEXT_MAX_BYTES; `truncated` records that the cap was reached, so a
23480
+ // short capture is never mistaken for a short reply.
23481
+ responseText: external_exports.string().optional(),
23482
+ truncated: external_exports.boolean().default(false)
23483
+ });
23484
+ var RESPONSE_TEXT_MAX_BYTES = 2 * 1024 * 1024;
23485
+ var WebCaptureStatus = external_exports.object({
23486
+ patched: external_exports.boolean(),
23487
+ live: external_exports.boolean(),
23488
+ blind: external_exports.boolean(),
23489
+ sendsSeenDom: external_exports.number().int().nonnegative(),
23490
+ exchangesSeenNet: external_exports.number().int().nonnegative(),
23491
+ parseFailures: external_exports.number().int().nonnegative(),
23492
+ unparsedBodies: external_exports.number().int().nonnegative(),
23493
+ // The adapter-declared JSON key paths that were absent from a real payload —
23494
+ // the earliest signal that a site's contract moved.
23495
+ shapeMisses: external_exports.array(external_exports.string()).default([])
23496
+ });
23497
+
23271
23498
  // ../../packages/persistence/src/paths.ts
23272
23499
  import {
23273
23500
  chmodSync,
@@ -23411,6 +23638,32 @@ var STALE_PARTIAL_MS = 5 * 6e4;
23411
23638
  var SNAPSHOT_STAGING_SUFFIX = ".partial";
23412
23639
  var STAGED_NAME_SUFFIX = `.bak${SNAPSHOT_STAGING_SUFFIX}`;
23413
23640
 
23641
+ // ../../packages/persistence/src/internal/sql-functions.ts
23642
+ var utf8 = new TextDecoder();
23643
+
23644
+ // ../../packages/persistence/src/internal/outbox-lane.ts
23645
+ var OUTBOX_CAPTURE_EVENT_TYPES = ["prompt", "response", "tool_use"];
23646
+ var OUTBOX_CAPTURE_TYPE_LIST = OUTBOX_CAPTURE_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
23647
+
23648
+ // ../../packages/persistence/src/sync-failure.ts
23649
+ var SYNC_FAILURE_REASONS = SyncFailureReason.options;
23650
+
23651
+ // ../../packages/persistence/src/repositories/history-sync.ts
23652
+ var STRUCTURAL_EVENT_TYPES = ["session", "llm_call", "tool_call"];
23653
+ var TYPE_LIST = STRUCTURAL_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
23654
+ var COUNTED_EVENT_TYPES = [
23655
+ ...STRUCTURAL_EVENT_TYPES,
23656
+ ...OUTBOX_CAPTURE_EVENT_TYPES
23657
+ ];
23658
+ var COUNTED_TYPE_LIST = COUNTED_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
23659
+ var COUNTED_SCOPE = `
23660
+ WHERE event_type IN (${COUNTED_TYPE_LIST})
23661
+ AND (
23662
+ event_type IN (${TYPE_LIST})
23663
+ OR synced_at IS NOT NULL
23664
+ OR outbox_owed = 1
23665
+ )`;
23666
+
23414
23667
  // ../../packages/persistence/src/internal/json.ts
23415
23668
  function parseJsonObject(s) {
23416
23669
  if (s == null) return void 0;
@@ -23475,13 +23728,10 @@ var FINDING_ROW_COLUMNS_SQL = `f.id AS id, d.rule_id AS rule_id, d.category AS c
23475
23728
  e.tool_name AS tool_name,
23476
23729
  f.audit_event_id AS event_id, e.root_session_id AS session_id,
23477
23730
  e.event_type AS kind, f.finding_key AS finding_key,
23478
- ${latestResolutionStatusSql("f")} AS latest_status`;
23479
-
23480
- // ../../packages/persistence/src/repositories/history-sync.ts
23481
- var STRUCTURAL_EVENT_TYPES = ["session", "llm_call", "tool_call"];
23482
- var TYPE_LIST = STRUCTURAL_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
23483
- var OUTBOX_CAPTURE_EVENT_TYPES = ["prompt", "response", "tool_use"];
23484
- var CAPTURE_TYPE_LIST = OUTBOX_CAPTURE_EVENT_TYPES.map((t) => `'${t}'`).join(", ");
23731
+ ${latestResolutionStatusSql("f")} AS latest_status,
23732
+ e.synced_at AS synced_at, e.sync_claimed_at AS sync_claimed_at,
23733
+ e.sync_failed_at AS sync_failed_at, e.sync_failure AS sync_failure,
23734
+ e.outbox_owed AS outbox_owed`;
23485
23735
 
23486
23736
  // ../../packages/persistence/src/repositories/installed-packs.ts
23487
23737
  import { createHash as createHash2, randomUUID as randomUUID4 } from "crypto";
@@ -23578,6 +23828,7 @@ function overlayManagedSettings(settings, managed, now = () => /* @__PURE__ */ n
23578
23828
  if (values.vaultInlineReveal !== void 0) merged.vaultInlineReveal = values.vaultInlineReveal;
23579
23829
  if (values.dataSharesInPlace !== void 0) merged.dataSharesInPlace = values.dataSharesInPlace;
23580
23830
  if (values.redactFallback !== void 0) merged.redactFallback = values.redactFallback;
23831
+ if (values.bodyRetention !== void 0) merged.bodyRetention = values.bodyRetention;
23581
23832
  if (values.vaultConsent !== void 0) {
23582
23833
  merged.vaultConsent = values.vaultConsent ? (
23583
23834
  // Keep an existing valid grant so its acknowledgedAt survives; mint one
@@ -23665,9 +23916,11 @@ import { randomUUID as randomUUID10 } from "crypto";
23665
23916
 
23666
23917
  // ../../packages/persistence/src/database.ts
23667
23918
  var CAPTURE_GRAIN = new Set(EventKind.options);
23919
+ var DEFERRED_TAGS = new Set(DEFERRED_MIGRATION_TAGS);
23668
23920
 
23669
23921
  // ../../packages/persistence/src/egress-wire.ts
23670
23922
  import { createHash as createHash3 } from "crypto";
23923
+ var SLASH = "/".charCodeAt(0);
23671
23924
 
23672
23925
  // ../../packages/persistence/src/finding-key.ts
23673
23926
  import { createHash as createHash4 } from "crypto";
@@ -23678,18 +23931,26 @@ import { existsSync as existsSync3, readFileSync as readFileSync6 } from "fs";
23678
23931
  import { join as join8 } from "path";
23679
23932
  import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
23680
23933
 
23934
+ // ../../packages/persistence/src/forward-health.ts
23935
+ import { readFileSync as readFileSync7 } from "fs";
23936
+ import { join as join9 } from "path";
23937
+
23681
23938
  // ../../packages/persistence/src/history-backfill.ts
23682
23939
  import { existsSync as existsSync4 } from "fs";
23683
- import { join as join9 } from "path";
23940
+ import { join as join10 } from "path";
23684
23941
 
23685
23942
  // ../../packages/persistence/src/history-preview.ts
23686
23943
  import { existsSync as existsSync5 } from "fs";
23687
- import { join as join10 } from "path";
23944
+ import { join as join11 } from "path";
23688
23945
  import { DatabaseSync as DatabaseSync3 } from "node:sqlite";
23689
23946
 
23947
+ // ../../packages/persistence/src/history-sync-state.ts
23948
+ import { readFileSync as readFileSync8 } from "fs";
23949
+ import { join as join12 } from "path";
23950
+
23690
23951
  // ../../packages/persistence/src/store-symlinks.ts
23691
23952
  import { existsSync as existsSync6, lstatSync as lstatSync3, readlinkSync, realpathSync, statSync as statSync4 } from "fs";
23692
- import { dirname as dirname3, join as join11, resolve } from "path";
23953
+ import { dirname as dirname3, join as join13, resolve } from "path";
23693
23954
 
23694
23955
  // ../../packages/persistence/src/vault/crypto.ts
23695
23956
  import {
@@ -23703,15 +23964,15 @@ import {
23703
23964
  // ../../packages/persistence/src/vault/key-provider.ts
23704
23965
  import { execFileSync } from "child_process";
23705
23966
  import { randomBytes as randomBytes2 } from "crypto";
23706
- import { chmodSync as chmodSync3, readFileSync as readFileSync7, renameSync as renameSync4, rmSync as rmSync6, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
23707
- import { join as join12 } from "path";
23967
+ import { chmodSync as chmodSync3, readFileSync as readFileSync9, renameSync as renameSync4, rmSync as rmSync6, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
23968
+ import { join as join14 } from "path";
23708
23969
 
23709
23970
  // ../../packages/persistence/src/vault/vault.ts
23710
23971
  import { randomBytes as randomBytes3, randomUUID as randomUUID12 } from "crypto";
23711
23972
 
23712
23973
  // ../../packages/persistence/src/warn-era-cap.ts
23713
23974
  import { existsSync as existsSync7, writeFileSync as writeFileSync4 } from "fs";
23714
- import { join as join13 } from "path";
23975
+ import { join as join15 } from "path";
23715
23976
 
23716
23977
  // ../../packages/remote/src/http.ts
23717
23978
  import { request as httpRequest } from "http";
@@ -23896,10 +24157,10 @@ function parsed(schema, body, route) {
23896
24157
  }
23897
24158
  function withoutTrailingSlashes(endpoint) {
23898
24159
  let end = endpoint.length;
23899
- while (end > 0 && endpoint.charCodeAt(end - 1) === SLASH) end -= 1;
24160
+ while (end > 0 && endpoint.charCodeAt(end - 1) === SLASH2) end -= 1;
23900
24161
  return endpoint.slice(0, end);
23901
24162
  }
23902
- var SLASH = "/".charCodeAt(0);
24163
+ var SLASH2 = "/".charCodeAt(0);
23903
24164
  function createRemoteClient(options) {
23904
24165
  const base = withoutTrailingSlashes(options.endpoint);
23905
24166
  const url2 = (route) => `${base}${route}`;
@@ -24139,18 +24400,17 @@ async function runCommandSync(deps) {
24139
24400
  }
24140
24401
 
24141
24402
  // ../../packages/plugin-runtime/src/attached/forward-drops.ts
24142
- import { readFileSync as readFileSync8 } from "fs";
24143
- import { join as join14 } from "path";
24403
+ import { readFileSync as readFileSync10 } from "fs";
24404
+ import { join as join16 } from "path";
24144
24405
 
24145
24406
  // ../../packages/plugin-runtime/src/attached/forward-policy.ts
24146
24407
  import { randomUUID as randomUUID15 } from "crypto";
24147
- import { readFileSync as readFileSync15 } from "fs";
24148
24408
  import { readFile, rename, writeFile } from "fs/promises";
24149
- import { join as join24 } from "path";
24409
+ import { join as join26 } from "path";
24150
24410
 
24151
24411
  // ../../packages/plugin-sdk/src/config.ts
24152
24412
  import { existsSync as existsSync8 } from "fs";
24153
- import { join as join15 } from "path";
24413
+ import { join as join17 } from "path";
24154
24414
 
24155
24415
  // ../../packages/plugin-sdk/src/provider-env.ts
24156
24416
  var booleanish = external_exports.string().optional().transform((v) => {
@@ -24171,9 +24431,9 @@ var providerEnvShape = {
24171
24431
  var ProviderEnvSchema = external_exports.object(providerEnvShape);
24172
24432
 
24173
24433
  // ../../packages/plugin-sdk/src/config-inventory.ts
24174
- import { readdirSync as readdirSync2, readFileSync as readFileSync10, realpathSync as realpathSync2, statSync as statSync7 } from "fs";
24434
+ import { readdirSync as readdirSync2, readFileSync as readFileSync12, realpathSync as realpathSync2, statSync as statSync7 } from "fs";
24175
24435
  import { homedir as homedir2 } from "os";
24176
- import { basename as basename3, join as join17 } from "path";
24436
+ import { basename as basename3, join as join19 } from "path";
24177
24437
 
24178
24438
  // ../../packages/detections/src/egress/registry.ts
24179
24439
  var EXTRACTOR_VERSION = "1";
@@ -24931,8 +25191,8 @@ var CPU_CORROBORATION_SHARE = 0.2;
24931
25191
  var CORROBORATION_FLOOR_MS = BUDGET_MS * CPU_CORROBORATION_SHARE;
24932
25192
 
24933
25193
  // ../../packages/plugin-sdk/src/repo.ts
24934
- import { existsSync as existsSync9, readFileSync as readFileSync9, statSync as statSync6 } from "fs";
24935
- import { basename as basename2, dirname as dirname4, isAbsolute, join as join16, sep as sep2 } from "path";
25194
+ import { existsSync as existsSync9, readFileSync as readFileSync11, statSync as statSync6 } from "fs";
25195
+ import { basename as basename2, dirname as dirname4, isAbsolute, join as join18, sep as sep2 } from "path";
24936
25196
 
24937
25197
  // ../../packages/plugin-sdk/src/events.ts
24938
25198
  import { createHash as createHash5, randomUUID as randomUUID13 } from "crypto";
@@ -24943,8 +25203,8 @@ import { fileURLToPath } from "url";
24943
25203
  import { Worker } from "worker_threads";
24944
25204
 
24945
25205
  // ../../packages/plugin-sdk/src/host-floor.ts
24946
- import { readFileSync as readFileSync12 } from "fs";
24947
- import { join as join19 } from "path";
25206
+ import { readFileSync as readFileSync14 } from "fs";
25207
+ import { join as join21 } from "path";
24948
25208
 
24949
25209
  // ../../packages/plugin-sdk/src/model-governance.ts
24950
25210
  import {
@@ -24952,11 +25212,11 @@ import {
24952
25212
  fstatSync,
24953
25213
  mkdirSync as mkdirSync2,
24954
25214
  openSync as openSync2,
24955
- readFileSync as readFileSync11,
25215
+ readFileSync as readFileSync13,
24956
25216
  readSync,
24957
25217
  writeFileSync as writeFileSync5
24958
25218
  } from "fs";
24959
- import { join as join18 } from "path";
25219
+ import { join as join20 } from "path";
24960
25220
  var TAIL_BYTES = 256 * 1024;
24961
25221
 
24962
25222
  // ../../packages/plugin-sdk/src/host-floor.ts
@@ -24979,15 +25239,15 @@ var HOST_FLOORS = {
24979
25239
 
24980
25240
  // ../../packages/plugin-sdk/src/ignore-layers.ts
24981
25241
  var import_ignore = __toESM(require_ignore(), 1);
24982
- import { readFileSync as readFileSync13 } from "fs";
24983
- import { join as join20 } from "path";
25242
+ import { readFileSync as readFileSync15 } from "fs";
25243
+ import { join as join22 } from "path";
24984
25244
 
24985
25245
  // ../../packages/plugin-sdk/src/inventory-resolver.ts
24986
25246
  import { arch, hostname as hostname4, platform, release } from "os";
24987
25247
 
24988
25248
  // ../../packages/plugin-sdk/src/nudge.ts
24989
- import { mkdirSync as mkdirSync3, readFileSync as readFileSync14, writeFileSync as writeFileSync6 } from "fs";
24990
- import { join as join21 } from "path";
25249
+ import { mkdirSync as mkdirSync3, readFileSync as readFileSync16, writeFileSync as writeFileSync6 } from "fs";
25250
+ import { join as join23 } from "path";
24991
25251
 
24992
25252
  // ../../packages/plugin-sdk/src/paths.ts
24993
25253
  import { readdirSync as readdirSync3, realpathSync as realpathSync3 } from "fs";
@@ -24995,7 +25255,7 @@ import { basename as basename4, dirname as dirname5, sep as sep3 } from "path";
24995
25255
 
24996
25256
  // ../../packages/plugin-sdk/src/project-files.ts
24997
25257
  import { existsSync as existsSync11, readdirSync as readdirSync4 } from "fs";
24998
- import { basename as basename5, join as join22 } from "path";
25258
+ import { basename as basename5, join as join24 } from "path";
24999
25259
 
25000
25260
  // ../../packages/plugin-sdk/src/provider-env-antigravity.ts
25001
25261
  var optionalBaseUrl2 = external_exports.preprocess((v) => {
@@ -25031,10 +25291,6 @@ var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
25031
25291
 
25032
25292
  // ../../packages/plugin-sdk/src/throttle.ts
25033
25293
  import { mkdirSync as mkdirSync4, statSync as statSync8, writeFileSync as writeFileSync7 } from "fs";
25034
- import { join as join23 } from "path";
25035
-
25036
- // ../../packages/plugin-runtime/src/attached/history-state.ts
25037
- import { readFileSync as readFileSync16 } from "fs";
25038
25294
  import { join as join25 } from "path";
25039
25295
 
25040
25296
  // ../../packages/plugin-runtime/src/attached/history-sync.ts
@@ -25045,6 +25301,10 @@ import { hostname as hostname5 } from "os";
25045
25301
  var CORRELATION_ID = EventMetadata.shape.correlationId;
25046
25302
  var TRACE_ID = EventMetadata.shape.traceId;
25047
25303
  var EXCEPTION_ID = EventMetadata.shape.exceptionIds.unwrap().element;
25304
+ var REDACT_DEGRADED_TO = EventMetadata.shape.redactDegradedTo.unwrap();
25305
+
25306
+ // ../../packages/plugin-runtime/src/attached/history-sync.ts
25307
+ var CAPTURE_BATCH_BYTES = 1024 * 1024;
25048
25308
 
25049
25309
  // ../../packages/plugin-runtime/src/attached/history-sync-trigger.ts
25050
25310
  import { spawn } from "child_process";
@@ -25057,7 +25317,7 @@ import { readFileSync as readFileSync17 } from "fs";
25057
25317
  // ../../packages/plugin-runtime/src/attached/policy-store.ts
25058
25318
  import { randomUUID as randomUUID16 } from "crypto";
25059
25319
  import { readFile as readFile2, rm, writeFile as writeFile2 } from "fs/promises";
25060
- import { join as join26 } from "path";
25320
+ import { join as join27 } from "path";
25061
25321
 
25062
25322
  // ../../packages/plugin-runtime/src/attached/atomic-publish.ts
25063
25323
  import { rename as rename2 } from "fs/promises";
@@ -25081,7 +25341,7 @@ async function publishByRename(tmp, file2, move = rename2) {
25081
25341
 
25082
25342
  // ../../packages/plugin-runtime/src/attached/policy-store.ts
25083
25343
  function createPolicyStore(dir = dataDir()) {
25084
- const file2 = join26(dir, "policy-cache.json");
25344
+ const file2 = join27(dir, "policy-cache.json");
25085
25345
  async function read() {
25086
25346
  try {
25087
25347
  const raw = await readFile2(file2, "utf8");
@@ -25209,14 +25469,14 @@ import { DatabaseSync as DatabaseSync4 } from "node:sqlite";
25209
25469
  // ../../packages/plugin-runtime/src/attached/posture-store.ts
25210
25470
  import { randomUUID as randomUUID17 } from "crypto";
25211
25471
  import { readFile as readFile3, rm as rm2, writeFile as writeFile3 } from "fs/promises";
25212
- import { join as join27 } from "path";
25472
+ import { join as join28 } from "path";
25213
25473
 
25214
25474
  // ../../packages/plugin-runtime/src/attached/sync-state.ts
25215
25475
  import { readFileSync as readFileSync18 } from "fs";
25216
- import { join as join28 } from "path";
25476
+ import { join as join29 } from "path";
25217
25477
  var SYNC_STATE_FILENAME = ATTACHED_SYNC_STATE_FILENAME;
25218
25478
  function syncStatePath(dataDir2) {
25219
- return join28(dataDir2, SYNC_STATE_FILENAME);
25479
+ return join29(dataDir2, SYNC_STATE_FILENAME);
25220
25480
  }
25221
25481
  function writeSyncState(dataDir2, result) {
25222
25482
  try {
@@ -25269,6 +25529,14 @@ import { spawn as spawn2 } from "child_process";
25269
25529
  import { fileURLToPath as fileURLToPath3 } from "url";
25270
25530
  var SYNC_THROTTLE_MS = 15 * 60 * 1e3;
25271
25531
 
25532
+ // ../../packages/plugin-runtime/src/content-retention-pass.ts
25533
+ var MAX_ROWS_PER_SWEEP = 50 * 1e3;
25534
+
25535
+ // ../../packages/plugin-runtime/src/content-retention-trigger.ts
25536
+ import { spawn as spawn3 } from "child_process";
25537
+ import { fileURLToPath as fileURLToPath4 } from "url";
25538
+ var CONTENT_RETENTION_THROTTLE_MS = 60 * 60 * 1e3;
25539
+
25272
25540
  // ../../packages/plugin-runtime/src/attached/factory.ts
25273
25541
  import { hostname as hostname6 } from "os";
25274
25542