@akasecurity/ai-tc-antigravity 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.
package/scripts/intro.js CHANGED
@@ -20279,7 +20279,17 @@ var UNPRICEABLE_PROVIDERS = Object.freeze([
20279
20279
  "gateway",
20280
20280
  "unknown",
20281
20281
  "cli",
20282
- "api"
20282
+ "api",
20283
+ // The browser extension's native host records these as `llm_call.provider`
20284
+ // for a web-chat turn — the web tool id, deliberately never the vendor id
20285
+ // (`openai`/`anthropic`) the session root carries. Subscription traffic
20286
+ // burns rate-limit budget, not dollar credits, and listing them here is
20287
+ // what keeps that true structurally: a later maintainer who wants to price
20288
+ // web-chat traffic at API rates has to delete this entry first, and meet
20289
+ // the reason on the way, rather than quietly adding one to
20290
+ // PROVIDER_PLATFORM.
20291
+ "chatgpt",
20292
+ "claude-ai"
20283
20293
  ]);
20284
20294
 
20285
20295
  // ../../packages/schema/src/token/format.ts
@@ -20299,7 +20309,12 @@ var HARNESS = {
20299
20309
  ClaudeDesktop: "claudedesktop",
20300
20310
  ChatGpt: "chatgpt",
20301
20311
  ClaudeAi: "claudeai",
20302
- Api: "api"
20312
+ Api: "api",
20313
+ // Not a coding assistant a person drives — an in-process SDK embedded in an
20314
+ // application, so it has no IDE/CLI/desktop/web surface of its own. Carries
20315
+ // the same id as its SOURCE_TOOL counterpart, unlike every capture-side tool
20316
+ // whose wire spelling differs from its display spelling.
20317
+ AiTcSdk: "ai-tc-sdk"
20303
20318
  };
20304
20319
  var Harness = external_exports.enum(HARNESS).meta({ id: "Harness" });
20305
20320
  var SOURCE_TOOL = {
@@ -20315,9 +20330,15 @@ var SOURCE_TOOL = {
20315
20330
  // whose tool could not be identified both render through the read side's
20316
20331
  // miss path rather than as a harness of their own.
20317
20332
  Cli: "cli",
20318
- Unknown: "unknown"
20333
+ Unknown: "unknown",
20334
+ // The wire id an in-process, request-path SDK stamps on its own structural
20335
+ // rows (`request_decision`) — never a capture of prompt/response/tool text,
20336
+ // since the SDK sits in front of a model call rather than inside a coding
20337
+ // assistant's own hook contract.
20338
+ AiTcSdk: "ai-tc-sdk"
20319
20339
  };
20320
20340
  var SourceTool = external_exports.enum(SOURCE_TOOL).meta({ id: "SourceTool" });
20341
+ var WebSourceTool = SourceTool.extract(["ChatGpt", "ClaudeAi"]);
20321
20342
  var TOOL_TO_HARNESS = {
20322
20343
  [SOURCE_TOOL.ClaudeCode]: HARNESS.ClaudeCode,
20323
20344
  [SOURCE_TOOL.ClaudeDesktop]: HARNESS.ClaudeDesktop,
@@ -20326,7 +20347,12 @@ var TOOL_TO_HARNESS = {
20326
20347
  [SOURCE_TOOL.ChatGpt]: HARNESS.ChatGpt,
20327
20348
  [SOURCE_TOOL.Codex]: HARNESS.Codex,
20328
20349
  [SOURCE_TOOL.Antigravity]: HARNESS.Antigravity,
20329
- [SOURCE_TOOL.ClaudeAi]: HARNESS.ClaudeAi
20350
+ [SOURCE_TOOL.ClaudeAi]: HARNESS.ClaudeAi,
20351
+ // Wire and display id are the same string here, but the row still belongs:
20352
+ // both vocabularies carry the `AiTcSdk` member, and the join is exactly
20353
+ // their intersection — leaving a shared member out would read as an
20354
+ // uninstrumented tool on both surfaces, which this one is not.
20355
+ [SOURCE_TOOL.AiTcSdk]: HARNESS.AiTcSdk
20330
20356
  };
20331
20357
 
20332
20358
  // ../../packages/schema/src/zod/finding.ts
@@ -20360,7 +20386,8 @@ var FindingProvider = Harness.extract([
20360
20386
  "ClaudeAi",
20361
20387
  "Codex",
20362
20388
  "Antigravity",
20363
- "Api"
20389
+ "Api",
20390
+ "AiTcSdk"
20364
20391
  ]).meta({ id: "FindingProvider" });
20365
20392
  var FindingCategory = external_exports.enum([
20366
20393
  "secret",
@@ -20734,18 +20761,41 @@ var AuditEventType = external_exports.enum([
20734
20761
  // 'tool_call' is the reconciler's structural row for every call, while
20735
20762
  // 'tool_use' exists only where a hook enforced against the arguments.
20736
20763
  "tool_use",
20737
- // One row per model REFUSAL: a switch onto a prohibited model that was
20738
- // denied, or a turn refused because the session was already running on one.
20739
- // A structural row like the ones above rather than a capture — it carries
20740
- // the model that was refused and nothing the user typed, because what is
20741
- // worth recording about a governance decision is the decision, and prompt
20742
- // text is the thing this product exists to keep from travelling.
20764
+ // One row per model REFUSAL, across all four seams a prohibited model can be
20765
+ // stopped at: a switch onto it, a turn already running on it, a subagent
20766
+ // spawn asking for it, or a request-path refusal an embedded request-path
20767
+ // SDK makes in-process before the call leaves the application. Which seam
20768
+ // rides `attributes.refusal_seam`, never this member name. A structural row
20769
+ // like the ones above rather than a capture — it carries the model that was
20770
+ // refused and nothing the user typed, because what is worth recording about
20771
+ // a governance decision is the decision, and prompt text is the thing this
20772
+ // product exists to keep from travelling.
20743
20773
  "model_refusal",
20774
+ // One row per request-path DECISION: a policy check an embedded request-path
20775
+ // SDK performs in-process before a model call leaves the application, or
20776
+ // against that call's non-streamed response. A structural row like
20777
+ // 'model_refusal' rather than a capture — content-free in the same way:
20778
+ // which side, which seam, what action and which field are decided rides
20779
+ // `attributes`, never this member name, and the matched text itself never
20780
+ // travels.
20781
+ //
20782
+ // A prohibited-model refusal on the request path is deliberately NOT this
20783
+ // member: it stays 'model_refusal' with `refusal_seam: 'request'`, so it
20784
+ // shares one bucket with the plugin's switch/turn/spawn refusals rather
20785
+ // than splitting one governance concept across two event types. This
20786
+ // member carries every OTHER request-path decision.
20787
+ "request_decision",
20744
20788
  // One row per config-inventory scan, hung off the session root. It is the
20745
20789
  // fact the posture inspection findings reference (findings require an
20746
20790
  // audit_event_id), and its started_at is the "scanned Nm ago" the read
20747
20791
  // surface renders.
20748
- "config_scan"
20792
+ "config_scan",
20793
+ // One row per reported browser-extension capture status, hung off the web
20794
+ // session root. The durable home of what one tab's network interception
20795
+ // is doing — a write-through of the native host's in-memory tracker, so a
20796
+ // second process (aka extension status) and a restarted host both have
20797
+ // somewhere to read it back from.
20798
+ "capture_status"
20749
20799
  ]).meta({ id: "AuditEventType" });
20750
20800
  var AttributeBag = external_exports.record(external_exports.string(), external_exports.unknown());
20751
20801
  var HostAttributes = external_exports.object({
@@ -20905,6 +20955,20 @@ var CaptureAttributes = external_exports.object({
20905
20955
  // repeated rather than referenced because a store reader opens this file.
20906
20956
  redact_degraded_to: ActionTaken.optional()
20907
20957
  }).catchall(external_exports.unknown());
20958
+ var CaptureStatusAttributes = external_exports.object({
20959
+ source_tool: external_exports.string().optional(),
20960
+ patched: external_exports.boolean().optional(),
20961
+ live: external_exports.boolean().optional(),
20962
+ blind: external_exports.boolean().optional(),
20963
+ sends_seen_dom: external_exports.number().int().nonnegative().optional(),
20964
+ exchanges_seen_net: external_exports.number().int().nonnegative().optional(),
20965
+ parse_failures: external_exports.number().int().nonnegative().optional(),
20966
+ unparsed_bodies: external_exports.number().int().nonnegative().optional(),
20967
+ shape_misses: external_exports.array(external_exports.string()).optional(),
20968
+ conversation_endpoints: external_exports.number().int().nonnegative().optional(),
20969
+ closed: external_exports.boolean().optional(),
20970
+ enforcement: external_exports.string().optional()
20971
+ }).catchall(external_exports.unknown());
20908
20972
  var ToolCallInspection = external_exports.object({
20909
20973
  ruleId: external_exports.string().min(1),
20910
20974
  ruleName: external_exports.string(),
@@ -21914,6 +21978,11 @@ var RemoteFailureKind = external_exports.enum([
21914
21978
  "rejected",
21915
21979
  "unreachable"
21916
21980
  ]);
21981
+ var ControlPlaneFailure = RemoteFailureKind.extract([
21982
+ "unauthorized",
21983
+ "forbidden",
21984
+ "unreachable"
21985
+ ]);
21917
21986
  var AttachDeviceRequest = external_exports.object({
21918
21987
  // This machine's own continuity id, so re-attaching ROTATES the credential
21919
21988
  // on one machine record instead of producing a second one. Client-minted
@@ -22336,7 +22405,12 @@ var EventMetadata = external_exports.object({
22336
22405
  // in — set by the browser extension's network capture so a stored `response`
22337
22406
  // row can be joined to the `llm_call` leaf describing the same turn. Absent
22338
22407
  // on every other capture path, which has no such id.
22339
- messageId: external_exports.string().optional(),
22408
+ //
22409
+ // Non-empty for the reason WebExchange.messageId is: it is the join key, and
22410
+ // a blank one matches no `llm_call` leaf. That refusal reaches only the
22411
+ // places an event is PARSED; the local write path types the event and parses
22412
+ // nothing, which is why `toCaptureAttributes` omits a blank one separately.
22413
+ messageId: external_exports.string().min(1).optional(),
22340
22414
  conversationId: external_exports.string().optional(),
22341
22415
  // How long THIS capture's inspection blocked its caller, in whole
22342
22416
  // milliseconds — the plugin's own added latency, NOT the LLM call it sat in
@@ -22936,6 +23010,18 @@ var HistorySyncConsent = external_exports.object({
22936
23010
  payloadVersion: external_exports.number().int().positive(),
22937
23011
  endpoint: external_exports.string()
22938
23012
  });
23013
+ var WebChatCaptureConsent = external_exports.object({
23014
+ acknowledgedAt: external_exports.iso.datetime(),
23015
+ version: external_exports.number().int().positive()
23016
+ });
23017
+ var WebChatResponseCapture = external_exports.enum(["with-findings", "always", "never"]);
23018
+ var WebChatCapture = external_exports.object({
23019
+ responses: WebChatResponseCapture.default("with-findings"),
23020
+ account: external_exports.boolean().default(false),
23021
+ // Absent until granted. Presence alone does not authorize anything — see
23022
+ // isWebChatCaptureConsentValid.
23023
+ consent: WebChatCaptureConsent.optional()
23024
+ });
22939
23025
  var BODY_RETENTION_DEFAULT_DAYS = 30;
22940
23026
  var BodyRetention = external_exports.object({
22941
23027
  enabled: external_exports.boolean().default(false),
@@ -22994,6 +23080,16 @@ var WorkspaceSettings = external_exports.object({
22994
23080
  // both widenings. Absent until granted, and a grant for a different endpoint
22995
23081
  // or an older payload no longer counts.
22996
23082
  historySyncConsent: HistorySyncConsent.optional(),
23083
+ // What the browser extension may record from a web chat, and the grant that
23084
+ // authorizes it. Absent until the user answers: recording something that was
23085
+ // never recorded before is never an assumed grant on upgrade, so the whole
23086
+ // block is optional rather than defaulted in. What an absent block means is
23087
+ // webChatCaptureOf's answer, in one place.
23088
+ //
23089
+ // Enforcement is NOT gated on this. A machine that has never answered still
23090
+ // blocks, redacts and warns on what a user sends; the grant covers what is
23091
+ // written down.
23092
+ webChatCapture: WebChatCapture.optional(),
22997
23093
  // Local body expiry (see BodyRetention). Off until switched on; expiring a
22998
23094
  // body never removes the row or its findings.
22999
23095
  bodyRetention: BodyRetention.default({
@@ -23351,12 +23447,14 @@ var RecommendedActionIdParam = external_exports.object({ id: external_exports.st
23351
23447
  // ../../packages/schema/src/zod/settings-action.ts
23352
23448
  var HistorySyncConsentChoice = external_exports.enum(["granted", "revoked", "unchanged"]).meta({ id: "HistorySyncConsentChoice" });
23353
23449
  var ModelJudgeConsentChoice = external_exports.enum(["granted", "revoked", "unchanged"]).meta({ id: "ModelJudgeConsentChoice" });
23450
+ var WebChatCaptureConsentChoice = external_exports.enum(["granted", "revoked", "unchanged"]).meta({ id: "WebChatCaptureConsentChoice" });
23354
23451
  var SaveSettingsInput = external_exports.object({
23355
23452
  historicalAccess: external_exports.string(),
23356
23453
  modelJudgeConsent: ModelJudgeConsentChoice,
23357
23454
  historySyncConsent: HistorySyncConsentChoice,
23358
23455
  vaultConsent: external_exports.string(),
23359
23456
  vaultInlineReveal: external_exports.string(),
23457
+ webChatCaptureConsent: WebChatCaptureConsentChoice,
23360
23458
  // Widened to `string` like its neighbours rather than typed as
23361
23459
  // `RedactFallback`, on this module's own layering rule: shape here, VALUE at
23362
23460
  // the call site, so the domain check receives the type it was written for.
@@ -23525,11 +23623,24 @@ var WebExchange = external_exports.object({
23525
23623
  turnIndex: external_exports.number().int().nonnegative().optional(),
23526
23624
  toolCalls: external_exports.array(WebToolCall).default([]),
23527
23625
  // Absent when the adapter recovered no text. Capped by the caller at
23528
- // RESPONSE_TEXT_MAX_BYTES; `truncated` records that the cap was reached, so a
23529
- // short capture is never mistaken for a short reply.
23626
+ // RESPONSE_TEXT_MAX_BYTES, so a short capture is never mistaken for a short
23627
+ // reply.
23530
23628
  responseText: external_exports.string().optional(),
23629
+ // The stored text is short of the reply. It does NOT say which of the two
23630
+ // ceilings on this path cut it: the caller applies its own cap on the raw
23631
+ // bytes it reads off the wire, which can be reached by a stream whose
23632
+ // recovered text stays well under RESPONSE_TEXT_MAX_BYTES, and applies that
23633
+ // one to the text. A reader cannot tell them apart, and nothing downstream
23634
+ // should branch as though it could.
23531
23635
  truncated: external_exports.boolean().default(false)
23532
23636
  });
23637
+ var WebEnforcementState = external_exports.enum([
23638
+ "watching",
23639
+ "composer-only",
23640
+ "button-only",
23641
+ "unattached",
23642
+ "unknown"
23643
+ ]);
23533
23644
  var RESPONSE_TEXT_MAX_BYTES = 2 * 1024 * 1024;
23534
23645
  var WebCaptureStatus = external_exports.object({
23535
23646
  patched: external_exports.boolean(),
@@ -23541,8 +23652,39 @@ var WebCaptureStatus = external_exports.object({
23541
23652
  unparsedBodies: external_exports.number().int().nonnegative(),
23542
23653
  // The adapter-declared JSON key paths that were absent from a real payload —
23543
23654
  // the earliest signal that a site's contract moved.
23544
- shapeMisses: external_exports.array(external_exports.string()).default([])
23545
- });
23655
+ shapeMisses: external_exports.array(external_exports.string()).default([]),
23656
+ // How many `kind: 'conversation'` endpoints the reporting tab's adapter
23657
+ // compiled. Zero means this build declares none for the site, so observing
23658
+ // nothing is the design rather than a fault — the one fact that separates a
23659
+ // site nobody has surveyed yet from one whose contract moved. Defaulted so a
23660
+ // build predating the field is read as declaring nothing rather than refused.
23661
+ conversationEndpoints: external_exports.number().int().nonnegative().default(0),
23662
+ // The document that sent this report is going away. The bridge sets it on
23663
+ // its `pagehide` report and nowhere else.
23664
+ //
23665
+ // A property of the REPORT rather than of capture health, which is why
23666
+ // nothing in `deriveWebCaptureState` reads it and why it stays out of the
23667
+ // bridge's own report signature — a closing tab's last word must not be
23668
+ // suppressed for carrying the same health as the report before it. What
23669
+ // reads it is the per-site fold: a document that said it was unloading stops
23670
+ // voting on the site's state, so the reload the `blind` remediation asks for
23671
+ // can actually clear the verdict it was shown. A document that dies without
23672
+ // sending one is covered by CAPTURE_STATUS_DOCUMENT_QUIET_MS instead.
23673
+ //
23674
+ // Defaulted so a build predating the field reads as a document that never
23675
+ // said it was closing — which keeps it voting, the same as every report that
23676
+ // is not a final one.
23677
+ closed: external_exports.boolean().default(false),
23678
+ // What the DOM enforcement path is doing, which none of the counters above
23679
+ // can say: `sendsSeenDom` rises only once a send has COMPLETED, so a tab
23680
+ // whose watcher never bound reports zero exactly like a tab nobody typed in.
23681
+ // Defaulted to 'unknown' rather than 'watching' so a status from a build
23682
+ // predating the field is not read as reporting a healthy one.
23683
+ enforcement: WebEnforcementState.default("unknown")
23684
+ });
23685
+ var CAPTURE_STATUS_RECENCY_MS = 30 * 24 * 60 * 60 * 1e3;
23686
+ var CAPTURE_STATUS_RECENCY_DAYS = CAPTURE_STATUS_RECENCY_MS / (24 * 60 * 60 * 1e3);
23687
+ var CAPTURE_STATUS_DOCUMENT_QUIET_MS = 12 * 60 * 60 * 1e3;
23546
23688
 
23547
23689
  // ../../packages/persistence/src/paths.ts
23548
23690
  import {
@@ -24546,6 +24688,56 @@ var CONFIG_POSTURE_RULES = [
24546
24688
  }
24547
24689
  ];
24548
24690
 
24691
+ // ../../packages/detections/src/posture/web-capture-posture.ts
24692
+ var RULE_VERSION2 = "1";
24693
+ var DRIFT_MIN_PARSE_FAILURES = 2;
24694
+ var WEB_CAPTURE_DRIFT_STATES = /* @__PURE__ */ new Set([
24695
+ "blind",
24696
+ "degraded"
24697
+ ]);
24698
+ var WEB_CAPTURE_DRIFT_RULE = {
24699
+ ruleId: "web-capture-drift",
24700
+ version: RULE_VERSION2,
24701
+ name: "Web chat capture is not reading the site",
24702
+ category: "config",
24703
+ severity: "medium",
24704
+ definition: JSON.stringify({
24705
+ kind: "web-capture-drift",
24706
+ states: [...WEB_CAPTURE_DRIFT_STATES],
24707
+ minParseFailures: DRIFT_MIN_PARSE_FAILURES
24708
+ })
24709
+ };
24710
+ var STATIC_COPY = {
24711
+ active: { headline: "turns are being observed on this site" },
24712
+ unreported: {
24713
+ // Says "recently" rather than "yet": the store read is bounded to
24714
+ // CAPTURE_STATUS_RECENCY_MS, so this state covers a site nothing has ever
24715
+ // reported for AND one whose last report has aged out. The two are the
24716
+ // same fact to a reader — nobody has confirmed anything lately — and the
24717
+ // copy may not claim the stronger of them.
24718
+ headline: `no report in the last ${String(CAPTURE_STATUS_RECENCY_DAYS)} days \u2014 open the site in Chrome with the extension loaded`
24719
+ },
24720
+ standby: {
24721
+ headline: "this build declares no endpoints for the site, so nothing is observed yet"
24722
+ },
24723
+ unpatched: {
24724
+ // Says what the flags say and no more. `patched` is false both for a tap
24725
+ // that installed and hooked neither transport and for one that never ran
24726
+ // at all — a page reports the same status either way, so the copy may not
24727
+ // assert one of them.
24728
+ headline: "the page tap captured neither fetch nor XHR \u2014 it may not have installed; reload the extension at chrome://extensions"
24729
+ },
24730
+ idle: { headline: "watching; no turn has been observed yet" },
24731
+ blind: {
24732
+ headline: "messages were sent in the page that the network capture never saw",
24733
+ 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."
24734
+ },
24735
+ degraded: {
24736
+ headline: "the site's payloads no longer carry the fields the extension reads",
24737
+ 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."
24738
+ }
24739
+ };
24740
+
24549
24741
  // ../../packages/detections/src/security/redos-probe.ts
24550
24742
  var BUDGET_MS = 100;
24551
24743
  var EXPONENTIAL_UNITS = [