chore: migrate to oxlint and oxfmt
Co-authored-by: Christoph Nakazawa <christoph.pojer@gmail.com>
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import type { SlashCommand } from "@mariozechner/pi-tui";
|
||||
import {
|
||||
formatThinkingLevels,
|
||||
listThinkingLevels,
|
||||
} from "../auto-reply/thinking.js";
|
||||
import { formatThinkingLevels, listThinkingLevels } from "../auto-reply/thinking.js";
|
||||
|
||||
const VERBOSE_LEVELS = ["on", "off"];
|
||||
const REASONING_LEVELS = ["on", "off"];
|
||||
@@ -35,9 +32,7 @@ export function parseCommand(input: string): ParsedCommand {
|
||||
};
|
||||
}
|
||||
|
||||
export function getSlashCommands(
|
||||
options: SlashCommandOptions = {},
|
||||
): SlashCommand[] {
|
||||
export function getSlashCommands(options: SlashCommandOptions = {}): SlashCommand[] {
|
||||
const thinkLevels = listThinkingLevels(options.provider, options.model);
|
||||
return [
|
||||
{ name: "help", description: "Show slash command help" },
|
||||
@@ -63,49 +58,55 @@ export function getSlashCommands(
|
||||
name: "verbose",
|
||||
description: "Set verbose on/off",
|
||||
getArgumentCompletions: (prefix) =>
|
||||
VERBOSE_LEVELS.filter((v) => v.startsWith(prefix.toLowerCase())).map(
|
||||
(value) => ({ value, label: value }),
|
||||
),
|
||||
VERBOSE_LEVELS.filter((v) => v.startsWith(prefix.toLowerCase())).map((value) => ({
|
||||
value,
|
||||
label: value,
|
||||
})),
|
||||
},
|
||||
{
|
||||
name: "reasoning",
|
||||
description: "Set reasoning on/off",
|
||||
getArgumentCompletions: (prefix) =>
|
||||
REASONING_LEVELS.filter((v) => v.startsWith(prefix.toLowerCase())).map(
|
||||
(value) => ({ value, label: value }),
|
||||
),
|
||||
REASONING_LEVELS.filter((v) => v.startsWith(prefix.toLowerCase())).map((value) => ({
|
||||
value,
|
||||
label: value,
|
||||
})),
|
||||
},
|
||||
{
|
||||
name: "cost",
|
||||
description: "Toggle per-response usage line",
|
||||
getArgumentCompletions: (prefix) =>
|
||||
TOGGLE.filter((v) => v.startsWith(prefix.toLowerCase())).map(
|
||||
(value) => ({ value, label: value }),
|
||||
),
|
||||
TOGGLE.filter((v) => v.startsWith(prefix.toLowerCase())).map((value) => ({
|
||||
value,
|
||||
label: value,
|
||||
})),
|
||||
},
|
||||
{
|
||||
name: "elevated",
|
||||
description: "Set elevated on/off",
|
||||
getArgumentCompletions: (prefix) =>
|
||||
ELEVATED_LEVELS.filter((v) => v.startsWith(prefix.toLowerCase())).map(
|
||||
(value) => ({ value, label: value }),
|
||||
),
|
||||
ELEVATED_LEVELS.filter((v) => v.startsWith(prefix.toLowerCase())).map((value) => ({
|
||||
value,
|
||||
label: value,
|
||||
})),
|
||||
},
|
||||
{
|
||||
name: "elev",
|
||||
description: "Alias for /elevated",
|
||||
getArgumentCompletions: (prefix) =>
|
||||
ELEVATED_LEVELS.filter((v) => v.startsWith(prefix.toLowerCase())).map(
|
||||
(value) => ({ value, label: value }),
|
||||
),
|
||||
ELEVATED_LEVELS.filter((v) => v.startsWith(prefix.toLowerCase())).map((value) => ({
|
||||
value,
|
||||
label: value,
|
||||
})),
|
||||
},
|
||||
{
|
||||
name: "activation",
|
||||
description: "Set group activation",
|
||||
getArgumentCompletions: (prefix) =>
|
||||
ACTIVATION_LEVELS.filter((v) => v.startsWith(prefix.toLowerCase())).map(
|
||||
(value) => ({ value, label: value }),
|
||||
),
|
||||
ACTIVATION_LEVELS.filter((v) => v.startsWith(prefix.toLowerCase())).map((value) => ({
|
||||
value,
|
||||
label: value,
|
||||
})),
|
||||
},
|
||||
{ name: "abort", description: "Abort active run" },
|
||||
{ name: "new", description: "Reset the session" },
|
||||
@@ -117,11 +118,7 @@ export function getSlashCommands(
|
||||
}
|
||||
|
||||
export function helpText(options: SlashCommandOptions = {}): string {
|
||||
const thinkLevels = formatThinkingLevels(
|
||||
options.provider,
|
||||
options.model,
|
||||
"|",
|
||||
);
|
||||
const thinkLevels = formatThinkingLevels(options.provider, options.model, "|");
|
||||
return [
|
||||
"Slash commands:",
|
||||
"/help",
|
||||
|
||||
Reference in New Issue
Block a user