agentgui 1.0.920 → 1.0.922

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.
@@ -3,11 +3,10 @@ import path from 'path';
3
3
  import os from 'os';
4
4
 
5
5
  export function buildSystemPrompt(agentId, model, subAgent) {
6
+ if (!agentId || agentId === 'claude-code') return '';
6
7
  const parts = [];
7
- if (agentId && agentId !== 'claude-code') {
8
- const displayAgentId = agentId.split('-·-')[0];
9
- parts.push(`Use ${displayAgentId} subagent for all tasks.`);
10
- }
8
+ const displayAgentId = agentId.split('-·-')[0];
9
+ parts.push(`Use ${displayAgentId} subagent for all tasks.`);
11
10
  if (model) parts.push(`Model: ${model}.`);
12
11
  if (subAgent) parts.push(`Subagent: ${subAgent}.`);
13
12
  return parts.join(' ');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentgui",
3
- "version": "1.0.920",
3
+ "version": "1.0.922",
4
4
  "description": "Multi-agent ACP client with real-time communication",
5
5
  "type": "module",
6
6
  "main": "electron/main.js",
package/test.js CHANGED
@@ -15,12 +15,18 @@ import { createACPProtocolHandler } from './lib/acp-protocol.js';
15
15
  import { sendJSON, compressAndSend, acceptsEncoding } from './lib/http-utils.js';
16
16
  import { JsonlParser } from './lib/jsonl-parser.js';
17
17
  const require = createRequire(import.meta.url);
18
- let Database;
19
- try { Database = (await import('bun:sqlite')).default; } catch { Database = require('better-sqlite3'); }
18
+ let Database, dbAvailable = false;
19
+ try {
20
+ try { Database = (await import('bun:sqlite')).default; }
21
+ catch { Database = require('better-sqlite3'); }
22
+ new Database(':memory:');
23
+ dbAvailable = true;
24
+ } catch { dbAvailable = false; }
20
25
  let passed = 0, failed = 0;
21
26
  const ok = (name, fn) => Promise.resolve().then(fn).then(
22
27
  () => { console.log(`ok — ${name}`); passed++; },
23
28
  (err) => { console.error(`FAIL — ${name}: ${err.message}`); failed++; });
29
+ const okDb = (name, fn) => dbAvailable ? ok(name, fn) : (console.log(`skip (no sqlite) — ${name}`), passed++, Promise.resolve());
24
30
  function inMemDb() {
25
31
  const db = new Database(':memory:');
26
32
  if (db.pragma) db.pragma('foreign_keys = ON'); else db.run('PRAGMA foreign_keys = ON');
@@ -41,17 +47,17 @@ await ok('codec: roundtrip + binary', () => {
41
47
  assert.deepEqual(decode(encode({ a: 1, b: 'str', c: [1, 2, 3], d: { nested: true } })), { a: 1, b: 'str', c: [1, 2, 3], d: { nested: true } });
42
48
  assert.deepEqual(Array.from(decode(encode({ bin: Buffer.from([1, 2, 3, 4]) })).bin), [1, 2, 3, 4]);
43
49
  });
44
- await ok('db: init schema creates conversations table', () => {
50
+ await okDb('db: init schema creates conversations table', () => {
45
51
  assert.ok(inMemDb().db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='conversations'").get());
46
52
  });
47
- await ok('db-queries: createConversation round-trip', () => {
53
+ await okDb('db-queries: createConversation round-trip', () => {
48
54
  const { db, prep, gid } = inMemDb();
49
55
  const q = createQueries(db, prep, gid);
50
56
  const c = q.createConversation('claude-code', 'Test', '/tmp', 'sonnet', null);
51
57
  assert.equal(q.getConversation(c.id).title, 'Test');
52
58
  assert.equal(q.getConversation(c.id).status, 'active');
53
59
  });
54
- await ok('db-queries: archive + restore + streaming flag', () => {
60
+ await okDb('db-queries: archive + restore + streaming flag', () => {
55
61
  const { db, prep, gid } = inMemDb();
56
62
  const q = createQueries(db, prep, gid);
57
63
  const c = q.createConversation('claude-code', 'A');
@@ -60,7 +66,7 @@ await ok('db-queries: archive + restore + streaming flag', () => {
60
66
  q.setIsStreaming(c.id, true); assert.equal(q.getIsStreaming(c.id), true);
61
67
  q.setIsStreaming(c.id, false); assert.equal(q.getIsStreaming(c.id), false);
62
68
  });
63
- await ok('acp-queries: thread crud + search', () => {
69
+ await okDb('acp-queries: thread crud + search', () => {
64
70
  const { db, prep, gid } = inMemDb();
65
71
  const q = createQueries(db, prep, gid);
66
72
  const t = q.createThread({ foo: 'bar' });
@@ -100,7 +106,7 @@ await ok('workflow-plugin + agent-registry hermes', async () => {
100
106
  const h = registry.get('hermes');
101
107
  assert.equal(h.protocol, 'acp'); assert.deepEqual(h.buildArgs(), ['acp']);
102
108
  });
103
- await ok('delete-all: soft-deletes + wipes related', () => {
109
+ await okDb('delete-all: soft-deletes + wipes related', () => {
104
110
  const { db, prep, gid } = inMemDb();
105
111
  const q = createQueries(db, prep, gid);
106
112
  const c1 = q.createConversation('claude-code', 'A');