agentgui 1.0.779 → 1.0.781
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
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/routes-threads.js
CHANGED
|
@@ -74,7 +74,8 @@ export function register(deps) {
|
|
|
74
74
|
const url = new URL(req.url, `http://${req.headers.host}`);
|
|
75
75
|
const limit = parseInt(url.searchParams.get('limit') || '50', 10);
|
|
76
76
|
const before = url.searchParams.get('before') || null;
|
|
77
|
-
let offset =
|
|
77
|
+
let offset = 0;
|
|
78
|
+
if (before) { const parsed = parseInt(before, 10); if (!isNaN(parsed)) offset = parsed; }
|
|
78
79
|
const result = queries.getThreadHistory(threadId, limit, offset);
|
|
79
80
|
sendJSON(req, res, 200, { states: result.states, next_cursor: result.hasMore ? String(offset + limit) : null });
|
|
80
81
|
} catch (err) {
|
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);
|
|
@@ -53,6 +53,7 @@ export function register(router, deps) {
|
|
|
53
53
|
const entry = activeScripts.get(p.id);
|
|
54
54
|
if (!entry) err(404, 'No running script');
|
|
55
55
|
try { process.kill(-entry.process.pid, 'SIGTERM'); } catch { try { entry.process.kill('SIGTERM'); } catch {} }
|
|
56
|
+
setTimeout(() => { try { process.kill(-entry.process.pid, 'SIGKILL'); } catch { try { entry.process.kill('SIGKILL'); } catch {} } }, 5000);
|
|
56
57
|
return { ok: true };
|
|
57
58
|
});
|
|
58
59
|
}
|
package/package.json
CHANGED
|
@@ -32,7 +32,7 @@ class ConversationState {
|
|
|
32
32
|
|
|
33
33
|
updateConversation(id, data, serverVersion) {
|
|
34
34
|
if (id !== this.current.id) {
|
|
35
|
-
return { success: false, reason: '
|
|
35
|
+
return { success: false, reason: 'id_mismatch', prevState: this.current, newState: this.current };
|
|
36
36
|
}
|
|
37
37
|
if (serverVersion && serverVersion < this.current.version) {
|
|
38
38
|
return { success: false, reason: 'stale_version', prevState: this.current, newState: this.current };
|
package/static/js/terminal.js
CHANGED