(input: {
readonly children: ReadonlyArray<{
readonly segment: string;
readonly invokable: boolean;
readonly hasChildren: boolean;
readonly toolCount: number;
}>;
readonly args: ParsedCallHelpArgs;
readonly fallbackQuery: string | undefined;
})
| 1882 | }); |
| 1883 | |
| 1884 | const applyCallHelpChildFilters = (input: { |
| 1885 | readonly children: ReadonlyArray<{ |
| 1886 | readonly segment: string; |
| 1887 | readonly invokable: boolean; |
| 1888 | readonly hasChildren: boolean; |
| 1889 | readonly toolCount: number; |
| 1890 | }>; |
| 1891 | readonly args: ParsedCallHelpArgs; |
| 1892 | readonly fallbackQuery: string | undefined; |
| 1893 | }) => { |
| 1894 | const query = [input.fallbackQuery, input.args.match] |
| 1895 | .filter((value): value is string => typeof value === "string" && value.trim().length > 0) |
| 1896 | .join(" ") |
| 1897 | .trim(); |
| 1898 | const filtered = filterToolPathChildren(input.children, query.length > 0 ? query : undefined); |
| 1899 | const children = |
| 1900 | input.args.limit && input.args.limit > 0 ? filtered.slice(0, input.args.limit) : filtered; |
| 1901 | |
| 1902 | return { |
| 1903 | query: query.length > 0 ? query : undefined, |
| 1904 | filteredCount: filtered.length, |
| 1905 | totalCount: input.children.length, |
| 1906 | children, |
| 1907 | }; |
| 1908 | }; |
| 1909 | |
| 1910 | const runCallHelp = ( |
| 1911 | args: ParsedCallHelpArgs, |
no test coverage detected