ikie-cli 0.1.35 → 0.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/repl.js +7 -5
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +3 -1
- package/package.json +1 -1
package/dist/repl.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as readline from 'node:readline';
|
|
2
2
|
import { execSync, exec } from 'child_process';
|
|
3
3
|
import { restoreStdinListeners, extractUpstreamError } from './agent.js';
|
|
4
|
-
import { c, PROMPT, CONTINUE_PROMPT, PROMPT_ARROW, printPromptHeader, promptHeaderText, modeTag, drawBanner, infoLine, successLine, errorLine, THEMES, setTheme, stripAnsi, contextRing, renderSlashMenu, } from './theme.js';
|
|
4
|
+
import { c, PROMPT, CONTINUE_PROMPT, PROMPT_ARROW, printPromptHeader, promptHeaderText, modeTag, drawBanner, infoLine, successLine, errorLine, THEMES, setTheme, stripAnsi, contextRing, renderSlashMenu, supportsVT, CH, } from './theme.js';
|
|
5
5
|
import { renderMarkdown } from './renderer.js';
|
|
6
6
|
import { loadAllMemory } from './memory.js';
|
|
7
7
|
import { HOME_DIR, saveConfig, DEFAULT_MODEL, IKIE_HOST, IKIE_API_BASE, isLoggedIn, getApiKey } from './config.js';
|
|
@@ -1478,7 +1478,7 @@ export async function startREPL(agent, config, projectContext, oneShot) {
|
|
|
1478
1478
|
const pct = tokens / contextWindow;
|
|
1479
1479
|
const ring = tokens > 0 ? contextRing(Math.min(pct, 1)) : '';
|
|
1480
1480
|
const prompt = ring
|
|
1481
|
-
? `${c.primary(
|
|
1481
|
+
? `${c.primary(CH.prompt)} ${ring} ${c.primary(PROMPT_ARROW + ' ')}`
|
|
1482
1482
|
: PROMPT;
|
|
1483
1483
|
if (imageState.pending.length) {
|
|
1484
1484
|
const labels = imageState.pending.map(image => `[Image #${image.id}]`).join(' ');
|
|
@@ -1487,9 +1487,11 @@ export async function startREPL(agent, config, projectContext, oneShot) {
|
|
|
1487
1487
|
currentPrompt = prompt;
|
|
1488
1488
|
rl.setPrompt(prompt);
|
|
1489
1489
|
rl.prompt();
|
|
1490
|
-
// Rotating tip below the prompt
|
|
1491
|
-
|
|
1492
|
-
|
|
1490
|
+
// Rotating tip below the prompt (only on VT-capable terminals)
|
|
1491
|
+
if (supportsVT) {
|
|
1492
|
+
const tip = TIPS[tipIndex++ % TIPS.length];
|
|
1493
|
+
process.stdout.write(`\x1b[s\n${c.dim(' ' + tip)}\x1b[u`);
|
|
1494
|
+
}
|
|
1493
1495
|
}
|
|
1494
1496
|
};
|
|
1495
1497
|
rl.on('close', () => {
|
package/dist/theme.d.ts
CHANGED
|
@@ -41,6 +41,8 @@ export declare function drawBanner(model: string): void;
|
|
|
41
41
|
export declare function modeTag(mode: 'agent' | 'plan'): string;
|
|
42
42
|
/** Circular fill indicator for context usage. */
|
|
43
43
|
export declare function contextRing(pct: number): string;
|
|
44
|
+
/** True when the terminal supports VT100 escape sequences. */
|
|
45
|
+
export declare const supportsVT: boolean;
|
|
44
46
|
declare const CH: {
|
|
45
47
|
tl: string;
|
|
46
48
|
prompt: string;
|
package/dist/theme.js
CHANGED
|
@@ -280,8 +280,10 @@ export function contextRing(pct) {
|
|
|
280
280
|
return `${color(char)} ${color(`${Math.round(pct * 100)}%`)}`;
|
|
281
281
|
}
|
|
282
282
|
const IS_WIN = process.platform === 'win32';
|
|
283
|
+
/** True when the terminal supports VT100 escape sequences. */
|
|
284
|
+
export const supportsVT = !IS_WIN || (chalk.level > 0);
|
|
283
285
|
const CH = IS_WIN
|
|
284
|
-
? { tl: '+-', prompt: '
|
|
286
|
+
? { tl: '+-', prompt: '-> ', cont: '| ', arrow: '>', dot: 'o' }
|
|
285
287
|
: { tl: '╭─', prompt: '╰─❯', cont: '│ ', arrow: '❯', dot: '●' };
|
|
286
288
|
export { CH };
|
|
287
289
|
/**
|