clixad 0.0.1-beta.3 → 0.0.1-beta.5
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/clixad.mjs +17 -12
- package/package.json +1 -1
package/dist/clixad.mjs
CHANGED
|
@@ -1319,7 +1319,7 @@ var init_kimi = __esm({
|
|
|
1319
1319
|
"use strict";
|
|
1320
1320
|
CONTEXT_TOKENS = {
|
|
1321
1321
|
"gpt-5-nano": 4e5,
|
|
1322
|
-
"gemini-2.5-flash-lite":
|
|
1322
|
+
"gemini-2.5-flash-lite": 1048576,
|
|
1323
1323
|
"deepseek-v4-flash": 1048576,
|
|
1324
1324
|
"gemini-3.1-flash-lite": 1048576,
|
|
1325
1325
|
"kimi-k2": 131072,
|
|
@@ -3051,8 +3051,8 @@ async function githubLogin(client, config, start, invite) {
|
|
|
3051
3051
|
saveConfig(config);
|
|
3052
3052
|
console.log(c.green(`
|
|
3053
3053
|
\u2713 logged in as ${poll.login}`) + c.dim(poll.email ? ` (${poll.email})` : ""));
|
|
3054
|
-
const bonus = poll.created ? c.dim(` (signup bonus ${poll.signupBonus})`) : "";
|
|
3055
|
-
console.log(` balance: ${c.bold(
|
|
3054
|
+
const bonus = poll.created ? c.dim(` (signup bonus ${credits(poll.signupBonus)})`) : "";
|
|
3055
|
+
console.log(` balance: ${c.bold(credits(poll.balance))} credits${bonus}`);
|
|
3056
3056
|
console.log(c.dim(` token stored in ${configPath()}`));
|
|
3057
3057
|
return;
|
|
3058
3058
|
}
|
|
@@ -3079,10 +3079,11 @@ async function devLogin(client, config, email, invite) {
|
|
|
3079
3079
|
config.email = res.email;
|
|
3080
3080
|
saveConfig(config);
|
|
3081
3081
|
console.log(c.green(`\u2713 logged in as ${res.email}`));
|
|
3082
|
-
console.log(` balance: ${c.bold(
|
|
3082
|
+
console.log(` balance: ${c.bold(credits(res.balance))} credits (signup bonus)`);
|
|
3083
3083
|
console.log(c.dim(` token stored in ${configPath()}`));
|
|
3084
3084
|
}
|
|
3085
3085
|
var sleep2 = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
3086
|
+
var credits = (n) => n.toLocaleString("en-US");
|
|
3086
3087
|
function logout(config) {
|
|
3087
3088
|
delete config.token;
|
|
3088
3089
|
delete config.userId;
|
|
@@ -3094,7 +3095,7 @@ async function whoami(client, config) {
|
|
|
3094
3095
|
if (!config.token) return console.log(c.yellow("not logged in \u2014 run `clixad login`"));
|
|
3095
3096
|
const w = await client.wallet();
|
|
3096
3097
|
console.log(`${c.bold(config.email ?? "unknown")} \xB7 model ${c.cyan(config.model)}`);
|
|
3097
|
-
console.log(`balance: ${c.bold(
|
|
3098
|
+
console.log(`balance: ${c.bold(credits(w.balance))} credits \xB7 ${earnedToday(w)}`);
|
|
3098
3099
|
}
|
|
3099
3100
|
function earnedToday(w) {
|
|
3100
3101
|
const offers = `${w.ads_today} offer${w.ads_today === 1 ? "" : "s"}`;
|
|
@@ -3198,7 +3199,6 @@ async function buyCmd(client, config, pack) {
|
|
|
3198
3199
|
console.log(`
|
|
3199
3200
|
Stripe Checkout: ${c.bold(checkout.pack)} \u2014 ${checkout.credits.toLocaleString("en-US")} credits for ${c.bold("$" + checkout.price_usd.toFixed(2))}`);
|
|
3200
3201
|
console.log(c.dim(` ${checkout.url}`));
|
|
3201
|
-
console.log(c.dim(" Test card: 4242 4242 4242 4242 \xB7 any future expiry \xB7 any CVC \xB7 any ZIP\n"));
|
|
3202
3202
|
openBrowser(checkout.url);
|
|
3203
3203
|
process.stdout.write(c.dim(" waiting for payment to clear"));
|
|
3204
3204
|
const deadline = Date.now() + 5 * 60 * 1e3;
|
|
@@ -3208,7 +3208,7 @@ async function buyCmd(client, config, pack) {
|
|
|
3208
3208
|
const balance = (await safeWallet(client))?.balance ?? before;
|
|
3209
3209
|
if (balance > before) {
|
|
3210
3210
|
console.log(c.green(`
|
|
3211
|
-
\u2713 +${(balance - before)
|
|
3211
|
+
\u2713 +${credits(balance - before)} credits`) + ` \xB7 balance ${c.bold(credits(balance))}`);
|
|
3212
3212
|
return;
|
|
3213
3213
|
}
|
|
3214
3214
|
}
|
|
@@ -3292,10 +3292,6 @@ async function codeCmd(client, config, rest) {
|
|
|
3292
3292
|
if (code !== 0) process.exitCode = code;
|
|
3293
3293
|
}
|
|
3294
3294
|
async function repl(client, config, opts = {}) {
|
|
3295
|
-
if (!config.token) {
|
|
3296
|
-
console.log(c.yellow("Not logged in. Run `clixad login` first.\n"));
|
|
3297
|
-
return;
|
|
3298
|
-
}
|
|
3299
3295
|
if (opts.resume === "pick") {
|
|
3300
3296
|
const sessions = listSessions(void 0, 10);
|
|
3301
3297
|
if (!sessions.length) return console.log(c.yellow("no saved sessions yet"));
|
|
@@ -3307,9 +3303,18 @@ async function repl(client, config, opts = {}) {
|
|
|
3307
3303
|
return;
|
|
3308
3304
|
}
|
|
3309
3305
|
if (!process.stdin.isTTY) {
|
|
3306
|
+
if (!config.token) {
|
|
3307
|
+
console.log(c.yellow("Not logged in, and interactive mode needs a terminal."));
|
|
3308
|
+
console.log(c.dim(' Run `clixad login` in a terminal, then `clixad -p "..."` for scripted runs.'));
|
|
3309
|
+
return;
|
|
3310
|
+
}
|
|
3310
3311
|
console.log(c.yellow('Interactive mode needs a terminal. Use `clixad -p "..."` for scripted runs.'));
|
|
3311
3312
|
return;
|
|
3312
3313
|
}
|
|
3314
|
+
if (!config.token) {
|
|
3315
|
+
await login(client, config, []);
|
|
3316
|
+
if (!config.token) return;
|
|
3317
|
+
}
|
|
3313
3318
|
let session;
|
|
3314
3319
|
if (opts.resume === "latest") {
|
|
3315
3320
|
session = latestSession(process.cwd());
|
|
@@ -3373,7 +3378,7 @@ function printHelp() {
|
|
|
3373
3378
|
${c.cyan("--continue")} resume the last session in this directory
|
|
3374
3379
|
${c.cyan("--resume")} [id] list saved sessions, or resume one
|
|
3375
3380
|
${c.cyan("--version")} print the version and exit
|
|
3376
|
-
(no command) interactive coding REPL`);
|
|
3381
|
+
(no command) interactive coding REPL ${c.dim("(signs you in if needed)")}`);
|
|
3377
3382
|
}
|
|
3378
3383
|
main().catch((err) => {
|
|
3379
3384
|
console.error(c.red(err.message));
|