Files
kandev/backend/dockerfiles/augment-agent/agent.sh
T
jcfs aebb0c0c76 Implement bidirectional ACP communication with agents
- Add ACP session manager for JSON-RPC 2.0 over stdin/stdout
- Create jsonrpc package with Client for bidirectional communication
- Update agent.sh to run auggie --acp mode
- Add Docker client methods for container stdin/stdout attachment
- Update lifecycle manager to use ACP instead of log streaming
- Add new API endpoints: POST /prompt, POST /cancel, GET /session
- Update AGENTS.md with ACP protocol documentation
- Update OpenAPI spec with new endpoints and schemas

This enables:
- Sending prompts to running agents
- Cancelling agent operations
- Session management (create, load, resume)
- Real-time progress updates via session/update notifications
2026-01-10 10:51:11 +00:00

32 lines
915 B
Bash

#!/bin/bash
# Augment Agent - Runs in ACP (Agent Client Protocol) mode
# Uses JSON-RPC 2.0 over stdin/stdout for bidirectional communication
set -e
# Check if auggie is available
if ! command -v auggie &> /dev/null; then
echo '{"jsonrpc":"2.0","method":"error","params":{"message":"Auggie CLI not found"}}' >&2
exit 1
fi
# Check for authentication
if [ -z "$AUGMENT_SESSION_AUTH" ]; then
echo '{"jsonrpc":"2.0","method":"error","params":{"message":"AUGMENT_SESSION_AUTH required"}}' >&2
exit 1
fi
# Export for auggie to use
export AUGMENT_SESSION_AUTH
# Build auggie command
AUGGIE_ARGS="--acp"
# Add workspace root if we're in a workspace with files
if [ -d "/workspace" ] && [ "$(ls -A /workspace 2>/dev/null)" ]; then
AUGGIE_ARGS="$AUGGIE_ARGS --workspace-root /workspace"
fi
# Execute auggie in ACP mode - stdin/stdout will be used for JSON-RPC communication
exec auggie $AUGGIE_ARGS