shilo-cli 0.3.1 → 0.3.2

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # shilo-cli
2
2
 
3
- CLI para subir carpetas locales a repositorios de [Shilo](https://shilo-six.vercel.app),
3
+ CLI para subir carpetas locales a repositorios de [Shilo](https://www.shilo.city),
4
4
  con una experiencia tipo git: `shilo login` una vez y después `shilo push`.
5
5
 
6
6
  > **Estado:** Fase 5 (colaboración asíncrona). Disponibles `login`, `whoami`, `logout`,
package/bin/shilo.js CHANGED
@@ -28,7 +28,7 @@ ${ui.c.bold('Opciones de login:')}
28
28
  --email <e> Email (si se omite, se pregunta).
29
29
  --password <p> Contraseña (si se omite, se pregunta oculta).
30
30
  --token <pat> Token de acceso personal (en vez de email + contraseña).
31
- --base-url <url> Servidor Shilo (default: https://shilo-six.vercel.app).
31
+ --base-url <url> Servidor Shilo (default: https://www.shilo.city).
32
32
 
33
33
  ${ui.c.bold('Opciones de init:')}
34
34
  --project <uuid> Id del proyecto de Shilo (requerido).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shilo-cli",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "CLI para sincronizar carpetas locales con repositorios de Shilo: push, pull, status, log y diff.",
5
5
  "keywords": [
6
6
  "shilo",
@@ -13,7 +13,7 @@
13
13
  "upload",
14
14
  "repositorios"
15
15
  ],
16
- "homepage": "https://shilo-six.vercel.app",
16
+ "homepage": "https://www.shilo.city",
17
17
  "bin": {
18
18
  "shilo": "bin/shilo.js"
19
19
  },
@@ -18,9 +18,20 @@
18
18
  * con las credenciales posiblemente refrescadas, para que el caller las persista.
19
19
  */
20
20
 
21
- const DEFAULT_BASE_URL = 'https://shilo-six.vercel.app';
21
+ const DEFAULT_BASE_URL = 'https://www.shilo.city';
22
22
  const DEFAULT_TIMEOUT_MS = 45000;
23
23
 
24
+ /**
25
+ * El ápex https://shilo.city responde 307 hacia https://www.shilo.city. Como
26
+ * `fetch` sigue redirects pero descarta el header Authorization al cruzar de
27
+ * origen, apuntar al ápex haría fallar con 401 todo lo autenticado (push, pull,
28
+ * projects). Normalizamos a www para que nunca ocurra ese salto.
29
+ */
30
+ function normalizeBaseURL(url) {
31
+ const clean = String(url).replace(/\/+$/, '');
32
+ return clean.replace(/^(https?:\/\/)shilo\.city(?=$|\/)/i, '$1www.shilo.city');
33
+ }
34
+
24
35
  class ShiloError extends Error {
25
36
  constructor(message, { status = null, body = null } = {}) {
26
37
  super(message);
@@ -32,7 +43,7 @@ class ShiloError extends Error {
32
43
 
33
44
  class ShiloClient {
34
45
  constructor(options = {}) {
35
- this.baseURL = (options.baseURL || DEFAULT_BASE_URL).replace(/\/+$/, '');
46
+ this.baseURL = normalizeBaseURL(options.baseURL || DEFAULT_BASE_URL);
36
47
  this.timeoutMs = Number(options.timeoutMs) || DEFAULT_TIMEOUT_MS;
37
48
  // Opcionales: habilitan refresh de token sin re-login.
38
49
  this.supabaseUrl = options.supabaseUrl || null;
@@ -8,7 +8,7 @@ const prompt = require('../prompt');
8
8
  const ui = require('../ui');
9
9
  const { ShiloClient } = require('../ShiloClient');
10
10
 
11
- const DEFAULT_BASE_URL = 'https://shilo-six.vercel.app';
11
+ const DEFAULT_BASE_URL = 'https://www.shilo.city';
12
12
 
13
13
  // UUID v4 laxo (acepta cualquier versión). El backend valida de verdad; esto es
14
14
  // sólo un aviso temprano ante un typo evidente.
@@ -5,7 +5,7 @@ const prompt = require('../prompt');
5
5
  const ui = require('../ui');
6
6
  const { ShiloClient } = require('../ShiloClient');
7
7
 
8
- const DEFAULT_BASE_URL = 'https://shilo-six.vercel.app';
8
+ const DEFAULT_BASE_URL = 'https://www.shilo.city';
9
9
 
10
10
  /**
11
11
  * shilo login [--email <e>] [--password <p>] [--token <pat>] [--base-url <url>]
@@ -11,7 +11,7 @@ const { walk } = require('../walk');
11
11
  const { classifyContent } = require('../textguard');
12
12
  const { ShiloClient } = require('../ShiloClient');
13
13
 
14
- const DEFAULT_BASE_URL = 'https://shilo-six.vercel.app';
14
+ const DEFAULT_BASE_URL = 'https://www.shilo.city';
15
15
  const COMMIT_BATCH = 100; // máximo de archivos por commit (límite del backend)
16
16
 
17
17
  // Mapa mínimo extensión -> mime para texto. El backend default es text/plain.
package/src/config.js CHANGED
@@ -58,7 +58,7 @@ function decrypt(payload) {
58
58
  * Estructura en disco:
59
59
  * {
60
60
  * version: 1,
61
- * baseURL: "https://shilo-six.vercel.app",
61
+ * baseURL: "https://www.shilo.city",
62
62
  * supabaseUrl?: "...", // opcional, habilita refresh de token
63
63
  * supabaseAnonKey?: "...", // opcional (valor público)
64
64
  * credentials: { iv, data } // cifrado -> { jwt, refreshToken, expiresAt, user }
package/src/context.js CHANGED
@@ -17,7 +17,7 @@ const ui = require('./ui');
17
17
  const sync = require('./sync');
18
18
  const { ShiloClient } = require('./ShiloClient');
19
19
 
20
- const DEFAULT_BASE_URL = 'https://shilo-six.vercel.app';
20
+ const DEFAULT_BASE_URL = 'https://www.shilo.city';
21
21
 
22
22
  /**
23
23
  * Devuelve `{ ok: true, dir, projectId, baseURL, cfg, client, mgr, savedRemote }`
package/src/remote.js CHANGED
@@ -10,7 +10,7 @@
10
10
  * Estructura en disco:
11
11
  * {
12
12
  * "projectId": "<uuid>",
13
- * "baseURL": "https://shilo-six.vercel.app",
13
+ * "baseURL": "https://www.shilo.city",
14
14
  * "lastSync": "2026-07-27T12:00:00.000Z"
15
15
  * }
16
16
  *