@poolzin/pool-bot 2026.3.26 → 2026.3.27

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "2026.3.26",
3
- "commit": "eee66000dac39be6214625d1cf9dc6e254077e7c",
4
- "builtAt": "2026-03-18T11:37:07.663Z"
2
+ "version": "2026.3.27",
3
+ "commit": "d169651a542906fa84188f696d9675ef8d090b40",
4
+ "builtAt": "2026-03-18T14:07:20.323Z"
5
5
  }
package/dist/utils.js CHANGED
@@ -1,4 +1,6 @@
1
1
  // Stub for utils.js
2
+ import os from "node:os";
3
+ import path from "node:path";
2
4
  export function safeParseJson(str) {
3
5
  try {
4
6
  return JSON.parse(str);
@@ -20,3 +22,42 @@ export function escapeRegExp(str) {
20
22
  export function clamp(val, min, max) {
21
23
  return Math.min(max, Math.max(min, val));
22
24
  }
25
+ export function expandHomePrefix(input, ctx = {}) {
26
+ const home = ctx.home ?? os.homedir();
27
+ const env = ctx.env ?? process.env;
28
+ if (!input.startsWith("~"))
29
+ return input;
30
+ if (input === "~" || input.startsWith("~/")) {
31
+ return home + input.slice(1);
32
+ }
33
+ const slash = input.indexOf("/");
34
+ const user = slash === -1 ? input.slice(1) : input.slice(1, slash);
35
+ if (!user) {
36
+ return home + (slash === -1 ? "" : input.slice(1));
37
+ }
38
+ const envValue = env[`HOME_${user.toUpperCase()}`];
39
+ if (envValue) {
40
+ return envValue + (slash === -1 ? "" : input.slice(slash));
41
+ }
42
+ return input;
43
+ }
44
+ export function resolveRequiredHomeDir(env = process.env, homedir = os.homedir) {
45
+ const override = env.POOLBOT_HOME?.trim() || env.CLAWDBOT_HOME?.trim();
46
+ if (override) {
47
+ return path.resolve(expandHomePrefix(override, { home: homedir(), env }));
48
+ }
49
+ return homedir();
50
+ }
51
+ export function resolveUserPath(input) {
52
+ const trimmed = input.trim();
53
+ if (!trimmed)
54
+ return trimmed;
55
+ if (trimmed.startsWith("~")) {
56
+ const expanded = expandHomePrefix(trimmed, {
57
+ home: resolveRequiredHomeDir(process.env, os.homedir),
58
+ env: process.env,
59
+ });
60
+ return path.resolve(expanded);
61
+ }
62
+ return path.resolve(trimmed);
63
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poolzin/pool-bot",
3
- "version": "2026.3.26",
3
+ "version": "2026.3.27",
4
4
  "description": "🎱 Pool Bot - AI assistant with PLCODE integrations",
5
5
  "keywords": [],
6
6
  "license": "MIT",