chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -30,11 +30,7 @@ function resolveNodeRunner(): NodeRunner {
|
||||
throw new Error("Missing pnpm or npx; install a Node package runner.");
|
||||
}
|
||||
|
||||
async function runNodeTool(
|
||||
tool: string,
|
||||
toolArgs: string[],
|
||||
options: ToolRunOptions = {},
|
||||
) {
|
||||
async function runNodeTool(tool: string, toolArgs: string[], options: ToolRunOptions = {}) {
|
||||
const runner = resolveNodeRunner();
|
||||
const argv = [runner.cmd, ...runner.args, tool, ...toolArgs];
|
||||
return await runCommandWithTimeout(argv, {
|
||||
@@ -43,11 +39,7 @@ async function runNodeTool(
|
||||
});
|
||||
}
|
||||
|
||||
async function runTool(
|
||||
tool: string,
|
||||
toolArgs: string[],
|
||||
options: ToolRunOptions = {},
|
||||
) {
|
||||
async function runTool(tool: string, toolArgs: string[], options: ToolRunOptions = {}) {
|
||||
if (hasBinary(tool)) {
|
||||
return await runCommandWithTimeout([tool, ...toolArgs], {
|
||||
timeoutMs: options.timeoutMs ?? SEARCH_TIMEOUT_MS,
|
||||
@@ -130,11 +122,7 @@ function formatLinkLabel(link: string): string {
|
||||
return link.replace(/^https?:\/\//i, "");
|
||||
}
|
||||
|
||||
function renderRichResults(
|
||||
query: string,
|
||||
results: DocResult[],
|
||||
runtime: RuntimeEnv,
|
||||
) {
|
||||
function renderRichResults(query: string, results: DocResult[], runtime: RuntimeEnv) {
|
||||
runtime.log(`${theme.heading("Docs search:")} ${theme.info(query)}`);
|
||||
if (results.length === 0) {
|
||||
runtime.log(theme.muted("No results."));
|
||||
@@ -156,10 +144,7 @@ async function renderMarkdown(markdown: string, runtime: RuntimeEnv) {
|
||||
runtime.log(markdown.trimEnd());
|
||||
}
|
||||
|
||||
export async function docsSearchCommand(
|
||||
queryParts: string[],
|
||||
runtime: RuntimeEnv,
|
||||
) {
|
||||
export async function docsSearchCommand(queryParts: string[], runtime: RuntimeEnv) {
|
||||
const query = queryParts.join(" ").trim();
|
||||
if (!query) {
|
||||
const docs = formatDocsLink("/", "docs.clawd.bot");
|
||||
|
||||
Reference in New Issue
Block a user