From 01eac7b225c87f956813415125cbab937fed1835 Mon Sep 17 00:00:00 2001 From: gavrielc Date: Fri, 8 May 2026 21:04:07 +0300 Subject: [PATCH] style: fix prettier formatting Co-Authored-By: Claude Opus 4.6 (1M context) --- src/cli/crud.ts | 4 +++- src/delivery.test.ts | 17 +++++++++++++---- src/host-core.test.ts | 8 ++++++-- src/modules/agent-to-agent/agent-route.test.ts | 14 ++++++++++++-- 4 files changed, 34 insertions(+), 9 deletions(-) diff --git a/src/cli/crud.ts b/src/cli/crud.ts index 7721f67be..928aeede4 100644 --- a/src/cli/crud.ts +++ b/src/cli/crud.ts @@ -103,7 +103,9 @@ function genericList(def: ResourceDef) { } const where = filters.length > 0 ? ` WHERE ${filters.join(' AND ')}` : ''; params.push(limit); - return getDb().prepare(`SELECT ${cols} FROM ${def.table}${where} LIMIT ?`).all(...params); + return getDb() + .prepare(`SELECT ${cols} FROM ${def.table}${where} LIMIT ?`) + .all(...params); }; } diff --git a/src/delivery.test.ts b/src/delivery.test.ts index 5d235365c..aadfde809 100644 --- a/src/delivery.test.ts +++ b/src/delivery.test.ts @@ -26,7 +26,14 @@ vi.mock('./config.js', async () => { const TEST_DIR = '/tmp/nanoclaw-test-delivery'; -import { initTestDb, closeDb, runMigrations, createAgentGroup, createMessagingGroup, createMessagingGroupAgent } from './db/index.js'; +import { + initTestDb, + closeDb, + runMigrations, + createAgentGroup, + createMessagingGroup, + createMessagingGroupAgent, +} from './db/index.js'; import { getDeliveredIds } from './db/session-db.js'; import { resolveSession, outboundDbPath, openInboundDb } from './session-manager.js'; import { deliverSessionMessages, setDeliveryAdapter } from './delivery.js'; @@ -233,10 +240,12 @@ describe('deliverSessionMessages — permission check', () => { // Insert an outbound message targeting mg-2 (discord) — not the origin chat const outDb = new Database(outboundDbPath('ag-1', session.id)); - outDb.prepare( - `INSERT INTO messages_out (id, timestamp, kind, platform_id, channel_type, content) + outDb + .prepare( + `INSERT INTO messages_out (id, timestamp, kind, platform_id, channel_type, content) VALUES (?, datetime('now'), 'chat', 'discord:456', 'discord', ?)`, - ).run('out-unauth', JSON.stringify({ text: 'sneaky' })); + ) + .run('out-unauth', JSON.stringify({ text: 'sneaky' })); outDb.close(); const calls: string[] = []; diff --git a/src/host-core.test.ts b/src/host-core.test.ts index 1225b76f7..e6b9153c4 100644 --- a/src/host-core.test.ts +++ b/src/host-core.test.ts @@ -838,7 +838,6 @@ describe('agent-shared session resolution', () => { const { session } = resolveSession('ag-1', null, null, 'agent-shared'); expect(session.messaging_group_id).toBeNull(); }); - }); describe('agent-to-agent routing', () => { @@ -885,7 +884,12 @@ describe('agent-to-agent routing', () => { const { session: paSlackSession } = resolveSession('ag-pa', 'mg-slack', null, 'shared'); await routeAgentMessage( - { id: 'out-a2a-1', platform_id: 'ag-researcher', content: JSON.stringify({ text: 'research this' }), in_reply_to: null }, + { + id: 'out-a2a-1', + platform_id: 'ag-researcher', + content: JSON.stringify({ text: 'research this' }), + in_reply_to: null, + }, paSlackSession, ); diff --git a/src/modules/agent-to-agent/agent-route.test.ts b/src/modules/agent-to-agent/agent-route.test.ts index fca0d4b28..b0bc66e6b 100644 --- a/src/modules/agent-to-agent/agent-route.test.ts +++ b/src/modules/agent-to-agent/agent-route.test.ts @@ -328,7 +328,12 @@ describe('routeAgentMessage return-path', () => { // B replies to A, but in_reply_to references the C-originated row. // Guard rejects (SC belongs to C, not A) → falls through to newest of A. await routeAgentMessage( - { id: 'msg-reply-tamper', platform_id: A, content: JSON.stringify({ text: 'misdirected' }), in_reply_to: cInboundId }, + { + id: 'msg-reply-tamper', + platform_id: A, + content: JSON.stringify({ text: 'misdirected' }), + in_reply_to: cInboundId, + }, SB, ); @@ -353,7 +358,12 @@ describe('routeAgentMessage return-path', () => { // B replies to A with in_reply_to pointing to the channel message. // source_session_id is null → peer-affinity finds nothing → newest of A. await routeAgentMessage( - { id: 'msg-reply-channel', platform_id: A, content: JSON.stringify({ text: 'response' }), in_reply_to: 'channel-msg-1' }, + { + id: 'msg-reply-channel', + platform_id: A, + content: JSON.stringify({ text: 'response' }), + in_reply_to: 'channel-msg-1', + }, SB, );