docs: enrich module docs with binary analysis cross-references

This commit is contained in:
Nikketryhard
2026-02-14 04:20:57 -06:00
parent 932214fd95
commit 7f5a0f51d3
3 changed files with 21 additions and 0 deletions

View File

@@ -1,4 +1,10 @@
//! Model definitions and lookup.
//!
//! Maps our user-friendly model names to internal Antigravity identifiers.
//! The `model_enum` values are protobuf enum numbers extracted from extension.js:
//! placeholder models use 1000+N (e.g. M26→1026), while named models like
//! `MODEL_CLAUDE_4_OPUS` have their own enum values (e.g. 290).
//! See `docs/ls-binary-analysis.md` for the full enum mapping.
/// Model definition: friendly name → (antigravity_id, protobuf_enum, label).
pub(crate) struct ModelDef {

View File

@@ -3,6 +3,11 @@
//! This is a minimal, hand-rolled encoder. We do NOT use prost or any codegen
//! because we need precise control over field ordering and encoding to produce
//! byte-identical output to the captured webview traffic.
//!
//! The LS communicates with Google via gRPC over H2, using proto messages from
//! the `exa.*_pb` package family. Init metadata (field 34 of the init request)
//! carries the `detect_and_use_proxy` enum, model selection, and version info.
//! See `docs/ls-binary-analysis.md` for the full proto schema reverse engineering.
use crate::constants::{client_version, CLIENT_NAME};

View File

@@ -1,5 +1,15 @@
//! Quota monitor — polls the local LS `GetUserStatus` to track
//! prompt/flow credits and per-model rate limits without touching Google servers.
//!
//! The LS's `GetUserStatus` response contains `cascadeModelConfigData` with
//! per-model `quotaInfo` (remaining fraction, reset time) and plan-level credit
//! balances (prompt, flow, flex). This data originates from Google's
//! `PredictionService/RetrieveUserQuota` / `v1internal:retrieveUserQuota` endpoint,
//! but asking the LS is simpler since it caches this data locally.
//!
//! The credit system uses the `google/internal/cloud/code/v1internal/credits`
//! proto package with `Credits_CreditType` enum. The `CASCADE_ENFORCE_QUOTA`
//! config key controls whether quotas are actually enforced.
use serde::Serialize;
use std::sync::Arc;