fix(cli): add list filtering/pagination, fix double-close in container ncl

- genericList now accepts column filters (--flag value) and LIMIT (default 200)
- Remove early inDb.close() in container pollResponse to avoid double-close
- Document filtering and --limit in cli.instructions.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
gavrielc
2026-05-08 21:02:23 +03:00
parent ed571d1f66
commit 6caad0757a
3 changed files with 18 additions and 6 deletions

View File

@@ -102,8 +102,6 @@ function pollResponse(requestId: string, timeoutMs: number): ResponseFrame | nul
.get(`%"requestId":"${requestId}"%`) as { id: string; content: string } | null;
if (row) {
inDb.close();
// Mark as completed via processing_ack so agent-runner skips it
const outDb = new Database(OUTBOUND_DB);
outDb.exec('PRAGMA journal_mode = DELETE');
@@ -119,7 +117,7 @@ function pollResponse(requestId: string, timeoutMs: number): ResponseFrame | nul
return parsed.frame as ResponseFrame;
}
} finally {
try { inDb.close(); } catch {}
inDb.close();
}
Bun.sleepSync(500);

View File

@@ -73,5 +73,6 @@ ncl destinations add --agent-group-id abc123 --messaging-group-id mg_xyz
- Use `ncl <resource> help` to see all available fields, types, enums, and which fields are required or updatable.
- Flags use `--hyphen-case` (e.g. `--agent-group-id`), mapped to `underscore_case` DB columns automatically.
- `list` supports filtering by any non-auto column (e.g. `ncl wirings list --messaging-group-id mg_xyz`). Default limit is 200 rows; override with `--limit N`.
- For composite-key resources (roles, members, destinations), use the custom verbs (grant/revoke, add/remove) instead of create/delete.
- Write commands return `approval-pending` immediately — don't treat this as an error. Wait for the system message with the result.