claudish 14.21.1 → 14.22.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/dist/index.js +32829 -33746
- package/herdr-app-mod/claudish/main.js +28 -29
- package/package.json +5 -5
|
@@ -47,6 +47,17 @@ var HC_ERROR_STATES = new Set(["FAILED", "TIMEOUT"]);
|
|
|
47
47
|
|
|
48
48
|
// src/herdr/app-mod/model.ts
|
|
49
49
|
var MOD_NAME = "claudish";
|
|
50
|
+
var DEFAULT_COMMAND = "claudish";
|
|
51
|
+
function commandSetting(text) {
|
|
52
|
+
if (!text)
|
|
53
|
+
return DEFAULT_COMMAND;
|
|
54
|
+
try {
|
|
55
|
+
const v = JSON.parse(text)?.command;
|
|
56
|
+
return typeof v === "string" && /^[A-Za-z0-9._-]{1,64}$/.test(v) ? v : DEFAULT_COMMAND;
|
|
57
|
+
} catch {
|
|
58
|
+
return DEFAULT_COMMAND;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
50
61
|
var FEED_TERMINAL = "claudish-feed";
|
|
51
62
|
var VIEW_TERMINAL_PREFIX = "claudish-view-";
|
|
52
63
|
var VIEW_WINDOW_KEY = "claudish-view";
|
|
@@ -455,14 +466,6 @@ function runTabs(runs, selected, max, now) {
|
|
|
455
466
|
const keys = new Set(shown.map((r) => r.key));
|
|
456
467
|
return { tabs: shown.map(tab), earlier: runs.filter((r) => !keys.has(r.key)).map(tab) };
|
|
457
468
|
}
|
|
458
|
-
function sessionTabs(run, selected) {
|
|
459
|
-
return run.rows.map((r) => ({
|
|
460
|
-
target: r.target,
|
|
461
|
-
label: `${r.slot} ${clipText(r.model, 18)}`,
|
|
462
|
-
tone: r.tone,
|
|
463
|
-
selected: r.target === selected
|
|
464
|
-
}));
|
|
465
|
-
}
|
|
466
469
|
function footerLine(row, mode) {
|
|
467
470
|
if (mode === "text")
|
|
468
471
|
return `read only · transcript of slot ${row.slot}`;
|
|
@@ -471,7 +474,7 @@ function footerLine(row, mode) {
|
|
|
471
474
|
if (row.recordOnly)
|
|
472
475
|
return "read only · from its records: no running claudish holds it";
|
|
473
476
|
if (!row.finished)
|
|
474
|
-
return `read only · live screen of slot ${row.slot}
|
|
477
|
+
return `read only · live screen of slot ${row.slot}`;
|
|
475
478
|
return "read only · finished: a replay of the real interface";
|
|
476
479
|
}
|
|
477
480
|
function tilde(path, home) {
|
|
@@ -581,9 +584,11 @@ class PanelController {
|
|
|
581
584
|
return this.install ? `${this.install.root}/feed` : null;
|
|
582
585
|
}
|
|
583
586
|
async boot() {
|
|
587
|
+
const settings = `${this.host.home()}/.config/herdr-app/mods/${MOD_NAME}/settings.json`;
|
|
588
|
+
const command = commandSetting(await this.host.readTextFile(settings).catch(() => null));
|
|
584
589
|
const probe = await this.host.exec("/bin/sh", [
|
|
585
590
|
"-c",
|
|
586
|
-
`PATH="${PATH_HEAD.join(":")}:$PATH"; export PATH; command -v
|
|
591
|
+
`PATH="${PATH_HEAD.join(":")}:$PATH"; export PATH; command -v ${command} && printf '%s\\n' "$PATH"`
|
|
587
592
|
]).catch(() => null);
|
|
588
593
|
const [path, pathEnv] = (probe?.code === 0 ? probe.stdout : "").trim().split(`
|
|
589
594
|
`);
|
|
@@ -768,9 +773,7 @@ class PanelController {
|
|
|
768
773
|
this.view = null;
|
|
769
774
|
}
|
|
770
775
|
let address = liveTerminal(this.host.terminals(), name)?.address ?? null;
|
|
771
|
-
if (address)
|
|
772
|
-
await this.host.hc(["keys", address, "enter"]).catch(() => null);
|
|
773
|
-
} else
|
|
776
|
+
if (!address)
|
|
774
777
|
address = await this.startViewer(target, name);
|
|
775
778
|
if (!address)
|
|
776
779
|
return;
|
|
@@ -1023,6 +1026,7 @@ function roleOf() {
|
|
|
1023
1026
|
const role = props()?.role;
|
|
1024
1027
|
return role === "titlebar" || role === "toggle" ? role : "panel";
|
|
1025
1028
|
}
|
|
1029
|
+
var ROWS_BEFORE_SCROLL = 6;
|
|
1026
1030
|
function colour(t, name, fallback) {
|
|
1027
1031
|
const v = t[name];
|
|
1028
1032
|
return typeof v === "string" && v.startsWith("#") ? v : fallback;
|
|
@@ -1126,9 +1130,8 @@ class ClaudishPanel extends View {
|
|
|
1126
1130
|
if (ctl.message)
|
|
1127
1131
|
panel.child(div().px(14).py(6).text_size(12).text_color(colour(t, "muted", "#9AA0AB")).child(ctl.message));
|
|
1128
1132
|
if (current) {
|
|
1129
|
-
panel.child(this.runHeader(current, t, p));
|
|
1133
|
+
panel.child(this.runHeader(ctl, current, t, p));
|
|
1130
1134
|
panel.child(this.rowList(cx, current, row, t, p));
|
|
1131
|
-
panel.child(this.sessionStrip(cx, ctl, current, row, t, p));
|
|
1132
1135
|
}
|
|
1133
1136
|
panel.child(this.screenArea(cx, ctl, row, t));
|
|
1134
1137
|
if (row)
|
|
@@ -1157,27 +1160,23 @@ class ClaudishPanel extends View {
|
|
|
1157
1160
|
earlierList(cx, earlier, t, p) {
|
|
1158
1161
|
return v_flex().id("claudish-earlier").max_h(220).overflow_y_scrollbar().border_b(1).border_color(colour(t, "border", "#2C2F37")).children(earlier.map((r) => h_flex().id(`earlier-${r.key}`).px(14).py(5).gap(8).items_center().cursor_pointer().hover((s) => s.bg(colour(t, "hover", "#23262D"))).on_click((_e, cx) => this.act(cx, (c) => c.selectRun(r.key))).child(this.dot(r.tone, p)).child(div().flex_1().truncate().child(r.name)).child(div().text_color(colour(t, "dim", "#7D8390")).text_size(12).child(r.age))));
|
|
1159
1162
|
}
|
|
1160
|
-
runHeader(current, t, p) {
|
|
1163
|
+
runHeader(ctl, current, t, p) {
|
|
1161
1164
|
const muted = colour(t, "dim", "#7D8390");
|
|
1162
|
-
return h_flex().px(14).pt(10).pb(4).gap(10).items_center().child(div().flex_none().font_bold().text_color(p.mark).child("◆ claudish")).child(div().flex_none().font_bold().child(current.name)).child(div().flex_none().text_color(muted).child(current.counts)).when(current.meta !== null, (el) => el.child(div().truncate().text_color(muted).child(current.meta ?? "")));
|
|
1165
|
+
return h_flex().flex_none().px(14).pt(10).pb(4).gap(10).items_center().child(div().flex_none().font_bold().text_color(p.mark).child("◆ claudish")).child(div().flex_none().font_bold().child(current.name)).child(div().flex_none().text_color(muted).child(current.counts)).when(current.meta !== null, (el) => el.child(div().truncate().text_color(muted).child(current.meta ?? ""))).child(div().flex_1()).child(this.modeToggle(ctl, t));
|
|
1166
|
+
}
|
|
1167
|
+
modeToggle(ctl, t) {
|
|
1168
|
+
const toggle = h_flex().flex_none().rounded(6).overflow_hidden().border_1().border_color(colour(t, "border", "#343842"));
|
|
1169
|
+
for (const mode of ["screen", "text"])
|
|
1170
|
+
toggle.child(div().id(`mode-${mode}`).px(12).py(4).cursor_pointer().when(ctl.mode === mode, (el) => el.bg(colour(t, "selected", "#262A33")).font_bold()).hover((s) => s.bg(colour(t, "hover", "#23262D"))).on_click((_e, cx) => this.act(cx, (c) => c.setMode(mode))).child(mode === "screen" ? "Screen" : "Text"));
|
|
1171
|
+
return toggle;
|
|
1163
1172
|
}
|
|
1164
1173
|
rowList(cx, current, selected, t, p) {
|
|
1165
|
-
return v_flex().id("claudish-rows").px(14).pt(4).pb(10).gap(4).max_h(240).overflow_y_scrollbar().children(current.rows.map((r) => this.bandRow(r, r.target === selected?.target, t, p)));
|
|
1174
|
+
return v_flex().id("claudish-rows").flex_none().px(14).pt(4).pb(10).gap(4).when(current.rows.length > ROWS_BEFORE_SCROLL, (el) => el.max_h(240).overflow_y_scrollbar()).children(current.rows.map((r) => this.bandRow(r, r.target === selected?.target, t, p)));
|
|
1166
1175
|
}
|
|
1167
1176
|
bandRow(r, selected, t, p) {
|
|
1168
1177
|
const [tokensIn, tokensOut] = r.tokens.includes(" ↓") ? [r.tokens.slice(0, r.tokens.indexOf(" ↓")), r.tokens.slice(r.tokens.indexOf(" ↓") + 1)] : [r.tokens, null];
|
|
1169
1178
|
return h_flex().id(`row-${r.target}`).px(4).py(3).gap(6).items_center().rounded(4).overflow_hidden().cursor_pointer().when(selected, (el) => el.bg(colour(t, "selected", "#262A33")).border_1().border_color(colour(t, "border", "#3A4150"))).hover((s) => s.bg(colour(t, "hover", "#23262D"))).on_click((_e, cx) => this.act(cx, (c) => c.selectSlot(r.target))).child(div().w(22).flex_none().text_color(colour(t, "dim", "#8A909B")).child(r.slot)).child(chip(r.code, p.solid[r.tone], { bold: true, minW: 40 })).child(div().w(44).flex_none().text_right().text_color(p.text[r.tone]).child(r.elapsed)).child(h_flex().flex_none().child(chip(r.model, p.solid.model, { bold: true })).child(chip(r.provider, p.quiet.model))).child(h_flex().flex_none().child(chip(tokensIn, p.tokensIn)).when(tokensOut !== null, (el) => el.child(chip(tokensOut ?? "", p.tokensOut))).child(chip(r.tools, p.quiet.tools, { bold: true })).child(chip(r.turns, p.quiet.loops, { bold: true })).child(chip(r.billing, p.quiet.cost, { bold: true }))).when(r.agent !== null, (el) => el.child(div().flex_none().px(6).border_1().border_color(colour(t, "border", "#3A4150")).text_color(colour(t, "muted", "#9AA0AB")).child(r.agent ?? ""))).child(div().flex_1().min_w(0).truncate().text_color(r.error ? p.text.fail : colour(t, "muted", "#9AA0AB")).child(r.note));
|
|
1170
1179
|
}
|
|
1171
|
-
sessionStrip(cx, ctl, current, row, t, p) {
|
|
1172
|
-
const strip = h_flex().id("claudish-sessions").w_full().items_center().overflow_hidden().border_t(1).border_b(1).border_color(colour(t, "border", "#2C2F37")).bg(colour(t, "surface", "#17191D"));
|
|
1173
|
-
for (const s of sessionTabs(current, row?.target ?? null))
|
|
1174
|
-
strip.child(this.tab(`session-${s.target}`, s.selected, t, (cx) => this.act(cx, (c) => c.selectSlot(s.target)), [this.dot(s.tone, p), div().whitespace_nowrap().child(s.label)]));
|
|
1175
|
-
strip.child(div().flex_1());
|
|
1176
|
-
const toggle = h_flex().mx(10).flex_none().rounded(6).overflow_hidden().border_1().border_color(colour(t, "border", "#343842"));
|
|
1177
|
-
for (const mode of ["screen", "text"])
|
|
1178
|
-
toggle.child(div().id(`mode-${mode}`).px(12).py(4).cursor_pointer().when(ctl.mode === mode, (el) => el.bg(colour(t, "selected", "#262A33")).font_bold()).hover((s) => s.bg(colour(t, "hover", "#23262D"))).on_click((_e, cx) => this.act(cx, (c) => c.setMode(mode))).child(mode === "screen" ? "Screen" : "Text"));
|
|
1179
|
-
return strip.child(toggle);
|
|
1180
|
-
}
|
|
1181
1180
|
screenArea(cx, ctl, row, t) {
|
|
1182
1181
|
const area = v_flex().id("claudish-screen").flex_1().min_h(160).px(16).py(14).bg(colour(t, "background", "#101114")).text_color(colour(t, "foreground", "#CFD2D8")).font_family("JetBrains Mono").text_size(12).overflow_y_scrollbar();
|
|
1183
1182
|
const lines = (text) => text.map((l, i) => div().id(`line-${i}`).whitespace_nowrap().child(l === "" ? " " : l));
|
|
@@ -1198,7 +1197,7 @@ class ClaudishPanel extends View {
|
|
|
1198
1197
|
const p = props() ?? {};
|
|
1199
1198
|
const terminal = typeof p.terminal === "string" ? p.terminal : null;
|
|
1200
1199
|
const overlay = typeof p.overlay === "string" ? p.overlay : null;
|
|
1201
|
-
return h_flex().size_full().px(10).gap(8).items_center().bg(t.surface).border_b(1).border_color(t.border).text_size(12).child(div().flex_1().truncate().text_color(t.foreground).child(`claudish · ${String(p.title ?? "")}`)).child(div().text_color(t.dim).child("read only
|
|
1200
|
+
return h_flex().size_full().px(10).gap(8).items_center().bg(t.surface).border_b(1).border_color(t.border).text_size(12).child(div().flex_1().truncate().text_color(t.foreground).child(`claudish · ${String(p.title ?? "")}`)).child(div().text_color(t.dim).child("read only")).child(div().id("claudish-close").px(6).cursor_pointer().text_color(t.muted).hover((s) => s.text_color(t.foreground)).on_click(() => {
|
|
1202
1201
|
if (terminal)
|
|
1203
1202
|
run("terminal.kill", { terminal });
|
|
1204
1203
|
else if (overlay)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claudish",
|
|
3
|
-
"version": "14.
|
|
3
|
+
"version": "14.22.1",
|
|
4
4
|
"description": "Run Claude Code with any model - OpenRouter, Ollama, LM Studio & local models",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -74,10 +74,10 @@
|
|
|
74
74
|
"ai"
|
|
75
75
|
],
|
|
76
76
|
"optionalDependencies": {
|
|
77
|
-
"@claudish/magmux-darwin-arm64": "14.
|
|
78
|
-
"@claudish/magmux-darwin-x64": "14.
|
|
79
|
-
"@claudish/magmux-linux-arm64": "14.
|
|
80
|
-
"@claudish/magmux-linux-x64": "14.
|
|
77
|
+
"@claudish/magmux-darwin-arm64": "14.22.1",
|
|
78
|
+
"@claudish/magmux-darwin-x64": "14.22.1",
|
|
79
|
+
"@claudish/magmux-linux-arm64": "14.22.1",
|
|
80
|
+
"@claudish/magmux-linux-x64": "14.22.1"
|
|
81
81
|
},
|
|
82
82
|
"author": "Jack Rudenko <i@madappgang.com>",
|
|
83
83
|
"license": "MIT",
|