From c5e9fd6cd6565b55fab1bf2b9d8dacf8ba72a9f4 Mon Sep 17 00:00:00 2001 From: Adam Malczewski Date: Sun, 21 Jun 2026 19:20:10 +0900 Subject: feat(cli): list, read, send commands (Wave 3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CLI gains three new sub-commands: - dispatch list [--server] — list conversations (short ID + title + activity) - dispatch read [--server] — block until turn settles, print last AI message - dispatch send --text [--queue] [--open] [--cwd] [--effort] [--server] - Default: blocking (consumes NDJSON stream, prints accumulated text + conv ID) - --queue: non-blocking (POST /conversations/:id/queue, exit immediately) - --open: signals frontend to open the conversation tab (POST /conversations/:id/open) Short-ID resolution: 4+ char prefix → GET /conversations?q= → resolve to full ID. 32+ char input is treated as a full UUID (no resolution). Errors on 0 or >1 matches. 48 new tests (108 total in cli). Pure arg parser + HTTP client functions, zero vi.mock. --- packages/cli/src/index.ts | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'packages/cli/src/index.ts') diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 82e0b21..6f16547 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -6,7 +6,21 @@ export { type ParsedCommand, parseArgs } from "./args.js"; export { formatCatalog } from "./catalog.js"; -export { fetchModels, streamChat } from "./http.js"; +export { + type ConversationIdResolution, + enqueueMessage, + fetchConversations, + fetchLastMessage, + fetchModels, + openConversation, + resolveConversationId, + streamChat, +} from "./http.js"; export { buildChatRequest, composeMessage } from "./message.js"; export { type SplitResult, splitNdjsonLines } from "./ndjson.js"; -export { renderEvent } from "./render.js"; +export { + extractLastText, + formatConversationList, + formatRelativeTime, + renderEvent, +} from "./render.js"; -- cgit v1.2.3