Compare commits
No commits in common. "f1c65b2c1b0ed2318fcb4092bf9a83eb79e97321" and "b6ee3e071f0c4c5fc11c78208397cc2a294e3d8a" have entirely different histories.
f1c65b2c1b
...
b6ee3e071f
@ -36,7 +36,7 @@ interface Config {
|
|||||||
[key: string]: unknown;
|
[key: string]: unknown;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_AUXILIARY_TASKS = [
|
const AUXILIARY_TASKS = [
|
||||||
"vision",
|
"vision",
|
||||||
"web_extract",
|
"web_extract",
|
||||||
"compression",
|
"compression",
|
||||||
@ -47,18 +47,6 @@ const DEFAULT_AUXILIARY_TASKS = [
|
|||||||
"approval",
|
"approval",
|
||||||
];
|
];
|
||||||
|
|
||||||
function getAuxiliaryTasks(): string[] {
|
|
||||||
try {
|
|
||||||
const config = loadConfig();
|
|
||||||
const aux = config.auxiliary || {};
|
|
||||||
const tasks = Object.keys(aux).filter(
|
|
||||||
(k) => typeof aux[k] === "object" && aux[k]?.provider !== undefined
|
|
||||||
);
|
|
||||||
if (tasks.length > 0) return tasks;
|
|
||||||
} catch {}
|
|
||||||
return DEFAULT_AUXILIARY_TASKS;
|
|
||||||
}
|
|
||||||
|
|
||||||
// ── Helpers ────────────────────────────────────────────────────────────
|
// ── Helpers ────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
function loadConfig(): Config {
|
function loadConfig(): Config {
|
||||||
@ -336,7 +324,7 @@ function switchConfig(opts: SwitchOptions) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
saveConfig(config);
|
saveConfig(config);
|
||||||
console.log("\nConfig saved. Run 'hermes gateway restart' or start a new session to apply.");
|
console.log("\nConfig saved. New sessions will use the updated settings.");
|
||||||
}
|
}
|
||||||
|
|
||||||
async function switchTelegram(opts: SwitchOptions) {
|
async function switchTelegram(opts: SwitchOptions) {
|
||||||
@ -398,19 +386,16 @@ async function switchTelegram(opts: SwitchOptions) {
|
|||||||
if (result.ok) {
|
if (result.ok) {
|
||||||
console.log(`Sent: ${command}`);
|
console.log(`Sent: ${command}`);
|
||||||
console.log(opts.global ? "Persistent change (--global)." : "Current session only.");
|
console.log(opts.global ? "Persistent change (--global)." : "Current session only.");
|
||||||
// Clean up the command message after a delay so hermes can process it
|
// Clean up the command message
|
||||||
if (result.result?.message_id) {
|
if (result.result?.message_id) {
|
||||||
const msgId = result.result.message_id;
|
await fetch(`https://api.telegram.org/bot${token}/deleteMessage`, {
|
||||||
setTimeout(async () => {
|
method: "POST",
|
||||||
await fetch(`https://api.telegram.org/bot${token}/deleteMessage`, {
|
headers: { "Content-Type": "application/json" },
|
||||||
method: "POST",
|
body: JSON.stringify({
|
||||||
headers: { "Content-Type": "application/json" },
|
chat_id: chatId,
|
||||||
body: JSON.stringify({
|
message_id: result.result.message_id,
|
||||||
chat_id: chatId,
|
}),
|
||||||
message_id: msgId,
|
}).catch(() => {});
|
||||||
}),
|
|
||||||
}).catch(() => {});
|
|
||||||
}, 3000);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.error(`Telegram API error: ${result.description}`);
|
console.error(`Telegram API error: ${result.description}`);
|
||||||
@ -491,12 +476,11 @@ export async function models(args: string[]) {
|
|||||||
i++;
|
i++;
|
||||||
} else if (args[i] === "--aux" && i + 1 < args.length) {
|
} else if (args[i] === "--aux" && i + 1 < args.length) {
|
||||||
const task = args[i + 1];
|
const task = args[i + 1];
|
||||||
const knownTasks = getAuxiliaryTasks();
|
if (!AUXILIARY_TASKS.includes(task)) {
|
||||||
if (!knownTasks.includes(task)) {
|
console.error(`Unknown auxiliary task: ${task}`);
|
||||||
console.error(`Unknown auxiliary task: ${task}`);
|
console.error(`Available: ${AUXILIARY_TASKS.join(", ")}`);
|
||||||
console.error(`Available: ${knownTasks.join(", ")}`);
|
process.exit(1);
|
||||||
process.exit(1);
|
}
|
||||||
}
|
|
||||||
auxTasks.push(task);
|
auxTasks.push(task);
|
||||||
i += 2;
|
i += 2;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user