AVC (Agent View Controller) is a visual interaction tool installed on this system. It transforms JSON data into interactive visual UIs for human decision-making.
Binary location: avc (in PATH) or ./avc (project root)
Use AVC instead of printing plain text when you need human approval for:
- Execution plans with more than 3 steps
- Architecture changes involving multiple modules
- Multi-file refactoring plans
- Deployment sequences that need human ordering
Construct a JSON object following the schema below, then pipe it to avc:
echo '{"view":"plan","title":"Your Plan Title","editable":true,"data":{"steps":[{"id":1,"label":"Step description","status":"pending"}]}}' | avc- The
avccommand blocks until the human clicks Confirm or Cancel - stdout contains the modified JSON (human may have reordered, edited, or removed steps)
- Exit code
0= confirmed, exit code130= cancelled - Parse the returned JSON to get the human-approved plan
- Token threshold: If the input token count β€ 3000 (default), AVC will pass-through β it outputs the original JSON to stdout and exits with code
0without opening a window. This avoids interrupting the human for short content.
AVC has a built-in token threshold (default: 3000 tokens). When the content is short, AVC skips the WebView and passes through directly.
How it works:
- If the JSON contains a
token_countfield, AVC uses that value - Otherwise, AVC estimates tokens from the JSON byte length (
bytes / 3) - If the token count β€ threshold, AVC passes through without opening a window
To always show the WebView (bypass threshold), use --no-threshold:
echo '<json>' | avc --no-thresholdTo set a custom threshold:
echo '<json>' | avc --threshold=5000To include token count in JSON (recommended for accuracy):
{
"view": "plan",
"title": "Your Plan",
"token_count": 4500,
"data": { "steps": [...] }
}{
"view": "plan",
"title": "Plan title shown in window header",
"lang": "en",
"editable": true,
"token_count": 4500,
"data": {
"steps": [
{
"id": 1,
"label": "Human-readable step description",
"status": "pending"
}
]
},
"actions": ["confirm", "cancel"]
}Notes:
token_countis optional. If omitted, AVC estimates from byte length.langis optional (default"en"). Localizes UI chrome (buttons / status bar) only β not step content. Supported:en,zh,ja,ko,es,fr,de. Match it to the language of your step labels.
| view | Use for | Data shape |
|---|---|---|
plan |
Linear step-by-step execution plans | data.steps[] |
graph |
Architecture topology / dependency map / ER / data flow | data.nodes[] + data.edges[] |
Use graph when you're describing relationships between things rather than
a sequence of steps. See examples/graph-microservices.json for the shape.
RESULT=$(echo '{"view":"plan","title":"Refactor Plan","token_count":5000,"editable":true,"data":{"steps":[
{"id":1,"label":"Extract auth middleware","status":"pending"},
{"id":2,"label":"Create JWT service","status":"pending"},
{"id":3,"label":"Update routes","status":"pending"}
]}}' | avc)
if [ $? -eq 0 ]; then
echo "Human approved plan: $RESULT"
# Parse $RESULT and execute approved steps
else
echo "Human cancelled the plan"
fiWhen the human sees your plan in AVC, they can:
- Drag & drop to reorder steps
- Edit step descriptions by clicking on text
- Skip steps they don't want executed
- Delete steps entirely
- Add new steps you didn't think of
Always respect the human's modifications in the returned JSON.