@staff0rd/assist 0.330.1 → 0.330.3
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 +112 -106
- 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.330.
|
|
9
|
+
version: "0.330.3",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -4867,23 +4867,27 @@ async function handleIncompletePhase() {
|
|
|
4867
4867
|
import { existsSync as existsSync21, readFileSync as readFileSync15 } from "fs";
|
|
4868
4868
|
|
|
4869
4869
|
// src/commands/backlog/writeSignal.ts
|
|
4870
|
-
import { writeFileSync as writeFileSync18 } from "fs";
|
|
4871
|
-
import {
|
|
4870
|
+
import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync18 } from "fs";
|
|
4871
|
+
import { homedir as homedir8 } from "os";
|
|
4872
|
+
import { dirname as dirname15, join as join19 } from "path";
|
|
4872
4873
|
function getSignalPath() {
|
|
4873
4874
|
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
4874
|
-
|
|
4875
|
-
return join19(
|
|
4875
|
+
if (!sessionId) return void 0;
|
|
4876
|
+
return join19(homedir8(), ".assist", "signals", `signal-${sessionId}.json`);
|
|
4876
4877
|
}
|
|
4877
4878
|
function writeSignal(event, data) {
|
|
4879
|
+
const path57 = getSignalPath();
|
|
4880
|
+
if (!path57) return;
|
|
4878
4881
|
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
4879
4882
|
const signal = { event, ...sessionId && { sessionId }, ...data };
|
|
4880
|
-
|
|
4883
|
+
mkdirSync8(dirname15(path57), { recursive: true });
|
|
4884
|
+
writeFileSync18(path57, JSON.stringify(signal));
|
|
4881
4885
|
}
|
|
4882
4886
|
|
|
4883
4887
|
// src/commands/backlog/readSignal.ts
|
|
4884
4888
|
function readSignal() {
|
|
4885
4889
|
const path57 = getSignalPath();
|
|
4886
|
-
if (!existsSync21(path57)) return void 0;
|
|
4890
|
+
if (!path57 || !existsSync21(path57)) return void 0;
|
|
4887
4891
|
try {
|
|
4888
4892
|
return JSON.parse(readFileSync15(path57, "utf8"));
|
|
4889
4893
|
} catch {
|
|
@@ -4894,7 +4898,7 @@ function readSignal() {
|
|
|
4894
4898
|
// src/commands/backlog/resolvePhaseResult.ts
|
|
4895
4899
|
function cleanupSignal() {
|
|
4896
4900
|
const statusPath = getSignalPath();
|
|
4897
|
-
if (existsSync22(statusPath)) {
|
|
4901
|
+
if (statusPath && existsSync22(statusPath)) {
|
|
4898
4902
|
unlinkSync4(statusPath);
|
|
4899
4903
|
}
|
|
4900
4904
|
}
|
|
@@ -4904,7 +4908,8 @@ async function isTerminalStatus(itemId) {
|
|
|
4904
4908
|
return item?.status === "done" || item?.status === "wontdo";
|
|
4905
4909
|
}
|
|
4906
4910
|
async function resolvePhaseResult(phaseIndex, itemId) {
|
|
4907
|
-
|
|
4911
|
+
const signalPath = getSignalPath();
|
|
4912
|
+
if (!signalPath || !existsSync22(signalPath)) {
|
|
4908
4913
|
if (await isTerminalStatus(itemId)) return -1;
|
|
4909
4914
|
const action = await handleIncompletePhase();
|
|
4910
4915
|
if (action === "abort") return -1;
|
|
@@ -4929,6 +4934,7 @@ Phase ${phaseNumber} completed.`));
|
|
|
4929
4934
|
import { existsSync as existsSync23, unwatchFile, watchFile } from "fs";
|
|
4930
4935
|
function watchForMarker(child, options2) {
|
|
4931
4936
|
const statusPath = getSignalPath();
|
|
4937
|
+
if (!statusPath) return;
|
|
4932
4938
|
watchFile(statusPath, { interval: 1e3 }, () => {
|
|
4933
4939
|
if (!existsSync23(statusPath)) return;
|
|
4934
4940
|
const signal = readSignal();
|
|
@@ -4939,7 +4945,8 @@ function watchForMarker(child, options2) {
|
|
|
4939
4945
|
});
|
|
4940
4946
|
}
|
|
4941
4947
|
function stopWatching() {
|
|
4942
|
-
|
|
4948
|
+
const statusPath = getSignalPath();
|
|
4949
|
+
if (statusPath) unwatchFile(statusPath);
|
|
4943
4950
|
}
|
|
4944
4951
|
|
|
4945
4952
|
// src/commands/backlog/executePhase.ts
|
|
@@ -5343,10 +5350,10 @@ import { WebSocketServer } from "ws";
|
|
|
5343
5350
|
|
|
5344
5351
|
// src/shared/getInstallDir.ts
|
|
5345
5352
|
import { execSync as execSync19 } from "child_process";
|
|
5346
|
-
import { dirname as
|
|
5353
|
+
import { dirname as dirname16, resolve as resolve7 } from "path";
|
|
5347
5354
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
5348
5355
|
var __filename2 = fileURLToPath2(import.meta.url);
|
|
5349
|
-
var __dirname3 =
|
|
5356
|
+
var __dirname3 = dirname16(__filename2);
|
|
5350
5357
|
function getInstallDir() {
|
|
5351
5358
|
return resolve7(__dirname3, "..");
|
|
5352
5359
|
}
|
|
@@ -5489,7 +5496,7 @@ function startWebServer(label2, port, handler, initialPath, open = true) {
|
|
|
5489
5496
|
import { spawn as spawn4 } from "child_process";
|
|
5490
5497
|
import {
|
|
5491
5498
|
closeSync,
|
|
5492
|
-
mkdirSync as
|
|
5499
|
+
mkdirSync as mkdirSync9,
|
|
5493
5500
|
openSync,
|
|
5494
5501
|
statSync,
|
|
5495
5502
|
unlinkSync as unlinkSync5,
|
|
@@ -5500,7 +5507,7 @@ var RETRY_DELAY_MS = 200;
|
|
|
5500
5507
|
var STALE_LOCK_MS = SPAWN_TIMEOUT_MS + 5e3;
|
|
5501
5508
|
async function ensureDaemonRunning(reason = "unspecified") {
|
|
5502
5509
|
if (await isDaemonRunning()) return;
|
|
5503
|
-
|
|
5510
|
+
mkdirSync9(daemonPaths.dir, { recursive: true });
|
|
5504
5511
|
const holdsLock = acquireSpawnLock();
|
|
5505
5512
|
if (holdsLock) spawnDaemon(reason);
|
|
5506
5513
|
try {
|
|
@@ -5572,10 +5579,10 @@ import { createRequire as createRequire2 } from "module";
|
|
|
5572
5579
|
// src/shared/createBundleHandler.ts
|
|
5573
5580
|
import { createHash } from "crypto";
|
|
5574
5581
|
import { readFileSync as readFileSync16 } from "fs";
|
|
5575
|
-
import { dirname as
|
|
5582
|
+
import { dirname as dirname17, join as join20 } from "path";
|
|
5576
5583
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
5577
5584
|
function createBundleHandler(importMetaUrl, bundlePath) {
|
|
5578
|
-
const dir =
|
|
5585
|
+
const dir = dirname17(fileURLToPath3(importMetaUrl));
|
|
5579
5586
|
let cache;
|
|
5580
5587
|
return (req, res) => {
|
|
5581
5588
|
if (!cache) {
|
|
@@ -8541,19 +8548,6 @@ var BUILTIN_DENIES = [
|
|
|
8541
8548
|
message: `Do not run 'git commit' directly. Use 'assist commit "<message>"' instead.`
|
|
8542
8549
|
}
|
|
8543
8550
|
];
|
|
8544
|
-
function matchesBuiltinDeny(part) {
|
|
8545
|
-
return BUILTIN_DENIES.find(
|
|
8546
|
-
(rule) => part === rule.pattern || part.startsWith(`${rule.pattern} `)
|
|
8547
|
-
);
|
|
8548
|
-
}
|
|
8549
|
-
function findBuiltinDeny(parts) {
|
|
8550
|
-
const rule = parts.map(matchesBuiltinDeny).find(Boolean);
|
|
8551
|
-
if (!rule) return void 0;
|
|
8552
|
-
return {
|
|
8553
|
-
permissionDecision: "deny",
|
|
8554
|
-
permissionDecisionReason: rule.message
|
|
8555
|
-
};
|
|
8556
|
-
}
|
|
8557
8551
|
function rawDenyRegex(pattern2) {
|
|
8558
8552
|
const tokens = pattern2.trim().split(/\s+/).map((token) => token.replace(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`)).join(String.raw`\s+`);
|
|
8559
8553
|
return new RegExp(`(?<=^|\\s)${tokens}(?=\\s|$)`);
|
|
@@ -8562,23 +8556,35 @@ var RAW_BUILTIN_DENIES = BUILTIN_DENIES.map((rule) => ({
|
|
|
8562
8556
|
...rule,
|
|
8563
8557
|
regex: rawDenyRegex(rule.pattern)
|
|
8564
8558
|
}));
|
|
8565
|
-
function
|
|
8566
|
-
|
|
8559
|
+
function matchBuiltinDeny(text6) {
|
|
8560
|
+
return RAW_BUILTIN_DENIES.find((rule) => rule.regex.test(text6));
|
|
8561
|
+
}
|
|
8562
|
+
function toDecision(rule) {
|
|
8567
8563
|
if (!rule) return void 0;
|
|
8568
8564
|
return {
|
|
8569
8565
|
permissionDecision: "deny",
|
|
8570
8566
|
permissionDecisionReason: rule.message
|
|
8571
8567
|
};
|
|
8572
8568
|
}
|
|
8569
|
+
function findBuiltinDeny(parts) {
|
|
8570
|
+
for (const part of parts) {
|
|
8571
|
+
const decision = toDecision(matchBuiltinDeny(part));
|
|
8572
|
+
if (decision) return decision;
|
|
8573
|
+
}
|
|
8574
|
+
return void 0;
|
|
8575
|
+
}
|
|
8576
|
+
function findBuiltinDenyRaw(rawCommand) {
|
|
8577
|
+
return toDecision(matchBuiltinDeny(rawCommand));
|
|
8578
|
+
}
|
|
8573
8579
|
|
|
8574
8580
|
// src/commands/cliHook/logDeniedToolCall.ts
|
|
8575
|
-
import { mkdirSync as
|
|
8576
|
-
import { homedir as
|
|
8581
|
+
import { mkdirSync as mkdirSync10 } from "fs";
|
|
8582
|
+
import { homedir as homedir9 } from "os";
|
|
8577
8583
|
import { join as join22 } from "path";
|
|
8578
8584
|
import Database from "better-sqlite3";
|
|
8579
8585
|
var _db;
|
|
8580
8586
|
function getDbDir() {
|
|
8581
|
-
return join22(
|
|
8587
|
+
return join22(homedir9(), ".assist");
|
|
8582
8588
|
}
|
|
8583
8589
|
function initSchema2(db) {
|
|
8584
8590
|
db.exec(`
|
|
@@ -8596,7 +8602,7 @@ function initSchema2(db) {
|
|
|
8596
8602
|
function openPromptsDb(dir) {
|
|
8597
8603
|
if (_db) return _db;
|
|
8598
8604
|
const dbDir = dir ?? getDbDir();
|
|
8599
|
-
|
|
8605
|
+
mkdirSync10(dbDir, { recursive: true });
|
|
8600
8606
|
const db = new Database(join22(dbDir, "assist.db"));
|
|
8601
8607
|
db.pragma("journal_mode = WAL");
|
|
8602
8608
|
initSchema2(db);
|
|
@@ -8700,10 +8706,10 @@ function extractGraphqlQuery(args) {
|
|
|
8700
8706
|
|
|
8701
8707
|
// src/shared/loadCliReads.ts
|
|
8702
8708
|
import { existsSync as existsSync24, readFileSync as readFileSync19, writeFileSync as writeFileSync20 } from "fs";
|
|
8703
|
-
import { dirname as
|
|
8709
|
+
import { dirname as dirname18, resolve as resolve8 } from "path";
|
|
8704
8710
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
8705
8711
|
var __filename3 = fileURLToPath4(import.meta.url);
|
|
8706
|
-
var __dirname4 =
|
|
8712
|
+
var __dirname4 = dirname18(__filename3);
|
|
8707
8713
|
function packageRoot() {
|
|
8708
8714
|
return __dirname4;
|
|
8709
8715
|
}
|
|
@@ -8756,11 +8762,11 @@ function findCliWrite(command) {
|
|
|
8756
8762
|
|
|
8757
8763
|
// src/shared/readSettingsPerms.ts
|
|
8758
8764
|
import { existsSync as existsSync25, readFileSync as readFileSync20 } from "fs";
|
|
8759
|
-
import { homedir as
|
|
8765
|
+
import { homedir as homedir10 } from "os";
|
|
8760
8766
|
import { join as join23 } from "path";
|
|
8761
8767
|
function readSettingsPerms(key) {
|
|
8762
8768
|
const paths = [
|
|
8763
|
-
join23(
|
|
8769
|
+
join23(homedir10(), ".claude", "settings.json"),
|
|
8764
8770
|
join23(process.cwd(), ".claude", "settings.json"),
|
|
8765
8771
|
join23(process.cwd(), ".claude", "settings.local.json")
|
|
8766
8772
|
];
|
|
@@ -9035,8 +9041,8 @@ ${reasons.join("\n")}`);
|
|
|
9035
9041
|
}
|
|
9036
9042
|
|
|
9037
9043
|
// src/commands/permitCliReads/index.ts
|
|
9038
|
-
import { existsSync as existsSync26, mkdirSync as
|
|
9039
|
-
import { homedir as
|
|
9044
|
+
import { existsSync as existsSync26, mkdirSync as mkdirSync11, readFileSync as readFileSync21, writeFileSync as writeFileSync21 } from "fs";
|
|
9045
|
+
import { homedir as homedir11 } from "os";
|
|
9040
9046
|
import { join as join24 } from "path";
|
|
9041
9047
|
|
|
9042
9048
|
// src/shared/checkCliAvailable.ts
|
|
@@ -9326,7 +9332,7 @@ function updateSettings(cli, commands) {
|
|
|
9326
9332
|
// src/commands/permitCliReads/index.ts
|
|
9327
9333
|
function logPath(cli) {
|
|
9328
9334
|
const safeName = cli.replace(/\s+/g, "-");
|
|
9329
|
-
return join24(
|
|
9335
|
+
return join24(homedir11(), ".assist", `cli-discover-${safeName}.log`);
|
|
9330
9336
|
}
|
|
9331
9337
|
function readCache(cli) {
|
|
9332
9338
|
const path57 = logPath(cli);
|
|
@@ -9334,8 +9340,8 @@ function readCache(cli) {
|
|
|
9334
9340
|
return readFileSync21(path57, "utf8");
|
|
9335
9341
|
}
|
|
9336
9342
|
function writeCache(cli, output) {
|
|
9337
|
-
const dir = join24(
|
|
9338
|
-
|
|
9343
|
+
const dir = join24(homedir11(), ".assist");
|
|
9344
|
+
mkdirSync11(dir, { recursive: true });
|
|
9339
9345
|
writeFileSync21(logPath(cli), output);
|
|
9340
9346
|
}
|
|
9341
9347
|
async function permitCliReads(cli, options2 = { noCache: false }) {
|
|
@@ -9467,10 +9473,10 @@ import { existsSync as existsSync27, readFileSync as readFileSync22, unlinkSync
|
|
|
9467
9473
|
import chalk94 from "chalk";
|
|
9468
9474
|
|
|
9469
9475
|
// src/commands/codeComment/getRestrictedDir.ts
|
|
9470
|
-
import { homedir as
|
|
9476
|
+
import { homedir as homedir12 } from "os";
|
|
9471
9477
|
import { join as join25 } from "path";
|
|
9472
9478
|
function getRestrictedDir() {
|
|
9473
|
-
return join25(
|
|
9479
|
+
return join25(homedir12(), ".assist", "restricted");
|
|
9474
9480
|
}
|
|
9475
9481
|
function getPinStatePath(pin) {
|
|
9476
9482
|
return join25(getRestrictedDir(), `code-comment-${pin}.json`);
|
|
@@ -9574,11 +9580,11 @@ function validateCommentText(raw) {
|
|
|
9574
9580
|
}
|
|
9575
9581
|
|
|
9576
9582
|
// src/commands/codeComment/issuePin.ts
|
|
9577
|
-
import { mkdirSync as
|
|
9583
|
+
import { mkdirSync as mkdirSync12, writeFileSync as writeFileSync23 } from "fs";
|
|
9578
9584
|
import { randomInt } from "crypto";
|
|
9579
9585
|
function issuePin(file, lineNumber, text6) {
|
|
9580
9586
|
const pin = generatePin();
|
|
9581
|
-
|
|
9587
|
+
mkdirSync12(getRestrictedDir(), { recursive: true });
|
|
9582
9588
|
sweepRestrictedDir();
|
|
9583
9589
|
writeFileSync23(
|
|
9584
9590
|
getPinStatePath(pin),
|
|
@@ -10410,9 +10416,9 @@ import { execFileSync as execFileSync2 } from "child_process";
|
|
|
10410
10416
|
import { basename as basename4 } from "path";
|
|
10411
10417
|
|
|
10412
10418
|
// src/commands/devlog/loadBlogSkipDays.ts
|
|
10413
|
-
import { homedir as
|
|
10419
|
+
import { homedir as homedir13 } from "os";
|
|
10414
10420
|
import { join as join27 } from "path";
|
|
10415
|
-
var BLOG_REPO_ROOT = join27(
|
|
10421
|
+
var BLOG_REPO_ROOT = join27(homedir13(), "git/blog");
|
|
10416
10422
|
function loadBlogSkipDays(repoName) {
|
|
10417
10423
|
const config = loadRawYaml(join27(BLOG_REPO_ROOT, "assist.yml"));
|
|
10418
10424
|
const devlog = config.devlog;
|
|
@@ -11329,7 +11335,7 @@ import chalk121 from "chalk";
|
|
|
11329
11335
|
|
|
11330
11336
|
// src/commands/dotnet/findSolution.ts
|
|
11331
11337
|
import { readdirSync as readdirSync5 } from "fs";
|
|
11332
|
-
import { dirname as
|
|
11338
|
+
import { dirname as dirname19, join as join32 } from "path";
|
|
11333
11339
|
import chalk120 from "chalk";
|
|
11334
11340
|
function findSlnInDir(dir) {
|
|
11335
11341
|
try {
|
|
@@ -11354,7 +11360,7 @@ function findSolution() {
|
|
|
11354
11360
|
process.exit(1);
|
|
11355
11361
|
}
|
|
11356
11362
|
if (current === ceiling) break;
|
|
11357
|
-
current =
|
|
11363
|
+
current = dirname19(current);
|
|
11358
11364
|
}
|
|
11359
11365
|
console.error(chalk120.red("No .sln file found between cwd and repo root"));
|
|
11360
11366
|
process.exit(1);
|
|
@@ -12252,11 +12258,11 @@ function acceptanceCriteria(issueKey) {
|
|
|
12252
12258
|
import { execSync as execSync30 } from "child_process";
|
|
12253
12259
|
|
|
12254
12260
|
// src/shared/loadJson.ts
|
|
12255
|
-
import { existsSync as existsSync35, mkdirSync as
|
|
12256
|
-
import { homedir as
|
|
12261
|
+
import { existsSync as existsSync35, mkdirSync as mkdirSync13, readFileSync as readFileSync30, writeFileSync as writeFileSync27 } from "fs";
|
|
12262
|
+
import { homedir as homedir14 } from "os";
|
|
12257
12263
|
import { join as join37 } from "path";
|
|
12258
12264
|
function getStoreDir() {
|
|
12259
|
-
return join37(
|
|
12265
|
+
return join37(homedir14(), ".assist");
|
|
12260
12266
|
}
|
|
12261
12267
|
function getStorePath(filename) {
|
|
12262
12268
|
return join37(getStoreDir(), filename);
|
|
@@ -12275,7 +12281,7 @@ function loadJson(filename) {
|
|
|
12275
12281
|
function saveJson(filename, data) {
|
|
12276
12282
|
const dir = getStoreDir();
|
|
12277
12283
|
if (!existsSync35(dir)) {
|
|
12278
|
-
|
|
12284
|
+
mkdirSync13(dir, { recursive: true });
|
|
12279
12285
|
}
|
|
12280
12286
|
writeFileSync27(getStorePath(filename), JSON.stringify(data, null, 2));
|
|
12281
12287
|
}
|
|
@@ -12444,7 +12450,7 @@ function registerList(program2) {
|
|
|
12444
12450
|
}
|
|
12445
12451
|
|
|
12446
12452
|
// src/commands/mermaid/index.ts
|
|
12447
|
-
import { mkdirSync as
|
|
12453
|
+
import { mkdirSync as mkdirSync14, readdirSync as readdirSync7 } from "fs";
|
|
12448
12454
|
import { resolve as resolve11 } from "path";
|
|
12449
12455
|
import chalk132 from "chalk";
|
|
12450
12456
|
|
|
@@ -12513,7 +12519,7 @@ function extractMermaidBlocks(markdown) {
|
|
|
12513
12519
|
async function mermaidExport(file, options2 = {}) {
|
|
12514
12520
|
const { mermaid } = loadConfig();
|
|
12515
12521
|
const outDir = resolve11(process.cwd(), options2.out ?? ".");
|
|
12516
|
-
|
|
12522
|
+
mkdirSync14(outDir, { recursive: true });
|
|
12517
12523
|
if (options2.index !== void 0) {
|
|
12518
12524
|
if (!Number.isInteger(options2.index) || options2.index < 1) {
|
|
12519
12525
|
console.error(
|
|
@@ -12553,7 +12559,7 @@ function registerMermaid(program2) {
|
|
|
12553
12559
|
// src/commands/netcap/netcap.ts
|
|
12554
12560
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
12555
12561
|
import { createServer as createServer2 } from "http";
|
|
12556
|
-
import { dirname as
|
|
12562
|
+
import { dirname as dirname21 } from "path";
|
|
12557
12563
|
import chalk134 from "chalk";
|
|
12558
12564
|
|
|
12559
12565
|
// src/commands/netcap/corsHeaders.ts
|
|
@@ -12636,9 +12642,9 @@ import { join as join39 } from "path";
|
|
|
12636
12642
|
import chalk133 from "chalk";
|
|
12637
12643
|
|
|
12638
12644
|
// src/commands/netcap/netcapExtensionDir.ts
|
|
12639
|
-
import { dirname as
|
|
12645
|
+
import { dirname as dirname20, join as join38 } from "path";
|
|
12640
12646
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
12641
|
-
var moduleDir =
|
|
12647
|
+
var moduleDir = dirname20(fileURLToPath5(import.meta.url));
|
|
12642
12648
|
function netcapExtensionDir() {
|
|
12643
12649
|
return join38(moduleDir, "commands", "netcap", "netcap-extension");
|
|
12644
12650
|
}
|
|
@@ -12698,10 +12704,10 @@ async function prepareExtensionForLoad(port, filter = "") {
|
|
|
12698
12704
|
import { isAbsolute, join as join41, resolve as resolve12 } from "path";
|
|
12699
12705
|
|
|
12700
12706
|
// src/commands/netcap/defaultCapturePath.ts
|
|
12701
|
-
import { homedir as
|
|
12707
|
+
import { homedir as homedir15 } from "os";
|
|
12702
12708
|
import { join as join40 } from "path";
|
|
12703
12709
|
function defaultCapturePath() {
|
|
12704
|
-
return join40(
|
|
12710
|
+
return join40(homedir15(), ".assist", "netcap", "capture.jsonl");
|
|
12705
12711
|
}
|
|
12706
12712
|
|
|
12707
12713
|
// src/commands/netcap/resolveNetcapOutPath.ts
|
|
@@ -12716,7 +12722,7 @@ async function netcap(options2) {
|
|
|
12716
12722
|
const port = Number(options2.port);
|
|
12717
12723
|
const outPath = resolveNetcapOutPath(options2.out);
|
|
12718
12724
|
const filter = options2.filter ?? "";
|
|
12719
|
-
await mkdir3(
|
|
12725
|
+
await mkdir3(dirname21(outPath), { recursive: true });
|
|
12720
12726
|
const extensionPath = await prepareExtensionForLoad(port, filter);
|
|
12721
12727
|
let count6 = 0;
|
|
12722
12728
|
const handler = createNetcapHandler({
|
|
@@ -13755,7 +13761,7 @@ function fixed(commentId, sha) {
|
|
|
13755
13761
|
}
|
|
13756
13762
|
|
|
13757
13763
|
// src/commands/prs/listComments/index.ts
|
|
13758
|
-
import { existsSync as existsSync37, mkdirSync as
|
|
13764
|
+
import { existsSync as existsSync37, mkdirSync as mkdirSync15, writeFileSync as writeFileSync32 } from "fs";
|
|
13759
13765
|
import { join as join46 } from "path";
|
|
13760
13766
|
import { stringify } from "yaml";
|
|
13761
13767
|
|
|
@@ -13882,7 +13888,7 @@ function printComments2(result) {
|
|
|
13882
13888
|
function writeCommentsCache(prNumber, comments3) {
|
|
13883
13889
|
const assistDir = join46(process.cwd(), ".assist");
|
|
13884
13890
|
if (!existsSync37(assistDir)) {
|
|
13885
|
-
|
|
13891
|
+
mkdirSync15(assistDir, { recursive: true });
|
|
13886
13892
|
}
|
|
13887
13893
|
const cacheData = {
|
|
13888
13894
|
prNumber,
|
|
@@ -16427,11 +16433,11 @@ ${annotateDiffWithLineNumbers(context.diff.trimEnd())}
|
|
|
16427
16433
|
}
|
|
16428
16434
|
|
|
16429
16435
|
// src/commands/review/buildReviewPaths.ts
|
|
16430
|
-
import { homedir as
|
|
16436
|
+
import { homedir as homedir16 } from "os";
|
|
16431
16437
|
import { basename as basename7, join as join47 } from "path";
|
|
16432
16438
|
function buildReviewPaths(repoRoot, key) {
|
|
16433
16439
|
const reviewDir = join47(
|
|
16434
|
-
|
|
16440
|
+
homedir16(),
|
|
16435
16441
|
".assist",
|
|
16436
16442
|
"reviews",
|
|
16437
16443
|
basename7(repoRoot),
|
|
@@ -16977,14 +16983,14 @@ async function handlePostSynthesis(synthesisPath, options2) {
|
|
|
16977
16983
|
}
|
|
16978
16984
|
|
|
16979
16985
|
// src/commands/review/prepareReviewDir.ts
|
|
16980
|
-
import { existsSync as existsSync38, mkdirSync as
|
|
16986
|
+
import { existsSync as existsSync38, mkdirSync as mkdirSync16, unlinkSync as unlinkSync14, writeFileSync as writeFileSync33 } from "fs";
|
|
16981
16987
|
function clearReviewFiles(paths) {
|
|
16982
16988
|
for (const path57 of [paths.claudePath, paths.codexPath, paths.synthesisPath]) {
|
|
16983
16989
|
if (existsSync38(path57)) unlinkSync14(path57);
|
|
16984
16990
|
}
|
|
16985
16991
|
}
|
|
16986
16992
|
function prepareReviewDir(paths, requestBody, force) {
|
|
16987
|
-
|
|
16993
|
+
mkdirSync16(paths.reviewDir, { recursive: true });
|
|
16988
16994
|
if (force) clearReviewFiles(paths);
|
|
16989
16995
|
writeFileSync33(paths.requestPath, requestBody);
|
|
16990
16996
|
}
|
|
@@ -18778,7 +18784,7 @@ async function configure() {
|
|
|
18778
18784
|
import { existsSync as existsSync43 } from "fs";
|
|
18779
18785
|
|
|
18780
18786
|
// src/commands/transcript/format/fixInvalidDatePrefixes/index.ts
|
|
18781
|
-
import { dirname as
|
|
18787
|
+
import { dirname as dirname23, join as join50 } from "path";
|
|
18782
18788
|
|
|
18783
18789
|
// src/commands/transcript/format/fixInvalidDatePrefixes/promptForDateFix.ts
|
|
18784
18790
|
import { renameSync as renameSync2 } from "fs";
|
|
@@ -18828,11 +18834,11 @@ async function fixInvalidDatePrefixes(vttFiles) {
|
|
|
18828
18834
|
for (let i = 0; i < vttFiles.length; i++) {
|
|
18829
18835
|
const vttFile = vttFiles[i];
|
|
18830
18836
|
if (!isValidDatePrefix(vttFile.filename)) {
|
|
18831
|
-
const vttFileDir =
|
|
18837
|
+
const vttFileDir = dirname23(vttFile.absolutePath);
|
|
18832
18838
|
const newFilename = await promptForDateFix(vttFile.filename, vttFileDir);
|
|
18833
18839
|
if (newFilename) {
|
|
18834
18840
|
const newRelativePath = join50(
|
|
18835
|
-
|
|
18841
|
+
dirname23(vttFile.relativePath),
|
|
18836
18842
|
newFilename
|
|
18837
18843
|
);
|
|
18838
18844
|
vttFiles[i] = {
|
|
@@ -18849,8 +18855,8 @@ async function fixInvalidDatePrefixes(vttFiles) {
|
|
|
18849
18855
|
}
|
|
18850
18856
|
|
|
18851
18857
|
// src/commands/transcript/format/processVttFile/index.ts
|
|
18852
|
-
import { existsSync as existsSync42, mkdirSync as
|
|
18853
|
-
import { basename as basename9, dirname as
|
|
18858
|
+
import { existsSync as existsSync42, mkdirSync as mkdirSync17, readFileSync as readFileSync36, writeFileSync as writeFileSync35 } from "fs";
|
|
18859
|
+
import { basename as basename9, dirname as dirname24, join as join51 } from "path";
|
|
18854
18860
|
|
|
18855
18861
|
// src/commands/transcript/cleanText.ts
|
|
18856
18862
|
function cleanText(text6) {
|
|
@@ -19064,7 +19070,7 @@ function resolveOutputDir(relativeDir, transcriptsDir) {
|
|
|
19064
19070
|
}
|
|
19065
19071
|
function buildOutputPaths(vttFile, transcriptsDir) {
|
|
19066
19072
|
const mdFile = toMdFilename(vttFile.filename);
|
|
19067
|
-
const relativeDir =
|
|
19073
|
+
const relativeDir = dirname24(vttFile.relativePath);
|
|
19068
19074
|
const outputDir = resolveOutputDir(relativeDir, transcriptsDir);
|
|
19069
19075
|
const outputPath = join51(outputDir, mdFile);
|
|
19070
19076
|
return { outputDir, outputPath, mdFile, relativeDir };
|
|
@@ -19075,7 +19081,7 @@ function logSkipped(relativeDir, mdFile) {
|
|
|
19075
19081
|
}
|
|
19076
19082
|
function ensureDirectory(dir, label2) {
|
|
19077
19083
|
if (!existsSync42(dir)) {
|
|
19078
|
-
|
|
19084
|
+
mkdirSync17(dir, { recursive: true });
|
|
19079
19085
|
console.log(`Created ${label2}: ${dir}`);
|
|
19080
19086
|
}
|
|
19081
19087
|
}
|
|
@@ -19169,17 +19175,17 @@ async function format() {
|
|
|
19169
19175
|
|
|
19170
19176
|
// src/commands/transcript/summarise/index.ts
|
|
19171
19177
|
import { existsSync as existsSync45 } from "fs";
|
|
19172
|
-
import { basename as basename10, dirname as
|
|
19178
|
+
import { basename as basename10, dirname as dirname26, join as join53, relative as relative3 } from "path";
|
|
19173
19179
|
|
|
19174
19180
|
// src/commands/transcript/summarise/processStagedFile/index.ts
|
|
19175
19181
|
import {
|
|
19176
19182
|
existsSync as existsSync44,
|
|
19177
|
-
mkdirSync as
|
|
19183
|
+
mkdirSync as mkdirSync18,
|
|
19178
19184
|
readFileSync as readFileSync37,
|
|
19179
19185
|
renameSync as renameSync3,
|
|
19180
19186
|
rmSync as rmSync3
|
|
19181
19187
|
} from "fs";
|
|
19182
|
-
import { dirname as
|
|
19188
|
+
import { dirname as dirname25, join as join52 } from "path";
|
|
19183
19189
|
|
|
19184
19190
|
// src/commands/transcript/summarise/processStagedFile/validateStagedContent.ts
|
|
19185
19191
|
import chalk178 from "chalk";
|
|
@@ -19233,9 +19239,9 @@ function processStagedFile() {
|
|
|
19233
19239
|
process.exit(1);
|
|
19234
19240
|
}
|
|
19235
19241
|
const destPath = join52(summaryDir, matchingTranscript.relativePath);
|
|
19236
|
-
const destDir =
|
|
19242
|
+
const destDir = dirname25(destPath);
|
|
19237
19243
|
if (!existsSync44(destDir)) {
|
|
19238
|
-
|
|
19244
|
+
mkdirSync18(destDir, { recursive: true });
|
|
19239
19245
|
}
|
|
19240
19246
|
renameSync3(stagedFile.absolutePath, destPath);
|
|
19241
19247
|
const remaining = findMdFilesRecursive(STAGING_DIR);
|
|
@@ -19247,7 +19253,7 @@ function processStagedFile() {
|
|
|
19247
19253
|
|
|
19248
19254
|
// src/commands/transcript/summarise/index.ts
|
|
19249
19255
|
function buildRelativeKey(relativePath, baseName) {
|
|
19250
|
-
const relDir =
|
|
19256
|
+
const relDir = dirname26(relativePath);
|
|
19251
19257
|
return relDir === "." ? baseName : join53(relDir, baseName);
|
|
19252
19258
|
}
|
|
19253
19259
|
function buildSummaryIndex(summaryDir) {
|
|
@@ -19283,7 +19289,7 @@ function summarise2() {
|
|
|
19283
19289
|
const next3 = missing[0];
|
|
19284
19290
|
const outputFilename = `${getTranscriptBaseName(next3.filename)}.md`;
|
|
19285
19291
|
const outputPath = join53(STAGING_DIR, outputFilename);
|
|
19286
|
-
const summaryFileDir = join53(summaryDir,
|
|
19292
|
+
const summaryFileDir = join53(summaryDir, dirname26(next3.relativePath));
|
|
19287
19293
|
const relativeTranscriptPath = encodeURI(
|
|
19288
19294
|
relative3(summaryFileDir, next3.absolutePath).replace(/\\/g, "/")
|
|
19289
19295
|
);
|
|
@@ -19343,11 +19349,11 @@ import { spawnSync as spawnSync5 } from "child_process";
|
|
|
19343
19349
|
import { join as join55 } from "path";
|
|
19344
19350
|
|
|
19345
19351
|
// src/commands/voice/shared.ts
|
|
19346
|
-
import { homedir as
|
|
19347
|
-
import { dirname as
|
|
19352
|
+
import { homedir as homedir17 } from "os";
|
|
19353
|
+
import { dirname as dirname27, join as join54 } from "path";
|
|
19348
19354
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
19349
|
-
var __dirname5 =
|
|
19350
|
-
var VOICE_DIR = join54(
|
|
19355
|
+
var __dirname5 = dirname27(fileURLToPath6(import.meta.url));
|
|
19356
|
+
var VOICE_DIR = join54(homedir17(), ".assist", "voice");
|
|
19351
19357
|
var voicePaths = {
|
|
19352
19358
|
dir: VOICE_DIR,
|
|
19353
19359
|
pid: join54(VOICE_DIR, "voice.pid"),
|
|
@@ -19405,12 +19411,12 @@ function logs(options2) {
|
|
|
19405
19411
|
|
|
19406
19412
|
// src/commands/voice/setup.ts
|
|
19407
19413
|
import { spawnSync as spawnSync6 } from "child_process";
|
|
19408
|
-
import { mkdirSync as
|
|
19414
|
+
import { mkdirSync as mkdirSync20 } from "fs";
|
|
19409
19415
|
import { join as join57 } from "path";
|
|
19410
19416
|
|
|
19411
19417
|
// src/commands/voice/checkLockFile.ts
|
|
19412
19418
|
import { execSync as execSync48 } from "child_process";
|
|
19413
|
-
import { existsSync as existsSync47, mkdirSync as
|
|
19419
|
+
import { existsSync as existsSync47, mkdirSync as mkdirSync19, readFileSync as readFileSync39, writeFileSync as writeFileSync36 } from "fs";
|
|
19414
19420
|
import { join as join56 } from "path";
|
|
19415
19421
|
function isProcessAlive2(pid) {
|
|
19416
19422
|
try {
|
|
@@ -19448,7 +19454,7 @@ function bootstrapVenv() {
|
|
|
19448
19454
|
}
|
|
19449
19455
|
function writeLockFile(pid) {
|
|
19450
19456
|
const lockFile = getLockFile();
|
|
19451
|
-
|
|
19457
|
+
mkdirSync19(join56(lockFile, ".."), { recursive: true });
|
|
19452
19458
|
writeFileSync36(
|
|
19453
19459
|
lockFile,
|
|
19454
19460
|
JSON.stringify({
|
|
@@ -19461,7 +19467,7 @@ function writeLockFile(pid) {
|
|
|
19461
19467
|
|
|
19462
19468
|
// src/commands/voice/setup.ts
|
|
19463
19469
|
function setup() {
|
|
19464
|
-
|
|
19470
|
+
mkdirSync20(voicePaths.dir, { recursive: true });
|
|
19465
19471
|
bootstrapVenv();
|
|
19466
19472
|
console.log("\nDownloading models...\n");
|
|
19467
19473
|
const script = join57(getPythonDir(), "setup_models.py");
|
|
@@ -19477,7 +19483,7 @@ function setup() {
|
|
|
19477
19483
|
|
|
19478
19484
|
// src/commands/voice/start.ts
|
|
19479
19485
|
import { spawn as spawn7 } from "child_process";
|
|
19480
|
-
import { mkdirSync as
|
|
19486
|
+
import { mkdirSync as mkdirSync21, writeFileSync as writeFileSync37 } from "fs";
|
|
19481
19487
|
import { join as join58 } from "path";
|
|
19482
19488
|
|
|
19483
19489
|
// src/commands/voice/buildDaemonEnv.ts
|
|
@@ -19511,7 +19517,7 @@ function spawnBackground(python, script, env) {
|
|
|
19511
19517
|
console.log(`Voice daemon started (PID ${pid})`);
|
|
19512
19518
|
}
|
|
19513
19519
|
function start2(options2) {
|
|
19514
|
-
|
|
19520
|
+
mkdirSync21(voicePaths.dir, { recursive: true });
|
|
19515
19521
|
checkLockFile();
|
|
19516
19522
|
bootstrapVenv();
|
|
19517
19523
|
const debug = options2.debug || options2.foreground || process.platform === "win32";
|
|
@@ -19930,12 +19936,12 @@ function runPreCommands(pre, cwd) {
|
|
|
19930
19936
|
// src/commands/run/spawnRunCommand.ts
|
|
19931
19937
|
import { execFileSync as execFileSync8, spawn as spawn8 } from "child_process";
|
|
19932
19938
|
import { existsSync as existsSync50 } from "fs";
|
|
19933
|
-
import { dirname as
|
|
19939
|
+
import { dirname as dirname28, join as join60, resolve as resolve13 } from "path";
|
|
19934
19940
|
function resolveCommand2(command) {
|
|
19935
19941
|
if (process.platform !== "win32" || command !== "bash") return command;
|
|
19936
19942
|
try {
|
|
19937
19943
|
const gitPath = execFileSync8("where", ["git"], { encoding: "utf8" }).trim().split("\r\n")[0];
|
|
19938
|
-
const gitRoot = resolve13(
|
|
19944
|
+
const gitRoot = resolve13(dirname28(gitPath), "..");
|
|
19939
19945
|
const gitBash = join60(gitRoot, "bin", "bash.exe");
|
|
19940
19946
|
if (existsSync50(gitBash)) return gitBash;
|
|
19941
19947
|
} catch {
|
|
@@ -20022,7 +20028,7 @@ async function run3(name, args) {
|
|
|
20022
20028
|
}
|
|
20023
20029
|
|
|
20024
20030
|
// src/commands/run/add.ts
|
|
20025
|
-
import { mkdirSync as
|
|
20031
|
+
import { mkdirSync as mkdirSync22, writeFileSync as writeFileSync38 } from "fs";
|
|
20026
20032
|
import { join as join61 } from "path";
|
|
20027
20033
|
|
|
20028
20034
|
// src/commands/run/extractOption.ts
|
|
@@ -20085,7 +20091,7 @@ function saveNewRunConfig(name, command, args, cwd) {
|
|
|
20085
20091
|
}
|
|
20086
20092
|
function createCommandFile(name) {
|
|
20087
20093
|
const dir = join61(".claude", "commands");
|
|
20088
|
-
|
|
20094
|
+
mkdirSync22(dir, { recursive: true });
|
|
20089
20095
|
const content = `---
|
|
20090
20096
|
description: Run ${name}
|
|
20091
20097
|
---
|
|
@@ -20204,7 +20210,7 @@ function registerRun(program2) {
|
|
|
20204
20210
|
|
|
20205
20211
|
// src/commands/screenshot/index.ts
|
|
20206
20212
|
import { execSync as execSync50 } from "child_process";
|
|
20207
|
-
import { existsSync as existsSync52, mkdirSync as
|
|
20213
|
+
import { existsSync as existsSync52, mkdirSync as mkdirSync23, unlinkSync as unlinkSync19, writeFileSync as writeFileSync39 } from "fs";
|
|
20208
20214
|
import { tmpdir as tmpdir7 } from "os";
|
|
20209
20215
|
import { join as join63, resolve as resolve15 } from "path";
|
|
20210
20216
|
import chalk180 from "chalk";
|
|
@@ -20337,7 +20343,7 @@ Write-Output $OutputPath
|
|
|
20337
20343
|
// src/commands/screenshot/index.ts
|
|
20338
20344
|
function buildOutputPath(outputDir, processName) {
|
|
20339
20345
|
if (!existsSync52(outputDir)) {
|
|
20340
|
-
|
|
20346
|
+
mkdirSync23(outputDir, { recursive: true });
|
|
20341
20347
|
}
|
|
20342
20348
|
const timestamp4 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
20343
20349
|
return resolve15(outputDir, `${processName}-${timestamp4}.png`);
|
|
@@ -20597,7 +20603,7 @@ function requestDrain(socket) {
|
|
|
20597
20603
|
}
|
|
20598
20604
|
|
|
20599
20605
|
// src/commands/sessions/daemon/runDaemon.ts
|
|
20600
|
-
import { mkdirSync as
|
|
20606
|
+
import { mkdirSync as mkdirSync25 } from "fs";
|
|
20601
20607
|
|
|
20602
20608
|
// src/commands/sessions/daemon/createAutoExit.ts
|
|
20603
20609
|
var DEFAULT_GRACE_MS = 6e4;
|
|
@@ -21238,8 +21244,8 @@ function resumeSession(id2, sessionId, cwd, name) {
|
|
|
21238
21244
|
}
|
|
21239
21245
|
|
|
21240
21246
|
// src/commands/sessions/daemon/watchActivity.ts
|
|
21241
|
-
import { existsSync as existsSync54, mkdirSync as
|
|
21242
|
-
import { dirname as
|
|
21247
|
+
import { existsSync as existsSync54, mkdirSync as mkdirSync24, watch } from "fs";
|
|
21248
|
+
import { dirname as dirname29 } from "path";
|
|
21243
21249
|
|
|
21244
21250
|
// src/commands/sessions/daemon/applyReviewPause.ts
|
|
21245
21251
|
function applyReviewPause(session, activity2) {
|
|
@@ -21257,9 +21263,9 @@ var DEBOUNCE_MS = 50;
|
|
|
21257
21263
|
function watchActivity(session, notify2) {
|
|
21258
21264
|
if (session.commandType !== "assist" || !session.cwd) return;
|
|
21259
21265
|
const path57 = activityPath(session.id);
|
|
21260
|
-
const dir =
|
|
21266
|
+
const dir = dirname29(path57);
|
|
21261
21267
|
try {
|
|
21262
|
-
|
|
21268
|
+
mkdirSync24(dir, { recursive: true });
|
|
21263
21269
|
} catch {
|
|
21264
21270
|
return;
|
|
21265
21271
|
}
|
|
@@ -22635,7 +22641,7 @@ async function recoverFromAddrInUse(server, manager, checkAutoExit) {
|
|
|
22635
22641
|
|
|
22636
22642
|
// src/commands/sessions/daemon/runDaemon.ts
|
|
22637
22643
|
async function runDaemon() {
|
|
22638
|
-
|
|
22644
|
+
mkdirSync25(daemonPaths.dir, { recursive: true });
|
|
22639
22645
|
daemonLog(
|
|
22640
22646
|
`starting (reason: ${process.env.ASSIST_DAEMON_SPAWN_REASON ?? "manual"})`
|
|
22641
22647
|
);
|