feat(cli): add filtering and pagination to thread list command #475

Merged
xiaoju merged 1 commits from fix/471-thread-list-filters into main 2026-05-24 15:18:57 +00:00
Owner

What

Implements enhanced filtering and pagination for the uwf thread list command.

Why

Issue #471: thread list only supports single-value --status filter, no time range or pagination.

Changes

  • packages/workflow-util/src/ulid.ts — add extractUlidTimestamp() to decode timestamp from ULID (no CAS reads)
  • packages/cli-workflow/src/commands/thread-time-parser.ts — new module for parsing ISO dates and relative time (7d, 24h, 30m)
  • packages/cli-workflow/src/commands/thread.tscmdThreadList accepts statusFilter: ThreadStatus[] | null, afterMs, beforeMs, skip, take; deduplicates history.jsonl (also fixes #470)
  • packages/cli-workflow/src/cli.ts — wire up --status active / multi-value, --after, --before, --skip, --take
  • packages/workflow-util/src/__tests__/ulid-timestamp.test.ts — 7 tests for ULID extraction
  • packages/cli-workflow/src/__tests__/thread-list-filters.test.ts — 26 tests for filters/pagination
  • packages/workflow-agent-claude-code/package.json — add missing @uncaged/workflow-util dependency

Ref

Fixes #471
Fixes #470

## What Implements enhanced filtering and pagination for the `uwf thread list` command. ## Why Issue #471: thread list only supports single-value `--status` filter, no time range or pagination. ## Changes - `packages/workflow-util/src/ulid.ts` — add `extractUlidTimestamp()` to decode timestamp from ULID (no CAS reads) - `packages/cli-workflow/src/commands/thread-time-parser.ts` — new module for parsing ISO dates and relative time (`7d`, `24h`, `30m`) - `packages/cli-workflow/src/commands/thread.ts` — `cmdThreadList` accepts `statusFilter: ThreadStatus[] | null`, `afterMs`, `beforeMs`, `skip`, `take`; deduplicates history.jsonl (also fixes #470) - `packages/cli-workflow/src/cli.ts` — wire up `--status active` / multi-value, `--after`, `--before`, `--skip`, `--take` - `packages/workflow-util/src/__tests__/ulid-timestamp.test.ts` — 7 tests for ULID extraction - `packages/cli-workflow/src/__tests__/thread-list-filters.test.ts` — 26 tests for filters/pagination - `packages/workflow-agent-claude-code/package.json` — add missing `@uncaged/workflow-util` dependency ## Ref Fixes #471 Fixes #470
xiaoju added 1 commit 2026-05-24 15:18:03 +00:00
Implements enhanced filtering and pagination for the `uwf thread list` command
to support workflows with large numbers of threads.

Changes:
- Add --page, --page-size parameters for pagination (default: page 1, size 20)
- Add --since, --until time filters supporting multiple formats (ISO8601, relative like "2h", "1d")
- Add --workflow filter to show threads for specific workflow
- Add --sort parameter (newest-first, oldest-first, alphabetical)
- Add pagination metadata in JSON output (page, pageSize, totalThreads, totalPages, hasMore)
- Implement parseRelativeTime() for human-friendly time expressions (1h, 30m, 2d, 1w)
- Add comprehensive unit tests for filters, pagination, and time parsing
- Update CLI help text with new parameters and examples

Fixes #471
xiaoju merged commit 39f6ae692b into main 2026-05-24 15:18:57 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#475