From ee5d0e84c2060f10c20a4b3e519bf0f928fd170d Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 5 Aug 2026 02:48:41 +0900 Subject: feat(plugin): discover and list plugin-provided commands Port Application::getPluginCommands: resolve the local composer with plugins force-enabled, fall back to Factory::createGlobal, and collect commands from CommandProvider capability adapters. PhpCommandProxy now mirrors name/description/aliases/hidden over RPC so `list` output matches upstream; input definitions remain TODO(plugin). PhpClass::php_class_name returns an owned String because PHP-backed proxies only know their class at runtime (the override-skip warning prints get_class). CommandProvider::getCommands hands out shared Rc handles since the commands are stored in the application. Factory::createGlobal now propagates createConfig errors instead of swallowing them, and Application::getComposer only catches the exception classes upstream catches, so a ParsingException reaches doRun's GithubActionError path as in Composer. Co-Authored-By: Claude Fable 5 --- crates/shirabe/src/repository/vcs.rs | 3 ++- crates/shirabe/src/repository/vcs_repository.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/src/repository') diff --git a/crates/shirabe/src/repository/vcs.rs b/crates/shirabe/src/repository/vcs.rs index 920fefa3..cb20735c 100644 --- a/crates/shirabe/src/repository/vcs.rs +++ b/crates/shirabe/src/repository/vcs.rs @@ -140,7 +140,7 @@ impl VcsDriverKind { impl PhpClass for VcsDriverKind { /// Used as the fallback driver name in `getRepoName()`. - fn php_class_name(&self) -> &'static str { + fn php_class_name(&self) -> String { match self { VcsDriverKind::GitHub => r"Composer\Repository\Vcs\GitHubDriver", VcsDriverKind::GitLab => r"Composer\Repository\Vcs\GitLabDriver", @@ -152,5 +152,6 @@ impl PhpClass for VcsDriverKind { VcsDriverKind::Fossil => r"Composer\Repository\Vcs\FossilDriver", VcsDriverKind::Svn => r"Composer\Repository\Vcs\SvnDriver", } + .to_string() } } diff --git a/crates/shirabe/src/repository/vcs_repository.rs b/crates/shirabe/src/repository/vcs_repository.rs index dd7b4b06..7ce00ce5 100644 --- a/crates/shirabe/src/repository/vcs_repository.rs +++ b/crates/shirabe/src/repository/vcs_repository.rs @@ -178,7 +178,7 @@ impl VcsRepository { .iter() .find(|(_, v)| **v == kind) .map(|(name, _)| name.clone()) - .unwrap_or_else(|| kind.php_class_name().to_string()), + .unwrap_or_else(|| kind.php_class_name()), None => String::new(), }; -- cgit v1.3.1