free-pi-cli 0.6.0 → 0.6.1

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
@@ -30,4 +30,4 @@ if (err) {
30
30
  console.error(err);
31
31
  process.exit(1);
32
32
  }
33
- await import("./main-98djq99p.js");
33
+ await import("./main-zv5s2zn8.js");
@@ -15029,7 +15029,7 @@ var HiveClassifyResponseSchema = exports_external.object({
15029
15029
  // package.json
15030
15030
  var package_default = {
15031
15031
  name: "free-pi-cli",
15032
- version: "0.6.0",
15032
+ version: "0.6.1",
15033
15033
  description: "Free, ad-supported distribution of the pi coding agent. Inference paid for by ads.",
15034
15034
  license: "MIT",
15035
15035
  type: "module",
@@ -20433,7 +20433,7 @@ at first run, before the GitHub sign-in.
20433
20433
  Each user gets a free allowance every day. The allowance can change with
20434
20434
  supply and demand. \`/usage\` shows how much of today's allowance is spent, as
20435
20435
  a percentage, with token counts.
20436
- One session per account runs at a time. If a previous session is stuck,
20436
+ You can run free-pi in more than one terminal. If a previous session is stuck,
20437
20437
  \`/close-other-session\` frees it.
20438
20438
 
20439
20439
  ## Credits
@@ -21054,20 +21054,65 @@ function registerBugAutocomplete(pi) {
21054
21054
  }
21055
21055
 
21056
21056
  // src/footer-align.ts
21057
- var ANSI = /\x1b\[[0-9;]*m/g;
21058
- var SIMPLE = /^[\x20-\x7e\xa0-\xff]*$/;
21057
+ import { truncateToWidth as truncateToWidth4, visibleWidth as visibleWidth2 } from "@earendil-works/pi-tui";
21058
+ var MIN_GAP = 2;
21059
+ var MIN_CWD = 8;
21060
+ var LEADING_SGR = /^(?:\x1b\[[0-9;]*m)+/;
21061
+ function mergeStatusIntoCwdLine(lines, width) {
21062
+ if (lines.length < 3)
21063
+ return lines;
21064
+ const [cwd, stats] = lines;
21065
+ const status = lines[lines.length - 1];
21066
+ const statusW = visibleWidth2(status);
21067
+ let left = cwd;
21068
+ if (visibleWidth2(left) + MIN_GAP + statusW > width) {
21069
+ const room = width - MIN_GAP - statusW;
21070
+ if (room < MIN_CWD)
21071
+ return lines;
21072
+ const style = LEADING_SGR.exec(cwd)?.[0] ?? "";
21073
+ left = truncateToWidth4(cwd, room, style ? `${style}...\x1B[0m` : "...");
21074
+ }
21075
+ const gap = " ".repeat(Math.max(MIN_GAP, width - visibleWidth2(left) - statusW));
21076
+ return [left + gap + status, stats, ...lines.slice(2, -1)];
21077
+ }
21059
21078
  function installFooterRightAlign(mode) {
21060
21079
  const footer = mode.footer;
21061
21080
  const render = footer.render.bind(footer);
21062
- footer.render = (w) => {
21063
- const lines = render(w);
21064
- if (lines.length <= 2)
21065
- return lines;
21066
- const last = lines[lines.length - 1];
21067
- const text = last.replace(ANSI, "");
21068
- if (!SIMPLE.test(text))
21069
- return lines;
21070
- return [...lines.slice(0, -1), " ".repeat(Math.max(0, w - text.length)) + last];
21081
+ footer.render = (w) => mergeStatusIntoCwdLine(render(w), w);
21082
+ }
21083
+
21084
+ // src/guest-handoff.ts
21085
+ var LOGIN_VALUE_LINE = "sign in free with GitHub: full daily allowance, FREE abliterated DeepSeek, history saved";
21086
+ var GUEST_NEAR_WALL_LINE = `A few guest requests left. ${LOGIN_VALUE_LINE}`;
21087
+ var SIGNED_IN_CONTINUE_LINE = "Signed in. Your conversation continues — full daily allowance is unlocked.";
21088
+ var HEADLESS_FALLBACK_LINE = "No browser or clipboard here — open the URL and enter the code above.";
21089
+ function isHandoffTreatment(variant) {
21090
+ return variant === "treatment";
21091
+ }
21092
+ var GUEST_NOTES = [
21093
+ "Signed-in users get the Defense models in /model, for security work on code and systems you own. Sign in free with /login.",
21094
+ "With the Defense models you can audit your own repo for vulnerabilities and get fixes, without the usual refusals. /login to unlock.",
21095
+ "Write detection rules and review your server configs with the Defense models. Sign in free with /login.",
21096
+ "More on security work with free-pi: https://freepi.ai/cybersecurity. /login to unlock the Defense models."
21097
+ ];
21098
+ var GUEST_NOTE_EVERY_TURNS = 3;
21099
+ function createGuestNotesExtension(opts) {
21100
+ let turns = 0;
21101
+ let shown = 0;
21102
+ return {
21103
+ name: "free-pi-guest-notes",
21104
+ factory(pi) {
21105
+ pi.on("agent_end", (event, ctx) => {
21106
+ if (!opts.isGuest() || shown >= GUEST_NOTES.length)
21107
+ return;
21108
+ const last = [...event.messages].reverse().find((m) => m.role === "assistant");
21109
+ if (last?.stopReason !== "stop")
21110
+ return;
21111
+ if (++turns % GUEST_NOTE_EVERY_TURNS !== 0)
21112
+ return;
21113
+ ctx.ui.notify(GUEST_NOTES[shown++], "info");
21114
+ });
21115
+ }
21071
21116
  };
21072
21117
  }
21073
21118
 
@@ -21113,6 +21158,15 @@ function mergeAttribution(a, b) {
21113
21158
 
21114
21159
  // src/changelog.ts
21115
21160
  var CHANGELOG_HIGHLIGHTS = [
21161
+ {
21162
+ version: "0.6.1",
21163
+ highlights: [
21164
+ "/model shows the Defense models by their real names.",
21165
+ "Five more Defense models: Abliterated Large V2, Qwen 3.6 Plus Uncensored, Gemma 4 Uncensored, GLM 4.7 Flash Heretic and Uncensored 1.2.",
21166
+ "The footer is two lines: credits left now sit next to the folder name.",
21167
+ "The welcome text no longer says you can only run one session."
21168
+ ]
21169
+ },
21116
21170
  {
21117
21171
  version: "0.6.0",
21118
21172
  highlights: [
@@ -21522,15 +21576,6 @@ async function submitUserConsent(baseUrl, jwt2, consentVersion) {
21522
21576
  throw new Error(`consent submission failed: HTTP ${res.status}`);
21523
21577
  }
21524
21578
 
21525
- // src/guest-handoff.ts
21526
- var LOGIN_VALUE_LINE = "sign in free with GitHub: full daily allowance, FREE abliterated DeepSeek, history saved";
21527
- var GUEST_NEAR_WALL_LINE = `A few guest requests left. ${LOGIN_VALUE_LINE}`;
21528
- var SIGNED_IN_CONTINUE_LINE = "Signed in. Your conversation continues — full daily allowance is unlocked.";
21529
- var HEADLESS_FALLBACK_LINE = "No browser or clipboard here — open the URL and enter the code above.";
21530
- function isHandoffTreatment(variant) {
21531
- return variant === "treatment";
21532
- }
21533
-
21534
21579
  // src/clipboard.ts
21535
21580
  import { spawn as spawn2 } from "node:child_process";
21536
21581
  import { existsSync as existsSync2 } from "node:fs";
@@ -24235,7 +24280,8 @@ function buildRuntimeOptions(opts, sessionId) {
24235
24280
  codemodeExtension,
24236
24281
  toolSearchExtension,
24237
24282
  hiveExtension,
24238
- ...guestLoginExtension ? [guestLoginExtension] : []
24283
+ ...guestLoginExtension ? [guestLoginExtension] : [],
24284
+ ...opts.guest ? [createGuestNotesExtension({ isGuest: () => auth.isGuest() })] : []
24239
24285
  ];
24240
24286
  const settingsManager = buildSettingsManager(opts, models, opts.projectTrusted === true);
24241
24287
  return {
@@ -24546,8 +24592,8 @@ Welcome to free-pi — a free coding agent in your terminal.
24546
24592
  • It's the pi coding agent, free to use. Ads in the terminal pay for the
24547
24593
  inference — ad content never reaches the model.
24548
24594
  • Tell it what to build, fix, or explain, like any coding assistant.
24549
- • One session per account at a time. If you close the terminal, relaunch
24550
- with "npx free-pi-cli" — or resume where you left off with
24595
+ • You can run free-pi in more than one terminal. If you close the terminal,
24596
+ relaunch with "npx free-pi-cli" — or resume where you left off with
24551
24597
  "npx free-pi-cli --session <id>" (the id prints when you exit).
24552
24598
 
24553
24599
  Set ${INTRO_ENV_SKIP}=1 to skip this next time.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "free-pi-cli",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Free, ad-supported distribution of the pi coding agent. Inference paid for by ads.",
5
5
  "license": "MIT",
6
6
  "type": "module",