free-pi-cli 0.6.12 → 0.6.13
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/index.js
CHANGED
|
@@ -515,7 +515,7 @@ function folderMatches(cwd, sessionCwd) {
|
|
|
515
515
|
// package.json
|
|
516
516
|
var package_default = {
|
|
517
517
|
name: "free-pi-cli",
|
|
518
|
-
version: "0.6.
|
|
518
|
+
version: "0.6.13",
|
|
519
519
|
description: "Free AI coding agent for your terminal. Ads and a daily free allowance pay for the models; sign in with GitHub and run npx free-pi-cli.",
|
|
520
520
|
keywords: [
|
|
521
521
|
"coding agent",
|
|
@@ -6267,6 +6267,10 @@ var ConfigSchema = object({
|
|
|
6267
6267
|
experientialTtftMs: number2().int().min(1).default(1e4),
|
|
6268
6268
|
experientialMaxCostUsdPerRequest: string2().default("0.0005"),
|
|
6269
6269
|
experientialPriceCooldownMs: number2().int().min(1).default(3600000),
|
|
6270
|
+
particleEnabled: boolean2().default(false),
|
|
6271
|
+
particleBaseUrl: string2().default("https://api.particle.ai/v1"),
|
|
6272
|
+
particleModel: string2().default("particle-1"),
|
|
6273
|
+
particleTtftMs: number2().int().min(1).default(1e4),
|
|
6270
6274
|
minCliVersion: string2().default("0.0.0"),
|
|
6271
6275
|
latestCliVersion: string2().default("0.2.0"),
|
|
6272
6276
|
minDesktopVersion: string2().default("0.0.0"),
|
|
@@ -6571,6 +6575,10 @@ function loadConfig(env = process.env) {
|
|
|
6571
6575
|
experientialTtftMs: envNumber(env.EXPERIENTIAL_TTFT_MS),
|
|
6572
6576
|
experientialMaxCostUsdPerRequest: /^\d{1,6}(\.\d{1,6})?$/.test(env.EXPERIENTIAL_MAX_COST_USD_PER_REQUEST?.trim() ?? "") ? env.EXPERIENTIAL_MAX_COST_USD_PER_REQUEST.trim() : undefined,
|
|
6573
6577
|
experientialPriceCooldownMs: envNumber(env.EXPERIENTIAL_PRICE_COOLDOWN_MS),
|
|
6578
|
+
particleEnabled: envBoolean(env.PARTICLE_ENABLED),
|
|
6579
|
+
particleBaseUrl: env.PARTICLE_BASE_URL?.trim().replace(/\/$/, "") || undefined,
|
|
6580
|
+
particleModel: env.PARTICLE_MODEL?.trim() || undefined,
|
|
6581
|
+
particleTtftMs: envNumber(env.PARTICLE_TTFT_MS),
|
|
6574
6582
|
minCliVersion: env.MIN_CLI_VERSION || undefined,
|
|
6575
6583
|
latestCliVersion: env.LATEST_CLI_VERSION || undefined,
|
|
6576
6584
|
minDesktopVersion: env.MIN_DESKTOP_VERSION || undefined,
|
|
@@ -9636,6 +9644,12 @@ function mergeAttribution(a, b) {
|
|
|
9636
9644
|
|
|
9637
9645
|
// src/changelog.ts
|
|
9638
9646
|
var CHANGELOG_HIGHLIGHTS = [
|
|
9647
|
+
{
|
|
9648
|
+
version: "0.6.13",
|
|
9649
|
+
highlights: [
|
|
9650
|
+
"New: Particle, a free model that uses no credits, when it is available."
|
|
9651
|
+
]
|
|
9652
|
+
},
|
|
9639
9653
|
{
|
|
9640
9654
|
version: "0.6.12",
|
|
9641
9655
|
highlights: [
|
|
@@ -11425,6 +11439,8 @@ var ALL_COMMANDS = [
|
|
|
11425
11439
|
var commands = () => ALL_COMMANDS.filter((c) => c.name !== "/hive" || process.env.FREEPI_HIVE === "1");
|
|
11426
11440
|
var NAME_COLUMN = 24;
|
|
11427
11441
|
var WELCOME_LINE = "Welcome to Free Pi, ad-supported inference. Please visit our advertisers to support us.";
|
|
11442
|
+
var PARTICLE_ID = "particle";
|
|
11443
|
+
var PARTICLE_LINE = "Free Particle — doesn't use any credits.";
|
|
11428
11444
|
var GUEST_LINE = "Guest trial — sign in with GitHub (/login) to unlock daily credits and a comeback bonus.";
|
|
11429
11445
|
var CONSENT_LINE_1 = "Usage is funded by ads and training. By using free-pi you consent.";
|
|
11430
11446
|
var CONSENT_LINE_2 = "See /tos and /privacy-policy.";
|
|
@@ -11455,7 +11471,7 @@ function truncate2(text, maxWidth) {
|
|
|
11455
11471
|
return text.slice(0, maxWidth);
|
|
11456
11472
|
return `${text.slice(0, maxWidth - 1)}…`;
|
|
11457
11473
|
}
|
|
11458
|
-
function headerLines(theme, modelName, expanded, width = Number.POSITIVE_INFINITY, updateLatest, guest, allowanceLine) {
|
|
11474
|
+
function headerLines(theme, modelName, expanded, width = Number.POSITIVE_INFINITY, updateLatest, guest, allowanceLine, particleFree) {
|
|
11459
11475
|
const inner = width - 1;
|
|
11460
11476
|
const fit = (plain, styled) => plain.length <= inner ? styled() : theme.fg("dim", truncate2(plain, inner));
|
|
11461
11477
|
const titleRest = ` · ${modelName} · ctrl+o for help`;
|
|
@@ -11470,6 +11486,7 @@ function headerLines(theme, modelName, expanded, width = Number.POSITIVE_INFINIT
|
|
|
11470
11486
|
title,
|
|
11471
11487
|
"",
|
|
11472
11488
|
dim(WELCOME_LINE),
|
|
11489
|
+
...particleFree ? [dim(PARTICLE_LINE)] : [],
|
|
11473
11490
|
...guest ? [dim(GUEST_LINE)] : [],
|
|
11474
11491
|
...allowanceLine ? [dim(allowanceLine)] : [],
|
|
11475
11492
|
"",
|
|
@@ -11495,7 +11512,9 @@ function createHeaderExtension(opts) {
|
|
|
11495
11512
|
let expanded = false;
|
|
11496
11513
|
return {
|
|
11497
11514
|
render(width) {
|
|
11498
|
-
|
|
11515
|
+
const active = ctx.model?.id;
|
|
11516
|
+
const name = active && opts.modelNameFor?.(active) || opts.modelName;
|
|
11517
|
+
return headerLines(theme, name, expanded, width, opts.updateLatest, opts.guest, opts.allowanceLine, active === PARTICLE_ID);
|
|
11499
11518
|
},
|
|
11500
11519
|
invalidate() {},
|
|
11501
11520
|
setExpanded(next) {
|
|
@@ -13409,7 +13428,8 @@ function buildRuntimeOptions(opts, sessionId) {
|
|
|
13409
13428
|
modelName: resolveModelName(opts),
|
|
13410
13429
|
updateLatest: opts.updateLatest,
|
|
13411
13430
|
guest: opts.guest,
|
|
13412
|
-
allowanceLine: opts.allowanceLine
|
|
13431
|
+
allowanceLine: opts.allowanceLine,
|
|
13432
|
+
modelNameFor: (id) => catalogModelsFor(opts).find((m) => m.id === id)?.name
|
|
13413
13433
|
});
|
|
13414
13434
|
const todoToolExtension = createTodoToolExtension();
|
|
13415
13435
|
const shellSandbox = opts.shellSandbox ?? createShellSandbox();
|
package/package.json
CHANGED