quota/
├── src/
│ ├── auth/
│ │ ├── TokenStorageReader.ts # Reads V3 account storage
│ │ └── AccountRotator.ts # Account rotation logic
│ ├── quota/
│ │ ├── LSPFinder.ts # Finds Antigravity LSP process
│ │ └── QuotaPoller.ts # Polls quota via LSP
│ ├── rotation/
│ │ ├── QuotaTracker.ts # Tracks quota per model
│ │ └── ModelSelector.ts # Selects best available model
│ ├── manager.ts # Main QuotaManager class
│ ├── plugin.ts # OpenCode plugin wrapper
│ ├── oh-my-opencode.ts # oh-my-opencode integration
│ ├── types.ts # Shared TypeScript types
│ └── index.ts # Public API exports
├── tests/ # Jest tests (existing)
├── package.json
├── tsconfig.json
├── tsconfig.build.json
├── LICENSE
├── README.md
└── .gitignore
- Plugin installed via
package.json - Uses
AntigravityQuotaPluginexport - Reads from same auth storage as opencode-antigravity-auth
- Provides
createOhMyOpenCodeIntegrationhelper - Generates agent configs with model rotation
- Dynamic model selection based on quota
- Quota Tracking: Real-time monitoring via LSP process
- Model Rotation: Automatic fallback when quota is low
- Account Rotation: Leverages multi-account from auth plugin
- oh-my-opencode Support: Agent-level model management
- TypeScript: Full type safety and ESM support
See README.md for complete examples including:
- Basic usage with QuotaManager
- oh-my-opencode integration
- Model rotation strategies
- API documentation