agentgui 1.0.746 → 1.0.747
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/database.js +6 -3
- package/lib/ws-handlers-conv.js +9 -1
- package/package.json +1 -1
package/database.js
CHANGED
|
@@ -422,7 +422,8 @@ try {
|
|
|
422
422
|
isStreaming: 'INTEGER DEFAULT 0',
|
|
423
423
|
model: 'TEXT',
|
|
424
424
|
subAgent: 'TEXT',
|
|
425
|
-
pinned: 'INTEGER DEFAULT 0'
|
|
425
|
+
pinned: 'INTEGER DEFAULT 0',
|
|
426
|
+
tags: 'TEXT'
|
|
426
427
|
};
|
|
427
428
|
|
|
428
429
|
let addedColumns = false;
|
|
@@ -682,11 +683,12 @@ export const queries = {
|
|
|
682
683
|
const model = data.model !== undefined ? data.model : conv.model;
|
|
683
684
|
const subAgent = data.subAgent !== undefined ? data.subAgent : conv.subAgent;
|
|
684
685
|
const pinned = data.pinned !== undefined ? (data.pinned ? 1 : 0) : (conv.pinned || 0);
|
|
686
|
+
const tags = data.tags !== undefined ? (Array.isArray(data.tags) ? data.tags.join(',') : data.tags) : (conv.tags || null);
|
|
685
687
|
|
|
686
688
|
const stmt = prep(
|
|
687
|
-
`UPDATE conversations SET title = ?, status = ?, agentId = ?, agentType = ?, model = ?, subAgent = ?, pinned = ?, updated_at = ? WHERE id = ?`
|
|
689
|
+
`UPDATE conversations SET title = ?, status = ?, agentId = ?, agentType = ?, model = ?, subAgent = ?, pinned = ?, tags = ?, updated_at = ? WHERE id = ?`
|
|
688
690
|
);
|
|
689
|
-
stmt.run(title, status, agentId, agentType, model, subAgent, pinned, now, id);
|
|
691
|
+
stmt.run(title, status, agentId, agentType, model, subAgent, pinned, tags, now, id);
|
|
690
692
|
|
|
691
693
|
return {
|
|
692
694
|
...conv,
|
|
@@ -697,6 +699,7 @@ export const queries = {
|
|
|
697
699
|
model,
|
|
698
700
|
subAgent,
|
|
699
701
|
pinned,
|
|
702
|
+
tags,
|
|
700
703
|
updated_at: now
|
|
701
704
|
};
|
|
702
705
|
},
|
package/lib/ws-handlers-conv.js
CHANGED
|
@@ -22,11 +22,19 @@ export function register(router, deps) {
|
|
|
22
22
|
getJsonlWatcher = () => null } = deps;
|
|
23
23
|
|
|
24
24
|
router.handle('conv.ls', () => {
|
|
25
|
-
|
|
25
|
+
let conversations = queries.getConversationsList();
|
|
26
26
|
for (const c of conversations) { if (c.isStreaming && !execMachine.isActive(c.id)) c.isStreaming = 0; }
|
|
27
|
+
if (p.tag) conversations = conversations.filter(c => c.tags && c.tags.split(',').includes(p.tag));
|
|
27
28
|
return { conversations };
|
|
28
29
|
});
|
|
29
30
|
|
|
31
|
+
router.handle('conv.tags', () => {
|
|
32
|
+
const convs = queries.getConversationsList();
|
|
33
|
+
const tagSet = new Set();
|
|
34
|
+
for (const c of convs) { if (c.tags) c.tags.split(',').forEach(t => { if (t.trim()) tagSet.add(t.trim()); }); }
|
|
35
|
+
return { tags: [...tagSet].sort() };
|
|
36
|
+
});
|
|
37
|
+
|
|
30
38
|
router.handle('conv.new', (p) => {
|
|
31
39
|
p = validate(ConvNewSchema, p);
|
|
32
40
|
const wd = p.workingDirectory ? path.resolve(expandTilde(p.workingDirectory)) : null;
|