theus-cli 0.1.17 → 0.2.0

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 (3) hide show
  1. package/bin/theus +14 -8
  2. package/cli.js +9880 -8681
  3. package/package.json +101 -3
package/bin/theus CHANGED
@@ -1,6 +1,7 @@
1
- #!/usr/bin/env bash
2
- # Launcher de Theus CLI (paquete de release).
3
- # Ejecuta el bundle self-contained cli.js con Bun.
1
+ #!/bin/bash
2
+ # Theus launcher — type `theus` to start from any project.
3
+ # Runs the project's Bun entrypoint with the build shims preloaded.
4
+ # Any arguments are passed through, e.g. theus --help or theus -p "hola".
4
5
  set -euo pipefail
5
6
 
6
7
  SOURCE="${BASH_SOURCE[0]}"
@@ -9,16 +10,21 @@ while [[ -L "$SOURCE" ]]; do
9
10
  SOURCE="$(readlink "$SOURCE")"
10
11
  [[ "$SOURCE" != /* ]] && SOURCE="$DIR/$SOURCE"
11
12
  done
12
- APP="$(cd -P "$(dirname "$SOURCE")/.." && pwd)"
13
+ PROJ="$(cd -P "$(dirname "$SOURCE")/.." && pwd)"
13
14
 
14
15
  if ! command -v bun >/dev/null 2>&1; then
15
- echo "theus: Bun no esta instalado. Instalalo desde https://bun.sh y reintenta." >&2
16
+ echo "theus: Bun no está instalado. Instálalo con: curl -fsSL https://bun.sh/install | bash" >&2
16
17
  exit 1
17
18
  fi
18
19
 
19
- if [[ ! -f "$APP/cli.js" ]]; then
20
- echo "theus: no encuentro el bundle en $APP/cli.js. Reinstala con: curl -fsSL https://theus.pe/install.sh | bash" >&2
20
+ if [[ ! -f "$PROJ/entrypoints/cli.tsx" || ! -f "$PROJ/bun-shims/preload.ts" ]]; then
21
+ echo "theus: no encuentro el runtime en $PROJ" >&2
21
22
  exit 1
22
23
  fi
23
24
 
24
- exec bun "$APP/cli.js" "$@"
25
+ if [[ "${1:-}" == "login" || "${1:-}" == "signin" || "${1:-}" == "entrar" ]]; then
26
+ shift
27
+ exec bun --preload "$PROJ/bun-shims/preload.ts" "$PROJ/entrypoints/theus-login.ts" "$@"
28
+ fi
29
+
30
+ exec bun --preload "$PROJ/bun-shims/preload.ts" "$PROJ/entrypoints/cli.tsx" "$@"