Implements issue #4 (Phase 1). Adds tangled pr create, tangled pr list, and tangled pr view commands.
Changes#
- src/lib/pulls-api.ts — business logic:
createPull,listPulls,getPull,getPullState,resolveSequentialPullNumber,getCompletePullData - src/commands/pr.ts —
tangled pr create/list/viewwith--json,--base,--head,--skip-behind-check - src/index.ts — registers the
prcommand group - tests/ — 28 new tests (14 lib, 14 command)
How pr create works#
- Detects current branch automatically if
--headis not specified - Checks if head is behind base; prompts interactively or exits in
--jsonmode (bypass with--skip-behind-check) - Generates
git diff base..head, gzip-compresses it, uploads as a blob (application/gzip) - Creates a
sh.tangled.repo.pullrecord with target, source, and patchBlob