diff --git a/src/cli/crud.ts b/src/cli/crud.ts index 370b9ad..af1371f 100644 --- a/src/cli/crud.ts +++ b/src/cli/crud.ts @@ -99,9 +99,7 @@ function genericGet(def: ResourceDef) { return async (args: Record) => { const id = args.id as string; if (!id) throw new Error(`${def.name} id is required`); - const row = getDb() - .prepare(`SELECT ${cols} FROM ${def.table} WHERE ${def.idColumn} = ?`) - .get(id); + const row = getDb().prepare(`SELECT ${cols} FROM ${def.table} WHERE ${def.idColumn} = ?`).get(id); if (!row) throw new Error(`${def.name} not found: ${id}`); return row; }; @@ -160,7 +158,9 @@ function genericUpdate(def: ResourceDef) { } } if (Object.keys(updates).length === 0) { - throw new Error(`nothing to update — provide at least one of: ${updatableCols.map((c) => '--' + c.name.replace(/_/g, '-')).join(', ')}`); + throw new Error( + `nothing to update — provide at least one of: ${updatableCols.map((c) => '--' + c.name.replace(/_/g, '-')).join(', ')}`, + ); } const setClause = Object.keys(updates) @@ -172,9 +172,7 @@ function genericUpdate(def: ResourceDef) { if (result.changes === 0) throw new Error(`${def.name} not found: ${id}`); const cols = visibleColumns(def).join(', '); - return getDb() - .prepare(`SELECT ${cols} FROM ${def.table} WHERE ${def.idColumn} = ?`) - .get(id); + return getDb().prepare(`SELECT ${cols} FROM ${def.table} WHERE ${def.idColumn} = ?`).get(id); }; } @@ -182,9 +180,7 @@ function genericDelete(def: ResourceDef) { return async (args: Record) => { const id = args.id as string; if (!id) throw new Error(`${def.name} id is required`); - const result = getDb() - .prepare(`DELETE FROM ${def.table} WHERE ${def.idColumn} = ?`) - .run(id); + const result = getDb().prepare(`DELETE FROM ${def.table} WHERE ${def.idColumn} = ?`).run(id); if (result.changes === 0) throw new Error(`${def.name} not found: ${id}`); return { deleted: id }; }; diff --git a/src/cli/dispatch.ts b/src/cli/dispatch.ts index a9943c4..f4c8987 100644 --- a/src/cli/dispatch.ts +++ b/src/cli/dispatch.ts @@ -18,11 +18,7 @@ export async function dispatch(req: RequestFrame, ctx: CallerContext): Promise.', + description: + 'LLM provider. Null means the default (claude). Skill-installed providers (e.g. opencode) register via /add-.', updatable: true, default: null, }, diff --git a/src/cli/resources/roles.ts b/src/cli/resources/roles.ts index 4e0a20b..9d51815 100644 --- a/src/cli/resources/roles.ts +++ b/src/cli/resources/roles.ts @@ -19,7 +19,8 @@ registerResource({ { name: 'agent_group_id', type: 'string', - description: 'Null = global (all groups). A specific ID limits the role to that group. Owner must always be null.', + description: + 'Null = global (all groups). A specific ID limits the role to that group. Owner must always be null.', }, { name: 'granted_by', type: 'string', description: 'Who granted this role. Informational.' }, { name: 'granted_at', type: 'string', description: 'Auto-set.' }, diff --git a/src/cli/resources/user-dms.ts b/src/cli/resources/user-dms.ts index 8b7b1cd..50b2763 100644 --- a/src/cli/resources/user-dms.ts +++ b/src/cli/resources/user-dms.ts @@ -5,7 +5,7 @@ registerResource({ plural: 'user-dms', table: 'user_dms', description: - 'User DM cache — maps (user, channel_type) to the messaging group used for DM delivery. Populated lazily by ensureUserDm() when the host needs to cold-DM a user (approvals, pairing). For direct-addressable channels (Telegram, WhatsApp) the handle IS the DM chat ID. For resolution-required channels (Discord, Slack) the adapter\'s openDM resolves it.', + "User DM cache — maps (user, channel_type) to the messaging group used for DM delivery. Populated lazily by ensureUserDm() when the host needs to cold-DM a user (approvals, pairing). For direct-addressable channels (Telegram, WhatsApp) the handle IS the DM chat ID. For resolution-required channels (Discord, Slack) the adapter's openDM resolves it.", idColumn: 'user_id', columns: [ { name: 'user_id', type: 'string', description: 'User this DM route is for.' }, diff --git a/src/cli/resources/users.ts b/src/cli/resources/users.ts index 5cd003e..0c4fd56 100644 --- a/src/cli/resources/users.ts +++ b/src/cli/resources/users.ts @@ -11,7 +11,8 @@ registerResource({ { name: 'id', type: 'string', - description: 'Namespaced "channel_type:handle" — e.g. "tg:6037840640", "discord:123456789", "email:user@example.com". Must be provided on create.', + description: + 'Namespaced "channel_type:handle" — e.g. "tg:6037840640", "discord:123456789", "email:user@example.com". Must be provided on create.', required: true, }, { @@ -24,7 +25,8 @@ registerResource({ { name: 'display_name', type: 'string', - description: 'Human-readable name. Shown in approval cards and logs. Often auto-populated from the channel adapter.', + description: + 'Human-readable name. Shown in approval cards and logs. Often auto-populated from the channel adapter.', updatable: true, }, { name: 'created_at', type: 'string', description: 'Auto-set.', generated: true },