billion-context-pi 0.0.5 → 0.0.6

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
@@ -7044,8 +7044,9 @@ __export(typebox_exports, {
7044
7044
  // src/log.ts
7045
7045
  import { promises as fs2 } from "fs";
7046
7046
  import * as path2 from "path";
7047
+ import { homedir } from "os";
7047
7048
  var ENV_DEBUG = process.env.ACP_DEBUG === "1" || process.env.ACP_DEBUG === "true";
7048
- var LOG_FILE = process.env.ACP_LOG_FILE ?? path2.join(process.env.HOME ?? "/tmp", ".pi", "acp-debug.log");
7049
+ var LOG_FILE = process.env.ACP_LOG_FILE ?? path2.join(homedir(), ".pi", "acp-debug.log");
7049
7050
  var runtimeDebug = null;
7050
7051
  var initialized = false;
7051
7052
  function setDebugEnabled(enabled) {
@@ -7206,8 +7207,8 @@ async function handleCompress(args, runtime, ctx, toolCallId) {
7206
7207
  // src/decompress-tool.ts
7207
7208
  import { writeFile, mkdir } from "fs/promises";
7208
7209
  import { resolve, relative, isAbsolute, join as join3 } from "path";
7209
- import { tmpdir } from "os";
7210
- var AUTO_DIR = join3(process.env.HOME ?? tmpdir(), ".cache", "pi", "acp-decompress");
7210
+ import { tmpdir, homedir as homedir2 } from "os";
7211
+ var AUTO_DIR = join3(homedir2() || tmpdir(), ".cache", "pi", "acp-decompress");
7211
7212
  var PREVIEW_CHARS = 600;
7212
7213
  var MESSAGE_INLINE_THRESHOLD = 2e3;
7213
7214
  var DecompressParams = typebox_exports.Object({
@@ -7237,11 +7238,11 @@ function makeDecompressTool(runtime) {
7237
7238
  }
7238
7239
  var ALLOWED_DIRS = [
7239
7240
  tmpdir(),
7240
- join3(process.env.HOME ?? "", ".cache", "opencode"),
7241
- join3(process.env.HOME ?? "", ".cache", "pi")
7241
+ join3(homedir2(), ".cache", "opencode"),
7242
+ join3(homedir2(), ".cache", "pi")
7242
7243
  ];
7243
7244
  function resolveToFilePath(targetPath) {
7244
- const expanded = targetPath.startsWith("~/") ? join3(process.env.HOME ?? "", targetPath.slice(2)) : targetPath;
7245
+ const expanded = targetPath.startsWith("~/") ? join3(homedir2(), targetPath.slice(2)) : targetPath;
7245
7246
  const resolved = resolve(expanded);
7246
7247
  const isAllowed = ALLOWED_DIRS.some((dir) => {
7247
7248
  const rel = relative(dir, resolved);
@@ -8184,7 +8185,7 @@ async function statusReport(runtime, ctx) {
8184
8185
  const activeBlocksList = state.blocks.filter((b) => b.active);
8185
8186
  const totalBlocksList = state.blocks;
8186
8187
  const lines = [];
8187
- const versionStr = "0.0.5" ? `billion-context-pi@${"0.0.5"}` : "";
8188
+ const versionStr = "0.0.6" ? `billion-context-pi@${"0.0.6"}` : "";
8188
8189
  lines.push("\u256D\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256E");
8189
8190
  lines.push("\u2502 ACP Context Analysis \u2502");
8190
8191
  lines.push("\u2570\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u256F");
@@ -8331,11 +8332,12 @@ import { readFile, writeFile as writeFile3, mkdir as mkdir3 } from "fs/promises"
8331
8332
  import { join as join5, dirname as dirname3 } from "path";
8332
8333
  import { fileURLToPath } from "url";
8333
8334
  import { execFile } from "child_process";
8335
+ import { homedir as homedir3 } from "os";
8334
8336
  var PACKAGE_NAME = "billion-context-pi";
8335
8337
  var REGISTRY_URL = `https://registry.npmjs.org/${PACKAGE_NAME}/latest`;
8336
8338
  var SEMVER_RE = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z-.]+)?$/;
8337
8339
  var CHECK_INTERVAL_MS = 3 * 60 * 1e3;
8338
- var THROTTLE_FILE = `${process.env.HOME ?? ""}/.pi/agent/.billion-context-pi-update-check`;
8340
+ var THROTTLE_FILE = join5(homedir3(), ".pi", "agent", ".billion-context-pi-update-check");
8339
8341
  var updateInFlight = false;
8340
8342
  function parseVersion(v) {
8341
8343
  return v.replace(/^v/, "").split(".").map((n) => parseInt(n, 10) || 0);
@@ -8431,7 +8433,7 @@ async function checkForUpdate(autoUpdate, notify) {
8431
8433
  const data = await res.json();
8432
8434
  const latest = data.version;
8433
8435
  if (!latest) return;
8434
- const current = runtimeVersion ?? "0.0.5";
8436
+ const current = runtimeVersion ?? "0.0.6";
8435
8437
  debug.event("update-check", {
8436
8438
  current,
8437
8439
  latest,
@@ -8464,7 +8466,7 @@ async function getRuntimeVersion() {
8464
8466
  // src/setup-subagent-tools.ts
8465
8467
  import { readFile as readFile2, writeFile as writeFile4, stat, copyFile, rename } from "fs/promises";
8466
8468
  import { existsSync } from "fs";
8467
- import { homedir } from "os";
8469
+ import { homedir as homedir4 } from "os";
8468
8470
  import { join as join6 } from "path";
8469
8471
  var ACP_TOOLS = ["compress", "decompress", "search_context", "acp_status"];
8470
8472
  var BUILTIN_DEFAULT_TOOLS = {
@@ -8480,9 +8482,9 @@ var BUILTIN_DEFAULT_TOOLS = {
8480
8482
  };
8481
8483
  function resolveAgentDir() {
8482
8484
  const configured = process.env.PI_CODING_AGENT_DIR;
8483
- if (configured === "~") return homedir();
8484
- if (configured?.startsWith("~/")) return join6(homedir(), configured.slice(2));
8485
- return configured || join6(homedir(), ".pi", "agent");
8485
+ if (configured === "~") return homedir4();
8486
+ if (configured?.startsWith("~/")) return join6(homedir4(), configured.slice(2));
8487
+ return configured || join6(homedir4(), ".pi", "agent");
8486
8488
  }
8487
8489
  function desiredTools(existing, name) {
8488
8490
  const base = Array.isArray(existing?.tools) && existing.tools.length > 0 ? [...existing.tools] : [...BUILTIN_DEFAULT_TOOLS[name] ?? []];
@@ -8589,9 +8591,10 @@ async function runSetupAndNotify(notify) {
8589
8591
  // src/user-config.ts
8590
8592
  import { promises as fs3 } from "fs";
8591
8593
  import * as path3 from "path";
8594
+ import { homedir as homedir5 } from "os";
8592
8595
  import { CONFIG_DIR_NAME } from "@earendil-works/pi-coding-agent";
8593
8596
  async function loadUserConfig(cwd) {
8594
- const home = process.env.HOME ?? "";
8597
+ const home = homedir5();
8595
8598
  const merged = {};
8596
8599
  for (const base of [join8(home, CONFIG_DIR_NAME), join8(cwd, CONFIG_DIR_NAME)]) {
8597
8600
  const file = join8(base, "acp.json");