feat(tui,gemini): implement verbose transfer and url image fetch
This commit is contained in:
+15
-13
@@ -232,6 +232,18 @@ export function registerTuiCommand(program: Command): void {
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
const transferSessionToTarget = (target: string): string => {
|
||||
if (target !== 'telegram') {
|
||||
return `Unknown transfer target: ${target}`;
|
||||
}
|
||||
if (!config.telegram || config.telegram.allowed_chat_ids.length === 0) {
|
||||
return 'Telegram not configured';
|
||||
}
|
||||
const telegramUserId = String(config.telegram.allowed_chat_ids[0]);
|
||||
sessionManager.transferSession('tui', 'local', 'telegram', telegramUserId);
|
||||
return `Session transferred to Telegram (${telegramUserId})`;
|
||||
};
|
||||
|
||||
if (opts.fullscreen) {
|
||||
await startFullscreenTui({
|
||||
session,
|
||||
@@ -243,6 +255,7 @@ export function registerTuiCommand(program: Command): void {
|
||||
hookEngine,
|
||||
modelProviderConfigs,
|
||||
contextThresholdPct: config.compaction.threshold_pct,
|
||||
onTransfer: transferSessionToTarget,
|
||||
onExit: cleanup,
|
||||
});
|
||||
} else {
|
||||
@@ -260,19 +273,7 @@ export function registerTuiCommand(program: Command): void {
|
||||
modelProviderConfigs,
|
||||
contextThresholdPct: config.compaction.threshold_pct,
|
||||
currentLocalProvider: config.models.local?.provider,
|
||||
onTransfer: (target) => {
|
||||
if (target === 'telegram') {
|
||||
if (config.telegram && config.telegram.allowed_chat_ids.length > 0) {
|
||||
const telegramUserId = String(config.telegram.allowed_chat_ids[0]);
|
||||
sessionManager.transferSession('tui', 'local', 'telegram', telegramUserId);
|
||||
console.log(`Session transferred to Telegram (${telegramUserId})\n`);
|
||||
} else {
|
||||
console.log('Telegram not configured\n');
|
||||
}
|
||||
} else {
|
||||
console.log(`Unknown transfer target: ${target}\n`);
|
||||
}
|
||||
},
|
||||
onTransfer: transferSessionToTarget,
|
||||
onFullscreen: () => {
|
||||
switchingToFullscreen = true;
|
||||
tui.stop(true);
|
||||
@@ -293,6 +294,7 @@ export function registerTuiCommand(program: Command): void {
|
||||
hookEngine,
|
||||
modelProviderConfigs,
|
||||
contextThresholdPct: config.compaction.threshold_pct,
|
||||
onTransfer: transferSessionToTarget,
|
||||
onExit: cleanup,
|
||||
});
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user