Commit Graph

1280 Commits

Author SHA1 Message Date
jcfs 3b17f2af8d test: Add integration test to verify session_id is stored in task metadata
- Wire session_info ACP handler in test server (mirrors main.go)
- Update TestOrchestratorSessionInfo to verify auggie_session_id is stored
- Test confirms session ID flows from agent → event bus → task metadata
2026-01-11 00:29:54 +00:00
jcfs 35cf080717 fix: Structure session_info event correctly for protocol.Message parsing
The session_id must be in the 'data' field, not at the top level,
so the watcher can parse it into protocol.Message and the handler
can find it at msg.Data["session_id"].
2026-01-11 00:27:01 +00:00
jcfs 1a56148ea7 fix: Publish session_info event so session ID is stored in task metadata
The lifecycle manager now publishes a session_info event after creating
an ACP session. This event is handled in main.go to store the session ID
in the task metadata, enabling session resumption for follow-up tasks.
2026-01-11 00:23:23 +00:00
jcfs 0120b7b6d7 docs: Update AGENTS.md for WebSocket-only architecture
- Replace REST endpoint references with WebSocket actions
- Update message flow diagram to show client → backend → agentctl
- Change agent.* actions to orchestrator.* actions
- Add ACP notification examples
- Update session resumption example with correct endpoint
- Add orchestrator action reference table
2026-01-11 00:10:50 +00:00
jcfs 7dc481e7a7 ci: Add GitHub Actions workflow for backend tests 2026-01-11 00:01:40 +00:00
jcfs 4d0efdc3ed chore: Clean up unused code and placeholder directories
Remove obsolete REST API code and empty placeholder directories:

Removed REST API code:
- apps/backend/internal/agent/api/ (REST handlers)
- apps/backend/internal/orchestrator/api/ (REST handlers)
- apps/backend/internal/orchestrator/streaming/ (REST streaming)
- apps/backend/internal/task/api/ (REST handlers)

Removed obsolete cmd binaries:
- apps/backend/cmd/agent-manager/
- apps/backend/cmd/orchestrator/
- apps/backend/cmd/api-gateway/
- apps/backend/cmd/task-service/
- apps/backend/cmd/agentctl/

Removed empty placeholder directories:
- apps/backend/internal/agent/models/
- apps/backend/internal/agent/monitor/
- apps/backend/internal/common/acp/
- apps/backend/internal/common/auth/
- apps/backend/internal/events/publisher/
- apps/backend/internal/events/subscriber/
- apps/backend/internal/gateway/handlers/
- apps/backend/internal/gateway/middleware/
- apps/backend/internal/gateway/router/
- apps/backend/internal/gateway/streaming/
- apps/backend/pkg/acp/client/
- apps/backend/pkg/acp/server/
- deployments/docker/agents/
- deployments/docker/compose/
- migrations/postgres/
- apps/agentctl/

Fixed:
- Added missing PromptAgent method to mock in scheduler_test.go

All tests pass, build succeeds.
2026-01-10 23:33:38 +00:00
Carlos Florêncio ec0b97ebfb fix: build 2026-01-10 23:17:27 +00:00
Carlos Florêncio e768e63ba4 feat: improve homepage buttons 2026-01-10 23:17:26 +00:00
Carlos Florêncio 3d9dfb2171 feat: settings page 2026-01-10 23:17:26 +00:00
Carlos Florêncio a797335ecd feat: improved task page 2026-01-10 23:17:26 +00:00
Carlos Florêncio 2efb7a2b32 feat: ui components reset 2026-01-10 23:17:26 +00:00
jcfs 4cd1e806ed docs: Add comprehensive WebSocket API reference
Add docs/WEBSOCKET_API.md with complete documentation for all 32 WebSocket
actions including:

- Message envelope format and error codes
- System flow diagram and typical workflow
- Board, Column, Task CRUD operations
- Task subscription for ACP streaming
- Agent management (list, launch, status, logs, stop, types)
- Orchestrator control (status, queue, start, stop, prompt, complete)
- Server notifications (acp.progress, acp.log, acp.result, etc.)
- Complete JavaScript usage example
- Quick reference table

Each action includes purpose, flow position, request/response examples,
payload field tables, and side effects.
2026-01-10 23:09:22 +00:00
jcfs 35915ff0cb refactor: Replace REST API with WebSocket-only architecture
- Remove all REST endpoints, replace with WebSocket message-based API
- Add WebSocket gateway with Hub and Client for connection management
- Add WebSocket handlers for Task, Agent, and Orchestrator services
- Add task subscription support for real-time ACP notifications
- Update all documentation to reflect WebSocket-first architecture
- Replace docs/openapi.yaml with docs/asyncapi.yaml
- Update e2e tests to use WebSocket via websocat

WebSocket endpoint: ws://localhost:8080/ws
Message format: {id, type, action, payload, timestamp}

Available actions:
- Board: board.list, board.create, board.get, board.update, board.delete
- Column: column.list, column.create, column.get
- Task: task.list, task.create, task.get, task.update, task.delete,
        task.move, task.state, task.subscribe, task.unsubscribe
- Agent: agent.list, agent.launch, agent.status, agent.logs, agent.stop,
         agent.prompt, agent.cancel, agent.session, agent.types
- Orchestrator: orchestrator.status, orchestrator.queue, orchestrator.trigger,
                orchestrator.start, orchestrator.stop, orchestrator.prompt,
                orchestrator.complete
- Health: health.check
2026-01-10 23:01:05 +00:00
Carlos Florêncio acee9f4278 feat: task page 2026-01-10 18:21:02 +00:00
jcfs e99aa07578 fix: publish session notifications to event bus for WebSocket streaming
- Add publishSessionNotification() to lifecycle manager
- Convert agentctl SessionNotification to event bus message
- Enables real-time streaming of agent output to WebSocket clients
2026-01-10 17:15:48 +00:00
jcfs 7faef25f3a feat: add READY status and multi-turn conversation support
- Add AgentStatusReady status for when agent finishes a prompt
- Add AgentReady event published when prompt completes
- PromptAgent accepts RUNNING/READY states, marks READY when done
- Add /complete endpoint to explicitly complete a task
- E2E test polls for READY status instead of file creation
- E2E test validates multi-turn conversation flow
2026-01-10 17:06:50 +00:00
jcfs 20f5f43fb3 feat: complete acp-go-sdk integration with task state updates
- Use acp-go-sdk for all ACP communication in agentctl
- Mark agent as completed when Prompt() returns successfully
- Update task state to COMPLETED when agent completes
- Update task state to FAILED when agent fails and retries exhausted
- Enhanced E2E test to verify agent actually creates files
- E2E test now validates full flow: task creation -> agent work -> file creation -> task completion
2026-01-10 16:46:35 +00:00
Carlos Florêncio 214b6ed2d8 fix: web linter issues 2026-01-10 16:11:30 +00:00
Carlos Florêncio b01fd2886d feat: multi view kanban 2026-01-10 16:07:59 +00:00
Carlos Florêncio 9c845dbc16 feat: fix kanban ssr 2026-01-10 15:49:12 +00:00
Carlos Florêncio 5b31958775 feat: init kanban 2026-01-10 15:23:49 +00:00
jcfs 7551235267 Implement ACP permission handling and E2E test
- Add proper JSON-RPC message type discrimination in readLoop():
  - Response: id + (result|error), no method
  - Request: id + method (e.g., session/request_permission)
  - Notification: method, no id

- Add permission request types to types.go:
  - RequestPermissionParams, PermissionOption
  - RequestPermissionResult, PermissionOutcome

- Implement handleRequestPermission in session manager:
  - Auto-approves by selecting first 'allow' option
  - Handles workspace indexing and tool permissions

- Add augment_provider.go for session credential injection

- Add repository_url field to task model for workspace mounting

- Create scripts/e2e-test.sh for automated testing

- Update documentation with ACP protocol details
2026-01-10 12:16:02 +00:00
Carlos Florêncio 2a7afcae43 feat: web app cleanup (#2) 2026-01-10 12:13:33 +00:00
Carlos Florêncio 794337ba28 feat: add build orchestration and architecture documentation (#1) 2026-01-10 12:05:58 +00:00
Carlos Florêncio f6a89471c7 feat: web app init 2026-01-10 11:27:28 +00:00
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
jcfs c36a5d28c0 Add OpenAPI 3.0 specification for complete API documentation
- docs/openapi.yaml: Full OpenAPI 3.0 spec (1174 lines)
  - All endpoints for Health, Boards, Columns, Tasks APIs
  - Agent lifecycle APIs (launch, stop, status, logs, types)
  - Orchestrator APIs (queue, trigger, task control)
  - Complete request/response schemas
  - Parameter definitions and error responses

- Updated AGENTS.md to reference OpenAPI spec

Compatible with Swagger UI, Redoc, and Postman.
2026-01-10 10:23:34 +00:00
jcfs 56c73914f8 Add AGENTS.md with agent guidelines and API documentation
Includes:
- Agent architecture overview
- Available agent types (Augment Agent)
- ACP (Agent Communication Protocol) message format and types
- Complete REST API reference for all endpoints:
  - Health, Boards, Columns, Tasks APIs
  - Agents API (launch, stop, status, logs, types)
  - Orchestrator API (queue, trigger, task control)
- Session resumption guide
- Error response format
- Custom agent creation guide
- Development notes

Note: API docs must be updated when endpoints change.
2026-01-10 10:16:58 +00:00
jcfs ffd288efea Add comprehensive test suite (216 tests)
Test coverage for:
- Task package: models, repository (memory + SQLite), service, API handlers
- Agent package: registry, lifecycle manager, credentials manager, API handlers
- Orchestrator package: queue, scheduler, watcher, ACP message store
- Events package: in-memory event bus with pub/sub
- ACP protocol: message types, helpers, JSON marshaling

All tests pass with 'go test ./...'
2026-01-10 01:52:56 +00:00
jcfs ba919305c2 Initial commit: Kandev with SQLite persistence and agent integration
Features:
- Unified Go binary running Task Service, Agent Manager, and Orchestrator
- SQLite persistence for boards, columns, and tasks
- Docker-based agent execution with ACP message streaming
- Augment Agent integration with session resumption support
- RESTful API for all operations (port 8080)
- In-memory event bus for service communication

Architecture:
- cmd/kandev: Single entry point for all services
- internal/task: Task, board, and column management
- internal/agent: Docker container lifecycle and ACP streaming
- internal/orchestrator: Agent coordination and monitoring
- internal/events: In-memory pub/sub event bus

Documentation:
- README.md: Project overview and quick start
- docs/ARCHITECTURE.md: System architecture (current + planned)
- docs/GETTING_STARTED.md: Development setup guide
- docs/IMPLEMENTATION_PLAN.md: Original microservices plan
- backend/NEXT_STEPS.md: Development roadmap
2026-01-10 01:30:24 +00:00