@staff0rd/assist 0.935.0 → 0.935.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
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.935.
|
|
9
|
+
version: "0.935.1",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -454,7 +454,7 @@ import chalk3 from "chalk";
|
|
|
454
454
|
import { stringify as stringifyYaml } from "yaml";
|
|
455
455
|
|
|
456
456
|
// src/shared/loadConfigFrom.ts
|
|
457
|
-
import { existsSync as
|
|
457
|
+
import { existsSync as existsSync6 } from "fs";
|
|
458
458
|
import { homedir as homedir4 } from "os";
|
|
459
459
|
import { dirname as dirname3, join as join7 } from "path";
|
|
460
460
|
|
|
@@ -586,6 +586,20 @@ function mergeRawConfigs(globalRaw, projectRaw) {
|
|
|
586
586
|
// src/shared/resolveRepoLayer.ts
|
|
587
587
|
import chalk2 from "chalk";
|
|
588
588
|
|
|
589
|
+
// src/shared/findRepoRoot.ts
|
|
590
|
+
import { existsSync as existsSync3 } from "fs";
|
|
591
|
+
import path from "path";
|
|
592
|
+
function findRepoRoot(dir) {
|
|
593
|
+
let current = dir;
|
|
594
|
+
while (current !== path.dirname(current)) {
|
|
595
|
+
if (existsSync3(path.join(current, ".git"))) {
|
|
596
|
+
return current;
|
|
597
|
+
}
|
|
598
|
+
current = path.dirname(current);
|
|
599
|
+
}
|
|
600
|
+
return null;
|
|
601
|
+
}
|
|
602
|
+
|
|
589
603
|
// src/commands/backlog/remoteUrl.ts
|
|
590
604
|
import { execFileSync } from "child_process";
|
|
591
605
|
function runGit(cwd, args) {
|
|
@@ -625,6 +639,7 @@ function getRemoteOriginUrl(cwd) {
|
|
|
625
639
|
}
|
|
626
640
|
|
|
627
641
|
// src/commands/backlog/getCurrentOrigin.ts
|
|
642
|
+
var WINDOWS_PATH = /^[A-Za-z]:[\\/]/;
|
|
628
643
|
function stripLeadingSlashes(path108) {
|
|
629
644
|
return path108.replace(/^\/+/, "");
|
|
630
645
|
}
|
|
@@ -645,6 +660,8 @@ function normalizeOrigin(raw) {
|
|
|
645
660
|
return trimmed.toLowerCase();
|
|
646
661
|
}
|
|
647
662
|
function resolveCurrentOrigin(cwd) {
|
|
663
|
+
if (!WINDOWS_PATH.test(cwd) && findRepoRoot(cwd) === null)
|
|
664
|
+
return { origin: `local:${cwd}`, stable: false };
|
|
648
665
|
const remote = remoteUrl(cwd);
|
|
649
666
|
if (remote.url) return { origin: normalizeOrigin(remote.url), stable: true };
|
|
650
667
|
const root2 = tryGit(cwd, ["rev-parse", "--show-toplevel"]);
|
|
@@ -665,12 +682,12 @@ function getCachedOrigin(cwd) {
|
|
|
665
682
|
}
|
|
666
683
|
|
|
667
684
|
// src/shared/readRepoConfigCache.ts
|
|
668
|
-
import { existsSync as
|
|
685
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4 } from "fs";
|
|
669
686
|
import { join as join6 } from "path";
|
|
670
687
|
|
|
671
688
|
// src/shared/loadJson.ts
|
|
672
689
|
import {
|
|
673
|
-
existsSync as
|
|
690
|
+
existsSync as existsSync4,
|
|
674
691
|
mkdirSync as mkdirSync2,
|
|
675
692
|
readFileSync as readFileSync3,
|
|
676
693
|
renameSync,
|
|
@@ -687,7 +704,7 @@ function getStorePath(filename) {
|
|
|
687
704
|
}
|
|
688
705
|
function loadJson(filename) {
|
|
689
706
|
const path108 = getStorePath(filename);
|
|
690
|
-
if (
|
|
707
|
+
if (existsSync4(path108)) {
|
|
691
708
|
try {
|
|
692
709
|
return JSON.parse(readFileSync3(path108, "utf8"));
|
|
693
710
|
} catch {
|
|
@@ -698,7 +715,7 @@ function loadJson(filename) {
|
|
|
698
715
|
}
|
|
699
716
|
function saveJson(filename, data) {
|
|
700
717
|
const dir = getStoreDir();
|
|
701
|
-
if (!
|
|
718
|
+
if (!existsSync4(dir)) {
|
|
702
719
|
mkdirSync2(dir, { recursive: true });
|
|
703
720
|
}
|
|
704
721
|
const path108 = getStorePath(filename);
|
|
@@ -718,7 +735,7 @@ function repoConfigCachePath() {
|
|
|
718
735
|
}
|
|
719
736
|
function readRepoConfigCache() {
|
|
720
737
|
const path108 = repoConfigCachePath();
|
|
721
|
-
if (!
|
|
738
|
+
if (!existsSync5(path108)) return {};
|
|
722
739
|
try {
|
|
723
740
|
const parsed = JSON.parse(readFileSync4(path108, "utf8"));
|
|
724
741
|
return parsed?.repos ?? {};
|
|
@@ -1377,10 +1394,10 @@ function findConfigUp(startDir) {
|
|
|
1377
1394
|
let current = startDir;
|
|
1378
1395
|
while (current !== dirname3(current)) {
|
|
1379
1396
|
const claudePath = join7(current, ".claude", "assist.yml");
|
|
1380
|
-
if (
|
|
1397
|
+
if (existsSync6(claudePath))
|
|
1381
1398
|
return { configPath: claudePath, rootDir: current };
|
|
1382
1399
|
const rootPath = join7(current, "assist.yml");
|
|
1383
|
-
if (
|
|
1400
|
+
if (existsSync6(rootPath)) return { configPath: rootPath, rootDir: current };
|
|
1384
1401
|
current = dirname3(current);
|
|
1385
1402
|
}
|
|
1386
1403
|
return null;
|
|
@@ -1448,7 +1465,7 @@ function getTranscriptConfig() {
|
|
|
1448
1465
|
|
|
1449
1466
|
// src/commands/sessions/nodes/tailscaleStatus.ts
|
|
1450
1467
|
import { execFile } from "child_process";
|
|
1451
|
-
import { existsSync as
|
|
1468
|
+
import { existsSync as existsSync7 } from "fs";
|
|
1452
1469
|
import { promisify } from "util";
|
|
1453
1470
|
var execFileAsync = promisify(execFile);
|
|
1454
1471
|
var STATUS_TIMEOUT_MS = 1e4;
|
|
@@ -1460,7 +1477,7 @@ var INSTALLED_CLI = {
|
|
|
1460
1477
|
function tailscaleCli() {
|
|
1461
1478
|
const platform = detectPlatform();
|
|
1462
1479
|
const installed = INSTALLED_CLI[platform];
|
|
1463
|
-
if (installed &&
|
|
1480
|
+
if (installed && existsSync7(installed)) return installed;
|
|
1464
1481
|
return platform === "wsl" ? "tailscale.exe" : "tailscale";
|
|
1465
1482
|
}
|
|
1466
1483
|
async function tailscaleStatus() {
|
|
@@ -2286,7 +2303,7 @@ function originDisplayLabels(origins) {
|
|
|
2286
2303
|
}
|
|
2287
2304
|
|
|
2288
2305
|
// src/commands/backlog/resolveRepoLocation.ts
|
|
2289
|
-
import { existsSync as
|
|
2306
|
+
import { existsSync as existsSync8 } from "fs";
|
|
2290
2307
|
|
|
2291
2308
|
// src/commands/backlog/cloneTargetDir.ts
|
|
2292
2309
|
import { join as join8, resolve as resolve3 } from "path";
|
|
@@ -2302,7 +2319,7 @@ function resolveRepoLocation(origin, knownCwd, baseDir) {
|
|
|
2302
2319
|
if (knownCwd) return { cwd: knownCwd };
|
|
2303
2320
|
const target = cloneTargetDir(origin, baseDir);
|
|
2304
2321
|
if (!target) return {};
|
|
2305
|
-
if (
|
|
2322
|
+
if (existsSync8(target) && getCurrentOrigin(target) === origin)
|
|
2306
2323
|
return { cwd: target };
|
|
2307
2324
|
return { cloneTarget: target };
|
|
2308
2325
|
}
|
|
@@ -2311,19 +2328,19 @@ function resolveRepoLocation(origin, knownCwd, baseDir) {
|
|
|
2311
2328
|
import chalk7 from "chalk";
|
|
2312
2329
|
|
|
2313
2330
|
// src/commands/backlog/migrateLocalBacklog.ts
|
|
2314
|
-
import { existsSync as
|
|
2331
|
+
import { existsSync as existsSync10 } from "fs";
|
|
2315
2332
|
import { join as join10 } from "path";
|
|
2316
2333
|
import chalk5 from "chalk";
|
|
2317
2334
|
|
|
2318
2335
|
// src/commands/backlog/backupLocalBacklogFiles.ts
|
|
2319
|
-
import { existsSync as
|
|
2336
|
+
import { existsSync as existsSync9, renameSync as renameSync2 } from "fs";
|
|
2320
2337
|
import { join as join9 } from "path";
|
|
2321
2338
|
var LOCAL_FILES = ["backlog.jsonl", "backlog.db"];
|
|
2322
2339
|
function backupLocalBacklogFiles(dir) {
|
|
2323
2340
|
const moved = [];
|
|
2324
2341
|
for (const name of LOCAL_FILES) {
|
|
2325
2342
|
const path108 = join9(dir, ".assist", name);
|
|
2326
|
-
if (
|
|
2343
|
+
if (existsSync9(path108)) {
|
|
2327
2344
|
renameSync2(path108, `${path108}.bak`);
|
|
2328
2345
|
moved.push(`${name} \u2192 ${name}.bak`);
|
|
2329
2346
|
}
|
|
@@ -2792,7 +2809,7 @@ async function verifyImport(orm, origin, items2, imported) {
|
|
|
2792
2809
|
}
|
|
2793
2810
|
}
|
|
2794
2811
|
async function migrateLocalBacklog(orm, dir, origin) {
|
|
2795
|
-
if (!
|
|
2812
|
+
if (!existsSync10(jsonlPath(dir))) return;
|
|
2796
2813
|
const existing = (await loadAllItems(orm, origin)).length;
|
|
2797
2814
|
if (existing > 0) {
|
|
2798
2815
|
const moved2 = backupLocalBacklogFiles(dir);
|
|
@@ -3448,7 +3465,7 @@ async function deleteItem(orm, id) {
|
|
|
3448
3465
|
}
|
|
3449
3466
|
|
|
3450
3467
|
// src/commands/backlog/findBacklogUp.ts
|
|
3451
|
-
import { existsSync as
|
|
3468
|
+
import { existsSync as existsSync11 } from "fs";
|
|
3452
3469
|
import { dirname as dirname4, join as join11 } from "path";
|
|
3453
3470
|
var BACKLOG_MARKERS = [
|
|
3454
3471
|
join11(".assist", "backlog.db"),
|
|
@@ -3458,7 +3475,7 @@ var BACKLOG_MARKERS = [
|
|
|
3458
3475
|
function findBacklogUp(startDir) {
|
|
3459
3476
|
let current = startDir;
|
|
3460
3477
|
while (current !== dirname4(current)) {
|
|
3461
|
-
if (BACKLOG_MARKERS.some((marker2) =>
|
|
3478
|
+
if (BACKLOG_MARKERS.some((marker2) => existsSync11(join11(current, marker2)))) {
|
|
3462
3479
|
return current;
|
|
3463
3480
|
}
|
|
3464
3481
|
current = dirname4(current);
|
|
@@ -3697,19 +3714,19 @@ async function updateStarred(orm, id, starred) {
|
|
|
3697
3714
|
}
|
|
3698
3715
|
|
|
3699
3716
|
// src/commands/sessions/shared/lookupSessionsById.ts
|
|
3700
|
-
import * as
|
|
3717
|
+
import * as path8 from "path";
|
|
3701
3718
|
|
|
3702
3719
|
// src/commands/sessions/shared/codex/discoverCodexRolloutPaths.ts
|
|
3703
3720
|
import * as fs from "fs";
|
|
3704
|
-
import * as
|
|
3721
|
+
import * as path4 from "path";
|
|
3705
3722
|
|
|
3706
3723
|
// src/commands/sessions/shared/codex/codexSessionsDir.ts
|
|
3707
|
-
import { existsSync as
|
|
3708
|
-
import * as
|
|
3724
|
+
import { existsSync as existsSync12 } from "fs";
|
|
3725
|
+
import * as path3 from "path";
|
|
3709
3726
|
|
|
3710
3727
|
// src/shared/harnesses.ts
|
|
3711
3728
|
import * as os from "os";
|
|
3712
|
-
import * as
|
|
3729
|
+
import * as path2 from "path";
|
|
3713
3730
|
|
|
3714
3731
|
// src/shared/checkCliAvailable.ts
|
|
3715
3732
|
import { execSync as execSync4 } from "child_process";
|
|
@@ -3738,25 +3755,25 @@ var harnesses = {
|
|
|
3738
3755
|
claude: {
|
|
3739
3756
|
kind: "claude",
|
|
3740
3757
|
command: "claude",
|
|
3741
|
-
homeDir:
|
|
3758
|
+
homeDir: path2.join(os.homedir(), ".claude"),
|
|
3742
3759
|
sync: {
|
|
3743
|
-
commandDest: (name) =>
|
|
3760
|
+
commandDest: (name) => path2.join("skills", name, "SKILL.md")
|
|
3744
3761
|
}
|
|
3745
3762
|
},
|
|
3746
3763
|
codex: {
|
|
3747
3764
|
kind: "codex",
|
|
3748
3765
|
command: "codex",
|
|
3749
|
-
homeDir:
|
|
3766
|
+
homeDir: path2.join(os.homedir(), ".codex"),
|
|
3750
3767
|
sync: {
|
|
3751
|
-
commandDest: (name) =>
|
|
3768
|
+
commandDest: (name) => path2.join("skills", name, "SKILL.md")
|
|
3752
3769
|
}
|
|
3753
3770
|
},
|
|
3754
3771
|
pi: {
|
|
3755
3772
|
kind: "pi",
|
|
3756
3773
|
command: "pi",
|
|
3757
|
-
homeDir:
|
|
3774
|
+
homeDir: path2.join(os.homedir(), ".pi", "agent"),
|
|
3758
3775
|
sync: {
|
|
3759
|
-
commandDest: (name) =>
|
|
3776
|
+
commandDest: (name) => path2.join("prompts", `${name}.md`)
|
|
3760
3777
|
}
|
|
3761
3778
|
}
|
|
3762
3779
|
};
|
|
@@ -3766,10 +3783,10 @@ function isHarnessAvailable(kind) {
|
|
|
3766
3783
|
|
|
3767
3784
|
// src/commands/sessions/shared/codex/codexSessionsDir.ts
|
|
3768
3785
|
function codexSessionsDir() {
|
|
3769
|
-
return
|
|
3786
|
+
return path3.join(harnesses.codex.homeDir, "sessions");
|
|
3770
3787
|
}
|
|
3771
3788
|
function hasCodexSessions() {
|
|
3772
|
-
return
|
|
3789
|
+
return existsSync12(codexSessionsDir());
|
|
3773
3790
|
}
|
|
3774
3791
|
|
|
3775
3792
|
// src/commands/sessions/shared/codex/discoverCodexRolloutPaths.ts
|
|
@@ -3794,14 +3811,14 @@ async function collect(dir, depth) {
|
|
|
3794
3811
|
return nested.flat();
|
|
3795
3812
|
}
|
|
3796
3813
|
async function collectEntry(dir, entry, depth) {
|
|
3797
|
-
const full =
|
|
3814
|
+
const full = path4.join(dir, entry.name);
|
|
3798
3815
|
if (entry.isDirectory()) return depth > 0 ? collect(full, depth - 1) : [];
|
|
3799
3816
|
return isCodexRolloutFile(entry.name) ? [full] : [];
|
|
3800
3817
|
}
|
|
3801
3818
|
|
|
3802
3819
|
// src/commands/sessions/shared/codex/parseCodexSessionFile.ts
|
|
3803
3820
|
import * as fs3 from "fs";
|
|
3804
|
-
import * as
|
|
3821
|
+
import * as path5 from "path";
|
|
3805
3822
|
|
|
3806
3823
|
// src/commands/sessions/shared/backlogRunMarkers.ts
|
|
3807
3824
|
function backlogRunMarkers(text17) {
|
|
@@ -3923,7 +3940,7 @@ async function parseCodexSessionFile(filePath) {
|
|
|
3923
3940
|
return {
|
|
3924
3941
|
sessionId: meta.sessionId,
|
|
3925
3942
|
name: name || `Session ${meta.sessionId.slice(0, 8)}`,
|
|
3926
|
-
project: meta.cwd ?
|
|
3943
|
+
project: meta.cwd ? path5.basename(meta.cwd) : "",
|
|
3927
3944
|
cwd: meta.cwd,
|
|
3928
3945
|
timestamp: meta.timestamp || await mtime(filePath),
|
|
3929
3946
|
origin: "wsl",
|
|
@@ -3995,13 +4012,13 @@ function matchMarker(text17, tag) {
|
|
|
3995
4012
|
}
|
|
3996
4013
|
|
|
3997
4014
|
// src/commands/sessions/shared/deriveProject.ts
|
|
3998
|
-
import * as
|
|
4015
|
+
import * as path6 from "path";
|
|
3999
4016
|
function deriveProject(cwd, filePath, origin) {
|
|
4000
4017
|
if (!cwd) return dirNameToProject(filePath);
|
|
4001
|
-
return origin === "windows" ?
|
|
4018
|
+
return origin === "windows" ? path6.win32.basename(cwd) : path6.basename(cwd);
|
|
4002
4019
|
}
|
|
4003
4020
|
function dirNameToProject(filePath) {
|
|
4004
|
-
const dirName =
|
|
4021
|
+
const dirName = path6.basename(path6.dirname(filePath));
|
|
4005
4022
|
const parts = dirName.split("--");
|
|
4006
4023
|
return parts[parts.length - 1].replace(/-/g, "/");
|
|
4007
4024
|
}
|
|
@@ -4038,7 +4055,7 @@ async function readHeadLines(handle) {
|
|
|
4038
4055
|
// src/commands/sessions/shared/discoverSessionJsonlPaths.ts
|
|
4039
4056
|
import * as fs5 from "fs";
|
|
4040
4057
|
import * as os2 from "os";
|
|
4041
|
-
import * as
|
|
4058
|
+
import * as path7 from "path";
|
|
4042
4059
|
async function discoverSessionJsonlPaths() {
|
|
4043
4060
|
const results = [];
|
|
4044
4061
|
await Promise.all(
|
|
@@ -4051,7 +4068,7 @@ async function discoverSessionJsonlPaths() {
|
|
|
4051
4068
|
}
|
|
4052
4069
|
await Promise.all(
|
|
4053
4070
|
projectDirs.map(async (dirName) => {
|
|
4054
|
-
const dirPath =
|
|
4071
|
+
const dirPath = path7.join(dir, dirName);
|
|
4055
4072
|
let entries;
|
|
4056
4073
|
try {
|
|
4057
4074
|
entries = await fs5.promises.readdir(dirPath);
|
|
@@ -4060,7 +4077,7 @@ async function discoverSessionJsonlPaths() {
|
|
|
4060
4077
|
}
|
|
4061
4078
|
for (const file of entries) {
|
|
4062
4079
|
if (file.endsWith(".jsonl"))
|
|
4063
|
-
results.push({ path:
|
|
4080
|
+
results.push({ path: path7.join(dirPath, file), origin });
|
|
4064
4081
|
}
|
|
4065
4082
|
})
|
|
4066
4083
|
);
|
|
@@ -4070,7 +4087,7 @@ async function discoverSessionJsonlPaths() {
|
|
|
4070
4087
|
}
|
|
4071
4088
|
function sessionRoots() {
|
|
4072
4089
|
return [
|
|
4073
|
-
{ dir:
|
|
4090
|
+
{ dir: path7.join(os2.homedir(), ".claude", "projects"), origin: "wsl" }
|
|
4074
4091
|
];
|
|
4075
4092
|
}
|
|
4076
4093
|
|
|
@@ -4086,7 +4103,7 @@ async function lookupSessionsById(ids) {
|
|
|
4086
4103
|
]);
|
|
4087
4104
|
await Promise.all([
|
|
4088
4105
|
...claudePaths.map(async ({ path: filePath, origin }) => {
|
|
4089
|
-
const id =
|
|
4106
|
+
const id = path8.basename(filePath, ".jsonl");
|
|
4090
4107
|
if (!wanted.has(id)) return;
|
|
4091
4108
|
const session = await parseSessionFile(filePath, origin);
|
|
4092
4109
|
if (session) found.set(id, session);
|
|
@@ -4101,7 +4118,7 @@ async function lookupSessionsById(ids) {
|
|
|
4101
4118
|
return found;
|
|
4102
4119
|
}
|
|
4103
4120
|
function codexRolloutIdFromFilename(filePath) {
|
|
4104
|
-
const name =
|
|
4121
|
+
const name = path8.basename(filePath, ".jsonl");
|
|
4105
4122
|
return name.length > CODEX_ROLLOUT_ID_LENGTH ? name.slice(-CODEX_ROLLOUT_ID_LENGTH) : void 0;
|
|
4106
4123
|
}
|
|
4107
4124
|
|
|
@@ -4477,7 +4494,7 @@ import chalk8 from "chalk";
|
|
|
4477
4494
|
|
|
4478
4495
|
// src/commands/backlog/recordSignalOwner.ts
|
|
4479
4496
|
import {
|
|
4480
|
-
existsSync as
|
|
4497
|
+
existsSync as existsSync13,
|
|
4481
4498
|
mkdirSync as mkdirSync3,
|
|
4482
4499
|
readFileSync as readFileSync6,
|
|
4483
4500
|
rmSync as rmSync3,
|
|
@@ -4497,7 +4514,7 @@ function recordSignalOwner(itemId2) {
|
|
|
4497
4514
|
}
|
|
4498
4515
|
function readSignalOwner(itemId2) {
|
|
4499
4516
|
const path108 = getOwnerPath(itemId2);
|
|
4500
|
-
if (!
|
|
4517
|
+
if (!existsSync13(path108)) return void 0;
|
|
4501
4518
|
try {
|
|
4502
4519
|
const parsed = JSON.parse(readFileSync6(path108, "utf8"));
|
|
4503
4520
|
return parsed.sessionId;
|
|
@@ -5449,7 +5466,7 @@ function azureDevopsRepoUrl({ org, project, repo }) {
|
|
|
5449
5466
|
}
|
|
5450
5467
|
|
|
5451
5468
|
// src/commands/sessions/web/fromGithub/findAzureDevopsClone.ts
|
|
5452
|
-
import { existsSync as
|
|
5469
|
+
import { existsSync as existsSync14, readdirSync as readdirSync2 } from "fs";
|
|
5453
5470
|
import { join as join18 } from "path";
|
|
5454
5471
|
|
|
5455
5472
|
// src/shared/azureDevops/parseAzureDevopsRemote.ts
|
|
@@ -5471,13 +5488,13 @@ function sameAzureDevopsRepo(a, b) {
|
|
|
5471
5488
|
|
|
5472
5489
|
// src/commands/sessions/web/fromGithub/findAzureDevopsClone.ts
|
|
5473
5490
|
function clonesRepo(dir, repo) {
|
|
5474
|
-
if (!
|
|
5491
|
+
if (!existsSync14(join18(dir, ".git"))) return false;
|
|
5475
5492
|
const url = remoteUrl(dir).url;
|
|
5476
5493
|
const remote = url ? parseAzureDevopsRemote(url) : null;
|
|
5477
5494
|
return remote !== null && sameAzureDevopsRepo(remote, repo);
|
|
5478
5495
|
}
|
|
5479
5496
|
function findAzureDevopsClone(repo, baseDir) {
|
|
5480
|
-
if (!
|
|
5497
|
+
if (!existsSync14(baseDir)) return void 0;
|
|
5481
5498
|
const named = join18(baseDir, repo.repo);
|
|
5482
5499
|
const others = readdirSync2(baseDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join18(baseDir, entry.name)).filter((dir) => dir !== named).sort();
|
|
5483
5500
|
return [named, ...others].find((dir) => clonesRepo(dir, repo));
|
|
@@ -5555,11 +5572,11 @@ function isAllowedPrArgs(args) {
|
|
|
5555
5572
|
}
|
|
5556
5573
|
|
|
5557
5574
|
// src/commands/sessions/web/fromGithub/findCloneByOrigin.ts
|
|
5558
|
-
import { existsSync as
|
|
5575
|
+
import { existsSync as existsSync15, readdirSync as readdirSync3 } from "fs";
|
|
5559
5576
|
import { join as join19 } from "path";
|
|
5560
5577
|
function findCloneByOrigin(origin, baseDir) {
|
|
5561
|
-
if (!
|
|
5562
|
-
return readdirSync3(baseDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join19(baseDir, entry.name)).filter((dir) =>
|
|
5578
|
+
if (!existsSync15(baseDir)) return void 0;
|
|
5579
|
+
return readdirSync3(baseDir, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => join19(baseDir, entry.name)).filter((dir) => existsSync15(join19(dir, ".git"))).sort().find((dir) => getCurrentOrigin(dir) === origin);
|
|
5563
5580
|
}
|
|
5564
5581
|
|
|
5565
5582
|
// src/commands/sessions/web/fromGithub/parseGithubOrigin.ts
|
|
@@ -7100,14 +7117,14 @@ function assertNoDuplicateRunNames(configs) {
|
|
|
7100
7117
|
}
|
|
7101
7118
|
|
|
7102
7119
|
// src/shared/findLinkedConfigPath.ts
|
|
7103
|
-
import { existsSync as
|
|
7120
|
+
import { existsSync as existsSync16 } from "fs";
|
|
7104
7121
|
import { join as join20, resolve as resolve5 } from "path";
|
|
7105
7122
|
function findLinkedConfigPath(linkPath, fromDir) {
|
|
7106
7123
|
const resolved = resolve5(fromDir, linkPath);
|
|
7107
7124
|
const claudePath = join20(resolved, ".claude", "assist.yml");
|
|
7108
|
-
if (
|
|
7125
|
+
if (existsSync16(claudePath)) return claudePath;
|
|
7109
7126
|
const rootPath = join20(resolved, "assist.yml");
|
|
7110
|
-
if (
|
|
7127
|
+
if (existsSync16(rootPath)) return rootPath;
|
|
7111
7128
|
throw new Error(`No assist.yml found in linked project: ${resolved}`);
|
|
7112
7129
|
}
|
|
7113
7130
|
|
|
@@ -7175,20 +7192,6 @@ function resolveLocalCwd(config, configDir, ctx) {
|
|
|
7175
7192
|
};
|
|
7176
7193
|
}
|
|
7177
7194
|
|
|
7178
|
-
// src/shared/findRepoRoot.ts
|
|
7179
|
-
import { existsSync as existsSync16 } from "fs";
|
|
7180
|
-
import path8 from "path";
|
|
7181
|
-
function findRepoRoot(dir) {
|
|
7182
|
-
let current = dir;
|
|
7183
|
-
while (current !== path8.dirname(current)) {
|
|
7184
|
-
if (existsSync16(path8.join(current, ".git"))) {
|
|
7185
|
-
return current;
|
|
7186
|
-
}
|
|
7187
|
-
current = path8.dirname(current);
|
|
7188
|
-
}
|
|
7189
|
-
return null;
|
|
7190
|
-
}
|
|
7191
|
-
|
|
7192
7195
|
// src/shared/runConfigBaseDir.ts
|
|
7193
7196
|
function runConfigBaseDirFrom(cwd) {
|
|
7194
7197
|
return findConfigUp(cwd)?.rootDir ?? findRepoRoot(cwd) ?? cwd;
|