hopdeck 1.2.1 → 1.2.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/CHANGELOG.md +5 -0
- package/README.en.md +13 -1
- package/README.md +13 -1
- package/bin/hopdeck.js +25 -2
- package/lib/i18n.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Cambios
|
|
2
2
|
|
|
3
|
+
## 1.2.2
|
|
4
|
+
|
|
5
|
+
### Corregido
|
|
6
|
+
- **Una errata en un comando ya no abre Hopdeck:** `hopdeck unistall` abría la interfaz y le pasaba la palabra a `claude` como argumento, que se aplicaba a los chats que abrieras. Ahora una palabra que no es un comando da un error con una sugerencia («¿Quisiste decir "uninstall"?»). También se aceptan `--uninstall`, `--install`, `--doctor` y los alias `desinstalar`, `instalar`, `ayuda`, `version` y `list`. Lo que empieza por `-` sigue pasando a `claude`.
|
|
7
|
+
|
|
3
8
|
## 1.2.1
|
|
4
9
|
|
|
5
10
|
### Corregido
|
package/README.en.md
CHANGED
|
@@ -148,9 +148,21 @@ It always starts at `~`. Recently used folders appear on top (`↻ recent`).
|
|
|
148
148
|
### More
|
|
149
149
|
|
|
150
150
|
- The project's **git branch** is shown and the list refreshes itself.
|
|
151
|
-
- `hopdeck --list` prints the projects as plain text. `hopdeck <arguments>` passes them to `claude` when opening chats (for example `hopdeck --model opus`).
|
|
152
151
|
- Available in **Spanish and English** (follows the system language).
|
|
153
152
|
|
|
153
|
+
## Commands
|
|
154
|
+
|
|
155
|
+
| Command | What it does |
|
|
156
|
+
|---|---|
|
|
157
|
+
| `hopdeck` | Opens Hopdeck |
|
|
158
|
+
| `hopdeck install` / `hopdeck uninstall` | Installs or removes the shortcut so that `claude` opens Hopdeck |
|
|
159
|
+
| `hopdeck doctor` | Checks your setup and tells you how to fix whatever is missing |
|
|
160
|
+
| `hopdeck --list` | Lists the projects as plain text |
|
|
161
|
+
| `hopdeck --version` | Shows the version |
|
|
162
|
+
| `hopdeck --model opus` | Anything starting with `-` is passed to `claude` when opening chats |
|
|
163
|
+
|
|
164
|
+
A word that is not a command (for example `hopdeck unistall`) gives an error with a suggestion instead of opening Hopdeck.
|
|
165
|
+
|
|
154
166
|
## Compatibility
|
|
155
167
|
|
|
156
168
|
| System | Works with | Notes |
|
package/README.md
CHANGED
|
@@ -148,9 +148,21 @@ Empieza siempre en `~`. Las carpetas que usaste hace poco aparecen arriba (`↻
|
|
|
148
148
|
### Otros detalles
|
|
149
149
|
|
|
150
150
|
- Se muestra la **rama de git** del proyecto y la lista se refresca sola.
|
|
151
|
-
- `hopdeck --list` imprime los proyectos en texto plano. `hopdeck <argumentos>` pasa esos argumentos a `claude` al abrir chats (por ejemplo `hopdeck --model opus`).
|
|
152
151
|
- Disponible en **español e inglés** (sigue el idioma del sistema).
|
|
153
152
|
|
|
153
|
+
## Comandos
|
|
154
|
+
|
|
155
|
+
| Comando | Qué hace |
|
|
156
|
+
|---|---|
|
|
157
|
+
| `hopdeck` | Abre Hopdeck |
|
|
158
|
+
| `hopdeck install` / `hopdeck uninstall` | Instala o quita el atajo para que `claude` abra Hopdeck |
|
|
159
|
+
| `hopdeck doctor` | Revisa tu instalación y dice cómo arreglar lo que falte |
|
|
160
|
+
| `hopdeck --list` | Lista los proyectos en texto plano |
|
|
161
|
+
| `hopdeck --version` | Muestra la versión |
|
|
162
|
+
| `hopdeck --model opus` | Lo que empiece por `-` se pasa a `claude` al abrir chats |
|
|
163
|
+
|
|
164
|
+
Una palabra que no es un comando (por ejemplo `hopdeck unistall`) da un error con una sugerencia, en vez de abrir Hopdeck.
|
|
165
|
+
|
|
154
166
|
## Compatibilidad
|
|
155
167
|
|
|
156
168
|
| Sistema | Funciona con | Notas |
|
package/bin/hopdeck.js
CHANGED
|
@@ -1906,8 +1906,31 @@ function tutorial(afterInstall) {
|
|
|
1906
1906
|
}
|
|
1907
1907
|
|
|
1908
1908
|
// ───────────────────────── entrada ─────────────────────────
|
|
1909
|
+
// ── Comandos: una errata no debe abrir Hopdeck (antes "hopdeck unistall" lo abría y le pasaba la palabra a claude como argumento) ──
|
|
1910
|
+
const COMMANDS = ['install', 'uninstall', 'doctor', 'help'];
|
|
1911
|
+
const COMMAND_ALIASES = { desinstalar: 'uninstall', remove: 'uninstall', instalar: 'install', ayuda: 'help', diagnostico: 'doctor', version: '--version', list: '--list' };
|
|
1912
|
+
/** Nombre de comando (también como --uninstall o en español); null si no lo es. */
|
|
1913
|
+
function commandName(arg) {
|
|
1914
|
+
const w = String(arg || '').replace(/^-{1,2}/, '').toLowerCase();
|
|
1915
|
+
return COMMANDS.includes(w) ? w : COMMAND_ALIASES[w] || null;
|
|
1916
|
+
}
|
|
1917
|
+
const editDistance = (a, b) => { const d = Array.from({ length: a.length + 1 }, (_, i) => [i, ...Array(b.length).fill(0)]); for (let j = 1; j <= b.length; j++) d[0][j] = j; for (let i = 1; i <= a.length; i++) for (let j = 1; j <= b.length; j++) d[i][j] = Math.min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1)); return d[a.length][b.length]; };
|
|
1918
|
+
/** El comando que más se parece a una palabra mal escrita (hasta 2 letras de diferencia), o null. */
|
|
1919
|
+
function suggestCommand(word) {
|
|
1920
|
+
const w = String(word || '').toLowerCase(); let best = null, bd = 3;
|
|
1921
|
+
for (const c of [...COMMANDS, ...Object.keys(COMMAND_ALIASES)]) { const d = editDistance(w, c); if (d < bd) { bd = d; best = COMMAND_ALIASES[c] || c; } }
|
|
1922
|
+
return best;
|
|
1923
|
+
}
|
|
1924
|
+
|
|
1909
1925
|
function main() {
|
|
1910
|
-
|
|
1926
|
+
let [cmd, ...rest] = process.argv.slice(2);
|
|
1927
|
+
const named = commandName(cmd);
|
|
1928
|
+
if (named) cmd = named; // --uninstall, desinstalar… valen como uninstall
|
|
1929
|
+
else if (cmd && !cmd.startsWith('-')) { // una palabra suelta que no es comando: es una errata, no algo que pasar a claude
|
|
1930
|
+
const sug = suggestCommand(cmd);
|
|
1931
|
+
console.error(`${C.warn}${T.unknownCmd(cmd)}${R}${sug ? ' ' + T.didYouMean(sug) : ''}\n${C.dim}${T.cmdList}${R}`);
|
|
1932
|
+
process.exit(2);
|
|
1933
|
+
}
|
|
1911
1934
|
if (cmd === 'install') { install(false); markAsked(); }
|
|
1912
1935
|
else if (cmd === 'uninstall') { install(true); markAsked(); }
|
|
1913
1936
|
else if (cmd === 'help' || cmd === '--help' || cmd === '-h') tutorial(false);
|
|
@@ -1933,7 +1956,7 @@ else {
|
|
|
1933
1956
|
module.exports = {
|
|
1934
1957
|
cw, strW, fit, clean, imageExt, exportImages, safeId, findClaude, install, backupProfile, ago, tidy, fuzzy, wrapText, parseKeys, KEYMAP, isType, T, S, CFG, E,
|
|
1935
1958
|
readSession, buildProject, scan, scanAsync, finishScan, sortProjects, projectDirs,
|
|
1936
|
-
view, flatList, stripBlock, offerShortcut, SNIP, MARK_A, MARK_B, toggleProject, cacheLoad, selNorm,
|
|
1959
|
+
view, flatList, stripBlock, offerShortcut, commandName, suggestCommand, SNIP, MARK_A, MARK_B, toggleProject, cacheLoad, selNorm,
|
|
1937
1960
|
decodePNG, decodeImage, scaleBox, fitSize, halfBlocks, collectImages, extractImages,
|
|
1938
1961
|
editBuf, normalizeKeys, stripJsonc, wtCtrlV, fbNames, fbOpen, fbRows, sidebarMouse, gitBranch, imageMarkerAt, shownSession, linkChats, findImageByNumber: images.findImageByNumber,
|
|
1939
1962
|
};
|
package/lib/i18n.js
CHANGED
|
@@ -20,6 +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
|
+
unknownCmd: (c) => `Comando desconocido: "${c}"`, didYouMean: (s) => `¿Quisiste decir "${s}"?`, cmdList: 'Comandos: install, uninstall, doctor, help, --list, --version.\nLo que empiece por - se pasa a claude al abrir chats, por ejemplo: hopdeck --model opus',
|
|
23
24
|
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
25
|
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
26
|
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.',
|
|
@@ -55,6 +56,7 @@ const T = {
|
|
|
55
56
|
copied: (n) => `Copied (${n} chars)`, archMsg: 'Archived (H to show)', unarchMsg: 'Unarchived', qsHint: 'jump to any conversation',
|
|
56
57
|
prevHint: '⏎ resume this conversation', noPrev: 'No messages to show',
|
|
57
58
|
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',
|
|
59
|
+
unknownCmd: (c) => `Unknown command: "${c}"`, didYouMean: (s) => `Did you mean "${s}"?`, cmdList: 'Commands: install, uninstall, doctor, help, --list, --version.\nAnything starting with - is passed to claude when opening chats, for example: hopdeck --model opus',
|
|
58
60
|
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
61
|
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
62
|
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.',
|
package/package.json
CHANGED