@rse/claudex 1.1.4 → 1.1.6
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/claudex.js +42 -5
- package/claudex.ts +50 -11
- package/lazygit.yaml +11 -0
- package/package.json +5 -5
package/claudex.js
CHANGED
|
@@ -261,6 +261,24 @@ const self = async (...args) => {
|
|
|
261
261
|
process.exit(r.exitCode ?? 1);
|
|
262
262
|
return r.exitCode ?? 0;
|
|
263
263
|
};
|
|
264
|
+
/* derive the session/project name from a directory: usually its basename,
|
|
265
|
+
but for a multi-worktree setup "<basedir>/<branch>/" with an "active"
|
|
266
|
+
symlink in "<basedir>/" (pointing to one of the worktrees) the name is
|
|
267
|
+
"<basedir>-<branch>", as the bare branch name (e.g. "master") is not unique */
|
|
268
|
+
const deriveSessionName = (dir) => {
|
|
269
|
+
const name = path.basename(dir);
|
|
270
|
+
const parent = path.dirname(dir);
|
|
271
|
+
if (name !== "" && parent !== dir) {
|
|
272
|
+
try {
|
|
273
|
+
if (fs.lstatSync(path.join(parent, "active")).isSymbolicLink())
|
|
274
|
+
return `${path.basename(parent)}-${name}`;
|
|
275
|
+
}
|
|
276
|
+
catch (_e) {
|
|
277
|
+
/* no "active" symlink, so no multi-worktree setup */
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
return name;
|
|
281
|
+
};
|
|
264
282
|
/* detect the session/project name by walking up from the current working
|
|
265
283
|
directory looking for an AGENTS.md / CLAUDE.md marker; fall back to the
|
|
266
284
|
basename of the current working directory */
|
|
@@ -268,13 +286,13 @@ const detectSessionName = () => {
|
|
|
268
286
|
let dir = process.cwd();
|
|
269
287
|
while (true) {
|
|
270
288
|
if (fs.existsSync(path.join(dir, "AGENTS.md")) || fs.existsSync(path.join(dir, "CLAUDE.md")))
|
|
271
|
-
return
|
|
289
|
+
return deriveSessionName(dir);
|
|
272
290
|
const parent = path.dirname(dir);
|
|
273
291
|
if (parent === dir)
|
|
274
292
|
break;
|
|
275
293
|
dir = parent;
|
|
276
294
|
}
|
|
277
|
-
const session =
|
|
295
|
+
const session = deriveSessionName(process.cwd()) || "default";
|
|
278
296
|
info(`no AGENTS.md/CLAUDE.md marker found; using cwd basename "${session}" as session name`);
|
|
279
297
|
return session;
|
|
280
298
|
};
|
|
@@ -633,6 +651,8 @@ const actionInternalTmux = (opts, args) => {
|
|
|
633
651
|
/* ASE-specific bind-keys (only when "-A" is in effect) */
|
|
634
652
|
conf +=
|
|
635
653
|
"bind-key q display-popup -E -w 95% -h 95% -T \"─◀#[reverse] ⧉ Task Edit (ase task edit) #[noreverse]▶\" claudex internal ase-task-edit\n" +
|
|
654
|
+
"bind-key b display-popup -E -w 95% -h 95% -T \"─◀#[reverse] ⧉ Task Board (ase task board) #[noreverse]▶\" claudex internal ase-task-board\n" +
|
|
655
|
+
"bind-key B run-shell -b \"claudex internal ase-task-board --web\"\n" +
|
|
636
656
|
"bind-key t send-keys \"/ase:ase-task-id \"\n" +
|
|
637
657
|
"bind-key p send-keys \"/ase:ase-meta-persona \"\n";
|
|
638
658
|
}
|
|
@@ -650,7 +670,10 @@ const actionInternalTmux = (opts, args) => {
|
|
|
650
670
|
"set-hook -g -u after-split-window\n" +
|
|
651
671
|
"bind-key g display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Version Control (lazygit) )▶\" claudex internal lazygit\n" +
|
|
652
672
|
"bind-key s display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Shell )▶\" claudex internal shell\n" +
|
|
653
|
-
(opts.ase ?
|
|
673
|
+
(opts.ase ?
|
|
674
|
+
"bind-key q display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Task Edit (ase task edit) )▶\" claudex internal ase-task-edit\n" +
|
|
675
|
+
"bind-key b display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Task Board (ase task board) )▶\" claudex internal ase-task-board\n" +
|
|
676
|
+
"bind-key B run-shell -b \"claudex internal ase-task-board --web\"\n" : "");
|
|
654
677
|
}
|
|
655
678
|
/* propagate model-selection environment variables into the tmux
|
|
656
679
|
server's global environment, so that they survive into every pane
|
|
@@ -726,6 +749,19 @@ const actionInternalAseTaskEdit = async (_opts) => {
|
|
|
726
749
|
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
727
750
|
}
|
|
728
751
|
};
|
|
752
|
+
/* action: internal "ase-task-board" -- show the ASE task board (keeping errors visible briefly);
|
|
753
|
+
with "--web" it runs via tmux "run-shell", so stdout (the URL) is suppressed to avoid tmux view mode */
|
|
754
|
+
const actionInternalAseTaskBoard = async (_opts, args) => {
|
|
755
|
+
ensureTool("ase");
|
|
756
|
+
const web = args.includes("--web");
|
|
757
|
+
const r = execaSync("ase", ["task", "board", ...args], {
|
|
758
|
+
stdio: web ? ["ignore", "ignore", "inherit"] : "inherit",
|
|
759
|
+
reject: false,
|
|
760
|
+
windowsHide: false
|
|
761
|
+
});
|
|
762
|
+
if (!web && (r.exitCode ?? 1) !== 0)
|
|
763
|
+
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
764
|
+
};
|
|
729
765
|
/* action: internal "lazygit" -- spawn lazygit (optionally recolored) */
|
|
730
766
|
const actionInternalLazygit = (opts, args) => {
|
|
731
767
|
ensureTool("git");
|
|
@@ -849,7 +885,7 @@ const actionStats = async (args) => {
|
|
|
849
885
|
ensureTool("codeburn", { hint: "run \"claudex install\" or \"claudex update\" first" });
|
|
850
886
|
return execInherit("codeburn", ["report", "--provider", "claude", "--period", "30days", ...args]);
|
|
851
887
|
};
|
|
852
|
-
/* action: internal sub-dispatch (tmux, shell, ase-task-edit, lazygit, capsula, exec) */
|
|
888
|
+
/* action: internal sub-dispatch (tmux, shell, ase-task-edit, ase-task-board, lazygit, capsula, exec) */
|
|
853
889
|
const actionInternal = async (opts, args) => {
|
|
854
890
|
const util = args[0];
|
|
855
891
|
const rest = args.slice(1);
|
|
@@ -857,6 +893,7 @@ const actionInternal = async (opts, args) => {
|
|
|
857
893
|
case "tmux": return actionInternalTmux(opts, rest);
|
|
858
894
|
case "shell": return actionInternalShell(opts, rest);
|
|
859
895
|
case "ase-task-edit": return actionInternalAseTaskEdit(opts);
|
|
896
|
+
case "ase-task-board": return actionInternalAseTaskBoard(opts, rest);
|
|
860
897
|
case "lazygit": return actionInternalLazygit(opts, rest);
|
|
861
898
|
case "capsula": return actionInternalCapsula(opts, rest);
|
|
862
899
|
case "exec": return actionInternalExec(opts);
|
|
@@ -1382,7 +1419,7 @@ const main = async () => {
|
|
|
1382
1419
|
/* dispatch "internal" sub-command */
|
|
1383
1420
|
program
|
|
1384
1421
|
.command("internal")
|
|
1385
|
-
.description("internal command dispatcher (tmux, shell, lazygit, ase-task-edit, capsula)")
|
|
1422
|
+
.description("internal command dispatcher (tmux, shell, lazygit, ase-task-edit, ase-task-board, capsula)")
|
|
1386
1423
|
.helpOption("-h, --help", "display help for command")
|
|
1387
1424
|
.passThroughOptions()
|
|
1388
1425
|
.allowUnknownOption()
|
package/claudex.ts
CHANGED
|
@@ -292,6 +292,25 @@ const self = async (...args: string[]): Promise<number> => {
|
|
|
292
292
|
return r.exitCode ?? 0
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
+
/* derive the session/project name from a directory: usually its basename,
|
|
296
|
+
but for a multi-worktree setup "<basedir>/<branch>/" with an "active"
|
|
297
|
+
symlink in "<basedir>/" (pointing to one of the worktrees) the name is
|
|
298
|
+
"<basedir>-<branch>", as the bare branch name (e.g. "master") is not unique */
|
|
299
|
+
const deriveSessionName = (dir: string): string => {
|
|
300
|
+
const name = path.basename(dir)
|
|
301
|
+
const parent = path.dirname(dir)
|
|
302
|
+
if (name !== "" && parent !== dir) {
|
|
303
|
+
try {
|
|
304
|
+
if (fs.lstatSync(path.join(parent, "active")).isSymbolicLink())
|
|
305
|
+
return `${path.basename(parent)}-${name}`
|
|
306
|
+
}
|
|
307
|
+
catch (_e) {
|
|
308
|
+
/* no "active" symlink, so no multi-worktree setup */
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return name
|
|
312
|
+
}
|
|
313
|
+
|
|
295
314
|
/* detect the session/project name by walking up from the current working
|
|
296
315
|
directory looking for an AGENTS.md / CLAUDE.md marker; fall back to the
|
|
297
316
|
basename of the current working directory */
|
|
@@ -299,13 +318,13 @@ const detectSessionName = (): string => {
|
|
|
299
318
|
let dir = process.cwd()
|
|
300
319
|
while (true) {
|
|
301
320
|
if (fs.existsSync(path.join(dir, "AGENTS.md")) || fs.existsSync(path.join(dir, "CLAUDE.md")))
|
|
302
|
-
return
|
|
321
|
+
return deriveSessionName(dir)
|
|
303
322
|
const parent = path.dirname(dir)
|
|
304
323
|
if (parent === dir)
|
|
305
324
|
break
|
|
306
325
|
dir = parent
|
|
307
326
|
}
|
|
308
|
-
const session =
|
|
327
|
+
const session = deriveSessionName(process.cwd()) || "default"
|
|
309
328
|
info(`no AGENTS.md/CLAUDE.md marker found; using cwd basename "${session}" as session name`)
|
|
310
329
|
return session
|
|
311
330
|
}
|
|
@@ -721,6 +740,8 @@ const actionInternalTmux = (opts: TopOpts, args: string[]): never => {
|
|
|
721
740
|
/* ASE-specific bind-keys (only when "-A" is in effect) */
|
|
722
741
|
conf +=
|
|
723
742
|
"bind-key q display-popup -E -w 95% -h 95% -T \"─◀#[reverse] ⧉ Task Edit (ase task edit) #[noreverse]▶\" claudex internal ase-task-edit\n" +
|
|
743
|
+
"bind-key b display-popup -E -w 95% -h 95% -T \"─◀#[reverse] ⧉ Task Board (ase task board) #[noreverse]▶\" claudex internal ase-task-board\n" +
|
|
744
|
+
"bind-key B run-shell -b \"claudex internal ase-task-board --web\"\n" +
|
|
724
745
|
"bind-key t send-keys \"/ase:ase-task-id \"\n" +
|
|
725
746
|
"bind-key p send-keys \"/ase:ase-meta-persona \"\n"
|
|
726
747
|
}
|
|
@@ -738,7 +759,10 @@ const actionInternalTmux = (opts: TopOpts, args: string[]): never => {
|
|
|
738
759
|
"set-hook -g -u after-split-window\n" +
|
|
739
760
|
"bind-key g display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Version Control (lazygit) )▶\" claudex internal lazygit\n" +
|
|
740
761
|
"bind-key s display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Shell )▶\" claudex internal shell\n" +
|
|
741
|
-
(opts.ase ?
|
|
762
|
+
(opts.ase ?
|
|
763
|
+
"bind-key q display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Task Edit (ase task edit) )▶\" claudex internal ase-task-edit\n" +
|
|
764
|
+
"bind-key b display-popup -E -w 95% -h 95% -T \"─◀( ⧉ Task Board (ase task board) )▶\" claudex internal ase-task-board\n" +
|
|
765
|
+
"bind-key B run-shell -b \"claudex internal ase-task-board --web\"\n" : "")
|
|
742
766
|
}
|
|
743
767
|
/* propagate model-selection environment variables into the tmux
|
|
744
768
|
server's global environment, so that they survive into every pane
|
|
@@ -817,6 +841,20 @@ const actionInternalAseTaskEdit = async (_opts: TopOpts): Promise<void> => {
|
|
|
817
841
|
}
|
|
818
842
|
}
|
|
819
843
|
|
|
844
|
+
/* action: internal "ase-task-board" -- show the ASE task board (keeping errors visible briefly);
|
|
845
|
+
with "--web" it runs via tmux "run-shell", so stdout (the URL) is suppressed to avoid tmux view mode */
|
|
846
|
+
const actionInternalAseTaskBoard = async (_opts: TopOpts, args: string[]): Promise<void> => {
|
|
847
|
+
ensureTool("ase")
|
|
848
|
+
const web = args.includes("--web")
|
|
849
|
+
const r = execaSync("ase", [ "task", "board", ...args ], {
|
|
850
|
+
stdio: web ? [ "ignore", "ignore", "inherit" ] : "inherit",
|
|
851
|
+
reject: false,
|
|
852
|
+
windowsHide: false
|
|
853
|
+
})
|
|
854
|
+
if (!web && (r.exitCode ?? 1) !== 0)
|
|
855
|
+
await new Promise((resolve) => setTimeout(resolve, 2000))
|
|
856
|
+
}
|
|
857
|
+
|
|
820
858
|
/* action: internal "lazygit" -- spawn lazygit (optionally recolored) */
|
|
821
859
|
const actionInternalLazygit = (opts: TopOpts, args: string[]): never => {
|
|
822
860
|
ensureTool("git")
|
|
@@ -948,17 +986,18 @@ const actionStats = async (args: string[]): Promise<never> => {
|
|
|
948
986
|
return execInherit("codeburn", [ "report", "--provider", "claude", "--period", "30days", ...args ])
|
|
949
987
|
}
|
|
950
988
|
|
|
951
|
-
/* action: internal sub-dispatch (tmux, shell, ase-task-edit, lazygit, capsula, exec) */
|
|
989
|
+
/* action: internal sub-dispatch (tmux, shell, ase-task-edit, ase-task-board, lazygit, capsula, exec) */
|
|
952
990
|
const actionInternal = async (opts: TopOpts, args: string[]): Promise<void> => {
|
|
953
991
|
const util = args[0]
|
|
954
992
|
const rest = args.slice(1)
|
|
955
993
|
switch (util) {
|
|
956
|
-
case "tmux":
|
|
957
|
-
case "shell":
|
|
958
|
-
case "ase-task-edit":
|
|
959
|
-
case "
|
|
960
|
-
case "
|
|
961
|
-
case "
|
|
994
|
+
case "tmux": return actionInternalTmux(opts, rest)
|
|
995
|
+
case "shell": return actionInternalShell(opts, rest)
|
|
996
|
+
case "ase-task-edit": return actionInternalAseTaskEdit(opts)
|
|
997
|
+
case "ase-task-board": return actionInternalAseTaskBoard(opts, rest)
|
|
998
|
+
case "lazygit": return actionInternalLazygit(opts, rest)
|
|
999
|
+
case "capsula": return actionInternalCapsula(opts, rest)
|
|
1000
|
+
case "exec": return actionInternalExec(opts)
|
|
962
1001
|
default:
|
|
963
1002
|
fatal(`invalid internal command "${util ?? ""}"`)
|
|
964
1003
|
}
|
|
@@ -1511,7 +1550,7 @@ const main = async (): Promise<void> => {
|
|
|
1511
1550
|
/* dispatch "internal" sub-command */
|
|
1512
1551
|
program
|
|
1513
1552
|
.command("internal")
|
|
1514
|
-
.description("internal command dispatcher (tmux, shell, lazygit, ase-task-edit, capsula)")
|
|
1553
|
+
.description("internal command dispatcher (tmux, shell, lazygit, ase-task-edit, ase-task-board, capsula)")
|
|
1515
1554
|
.helpOption("-h, --help", "display help for command")
|
|
1516
1555
|
.passThroughOptions()
|
|
1517
1556
|
.allowUnknownOption()
|
package/lazygit.yaml
CHANGED
|
@@ -80,3 +80,14 @@ os:
|
|
|
80
80
|
edit: vim {{filename}}
|
|
81
81
|
editAtLine: vim +{{line}} {{filename}}
|
|
82
82
|
|
|
83
|
+
customCommands:
|
|
84
|
+
- key: "s"
|
|
85
|
+
context: "files"
|
|
86
|
+
description: "Stash all changes (including untracked)"
|
|
87
|
+
prompts:
|
|
88
|
+
- type: "input"
|
|
89
|
+
title: "Stash message"
|
|
90
|
+
key: "Message"
|
|
91
|
+
command: "git stash push --include-untracked -m {{.Form.Message | quote}}"
|
|
92
|
+
loadingText: "Stashing..."
|
|
93
|
+
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rse/claudex",
|
|
3
3
|
"publishConfig": { "access": "public" },
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.6",
|
|
5
5
|
"description": "Claude Code eXtended",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"keywords": [ "claude", "code", "extension", "wrapper" ],
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"bin": { "claudex": "claudex.js" },
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"which": "7.0.0",
|
|
20
|
-
"execa": "10.
|
|
20
|
+
"execa": "10.2.0",
|
|
21
21
|
"chalk": "6.0.1",
|
|
22
22
|
"commander": "15.0.0",
|
|
23
23
|
"deepmerge": "4.3.1",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"@rse/stx": "1.1.7",
|
|
34
34
|
"eslint": "9.39.5",
|
|
35
35
|
"@eslint/js": "9.39.5",
|
|
36
|
-
"typescript-eslint": "8.71.
|
|
37
|
-
"@typescript-eslint/parser": "8.71.
|
|
36
|
+
"typescript-eslint": "8.71.2",
|
|
37
|
+
"@typescript-eslint/parser": "8.71.2",
|
|
38
38
|
"eslint-plugin-promise": "7.3.0",
|
|
39
39
|
"eslint-plugin-import": "2.32.0",
|
|
40
|
-
"neostandard": "0.14.
|
|
40
|
+
"neostandard": "0.14.1",
|
|
41
41
|
"globals": "17.13.0",
|
|
42
42
|
"shx": "0.4.0"
|
|
43
43
|
},
|