feat: support pull requests

Support for pull requests, it's not standard in NIPs yet[1] but there must be
two clients that support it to be included in NIPs, n34 is one of them.

This support:
- Create a new PR `n34 pr new`
- Update PR tip `n34 pr update`
- View a PR `n34 pr view`
- List PRs `n34 pr list`
- Add `PR` and `PR-update` kinds as roots in `NostrClient::find_root`
- Support issuing statuses for PRs
- Support GRASP PR and PR-update
- Update the docs

[1] https://github.com/nostr-protocol/nips/pull/1966
This commit is contained in:
Awiteb
2025-09-12 06:43:23 +00:00
parent cc3aed0e89
commit 4360aa192c
43 changed files with 1714 additions and 143 deletions

View File

@@ -19,7 +19,12 @@ use std::num::NonZeroUsize;
use clap::Args;
use crate::{
cli::{CliOptions, common_commands, traits::CommandRunner, types::NaddrOrSet},
cli::{
CliOptions,
common_commands,
traits::CommandRunner,
types::{EntityType, NaddrOrSet},
},
error::N34Result,
};
@@ -42,7 +47,11 @@ impl CommandRunner for ListArgs {
const NEED_SIGNER: bool = false;
async fn run(self, options: CliOptions) -> N34Result<()> {
common_commands::list_patches_and_issues(options, self.naddrs, false, self.limit.into())
.await
common_commands::list_pr_patches_and_issues::<{ EntityType::Issue as u8 }>(
options,
self.naddrs,
self.limit.into(),
)
.await
}
}