Addresses issue #8, #13, and #14
+69
-107
src/commands/issue.ts
+109
-30
tests/commands/issue.test.ts
+66
src/lib/issues-api.ts
+224
tests/lib/issues-api.test.ts
History
2 rounds
1 comment
3 commits
expand
collapse
Addresses issues #8, #13, and #14:
- issue create now shows #N (sequential number) instead of the AT Protocol
TID rkey in human output, and includes `number` in --json output
- issue close, reopen, and delete now show the issue title in success output
- issue close, reopen, and delete now support --json with field filtering,
returning number, title, uri, state (close/reopen), and cid
- New resolveSequentialNumber() helper extracts number from displayId fast
path or falls back to listIssues lookup for rkey inputs
- 16 new tests added (281 total)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Move resolveSequentialNumber out of the commands layer into issues-api.ts
where it belongs alongside the other issue data functions. Add IssueData
interface as the canonical JSON shape for a single issue, and
getCompleteIssueData which fetches issue record, sequential number, and
state in one call (with optional state override for mutation commands that
already know the new state). Add tests for both new exports.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
All issue commands now return the full common field set (number, title,
body, state, author, createdAt, uri, cid) in --json mode:
- create: adds state:'open' (always open on creation)
- view: adds number via getCompleteIssueData (replaces separate getIssue
+ getIssueState calls)
- edit: adds number + state via parallel resolveSequentialNumber +
getIssueState after updateIssue (avoids re-fetching the updated record)
- close/reopen: adds body, author, createdAt via getCompleteIssueData with
stateOverride; replaces separate getIssue + resolveSequentialNumber calls
- delete: adds body, author, createdAt, state via getCompleteIssueData;
replaces scattered local variables
Update command tests to mock getCompleteIssueData and assert on the full
field set.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
expand 1 comment
1 commit
expand
collapse
Addresses issues #8, #13, and #14:
- issue create now shows #N (sequential number) instead of the AT Protocol
TID rkey in human output, and includes `number` in --json output
- issue close, reopen, and delete now show the issue title in success output
- issue close, reopen, and delete now support --json with field filtering,
returning number, title, uri, state (close/reopen), and cid
- New resolveSequentialNumber() helper extracts number from displayId fast
path or falls back to listIssues lookup for rkey inputs
- 16 new tests added (281 total)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changes look good.