@staff0rd/assist 0.691.1 → 0.692.0
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/README.md +1 -1
- package/dist/commands/sessions/web/bundle.js +329 -329
- package/dist/index.js +36 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Command } from "commander";
|
|
|
6
6
|
// package.json
|
|
7
7
|
var package_default = {
|
|
8
8
|
name: "@staff0rd/assist",
|
|
9
|
-
version: "0.
|
|
9
|
+
version: "0.692.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -39523,6 +39523,33 @@ function killPtyTree(pty2) {
|
|
|
39523
39523
|
}
|
|
39524
39524
|
}
|
|
39525
39525
|
|
|
39526
|
+
// src/commands/sessions/daemon/worktree/liveWatcherFor.ts
|
|
39527
|
+
function liveWatcherFor(sessions, clone) {
|
|
39528
|
+
for (const session of sessions.values())
|
|
39529
|
+
if (session.watcher === true && session.cwd !== void 0 && (clone === void 0 || canonicalTreePath(session.cwd) === clone) && session.status !== "stopped" && session.status !== "error")
|
|
39530
|
+
return session;
|
|
39531
|
+
return void 0;
|
|
39532
|
+
}
|
|
39533
|
+
|
|
39534
|
+
// src/commands/sessions/daemon/worktree/resolveClone.ts
|
|
39535
|
+
function resolveClone(cwd) {
|
|
39536
|
+
const repoRoot2 = findRepoRoot(cwd) ?? cwd;
|
|
39537
|
+
return canonicalTreePath(mainWorktree(repoRoot2) ?? repoRoot2);
|
|
39538
|
+
}
|
|
39539
|
+
|
|
39540
|
+
// src/commands/sessions/daemon/worktree/orphanedWatcherFor.ts
|
|
39541
|
+
function orphanedWatcherFor(sessions, dismissed) {
|
|
39542
|
+
if (dismissed.watcher === true || !dismissed.cwd) return void 0;
|
|
39543
|
+
if (!liveWatcherFor(sessions)) return void 0;
|
|
39544
|
+
const clone = resolveClone(dismissed.cwd);
|
|
39545
|
+
const watcher = liveWatcherFor(sessions, clone);
|
|
39546
|
+
if (!watcher) return void 0;
|
|
39547
|
+
const kept = [...sessions.values()].some(
|
|
39548
|
+
(s) => s.watcher !== true && s.cwd !== void 0 && resolveClone(s.cwd) === clone
|
|
39549
|
+
);
|
|
39550
|
+
return kept ? void 0 : { watcher, clone };
|
|
39551
|
+
}
|
|
39552
|
+
|
|
39526
39553
|
// src/commands/sessions/daemon/worktree/treeUnderClose.ts
|
|
39527
39554
|
function treeUnderClose(session) {
|
|
39528
39555
|
if (session.worktree) return { path: session.worktree.path, removable: true };
|
|
@@ -39552,6 +39579,13 @@ function dismissSession(sessions, id) {
|
|
|
39552
39579
|
if (s.activity?.itemId != null) releaseLock(s.activity.itemId);
|
|
39553
39580
|
sessions.delete(id);
|
|
39554
39581
|
daemonLog(`session ${id} dismissed (${s.name})`);
|
|
39582
|
+
const orphan = orphanedWatcherFor(sessions, s);
|
|
39583
|
+
if (orphan) {
|
|
39584
|
+
daemonLog(
|
|
39585
|
+
`reaping watcher session ${orphan.watcher.id} for the clone ${orphan.clone}: its last session ${id} was dismissed`
|
|
39586
|
+
);
|
|
39587
|
+
dismissSession(sessions, orphan.watcher.id);
|
|
39588
|
+
}
|
|
39555
39589
|
if (!s.worktree) return true;
|
|
39556
39590
|
if (sharedWith.length > 0)
|
|
39557
39591
|
daemonLog(
|
|
@@ -42418,7 +42452,7 @@ function ensureWatcher(ctx, cwd) {
|
|
|
42418
42452
|
const repoRoot2 = findRepoRoot(cwd) ?? cwd;
|
|
42419
42453
|
const cfg = worktreeConfigFor(repoRoot2);
|
|
42420
42454
|
if (!cfg.enabled || cfg.watcher !== true) return void 0;
|
|
42421
|
-
const clone =
|
|
42455
|
+
const clone = resolveClone(repoRoot2);
|
|
42422
42456
|
const live = liveWatcherFor(ctx.sessions, clone);
|
|
42423
42457
|
if (live) {
|
|
42424
42458
|
daemonLog(
|
|
@@ -42437,12 +42471,6 @@ function ensureWatcher(ctx, cwd) {
|
|
|
42437
42471
|
);
|
|
42438
42472
|
return id;
|
|
42439
42473
|
}
|
|
42440
|
-
function liveWatcherFor(sessions, clone) {
|
|
42441
|
-
for (const session of sessions.values())
|
|
42442
|
-
if (session.watcher === true && session.cwd !== void 0 && canonicalTreePath(session.cwd) === clone && session.status !== "stopped" && session.status !== "error")
|
|
42443
|
-
return session;
|
|
42444
|
-
return void 0;
|
|
42445
|
-
}
|
|
42446
42474
|
|
|
42447
42475
|
// src/commands/sessions/daemon/worktree/isBacklogRunArgs.ts
|
|
42448
42476
|
var ITEM_ID = /^a?\d+$/;
|