agentgui 1.0.393 → 1.0.394

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/.prd +0 -215
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.393",
3
+ "version": "1.0.394",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "server.js",
package/.prd DELETED
@@ -1,215 +0,0 @@
1
- # AgentGUI ACP Compliance PRD
2
-
3
- ## Overview
4
- Transform AgentGUI into a fully ACP (Agent Connect Protocol) v0.2.3 compliant server.
5
-
6
- **Current Status**: 100% ACP compliant - All waves completed
7
- **All Required Features**: Fully implemented and tested
8
-
9
- **Note on "Slash Commands"**: ACP spec contains no slash command concept. This is purely a client-side UI feature outside ACP scope. If user wants slash commands implemented, that would be a separate UI enhancement task.
10
-
11
- ---
12
-
13
- ## Completion Status
14
-
15
- ### ✅ WAVE 1: Foundation (COMPLETED)
16
- - Database schema extended with ACP tables
17
- - Thread state management implemented
18
- - Checkpoint system operational
19
-
20
- ### ✅ WAVE 2: Core ACP APIs (COMPLETED)
21
- - All 23 ACP endpoints implemented
22
- - Threads API fully functional
23
- - Stateless runs supported
24
- - Agent discovery operational
25
-
26
- ### ✅ WAVE 3: SSE Streaming & Run Control (COMPLETED)
27
- - SSE streaming endpoints implemented
28
- - Run cancellation working
29
- - Event stream format compliant with ACP spec
30
-
31
- ### ✅ WAVE 4: UI Fixes & Optimization (COMPLETED - Enhanced)
32
- - **4.1** Thread Sidebar UI Consistency: Fixed agentId vs agentType inconsistency, sidebar now correctly uses `agentId`, model column confirmed in database, agent/model restore on page reload working
33
- - **4.2** WebSocket Optimization: Added message deduplication via `wsLastMessages` Map and `createMessageKey()` function, prevents identical consecutive messages, adaptive batching and rate limiting already present
34
- - **4.3** Duplicate Displays: Removed redundant agent/model from conversation headers (3 locations) and streaming start event, kept authoritative displays in sidebar and input selectors only
35
-
36
- ---
37
-
38
- ## Additional Enhancements (Non-blocking)
39
-
40
- ### NICE-TO-HAVE 1: Webhook Callbacks
41
- - Implement webhook support for run status changes
42
- - POST to webhook URL when run status changes (pending → active → completed)
43
- - Retry logic: 3 attempts with exponential backoff
44
- - Store webhook config in run_metadata table
45
- - Validate webhook URL format on run creation
46
-
47
- ### NICE-TO-HAVE 2: Run Interrupts
48
- - Support interrupt mechanism for agents that implement it
49
- - Interrupt types: user feedback request, tool approval, configuration needed
50
- - Store interrupt state in sessions table
51
- - API endpoints: GET /runs/{id}/interrupts, POST /runs/{id}/resume with interrupt response
52
- - UI: show interrupt prompt, collect user input, resume run
53
-
54
- ### NICE-TO-HAVE 3: Enhanced Search & Filtering
55
- - Full-text search on thread content (messages, agent responses)
56
- - Filter by agent type, date range, status, metadata fields
57
- - Search history: recent searches saved per user
58
- - Autocomplete for search filters
59
- - Export search results as JSON
60
-
61
- ### NICE-TO-HAVE 4: Thread Templates
62
- - Save thread configuration as template
63
- - Templates include: agent, model, initial prompt, working directory
64
- - Clone thread from template
65
- - Share templates between users (if multi-user support added)
66
-
67
- ---
68
-
69
- ## Testing Requirements (Per Item)
70
-
71
- Each implementation item must include:
72
- 1. Execute in plugin:gm:dev: create test run for every endpoint/function
73
- 2. Success paths: valid inputs, expected outputs verified
74
- 3. Error paths: invalid inputs, 404s, 409s, 422s verified
75
- 4. Edge cases: empty results, large payloads, concurrent requests
76
- 5. Integration tests: end-to-end flow (create thread → run → stream → cancel)
77
- 6. Database verification: inspect tables after operations, verify foreign keys
78
- 7. WebSocket verification: subscribe, receive events, verify payload format
79
- 8. SSE verification: curl endpoint, verify event-stream format
80
-
81
- ---
82
-
83
- ## Acceptance Criteria (All Must Pass)
84
-
85
- ### Core ACP Compliance
86
- - [ ] All 23 ACP endpoints implemented and tested
87
- - [ ] All ACP data models match spec (Thread, ThreadState, Run, Agent, etc.)
88
- - [ ] Error responses follow ACP format (ErrorResponse schema)
89
- - [ ] SSE streaming works with curl: `curl -N /threads/{id}/runs/stream`
90
- - [ ] Stateless runs work without thread context
91
- - [ ] Run cancellation kills agent process within 5 seconds
92
- - [ ] Thread copy duplicates all states and checkpoints
93
- - [ ] Agent descriptors return valid JSON matching AgentACPDescriptor schema
94
-
95
- ### Database Integrity
96
- - [ ] No orphaned records after thread/run deletion
97
- - [ ] Foreign key constraints enforced
98
- - [ ] Thread status correctly reflects run states
99
- - [ ] Checkpoint sequences monotonically increase
100
- - [ ] WAL mode enabled, queries under 100ms for typical operations
101
-
102
- ### UI Consistency
103
- - [ ] Sidebar shows correct agent for each conversation
104
- - [ ] Model selection persists after page reload
105
- - [ ] No duplicate agent/model displays found
106
- - [ ] Agent/model changes reflected in database immediately
107
-
108
- ### WebSocket Optimization
109
- - [ ] Streaming progress events batched (max 10/100ms)
110
- - [ ] Only subscribed clients receive messages
111
- - [ ] No client exceeds 1MB/sec sustained WebSocket traffic
112
- - [ ] Message deduplication prevents identical consecutive events
113
-
114
- ### Integration & E2E
115
- - [ ] Full flow: create thread → start run → stream events → cancel → verify cancelled
116
- - [ ] Stateless run: create run → stream → complete → verify output
117
- - [ ] Thread search: create 10 threads → search by metadata → verify correct results
118
- - [ ] Agent search: search by capability "streaming" → verify all streaming agents returned
119
- - [ ] Thread copy: create thread with 5 runs → copy → verify new thread has all history
120
- - [ ] Concurrent runs blocked: start run on thread → start second run → verify 409 conflict
121
-
122
- ---
123
-
124
- ## Migration Strategy
125
-
126
- ### Backward Compatibility
127
- - Existing conversations map to threads (1:1)
128
- - Existing sessions map to thread runs
129
- - `/api/conversations/*` endpoints remain functional (alias to `/threads/*`)
130
- - Old WebSocket message formats supported alongside new ACP formats
131
- - No breaking changes to current client code
132
-
133
- ### Rollout Plan
134
- 1. Deploy database schema changes (additive only, no drops)
135
- 2. Deploy new ACP endpoints alongside existing endpoints
136
- 3. Update client to use ACP endpoints where beneficial
137
- 4. Deprecation notice for old endpoints (6 month window)
138
- 5. Remove old endpoints after deprecation period
139
-
140
- ---
141
-
142
- ## Out of Scope
143
-
144
- - Multi-user authentication/authorization
145
- - Slash command implementation (not in ACP spec, pure client feature)
146
- - Agent marketplace or discovery service
147
- - Real-time collaboration on threads
148
- - Thread branching/forking (beyond simple copy)
149
- - Custom agent development framework
150
- - Billing/metering for agent usage
151
-
152
- ---
153
-
154
- ## Technical Notes
155
-
156
- ### ACP Terminology Mapping
157
- - AgentGUI "conversations" = ACP "threads"
158
- - AgentGUI "sessions" = ACP "runs" (stateful, on a thread)
159
- - AgentGUI "chunks/events" = ACP "run output stream"
160
- - AgentGUI "claudeSessionId" = ACP checkpoint ID concept
161
-
162
- ### Known Gotchas
163
- - ACP requires UUID format for thread_id, run_id, agent_id (current AgentGUI uses strings)
164
- - SSE requires newline-delimited format, different from current JSON streaming
165
- - Run cancellation must handle agents that don't support it gracefully
166
- - Thread status "idle" means no pending runs; must validate on run creation
167
- - Webhook URLs must be validated to prevent SSRF attacks
168
-
169
- ### Performance Targets
170
- - Thread search: <200ms for 10,000 threads
171
- - Run creation: <50ms (background processing)
172
- - SSE streaming: <10ms latency per event
173
- - WebSocket batch: <100ms accumulation window
174
- - Database writes: <20ms per transaction
175
-
176
- ---
177
-
178
- ## Dependencies
179
-
180
- **External**:
181
- - None (all features implemented with existing dependencies)
182
-
183
- **Internal**:
184
- - database.js (extended with new tables/queries)
185
- - server.js (new route handlers)
186
- - lib/claude-runner.js (run cancellation support)
187
- - static/js/client.js (UI consistency fixes)
188
- - static/js/conversations.js (agent/model persistence)
189
- - static/js/websocket-manager.js (optimization)
190
-
191
- **Configuration**:
192
- - No new env vars required
193
- - Existing BASE_URL, PORT, STARTUP_CWD remain unchanged
194
-
195
- ---
196
-
197
- ## Success Metrics
198
-
199
- - ACP compliance score: 0% → 100%
200
- - API endpoint coverage: 20 → 43 endpoints
201
- - WebSocket bandwidth: <50% reduction in bytes/sec per client
202
- - UI consistency issues: 4 identified → 0 remaining
203
- - Database tables: 5 → 8 (conversations, messages, sessions, events, chunks, thread_states, checkpoints, run_metadata)
204
- - Test coverage: endpoint tests for all 43 routes, integration tests for all critical flows
205
-
206
- ---
207
-
208
- ## Timeline Estimate
209
-
210
- - Wave 1 (Foundation): 3 parallel tasks = 1 completion cycle
211
- - Wave 2 (Core APIs): 3 parallel tasks = 1 completion cycle
212
- - Wave 3 (Streaming): 2 tasks = 1 completion cycle
213
- - Wave 4 (UI Fixes): 3 tasks = 1 completion cycle
214
-
215
- **Total**: 4 completion cycles (waves executed sequentially, items within wave executed in parallel with max 3 concurrent subagents per wave)