@10iii/air-oc-plugin
v0.2.18
Published
OpenCode plugin for AIR - AI-optimized tool output compression
Downloads
819
Maintainers
Readme
@10iii/air-oc-plugin
OpenCode plugin for AIR (AI-optimized Information Representation) - transparent compression for tool outputs.
For AI Agents: See the unified installation guide at AGENT-INSTALL.md
Installation
# Global install (recommended)
npm install -g @10iii/air-oc-pluginImportant: Requires version ≥0.2.11 for compression hooks to work correctly.
Note: npx @10iii/air init is for CLI usage guide injection, not for installing this plugin. To use the OC plugin, you must install it explicitly and configure opencode.json.
Configuration
Add to your opencode.json:
{
"plugin": ["@10iii/air-oc-plugin"]
}Features
Transparent Compression
Tool outputs are automatically compressed before entering the context window. The LLM sees compressed output with a marker:
... compressed content ...
[AIR: compressed 63% | air_off() for raw]Control Tools
air_on()
Re-enable compression (default state).
air_off(calls?: number)
Temporarily disable compression. Auto-expires after N tool calls (default: 10).
LLM: Can you show me the raw output?
LLM calls: air_off(5)
Response: AIR compression disabled for the next 5 tool calls.Compressed Tools
| Tool | Compressor | Compression Ratio |
|------|------------|-------------------|
| bash | BashCompressor | 30-70% |
| read | ReadCompressor | 40-60% |
| grep | GrepCompressor | 50-80% |
| glob/list | LsCompressor | 40-70% |
| webfetch | WebCompressor | 60-90% |
| websearch_* | SearchCompressor + AIR Merge | 40-60% |
Dual-Source Search Merge
When using websearch_* tools (Exa, Tavily, etc.), AIR automatically:
- Keeps the LLM search results
- Adds AIR free search engine results
- Deduplicates and merges
This provides backup results when API keys run out.
Facts Upload
Web content is automatically uploaded to facts.airgo.dev for knowledge base building. Disable with:
export AIR_FACTS_UPLOAD=falseEnvironment Variables
| Variable | Default | Description |
|----------|---------|-------------|
| AIR_FACTS_UPLOAD | true | Upload web content to facts.airgo.dev |
| AIR_MIN_GAIN | 200 | Minimum chars saved to trigger compression |
API
Plugin Activation
The plugin auto-activates when loaded by OpenCode. No manual setup needed.
Utilities (for extension/testing)
import {
selectCompressor,
shouldCompress,
isEnabled,
enable,
disable,
reset,
} from "@10iii/air-oc-plugin";License
MIT
