hopdeck 1.2.0 → 1.2.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Cambios
2
2
 
3
+ ## 1.2.1
4
+
5
+ ### Corregido
6
+ - **Conversaciones que no aparecían en la lista** (y por tanto tampoco mostraban sus imágenes al pasar el cursor): Hopdeck solo leía los primeros 64 KB de cada archivo para sacar el título. Si el primer mensaje llevaba una imagen (cientos de KB) y Claude aún no había guardado un título, la conversación se descartaba. Ahora lee el principio del archivo por bloques, hasta 4 MB, hasta encontrar el primer mensaje.
7
+ - **Las cachés guardadas con la versión anterior se reconstruyen**, para que ese arreglo llegue también a quien ya tenía la lista cacheada.
8
+ - **Imágenes duplicadas en la galería:** Claude Code guarda cada imagen otra vez en una línea interna (`api-request-blob`). Ya no se cuentan dos veces.
9
+ - **Hover de imagen en un chat nuevo:** si todavía no se había enlazado con su conversación, podía mostrar la imagen de otra conversación del mismo proyecto cuando coincidía el número. Ahora solo toma una conversación creada después de abrir el chat.
10
+ - **Detección de `[Image #N]`:** calcula bien la columna con caracteres anchos delante (emoji, CJK) y acepta espacios no separables.
11
+ - **Pregunta del primer arranque:** al responder, la pregunta se borra de la pantalla y deja una línea de resumen (antes se quedaba escrita como si siguiera pendiente), y el texto aclara que responder que no no impide abrir Hopdeck: el atajo solo afecta a lo que ocurre al escribir `claude`.
12
+ - **Aviso de tamaño mínimo:** decía 60×12 y el programa exige 70×12.
13
+
3
14
  ## 1.2.0 · primera versión pública
4
15
 
5
16
  ### Nuevo
package/README.en.md CHANGED
@@ -9,6 +9,8 @@
9
9
 
10
10
  [Español](README.md) · **English**
11
11
 
12
+ [![npm](https://img.shields.io/npm/v/hopdeck.svg)](https://www.npmjs.com/package/hopdeck)
13
+ [![CI](https://github.com/fabriciodev26/hopdeck/actions/workflows/ci.yml/badge.svg)](https://github.com/fabriciodev26/hopdeck/actions/workflows/ci.yml)
12
14
  [![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
13
15
  [![Node](https://img.shields.io/badge/node-%E2%89%A522-brightgreen.svg)](package.json)
14
16
 
package/README.md CHANGED
@@ -9,6 +9,8 @@
9
9
 
10
10
  **Español** · [English](README.en.md)
11
11
 
12
+ [![npm](https://img.shields.io/npm/v/hopdeck.svg)](https://www.npmjs.com/package/hopdeck)
13
+ [![CI](https://github.com/fabriciodev26/hopdeck/actions/workflows/ci.yml/badge.svg)](https://github.com/fabriciodev26/hopdeck/actions/workflows/ci.yml)
12
14
  [![Licencia: MIT](https://img.shields.io/badge/licencia-MIT-blue.svg)](LICENSE)
13
15
  [![Node](https://img.shields.io/badge/node-%E2%89%A522-brightgreen.svg)](package.json)
14
16
 
package/bin/hopdeck.js CHANGED
@@ -953,11 +953,38 @@ async function shownSession(x) {
953
953
  if (!sess) {
954
954
  await reloadAsync(null, true);
955
955
  const p = S.projects.find((q) => q.cwd === x.cwd);
956
- sess = p && p.sessions[0];
956
+ // un chat nuevo aún sin enlazar: solo vale una conversación creada después de abrirlo. Usar "la más reciente del proyecto"
957
+ // podía mostrar la imagen de OTRA conversación cuando coincidía el número
958
+ sess = p && p.sessions.find((q) => q.mtime >= (x.t0 || 0) - 2000);
957
959
  }
958
960
  return sess;
959
961
  }
960
962
 
963
+ /** Texto de una fila del terminal virtual y la columna de cada carácter (los de ancho 2 ocupan dos celdas). */
964
+ function rowChars(term, y) {
965
+ const b = term.buffer.active, line = b.getLine(b.viewportY + y), cols = []; let text = '';
966
+ if (!line) return { text, cols };
967
+ const cell = b.getNullCell();
968
+ for (let x = 0; x < term.cols; x++) {
969
+ const c = line.getCell(x, cell); if (!c) break;
970
+ if (c.getWidth() === 0) continue;
971
+ const ch = c.getChars() || ' ';
972
+ for (let i = 0; i < ch.length; i++) cols.push(x);
973
+ text += ch;
974
+ }
975
+ return { text, cols };
976
+ }
977
+
978
+ /** ¿Hay un "[Image #N]" bajo la columna `col` de la fila `y`? Devuelve { n, x } o null. Tolera espacios no separables y caracteres anchos antes de la marca. */
979
+ function imageMarkerAt(term, y, col) {
980
+ const { text, cols } = rowChars(term, y);
981
+ for (const m of text.matchAll(/\[Image\s*#(\d+)\]/g)) {
982
+ const x0 = cols[m.index], x1 = cols[m.index + m[0].length - 1];
983
+ if (col >= x0 && col <= x1) return { n: +m[1], x: x0 };
984
+ }
985
+ return null;
986
+ }
987
+
961
988
  async function openGalleryShown() {
962
989
  const x = E.sessions.get(E.shown); if (!x) return flash(T.notOpen);
963
990
  const sess = await shownSession(x);
@@ -999,9 +1026,8 @@ function hoverChat(sh, x, y) {
999
1026
  const { SW, rw } = embedLayout(), x0 = SW ? SW + 2 : 1;
1000
1027
  let n = 0, at = null;
1001
1028
  if (sh.ready && x >= x0 && y >= 3) {
1002
- const b = sh.term.buffer.active, l = b.getLine(b.viewportY + (y - 3));
1003
- const txt = l ? l.translateToString(true) : '', col = x - x0;
1004
- for (const m of txt.matchAll(/\[Image #(\d+)\]/g)) if (col >= m.index && col < m.index + m[0].length) { n = +m[1]; at = { x: m.index, y: y - 3 }; break; }
1029
+ const hit = imageMarkerAt(sh.term, y - 3, x - x0);
1030
+ if (hit) { n = hit.n; at = { x: hit.x, y: y - 3 }; }
1005
1031
  }
1006
1032
  if (!n) { if (E.hover) { E.hover = null; scheduleRender(); } return; }
1007
1033
  const k = `${n}:${at.x}:${at.y}`;
@@ -1814,9 +1840,20 @@ function readKey(accept) {
1814
1840
  });
1815
1841
  }
1816
1842
 
1817
- function askShortcut() {
1818
- process.stdout.write(`\n ${C.brand}${C.bold}» Hop${R}${C.text}${C.bold}deck${R}\n\n ${C.text}${C.bold}${T.offerQ}${R}\n ${C.dim}${T.offerInfo}${R}\n\n ${C.accent}${T.offerKeys}${R}\n`);
1819
- return readKey((k) => (k === '\r' || k === '\n' || /^[sSyY]$/.test(k) ? 'yes' : /^[nN]$/.test(k) ? 'no' : k === '\x1b' || /^[mM]$/.test(k) ? 'later' : undefined));
1843
+ /**
1844
+ * Pinta la pregunta, espera la respuesta y la BORRA de la pantalla (si no, se quedaba escrita como si siguiera pendiente).
1845
+ * Cada línea se ajusta al ancho del terminal para saber exactamente cuántas ocupa y poder subir el cursor hasta el principio.
1846
+ */
1847
+ async function askShortcut() {
1848
+ const width = Math.max(30, (process.stdout.columns || 80) - 4);
1849
+ const block = ['', ` ${C.brand}${C.bold}» Hop${R}${C.text}${C.bold}deck${R}`, '', ` ${C.text}${C.bold}${T.offerQ}${R}`,
1850
+ ...wrapText(T.offerInfo, width).map((l) => ` ${C.dim}${l}${R}`), '', ` ${C.accent}${T.offerKeys}${R}`];
1851
+ process.stdout.write(block.join('\n') + '\n');
1852
+ const ans = await readKey((k) => (k === '\r' || k === '\n' || /^[sSyY]$/.test(k) ? 'yes' : /^[nN]$/.test(k) ? 'no' : k === '\x1b' || /^[mM]$/.test(k) ? 'later' : undefined));
1853
+ process.stdout.write(`\x1b[${block.length}A\x1b[J`); // sube hasta el principio de la pregunta y la borra
1854
+ if (ans === 'no') process.stdout.write(` ${C.dim}${T.offerNo}${R}\n`);
1855
+ else if (ans === 'later') process.stdout.write(` ${C.dim}${T.offerLater}${R}\n`);
1856
+ return ans;
1820
1857
  }
1821
1858
 
1822
1859
  /**
@@ -1837,7 +1874,7 @@ async function offerShortcut(opts = {}) {
1837
1874
  r.baks.forEach((b) => process.stdout.write(` ${C.dim}${T.bakMsg(shortPath(b))}${R}\n`));
1838
1875
  process.stdout.write(`\n ${C.dim}${T.offerCont}${R}`);
1839
1876
  await readKey(() => true);
1840
- process.stdout.write('\n');
1877
+ process.stdout.write('\r\x1b[2K'); // borra la línea «Pulsa una tecla…» y deja solo el resultado
1841
1878
  }
1842
1879
  return r.done.length ? 'yes' : 'failed';
1843
1880
  }
@@ -1898,6 +1935,6 @@ else {
1898
1935
  readSession, buildProject, scan, scanAsync, finishScan, sortProjects, projectDirs,
1899
1936
  view, flatList, stripBlock, offerShortcut, SNIP, MARK_A, MARK_B, toggleProject, cacheLoad, selNorm,
1900
1937
  decodePNG, decodeImage, scaleBox, fitSize, halfBlocks, collectImages, extractImages,
1901
- editBuf, normalizeKeys, stripJsonc, wtCtrlV, fbNames, fbOpen, fbRows, sidebarMouse, gitBranch, linkChats, findImageByNumber: images.findImageByNumber,
1938
+ editBuf, normalizeKeys, stripJsonc, wtCtrlV, fbNames, fbOpen, fbRows, sidebarMouse, gitBranch, imageMarkerAt, shownSession, linkChats, findImageByNumber: images.findImageByNumber,
1902
1939
  };
1903
1940
  }
package/lib/history.js CHANGED
@@ -18,13 +18,15 @@ function textOf(content) {
18
18
 
19
19
  // Caché del índice: solo se vuelven a leer las sesiones cuya fecha/tamaño cambió.
20
20
  const CACHE_FILE = process.env.HOPDECK_CACHE || path.join(os.homedir(), '.hopdeck-cache.json');
21
+ // Sube la versión cuando cambie cómo se lee una sesión: así las cachés ya guardadas se reconstruyen en vez de repetir resultados antiguos.
22
+ const CACHE_VERSION = 2;
21
23
  let CACHE = null, cacheDirty = false, cacheSeen = null;
22
24
  /** Empieza un escaneo: las entradas de la caché que no se vean se descartan al terminar. */
23
25
  const beginScan = () => { cacheSeen = new Set(); };
24
26
  const endScan = () => { cacheSave(); cacheSeen = null; };
25
27
  function cacheLoad() {
26
28
  if (CACHE) return CACHE;
27
- try { const j = JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8')); CACHE = j && j.v === 1 && j.files ? j : { v: 1, files: {} }; } catch { CACHE = { v: 1, files: {} }; }
29
+ try { const j = JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8')); CACHE = j && j.v === CACHE_VERSION && j.files ? j : { v: CACHE_VERSION, files: {} }; } catch { CACHE = { v: CACHE_VERSION, files: {} }; }
28
30
  return CACHE;
29
31
  }
30
32
  function cacheSave() {
@@ -51,40 +53,60 @@ function readSession(file) {
51
53
  return d;
52
54
  }
53
55
 
56
+ /**
57
+ * Recorre el principio del archivo por bloques, línea a línea, hasta que `onLine` devuelva true (ya tiene lo que busca)
58
+ * o se llegue a HEAD_MAX bytes. Antes solo se leían los primeros 64 KB: si el primer mensaje llevaba una imagen
59
+ * (una línea de cientos de KB) caía fuera y la conversación se descartaba por no tener título.
60
+ */
61
+ function scanHead(fd, size, onLine) {
62
+ const CHUNK = 128 * 1024, HEAD_MAX = 4 * 1024 * 1024;
63
+ let pos = 0, carry = Buffer.alloc(0);
64
+ while (pos < size && pos < HEAD_MAX) {
65
+ const buf = Buffer.alloc(Math.min(CHUNK, size - pos));
66
+ const n = fs.readSync(fd, buf, 0, buf.length, pos);
67
+ if (!n) break;
68
+ pos += n;
69
+ const data = carry.length ? Buffer.concat([carry, buf.subarray(0, n)]) : buf.subarray(0, n);
70
+ let start = 0, nl;
71
+ while ((nl = data.indexOf(10, start)) >= 0) { // se parte por bytes y se decodifica la línea completa: un carácter de varios bytes nunca queda cortado
72
+ if (onLine(data.toString('utf8', start, nl)) === true) return;
73
+ start = nl + 1;
74
+ }
75
+ carry = data.subarray(start);
76
+ }
77
+ if (pos >= size && carry.length) onLine(carry.toString('utf8')); // última línea sin salto final
78
+ }
79
+
54
80
  function parseSession(file, st) {
55
81
  let fd;
56
82
  try { fd = fs.openSync(file, 'r'); } catch { return null; }
57
83
  try {
58
- const HEAD = 64 * 1024, TAIL = 160 * 1024;
59
- const hb = Buffer.alloc(Math.min(st.size, HEAD));
60
- fs.readSync(fd, hb, 0, hb.length, 0);
61
- const head = hb.toString('utf8').split('\n');
62
- if (st.size > HEAD) head.pop(); // última línea cortada
63
- let tail = [];
64
- if (st.size > HEAD) {
65
- const len = Math.min(st.size, TAIL);
66
- const tb = Buffer.alloc(len);
67
- fs.readSync(fd, tb, 0, len, st.size - len);
68
- tail = tb.toString('utf8').split('\n');
69
- tail.shift();
70
- }
84
+ const TAIL = 160 * 1024;
71
85
  let cwd = '', first = '', custom = '', ai = '';
72
- for (const line of head) {
73
- if (!line) continue;
86
+ scanHead(fd, st.size, (line) => {
87
+ if (!line) return false;
74
88
  const wantCwd = !cwd && line.includes('"cwd"');
75
89
  const wantUser = !first && isType(line, 'user');
76
90
  const wantTitle = line.includes('-title"');
77
- if (!wantCwd && !wantUser && !wantTitle) continue;
78
- let j; try { j = JSON.parse(line); } catch { continue; }
79
- if (wantCwd && j.cwd) cwd = j.cwd;
80
- if (j.type === 'custom-title' && j.customTitle) custom = j.customTitle;
81
- if (j.type === 'ai-title' && j.aiTitle) ai = j.aiTitle;
82
- if (wantUser && j.type === 'user' && !j.isMeta && !j.isSidechain) {
83
- const t = tidy(textOf(j.message && j.message.content));
84
- if (t && !t.startsWith('<') && !t.startsWith('[Request interrupted')) first = t.slice(0, 300);
91
+ if (wantCwd || wantUser || wantTitle) {
92
+ let j; try { j = JSON.parse(line); } catch { j = null; }
93
+ if (j) {
94
+ if (wantCwd && j.cwd) cwd = j.cwd;
95
+ if (j.type === 'custom-title' && j.customTitle) custom = j.customTitle;
96
+ if (j.type === 'ai-title' && j.aiTitle) ai = j.aiTitle;
97
+ if (wantUser && j.type === 'user' && !j.isMeta && !j.isSidechain) {
98
+ const t = tidy(textOf(j.message && j.message.content));
99
+ if (t && !t.startsWith('<') && !t.startsWith('[Request interrupted')) first = t.slice(0, 300);
100
+ }
101
+ }
85
102
  }
86
- }
103
+ return !!(cwd && first); // con la carpeta y el primer mensaje ya no hace falta leer más del principio
104
+ });
87
105
  // los títulos más recientes están al final del archivo
106
+ const len = Math.min(st.size, TAIL), tb = Buffer.alloc(len);
107
+ fs.readSync(fd, tb, 0, len, st.size - len);
108
+ const tail = tb.toString('utf8').split('\n');
109
+ if (st.size > len) tail.shift(); // primera línea cortada
88
110
  let tCustom = '', tAi = '';
89
111
  for (let i = tail.length - 1; i >= 0; i--) {
90
112
  const line = tail[i];
package/lib/i18n.js CHANGED
@@ -9,7 +9,7 @@ const T = {
9
9
  sess: (n) => `${n} ${n === 1 ? 'sesión' : 'sesiones'}`,
10
10
  k: { move: 'mover', open: 'abrir', resume: 'reanudar', back: 'volver', neu: 'nueva', find: 'buscar', quit: 'salir' },
11
11
  searchHint: 'enter aceptar · esc limpiar',
12
- noMatch: 'Sin resultados', small: 'Agranda la terminal (mín. 60×12)',
12
+ noMatch: 'Sin resultados', small: 'Agranda la terminal (mín. 70×12)',
13
13
  missing: 'La carpeta ya no existe', mkAsk: '⏎ otra vez para crear', mkFail: 'No se pudo crear', current: 'carpeta actual',
14
14
  noClaude: 'No se encontró el comando "claude". ¿Está instalado y en el PATH?',
15
15
  pressKey: 'Pulsa una tecla para volver…',
@@ -20,7 +20,7 @@ const T = {
20
20
  copied: (n) => `Copiado (${n} caracteres)`, archMsg: 'Archivada (H para verlas)', unarchMsg: 'Desarchivada', qsHint: 'saltar a cualquier conversación',
21
21
  prevHint: '⏎ reanudar esta conversación', noPrev: 'Sin mensajes para mostrar',
22
22
  bar6: 'ocultar lista', bar7: 'mostrar lista', deep: 'contenido', pathPrompt: 'nombre de la nueva carpeta', mkIn: 'se crea en', fbTitle: 'Elegir carpeta', fbHere: 'Abrir chat aquí', fbNew: 'Nueva carpeta aquí…', fbUp: 'Subir un nivel', fbProj: 'proyecto', fbHint: '⏎ entrar · ␣ abrir · / buscar · . ocultas', fbDrives: 'Este equipo', fbRecent: 'reciente', hoverMiss: (n) => `[Image #${n}]: aún no está en el historial`, fbEmpty: 'Sin subcarpetas', badId: 'Identificador de sesión no válido',
23
- offerQ: '¿Quieres que escribir claude abra Hopdeck?', offerInfo: 'Se añade una función a tu perfil de shell, con copia de seguridad. Para quitarla: hopdeck uninstall. También puedes usar siempre el comando hopdeck.', offerKeys: '[Enter] Sí [n] No, gracias [m] Más tarde', offerDone: 'Hecho. Abre una terminal nueva para activarlo.', offerFail: 'No se pudo modificar tu perfil. Puedes intentarlo luego con: hopdeck install', offerCont: 'Pulsa una tecla para continuar…',
23
+ offerQ: '¿Quieres poder abrir Hopdeck escribiendo claude?', offerInfo: 'Se añade una función a tu perfil de shell, con copia de seguridad (para quitarla: hopdeck uninstall). Responder que no no cambia nada: Hopdeck se abre igualmente y puedes usarlo siempre con el comando hopdeck.', offerKeys: '[Enter] Sí, instalar el atajo [n] No, gracias [m] Más tarde', offerNo: 'Atajo no instalado. Si cambias de idea: hopdeck install', offerLater: 'Te lo volveré a preguntar la próxima vez.', offerDone: 'Hecho. Abre una terminal nueva para activarlo.', offerFail: 'No se pudo modificar tu perfil. Puedes intentarlo luego con: hopdeck install', offerCont: 'Pulsa una tecla para continuar…',
24
24
  dcNodeOld: (v) => `Node ${v}: se necesita Node 22 o superior`, dcNodeOldHint: 'Con versiones anteriores el ratón no funciona en Windows. Actualiza Node: https://nodejs.org',
25
25
  dcHist: (n, p) => `Historial de Claude: ${n} proyectos en ${p}`, dcNoHist: (p) => `No hay historial en ${p}`, dcNoHistHint: 'Usa Claude Code una vez, o define CLAUDE_CONFIG_DIR.',
26
26
  dcClaude: (p) => `claude encontrado: ${p}`, dcNoClaude: 'No se encuentra "claude" en el PATH', dcInstallWin: 'Instálalo: irm https://claude.ai/install.ps1 | iex', dcInstallUnix: 'Instálalo: curl -fsSL https://claude.ai/install.sh | bash',
@@ -44,7 +44,7 @@ const T = {
44
44
  sess: (n) => `${n} ${n === 1 ? 'session' : 'sessions'}`,
45
45
  k: { move: 'move', open: 'open', resume: 'resume', back: 'back', neu: 'new', find: 'search', quit: 'quit' },
46
46
  searchHint: 'enter accept · esc clear',
47
- noMatch: 'No results', small: 'Make the terminal bigger (min 60×12)',
47
+ noMatch: 'No results', small: 'Make the terminal bigger (min 70×12)',
48
48
  missing: 'That folder no longer exists', mkAsk: '⏎ again to create', mkFail: 'Could not create', current: 'current folder',
49
49
  noClaude: 'Could not find the "claude" command. Is it installed and on PATH?',
50
50
  pressKey: 'Press any key to go back…',
@@ -55,7 +55,7 @@ const T = {
55
55
  copied: (n) => `Copied (${n} chars)`, archMsg: 'Archived (H to show)', unarchMsg: 'Unarchived', qsHint: 'jump to any conversation',
56
56
  prevHint: '⏎ resume this conversation', noPrev: 'No messages to show',
57
57
  bar6: 'hide list', bar7: 'show list', deep: 'content', pathPrompt: 'new folder name', mkIn: 'created in', fbTitle: 'Pick a folder', fbHere: 'Open chat here', fbNew: 'New folder here…', fbUp: 'Go up', fbProj: 'project', fbHint: '⏎ enter · ␣ open · / find · . hidden', fbDrives: 'This PC', fbRecent: 'recent', hoverMiss: (n) => `[Image #${n}]: not in the history yet`, fbEmpty: 'No subfolders', badId: 'Invalid session id',
58
- offerQ: 'Do you want typing claude to open Hopdeck?', offerInfo: 'A function is added to your shell profile, with a backup. To remove it: hopdeck uninstall. You can also always use the hopdeck command.', offerKeys: '[Enter] Yes [n] No, thanks [m] Later', offerDone: 'Done. Open a new terminal to activate it.', offerFail: 'Could not modify your profile. You can try later with: hopdeck install', offerCont: 'Press any key to continue…',
58
+ offerQ: 'Do you want to open Hopdeck by typing claude?', offerInfo: 'A function is added to your shell profile, with a backup (to remove it: hopdeck uninstall). Answering no changes nothing: Hopdeck opens anyway and you can always use the hopdeck command.', offerKeys: '[Enter] Yes, install the shortcut [n] No, thanks [m] Later', offerNo: 'Shortcut not installed. If you change your mind: hopdeck install', offerLater: 'I will ask you again next time.', offerDone: 'Done. Open a new terminal to activate it.', offerFail: 'Could not modify your profile. You can try later with: hopdeck install', offerCont: 'Press any key to continue…',
59
59
  dcNodeOld: (v) => `Node ${v}: Node 22 or newer is required`, dcNodeOldHint: 'With older versions the mouse does not work on Windows. Update Node: https://nodejs.org',
60
60
  dcHist: (n, p) => `Claude history: ${n} projects in ${p}`, dcNoHist: (p) => `No history found in ${p}`, dcNoHistHint: 'Use Claude Code once, or set CLAUDE_CONFIG_DIR.',
61
61
  dcClaude: (p) => `claude found: ${p}`, dcNoClaude: '"claude" not found in PATH', dcInstallWin: 'Install it: irm https://claude.ai/install.ps1 | iex', dcInstallUnix: 'Install it: curl -fsSL https://claude.ai/install.sh | bash',
package/lib/images.js CHANGED
@@ -22,6 +22,7 @@ async function extractImages(file, max = 200) {
22
22
  for await (const line of rl) {
23
23
  if (!/"type"\s*:\s*"image"/.test(line)) continue;
24
24
  let j; try { j = JSON.parse(line); } catch { continue; }
25
+ if (j.type !== 'user' && j.type !== 'assistant') continue; // Claude Code guarda cada imagen otra vez en líneas internas (api-request-blob): se ignoran
25
26
  const c = j.message && j.message.content, local = [];
26
27
  collectImages(c, local);
27
28
  // "[Image #N]" del texto del mensaje ↔ imágenes del mismo mensaje (en orden)
@@ -47,6 +48,7 @@ async function findImageByNumber(file, n) {
47
48
  for await (const line of rl) {
48
49
  if (!/"type"\s*:\s*"image"/.test(line)) continue;
49
50
  let j; try { j = JSON.parse(line); } catch { continue; }
51
+ if (j.type !== 'user' && j.type !== 'assistant') continue; // Claude Code guarda cada imagen otra vez en líneas internas (api-request-blob): se ignoran
50
52
  const c = j.message && j.message.content, local = [];
51
53
  collectImages(c, local);
52
54
  const nums = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hopdeck",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Selector visual de proyectos y conversaciones para Claude Code, en la terminal: salta entre proyectos sin hacer cd.",
5
5
  "author": "fabriciodev26",
6
6
  "license": "MIT",