(input: {
readonly children: ReadonlyArray<{
readonly segment: string;
readonly invokable: boolean;
readonly hasChildren: boolean;
readonly toolCount: number;
}>;
readonly args: ParsedCallHelpArgs;
readonly fallbackQuery: string | undefined;
})
| 1840 | }); |
| 1841 | |
| 1842 | const applyCallHelpChildFilters = (input: { |
| 1843 | readonly children: ReadonlyArray<{ |
| 1844 | readonly segment: string; |
| 1845 | readonly invokable: boolean; |
| 1846 | readonly hasChildren: boolean; |
| 1847 | readonly toolCount: number; |
| 1848 | }>; |
| 1849 | readonly args: ParsedCallHelpArgs; |
| 1850 | readonly fallbackQuery: string | undefined; |
| 1851 | }) => { |
| 1852 | const query = [input.fallbackQuery, input.args.match] |
| 1853 | .filter((value): value is string => typeof value === "string" && value.trim().length > 0) |
| 1854 | .join(" ") |
| 1855 | .trim(); |
| 1856 | const filtered = filterToolPathChildren(input.children, query.length > 0 ? query : undefined); |
| 1857 | const children = |
| 1858 | input.args.limit && input.args.limit > 0 ? filtered.slice(0, input.args.limit) : filtered; |
| 1859 | |
| 1860 | return { |
| 1861 | query: query.length > 0 ? query : undefined, |
| 1862 | filteredCount: filtered.length, |
| 1863 | totalCount: input.children.length, |
| 1864 | children, |
| 1865 | }; |
| 1866 | }; |
| 1867 | |
| 1868 | const runCallHelp = ( |
| 1869 | args: ParsedCallHelpArgs, |
no test coverage detected