agycraft-mcp 0.2.0 → 0.2.1

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/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # agycraft-mcp
2
2
 
3
- Privacy-first local MCP server & offline CLI doctor for **Antigravity (AGY)** and **Gemini CLI** — part of the [ModelCraft](https://modelcraft.dev) open-source ecosystem.
3
+ [![npm version](https://img.shields.io/npm/v/agycraft-mcp)](https://www.npmjs.com/package/agycraft-mcp) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
4
+
5
+ Privacy-first local MCP server & offline CLI doctor for **Antigravity (AGY)** and **Gemini CLI** — part of the [ModelCraft](https://modelcraft.dev) open-source ecosystem. Available on [npm](https://www.npmjs.com/package/agycraft-mcp) and [GitHub](https://github.com/YuchengWang/agycraft-mcp).
4
6
 
5
7
  > **Independent community project. Not affiliated with or endorsed by Google.**
6
8
  >
@@ -117,7 +119,8 @@ AGYCRAFT_CONFIG_DIR=./sandbox_repo/.agycraft AGYCRAFT_BRAIN_DIR=none npx -y agyc
117
119
  | Command | Description |
118
120
  | :--- | :--- |
119
121
  | `agycraft-mcp` | Start Stdio MCP Server (default) |
120
- | `agycraft-mcp doctor [--json]` | Run offline preflight & context hygiene checks |
122
+ | `agycraft-mcp doctor [--auth-mode <channel>] [--json]` | Run offline preflight, channel isolation, & context hygiene checks |
123
+ | `agycraft-mcp doctor --cost [--window 5h\|24h\|7d\|30d\|all] [--json]` | Inspect readonly cost breakdown by Canonical Model × Auth Mode (`Shadow Cost` vs `Estimated GCP / API Spend`) |
121
124
  | `agycraft-mcp preflight [--json]` | Live cloud status guard against `status.json` (`MODELCRAFT_STATUS_URL` / `MODELCRAFT_DATA_URL`); exits `1` on degraded, active incidents, 429/503 sources, or timeout |
122
125
  | `agycraft-mcp setup` | Print opt-in AGY Hook, Gemini CLI OTel (`logPrompts: false`), & sandbox snippets |
123
126
  | `agycraft-mcp record` | Append whitelisted numeric hook payload from stdin (hashes `workspace_dir`/`cwd` into `project_hash`) |
@@ -132,10 +135,10 @@ AGYCRAFT_CONFIG_DIR=./sandbox_repo/.agycraft AGYCRAFT_BRAIN_DIR=none npx -y agyc
132
135
  - Parameters: `window` (`"24h" | "7d"`, default `"24h"`), `scope` (`"global" | "project"`), `transcript_path`, `loopThreshold` (default `4`), `workspace_dir`, `timezone`.
133
136
  - Returns `behavior_summary` (`avg_input_tokens_per_request`, `cache_hit_rate_pct`, `estimated_cache_savings_usd`, `light_model_request_share_pct`, `heavy_model_request_share_pct`, `top_models`, `peak_hours`, `project_share_of_global_pct`, `auth_context`) and `executive_summary` in a single call, with gentle compaction guidance when KV cache hit rate `>= 85%` and Python/data `.geminiignore` exclusions.
134
137
  3. **`diagnose_error`**
135
- - Parameters: `error_text` (required), `product` (`"agy" | "cli" | "api" | "web"`), `doctor_summary`.
136
- - Covers 5 fault domains + Structured Output/Function Calling + 4 granular GCP/Vertex AI rules (`gcp-vertex-api-disabled`, `gcp-adc-expired`, `gcp-vertex-iam-or-location`, `gcp-vpc-sc-blocked`) with BigQuery/GCS 400/403 anti-false-positive protection.
138
+ - Parameters: `error_text` (required), `product` (`"agy" | "cli" | "api" | "web"`), `auth_mode` (optional explicit channel ID/alias), `doctor_summary`.
139
+ - Driven by `ChannelRegistry` (`channels.json`), covering 4-channel `429 RESOURCE_EXHAUSTED` isolation (`google_oauth`, `gcp_vertex_adc`, `gemini_api_key`, `vertex_express_key`), 5 fault domains, Structured Output/Function Calling, and 4 granular GCP/Vertex AI rules (`gcp-vertex-api-disabled`, `gcp-adc-expired`, `gcp-vertex-iam-or-location`, `gcp-vpc-sc-blocked`) with BigQuery/GCS 400/403 anti-false-positive protection.
137
140
  4. **`lookup_model_guide`**
138
- - Parameters: `task`, `model_id`, `provider` (`"google" | "antigravity" | "all"`), `include_history` (boolean).
141
+ - Parameters: `task`, `model_id`, `provider` (`"google" | "antigravity" | "anthropic" | "all"`), `include_history` (boolean).
139
142
  5. **`get_ecosystem_status`**
140
143
  - Parameters: `plan` (`"free" | "pro" | "ultra"`), `product` (`"agy" | "cli" | "api" | "web"`), `timezone`, `scope` (`"global" | "project"`), `workspace_dir`, `auth_mode`.
141
144
  - Includes readonly `auth_context` mixed-auth isolation (`google_oauth`, `gcp_adc`, `api_key`) alongside live upstream status and PT midnight / rolling 5h/7d reset countdowns.
@@ -166,6 +169,18 @@ Special thanks to **Dr. Jessica Rudd** — Google Developer Expert (GDE) in GenA
166
169
 
167
170
  ## Release History / Changelog
168
171
 
172
+ ### `v0.2.1` (2026-12-02)
173
+
174
+ - **`doctor --cost` Channel-Isolated Cost Audit & Deprecation Alerts**: Added `agycraft-mcp doctor --cost [--window 5h|24h|7d|30d|all] [--json]` and `doctor --json` `cost_summary` / `deprecated_model_in_use` checks, strictly separating `Shadow Cost (Shared Quota Pressure)` (`google_oauth`), `Estimated GCP / API Spend` (`gcp_adc`), and `Unattributed Est.` (`unknown`) by Canonical Model × Auth Mode with zero `session_hash`, `project_hash`, or local path exposure.
175
+ - **Canonical Model Registry & `unknown` Attribution**: Unified model IDs to canonical catalog entries (`gemini-4-hydrogen`, `gemini-3.8-flash`, `gemini-3.5-flash-lite`, `claude-sonnet-5-5`, etc.) and eliminated `unknown` gaps for AGY `CHECKPOINT` events and `MODEL_TIER_FLASH_LITE` CLI background logs (`0` `unknown` in live `analyze_token_usage`).
176
+ - **Anthropic Provider & Deprecation Guidance**: Added `provider: "anthropic"` support (`claude-sonnet-5-5`, `claude-sonnet-4-5`, `claude-opus-4-6`, `claude-haiku-4-5`) to `lookup_model_guide`, filtered deprecated `gemini-3.8-flash` from `task: "planning"`, and resolved legacy `gemini-3-8-flash` aliases with migration warnings (`-> gemini-4-hydrogen`).
177
+ - **Dynamic `ChannelRegistry` (`channels.json`) & 4-Channel Isolation**: Added data-driven `ChannelRegistry` (supporting both `channels` and `auth_channels` schemas in `channels.json`), `doctor --auth-mode <channel>` isolation checks, per-channel `channel_reports` in `get_saving_recommendations`, and 4-channel `diagnose_error` routing (`google_oauth`, `gcp_vertex_adc`, `gemini_api_key`, `vertex_express_key`).
178
+ - **Verification & Release Verdict**: Verified on **Node `v20.20.2`** and **Node `v22.21.1`** with **94/94 unit tests passing** across 8 test files, plus real-project (`AGYCRAFT_READONLY=1`, live `modelcraft-web/public/data/v1/`), zero-code dynamic channel extension (`mock_enterprise_oidc`), and isolated sandbox E2E verification — **Go** for release.
179
+ - [verification/v0.2.1/ENVIRONMENT.md](verification/v0.2.1/ENVIRONMENT.md)
180
+ - [verification/v0.2.1/cli-e2e-cases.md](verification/v0.2.1/cli-e2e-cases.md)
181
+ - [verification/v0.2.1/mcp-e2e-cases.md](verification/v0.2.1/mcp-e2e-cases.md)
182
+ - [verification/v0.2.1/EVALUATION.md](verification/v0.2.1/EVALUATION.md)
183
+
169
184
  ### `v0.2.0` (2026-12-02)
170
185
 
171
186
  - **Built-in `preflight` Cloud Guard & Node 20+ Compatibility**: Added `agycraft-mcp preflight [--json]` to check `status.json` (`MODELCRAFT_STATUS_URL` / `MODELCRAFT_DATA_URL`) and exit `1` on degraded status, active incidents, upstream `429`/`503` signals, or HTTP/network failures. Relaxed `engines.node` to `>=20.0.0` (Node 22+ LTS recommended) with clean `doctor` Node 20.x support.