ikie-cli 0.1.15 → 0.1.17
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/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/repl.js +20 -3
- package/package.json +1 -1
package/dist/config.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export declare const CONFIG_FILE: string;
|
|
|
3
3
|
export declare const GLOBAL_MEMORY_FILE: string;
|
|
4
4
|
export declare const SESSIONS_DIR: string;
|
|
5
5
|
export declare const FIREWORKS_BASE_URL = "https://api.fireworks.ai/inference/v1";
|
|
6
|
-
export declare const DEFAULT_MODEL = "
|
|
6
|
+
export declare const DEFAULT_MODEL = "kimi-k2p7-code";
|
|
7
7
|
/**
|
|
8
8
|
* The hosted ikie API (masks the upstream provider behind ik_live_ keys).
|
|
9
9
|
* Override with IKIE_HOST env var, e.g. for local dev or a custom domain.
|
package/dist/config.js
CHANGED
|
@@ -6,7 +6,7 @@ export const CONFIG_FILE = join(HOME_DIR, 'config.json');
|
|
|
6
6
|
export const GLOBAL_MEMORY_FILE = join(HOME_DIR, 'memory.md');
|
|
7
7
|
export const SESSIONS_DIR = join(HOME_DIR, 'sessions');
|
|
8
8
|
export const FIREWORKS_BASE_URL = 'https://api.fireworks.ai/inference/v1';
|
|
9
|
-
export const DEFAULT_MODEL = '
|
|
9
|
+
export const DEFAULT_MODEL = 'kimi-k2p7-code';
|
|
10
10
|
/**
|
|
11
11
|
* The hosted ikie API (masks the upstream provider behind ik_live_ keys).
|
|
12
12
|
* Override with IKIE_HOST env var, e.g. for local dev or a custom domain.
|
package/dist/repl.js
CHANGED
|
@@ -34,7 +34,6 @@ async function fetchAndDisplayModels(config) {
|
|
|
34
34
|
const defaultLabel = model.is_default ? c.success(' [DEFAULT]') : '';
|
|
35
35
|
const contextInfo = c.muted(`(${(model.context_window / 1024).toFixed(0)}K context)`);
|
|
36
36
|
console.log(` ${c.secondary(model.name.padEnd(24))} ${c.white(model.display_name)}${defaultLabel} ${contextInfo}`);
|
|
37
|
-
console.log(` ${c.dim(model.provider_model_id)}`);
|
|
38
37
|
}
|
|
39
38
|
console.log(`\n${c.muted('To switch models:')}`);
|
|
40
39
|
console.log(` ${c.accent('/model')} ${c.muted('<name>')}`);
|
|
@@ -616,6 +615,19 @@ async function handleSlashCommand(input, agent, config, projectContext, rl, sess
|
|
|
616
615
|
return true;
|
|
617
616
|
}
|
|
618
617
|
}
|
|
618
|
+
function fmtReset(resetAt) {
|
|
619
|
+
if (!resetAt)
|
|
620
|
+
return 'not started';
|
|
621
|
+
const ms = resetAt - Date.now();
|
|
622
|
+
if (ms <= 0)
|
|
623
|
+
return 'now';
|
|
624
|
+
const mins = Math.ceil(ms / 60000);
|
|
625
|
+
const h = Math.floor(mins / 60);
|
|
626
|
+
const m = mins % 60;
|
|
627
|
+
if (h >= 24)
|
|
628
|
+
return `${Math.floor(h / 24)}d ${h % 24}h`;
|
|
629
|
+
return h > 0 ? `${h}h ${m}m` : `${m}m`;
|
|
630
|
+
}
|
|
619
631
|
function fmtUsd(n) {
|
|
620
632
|
if (n === 0)
|
|
621
633
|
return '$0.00';
|
|
@@ -634,7 +646,11 @@ function printUsage(data) {
|
|
|
634
646
|
const s = data.stats;
|
|
635
647
|
const row = (label, value) => console.log(` ${c.secondary(label.padEnd(18))} ${c.white(value)}`);
|
|
636
648
|
console.log(`\n${c.primary.bold('Account Usage')}\n`);
|
|
637
|
-
|
|
649
|
+
const w5 = data.limits.fiveHour;
|
|
650
|
+
const wk = data.limits.weekly;
|
|
651
|
+
const limitColor = (rem, lim) => rem <= 0 ? c.error : rem / lim <= 0.3 ? c.warning : c.success;
|
|
652
|
+
row('5-hour limit', `${limitColor(w5.remaining, w5.limit).bold(fmtUsd(w5.remaining))} left ${c.muted(`of ${fmtUsd(w5.limit)} · resets ${fmtReset(w5.resetAt)}`)}`);
|
|
653
|
+
row('Weekly limit', `${limitColor(wk.remaining, wk.limit).bold(fmtUsd(wk.remaining))} left ${c.muted(`of ${fmtUsd(wk.limit)} · resets ${fmtReset(wk.resetAt)}`)}`);
|
|
638
654
|
row('Total spent', fmtUsd(s.totalCost));
|
|
639
655
|
console.log();
|
|
640
656
|
row('Requests · 30d', s.requests30d.toLocaleString());
|
|
@@ -746,7 +762,8 @@ function selectModelInteractively(rl, config) {
|
|
|
746
762
|
return;
|
|
747
763
|
}
|
|
748
764
|
const chosen = models[num - 1];
|
|
749
|
-
config.model = chosen.
|
|
765
|
+
config.model = chosen.name;
|
|
766
|
+
saveConfig({ model: chosen.name });
|
|
750
767
|
console.log(successLine(`Switched to ${chosen.name} — ${chosen.display_name}`));
|
|
751
768
|
resolve();
|
|
752
769
|
});
|