Skip to content

feat(plugins): improve plugin list output - #567

Merged
RetricSu merged 3 commits into
developfrom
ctx/task-5d79242b37
Nov 27, 2026
Merged

RetricSu merged 3 commits into
developfrom
ctx/task-5d79242b37

Conversation

@RetricSu

Copy link
Copy Markdown
Collaborator

Summary

  • Group offckb plugin list into JavaScript plugins and binary tools, with aligned versions and ✓ installed / ✗ available statuses.
  • Show each registered binary once. Keep catalog tools visible with a blocked status when a JavaScript plugin already uses the command name.
  • Preserve the JSON result schema and full source details. Document where JavaScript and binary entries come from.

Verification

  • pnpm build
  • pnpm test --runInBand --silent tests/cli-errors.test.ts
  • Ran the bundled CLI with a temporary plugin registry to verify text and JSON output and confirm a blocked tool becomes available after unlinking the conflicting plugin.

@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

✅ Changeset file detected.

@Hanssen0-Alter-Ego

Hanssen0-Alter-Ego commented Nov 27, 2026 •

Copy link
Copy Markdown

Review completed for 2bc0ecf6bb046c05e365464152b2e10ab0832935. Two independent passes covered the opening revision and changeset follow-up. Scoped review records the display findings and validation limits.

Generated by ChatGPT · Alter Ego

@Hanssen0-Alter-Ego Hanssen0-Alter-Ego left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found three low-priority display regressions in the original change (95ebaeb), still present at 2bc0ecf. The follow-up changeset was reviewed separately and has no findings. Two independent source passes and focused isolated CLI checks covered text and JSON behavior; the full Jest suite was not run.

Generated by ChatGPT · Alter Ego

Comment thread src/plugins/cli.ts Outdated
const jsCommands = new Set(js.map(({ command }) => command));
const catalogRows = catalog
.filter(({ installed }) => !installed)
.map(({ command, version }) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Keep the catalog descriptions in the human list. This mapping discards the description previously shown for uninstalled tools. On a clean registry, the ckb-cli row now shows only its version and availability, omitting the catalog's explicit note that this build has no TUI. The grouped view can retain that information without restoring duplicate rows.

Suggested fix Carry `description` into the catalog rows and render it after the status with a test for the `ckb-cli` note.

Comment thread src/plugins/cli.ts Outdated

function pluginListRow({ command, version, kind, mode, state, error }: PluginInfo) {
const status = state === 'available' ? '✓ installed' : state;
return { command, version, status: kind === 'js' ? `${status} (${mode})` : status, error };

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Preserve installed-version diagnostics for broken managed tools. listPlugins() returns invalid or shadowed registrations before it can read the manifest version, but their registry-backed source.resolved remains available. The prior text showed that value; the new text shows -, and deduplication suppresses the separate catalog row. That makes it harder to identify the broken installation.

Suggested fix For the human row only, fall back to the registered source/version when manifest version is unavailable; do not show the catalog pin as the installed version.

Comment thread src/plugins/cli.ts Outdated
const versionWidth = rows.reduce((width, { version }) => Math.max(width, version?.length ?? 0), 1);
return rows.map(
({ command, version, status, error }) =>
` ${command.padEnd(commandWidth)} ${(version ?? '-').padEnd(versionWidth)} ${status}${error ? ` — ${error}` : ''}`,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P3] Render the missing-version placeholder for legacy descriptors. The legacy native manifest parser uses an empty string when the descriptor omits version (manifest.ts:107). ?? preserves that empty string, leaving a blank version column instead of -.

Suggested fix Normalize empty versions to the same display placeholder as `undefined` and cover a versionless legacy row.

@Hanssen0-Alter-Ego

Hanssen0-Alter-Ego commented Nov 27, 2026 •

Copy link
Copy Markdown

Review completed for afb07fd902c89b11968339a2cd09093e37074920. Two independent passes covered the fix delta. The scoped review confirms all three earlier display fixes and lists the validation performed.

Generated by ChatGPT · Alter Ego

@Hanssen0-Alter-Ego Hanssen0-Alter-Ego left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM for afb07fd902c89b11968339a2cd09093e37074920 against 2bc0ecf6bb046c05e365464152b2e10ab0832935. Two independent passes found no actionable issue in the fix delta.

I verified the earlier findings: catalog descriptions are visible, broken registered tools show their recorded source without a duplicate row, and empty legacy versions render as -. The isolated list-action check passed seven text assertions and six before/after JSON comparisons. The Jest suite was not run because dependencies were unavailable in the offline cache.

Generated by ChatGPT · Alter Ego

@RetricSu
RetricSu merged commit 209e8d2 into develop Nov 27, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants