@akasecurity/cli 0.9.12 → 0.9.13

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 (113) hide show
  1. package/dist/cli.js +553 -82
  2. package/extension/background.js +1 -1
  3. package/extension/bridge.js +1 -0
  4. package/extension/content.js +1 -1
  5. package/extension/manifest.json +24 -1
  6. package/extension/popup.html +9 -0
  7. package/extension/popup.js +1 -1
  8. package/extension/tap.js +1 -0
  9. package/native-host/host.js +919 -142
  10. package/native-host/scan-worker.js +209 -17
  11. package/native-host/sync.js +250 -32
  12. package/package.json +6 -6
  13. package/web-ui/web-ui/.next/BUILD_ID +1 -1
  14. package/web-ui/web-ui/.next/app-build-manifest.json +72 -72
  15. package/web-ui/web-ui/.next/app-path-routes-manifest.json +7 -7
  16. package/web-ui/web-ui/.next/build-manifest.json +2 -2
  17. package/web-ui/web-ui/.next/prerender-manifest.json +18 -18
  18. package/web-ui/web-ui/.next/server/app/(app)/activity/page.js +2 -2
  19. package/web-ui/web-ui/.next/server/app/(app)/activity/page.js.nft.json +1 -1
  20. package/web-ui/web-ui/.next/server/app/(app)/activity/page_client-reference-manifest.js +1 -1
  21. package/web-ui/web-ui/.next/server/app/(app)/data-shares/page.js +2 -2
  22. package/web-ui/web-ui/.next/server/app/(app)/data-shares/page.js.nft.json +1 -1
  23. package/web-ui/web-ui/.next/server/app/(app)/data-shares/page_client-reference-manifest.js +1 -1
  24. package/web-ui/web-ui/.next/server/app/(app)/detections/page.js +2 -2
  25. package/web-ui/web-ui/.next/server/app/(app)/detections/page.js.nft.json +1 -1
  26. package/web-ui/web-ui/.next/server/app/(app)/detections/page_client-reference-manifest.js +1 -1
  27. package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page.js +2 -2
  28. package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page.js.nft.json +1 -1
  29. package/web-ui/web-ui/.next/server/app/(app)/exceptions/[id]/page_client-reference-manifest.js +1 -1
  30. package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page.js +1 -1
  31. package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page.js.nft.json +1 -1
  32. package/web-ui/web-ui/.next/server/app/(app)/exceptions/new/page_client-reference-manifest.js +1 -1
  33. package/web-ui/web-ui/.next/server/app/(app)/exceptions/page.js +1 -1
  34. package/web-ui/web-ui/.next/server/app/(app)/exceptions/page.js.nft.json +1 -1
  35. package/web-ui/web-ui/.next/server/app/(app)/exceptions/page_client-reference-manifest.js +1 -1
  36. package/web-ui/web-ui/.next/server/app/(app)/findings/page.js +2 -2
  37. package/web-ui/web-ui/.next/server/app/(app)/findings/page.js.nft.json +1 -1
  38. package/web-ui/web-ui/.next/server/app/(app)/findings/page_client-reference-manifest.js +1 -1
  39. package/web-ui/web-ui/.next/server/app/(app)/inventory/page.js +2 -2
  40. package/web-ui/web-ui/.next/server/app/(app)/inventory/page.js.nft.json +1 -1
  41. package/web-ui/web-ui/.next/server/app/(app)/inventory/page_client-reference-manifest.js +1 -1
  42. package/web-ui/web-ui/.next/server/app/(app)/policies/page.js +2 -2
  43. package/web-ui/web-ui/.next/server/app/(app)/policies/page.js.nft.json +1 -1
  44. package/web-ui/web-ui/.next/server/app/(app)/policies/page_client-reference-manifest.js +1 -1
  45. package/web-ui/web-ui/.next/server/app/(app)/scan/page.js +3 -3
  46. package/web-ui/web-ui/.next/server/app/(app)/scan/page.js.nft.json +1 -1
  47. package/web-ui/web-ui/.next/server/app/(app)/scan/page_client-reference-manifest.js +1 -1
  48. package/web-ui/web-ui/.next/server/app/(app)/security/page.js +1 -1
  49. package/web-ui/web-ui/.next/server/app/(app)/security/page.js.nft.json +1 -1
  50. package/web-ui/web-ui/.next/server/app/(app)/security/page_client-reference-manifest.js +1 -1
  51. package/web-ui/web-ui/.next/server/app/(app)/settings/page.js +2 -2
  52. package/web-ui/web-ui/.next/server/app/(app)/settings/page.js.nft.json +1 -1
  53. package/web-ui/web-ui/.next/server/app/(app)/settings/page_client-reference-manifest.js +1 -1
  54. package/web-ui/web-ui/.next/server/app/(app)/updates/page.js +2 -2
  55. package/web-ui/web-ui/.next/server/app/(app)/updates/page.js.nft.json +1 -1
  56. package/web-ui/web-ui/.next/server/app/(app)/updates/page_client-reference-manifest.js +1 -1
  57. package/web-ui/web-ui/.next/server/app/(app)/vault/page.js +2 -2
  58. package/web-ui/web-ui/.next/server/app/(app)/vault/page.js.nft.json +1 -1
  59. package/web-ui/web-ui/.next/server/app/(app)/vault/page_client-reference-manifest.js +1 -1
  60. package/web-ui/web-ui/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  61. package/web-ui/web-ui/.next/server/app/_not-found.html +1 -1
  62. package/web-ui/web-ui/.next/server/app/_not-found.rsc +2 -2
  63. package/web-ui/web-ui/.next/server/app/index.html +1 -1
  64. package/web-ui/web-ui/.next/server/app/index.rsc +2 -2
  65. package/web-ui/web-ui/.next/server/app/page_client-reference-manifest.js +1 -1
  66. package/web-ui/web-ui/.next/server/app-paths-manifest.json +7 -7
  67. package/web-ui/web-ui/.next/server/chunks/121.js +1 -1
  68. package/web-ui/web-ui/.next/server/chunks/130.js +1026 -0
  69. package/web-ui/web-ui/.next/server/chunks/290.js +1 -1
  70. package/web-ui/web-ui/.next/server/chunks/3.js +1017 -0
  71. package/web-ui/web-ui/.next/server/chunks/300.js +1 -0
  72. package/web-ui/web-ui/.next/server/chunks/475.js +1 -1
  73. package/web-ui/web-ui/.next/server/chunks/662.js +1 -0
  74. package/web-ui/web-ui/.next/server/chunks/70.js +1 -0
  75. package/web-ui/web-ui/.next/server/functions-config-manifest.json +6 -6
  76. package/web-ui/web-ui/.next/server/middleware-manifest.json +5 -5
  77. package/web-ui/web-ui/.next/server/pages/404.html +1 -1
  78. package/web-ui/web-ui/.next/server/pages/500.html +1 -1
  79. package/web-ui/web-ui/.next/server/server-reference-manifest.js +1 -1
  80. package/web-ui/web-ui/.next/server/server-reference-manifest.json +1 -1
  81. package/web-ui/web-ui/.next/static/chunks/421-cc967c01935826d1.js +1 -0
  82. package/web-ui/web-ui/.next/static/chunks/app/(app)/activity/{page-a27c8937989448e4.js → page-41fba0354cc950be.js} +1 -1
  83. package/web-ui/web-ui/.next/static/chunks/app/(app)/data-shares/{page-2b805f9e1f995092.js → page-d2e03c3ab61af01a.js} +1 -1
  84. package/web-ui/web-ui/.next/static/chunks/app/(app)/detections/{page-a87cfee370c4e0f4.js → page-566036afcc87e4c9.js} +1 -1
  85. package/web-ui/web-ui/.next/static/chunks/app/(app)/{error-190085728a856072.js → error-4baae46bcee63009.js} +1 -1
  86. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/[id]/{page-4e214491c7be8d43.js → page-73dbcf0078b82ec4.js} +1 -1
  87. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/new/page-8051503193da1baf.js +1 -0
  88. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/{page-f16ba40d88e414b1.js → page-32c8a853bc8b5d34.js} +1 -1
  89. package/web-ui/web-ui/.next/static/chunks/app/(app)/findings/page-dc8fadb56d6d1e77.js +1 -0
  90. package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/page-9b49ef42350ea7bd.js +1 -0
  91. package/web-ui/web-ui/.next/static/chunks/app/(app)/{layout-cb3c8c7b6b33414c.js → layout-f5f361f817f90ac9.js} +1 -1
  92. package/web-ui/web-ui/.next/static/chunks/app/(app)/policies/{page-ab639e48f60ad7ee.js → page-01b303adf3c8ee56.js} +1 -1
  93. package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/page-8db3b62245c333a3.js +1 -0
  94. package/web-ui/web-ui/.next/static/chunks/app/(app)/security/{page-a3095119b3e87341.js → page-7a4ba61626e0d130.js} +1 -1
  95. package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/page-0930b49f6ab951bc.js +1 -0
  96. package/web-ui/web-ui/.next/static/chunks/app/(app)/updates/{page-5b32bd569c9569d9.js → page-9b04f3441a1a3f96.js} +1 -1
  97. package/web-ui/web-ui/.next/static/chunks/app/(app)/vault/page-911a76e75f5a1419.js +1 -0
  98. package/web-ui/web-ui/.next/static/css/298a651f6af38209.css +2 -0
  99. package/web-ui/web-ui/dist/scan-worker.js +209 -17
  100. package/web-ui/web-ui/.next/server/chunks/611.js +0 -1015
  101. package/web-ui/web-ui/.next/server/chunks/7.js +0 -1
  102. package/web-ui/web-ui/.next/server/chunks/816.js +0 -1
  103. package/web-ui/web-ui/.next/server/chunks/968.js +0 -1006
  104. package/web-ui/web-ui/.next/static/chunks/674-d8237c5d0faa4a53.js +0 -1
  105. package/web-ui/web-ui/.next/static/chunks/app/(app)/exceptions/new/page-c1bb992ee1f12566.js +0 -1
  106. package/web-ui/web-ui/.next/static/chunks/app/(app)/findings/page-59c76da638f22b0e.js +0 -1
  107. package/web-ui/web-ui/.next/static/chunks/app/(app)/inventory/page-c37447caf89a86e1.js +0 -1
  108. package/web-ui/web-ui/.next/static/chunks/app/(app)/scan/page-494614fccc8c62cc.js +0 -1
  109. package/web-ui/web-ui/.next/static/chunks/app/(app)/settings/page-469613d499e41093.js +0 -1
  110. package/web-ui/web-ui/.next/static/chunks/app/(app)/vault/page-3152ceb31f024b8d.js +0 -1
  111. package/web-ui/web-ui/.next/static/css/6e72259eccdf4435.css +0 -2
  112. /package/web-ui/web-ui/.next/static/{PMeePXfXsQ2xxrXppySG_ → pkVZ1_T311YNkJgZOLTx5}/_buildManifest.js +0 -0
  113. /package/web-ui/web-ui/.next/static/{PMeePXfXsQ2xxrXppySG_ → pkVZ1_T311YNkJgZOLTx5}/_ssgManifest.js +0 -0
@@ -20220,7 +20220,17 @@ var UNPRICEABLE_PROVIDERS = Object.freeze([
20220
20220
  "gateway",
20221
20221
  "unknown",
20222
20222
  "cli",
20223
- "api"
20223
+ "api",
20224
+ // The browser extension's native host records these as `llm_call.provider`
20225
+ // for a web-chat turn — the web tool id, deliberately never the vendor id
20226
+ // (`openai`/`anthropic`) the session root carries. Subscription traffic
20227
+ // burns rate-limit budget, not dollar credits, and listing them here is
20228
+ // what keeps that true structurally: a later maintainer who wants to price
20229
+ // web-chat traffic at API rates has to delete this entry first, and meet
20230
+ // the reason on the way, rather than quietly adding one to
20231
+ // PROVIDER_PLATFORM.
20232
+ "chatgpt",
20233
+ "claude-ai"
20224
20234
  ]);
20225
20235
 
20226
20236
  // ../../packages/schema/src/token/format.ts
@@ -20240,7 +20250,12 @@ var HARNESS = {
20240
20250
  ClaudeDesktop: "claudedesktop",
20241
20251
  ChatGpt: "chatgpt",
20242
20252
  ClaudeAi: "claudeai",
20243
- Api: "api"
20253
+ Api: "api",
20254
+ // Not a coding assistant a person drives — an in-process SDK embedded in an
20255
+ // application, so it has no IDE/CLI/desktop/web surface of its own. Carries
20256
+ // the same id as its SOURCE_TOOL counterpart, unlike every capture-side tool
20257
+ // whose wire spelling differs from its display spelling.
20258
+ AiTcSdk: "ai-tc-sdk"
20244
20259
  };
20245
20260
  var Harness = external_exports.enum(HARNESS).meta({ id: "Harness" });
20246
20261
  var SOURCE_TOOL = {
@@ -20256,9 +20271,15 @@ var SOURCE_TOOL = {
20256
20271
  // whose tool could not be identified both render through the read side's
20257
20272
  // miss path rather than as a harness of their own.
20258
20273
  Cli: "cli",
20259
- Unknown: "unknown"
20274
+ Unknown: "unknown",
20275
+ // The wire id an in-process, request-path SDK stamps on its own structural
20276
+ // rows (`request_decision`) — never a capture of prompt/response/tool text,
20277
+ // since the SDK sits in front of a model call rather than inside a coding
20278
+ // assistant's own hook contract.
20279
+ AiTcSdk: "ai-tc-sdk"
20260
20280
  };
20261
20281
  var SourceTool = external_exports.enum(SOURCE_TOOL).meta({ id: "SourceTool" });
20282
+ var WebSourceTool = SourceTool.extract(["ChatGpt", "ClaudeAi"]);
20262
20283
  var TOOL_TO_HARNESS = {
20263
20284
  [SOURCE_TOOL.ClaudeCode]: HARNESS.ClaudeCode,
20264
20285
  [SOURCE_TOOL.ClaudeDesktop]: HARNESS.ClaudeDesktop,
@@ -20267,7 +20288,12 @@ var TOOL_TO_HARNESS = {
20267
20288
  [SOURCE_TOOL.ChatGpt]: HARNESS.ChatGpt,
20268
20289
  [SOURCE_TOOL.Codex]: HARNESS.Codex,
20269
20290
  [SOURCE_TOOL.Antigravity]: HARNESS.Antigravity,
20270
- [SOURCE_TOOL.ClaudeAi]: HARNESS.ClaudeAi
20291
+ [SOURCE_TOOL.ClaudeAi]: HARNESS.ClaudeAi,
20292
+ // Wire and display id are the same string here, but the row still belongs:
20293
+ // both vocabularies carry the `AiTcSdk` member, and the join is exactly
20294
+ // their intersection — leaving a shared member out would read as an
20295
+ // uninstrumented tool on both surfaces, which this one is not.
20296
+ [SOURCE_TOOL.AiTcSdk]: HARNESS.AiTcSdk
20271
20297
  };
20272
20298
 
20273
20299
  // ../../packages/schema/src/zod/finding.ts
@@ -20301,7 +20327,8 @@ var FindingProvider = Harness.extract([
20301
20327
  "ClaudeAi",
20302
20328
  "Codex",
20303
20329
  "Antigravity",
20304
- "Api"
20330
+ "Api",
20331
+ "AiTcSdk"
20305
20332
  ]).meta({ id: "FindingProvider" });
20306
20333
  var FindingCategory = external_exports.enum([
20307
20334
  "secret",
@@ -20675,18 +20702,41 @@ var AuditEventType = external_exports.enum([
20675
20702
  // 'tool_call' is the reconciler's structural row for every call, while
20676
20703
  // 'tool_use' exists only where a hook enforced against the arguments.
20677
20704
  "tool_use",
20678
- // One row per model REFUSAL: a switch onto a prohibited model that was
20679
- // denied, or a turn refused because the session was already running on one.
20680
- // A structural row like the ones above rather than a capture — it carries
20681
- // the model that was refused and nothing the user typed, because what is
20682
- // worth recording about a governance decision is the decision, and prompt
20683
- // text is the thing this product exists to keep from travelling.
20705
+ // One row per model REFUSAL, across all four seams a prohibited model can be
20706
+ // stopped at: a switch onto it, a turn already running on it, a subagent
20707
+ // spawn asking for it, or a request-path refusal an embedded request-path
20708
+ // SDK makes in-process before the call leaves the application. Which seam
20709
+ // rides `attributes.refusal_seam`, never this member name. A structural row
20710
+ // like the ones above rather than a capture — it carries the model that was
20711
+ // refused and nothing the user typed, because what is worth recording about
20712
+ // a governance decision is the decision, and prompt text is the thing this
20713
+ // product exists to keep from travelling.
20684
20714
  "model_refusal",
20715
+ // One row per request-path DECISION: a policy check an embedded request-path
20716
+ // SDK performs in-process before a model call leaves the application, or
20717
+ // against that call's non-streamed response. A structural row like
20718
+ // 'model_refusal' rather than a capture — content-free in the same way:
20719
+ // which side, which seam, what action and which field are decided rides
20720
+ // `attributes`, never this member name, and the matched text itself never
20721
+ // travels.
20722
+ //
20723
+ // A prohibited-model refusal on the request path is deliberately NOT this
20724
+ // member: it stays 'model_refusal' with `refusal_seam: 'request'`, so it
20725
+ // shares one bucket with the plugin's switch/turn/spawn refusals rather
20726
+ // than splitting one governance concept across two event types. This
20727
+ // member carries every OTHER request-path decision.
20728
+ "request_decision",
20685
20729
  // One row per config-inventory scan, hung off the session root. It is the
20686
20730
  // fact the posture inspection findings reference (findings require an
20687
20731
  // audit_event_id), and its started_at is the "scanned Nm ago" the read
20688
20732
  // surface renders.
20689
- "config_scan"
20733
+ "config_scan",
20734
+ // One row per reported browser-extension capture status, hung off the web
20735
+ // session root. The durable home of what one tab's network interception
20736
+ // is doing — a write-through of the native host's in-memory tracker, so a
20737
+ // second process (aka extension status) and a restarted host both have
20738
+ // somewhere to read it back from.
20739
+ "capture_status"
20690
20740
  ]).meta({ id: "AuditEventType" });
20691
20741
  var AttributeBag = external_exports.record(external_exports.string(), external_exports.unknown());
20692
20742
  var HostAttributes = external_exports.object({
@@ -20846,6 +20896,20 @@ var CaptureAttributes = external_exports.object({
20846
20896
  // repeated rather than referenced because a store reader opens this file.
20847
20897
  redact_degraded_to: ActionTaken.optional()
20848
20898
  }).catchall(external_exports.unknown());
20899
+ var CaptureStatusAttributes = external_exports.object({
20900
+ source_tool: external_exports.string().optional(),
20901
+ patched: external_exports.boolean().optional(),
20902
+ live: external_exports.boolean().optional(),
20903
+ blind: external_exports.boolean().optional(),
20904
+ sends_seen_dom: external_exports.number().int().nonnegative().optional(),
20905
+ exchanges_seen_net: external_exports.number().int().nonnegative().optional(),
20906
+ parse_failures: external_exports.number().int().nonnegative().optional(),
20907
+ unparsed_bodies: external_exports.number().int().nonnegative().optional(),
20908
+ shape_misses: external_exports.array(external_exports.string()).optional(),
20909
+ conversation_endpoints: external_exports.number().int().nonnegative().optional(),
20910
+ closed: external_exports.boolean().optional(),
20911
+ enforcement: external_exports.string().optional()
20912
+ }).catchall(external_exports.unknown());
20849
20913
  var ToolCallInspection = external_exports.object({
20850
20914
  ruleId: external_exports.string().min(1),
20851
20915
  ruleName: external_exports.string(),
@@ -21702,6 +21766,30 @@ var AttachedCredential = external_exports.object({
21702
21766
  keyPrefix: external_exports.string().min(1).max(16).optional(),
21703
21767
  mintedAt: external_exports.iso.datetime().optional()
21704
21768
  });
21769
+ var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
21770
+ function unsafeEndpointReason(endpoint) {
21771
+ let parsed2;
21772
+ try {
21773
+ parsed2 = new URL(endpoint);
21774
+ } catch {
21775
+ return "unparseable";
21776
+ }
21777
+ if (parsed2.username !== "" || parsed2.password !== "") return "userinfo";
21778
+ if (parsed2.search !== "" || parsed2.hash !== "") return "query-or-fragment";
21779
+ if (parsed2.protocol === "https:") return null;
21780
+ return parsed2.protocol === "http:" && LOOPBACK_HOSTS.has(parsed2.hostname) ? null : "insecure";
21781
+ }
21782
+ function isSafeEndpoint(endpoint) {
21783
+ return unsafeEndpointReason(endpoint) === null;
21784
+ }
21785
+ function originOnly(endpoint) {
21786
+ try {
21787
+ const parsed2 = new URL(endpoint);
21788
+ return `${parsed2.protocol}//${parsed2.host}`;
21789
+ } catch {
21790
+ return "(unparseable endpoint)";
21791
+ }
21792
+ }
21705
21793
  var MAX_DATE_MS = 253402300799999;
21706
21794
  var MAX_INT4 = 2147483647;
21707
21795
  var StorePosturePack = external_exports.object({
@@ -21856,6 +21944,11 @@ var RemoteFailureKind = external_exports.enum([
21856
21944
  "rejected",
21857
21945
  "unreachable"
21858
21946
  ]);
21947
+ var ControlPlaneFailure = RemoteFailureKind.extract([
21948
+ "unauthorized",
21949
+ "forbidden",
21950
+ "unreachable"
21951
+ ]);
21859
21952
  var AttachDeviceRequest = external_exports.object({
21860
21953
  // This machine's own continuity id, so re-attaching ROTATES the credential
21861
21954
  // on one machine record instead of producing a second one. Client-minted
@@ -22278,7 +22371,12 @@ var EventMetadata = external_exports.object({
22278
22371
  // in — set by the browser extension's network capture so a stored `response`
22279
22372
  // row can be joined to the `llm_call` leaf describing the same turn. Absent
22280
22373
  // on every other capture path, which has no such id.
22281
- messageId: external_exports.string().optional(),
22374
+ //
22375
+ // Non-empty for the reason WebExchange.messageId is: it is the join key, and
22376
+ // a blank one matches no `llm_call` leaf. That refusal reaches only the
22377
+ // places an event is PARSED; the local write path types the event and parses
22378
+ // nothing, which is why `toCaptureAttributes` omits a blank one separately.
22379
+ messageId: external_exports.string().min(1).optional(),
22282
22380
  conversationId: external_exports.string().optional(),
22283
22381
  // How long THIS capture's inspection blocked its caller, in whole
22284
22382
  // milliseconds — the plugin's own added latency, NOT the LLM call it sat in
@@ -22880,6 +22978,18 @@ var HistorySyncConsent = external_exports.object({
22880
22978
  payloadVersion: external_exports.number().int().positive(),
22881
22979
  endpoint: external_exports.string()
22882
22980
  });
22981
+ var WebChatCaptureConsent = external_exports.object({
22982
+ acknowledgedAt: external_exports.iso.datetime(),
22983
+ version: external_exports.number().int().positive()
22984
+ });
22985
+ var WebChatResponseCapture = external_exports.enum(["with-findings", "always", "never"]);
22986
+ var WebChatCapture = external_exports.object({
22987
+ responses: WebChatResponseCapture.default("with-findings"),
22988
+ account: external_exports.boolean().default(false),
22989
+ // Absent until granted. Presence alone does not authorize anything — see
22990
+ // isWebChatCaptureConsentValid.
22991
+ consent: WebChatCaptureConsent.optional()
22992
+ });
22883
22993
  var BODY_RETENTION_DEFAULT_DAYS = 30;
22884
22994
  var BodyRetention = external_exports.object({
22885
22995
  enabled: external_exports.boolean().default(false),
@@ -22938,6 +23048,16 @@ var WorkspaceSettings = external_exports.object({
22938
23048
  // both widenings. Absent until granted, and a grant for a different endpoint
22939
23049
  // or an older payload no longer counts.
22940
23050
  historySyncConsent: HistorySyncConsent.optional(),
23051
+ // What the browser extension may record from a web chat, and the grant that
23052
+ // authorizes it. Absent until the user answers: recording something that was
23053
+ // never recorded before is never an assumed grant on upgrade, so the whole
23054
+ // block is optional rather than defaulted in. What an absent block means is
23055
+ // webChatCaptureOf's answer, in one place.
23056
+ //
23057
+ // Enforcement is NOT gated on this. A machine that has never answered still
23058
+ // blocks, redacts and warns on what a user sends; the grant covers what is
23059
+ // written down.
23060
+ webChatCapture: WebChatCapture.optional(),
22941
23061
  // Local body expiry (see BodyRetention). Off until switched on; expiring a
22942
23062
  // body never removes the row or its findings.
22943
23063
  bodyRetention: BodyRetention.default({
@@ -23302,12 +23422,14 @@ var RecommendedActionIdParam = external_exports.object({ id: external_exports.st
23302
23422
  // ../../packages/schema/src/zod/settings-action.ts
23303
23423
  var HistorySyncConsentChoice = external_exports.enum(["granted", "revoked", "unchanged"]).meta({ id: "HistorySyncConsentChoice" });
23304
23424
  var ModelJudgeConsentChoice = external_exports.enum(["granted", "revoked", "unchanged"]).meta({ id: "ModelJudgeConsentChoice" });
23425
+ var WebChatCaptureConsentChoice = external_exports.enum(["granted", "revoked", "unchanged"]).meta({ id: "WebChatCaptureConsentChoice" });
23305
23426
  var SaveSettingsInput = external_exports.object({
23306
23427
  historicalAccess: external_exports.string(),
23307
23428
  modelJudgeConsent: ModelJudgeConsentChoice,
23308
23429
  historySyncConsent: HistorySyncConsentChoice,
23309
23430
  vaultConsent: external_exports.string(),
23310
23431
  vaultInlineReveal: external_exports.string(),
23432
+ webChatCaptureConsent: WebChatCaptureConsentChoice,
23311
23433
  // Widened to `string` like its neighbours rather than typed as
23312
23434
  // `RedactFallback`, on this module's own layering rule: shape here, VALUE at
23313
23435
  // the call site, so the domain check receives the type it was written for.
@@ -23476,11 +23598,24 @@ var WebExchange = external_exports.object({
23476
23598
  turnIndex: external_exports.number().int().nonnegative().optional(),
23477
23599
  toolCalls: external_exports.array(WebToolCall).default([]),
23478
23600
  // 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.
23601
+ // RESPONSE_TEXT_MAX_BYTES, so a short capture is never mistaken for a short
23602
+ // reply.
23481
23603
  responseText: external_exports.string().optional(),
23604
+ // The stored text is short of the reply. It does NOT say which of the two
23605
+ // ceilings on this path cut it: the caller applies its own cap on the raw
23606
+ // bytes it reads off the wire, which can be reached by a stream whose
23607
+ // recovered text stays well under RESPONSE_TEXT_MAX_BYTES, and applies that
23608
+ // one to the text. A reader cannot tell them apart, and nothing downstream
23609
+ // should branch as though it could.
23482
23610
  truncated: external_exports.boolean().default(false)
23483
23611
  });
23612
+ var WebEnforcementState = external_exports.enum([
23613
+ "watching",
23614
+ "composer-only",
23615
+ "button-only",
23616
+ "unattached",
23617
+ "unknown"
23618
+ ]);
23484
23619
  var RESPONSE_TEXT_MAX_BYTES = 2 * 1024 * 1024;
23485
23620
  var WebCaptureStatus = external_exports.object({
23486
23621
  patched: external_exports.boolean(),
@@ -23492,8 +23627,39 @@ var WebCaptureStatus = external_exports.object({
23492
23627
  unparsedBodies: external_exports.number().int().nonnegative(),
23493
23628
  // The adapter-declared JSON key paths that were absent from a real payload —
23494
23629
  // the earliest signal that a site's contract moved.
23495
- shapeMisses: external_exports.array(external_exports.string()).default([])
23496
- });
23630
+ shapeMisses: external_exports.array(external_exports.string()).default([]),
23631
+ // How many `kind: 'conversation'` endpoints the reporting tab's adapter
23632
+ // compiled. Zero means this build declares none for the site, so observing
23633
+ // nothing is the design rather than a fault — the one fact that separates a
23634
+ // site nobody has surveyed yet from one whose contract moved. Defaulted so a
23635
+ // build predating the field is read as declaring nothing rather than refused.
23636
+ conversationEndpoints: external_exports.number().int().nonnegative().default(0),
23637
+ // The document that sent this report is going away. The bridge sets it on
23638
+ // its `pagehide` report and nowhere else.
23639
+ //
23640
+ // A property of the REPORT rather than of capture health, which is why
23641
+ // nothing in `deriveWebCaptureState` reads it and why it stays out of the
23642
+ // bridge's own report signature — a closing tab's last word must not be
23643
+ // suppressed for carrying the same health as the report before it. What
23644
+ // reads it is the per-site fold: a document that said it was unloading stops
23645
+ // voting on the site's state, so the reload the `blind` remediation asks for
23646
+ // can actually clear the verdict it was shown. A document that dies without
23647
+ // sending one is covered by CAPTURE_STATUS_DOCUMENT_QUIET_MS instead.
23648
+ //
23649
+ // Defaulted so a build predating the field reads as a document that never
23650
+ // said it was closing — which keeps it voting, the same as every report that
23651
+ // is not a final one.
23652
+ closed: external_exports.boolean().default(false),
23653
+ // What the DOM enforcement path is doing, which none of the counters above
23654
+ // can say: `sendsSeenDom` rises only once a send has COMPLETED, so a tab
23655
+ // whose watcher never bound reports zero exactly like a tab nobody typed in.
23656
+ // Defaulted to 'unknown' rather than 'watching' so a status from a build
23657
+ // predating the field is not read as reporting a healthy one.
23658
+ enforcement: WebEnforcementState.default("unknown")
23659
+ });
23660
+ var CAPTURE_STATUS_RECENCY_MS = 30 * 24 * 60 * 60 * 1e3;
23661
+ var CAPTURE_STATUS_RECENCY_DAYS = CAPTURE_STATUS_RECENCY_MS / (24 * 60 * 60 * 1e3);
23662
+ var CAPTURE_STATUS_DOCUMENT_QUIET_MS = 12 * 60 * 60 * 1e3;
23497
23663
 
23498
23664
  // ../../packages/persistence/src/paths.ts
23499
23665
  import {
@@ -23560,17 +23726,6 @@ function writeOwnerOnlyFileSync(file2, data) {
23560
23726
  function controlPlaneCredentialPath(settingsDir2) {
23561
23727
  return join2(settingsDir2, ATTACHED_CREDENTIAL_FILENAME);
23562
23728
  }
23563
- var LOOPBACK_HOSTS = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "::1", "[::1]"]);
23564
- function isSafeEndpoint(endpoint) {
23565
- let parsed2;
23566
- try {
23567
- parsed2 = new URL(endpoint);
23568
- } catch {
23569
- return false;
23570
- }
23571
- if (parsed2.protocol === "https:") return true;
23572
- return parsed2.protocol === "http:" && LOOPBACK_HOSTS.has(parsed2.hostname);
23573
- }
23574
23729
  function repairOrRefuseMode(file2) {
23575
23730
  const link = lstatSync2(file2, { throwIfNoEntry: false });
23576
23731
  if (link === void 0) return "absent";
@@ -24003,6 +24158,12 @@ var RemoteRequestInvalid = class extends Error {
24003
24158
  }
24004
24159
  cause;
24005
24160
  };
24161
+ var RemoteEndpointRefused = class extends Error {
24162
+ constructor(endpoint) {
24163
+ super(`refusing to talk to an unsafe control-plane endpoint: ${originOnly(endpoint)}`);
24164
+ this.name = "RemoteEndpointRefused";
24165
+ }
24166
+ };
24006
24167
  var RemoteResponseInvalid = class extends Error {
24007
24168
  constructor(route, detail) {
24008
24169
  super(`control plane answered ${route} with ${detail}`);
@@ -24155,14 +24316,15 @@ function parsed(schema, body, route) {
24155
24316
  }
24156
24317
  return result.data;
24157
24318
  }
24158
- function withoutTrailingSlashes(endpoint) {
24319
+ function resolveBaseUrl(endpoint) {
24320
+ if (!isSafeEndpoint(endpoint)) throw new RemoteEndpointRefused(endpoint);
24159
24321
  let end = endpoint.length;
24160
24322
  while (end > 0 && endpoint.charCodeAt(end - 1) === SLASH2) end -= 1;
24161
24323
  return endpoint.slice(0, end);
24162
24324
  }
24163
24325
  var SLASH2 = "/".charCodeAt(0);
24164
24326
  function createRemoteClient(options) {
24165
- const base = withoutTrailingSlashes(options.endpoint);
24327
+ const base = resolveBaseUrl(options.endpoint);
24166
24328
  const url2 = (route) => `${base}${route}`;
24167
24329
  const common = { apiKey: options.apiKey, timeoutMs: options.timeoutMs };
24168
24330
  const sendOne = async (event) => {
@@ -24292,6 +24454,7 @@ function classifyRemoteFailure(err) {
24292
24454
  case "RemoteRouteAbsent":
24293
24455
  return "route-absent";
24294
24456
  case "RemoteRequestInvalid":
24457
+ case "RemoteEndpointRefused":
24295
24458
  return "invalid-request";
24296
24459
  case "RemoteResponseInvalid":
24297
24460
  return "rejected";
@@ -25162,6 +25325,56 @@ var CONFIG_POSTURE_RULES = [
25162
25325
  }
25163
25326
  ];
25164
25327
 
25328
+ // ../../packages/detections/src/posture/web-capture-posture.ts
25329
+ var RULE_VERSION2 = "1";
25330
+ var DRIFT_MIN_PARSE_FAILURES = 2;
25331
+ var WEB_CAPTURE_DRIFT_STATES = /* @__PURE__ */ new Set([
25332
+ "blind",
25333
+ "degraded"
25334
+ ]);
25335
+ var WEB_CAPTURE_DRIFT_RULE = {
25336
+ ruleId: "web-capture-drift",
25337
+ version: RULE_VERSION2,
25338
+ name: "Web chat capture is not reading the site",
25339
+ category: "config",
25340
+ severity: "medium",
25341
+ definition: JSON.stringify({
25342
+ kind: "web-capture-drift",
25343
+ states: [...WEB_CAPTURE_DRIFT_STATES],
25344
+ minParseFailures: DRIFT_MIN_PARSE_FAILURES
25345
+ })
25346
+ };
25347
+ var STATIC_COPY = {
25348
+ active: { headline: "turns are being observed on this site" },
25349
+ unreported: {
25350
+ // Says "recently" rather than "yet": the store read is bounded to
25351
+ // CAPTURE_STATUS_RECENCY_MS, so this state covers a site nothing has ever
25352
+ // reported for AND one whose last report has aged out. The two are the
25353
+ // same fact to a reader — nobody has confirmed anything lately — and the
25354
+ // copy may not claim the stronger of them.
25355
+ headline: `no report in the last ${String(CAPTURE_STATUS_RECENCY_DAYS)} days \u2014 open the site in Chrome with the extension loaded`
25356
+ },
25357
+ standby: {
25358
+ headline: "this build declares no endpoints for the site, so nothing is observed yet"
25359
+ },
25360
+ unpatched: {
25361
+ // Says what the flags say and no more. `patched` is false both for a tap
25362
+ // that installed and hooked neither transport and for one that never ran
25363
+ // at all — a page reports the same status either way, so the copy may not
25364
+ // assert one of them.
25365
+ headline: "the page tap captured neither fetch nor XHR \u2014 it may not have installed; reload the extension at chrome://extensions"
25366
+ },
25367
+ idle: { headline: "watching; no turn has been observed yet" },
25368
+ blind: {
25369
+ headline: "messages were sent in the page that the network capture never saw",
25370
+ remediation: "reload the tab. If it persists after `aka update` and reloading the extension at chrome://extensions, the site's send path has changed and needs a new extension build."
25371
+ },
25372
+ degraded: {
25373
+ headline: "the site's payloads no longer carry the fields the extension reads",
25374
+ remediation: "run `aka update`, then reload the extension at chrome://extensions. If it stays degraded after an update, the site's contract has changed and needs a new extension build."
25375
+ }
25376
+ };
25377
+
25165
25378
  // ../../packages/detections/src/security/redos-probe.ts
25166
25379
  var BUDGET_MS = 100;
25167
25380
  var EXPONENTIAL_UNITS = [
@@ -25322,10 +25535,15 @@ import { join as join27 } from "path";
25322
25535
  // ../../packages/plugin-runtime/src/attached/atomic-publish.ts
25323
25536
  import { rename as rename2 } from "fs/promises";
25324
25537
  var RETRYABLE = /* @__PURE__ */ new Set(["EPERM", "EACCES", "EBUSY"]);
25325
- var ATTEMPTS = 5;
25538
+ var IMMEDIATE_RETRIES = 8;
25539
+ var TIMED_RETRIES = 4;
25540
+ var ATTEMPTS = 1 + IMMEDIATE_RETRIES + TIMED_RETRIES;
25326
25541
  var delay = (ms) => new Promise((resolve2) => {
25327
25542
  setTimeout(resolve2, ms);
25328
25543
  });
25544
+ var yieldToLoop = () => new Promise((resolve2) => {
25545
+ setImmediate(resolve2);
25546
+ });
25329
25547
  async function publishByRename(tmp, file2, move = rename2) {
25330
25548
  for (let attempt = 1; ; attempt += 1) {
25331
25549
  try {
@@ -25334,7 +25552,7 @@ async function publishByRename(tmp, file2, move = rename2) {
25334
25552
  } catch (err) {
25335
25553
  const code = err.code;
25336
25554
  if (attempt >= ATTEMPTS || code === void 0 || !RETRYABLE.has(code)) throw err;
25337
- await delay(attempt * 10);
25555
+ await (attempt <= IMMEDIATE_RETRIES ? yieldToLoop() : delay((attempt - IMMEDIATE_RETRIES) * 10));
25338
25556
  }
25339
25557
  }
25340
25558
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akasecurity/cli",
3
- "version": "0.9.12",
3
+ "version": "0.9.13",
4
4
  "description": "AI Traffic Control — local-first CLI to inspect and govern AI agent traffic on your machine",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -45,15 +45,15 @@
45
45
  "vitest": "^4.1.11",
46
46
  "@akasecurity/dashboard-ui": "0.8.0",
47
47
  "@akasecurity/detections": "0.8.0",
48
- "@akasecurity/eslint-config": "0.8.0",
49
48
  "@akasecurity/local-ops": "0.8.0",
50
- "@akasecurity/plugin-browser-extension": "0.9.4",
51
- "@akasecurity/plugin-runtime": "0.8.0",
52
- "@akasecurity/remote": "0.9.7",
53
49
  "@akasecurity/persistence": "0.8.0",
50
+ "@akasecurity/plugin-browser-extension": "0.9.4",
51
+ "@akasecurity/eslint-config": "0.8.0",
52
+ "@akasecurity/plugin-sdk": "0.8.0",
54
53
  "@akasecurity/schema": "0.8.0",
54
+ "@akasecurity/plugin-runtime": "0.8.0",
55
55
  "@akasecurity/web-ui": "0.8.0",
56
- "@akasecurity/plugin-sdk": "0.8.0"
56
+ "@akasecurity/remote": "0.9.7"
57
57
  },
58
58
  "scripts": {
59
59
  "dev": "tsx src/cli.ts",
@@ -1 +1 @@
1
- PMeePXfXsQ2xxrXppySG_
1
+ pkVZ1_T311YNkJgZOLTx5