@sma1lboy/kobe 0.7.10 → 0.7.12
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/cli/index.js +388 -165
- package/package.json +2 -1
package/dist/cli/index.js
CHANGED
|
@@ -70,7 +70,7 @@ var init_package = __esm(() => {
|
|
|
70
70
|
package_default = {
|
|
71
71
|
$schema: "https://json.schemastore.org/package.json",
|
|
72
72
|
name: "@sma1lboy/kobe",
|
|
73
|
-
version: "0.7.
|
|
73
|
+
version: "0.7.12",
|
|
74
74
|
description: "TUI orchestrator for Claude Code (codename)",
|
|
75
75
|
type: "module",
|
|
76
76
|
packageManager: "bun@1.3.13",
|
|
@@ -118,6 +118,7 @@ var init_package = __esm(() => {
|
|
|
118
118
|
"@biomejs/biome": "1.9.4",
|
|
119
119
|
"@tsconfig/bun": "1.0.9",
|
|
120
120
|
"@types/bun": "1.3.12",
|
|
121
|
+
"@types/node": "25.6.2",
|
|
121
122
|
knip: "^6.14.2",
|
|
122
123
|
"node-pty": "^1.1.0",
|
|
123
124
|
typescript: "5.8.2",
|
|
@@ -663,6 +664,33 @@ class TaskIndexStore {
|
|
|
663
664
|
this.notifyListeners();
|
|
664
665
|
return next;
|
|
665
666
|
}
|
|
667
|
+
async move(id, delta, withinIds) {
|
|
668
|
+
this.assertLoaded();
|
|
669
|
+
const task = this.cache.tasks.find((t) => t.id === id);
|
|
670
|
+
if (!task)
|
|
671
|
+
throw new Error(`task not found: ${id}`);
|
|
672
|
+
const ids = withinIds?.length ? withinIds : this.cache.tasks.map((t) => t.id);
|
|
673
|
+
const pos = ids.indexOf(String(id));
|
|
674
|
+
if (pos < 0)
|
|
675
|
+
throw new Error(`task not movable in current group: ${id}`);
|
|
676
|
+
const targetId = ids[pos + delta];
|
|
677
|
+
if (!targetId)
|
|
678
|
+
return task;
|
|
679
|
+
const fromIdx = this.cache.tasks.findIndex((t) => t.id === id);
|
|
680
|
+
const toIdx = this.cache.tasks.findIndex((t) => t.id === targetId);
|
|
681
|
+
if (fromIdx < 0 || toIdx < 0 || fromIdx === toIdx)
|
|
682
|
+
return task;
|
|
683
|
+
const [moved] = this.cache.tasks.splice(fromIdx, 1);
|
|
684
|
+
if (!moved)
|
|
685
|
+
return task;
|
|
686
|
+
const adjustedToIdx = fromIdx < toIdx ? toIdx - 1 : toIdx;
|
|
687
|
+
const insertAt = delta > 0 ? adjustedToIdx + 1 : adjustedToIdx;
|
|
688
|
+
const next = { ...moved, updatedAt: new Date().toISOString() };
|
|
689
|
+
this.cache.tasks.splice(insertAt, 0, next);
|
|
690
|
+
await this.save();
|
|
691
|
+
this.notifyListeners();
|
|
692
|
+
return next;
|
|
693
|
+
}
|
|
666
694
|
async archive(id, status = "done") {
|
|
667
695
|
return this.update(id, { status });
|
|
668
696
|
}
|
|
@@ -3096,6 +3124,13 @@ class Orchestrator {
|
|
|
3096
3124
|
return;
|
|
3097
3125
|
await this.store.update(task.id, { pinned: next });
|
|
3098
3126
|
}
|
|
3127
|
+
async moveTask(id, delta) {
|
|
3128
|
+
const task = this.requireTask(id);
|
|
3129
|
+
if (task.kind === "main")
|
|
3130
|
+
return;
|
|
3131
|
+
const groupIds = this.store.list().filter((t) => (t.kind ?? "task") !== "main" && t.archived === task.archived && (t.pinned ?? false) === (task.pinned ?? false)).map((t) => String(t.id));
|
|
3132
|
+
await this.store.move(task.id, delta, groupIds);
|
|
3133
|
+
}
|
|
3099
3134
|
async setArchived(id, archived) {
|
|
3100
3135
|
const task = this.requireTask(id);
|
|
3101
3136
|
const next = archived ?? !task.archived;
|
|
@@ -5019,6 +5054,21 @@ function matchTaskByCwd(tasks, cwd) {
|
|
|
5019
5054
|
}
|
|
5020
5055
|
return bestId;
|
|
5021
5056
|
}
|
|
5057
|
+
function matchRepoByCwd(tasks, cwd) {
|
|
5058
|
+
const target = normalize(cwd);
|
|
5059
|
+
let best;
|
|
5060
|
+
let bestLen = -1;
|
|
5061
|
+
for (const t of tasks) {
|
|
5062
|
+
if (!t.repo)
|
|
5063
|
+
continue;
|
|
5064
|
+
const repo = normalize(t.repo);
|
|
5065
|
+
if (isAncestorOrSelf(repo, target) && repo.length > bestLen) {
|
|
5066
|
+
bestLen = repo.length;
|
|
5067
|
+
best = repo;
|
|
5068
|
+
}
|
|
5069
|
+
}
|
|
5070
|
+
return best;
|
|
5071
|
+
}
|
|
5022
5072
|
function findAdoptableWorktree(tasks, cwd) {
|
|
5023
5073
|
const target = normalize(cwd);
|
|
5024
5074
|
const repos = new Set;
|
|
@@ -5329,6 +5379,14 @@ async function startDaemonServer(orch, options = {}) {
|
|
|
5329
5379
|
await orch.setPinned(taskId, optionalBoolean(payload, "pinned"));
|
|
5330
5380
|
return {};
|
|
5331
5381
|
}
|
|
5382
|
+
case "task.move": {
|
|
5383
|
+
const taskId = requireString(payload, "taskId");
|
|
5384
|
+
const direction = requireString(payload, "direction");
|
|
5385
|
+
if (direction !== "up" && direction !== "down")
|
|
5386
|
+
throw new Error("direction must be up or down");
|
|
5387
|
+
await orch.moveTask(taskId, direction === "up" ? -1 : 1);
|
|
5388
|
+
return {};
|
|
5389
|
+
}
|
|
5332
5390
|
case "task.status": {
|
|
5333
5391
|
const taskId = requireString(payload, "taskId");
|
|
5334
5392
|
const status = requireString(payload, "status");
|
|
@@ -5364,6 +5422,20 @@ async function startDaemonServer(orch, options = {}) {
|
|
|
5364
5422
|
});
|
|
5365
5423
|
return { task: serializeTask(task) };
|
|
5366
5424
|
}
|
|
5425
|
+
case "worktree.reconcile": {
|
|
5426
|
+
const cwd = requireString(payload, "cwd");
|
|
5427
|
+
const worktreePath = requireString(payload, "worktreePath");
|
|
5428
|
+
const repo = matchRepoByCwd(orch.listTasks(), cwd) ?? matchRepoByCwd(orch.listTasks(), worktreePath);
|
|
5429
|
+
if (!repo)
|
|
5430
|
+
return { adopted: false };
|
|
5431
|
+
try {
|
|
5432
|
+
const task = await orch.adoptWorktree({ repo, worktreePath, ifExists: "return" });
|
|
5433
|
+
return { adopted: true, taskId: task.id };
|
|
5434
|
+
} catch (err) {
|
|
5435
|
+
logDaemonError("worktree-created", err);
|
|
5436
|
+
return { adopted: false };
|
|
5437
|
+
}
|
|
5438
|
+
}
|
|
5367
5439
|
case "task.setActive": {
|
|
5368
5440
|
bus.publish("active-task", { taskId: optionalString(payload, "taskId") ?? null });
|
|
5369
5441
|
return {};
|
|
@@ -8405,6 +8477,29 @@ function mergeActivityHooks(current, install, inv = kobeCliInvocation()) {
|
|
|
8405
8477
|
}
|
|
8406
8478
|
return Object.keys(hooks).length > 0 ? { ...restSettings, hooks } : { ...restSettings };
|
|
8407
8479
|
}
|
|
8480
|
+
function buildWorktreeWatchHook(inv = kobeCliInvocation()) {
|
|
8481
|
+
const command = shellQuoteArgv([...inv, "hook", WORKTREE_SYNC_MARKER]);
|
|
8482
|
+
return { PostToolUse: [{ matcher: "Bash", hooks: [{ type: "command", command }] }] };
|
|
8483
|
+
}
|
|
8484
|
+
function isKobeWorktreeWatchGroup(group) {
|
|
8485
|
+
if (!isObject6(group) || !Array.isArray(group.hooks))
|
|
8486
|
+
return false;
|
|
8487
|
+
return group.hooks.some((h) => isObject6(h) && typeof h.command === "string" && h.command.includes(WORKTREE_SYNC_MARKER));
|
|
8488
|
+
}
|
|
8489
|
+
function mergeWorktreeWatchHook(current, install, inv = kobeCliInvocation()) {
|
|
8490
|
+
const { hooks: rawHooks, ...restSettings } = current;
|
|
8491
|
+
const hooks = isObject6(rawHooks) ? { ...rawHooks } : {};
|
|
8492
|
+
const key = "PostToolUse";
|
|
8493
|
+
const prior = Array.isArray(hooks[key]) ? hooks[key] : [];
|
|
8494
|
+
const kept = prior.filter((g) => !isKobeWorktreeWatchGroup(g));
|
|
8495
|
+
if (install)
|
|
8496
|
+
kept.push(...buildWorktreeWatchHook(inv)[key]);
|
|
8497
|
+
if (kept.length > 0)
|
|
8498
|
+
hooks[key] = kept;
|
|
8499
|
+
else
|
|
8500
|
+
delete hooks[key];
|
|
8501
|
+
return Object.keys(hooks).length > 0 ? { ...restSettings, hooks } : { ...restSettings };
|
|
8502
|
+
}
|
|
8408
8503
|
|
|
8409
8504
|
class ClaudeHookAdapter {
|
|
8410
8505
|
vendor = "claude";
|
|
@@ -8423,6 +8518,12 @@ class ClaudeHookAdapter {
|
|
|
8423
8518
|
async removeWorktreeSyncHook(settingsFilePath) {
|
|
8424
8519
|
await this.editSettings(settingsFilePath, (cur) => mergeWorktreeSyncHook(cur, null));
|
|
8425
8520
|
}
|
|
8521
|
+
async installWorktreeWatchHook(settingsFilePath) {
|
|
8522
|
+
await this.editSettings(settingsFilePath, (cur) => mergeWorktreeWatchHook(cur, true));
|
|
8523
|
+
}
|
|
8524
|
+
async removeWorktreeWatchHook(settingsFilePath) {
|
|
8525
|
+
await this.editSettings(settingsFilePath, (cur) => mergeWorktreeWatchHook(cur, false));
|
|
8526
|
+
}
|
|
8426
8527
|
async editSettings(settingsFilePath, transform) {
|
|
8427
8528
|
try {
|
|
8428
8529
|
const current = await readJsonObject(settingsFilePath);
|
|
@@ -8471,6 +8572,8 @@ class NoopHookAdapter {
|
|
|
8471
8572
|
return false;
|
|
8472
8573
|
}
|
|
8473
8574
|
async removeWorktreeSyncHook() {}
|
|
8575
|
+
async installWorktreeWatchHook() {}
|
|
8576
|
+
async removeWorktreeWatchHook() {}
|
|
8474
8577
|
}
|
|
8475
8578
|
var init_hook_adapter2 = __esm(() => {
|
|
8476
8579
|
init_hook_adapter();
|
|
@@ -8480,6 +8583,7 @@ var init_hook_adapter2 = __esm(() => {
|
|
|
8480
8583
|
var exports_hook_cmd = {};
|
|
8481
8584
|
__export(exports_hook_cmd, {
|
|
8482
8585
|
runHookSubcommand: () => runHookSubcommand,
|
|
8586
|
+
parseWorktreeAddPath: () => parseWorktreeAddPath,
|
|
8483
8587
|
ensureGlobalKobeHooks: () => ensureGlobalKobeHooks
|
|
8484
8588
|
});
|
|
8485
8589
|
import { homedir as homedir10 } from "os";
|
|
@@ -8516,12 +8620,69 @@ function flagValue(argv, name) {
|
|
|
8516
8620
|
}
|
|
8517
8621
|
return;
|
|
8518
8622
|
}
|
|
8623
|
+
function isPlainObject2(v) {
|
|
8624
|
+
return !!v && typeof v === "object" && !Array.isArray(v);
|
|
8625
|
+
}
|
|
8626
|
+
function tokenizeCommand(command) {
|
|
8627
|
+
const out = [];
|
|
8628
|
+
const re = /"([^"]*)"|'([^']*)'|(\S+)/g;
|
|
8629
|
+
let m;
|
|
8630
|
+
while ((m = re.exec(command)) !== null)
|
|
8631
|
+
out.push(m[1] ?? m[2] ?? m[3] ?? "");
|
|
8632
|
+
return out;
|
|
8633
|
+
}
|
|
8634
|
+
function parseWorktreeAddPath(command) {
|
|
8635
|
+
const tokens = tokenizeCommand(command);
|
|
8636
|
+
const valueFlags = new Set(["-b", "-B", "--reason"]);
|
|
8637
|
+
for (let i = 0;i + 1 < tokens.length; i++) {
|
|
8638
|
+
if (tokens[i] !== "worktree" || tokens[i + 1] !== "add")
|
|
8639
|
+
continue;
|
|
8640
|
+
let j = i + 2;
|
|
8641
|
+
while (j < tokens.length) {
|
|
8642
|
+
const t = tokens[j];
|
|
8643
|
+
if (t === "&&" || t === "||" || t === ";" || t === "|" || t === ">" || t === ">>")
|
|
8644
|
+
break;
|
|
8645
|
+
if (t.startsWith("-")) {
|
|
8646
|
+
j += valueFlags.has(t) ? 2 : 1;
|
|
8647
|
+
continue;
|
|
8648
|
+
}
|
|
8649
|
+
return t;
|
|
8650
|
+
}
|
|
8651
|
+
}
|
|
8652
|
+
return;
|
|
8653
|
+
}
|
|
8654
|
+
async function runWorktreeCreatedHook() {
|
|
8655
|
+
const payload = await readStdinPayload();
|
|
8656
|
+
const toolInput = isPlainObject2(payload.tool_input) ? payload.tool_input : {};
|
|
8657
|
+
const command = typeof toolInput.command === "string" ? toolInput.command : "";
|
|
8658
|
+
if (!command.includes("worktree"))
|
|
8659
|
+
return;
|
|
8660
|
+
const rawPath = parseWorktreeAddPath(command);
|
|
8661
|
+
if (!rawPath)
|
|
8662
|
+
return;
|
|
8663
|
+
const cwd = typeof payload.cwd === "string" && payload.cwd ? payload.cwd : process.cwd();
|
|
8664
|
+
const worktreePath = resolve6(cwd, rawPath);
|
|
8665
|
+
const client = await connectIfRunning();
|
|
8666
|
+
if (!client)
|
|
8667
|
+
return;
|
|
8668
|
+
try {
|
|
8669
|
+
await client.request("worktree.reconcile", { cwd, worktreePath });
|
|
8670
|
+
} finally {
|
|
8671
|
+
client.close();
|
|
8672
|
+
}
|
|
8673
|
+
}
|
|
8519
8674
|
async function runHookSubcommand(argv) {
|
|
8520
8675
|
const [verb, ...rest] = argv;
|
|
8521
8676
|
if (verb === "setup") {
|
|
8522
8677
|
await runHookSetup(rest);
|
|
8523
8678
|
return;
|
|
8524
8679
|
}
|
|
8680
|
+
if (verb === WORKTREE_CREATED_VERB) {
|
|
8681
|
+
try {
|
|
8682
|
+
await runWorktreeCreatedHook();
|
|
8683
|
+
} catch {}
|
|
8684
|
+
return;
|
|
8685
|
+
}
|
|
8525
8686
|
try {
|
|
8526
8687
|
if (!verb || !isEngineActivityKind(verb))
|
|
8527
8688
|
return;
|
|
@@ -8569,8 +8730,10 @@ function persistedSyncPath(stored) {
|
|
|
8569
8730
|
async function ensureGlobalKobeHooks() {
|
|
8570
8731
|
try {
|
|
8571
8732
|
const globalPath = globalSettingsPath();
|
|
8572
|
-
for (const a of activityHookAdapters())
|
|
8733
|
+
for (const a of activityHookAdapters()) {
|
|
8573
8734
|
await a.installActivityHooks(globalPath);
|
|
8735
|
+
await a.installWorktreeWatchHook(globalPath);
|
|
8736
|
+
}
|
|
8574
8737
|
await cleanupWorktreeSyncHook();
|
|
8575
8738
|
} catch {}
|
|
8576
8739
|
}
|
|
@@ -8605,7 +8768,7 @@ async function runHookSetup(_argv) {
|
|
|
8605
8768
|
].join(`
|
|
8606
8769
|
`));
|
|
8607
8770
|
}
|
|
8608
|
-
var SYNC_SETTING_KEY = "externalWorktreeSync";
|
|
8771
|
+
var WORKTREE_CREATED_VERB = "worktree-created", SYNC_SETTING_KEY = "externalWorktreeSync";
|
|
8609
8772
|
var init_hook_cmd = __esm(() => {
|
|
8610
8773
|
init_daemon_process();
|
|
8611
8774
|
init_hook_adapter2();
|
|
@@ -10067,6 +10230,9 @@ class RemoteOrchestrator {
|
|
|
10067
10230
|
async setPinned(id, pinned) {
|
|
10068
10231
|
await this.client.request("task.pin", { taskId: String(id), pinned });
|
|
10069
10232
|
}
|
|
10233
|
+
async moveTask(id, delta) {
|
|
10234
|
+
await this.client.request("task.move", { taskId: String(id), direction: delta < 0 ? "up" : "down" });
|
|
10235
|
+
}
|
|
10070
10236
|
async setArchived(id, archived) {
|
|
10071
10237
|
await this.client.request("task.archive", { taskId: String(id), archived });
|
|
10072
10238
|
}
|
|
@@ -16986,28 +17152,51 @@ function useSidebarBindings(opts) {
|
|
|
16986
17152
|
return ids[idx];
|
|
16987
17153
|
};
|
|
16988
17154
|
const searchModeAccessor = () => opts.searchMode?.() ?? false;
|
|
17155
|
+
const moveModeAccessor = () => opts.moveMode?.() ?? false;
|
|
16989
17156
|
useBindings(() => ({
|
|
16990
17157
|
enabled: opts.focused() && !searchModeAccessor(),
|
|
16991
17158
|
bindings: bindByIds({
|
|
16992
17159
|
"sidebar.nav": (evt) => {
|
|
17160
|
+
if (moveModeAccessor()) {
|
|
17161
|
+
const id = cursorTaskId();
|
|
17162
|
+
if (id === undefined)
|
|
17163
|
+
return;
|
|
17164
|
+
if (evt.name === "j" || evt.name === "down")
|
|
17165
|
+
opts.onMoveRequest?.(id, 1);
|
|
17166
|
+
else if (evt.name === "k" || evt.name === "up")
|
|
17167
|
+
opts.onMoveRequest?.(id, -1);
|
|
17168
|
+
return;
|
|
17169
|
+
}
|
|
16993
17170
|
if (evt.name === "j" || evt.name === "down")
|
|
16994
17171
|
ctrl.moveDown();
|
|
16995
17172
|
else if (evt.name === "k" || evt.name === "up")
|
|
16996
17173
|
ctrl.moveUp();
|
|
16997
17174
|
},
|
|
16998
|
-
"sidebar.select": () =>
|
|
17175
|
+
"sidebar.select": () => {
|
|
17176
|
+
if (moveModeAccessor()) {
|
|
17177
|
+
opts.onMoveModeExit?.();
|
|
17178
|
+
return;
|
|
17179
|
+
}
|
|
17180
|
+
ctrl.selectCurrent();
|
|
17181
|
+
},
|
|
16999
17182
|
"sidebar.goto": (evt) => {
|
|
17183
|
+
if (moveModeAccessor())
|
|
17184
|
+
return;
|
|
17000
17185
|
if (evt.shift)
|
|
17001
17186
|
ctrl.pressShiftG();
|
|
17002
17187
|
else
|
|
17003
17188
|
ctrl.pressG();
|
|
17004
17189
|
},
|
|
17005
17190
|
"sidebar.delete": () => {
|
|
17191
|
+
if (moveModeAccessor())
|
|
17192
|
+
return;
|
|
17006
17193
|
const id = cursorTaskId();
|
|
17007
17194
|
if (id !== undefined)
|
|
17008
17195
|
opts.onDeleteRequest?.(id);
|
|
17009
17196
|
},
|
|
17010
17197
|
"sidebar.archive": () => {
|
|
17198
|
+
if (moveModeAccessor())
|
|
17199
|
+
return;
|
|
17011
17200
|
const id = cursorTaskId();
|
|
17012
17201
|
if (id !== undefined)
|
|
17013
17202
|
opts.onArchiveRequest?.(id);
|
|
@@ -17020,20 +17209,32 @@ function useSidebarBindings(opts) {
|
|
|
17020
17209
|
opts.onLocalMergeRequest?.(id);
|
|
17021
17210
|
},
|
|
17022
17211
|
"sidebar.rename": () => {
|
|
17212
|
+
if (moveModeAccessor())
|
|
17213
|
+
return;
|
|
17023
17214
|
const id = cursorTaskId();
|
|
17024
17215
|
if (id !== undefined)
|
|
17025
17216
|
opts.onRenameRequest?.(id);
|
|
17026
17217
|
},
|
|
17027
17218
|
"sidebar.pin": (evt) => {
|
|
17219
|
+
if (moveModeAccessor())
|
|
17220
|
+
return;
|
|
17028
17221
|
if (!evt.shift)
|
|
17029
17222
|
return;
|
|
17030
17223
|
const id = cursorTaskId();
|
|
17031
17224
|
if (id !== undefined)
|
|
17032
17225
|
opts.onPinRequest?.(id);
|
|
17033
17226
|
},
|
|
17034
|
-
"sidebar.search.enter": () =>
|
|
17227
|
+
"sidebar.search.enter": () => {
|
|
17228
|
+
if (moveModeAccessor())
|
|
17229
|
+
return;
|
|
17230
|
+
opts.onSearchEnter?.();
|
|
17231
|
+
}
|
|
17035
17232
|
})
|
|
17036
17233
|
}));
|
|
17234
|
+
useBindings(() => ({
|
|
17235
|
+
enabled: opts.focused() && moveModeAccessor(),
|
|
17236
|
+
bindings: [{ key: "escape", cmd: () => opts.onMoveModeExit?.() }]
|
|
17237
|
+
}));
|
|
17037
17238
|
useBindings(() => ({
|
|
17038
17239
|
enabled: opts.focused(),
|
|
17039
17240
|
bindings: bindByIds({
|
|
@@ -17218,6 +17419,9 @@ function Sidebar(props) {
|
|
|
17218
17419
|
onDeleteRequest: (id) => props.onDeleteRequest?.(id),
|
|
17219
17420
|
onArchiveRequest: (id) => props.onArchiveRequest?.(id),
|
|
17220
17421
|
onLocalMergeRequest: (id) => props.onLocalMergeRequest?.(id),
|
|
17422
|
+
moveMode: props.moveMode,
|
|
17423
|
+
onMoveRequest: (id, delta) => props.onMoveRequest?.(id, delta),
|
|
17424
|
+
onMoveModeExit: () => props.onMoveModeExit?.(),
|
|
17221
17425
|
onRenameRequest: (id) => props.onRenameRequest?.(id),
|
|
17222
17426
|
onPinRequest: (id) => props.onPinRequest?.(id),
|
|
17223
17427
|
onViewSwitch: (delta) => cycleView(delta),
|
|
@@ -17438,33 +17642,55 @@ function Sidebar(props) {
|
|
|
17438
17642
|
});
|
|
17439
17643
|
const titleText = isMain ? repoBasename(task.repo) : task.title;
|
|
17440
17644
|
const activity = () => props.engineState?.().get(task.id)?.state;
|
|
17441
|
-
const
|
|
17442
|
-
const
|
|
17645
|
+
const hasActivity = () => activity() !== undefined;
|
|
17646
|
+
const loading = () => activity() === "running" || isLive() || !hasActivity() && !isMain && task.status === "in_progress";
|
|
17647
|
+
const activityBadge = () => {
|
|
17443
17648
|
switch (activity()) {
|
|
17444
17649
|
case "rate_limited":
|
|
17445
17650
|
return {
|
|
17446
|
-
|
|
17651
|
+
glyph: "\u25F7",
|
|
17447
17652
|
tone: "warning"
|
|
17448
17653
|
};
|
|
17449
17654
|
case "permission_needed":
|
|
17450
17655
|
return {
|
|
17451
|
-
|
|
17656
|
+
glyph: "?",
|
|
17452
17657
|
tone: "warning"
|
|
17453
17658
|
};
|
|
17454
17659
|
case "error":
|
|
17455
17660
|
return {
|
|
17456
|
-
|
|
17661
|
+
glyph: "\u2715",
|
|
17457
17662
|
tone: "error"
|
|
17458
17663
|
};
|
|
17459
17664
|
case "turn_complete":
|
|
17460
17665
|
return {
|
|
17461
|
-
|
|
17666
|
+
glyph: "\u2713",
|
|
17462
17667
|
tone: "primary"
|
|
17463
17668
|
};
|
|
17464
17669
|
default:
|
|
17465
17670
|
return null;
|
|
17466
17671
|
}
|
|
17467
17672
|
};
|
|
17673
|
+
const stateGlyph = () => {
|
|
17674
|
+
if (loading())
|
|
17675
|
+
return IN_PROGRESS_SPINNER[spinnerFrame()] ?? IN_PROGRESS_SPINNER[0];
|
|
17676
|
+
return activityBadge()?.glyph ?? badge.glyph;
|
|
17677
|
+
};
|
|
17678
|
+
const projectGlyph = () => {
|
|
17679
|
+
if (loading())
|
|
17680
|
+
return IN_PROGRESS_SPINNER[spinnerFrame()] ?? IN_PROGRESS_SPINNER[0];
|
|
17681
|
+
return activityBadge()?.glyph ?? "\u2605";
|
|
17682
|
+
};
|
|
17683
|
+
const stateColor = () => {
|
|
17684
|
+
const active = activityBadge();
|
|
17685
|
+
if (!loading() && active) {
|
|
17686
|
+
if (active.tone === "error")
|
|
17687
|
+
return theme.error;
|
|
17688
|
+
if (active.tone === "warning")
|
|
17689
|
+
return theme.warning;
|
|
17690
|
+
return theme.primary;
|
|
17691
|
+
}
|
|
17692
|
+
return badgeColor();
|
|
17693
|
+
};
|
|
17468
17694
|
const subtitleText = createMemo(() => {
|
|
17469
17695
|
if (task.branch.length > 0)
|
|
17470
17696
|
return truncateBranchLabel(task.branch, subtitleBudget());
|
|
@@ -17519,7 +17745,7 @@ function Sidebar(props) {
|
|
|
17519
17745
|
insert(_el$29, createComponent2(Show, {
|
|
17520
17746
|
when: isMain,
|
|
17521
17747
|
get children() {
|
|
17522
|
-
var _el$30 = createElement("box"), _el$31 = createElement("text"), _el$32 = createElement("box"), _el$33 = createElement("text"), _el$34 = createElement("text");
|
|
17748
|
+
var _el$30 = createElement("box"), _el$31 = createElement("text"), _el$32 = createElement("box"), _el$33 = createElement("text"), _el$34 = createElement("text"), _el$35 = createElement("text");
|
|
17523
17749
|
insertNode(_el$30, _el$31);
|
|
17524
17750
|
insertNode(_el$30, _el$32);
|
|
17525
17751
|
setProp(_el$30, "flexDirection", "row");
|
|
@@ -17528,64 +17754,36 @@ function Sidebar(props) {
|
|
|
17528
17754
|
insert(_el$31, barGlyph);
|
|
17529
17755
|
insertNode(_el$32, _el$33);
|
|
17530
17756
|
insertNode(_el$32, _el$34);
|
|
17757
|
+
insertNode(_el$32, _el$35);
|
|
17531
17758
|
setProp(_el$32, "flexDirection", "row");
|
|
17532
17759
|
setProp(_el$32, "flexGrow", 1);
|
|
17533
17760
|
setProp(_el$32, "paddingRight", 1);
|
|
17534
17761
|
setProp(_el$32, "gap", 0);
|
|
17535
17762
|
setProp(_el$33, "wrapMode", "none");
|
|
17536
|
-
insert(_el$33,
|
|
17537
|
-
var _c$2 = memo2(() => !!loading());
|
|
17538
|
-
return () => _c$2() ? IN_PROGRESS_SPINNER[spinnerFrame()] ?? IN_PROGRESS_SPINNER[0] : "\u2605";
|
|
17539
|
-
})());
|
|
17763
|
+
insert(_el$33, projectGlyph);
|
|
17540
17764
|
setProp(_el$34, "wrapMode", "none");
|
|
17541
17765
|
setProp(_el$34, "flexGrow", 1);
|
|
17542
17766
|
insert(_el$34, () => spacedTitle(titleText, titleBudget()));
|
|
17543
|
-
|
|
17544
|
-
|
|
17545
|
-
return loading();
|
|
17546
|
-
},
|
|
17547
|
-
get children() {
|
|
17548
|
-
var _el$35 = createElement("text");
|
|
17549
|
-
insertNode(_el$35, createTextNode(` working`));
|
|
17550
|
-
setProp(_el$35, "wrapMode", "none");
|
|
17551
|
-
effect((_$p) => setProp(_el$35, "fg", theme.primary, _$p));
|
|
17552
|
-
return _el$35;
|
|
17553
|
-
}
|
|
17554
|
-
}), null);
|
|
17555
|
-
insert(_el$32, createComponent2(Show, {
|
|
17556
|
-
get when() {
|
|
17557
|
-
return !loading();
|
|
17558
|
-
},
|
|
17559
|
-
get children() {
|
|
17560
|
-
var _el$37 = createElement("text");
|
|
17561
|
-
setProp(_el$37, "wrapMode", "none");
|
|
17562
|
-
insert(_el$37, () => ` ${truncatePathTail(abbrevHome(task.repo), subtitleBudget())}`);
|
|
17563
|
-
effect((_p$) => {
|
|
17564
|
-
var _v$15 = theme.textMuted, _v$16 = TextAttributes9.DIM;
|
|
17565
|
-
_v$15 !== _p$.e && (_p$.e = setProp(_el$37, "fg", _v$15, _p$.e));
|
|
17566
|
-
_v$16 !== _p$.t && (_p$.t = setProp(_el$37, "attributes", _v$16, _p$.t));
|
|
17567
|
-
return _p$;
|
|
17568
|
-
}, {
|
|
17569
|
-
e: undefined,
|
|
17570
|
-
t: undefined
|
|
17571
|
-
});
|
|
17572
|
-
return _el$37;
|
|
17573
|
-
}
|
|
17574
|
-
}), null);
|
|
17767
|
+
setProp(_el$35, "wrapMode", "none");
|
|
17768
|
+
insert(_el$35, () => ` ${truncatePathTail(abbrevHome(task.repo), subtitleBudget())}`);
|
|
17575
17769
|
effect((_p$) => {
|
|
17576
|
-
var _v$
|
|
17577
|
-
_v$
|
|
17578
|
-
_v$
|
|
17579
|
-
_v$
|
|
17580
|
-
_v$
|
|
17581
|
-
_v$
|
|
17770
|
+
var _v$15 = barColor(), _v$16 = stateColor(), _v$17 = TextAttributes9.BOLD, _v$18 = theme.text, _v$19 = TextAttributes9.BOLD, _v$20 = theme.textMuted, _v$21 = TextAttributes9.DIM;
|
|
17771
|
+
_v$15 !== _p$.e && (_p$.e = setProp(_el$31, "fg", _v$15, _p$.e));
|
|
17772
|
+
_v$16 !== _p$.t && (_p$.t = setProp(_el$33, "fg", _v$16, _p$.t));
|
|
17773
|
+
_v$17 !== _p$.a && (_p$.a = setProp(_el$33, "attributes", _v$17, _p$.a));
|
|
17774
|
+
_v$18 !== _p$.o && (_p$.o = setProp(_el$34, "fg", _v$18, _p$.o));
|
|
17775
|
+
_v$19 !== _p$.i && (_p$.i = setProp(_el$34, "attributes", _v$19, _p$.i));
|
|
17776
|
+
_v$20 !== _p$.n && (_p$.n = setProp(_el$35, "fg", _v$20, _p$.n));
|
|
17777
|
+
_v$21 !== _p$.s && (_p$.s = setProp(_el$35, "attributes", _v$21, _p$.s));
|
|
17582
17778
|
return _p$;
|
|
17583
17779
|
}, {
|
|
17584
17780
|
e: undefined,
|
|
17585
17781
|
t: undefined,
|
|
17586
17782
|
a: undefined,
|
|
17587
17783
|
o: undefined,
|
|
17588
|
-
i: undefined
|
|
17784
|
+
i: undefined,
|
|
17785
|
+
n: undefined,
|
|
17786
|
+
s: undefined
|
|
17589
17787
|
});
|
|
17590
17788
|
return _el$30;
|
|
17591
17789
|
}
|
|
@@ -17594,58 +17792,43 @@ function Sidebar(props) {
|
|
|
17594
17792
|
when: !isMain,
|
|
17595
17793
|
get children() {
|
|
17596
17794
|
return [(() => {
|
|
17597
|
-
var _el$
|
|
17795
|
+
var _el$36 = createElement("box"), _el$37 = createElement("text"), _el$38 = createElement("box"), _el$39 = createElement("text"), _el$40 = createElement("text");
|
|
17796
|
+
insertNode(_el$36, _el$37);
|
|
17797
|
+
insertNode(_el$36, _el$38);
|
|
17798
|
+
setProp(_el$36, "flexDirection", "row");
|
|
17799
|
+
setProp(_el$36, "gap", 0);
|
|
17800
|
+
setProp(_el$37, "wrapMode", "none");
|
|
17801
|
+
insert(_el$37, barGlyph);
|
|
17598
17802
|
insertNode(_el$38, _el$39);
|
|
17599
17803
|
insertNode(_el$38, _el$40);
|
|
17600
17804
|
setProp(_el$38, "flexDirection", "row");
|
|
17805
|
+
setProp(_el$38, "flexGrow", 1);
|
|
17806
|
+
setProp(_el$38, "paddingRight", 1);
|
|
17601
17807
|
setProp(_el$38, "gap", 0);
|
|
17602
17808
|
setProp(_el$39, "wrapMode", "none");
|
|
17603
|
-
insert(_el$39,
|
|
17604
|
-
|
|
17605
|
-
insertNode(_el$40, _el$42);
|
|
17606
|
-
setProp(_el$40, "flexDirection", "row");
|
|
17809
|
+
insert(_el$39, stateGlyph);
|
|
17810
|
+
setProp(_el$40, "wrapMode", "none");
|
|
17607
17811
|
setProp(_el$40, "flexGrow", 1);
|
|
17608
|
-
|
|
17609
|
-
|
|
17610
|
-
setProp(_el$41, "wrapMode", "none");
|
|
17611
|
-
insert(_el$41, (() => {
|
|
17612
|
-
var _c$3 = memo2(() => !!loading());
|
|
17613
|
-
return () => _c$3() ? IN_PROGRESS_SPINNER[spinnerFrame()] ?? IN_PROGRESS_SPINNER[0] : badge.glyph;
|
|
17614
|
-
})());
|
|
17615
|
-
setProp(_el$42, "wrapMode", "none");
|
|
17616
|
-
setProp(_el$42, "flexGrow", 1);
|
|
17617
|
-
insert(_el$42, () => spacedTitle(titleText, titleBudget()));
|
|
17618
|
-
insert(_el$40, createComponent2(Show, {
|
|
17812
|
+
insert(_el$40, () => spacedTitle(titleText, titleBudget()));
|
|
17813
|
+
insert(_el$38, createComponent2(Show, {
|
|
17619
17814
|
get when() {
|
|
17620
|
-
return
|
|
17815
|
+
return memo2(() => !!props.moveMode?.())() && isCursor();
|
|
17621
17816
|
},
|
|
17622
17817
|
get children() {
|
|
17623
|
-
var _el$
|
|
17624
|
-
insertNode(_el$
|
|
17625
|
-
setProp(_el$
|
|
17626
|
-
effect((_$p) => setProp(_el$
|
|
17627
|
-
return _el$
|
|
17818
|
+
var _el$41 = createElement("text");
|
|
17819
|
+
insertNode(_el$41, createTextNode(` move`));
|
|
17820
|
+
setProp(_el$41, "wrapMode", "none");
|
|
17821
|
+
effect((_$p) => setProp(_el$41, "fg", theme.warning, _$p));
|
|
17822
|
+
return _el$41;
|
|
17628
17823
|
}
|
|
17629
17824
|
}), null);
|
|
17630
|
-
insert(_el$40, createComponent2(Show, {
|
|
17631
|
-
get when() {
|
|
17632
|
-
return memo2(() => !!!loading())() && activityChip();
|
|
17633
|
-
},
|
|
17634
|
-
children: (chip) => (() => {
|
|
17635
|
-
var _el$55 = createElement("text");
|
|
17636
|
-
setProp(_el$55, "wrapMode", "none");
|
|
17637
|
-
insert(_el$55, () => ` ${chip().text}`);
|
|
17638
|
-
effect((_$p) => setProp(_el$55, "fg", chip().tone === "error" ? theme.error : chip().tone === "warning" ? theme.warning : theme.primary, _$p));
|
|
17639
|
-
return _el$55;
|
|
17640
|
-
})()
|
|
17641
|
-
}), null);
|
|
17642
17825
|
effect((_p$) => {
|
|
17643
|
-
var _v$22 = barColor(), _v$23 =
|
|
17644
|
-
_v$22 !== _p$.e && (_p$.e = setProp(_el$
|
|
17645
|
-
_v$23 !== _p$.t && (_p$.t = setProp(_el$
|
|
17646
|
-
_v$24 !== _p$.a && (_p$.a = setProp(_el$
|
|
17647
|
-
_v$25 !== _p$.o && (_p$.o = setProp(_el$
|
|
17648
|
-
_v$26 !== _p$.i && (_p$.i = setProp(_el$
|
|
17826
|
+
var _v$22 = barColor(), _v$23 = stateColor(), _v$24 = TextAttributes9.BOLD, _v$25 = theme.text, _v$26 = isSelected() || isCursor() ? TextAttributes9.BOLD : undefined;
|
|
17827
|
+
_v$22 !== _p$.e && (_p$.e = setProp(_el$37, "fg", _v$22, _p$.e));
|
|
17828
|
+
_v$23 !== _p$.t && (_p$.t = setProp(_el$39, "fg", _v$23, _p$.t));
|
|
17829
|
+
_v$24 !== _p$.a && (_p$.a = setProp(_el$39, "attributes", _v$24, _p$.a));
|
|
17830
|
+
_v$25 !== _p$.o && (_p$.o = setProp(_el$40, "fg", _v$25, _p$.o));
|
|
17831
|
+
_v$26 !== _p$.i && (_p$.i = setProp(_el$40, "attributes", _v$26, _p$.i));
|
|
17649
17832
|
return _p$;
|
|
17650
17833
|
}, {
|
|
17651
17834
|
e: undefined,
|
|
@@ -17654,74 +17837,74 @@ function Sidebar(props) {
|
|
|
17654
17837
|
o: undefined,
|
|
17655
17838
|
i: undefined
|
|
17656
17839
|
});
|
|
17657
|
-
return _el$
|
|
17840
|
+
return _el$36;
|
|
17658
17841
|
})(), (() => {
|
|
17659
|
-
var _el$
|
|
17842
|
+
var _el$43 = createElement("box"), _el$44 = createElement("text"), _el$45 = createElement("box"), _el$46 = createElement("text");
|
|
17843
|
+
insertNode(_el$43, _el$44);
|
|
17844
|
+
insertNode(_el$43, _el$45);
|
|
17845
|
+
setProp(_el$43, "flexDirection", "row");
|
|
17846
|
+
setProp(_el$43, "gap", 0);
|
|
17847
|
+
setProp(_el$44, "wrapMode", "none");
|
|
17848
|
+
insert(_el$44, barGlyph);
|
|
17660
17849
|
insertNode(_el$45, _el$46);
|
|
17661
|
-
insertNode(_el$45, _el$47);
|
|
17662
17850
|
setProp(_el$45, "flexDirection", "row");
|
|
17663
|
-
setProp(_el$45, "
|
|
17851
|
+
setProp(_el$45, "flexGrow", 1);
|
|
17852
|
+
setProp(_el$45, "paddingLeft", 2);
|
|
17853
|
+
setProp(_el$45, "paddingRight", 1);
|
|
17854
|
+
setProp(_el$45, "gap", 1);
|
|
17664
17855
|
setProp(_el$46, "wrapMode", "none");
|
|
17665
|
-
|
|
17666
|
-
|
|
17667
|
-
|
|
17668
|
-
setProp(_el$47, "flexGrow", 1);
|
|
17669
|
-
setProp(_el$47, "paddingLeft", 2);
|
|
17670
|
-
setProp(_el$47, "paddingRight", 1);
|
|
17671
|
-
setProp(_el$47, "gap", 1);
|
|
17672
|
-
setProp(_el$48, "wrapMode", "none");
|
|
17673
|
-
setProp(_el$48, "flexGrow", 1);
|
|
17674
|
-
insert(_el$48, subtitleText);
|
|
17675
|
-
insert(_el$47, createComponent2(Show, {
|
|
17856
|
+
setProp(_el$46, "flexGrow", 1);
|
|
17857
|
+
insert(_el$46, subtitleText);
|
|
17858
|
+
insert(_el$45, createComponent2(Show, {
|
|
17676
17859
|
get when() {
|
|
17677
17860
|
return task.pinned === true;
|
|
17678
17861
|
},
|
|
17679
17862
|
get children() {
|
|
17680
|
-
var _el$
|
|
17681
|
-
insertNode(_el$
|
|
17682
|
-
setProp(_el$
|
|
17683
|
-
effect((_$p) => setProp(_el$
|
|
17684
|
-
return _el$
|
|
17863
|
+
var _el$47 = createElement("text");
|
|
17864
|
+
insertNode(_el$47, createTextNode(`\u25B4`));
|
|
17865
|
+
setProp(_el$47, "wrapMode", "none");
|
|
17866
|
+
effect((_$p) => setProp(_el$47, "fg", theme.warning, _$p));
|
|
17867
|
+
return _el$47;
|
|
17685
17868
|
}
|
|
17686
17869
|
}), null);
|
|
17687
|
-
insert(_el$
|
|
17870
|
+
insert(_el$45, createComponent2(Show, {
|
|
17688
17871
|
get when() {
|
|
17689
17872
|
return changes().added > 0;
|
|
17690
17873
|
},
|
|
17691
17874
|
get children() {
|
|
17692
|
-
var _el$
|
|
17693
|
-
insertNode(_el$
|
|
17694
|
-
setProp(_el$
|
|
17695
|
-
insert(_el$
|
|
17696
|
-
effect((_$p) => setProp(_el$
|
|
17697
|
-
return _el$
|
|
17875
|
+
var _el$49 = createElement("text"), _el$50 = createTextNode(`+`);
|
|
17876
|
+
insertNode(_el$49, _el$50);
|
|
17877
|
+
setProp(_el$49, "wrapMode", "none");
|
|
17878
|
+
insert(_el$49, () => changes().added, null);
|
|
17879
|
+
effect((_$p) => setProp(_el$49, "fg", theme.success, _$p));
|
|
17880
|
+
return _el$49;
|
|
17698
17881
|
}
|
|
17699
17882
|
}), null);
|
|
17700
|
-
insert(_el$
|
|
17883
|
+
insert(_el$45, createComponent2(Show, {
|
|
17701
17884
|
get when() {
|
|
17702
17885
|
return changes().deleted > 0;
|
|
17703
17886
|
},
|
|
17704
17887
|
get children() {
|
|
17705
|
-
var _el$
|
|
17706
|
-
insertNode(_el$
|
|
17707
|
-
setProp(_el$
|
|
17708
|
-
insert(_el$
|
|
17709
|
-
effect((_$p) => setProp(_el$
|
|
17710
|
-
return _el$
|
|
17888
|
+
var _el$51 = createElement("text"), _el$52 = createTextNode(`\u2212`);
|
|
17889
|
+
insertNode(_el$51, _el$52);
|
|
17890
|
+
setProp(_el$51, "wrapMode", "none");
|
|
17891
|
+
insert(_el$51, () => changes().deleted, null);
|
|
17892
|
+
effect((_$p) => setProp(_el$51, "fg", theme.error, _$p));
|
|
17893
|
+
return _el$51;
|
|
17711
17894
|
}
|
|
17712
17895
|
}), null);
|
|
17713
17896
|
effect((_p$) => {
|
|
17714
17897
|
var _v$27 = barColor(), _v$28 = theme.textMuted, _v$29 = TextAttributes9.DIM;
|
|
17715
|
-
_v$27 !== _p$.e && (_p$.e = setProp(_el$
|
|
17716
|
-
_v$28 !== _p$.t && (_p$.t = setProp(_el$
|
|
17717
|
-
_v$29 !== _p$.a && (_p$.a = setProp(_el$
|
|
17898
|
+
_v$27 !== _p$.e && (_p$.e = setProp(_el$44, "fg", _v$27, _p$.e));
|
|
17899
|
+
_v$28 !== _p$.t && (_p$.t = setProp(_el$46, "fg", _v$28, _p$.t));
|
|
17900
|
+
_v$29 !== _p$.a && (_p$.a = setProp(_el$46, "attributes", _v$29, _p$.a));
|
|
17718
17901
|
return _p$;
|
|
17719
17902
|
}, {
|
|
17720
17903
|
e: undefined,
|
|
17721
17904
|
t: undefined,
|
|
17722
17905
|
a: undefined
|
|
17723
17906
|
});
|
|
17724
|
-
return _el$
|
|
17907
|
+
return _el$43;
|
|
17725
17908
|
})()];
|
|
17726
17909
|
}
|
|
17727
17910
|
}), null);
|
|
@@ -17784,43 +17967,43 @@ function Sidebar(props) {
|
|
|
17784
17967
|
const left = createMemo(() => Math.max(0, Math.min(h().x + 2, dims().width - boxW() - 1)));
|
|
17785
17968
|
const top = createMemo(() => Math.max(0, Math.min(h().y + 1, dims().height - boxH() - 1)));
|
|
17786
17969
|
return (() => {
|
|
17787
|
-
var _el$
|
|
17788
|
-
setProp(_el$
|
|
17789
|
-
setProp(_el$
|
|
17790
|
-
setProp(_el$
|
|
17791
|
-
setProp(_el$
|
|
17792
|
-
setProp(_el$
|
|
17793
|
-
setProp(_el$
|
|
17794
|
-
insert(_el$
|
|
17970
|
+
var _el$53 = createElement("box");
|
|
17971
|
+
setProp(_el$53, "position", "absolute");
|
|
17972
|
+
setProp(_el$53, "zIndex", 2600);
|
|
17973
|
+
setProp(_el$53, "flexDirection", "column");
|
|
17974
|
+
setProp(_el$53, "border", true);
|
|
17975
|
+
setProp(_el$53, "paddingLeft", 1);
|
|
17976
|
+
setProp(_el$53, "paddingRight", 1);
|
|
17977
|
+
insert(_el$53, createComponent2(For, {
|
|
17795
17978
|
get each() {
|
|
17796
17979
|
return lines();
|
|
17797
17980
|
},
|
|
17798
17981
|
children: (l) => (() => {
|
|
17799
|
-
var _el$
|
|
17800
|
-
setProp(_el$
|
|
17801
|
-
insert(_el$
|
|
17802
|
-
var _c$
|
|
17803
|
-
return () => _c$
|
|
17982
|
+
var _el$54 = createElement("text");
|
|
17983
|
+
setProp(_el$54, "wrapMode", "none");
|
|
17984
|
+
insert(_el$54, (() => {
|
|
17985
|
+
var _c$2 = memo2(() => !!l.dim);
|
|
17986
|
+
return () => _c$2() ? truncatePathTail(l.text, innerW()) : truncateTitle(l.text, innerW());
|
|
17804
17987
|
})());
|
|
17805
17988
|
effect((_p$) => {
|
|
17806
17989
|
var _v$35 = l.dim ? theme.textMuted : theme.text, _v$36 = l.bold ? TextAttributes9.BOLD : l.dim ? TextAttributes9.DIM : undefined;
|
|
17807
|
-
_v$35 !== _p$.e && (_p$.e = setProp(_el$
|
|
17808
|
-
_v$36 !== _p$.t && (_p$.t = setProp(_el$
|
|
17990
|
+
_v$35 !== _p$.e && (_p$.e = setProp(_el$54, "fg", _v$35, _p$.e));
|
|
17991
|
+
_v$36 !== _p$.t && (_p$.t = setProp(_el$54, "attributes", _v$36, _p$.t));
|
|
17809
17992
|
return _p$;
|
|
17810
17993
|
}, {
|
|
17811
17994
|
e: undefined,
|
|
17812
17995
|
t: undefined
|
|
17813
17996
|
});
|
|
17814
|
-
return _el$
|
|
17997
|
+
return _el$54;
|
|
17815
17998
|
})()
|
|
17816
17999
|
}));
|
|
17817
18000
|
effect((_p$) => {
|
|
17818
18001
|
var _v$30 = left(), _v$31 = top(), _v$32 = boxW(), _v$33 = theme.focusAccent, _v$34 = theme.backgroundElement;
|
|
17819
|
-
_v$30 !== _p$.e && (_p$.e = setProp(_el$
|
|
17820
|
-
_v$31 !== _p$.t && (_p$.t = setProp(_el$
|
|
17821
|
-
_v$32 !== _p$.a && (_p$.a = setProp(_el$
|
|
17822
|
-
_v$33 !== _p$.o && (_p$.o = setProp(_el$
|
|
17823
|
-
_v$34 !== _p$.i && (_p$.i = setProp(_el$
|
|
18002
|
+
_v$30 !== _p$.e && (_p$.e = setProp(_el$53, "left", _v$30, _p$.e));
|
|
18003
|
+
_v$31 !== _p$.t && (_p$.t = setProp(_el$53, "top", _v$31, _p$.t));
|
|
18004
|
+
_v$32 !== _p$.a && (_p$.a = setProp(_el$53, "width", _v$32, _p$.a));
|
|
18005
|
+
_v$33 !== _p$.o && (_p$.o = setProp(_el$53, "borderColor", _v$33, _p$.o));
|
|
18006
|
+
_v$34 !== _p$.i && (_p$.i = setProp(_el$53, "backgroundColor", _v$34, _p$.i));
|
|
17824
18007
|
return _p$;
|
|
17825
18008
|
}, {
|
|
17826
18009
|
e: undefined,
|
|
@@ -17829,7 +18012,7 @@ function Sidebar(props) {
|
|
|
17829
18012
|
o: undefined,
|
|
17830
18013
|
i: undefined
|
|
17831
18014
|
});
|
|
17832
|
-
return _el$
|
|
18015
|
+
return _el$53;
|
|
17833
18016
|
})();
|
|
17834
18017
|
}
|
|
17835
18018
|
}), null);
|
|
@@ -17925,6 +18108,7 @@ function TasksShell(props) {
|
|
|
17925
18108
|
const dialog = useDialog();
|
|
17926
18109
|
const kv = useKV();
|
|
17927
18110
|
const [selectedId, setSelectedId] = createSignal(props.tasks().some((t) => t.id === props.initialTaskId) ? props.initialTaskId : props.tasks()[0]?.id ?? null);
|
|
18111
|
+
const [moveMode, setMoveMode] = createSignal(false);
|
|
17928
18112
|
const [updateInfo, setUpdateInfo] = createSignal(null);
|
|
17929
18113
|
const dimensions = useTerminalDimensions();
|
|
17930
18114
|
let activeConfirmed = !props.initialTaskId;
|
|
@@ -18174,6 +18358,19 @@ function TasksShell(props) {
|
|
|
18174
18358
|
console.error(`[kobe tasks] failed to open worktree with ${opener.label}`);
|
|
18175
18359
|
}
|
|
18176
18360
|
}
|
|
18361
|
+
async function moveTask(id, delta) {
|
|
18362
|
+
const task = props.tasks().find((t) => t.id === id);
|
|
18363
|
+
if (!task || task.kind === "main" || !props.orch)
|
|
18364
|
+
return;
|
|
18365
|
+
try {
|
|
18366
|
+
await props.orch.moveTask(id, delta);
|
|
18367
|
+
} catch (err) {
|
|
18368
|
+
console.error("[kobe tasks] task.move failed:", err);
|
|
18369
|
+
return;
|
|
18370
|
+
}
|
|
18371
|
+
setSelectedId(id);
|
|
18372
|
+
await props.reload();
|
|
18373
|
+
}
|
|
18177
18374
|
useBindings(() => ({
|
|
18178
18375
|
enabled: dialog.stack.length === 0,
|
|
18179
18376
|
bindings: [{
|
|
@@ -18305,18 +18502,30 @@ function TasksShell(props) {
|
|
|
18305
18502
|
onRenameRequest: (id) => void renameTask(id),
|
|
18306
18503
|
onDeleteRequest: (id) => void deleteTask(id),
|
|
18307
18504
|
onArchiveRequest: (id) => void archiveTask(id),
|
|
18505
|
+
onLocalMergeRequest: (id) => {
|
|
18506
|
+
const task = props.tasks().find((t) => t.id === id);
|
|
18507
|
+
if (!task || task.kind === "main")
|
|
18508
|
+
return;
|
|
18509
|
+
setSelectedId(id);
|
|
18510
|
+
setMoveMode((cur) => !cur);
|
|
18511
|
+
},
|
|
18512
|
+
moveMode,
|
|
18513
|
+
onMoveRequest: (id, delta) => void moveTask(id, delta),
|
|
18514
|
+
onMoveModeExit: () => setMoveMode(false),
|
|
18308
18515
|
focused: () => dialog.stack.length === 0
|
|
18309
18516
|
}));
|
|
18310
|
-
insert(_el$, createComponent2(ShortcutHints, {
|
|
18517
|
+
insert(_el$, createComponent2(ShortcutHints, {
|
|
18518
|
+
moveMode
|
|
18519
|
+
}), null);
|
|
18311
18520
|
effect((_$p) => setProp(_el$, "backgroundColor", theme.background, _$p));
|
|
18312
18521
|
return _el$;
|
|
18313
18522
|
})();
|
|
18314
18523
|
}
|
|
18315
|
-
function ShortcutHints() {
|
|
18524
|
+
function ShortcutHints(props) {
|
|
18316
18525
|
const {
|
|
18317
18526
|
theme
|
|
18318
18527
|
} = useTheme();
|
|
18319
|
-
const
|
|
18528
|
+
const DEFAULT_HINTS = [{
|
|
18320
18529
|
k: "\u23CE",
|
|
18321
18530
|
label: "open"
|
|
18322
18531
|
}, {
|
|
@@ -18331,6 +18540,9 @@ function ShortcutHints() {
|
|
|
18331
18540
|
}, {
|
|
18332
18541
|
k: "[/]",
|
|
18333
18542
|
label: "views"
|
|
18543
|
+
}, {
|
|
18544
|
+
k: "M",
|
|
18545
|
+
label: "move task"
|
|
18334
18546
|
}, {
|
|
18335
18547
|
k: "A/D",
|
|
18336
18548
|
label: "archive/delete"
|
|
@@ -18365,9 +18577,17 @@ function ShortcutHints() {
|
|
|
18365
18577
|
k: "\u2303Q",
|
|
18366
18578
|
label: "detach"
|
|
18367
18579
|
}];
|
|
18580
|
+
const MOVE_HINTS = [{
|
|
18581
|
+
k: "J/K",
|
|
18582
|
+
label: "reorder"
|
|
18583
|
+
}, {
|
|
18584
|
+
k: "\u23CE/Esc",
|
|
18585
|
+
label: "done"
|
|
18586
|
+
}];
|
|
18587
|
+
const hints = () => props.moveMode?.() ? MOVE_HINTS : DEFAULT_HINTS;
|
|
18368
18588
|
const LABEL_COL_MAX = 18;
|
|
18369
|
-
const labelColWidth = Math.min(LABEL_COL_MAX, Math.max(...
|
|
18370
|
-
const clipLabel = (s) => s.length <= labelColWidth ? s : `${s.slice(0, Math.max(0, labelColWidth - 1))}\u2026`;
|
|
18589
|
+
const labelColWidth = () => Math.min(LABEL_COL_MAX, Math.max(...hints().map((h) => h.label.length)));
|
|
18590
|
+
const clipLabel = (s) => s.length <= labelColWidth() ? s : `${s.slice(0, Math.max(0, labelColWidth() - 1))}\u2026`;
|
|
18371
18591
|
return (() => {
|
|
18372
18592
|
var _el$3 = createElement("box"), _el$4 = createElement("text");
|
|
18373
18593
|
insertNode(_el$3, _el$4);
|
|
@@ -18380,7 +18600,9 @@ function ShortcutHints() {
|
|
|
18380
18600
|
insertNode(_el$4, createTextNode(`\u2500\u2500 keys \u2500\u2500`));
|
|
18381
18601
|
setProp(_el$4, "wrapMode", "none");
|
|
18382
18602
|
insert(_el$3, createComponent2(For, {
|
|
18383
|
-
each
|
|
18603
|
+
get each() {
|
|
18604
|
+
return hints();
|
|
18605
|
+
},
|
|
18384
18606
|
children: (h) => (() => {
|
|
18385
18607
|
var _el$6 = createElement("box"), _el$7 = createElement("box"), _el$8 = createElement("text"), _el$9 = createTextNode(`[`), _el$0 = createTextNode(`]`), _el$1 = createElement("box"), _el$10 = createElement("text");
|
|
18386
18608
|
insertNode(_el$6, _el$7);
|
|
@@ -18396,20 +18618,21 @@ function ShortcutHints() {
|
|
|
18396
18618
|
setProp(_el$8, "wrapMode", "none");
|
|
18397
18619
|
insert(_el$8, () => h.k, _el$0);
|
|
18398
18620
|
insertNode(_el$1, _el$10);
|
|
18399
|
-
setProp(_el$1, "width", labelColWidth);
|
|
18400
18621
|
setProp(_el$1, "flexShrink", 0);
|
|
18401
18622
|
setProp(_el$10, "wrapMode", "none");
|
|
18402
18623
|
insert(_el$10, () => clipLabel(h.label));
|
|
18403
18624
|
effect((_p$) => {
|
|
18404
|
-
var _v$3 = theme.accent, _v$4 = TextAttributes10.BOLD, _v$5 = theme.textMuted;
|
|
18625
|
+
var _v$3 = theme.accent, _v$4 = TextAttributes10.BOLD, _v$5 = labelColWidth(), _v$6 = theme.textMuted;
|
|
18405
18626
|
_v$3 !== _p$.e && (_p$.e = setProp(_el$8, "fg", _v$3, _p$.e));
|
|
18406
18627
|
_v$4 !== _p$.t && (_p$.t = setProp(_el$8, "attributes", _v$4, _p$.t));
|
|
18407
|
-
_v$5 !== _p$.a && (_p$.a = setProp(_el$
|
|
18628
|
+
_v$5 !== _p$.a && (_p$.a = setProp(_el$1, "width", _v$5, _p$.a));
|
|
18629
|
+
_v$6 !== _p$.o && (_p$.o = setProp(_el$10, "fg", _v$6, _p$.o));
|
|
18408
18630
|
return _p$;
|
|
18409
18631
|
}, {
|
|
18410
18632
|
e: undefined,
|
|
18411
18633
|
t: undefined,
|
|
18412
|
-
a: undefined
|
|
18634
|
+
a: undefined,
|
|
18635
|
+
o: undefined
|
|
18413
18636
|
});
|
|
18414
18637
|
return _el$6;
|
|
18415
18638
|
})()
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@sma1lboy/kobe",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.12",
|
|
5
5
|
"description": "TUI orchestrator for Claude Code (codename)",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"packageManager": "bun@1.3.13",
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
"@biomejs/biome": "1.9.4",
|
|
50
50
|
"@tsconfig/bun": "1.0.9",
|
|
51
51
|
"@types/bun": "1.3.12",
|
|
52
|
+
"@types/node": "25.6.2",
|
|
52
53
|
"knip": "^6.14.2",
|
|
53
54
|
"node-pty": "^1.1.0",
|
|
54
55
|
"typescript": "5.8.2",
|