@staff0rd/assist 0.487.0 → 0.487.2
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.487.
|
|
9
|
+
version: "0.487.2",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -19052,7 +19052,11 @@ function allocateTree(requestedCwd, boundTreeRoots2, options2 = {}) {
|
|
|
19052
19052
|
return { cwd: requestedCwd, kind: "primary", created: false };
|
|
19053
19053
|
const clone = mainWorktree(repoRoot) ?? repoRoot;
|
|
19054
19054
|
const reuse = { ...options2, includeDrafts: cfg.includeDrafts };
|
|
19055
|
-
if (
|
|
19055
|
+
if (mustLeaveTrunk(cfg.trunk, options2))
|
|
19056
|
+
daemonLog(
|
|
19057
|
+
`committing session spilled out of the clone ${clone}: worktree.trunk is on, so a commit here would land on the local mainline`
|
|
19058
|
+
);
|
|
19059
|
+
else if (reusesClone(clone, boundTreeRoots2, reuse))
|
|
19056
19060
|
return { cwd: clone, kind: "primary", created: false, clone };
|
|
19057
19061
|
const path71 = createWorktree(
|
|
19058
19062
|
clone,
|
|
@@ -19061,6 +19065,9 @@ function allocateTree(requestedCwd, boundTreeRoots2, options2 = {}) {
|
|
|
19061
19065
|
);
|
|
19062
19066
|
return { cwd: path71, kind: "worktree", created: true, clone };
|
|
19063
19067
|
}
|
|
19068
|
+
function mustLeaveTrunk(trunk, options2) {
|
|
19069
|
+
return trunk === true && options2.commits === true;
|
|
19070
|
+
}
|
|
19064
19071
|
function keptInPlace(cwd) {
|
|
19065
19072
|
daemonLog(
|
|
19066
19073
|
`session kept in ${cwd}: launched against work already checked out there`
|
|
@@ -20906,6 +20913,25 @@ function fetchLineComments(org, repo, prNumber, threadInfo) {
|
|
|
20906
20913
|
import { mkdirSync as mkdirSync18, writeFileSync as writeFileSync35 } from "fs";
|
|
20907
20914
|
import { dirname as dirname28 } from "path";
|
|
20908
20915
|
import { stringify } from "yaml";
|
|
20916
|
+
|
|
20917
|
+
// src/commands/prs/removeStaleCommentsCaches.ts
|
|
20918
|
+
import { readdirSync as readdirSync10, unlinkSync as unlinkSync16 } from "fs";
|
|
20919
|
+
import { join as join58 } from "path";
|
|
20920
|
+
var STALE_PATTERN = /^pr-\d+-comments\.yaml$/;
|
|
20921
|
+
function removeStaleCommentsCaches(cwd = process.cwd()) {
|
|
20922
|
+
const dir = join58(cwd, ".assist");
|
|
20923
|
+
let entries;
|
|
20924
|
+
try {
|
|
20925
|
+
entries = readdirSync10(dir);
|
|
20926
|
+
} catch {
|
|
20927
|
+
return;
|
|
20928
|
+
}
|
|
20929
|
+
for (const entry of entries.filter((e) => STALE_PATTERN.test(e))) {
|
|
20930
|
+
unlinkSync16(join58(dir, entry));
|
|
20931
|
+
}
|
|
20932
|
+
}
|
|
20933
|
+
|
|
20934
|
+
// src/commands/prs/listComments/updateCommentsCache.ts
|
|
20909
20935
|
function writeCommentsCache(org, repo, prNumber, comments3) {
|
|
20910
20936
|
const cachePath = commentsCachePath(org, repo, prNumber);
|
|
20911
20937
|
mkdirSync18(dirname28(cachePath), { recursive: true });
|
|
@@ -20917,6 +20943,7 @@ function writeCommentsCache(org, repo, prNumber, comments3) {
|
|
|
20917
20943
|
writeFileSync35(cachePath, stringify(cacheData));
|
|
20918
20944
|
}
|
|
20919
20945
|
function updateCommentsCache(org, repo, prNumber, comments3) {
|
|
20946
|
+
removeStaleCommentsCaches();
|
|
20920
20947
|
if (comments3.some((c) => c.type === "line")) {
|
|
20921
20948
|
writeCommentsCache(org, repo, prNumber, comments3);
|
|
20922
20949
|
} else {
|
|
@@ -23784,9 +23811,9 @@ ${annotateDiffWithLineNumbers(context.diff.trimEnd())}
|
|
|
23784
23811
|
|
|
23785
23812
|
// src/commands/review/buildReviewPaths.ts
|
|
23786
23813
|
import { homedir as homedir21 } from "os";
|
|
23787
|
-
import { basename as basename16, join as
|
|
23814
|
+
import { basename as basename16, join as join59 } from "path";
|
|
23788
23815
|
function buildReviewPaths(repoRoot, key) {
|
|
23789
|
-
const reviewDir =
|
|
23816
|
+
const reviewDir = join59(
|
|
23790
23817
|
homedir21(),
|
|
23791
23818
|
".assist",
|
|
23792
23819
|
"reviews",
|
|
@@ -23795,10 +23822,10 @@ function buildReviewPaths(repoRoot, key) {
|
|
|
23795
23822
|
);
|
|
23796
23823
|
return {
|
|
23797
23824
|
reviewDir,
|
|
23798
|
-
requestPath:
|
|
23799
|
-
claudePath:
|
|
23800
|
-
codexPath:
|
|
23801
|
-
synthesisPath:
|
|
23825
|
+
requestPath: join59(reviewDir, "request.md"),
|
|
23826
|
+
claudePath: join59(reviewDir, "claude.md"),
|
|
23827
|
+
codexPath: join59(reviewDir, "codex.md"),
|
|
23828
|
+
synthesisPath: join59(reviewDir, "synthesis.md")
|
|
23802
23829
|
};
|
|
23803
23830
|
}
|
|
23804
23831
|
|
|
@@ -24337,10 +24364,10 @@ async function handlePostSynthesis(synthesisPath, options2) {
|
|
|
24337
24364
|
}
|
|
24338
24365
|
|
|
24339
24366
|
// src/commands/review/prepareReviewDir.ts
|
|
24340
|
-
import { existsSync as existsSync49, mkdirSync as mkdirSync19, unlinkSync as
|
|
24367
|
+
import { existsSync as existsSync49, mkdirSync as mkdirSync19, unlinkSync as unlinkSync17, writeFileSync as writeFileSync36 } from "fs";
|
|
24341
24368
|
function clearReviewFiles(paths) {
|
|
24342
24369
|
for (const path71 of [paths.claudePath, paths.codexPath, paths.synthesisPath]) {
|
|
24343
|
-
if (existsSync49(path71))
|
|
24370
|
+
if (existsSync49(path71)) unlinkSync17(path71);
|
|
24344
24371
|
}
|
|
24345
24372
|
}
|
|
24346
24373
|
function prepareReviewDir(paths, requestBody, force) {
|
|
@@ -24625,7 +24652,7 @@ function printReviewerFailures(results) {
|
|
|
24625
24652
|
}
|
|
24626
24653
|
|
|
24627
24654
|
// src/commands/review/runAndSynthesise.ts
|
|
24628
|
-
import { existsSync as existsSync51, unlinkSync as
|
|
24655
|
+
import { existsSync as existsSync51, unlinkSync as unlinkSync19 } from "fs";
|
|
24629
24656
|
|
|
24630
24657
|
// src/commands/review/buildReviewerStdin.ts
|
|
24631
24658
|
var REVIEW_PROMPT = `You are acting as a reviewer for a proposed code change made by another engineer. The full review request \u2014 branch, base, changed files, and unified diff \u2014 is in the request file whose absolute path is given below.
|
|
@@ -25045,7 +25072,7 @@ function resolveClaude(args) {
|
|
|
25045
25072
|
}
|
|
25046
25073
|
|
|
25047
25074
|
// src/commands/review/runCodexReviewer.ts
|
|
25048
|
-
import { existsSync as existsSync50, unlinkSync as
|
|
25075
|
+
import { existsSync as existsSync50, unlinkSync as unlinkSync18 } from "fs";
|
|
25049
25076
|
|
|
25050
25077
|
// src/commands/review/parseCodexEvent.ts
|
|
25051
25078
|
function isItemStarted(value) {
|
|
@@ -25098,7 +25125,7 @@ async function runCodexReviewer(spec) {
|
|
|
25098
25125
|
}
|
|
25099
25126
|
});
|
|
25100
25127
|
if (result.exitCode !== 0 && existsSync50(spec.outputPath)) {
|
|
25101
|
-
|
|
25128
|
+
unlinkSync18(spec.outputPath);
|
|
25102
25129
|
}
|
|
25103
25130
|
return finaliseReviewerRun({ ...spec, command }, spinner, result);
|
|
25104
25131
|
}
|
|
@@ -25244,7 +25271,7 @@ async function runAndSynthesise(args) {
|
|
|
25244
25271
|
return { ok: false, failures };
|
|
25245
25272
|
}
|
|
25246
25273
|
if (anyFresh && existsSync51(paths.synthesisPath)) {
|
|
25247
|
-
|
|
25274
|
+
unlinkSync19(paths.synthesisPath);
|
|
25248
25275
|
}
|
|
25249
25276
|
const synthesisResult = await synthesise(paths, { multi });
|
|
25250
25277
|
if (synthesisResult.exitCode !== 0) failures.push(synthesisResult);
|
|
@@ -26116,14 +26143,14 @@ async function configure() {
|
|
|
26116
26143
|
}
|
|
26117
26144
|
|
|
26118
26145
|
// src/commands/transcript/list.ts
|
|
26119
|
-
import { existsSync as existsSync52, readdirSync as
|
|
26120
|
-
import { join as
|
|
26146
|
+
import { existsSync as existsSync52, readdirSync as readdirSync11, statSync as statSync9 } from "fs";
|
|
26147
|
+
import { join as join60 } from "path";
|
|
26121
26148
|
function list4() {
|
|
26122
26149
|
const { vttDir } = getTranscriptConfig();
|
|
26123
26150
|
if (!existsSync52(vttDir)) return;
|
|
26124
|
-
for (const entry of
|
|
26151
|
+
for (const entry of readdirSync11(vttDir)) {
|
|
26125
26152
|
if (!entry.endsWith(".vtt")) continue;
|
|
26126
|
-
if (statSync9(
|
|
26153
|
+
if (statSync9(join60(vttDir, entry)).isDirectory()) continue;
|
|
26127
26154
|
console.log(entry);
|
|
26128
26155
|
}
|
|
26129
26156
|
}
|
|
@@ -26136,7 +26163,7 @@ import {
|
|
|
26136
26163
|
renameSync as renameSync2,
|
|
26137
26164
|
writeFileSync as writeFileSync38
|
|
26138
26165
|
} from "fs";
|
|
26139
|
-
import { basename as basename17, join as
|
|
26166
|
+
import { basename as basename17, join as join61 } from "path";
|
|
26140
26167
|
|
|
26141
26168
|
// src/commands/transcript/cleanText.ts
|
|
26142
26169
|
function cleanText(text17) {
|
|
@@ -26349,9 +26376,9 @@ function convertVttToMarkdown(inputPath) {
|
|
|
26349
26376
|
return formatChatLog(messages);
|
|
26350
26377
|
}
|
|
26351
26378
|
function archiveRawVtt(vttDir, sourcePath, filename) {
|
|
26352
|
-
const processedDir =
|
|
26379
|
+
const processedDir = join61(vttDir, "processed");
|
|
26353
26380
|
mkdirSync20(processedDir, { recursive: true });
|
|
26354
|
-
renameSync2(sourcePath,
|
|
26381
|
+
renameSync2(sourcePath, join61(processedDir, filename));
|
|
26355
26382
|
}
|
|
26356
26383
|
function move(file, options2) {
|
|
26357
26384
|
const { date, client } = options2;
|
|
@@ -26361,19 +26388,19 @@ function move(file, options2) {
|
|
|
26361
26388
|
}
|
|
26362
26389
|
const { vttDir, transcriptsDir, summaryDir } = getTranscriptConfig();
|
|
26363
26390
|
const filename = basename17(file);
|
|
26364
|
-
const sourcePath =
|
|
26391
|
+
const sourcePath = join61(vttDir, filename);
|
|
26365
26392
|
if (!existsSync53(sourcePath)) {
|
|
26366
26393
|
console.error(`Error: VTT file not found: ${sourcePath}`);
|
|
26367
26394
|
process.exit(1);
|
|
26368
26395
|
}
|
|
26369
26396
|
const base = basename17(filename, ".vtt").replace(/ Transcription$/, "");
|
|
26370
26397
|
const outputName = `${date} ${base}.md`;
|
|
26371
|
-
const formattedDir =
|
|
26398
|
+
const formattedDir = join61(transcriptsDir, client);
|
|
26372
26399
|
mkdirSync20(formattedDir, { recursive: true });
|
|
26373
|
-
const formattedPath =
|
|
26400
|
+
const formattedPath = join61(formattedDir, outputName);
|
|
26374
26401
|
writeFileSync38(formattedPath, convertVttToMarkdown(sourcePath), "utf8");
|
|
26375
26402
|
archiveRawVtt(vttDir, sourcePath, filename);
|
|
26376
|
-
const summaryPath =
|
|
26403
|
+
const summaryPath = join61(summaryDir, client, outputName);
|
|
26377
26404
|
console.log(`Formatted transcript: ${formattedPath}`);
|
|
26378
26405
|
console.log(`Summary target: ${summaryPath}`);
|
|
26379
26406
|
}
|
|
@@ -26493,38 +26520,38 @@ function registerVerify(program2) {
|
|
|
26493
26520
|
|
|
26494
26521
|
// src/commands/voice/devices.ts
|
|
26495
26522
|
import { spawnSync as spawnSync6 } from "child_process";
|
|
26496
|
-
import { join as
|
|
26523
|
+
import { join as join63 } from "path";
|
|
26497
26524
|
|
|
26498
26525
|
// src/commands/voice/shared.ts
|
|
26499
26526
|
import { homedir as homedir22 } from "os";
|
|
26500
|
-
import { dirname as dirname30, join as
|
|
26527
|
+
import { dirname as dirname30, join as join62 } from "path";
|
|
26501
26528
|
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
26502
26529
|
var __dirname5 = dirname30(fileURLToPath7(import.meta.url));
|
|
26503
|
-
var VOICE_DIR =
|
|
26530
|
+
var VOICE_DIR = join62(homedir22(), ".assist", "voice");
|
|
26504
26531
|
var voicePaths = {
|
|
26505
26532
|
dir: VOICE_DIR,
|
|
26506
|
-
pid:
|
|
26507
|
-
log:
|
|
26508
|
-
venv:
|
|
26509
|
-
lock:
|
|
26533
|
+
pid: join62(VOICE_DIR, "voice.pid"),
|
|
26534
|
+
log: join62(VOICE_DIR, "voice.log"),
|
|
26535
|
+
venv: join62(VOICE_DIR, ".venv"),
|
|
26536
|
+
lock: join62(VOICE_DIR, "voice.lock")
|
|
26510
26537
|
};
|
|
26511
26538
|
function getPythonDir() {
|
|
26512
|
-
return
|
|
26539
|
+
return join62(__dirname5, "commands", "voice", "python");
|
|
26513
26540
|
}
|
|
26514
26541
|
function getVenvPython() {
|
|
26515
|
-
return process.platform === "win32" ?
|
|
26542
|
+
return process.platform === "win32" ? join62(voicePaths.venv, "Scripts", "python.exe") : join62(voicePaths.venv, "bin", "python");
|
|
26516
26543
|
}
|
|
26517
26544
|
function getLockDir() {
|
|
26518
26545
|
const config = loadConfig();
|
|
26519
26546
|
return config.voice?.lockDir ?? VOICE_DIR;
|
|
26520
26547
|
}
|
|
26521
26548
|
function getLockFile() {
|
|
26522
|
-
return
|
|
26549
|
+
return join62(getLockDir(), "voice.lock");
|
|
26523
26550
|
}
|
|
26524
26551
|
|
|
26525
26552
|
// src/commands/voice/devices.ts
|
|
26526
26553
|
function devices() {
|
|
26527
|
-
const script =
|
|
26554
|
+
const script = join63(getPythonDir(), "list_devices.py");
|
|
26528
26555
|
spawnSync6(getVenvPython(), [script], { stdio: "inherit" });
|
|
26529
26556
|
}
|
|
26530
26557
|
|
|
@@ -26559,12 +26586,12 @@ function logs(options2) {
|
|
|
26559
26586
|
// src/commands/voice/setup.ts
|
|
26560
26587
|
import { spawnSync as spawnSync7 } from "child_process";
|
|
26561
26588
|
import { mkdirSync as mkdirSync22 } from "fs";
|
|
26562
|
-
import { join as
|
|
26589
|
+
import { join as join65 } from "path";
|
|
26563
26590
|
|
|
26564
26591
|
// src/commands/voice/checkLockFile.ts
|
|
26565
26592
|
import { execSync as execSync59 } from "child_process";
|
|
26566
26593
|
import { existsSync as existsSync55, mkdirSync as mkdirSync21, readFileSync as readFileSync45, writeFileSync as writeFileSync39 } from "fs";
|
|
26567
|
-
import { join as
|
|
26594
|
+
import { join as join64 } from "path";
|
|
26568
26595
|
function isProcessAlive2(pid) {
|
|
26569
26596
|
try {
|
|
26570
26597
|
process.kill(pid, 0);
|
|
@@ -26601,7 +26628,7 @@ function bootstrapVenv() {
|
|
|
26601
26628
|
}
|
|
26602
26629
|
function writeLockFile(pid) {
|
|
26603
26630
|
const lockFile = getLockFile();
|
|
26604
|
-
mkdirSync21(
|
|
26631
|
+
mkdirSync21(join64(lockFile, ".."), { recursive: true });
|
|
26605
26632
|
writeFileSync39(
|
|
26606
26633
|
lockFile,
|
|
26607
26634
|
JSON.stringify({
|
|
@@ -26617,7 +26644,7 @@ function setup() {
|
|
|
26617
26644
|
mkdirSync22(voicePaths.dir, { recursive: true });
|
|
26618
26645
|
bootstrapVenv();
|
|
26619
26646
|
console.log("\nDownloading models...\n");
|
|
26620
|
-
const script =
|
|
26647
|
+
const script = join65(getPythonDir(), "setup_models.py");
|
|
26621
26648
|
const result = spawnSync7(getVenvPython(), [script], {
|
|
26622
26649
|
stdio: "inherit",
|
|
26623
26650
|
env: { ...process.env, VOICE_LOG_FILE: voicePaths.log }
|
|
@@ -26631,7 +26658,7 @@ function setup() {
|
|
|
26631
26658
|
// src/commands/voice/start.ts
|
|
26632
26659
|
import { spawn as spawn8 } from "child_process";
|
|
26633
26660
|
import { mkdirSync as mkdirSync23, writeFileSync as writeFileSync40 } from "fs";
|
|
26634
|
-
import { join as
|
|
26661
|
+
import { join as join66 } from "path";
|
|
26635
26662
|
|
|
26636
26663
|
// src/commands/voice/buildDaemonEnv.ts
|
|
26637
26664
|
function buildDaemonEnv(options2) {
|
|
@@ -26669,7 +26696,7 @@ function start2(options2) {
|
|
|
26669
26696
|
bootstrapVenv();
|
|
26670
26697
|
const debug = options2.debug || options2.foreground || process.platform === "win32";
|
|
26671
26698
|
const env = buildDaemonEnv({ debug });
|
|
26672
|
-
const script =
|
|
26699
|
+
const script = join66(getPythonDir(), "voice_daemon.py");
|
|
26673
26700
|
const python = getVenvPython();
|
|
26674
26701
|
if (options2.foreground) {
|
|
26675
26702
|
spawnForeground(python, script, env);
|
|
@@ -26717,7 +26744,7 @@ function status2() {
|
|
|
26717
26744
|
}
|
|
26718
26745
|
|
|
26719
26746
|
// src/commands/voice/stop.ts
|
|
26720
|
-
import { existsSync as existsSync57, readFileSync as readFileSync47, unlinkSync as
|
|
26747
|
+
import { existsSync as existsSync57, readFileSync as readFileSync47, unlinkSync as unlinkSync20 } from "fs";
|
|
26721
26748
|
function stop2() {
|
|
26722
26749
|
if (!existsSync57(voicePaths.pid)) {
|
|
26723
26750
|
console.log("Voice daemon is not running (no PID file)");
|
|
@@ -26731,12 +26758,12 @@ function stop2() {
|
|
|
26731
26758
|
console.log(`Voice daemon (PID ${pid}) is not running`);
|
|
26732
26759
|
}
|
|
26733
26760
|
try {
|
|
26734
|
-
|
|
26761
|
+
unlinkSync20(voicePaths.pid);
|
|
26735
26762
|
} catch {
|
|
26736
26763
|
}
|
|
26737
26764
|
try {
|
|
26738
26765
|
const lockFile = getLockFile();
|
|
26739
|
-
if (existsSync57(lockFile))
|
|
26766
|
+
if (existsSync57(lockFile)) unlinkSync20(lockFile);
|
|
26740
26767
|
} catch {
|
|
26741
26768
|
}
|
|
26742
26769
|
console.log("Voice daemon stopped");
|
|
@@ -27196,17 +27223,17 @@ async function auth() {
|
|
|
27196
27223
|
|
|
27197
27224
|
// src/commands/roam/postRoamActivity.ts
|
|
27198
27225
|
import { execFileSync as execFileSync12 } from "child_process";
|
|
27199
|
-
import { readdirSync as
|
|
27200
|
-
import { join as
|
|
27226
|
+
import { readdirSync as readdirSync12, readFileSync as readFileSync48, statSync as statSync10 } from "fs";
|
|
27227
|
+
import { join as join67 } from "path";
|
|
27201
27228
|
function findPortFile(roamDir) {
|
|
27202
27229
|
let entries;
|
|
27203
27230
|
try {
|
|
27204
|
-
entries =
|
|
27231
|
+
entries = readdirSync12(roamDir);
|
|
27205
27232
|
} catch {
|
|
27206
27233
|
return void 0;
|
|
27207
27234
|
}
|
|
27208
27235
|
const candidates = entries.filter((name) => /^roam-local-api(-[^.]+)?\.port$/.test(name)).map((name) => {
|
|
27209
|
-
const path71 =
|
|
27236
|
+
const path71 = join67(roamDir, name);
|
|
27210
27237
|
try {
|
|
27211
27238
|
return { path: path71, mtimeMs: statSync10(path71).mtimeMs };
|
|
27212
27239
|
} catch {
|
|
@@ -27218,7 +27245,7 @@ function findPortFile(roamDir) {
|
|
|
27218
27245
|
function postRoamActivity(app, event) {
|
|
27219
27246
|
const appData = process.env.APPDATA;
|
|
27220
27247
|
if (!appData) return;
|
|
27221
|
-
const portFile = findPortFile(
|
|
27248
|
+
const portFile = findPortFile(join67(appData, "Roam"));
|
|
27222
27249
|
if (!portFile) return;
|
|
27223
27250
|
let port;
|
|
27224
27251
|
try {
|
|
@@ -27451,13 +27478,13 @@ function runPreCommands(pre, cwd) {
|
|
|
27451
27478
|
// src/commands/run/spawnRunCommand.ts
|
|
27452
27479
|
import { execFileSync as execFileSync13, spawn as spawn9 } from "child_process";
|
|
27453
27480
|
import { existsSync as existsSync58 } from "fs";
|
|
27454
|
-
import { dirname as dirname31, join as
|
|
27481
|
+
import { dirname as dirname31, join as join68, resolve as resolve16 } from "path";
|
|
27455
27482
|
function resolveCommand2(command) {
|
|
27456
27483
|
if (process.platform !== "win32" || command !== "bash") return command;
|
|
27457
27484
|
try {
|
|
27458
27485
|
const gitPath = execFileSync13("where", ["git"], { encoding: "utf8" }).trim().split("\r\n")[0];
|
|
27459
27486
|
const gitRoot = resolve16(dirname31(gitPath), "..");
|
|
27460
|
-
const gitBash =
|
|
27487
|
+
const gitBash = join68(gitRoot, "bin", "bash.exe");
|
|
27461
27488
|
if (existsSync58(gitBash)) return gitBash;
|
|
27462
27489
|
} catch {
|
|
27463
27490
|
}
|
|
@@ -27546,7 +27573,7 @@ async function run3(name, args) {
|
|
|
27546
27573
|
|
|
27547
27574
|
// src/commands/run/add.ts
|
|
27548
27575
|
import { mkdirSync as mkdirSync24, writeFileSync as writeFileSync41 } from "fs";
|
|
27549
|
-
import { join as
|
|
27576
|
+
import { join as join69 } from "path";
|
|
27550
27577
|
|
|
27551
27578
|
// src/commands/run/extractOption.ts
|
|
27552
27579
|
function extractOption(args, flag) {
|
|
@@ -27607,7 +27634,7 @@ function saveNewRunConfig(name, command, args, cwd) {
|
|
|
27607
27634
|
saveConfig(config);
|
|
27608
27635
|
}
|
|
27609
27636
|
function createCommandFile(name) {
|
|
27610
|
-
const dir =
|
|
27637
|
+
const dir = join69(".claude", "commands");
|
|
27611
27638
|
mkdirSync24(dir, { recursive: true });
|
|
27612
27639
|
const content = `---
|
|
27613
27640
|
description: Run ${name}
|
|
@@ -27615,7 +27642,7 @@ description: Run ${name}
|
|
|
27615
27642
|
|
|
27616
27643
|
Run \`assist run ${name} $ARGUMENTS 2>&1\`.
|
|
27617
27644
|
`;
|
|
27618
|
-
const filePath =
|
|
27645
|
+
const filePath = join69(dir, `${name}.md`);
|
|
27619
27646
|
writeFileSync41(filePath, content);
|
|
27620
27647
|
console.log(`Created command file: ${filePath}`);
|
|
27621
27648
|
}
|
|
@@ -27671,8 +27698,8 @@ function link2() {
|
|
|
27671
27698
|
}
|
|
27672
27699
|
|
|
27673
27700
|
// src/commands/run/remove.ts
|
|
27674
|
-
import { existsSync as existsSync59, unlinkSync as
|
|
27675
|
-
import { join as
|
|
27701
|
+
import { existsSync as existsSync59, unlinkSync as unlinkSync21 } from "fs";
|
|
27702
|
+
import { join as join70 } from "path";
|
|
27676
27703
|
function findRemoveIndex() {
|
|
27677
27704
|
const idx = process.argv.indexOf("remove");
|
|
27678
27705
|
if (idx === -1 || idx + 1 >= process.argv.length) return -1;
|
|
@@ -27687,9 +27714,9 @@ function parseRemoveName() {
|
|
|
27687
27714
|
return process.argv[idx + 1];
|
|
27688
27715
|
}
|
|
27689
27716
|
function deleteCommandFile(name) {
|
|
27690
|
-
const filePath =
|
|
27717
|
+
const filePath = join70(".claude", "commands", `${name}.md`);
|
|
27691
27718
|
if (existsSync59(filePath)) {
|
|
27692
|
-
|
|
27719
|
+
unlinkSync21(filePath);
|
|
27693
27720
|
console.log(`Deleted command file: ${filePath}`);
|
|
27694
27721
|
}
|
|
27695
27722
|
}
|
|
@@ -27742,9 +27769,9 @@ function registerRun(program2) {
|
|
|
27742
27769
|
|
|
27743
27770
|
// src/commands/screenshot/index.ts
|
|
27744
27771
|
import { execSync as execSync61 } from "child_process";
|
|
27745
|
-
import { existsSync as existsSync60, mkdirSync as mkdirSync25, unlinkSync as
|
|
27772
|
+
import { existsSync as existsSync60, mkdirSync as mkdirSync25, unlinkSync as unlinkSync22, writeFileSync as writeFileSync42 } from "fs";
|
|
27746
27773
|
import { tmpdir as tmpdir8 } from "os";
|
|
27747
|
-
import { join as
|
|
27774
|
+
import { join as join71, resolve as resolve18 } from "path";
|
|
27748
27775
|
import chalk209 from "chalk";
|
|
27749
27776
|
|
|
27750
27777
|
// src/commands/screenshot/captureWindowPs1.ts
|
|
@@ -27881,7 +27908,7 @@ function buildOutputPath(outputDir, processName) {
|
|
|
27881
27908
|
return resolve18(outputDir, `${processName}-${timestamp6}.png`);
|
|
27882
27909
|
}
|
|
27883
27910
|
function runPowerShellScript(processName, outputPath) {
|
|
27884
|
-
const scriptPath =
|
|
27911
|
+
const scriptPath = join71(tmpdir8(), `assist-screenshot-${Date.now()}.ps1`);
|
|
27885
27912
|
writeFileSync42(scriptPath, captureWindowPs1, "utf8");
|
|
27886
27913
|
try {
|
|
27887
27914
|
execSync61(
|
|
@@ -27889,7 +27916,7 @@ function runPowerShellScript(processName, outputPath) {
|
|
|
27889
27916
|
{ stdio: ["ignore", "pipe", "pipe"], encoding: "utf8" }
|
|
27890
27917
|
);
|
|
27891
27918
|
} finally {
|
|
27892
|
-
|
|
27919
|
+
unlinkSync22(scriptPath);
|
|
27893
27920
|
}
|
|
27894
27921
|
}
|
|
27895
27922
|
function screenshot(processName) {
|
|
@@ -28546,12 +28573,12 @@ import { basename as basename18 } from "path";
|
|
|
28546
28573
|
|
|
28547
28574
|
// src/commands/sessions/daemon/worktree/deleteStrandedTree.ts
|
|
28548
28575
|
import { existsSync as existsSync62 } from "fs";
|
|
28549
|
-
import { join as
|
|
28576
|
+
import { join as join74 } from "path";
|
|
28550
28577
|
|
|
28551
28578
|
// src/commands/sessions/daemon/worktree/deleteTreeDirectly.ts
|
|
28552
28579
|
import { statSync as statSync12 } from "fs";
|
|
28553
28580
|
import { rm as rm2 } from "fs/promises";
|
|
28554
|
-
import { join as
|
|
28581
|
+
import { join as join73 } from "path";
|
|
28555
28582
|
async function deleteTreeDirectly(clone, worktreePath, why) {
|
|
28556
28583
|
if (holdsAGitDirectoryRatherThanALink(worktreePath)) {
|
|
28557
28584
|
daemonLog(
|
|
@@ -28578,7 +28605,7 @@ async function deleteTreeDirectly(clone, worktreePath, why) {
|
|
|
28578
28605
|
return true;
|
|
28579
28606
|
}
|
|
28580
28607
|
function holdsAGitDirectoryRatherThanALink(worktreePath) {
|
|
28581
|
-
return statSync12(
|
|
28608
|
+
return statSync12(join73(worktreePath, ".git"), {
|
|
28582
28609
|
throwIfNoEntry: false
|
|
28583
28610
|
})?.isDirectory() === true;
|
|
28584
28611
|
}
|
|
@@ -28614,7 +28641,7 @@ async function deleteStrandedTree(clone, worktreePath, cause) {
|
|
|
28614
28641
|
);
|
|
28615
28642
|
}
|
|
28616
28643
|
function strandedReason(worktreePath, cause) {
|
|
28617
|
-
if (!existsSync62(
|
|
28644
|
+
if (!existsSync62(join74(worktreePath, ".git")))
|
|
28618
28645
|
return "its .git link is already gone";
|
|
28619
28646
|
if (/not a working tree|not a git repository/i.test(reason2(cause)))
|
|
28620
28647
|
return "git no longer recognises it as a working tree";
|
|
@@ -31565,6 +31592,15 @@ function isPrCheckoutArgs(args) {
|
|
|
31565
31592
|
return rest.some((arg) => /^[1-9]\d*$/.test(arg));
|
|
31566
31593
|
}
|
|
31567
31594
|
|
|
31595
|
+
// src/commands/sessions/daemon/worktree/isCommittingArgs.ts
|
|
31596
|
+
var ITEM_ID = /^a?\d+$/;
|
|
31597
|
+
function isCommittingArgs(args) {
|
|
31598
|
+
if (isPrCheckoutArgs(args)) return true;
|
|
31599
|
+
const [command, subcommand, ...rest] = args;
|
|
31600
|
+
if (command !== "backlog" || subcommand !== "run") return false;
|
|
31601
|
+
return rest.some((arg) => ITEM_ID.test(arg));
|
|
31602
|
+
}
|
|
31603
|
+
|
|
31568
31604
|
// src/commands/sessions/daemon/worktree/spawnInTree.ts
|
|
31569
31605
|
function allocateAndBind(ctx, cwd, create, options2 = {}) {
|
|
31570
31606
|
const alloc = allocateTree(cwd, boundTreeRoots(ctx.sessions), options2);
|
|
@@ -31587,6 +31623,7 @@ function spawnAssistInTree(ctx, assistArgs, cwd, meta) {
|
|
|
31587
31623
|
(sid, resolvedCwd, holdUntilSeeded) => createAssistSession(sid, assistArgs, resolvedCwd, meta, holdUntilSeeded),
|
|
31588
31624
|
{
|
|
31589
31625
|
forCheckout: isPrCheckoutArgs(assistArgs),
|
|
31626
|
+
commits: isCommittingArgs(assistArgs),
|
|
31590
31627
|
draftLike: isDraftCommand(assistArgs[0]),
|
|
31591
31628
|
inPlace: meta?.inPlace
|
|
31592
31629
|
}
|
|
@@ -31818,7 +31855,7 @@ var SessionManager = class {
|
|
|
31818
31855
|
};
|
|
31819
31856
|
|
|
31820
31857
|
// src/commands/sessions/daemon/startDaemonServer.ts
|
|
31821
|
-
import { unlinkSync as
|
|
31858
|
+
import { unlinkSync as unlinkSync24 } from "fs";
|
|
31822
31859
|
import * as net3 from "net";
|
|
31823
31860
|
|
|
31824
31861
|
// src/commands/sessions/daemon/handleConnection.ts
|
|
@@ -32149,7 +32186,7 @@ function handleConnection(socket, manager) {
|
|
|
32149
32186
|
}
|
|
32150
32187
|
|
|
32151
32188
|
// src/commands/sessions/daemon/onListening.ts
|
|
32152
|
-
import { unlinkSync as
|
|
32189
|
+
import { unlinkSync as unlinkSync23, writeFileSync as writeFileSync43 } from "fs";
|
|
32153
32190
|
|
|
32154
32191
|
// src/commands/sessions/daemon/startPidFileWatchdog.ts
|
|
32155
32192
|
import { readFileSync as readFileSync52 } from "fs";
|
|
@@ -32192,12 +32229,12 @@ function onListening(manager, checkAutoExit) {
|
|
|
32192
32229
|
function cleanupOwnedFiles() {
|
|
32193
32230
|
if (!ownsPidFile()) return;
|
|
32194
32231
|
try {
|
|
32195
|
-
|
|
32232
|
+
unlinkSync23(daemonPaths.pid);
|
|
32196
32233
|
} catch {
|
|
32197
32234
|
}
|
|
32198
32235
|
if (process.platform !== "win32") {
|
|
32199
32236
|
try {
|
|
32200
|
-
|
|
32237
|
+
unlinkSync23(daemonPaths.socket);
|
|
32201
32238
|
} catch {
|
|
32202
32239
|
}
|
|
32203
32240
|
}
|
|
@@ -32244,7 +32281,7 @@ async function recoverFromAddrInUse(server, manager, checkAutoExit) {
|
|
|
32244
32281
|
daemonLog("removing stale socket left by a crashed daemon");
|
|
32245
32282
|
if (process.platform !== "win32") {
|
|
32246
32283
|
try {
|
|
32247
|
-
|
|
32284
|
+
unlinkSync24(daemonPaths.socket);
|
|
32248
32285
|
} catch {
|
|
32249
32286
|
}
|
|
32250
32287
|
}
|
|
@@ -32581,9 +32618,9 @@ function buildLimitsSegment(rateLimits) {
|
|
|
32581
32618
|
|
|
32582
32619
|
// src/commands/readGitBranch.ts
|
|
32583
32620
|
import { readFileSync as readFileSync54, statSync as statSync14 } from "fs";
|
|
32584
|
-
import { isAbsolute as isAbsolute4, join as
|
|
32621
|
+
import { isAbsolute as isAbsolute4, join as join76, resolve as resolve19 } from "path";
|
|
32585
32622
|
function resolveGitDir(cwd) {
|
|
32586
|
-
const dotGit =
|
|
32623
|
+
const dotGit = join76(cwd, ".git");
|
|
32587
32624
|
let stat3;
|
|
32588
32625
|
try {
|
|
32589
32626
|
stat3 = statSync14(dotGit);
|
|
@@ -32613,7 +32650,7 @@ function readGitBranch(cwd) {
|
|
|
32613
32650
|
}
|
|
32614
32651
|
let head;
|
|
32615
32652
|
try {
|
|
32616
|
-
head = readFileSync54(
|
|
32653
|
+
head = readFileSync54(join76(gitDir, "HEAD"), "utf8");
|
|
32617
32654
|
} catch {
|
|
32618
32655
|
return null;
|
|
32619
32656
|
}
|