agentgui 1.0.780 → 1.0.782
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.
- package/lib/db-queries.js +3 -1
- package/lib/jsonl-watcher.js +2 -2
- package/lib/ws-handlers-conv.js +1 -3
- package/lib/ws-handlers-run.js +2 -3
- package/package.json +1 -1
- package/server.js +1 -1
package/lib/db-queries.js
CHANGED
|
@@ -1344,6 +1344,8 @@ export function createQueries(db, prep, generateId) {
|
|
|
1344
1344
|
|
|
1345
1345
|
searchMessages(query, limit = 50) {
|
|
1346
1346
|
try {
|
|
1347
|
+
// Escape FTS5 special characters and wrap as phrase query
|
|
1348
|
+
const sanitized = '"' + query.replace(/"/g, '""') + '"';
|
|
1347
1349
|
const stmt = prep(`
|
|
1348
1350
|
SELECT m.id, m.conversationId, m.role, m.content, m.created_at,
|
|
1349
1351
|
c.title as conversationTitle, c.agentType
|
|
@@ -1353,7 +1355,7 @@ export function createQueries(db, prep, generateId) {
|
|
|
1353
1355
|
WHERE messages_fts MATCH ?
|
|
1354
1356
|
ORDER BY m.created_at DESC LIMIT ?
|
|
1355
1357
|
`);
|
|
1356
|
-
return stmt.all(
|
|
1358
|
+
return stmt.all(sanitized, limit);
|
|
1357
1359
|
} catch (_) { return []; }
|
|
1358
1360
|
},
|
|
1359
1361
|
|
package/lib/jsonl-watcher.js
CHANGED
|
@@ -124,8 +124,8 @@ export class JsonlWatcher {
|
|
|
124
124
|
const cwd = e.cwd || process.cwd();
|
|
125
125
|
const branch = e.gitBranch || '';
|
|
126
126
|
const base = path.basename(cwd);
|
|
127
|
-
const title = branch ?
|
|
128
|
-
const conv = this._q.createConversation('
|
|
127
|
+
const title = branch ? `${branch} @ ${base}` : base;
|
|
128
|
+
const conv = this._q.createConversation('claude-code', title, cwd);
|
|
129
129
|
this._q.setClaudeSessionId(conv.id, sid);
|
|
130
130
|
this._convMap.set(sid, conv.id);
|
|
131
131
|
this._bc({ type: 'conversation_created', conversation: conv, timestamp: Date.now() });
|
package/lib/ws-handlers-conv.js
CHANGED
|
@@ -255,9 +255,7 @@ export function register(router, deps) {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
if (sessionId) queries.updateSession(sessionId, { status: 'interrupted', completed_at: Date.now() });
|
|
258
|
-
|
|
259
|
-
execMachine.send(p.id, { type: 'CANCEL' });
|
|
260
|
-
activeExecutions.delete(p.id);
|
|
258
|
+
cleanupExecution(p.id);
|
|
261
259
|
|
|
262
260
|
// Clear claudeSessionId so new execution starts fresh without --resume on a killed session
|
|
263
261
|
queries.setClaudeSessionId(p.id, null);
|
package/lib/ws-handlers-run.js
CHANGED
|
@@ -2,7 +2,7 @@ function err(code, message) { const e = new Error(message); e.code = code; throw
|
|
|
2
2
|
function need(p, key) { if (!p[key]) err(400, `Missing required param: ${key}`); return p[key]; }
|
|
3
3
|
|
|
4
4
|
function register(router, deps) {
|
|
5
|
-
const { queries, discoveredAgents, activeExecutions, activeProcessesByRunId, broadcastSync, processMessageWithStreaming } = deps;
|
|
5
|
+
const { queries, discoveredAgents, activeExecutions, activeProcessesByRunId, broadcastSync, processMessageWithStreaming, cleanupExecution } = deps;
|
|
6
6
|
|
|
7
7
|
function findAgent(id) { const a = discoveredAgents.find(x => x.id === id); if (!a) err(404, 'Agent not found'); return a; }
|
|
8
8
|
function getRunOrThrow(id) { const r = queries.getRun(id); if (!r) err(404, 'Run not found'); return r; }
|
|
@@ -15,9 +15,8 @@ function register(router, deps) {
|
|
|
15
15
|
setTimeout(() => { try { process.kill(-ex.pid, 'SIGKILL'); } catch { try { process.kill(ex.pid, 'SIGKILL'); } catch {} } }, 3000);
|
|
16
16
|
}
|
|
17
17
|
if (ex?.sessionId) queries.updateSession(ex.sessionId, { status: 'error', error: 'Cancelled by user', completed_at: Date.now() });
|
|
18
|
-
|
|
18
|
+
cleanupExecution(threadId);
|
|
19
19
|
activeProcessesByRunId.delete(runId);
|
|
20
|
-
queries.setIsStreaming(threadId, false);
|
|
21
20
|
return ex;
|
|
22
21
|
}
|
|
23
22
|
|
package/package.json
CHANGED
package/server.js
CHANGED
|
@@ -2627,7 +2627,7 @@ debugLog('[INIT] registerSessionHandlers completed');
|
|
|
2627
2627
|
|
|
2628
2628
|
registerRunHandlers(wsRouter, {
|
|
2629
2629
|
queries, discoveredAgents, activeExecutions, activeProcessesByRunId,
|
|
2630
|
-
broadcastSync, processMessageWithStreaming
|
|
2630
|
+
broadcastSync, processMessageWithStreaming, cleanupExecution
|
|
2631
2631
|
});
|
|
2632
2632
|
|
|
2633
2633
|
registerUtilHandlers(wsRouter, {
|