fix(cli): restore help registration and descriptor graph · openclaw/openclaw@3d59e81
vincentkoc
·
2026-04-27
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
|
1 | 1 | import type { Command } from "commander"; |
2 | | -import type { CommandGroupEntry } from "./register-command-groups.js"; |
3 | 2 | |
4 | 3 | export type NamedCommandDescriptor = { |
5 | 4 | name: string; |
@@ -23,6 +22,11 @@ export type ResolvedCommandGroupEntry<TDescriptor extends NamedCommandDescriptor
|
23 | 22 | register: TRegister; |
24 | 23 | }; |
25 | 24 | |
| 25 | +type CommandGroupEntryLike = { |
| 26 | +placeholders: NamedCommandDescriptor[]; |
| 27 | +register: (program: Command) => Promise<void> | void; |
| 28 | +}; |
| 29 | + |
26 | 30 | function buildDescriptorIndex<TDescriptor extends NamedCommandDescriptor>( |
27 | 31 | descriptors: readonly TDescriptor[], |
28 | 32 | ): Map<string, TDescriptor> { |
@@ -49,8 +53,8 @@ export function resolveCommandGroupEntries<TDescriptor extends NamedCommandDescr
|
49 | 53 | export function buildCommandGroupEntries<TRegister>( |
50 | 54 | descriptors: readonly NamedCommandDescriptor[], |
51 | 55 | specs: readonly CommandGroupDescriptorSpec<TRegister>[], |
52 | | -mapRegister: (register: TRegister) => CommandGroupEntry["register"], |
53 | | -): CommandGroupEntry[] { |
| 56 | +mapRegister: (register: TRegister) => CommandGroupEntryLike["register"], |
| 57 | +): CommandGroupEntryLike[] { |
54 | 58 | return resolveCommandGroupEntries(descriptors, specs).map((entry) => ({ |
55 | 59 | placeholders: entry.placeholders, |
56 | 60 | register: mapRegister(entry.register), |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。