niahere 0.2.4 → 0.2.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.
Files changed (2) hide show
  1. package/bin/nia +16 -9
  2. package/package.json +1 -1
package/bin/nia CHANGED
@@ -20,13 +20,20 @@ if ! command -v bun >/dev/null 2>&1; then
20
20
  fi
21
21
  fi
22
22
 
23
- # Resolve symlink to find the actual package directory
24
- SCRIPT="$0"
25
- while [ -L "$SCRIPT" ]; do
26
- DIR="$(cd "$(dirname "$SCRIPT")" && pwd)"
27
- SCRIPT="$(readlink "$SCRIPT")"
28
- case "$SCRIPT" in /*) ;; *) SCRIPT="$DIR/$SCRIPT" ;; esac
29
- done
30
- PACKAGE_DIR="$(cd "$(dirname "$SCRIPT")/.." && pwd)"
23
+ # Resolve the real path of this script (follows all symlinks)
24
+ REAL="$(realpath "$0" 2>/dev/null)" || REAL="$(perl -MCwd -e 'print Cwd::realpath($ARGV[0])' "$0" 2>/dev/null)" || REAL="$0"
25
+ # Go up from bin/ to package root
26
+ PACKAGE_DIR="$(dirname "$REAL")/.."
27
+ ENTRY="$PACKAGE_DIR/src/cli/index.ts"
31
28
 
32
- exec bun "$PACKAGE_DIR/src/cli/index.ts" "$@"
29
+ if [ ! -f "$ENTRY" ]; then
30
+ # Fallback: try npm global root
31
+ ENTRY="$(npm root -g 2>/dev/null)/niahere/src/cli/index.ts"
32
+ fi
33
+
34
+ if [ ! -f "$ENTRY" ]; then
35
+ echo "Error: could not find niahere. Try: npm i -g niahere"
36
+ exit 1
37
+ fi
38
+
39
+ exec bun "$ENTRY" "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "niahere",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "A personal AI assistant daemon — scheduled jobs, chat across Telegram and Slack, persona system, and visual identity.",
5
5
  "type": "module",
6
6
  "scripts": {