agentgui 1.0.777 → 1.0.778

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.
@@ -99,7 +99,24 @@ export function register(router, deps) {
99
99
  router.handle('sess.exec', (p) => {
100
100
  const limit = Math.min(parseInt(p.limit || '1000'), 5000);
101
101
  const offset = Math.max(parseInt(p.offset || '0'), 0);
102
- return { sessionId: p.id, events: [], total: 0, limit, offset, hasMore: false, metadata: { status: 'pending', startTime: Date.now(), duration: 0, eventCount: 0 } };
102
+ const session = db.getSession(p.id);
103
+ const allChunks = session ? (db.getChunksSince(p.id, 0) || []) : [];
104
+ const filterType = p.filterType;
105
+ const filtered = filterType ? allChunks.filter(e => e.type === filterType) : allChunks;
106
+ return {
107
+ sessionId: p.id,
108
+ events: filtered.slice(offset, offset + limit),
109
+ total: filtered.length,
110
+ limit,
111
+ offset,
112
+ hasMore: offset + limit < filtered.length,
113
+ metadata: {
114
+ status: session?.status || 'unknown',
115
+ startTime: session?.created_at || null,
116
+ duration: session?.completed_at && session?.created_at ? session.completed_at - session.created_at : 0,
117
+ eventCount: filtered.length
118
+ }
119
+ };
103
120
  });
104
121
 
105
122
  router.handle('agent.ls', () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.777",
3
+ "version": "1.0.778",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",
package/server.js CHANGED
@@ -815,29 +815,25 @@ const server = http.createServer(async (req, res) => {
815
815
  const filterType = url.searchParams.get('filterType');
816
816
 
817
817
  try {
818
- // Retrieve execution history from database
819
- // This would normally query execution_events table
820
- // For now, return proper response structure
818
+ const session = queries.getSession(sessionId);
819
+ const allChunks = session ? (queries.getChunksSince(sessionId, 0) || []) : [];
820
+ const filtered = filterType ? allChunks.filter(e => e.type === filterType) : allChunks;
821
821
  const executionData = {
822
822
  sessionId,
823
- events: [],
824
- total: 0,
823
+ events: filtered.slice(offset, offset + limit),
824
+ total: filtered.length,
825
825
  limit,
826
826
  offset,
827
- hasMore: false,
827
+ hasMore: offset + limit < filtered.length,
828
828
  metadata: {
829
- status: 'pending',
830
- startTime: Date.now(),
831
- duration: 0,
832
- eventCount: 0
833
- }
829
+ status: session?.status || 'unknown',
830
+ startTime: session?.created_at || null,
831
+ duration: session?.completed_at && session?.created_at ? session.completed_at - session.created_at : 0,
832
+ eventCount: filtered.length
833
+ }
834
834
  };
835
835
 
836
- if (filterType) {
837
- executionData.events = executionData.events.filter(e => e.type === filterType);
838
- }
839
-
840
- sendJSON(req, res, 200, executionData);
836
+ sendJSON(req, res, 200, executionData);
841
837
  } catch (err) {
842
838
  sendJSON(req, res, 400, { error: err.message });
843
839
  }