@staff0rd/assist 0.652.0 → 0.654.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 +2 -0
- package/claude/advice/assist-global.md +6 -0
- package/claude/advice/backlog-ids.md +6 -0
- package/claude/advice/backlog-prs.md +6 -0
- package/claude/advice/code-comments.md +6 -0
- package/claude/advice/drafting-messages.md +6 -0
- package/claude/advice/editing-files.md +6 -0
- package/claude/advice/jira-context.md +6 -0
- package/claude/advice/jira-smart-links.md +6 -0
- package/claude/advice/markdown.md +6 -0
- package/claude/settings.json +4 -1
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/index.js +715 -544
- 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.654.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -674,6 +674,7 @@ var assistConfigShape = {
|
|
|
674
674
|
slack: z3.string().optional(),
|
|
675
675
|
required: z3.boolean().default(false),
|
|
676
676
|
promptJira: z3.boolean().default(false),
|
|
677
|
+
promptGithub: z3.boolean().default(false),
|
|
677
678
|
draft: z3.boolean().default(false),
|
|
678
679
|
readingWordsPerMinute: z3.number().int().positive().optional()
|
|
679
680
|
}).optional(),
|
|
@@ -3126,6 +3127,11 @@ var prsRaiseConfigHelp = [
|
|
|
3126
3127
|
setter: "assist config set prs.promptJira true",
|
|
3127
3128
|
note: "'assist prs raise' help asks the user for a Jira key to --resolves (default false)"
|
|
3128
3129
|
},
|
|
3130
|
+
{
|
|
3131
|
+
key: "prs.promptGithub",
|
|
3132
|
+
setter: "assist config set prs.promptGithub true",
|
|
3133
|
+
note: "'assist prs raise' help asks the user for a GitHub issue to --resolves (default false)"
|
|
3134
|
+
},
|
|
3129
3135
|
{
|
|
3130
3136
|
key: "prs.draft",
|
|
3131
3137
|
setter: "assist config set prs.draft true",
|
|
@@ -5081,9 +5087,148 @@ function registerActivity(program2) {
|
|
|
5081
5087
|
).action(activity);
|
|
5082
5088
|
}
|
|
5083
5089
|
|
|
5090
|
+
// src/commands/advise/adviceContextFor.ts
|
|
5091
|
+
function adviceContextFor(cwd) {
|
|
5092
|
+
return {
|
|
5093
|
+
config: loadConfigFrom(cwd),
|
|
5094
|
+
rootDir: findConfigUp(cwd)?.rootDir ?? cwd
|
|
5095
|
+
};
|
|
5096
|
+
}
|
|
5097
|
+
|
|
5098
|
+
// src/commands/advise/loadAdviceFragments.ts
|
|
5099
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync14 } from "fs";
|
|
5100
|
+
import { basename as basename4, join as join13 } from "path";
|
|
5101
|
+
|
|
5102
|
+
// src/commands/advise/adviceDir.ts
|
|
5103
|
+
import { existsSync as existsSync18 } from "fs";
|
|
5104
|
+
import { dirname as dirname13, join as join12 } from "path";
|
|
5105
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
5106
|
+
function adviceDir() {
|
|
5107
|
+
let current = dirname13(fileURLToPath3(import.meta.url));
|
|
5108
|
+
while (current !== dirname13(current)) {
|
|
5109
|
+
const candidate = join12(current, "claude", "advice");
|
|
5110
|
+
if (existsSync18(candidate)) return candidate;
|
|
5111
|
+
current = dirname13(current);
|
|
5112
|
+
}
|
|
5113
|
+
throw new Error("Could not locate the shipped claude/advice directory");
|
|
5114
|
+
}
|
|
5115
|
+
|
|
5116
|
+
// src/commands/advise/parseAdviceFragment.ts
|
|
5117
|
+
import { parse as parseYaml2 } from "yaml";
|
|
5118
|
+
var frontmatter = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
|
|
5119
|
+
function parseAdviceFragment(name, content) {
|
|
5120
|
+
const match = frontmatter.exec(content);
|
|
5121
|
+
if (!match) throw new Error(`Advice fragment ${name} has no frontmatter`);
|
|
5122
|
+
const meta = parseYaml2(match[1]) ?? {};
|
|
5123
|
+
const title = meta.title;
|
|
5124
|
+
const when = meta.when;
|
|
5125
|
+
if (typeof title !== "string" || typeof when !== "string")
|
|
5126
|
+
throw new Error(
|
|
5127
|
+
`Advice fragment ${name} needs a title and a when condition`
|
|
5128
|
+
);
|
|
5129
|
+
return {
|
|
5130
|
+
name,
|
|
5131
|
+
title,
|
|
5132
|
+
when,
|
|
5133
|
+
body: content.slice(match[0].length).trim()
|
|
5134
|
+
};
|
|
5135
|
+
}
|
|
5136
|
+
|
|
5137
|
+
// src/commands/advise/loadAdviceFragments.ts
|
|
5138
|
+
function loadAdviceFragments(dir = adviceDir()) {
|
|
5139
|
+
return readdirSync2(dir).filter((file) => file.endsWith(".md")).sort().map(
|
|
5140
|
+
(file) => parseAdviceFragment(
|
|
5141
|
+
basename4(file, ".md"),
|
|
5142
|
+
readFileSync14(join13(dir, file), "utf8")
|
|
5143
|
+
)
|
|
5144
|
+
);
|
|
5145
|
+
}
|
|
5146
|
+
|
|
5147
|
+
// src/commands/advise/adviceConditions.ts
|
|
5148
|
+
var adviceConditions = {
|
|
5149
|
+
always: {
|
|
5150
|
+
whenMet: "always included",
|
|
5151
|
+
whenUnmet: "always included",
|
|
5152
|
+
matches: () => true
|
|
5153
|
+
},
|
|
5154
|
+
jira: {
|
|
5155
|
+
whenMet: "jira is configured",
|
|
5156
|
+
whenUnmet: "jira is not configured",
|
|
5157
|
+
matches: ({ config }) => config.jira !== void 0
|
|
5158
|
+
}
|
|
5159
|
+
};
|
|
5160
|
+
|
|
5161
|
+
// src/commands/advise/selectAdvice.ts
|
|
5162
|
+
function selectAdvice(fragments, context) {
|
|
5163
|
+
return fragments.map((fragment) => {
|
|
5164
|
+
const condition = adviceConditions[fragment.when];
|
|
5165
|
+
if (!condition)
|
|
5166
|
+
return {
|
|
5167
|
+
fragment,
|
|
5168
|
+
included: false,
|
|
5169
|
+
reason: `unknown condition "${fragment.when}"`
|
|
5170
|
+
};
|
|
5171
|
+
const included = condition.matches(context);
|
|
5172
|
+
return {
|
|
5173
|
+
fragment,
|
|
5174
|
+
included,
|
|
5175
|
+
reason: included ? condition.whenMet : condition.whenUnmet
|
|
5176
|
+
};
|
|
5177
|
+
});
|
|
5178
|
+
}
|
|
5179
|
+
|
|
5180
|
+
// src/commands/advise/composeAdvice.ts
|
|
5181
|
+
var heading = "# Instructions for this repo (composed by assist)";
|
|
5182
|
+
function composeAdvice(context, fragments = loadAdviceFragments()) {
|
|
5183
|
+
const sections = selectAdvice(fragments, context).filter((decision) => decision.included).map(({ fragment }) => `## ${fragment.title}
|
|
5184
|
+
|
|
5185
|
+
${fragment.body}`);
|
|
5186
|
+
if (sections.length === 0) return "";
|
|
5187
|
+
return [heading, ...sections].join("\n\n");
|
|
5188
|
+
}
|
|
5189
|
+
|
|
5190
|
+
// src/commands/advise/advise.ts
|
|
5191
|
+
async function hookCwd(options2) {
|
|
5192
|
+
const read3 = options2.stdin ?? (process.stdin.isTTY ? void 0 : readStdin);
|
|
5193
|
+
if (!read3) return void 0;
|
|
5194
|
+
try {
|
|
5195
|
+
const raw = await read3();
|
|
5196
|
+
if (!raw.trim()) return void 0;
|
|
5197
|
+
return JSON.parse(raw).cwd;
|
|
5198
|
+
} catch {
|
|
5199
|
+
return void 0;
|
|
5200
|
+
}
|
|
5201
|
+
}
|
|
5202
|
+
async function advise(options2 = {}) {
|
|
5203
|
+
const fallback = options2.cwdFallback ?? process.cwd();
|
|
5204
|
+
const cwd = options2.hook ? await hookCwd(options2) ?? fallback : fallback;
|
|
5205
|
+
const markdown = composeAdvice(adviceContextFor(cwd));
|
|
5206
|
+
if (!markdown) return "";
|
|
5207
|
+
const output = options2.hook ? JSON.stringify({
|
|
5208
|
+
hookSpecificOutput: {
|
|
5209
|
+
hookEventName: "SessionStart",
|
|
5210
|
+
additionalContext: markdown
|
|
5211
|
+
}
|
|
5212
|
+
}) : markdown;
|
|
5213
|
+
console.log(output);
|
|
5214
|
+
return output;
|
|
5215
|
+
}
|
|
5216
|
+
|
|
5217
|
+
// src/commands/registerAdvise.ts
|
|
5218
|
+
function registerAdvise(program2) {
|
|
5219
|
+
program2.command("advise").description(
|
|
5220
|
+
"Print the advice fragments that apply to this repo, composed from config and repo facts"
|
|
5221
|
+
).option(
|
|
5222
|
+
"--hook",
|
|
5223
|
+
"emit the advice as SessionStart hook JSON (additionalContext)"
|
|
5224
|
+
).action(async (options2) => {
|
|
5225
|
+
await advise({ hook: options2.hook });
|
|
5226
|
+
});
|
|
5227
|
+
}
|
|
5228
|
+
|
|
5084
5229
|
// src/commands/registerBackup.ts
|
|
5085
5230
|
import { mkdir as mkdir2, stat } from "fs/promises";
|
|
5086
|
-
import { join as
|
|
5231
|
+
import { join as join15, resolve as resolve7 } from "path";
|
|
5087
5232
|
import chalk31 from "chalk";
|
|
5088
5233
|
|
|
5089
5234
|
// src/shared/db/getDb.ts
|
|
@@ -5717,7 +5862,7 @@ function expandTilde2(value) {
|
|
|
5717
5862
|
|
|
5718
5863
|
// src/commands/backup/scheduleBackup.ts
|
|
5719
5864
|
import { mkdir } from "fs/promises";
|
|
5720
|
-
import { join as
|
|
5865
|
+
import { join as join14 } from "path";
|
|
5721
5866
|
import chalk29 from "chalk";
|
|
5722
5867
|
|
|
5723
5868
|
// src/commands/backup/readCrontab.ts
|
|
@@ -5859,7 +6004,7 @@ async function scheduleBackup({
|
|
|
5859
6004
|
const cronExpr = durationToCron(every);
|
|
5860
6005
|
const dir = expandTilde2(loadConfig().backup.dir);
|
|
5861
6006
|
await mkdir(dir, { recursive: true });
|
|
5862
|
-
const logPath2 =
|
|
6007
|
+
const logPath2 = join14(dir, "cron.log");
|
|
5863
6008
|
const cronLine = `${cronExpr} ${resolveAssistCommand()} backup >> ${logPath2} 2>&1`;
|
|
5864
6009
|
writeCrontab(upsertScheduleBlock(readCrontab(), every, cronLine));
|
|
5865
6010
|
console.error(
|
|
@@ -6038,7 +6183,7 @@ async function backup({ out }) {
|
|
|
6038
6183
|
await mkdir2(dir, { recursive: true });
|
|
6039
6184
|
const start3 = Date.now();
|
|
6040
6185
|
const timestamp6 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
6041
|
-
const filePath = resolve7(
|
|
6186
|
+
const filePath = resolve7(join15(dir, `backup-${timestamp6}.dump`));
|
|
6042
6187
|
await exportBacklog(filePath);
|
|
6043
6188
|
const { size } = await stat(filePath);
|
|
6044
6189
|
const durationMs = Date.now() - start3;
|
|
@@ -6139,19 +6284,19 @@ function parseItemId(input) {
|
|
|
6139
6284
|
|
|
6140
6285
|
// src/commands/backlog/acquireLock.ts
|
|
6141
6286
|
import {
|
|
6142
|
-
existsSync as
|
|
6287
|
+
existsSync as existsSync19,
|
|
6143
6288
|
mkdirSync as mkdirSync4,
|
|
6144
|
-
readFileSync as
|
|
6289
|
+
readFileSync as readFileSync15,
|
|
6145
6290
|
unlinkSync as unlinkSync2,
|
|
6146
6291
|
writeFileSync as writeFileSync14
|
|
6147
6292
|
} from "fs";
|
|
6148
6293
|
import { homedir as homedir5 } from "os";
|
|
6149
|
-
import { join as
|
|
6294
|
+
import { join as join16 } from "path";
|
|
6150
6295
|
function getLocksDir() {
|
|
6151
|
-
return
|
|
6296
|
+
return join16(homedir5(), ".assist", "locks");
|
|
6152
6297
|
}
|
|
6153
6298
|
function getLockPath(itemId2) {
|
|
6154
|
-
return
|
|
6299
|
+
return join16(getLocksDir(), `lock-${itemId2}.json`);
|
|
6155
6300
|
}
|
|
6156
6301
|
function isProcessAlive(pid) {
|
|
6157
6302
|
try {
|
|
@@ -6163,9 +6308,9 @@ function isProcessAlive(pid) {
|
|
|
6163
6308
|
}
|
|
6164
6309
|
function foreignLockHolder(itemId2) {
|
|
6165
6310
|
const lockPath = getLockPath(itemId2);
|
|
6166
|
-
if (!
|
|
6311
|
+
if (!existsSync19(lockPath)) return null;
|
|
6167
6312
|
try {
|
|
6168
|
-
const lock2 = JSON.parse(
|
|
6313
|
+
const lock2 = JSON.parse(readFileSync15(lockPath, "utf8"));
|
|
6169
6314
|
if (typeof lock2.pid !== "number" || lock2.pid === process.pid) return null;
|
|
6170
6315
|
if (!isProcessAlive(lock2.pid)) return null;
|
|
6171
6316
|
return { pid: lock2.pid, timestamp: lock2.timestamp };
|
|
@@ -6276,7 +6421,7 @@ import chalk45 from "chalk";
|
|
|
6276
6421
|
|
|
6277
6422
|
// src/commands/sessions/daemon/ensureHooksSettings.ts
|
|
6278
6423
|
import { mkdirSync as mkdirSync5, writeFileSync as writeFileSync15 } from "fs";
|
|
6279
|
-
import { dirname as
|
|
6424
|
+
import { dirname as dirname14 } from "path";
|
|
6280
6425
|
var SET_STATUS = "assist sessions set-status";
|
|
6281
6426
|
function running(source) {
|
|
6282
6427
|
return `${SET_STATUS} running --source ${source}`;
|
|
@@ -6308,7 +6453,7 @@ var hooksSettings = {
|
|
|
6308
6453
|
};
|
|
6309
6454
|
function ensureHooksSettings() {
|
|
6310
6455
|
const path91 = daemonPaths.hooksSettings;
|
|
6311
|
-
mkdirSync5(
|
|
6456
|
+
mkdirSync5(dirname14(path91), { recursive: true });
|
|
6312
6457
|
writeFileSync15(path91, JSON.stringify(hooksSettings, null, 2));
|
|
6313
6458
|
return path91;
|
|
6314
6459
|
}
|
|
@@ -6363,7 +6508,7 @@ function buildArgs(prompt, options2) {
|
|
|
6363
6508
|
|
|
6364
6509
|
// src/commands/backlog/ensureStoryBranch.ts
|
|
6365
6510
|
import { execSync as execSync21 } from "child_process";
|
|
6366
|
-
import { basename as
|
|
6511
|
+
import { basename as basename5 } from "path";
|
|
6367
6512
|
|
|
6368
6513
|
// src/commands/branch/createBranch.ts
|
|
6369
6514
|
import { execSync as execSync20 } from "child_process";
|
|
@@ -6698,7 +6843,7 @@ function worktreeBranchInPlay() {
|
|
|
6698
6843
|
const tree = linkedWorktree(process.cwd());
|
|
6699
6844
|
if (!tree) return null;
|
|
6700
6845
|
const head = currentBranch();
|
|
6701
|
-
return head ===
|
|
6846
|
+
return head === basename5(tree.root) ? head : null;
|
|
6702
6847
|
}
|
|
6703
6848
|
function currentBranch() {
|
|
6704
6849
|
try {
|
|
@@ -6721,19 +6866,19 @@ function message(error) {
|
|
|
6721
6866
|
import chalk37 from "chalk";
|
|
6722
6867
|
|
|
6723
6868
|
// src/commands/backlog/migrateLocalBacklog.ts
|
|
6724
|
-
import { existsSync as
|
|
6725
|
-
import { join as
|
|
6869
|
+
import { existsSync as existsSync21 } from "fs";
|
|
6870
|
+
import { join as join18 } from "path";
|
|
6726
6871
|
import chalk36 from "chalk";
|
|
6727
6872
|
|
|
6728
6873
|
// src/commands/backlog/backupLocalBacklogFiles.ts
|
|
6729
|
-
import { existsSync as
|
|
6730
|
-
import { join as
|
|
6874
|
+
import { existsSync as existsSync20, renameSync } from "fs";
|
|
6875
|
+
import { join as join17 } from "path";
|
|
6731
6876
|
var LOCAL_FILES = ["backlog.jsonl", "backlog.db"];
|
|
6732
6877
|
function backupLocalBacklogFiles(dir) {
|
|
6733
6878
|
const moved = [];
|
|
6734
6879
|
for (const name of LOCAL_FILES) {
|
|
6735
|
-
const path91 =
|
|
6736
|
-
if (
|
|
6880
|
+
const path91 = join17(dir, ".assist", name);
|
|
6881
|
+
if (existsSync20(path91)) {
|
|
6737
6882
|
renameSync(path91, `${path91}.bak`);
|
|
6738
6883
|
moved.push(`${name} \u2192 ${name}.bak`);
|
|
6739
6884
|
}
|
|
@@ -7125,7 +7270,7 @@ async function loadAllItems(orm, origin) {
|
|
|
7125
7270
|
}
|
|
7126
7271
|
|
|
7127
7272
|
// src/commands/backlog/parseBacklogJsonl.ts
|
|
7128
|
-
import { readFileSync as
|
|
7273
|
+
import { readFileSync as readFileSync16 } from "fs";
|
|
7129
7274
|
|
|
7130
7275
|
// src/commands/backlog/types.ts
|
|
7131
7276
|
import { z as z4 } from "zod";
|
|
@@ -7219,14 +7364,14 @@ var backlogFileSchema = z4.array(backlogItemSchema);
|
|
|
7219
7364
|
|
|
7220
7365
|
// src/commands/backlog/parseBacklogJsonl.ts
|
|
7221
7366
|
function parseBacklogJsonl(path91) {
|
|
7222
|
-
const content =
|
|
7367
|
+
const content = readFileSync16(path91, "utf8").trim();
|
|
7223
7368
|
if (content.length === 0) return [];
|
|
7224
7369
|
return content.split("\n").map((line) => line.trim()).filter(Boolean).map((line) => backlogItemSchema.parse(JSON.parse(line)));
|
|
7225
7370
|
}
|
|
7226
7371
|
|
|
7227
7372
|
// src/commands/backlog/migrateLocalBacklog.ts
|
|
7228
7373
|
function jsonlPath(dir) {
|
|
7229
|
-
return
|
|
7374
|
+
return join18(dir, ".assist", "backlog.jsonl");
|
|
7230
7375
|
}
|
|
7231
7376
|
async function verifyImport(orm, origin, items2, imported) {
|
|
7232
7377
|
const reloaded = await loadAllItems(orm, origin);
|
|
@@ -7242,7 +7387,7 @@ async function verifyImport(orm, origin, items2, imported) {
|
|
|
7242
7387
|
}
|
|
7243
7388
|
}
|
|
7244
7389
|
async function migrateLocalBacklog(orm, dir, origin) {
|
|
7245
|
-
if (!
|
|
7390
|
+
if (!existsSync21(jsonlPath(dir))) return;
|
|
7246
7391
|
const existing = (await loadAllItems(orm, origin)).length;
|
|
7247
7392
|
if (existing > 0) {
|
|
7248
7393
|
const moved2 = backupLocalBacklogFiles(dir);
|
|
@@ -7281,20 +7426,20 @@ async function deleteItem(orm, id) {
|
|
|
7281
7426
|
}
|
|
7282
7427
|
|
|
7283
7428
|
// src/commands/backlog/findBacklogUp.ts
|
|
7284
|
-
import { existsSync as
|
|
7285
|
-
import { dirname as
|
|
7429
|
+
import { existsSync as existsSync22 } from "fs";
|
|
7430
|
+
import { dirname as dirname15, join as join19 } from "path";
|
|
7286
7431
|
var BACKLOG_MARKERS = [
|
|
7287
|
-
|
|
7288
|
-
|
|
7432
|
+
join19(".assist", "backlog.db"),
|
|
7433
|
+
join19(".assist", "backlog.jsonl"),
|
|
7289
7434
|
"assist.backlog.yml"
|
|
7290
7435
|
];
|
|
7291
7436
|
function findBacklogUp(startDir) {
|
|
7292
7437
|
let current = startDir;
|
|
7293
|
-
while (current !==
|
|
7294
|
-
if (BACKLOG_MARKERS.some((marker2) =>
|
|
7438
|
+
while (current !== dirname15(current)) {
|
|
7439
|
+
if (BACKLOG_MARKERS.some((marker2) => existsSync22(join19(current, marker2)))) {
|
|
7295
7440
|
return current;
|
|
7296
7441
|
}
|
|
7297
|
-
current =
|
|
7442
|
+
current = dirname15(current);
|
|
7298
7443
|
}
|
|
7299
7444
|
return null;
|
|
7300
7445
|
}
|
|
@@ -7545,14 +7690,14 @@ function reportDuplicateRun(itemId2, holder) {
|
|
|
7545
7690
|
}
|
|
7546
7691
|
|
|
7547
7692
|
// src/commands/backlog/consumePause.ts
|
|
7548
|
-
import { existsSync as
|
|
7693
|
+
import { existsSync as existsSync23, mkdirSync as mkdirSync6, unlinkSync as unlinkSync3, writeFileSync as writeFileSync16 } from "fs";
|
|
7549
7694
|
import { homedir as homedir6 } from "os";
|
|
7550
|
-
import { join as
|
|
7695
|
+
import { join as join20 } from "path";
|
|
7551
7696
|
function getControlsDir() {
|
|
7552
|
-
return
|
|
7697
|
+
return join20(homedir6(), ".assist", "controls");
|
|
7553
7698
|
}
|
|
7554
7699
|
function getPausePath(itemId2) {
|
|
7555
|
-
return
|
|
7700
|
+
return join20(getControlsDir(), `pause-${itemId2}.json`);
|
|
7556
7701
|
}
|
|
7557
7702
|
function requestPause(itemId2) {
|
|
7558
7703
|
mkdirSync6(getControlsDir(), { recursive: true });
|
|
@@ -7562,7 +7707,7 @@ function requestPause(itemId2) {
|
|
|
7562
7707
|
);
|
|
7563
7708
|
}
|
|
7564
7709
|
function isPausePending(itemId2) {
|
|
7565
|
-
return
|
|
7710
|
+
return existsSync23(getPausePath(itemId2));
|
|
7566
7711
|
}
|
|
7567
7712
|
function clearPause(itemId2) {
|
|
7568
7713
|
try {
|
|
@@ -7572,7 +7717,7 @@ function clearPause(itemId2) {
|
|
|
7572
7717
|
}
|
|
7573
7718
|
function consumePause(itemId2) {
|
|
7574
7719
|
const pausePath = getPausePath(itemId2);
|
|
7575
|
-
if (!
|
|
7720
|
+
if (!existsSync23(pausePath)) return false;
|
|
7576
7721
|
try {
|
|
7577
7722
|
unlinkSync3(pausePath);
|
|
7578
7723
|
} catch {
|
|
@@ -8003,42 +8148,42 @@ function spawnHarness(harness, prompt, options2 = {}) {
|
|
|
8003
8148
|
}
|
|
8004
8149
|
|
|
8005
8150
|
// src/commands/backlog/watchForMarker.ts
|
|
8006
|
-
import { existsSync as
|
|
8151
|
+
import { existsSync as existsSync26, unwatchFile, watchFile } from "fs";
|
|
8007
8152
|
|
|
8008
8153
|
// src/commands/backlog/readSignal.ts
|
|
8009
|
-
import { existsSync as
|
|
8154
|
+
import { existsSync as existsSync25, readFileSync as readFileSync18 } from "fs";
|
|
8010
8155
|
|
|
8011
8156
|
// src/commands/backlog/writeSignal.ts
|
|
8012
8157
|
import { mkdirSync as mkdirSync8, writeFileSync as writeFileSync18 } from "fs";
|
|
8013
8158
|
import { homedir as homedir9 } from "os";
|
|
8014
|
-
import { dirname as
|
|
8159
|
+
import { dirname as dirname17, join as join23 } from "path";
|
|
8015
8160
|
import chalk41 from "chalk";
|
|
8016
8161
|
|
|
8017
8162
|
// src/commands/backlog/recordSignalOwner.ts
|
|
8018
8163
|
import {
|
|
8019
|
-
existsSync as
|
|
8164
|
+
existsSync as existsSync24,
|
|
8020
8165
|
mkdirSync as mkdirSync7,
|
|
8021
|
-
readFileSync as
|
|
8166
|
+
readFileSync as readFileSync17,
|
|
8022
8167
|
rmSync,
|
|
8023
8168
|
writeFileSync as writeFileSync17
|
|
8024
8169
|
} from "fs";
|
|
8025
8170
|
import { homedir as homedir8 } from "os";
|
|
8026
|
-
import { dirname as
|
|
8171
|
+
import { dirname as dirname16, join as join22 } from "path";
|
|
8027
8172
|
function getOwnerPath(itemId2) {
|
|
8028
|
-
return
|
|
8173
|
+
return join22(homedir8(), ".assist", "signals", `owner-${itemId2}.json`);
|
|
8029
8174
|
}
|
|
8030
8175
|
function recordSignalOwner(itemId2) {
|
|
8031
8176
|
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
8032
8177
|
if (!sessionId) return;
|
|
8033
8178
|
const path91 = getOwnerPath(itemId2);
|
|
8034
|
-
mkdirSync7(
|
|
8179
|
+
mkdirSync7(dirname16(path91), { recursive: true });
|
|
8035
8180
|
writeFileSync17(path91, JSON.stringify({ sessionId }));
|
|
8036
8181
|
}
|
|
8037
8182
|
function readSignalOwner(itemId2) {
|
|
8038
8183
|
const path91 = getOwnerPath(itemId2);
|
|
8039
|
-
if (!
|
|
8184
|
+
if (!existsSync24(path91)) return void 0;
|
|
8040
8185
|
try {
|
|
8041
|
-
const parsed = JSON.parse(
|
|
8186
|
+
const parsed = JSON.parse(readFileSync17(path91, "utf8"));
|
|
8042
8187
|
return parsed.sessionId;
|
|
8043
8188
|
} catch {
|
|
8044
8189
|
return void 0;
|
|
@@ -8055,7 +8200,7 @@ function clearSignalOwner(itemId2) {
|
|
|
8055
8200
|
// src/commands/backlog/writeSignal.ts
|
|
8056
8201
|
function getSignalPath(sessionId = process.env.ASSIST_SESSION_ID) {
|
|
8057
8202
|
if (!sessionId) return void 0;
|
|
8058
|
-
return
|
|
8203
|
+
return join23(homedir9(), ".assist", "signals", `signal-${sessionId}.json`);
|
|
8059
8204
|
}
|
|
8060
8205
|
function resolveSignalTarget(event, data) {
|
|
8061
8206
|
const caller = process.env.ASSIST_SESSION_ID;
|
|
@@ -8087,16 +8232,16 @@ function writeSignal(event, data) {
|
|
|
8087
8232
|
const path91 = getSignalPath(target);
|
|
8088
8233
|
if (!path91) return;
|
|
8089
8234
|
const signal = { event, sessionId: target, ...data };
|
|
8090
|
-
mkdirSync8(
|
|
8235
|
+
mkdirSync8(dirname17(path91), { recursive: true });
|
|
8091
8236
|
writeFileSync18(path91, JSON.stringify(signal));
|
|
8092
8237
|
}
|
|
8093
8238
|
|
|
8094
8239
|
// src/commands/backlog/readSignal.ts
|
|
8095
8240
|
function readSignal() {
|
|
8096
8241
|
const path91 = getSignalPath();
|
|
8097
|
-
if (!path91 || !
|
|
8242
|
+
if (!path91 || !existsSync25(path91)) return void 0;
|
|
8098
8243
|
try {
|
|
8099
|
-
return JSON.parse(
|
|
8244
|
+
return JSON.parse(readFileSync18(path91, "utf8"));
|
|
8100
8245
|
} catch {
|
|
8101
8246
|
return void 0;
|
|
8102
8247
|
}
|
|
@@ -8108,7 +8253,7 @@ function watchForMarker(child, options2) {
|
|
|
8108
8253
|
const statusPath = getSignalPath();
|
|
8109
8254
|
if (!statusPath) return { killedOnMarker: () => killed };
|
|
8110
8255
|
watchFile(statusPath, { interval: 1e3 }, () => {
|
|
8111
|
-
if (!
|
|
8256
|
+
if (!existsSync26(statusPath)) return;
|
|
8112
8257
|
const signal = readSignal();
|
|
8113
8258
|
if (!signal) return;
|
|
8114
8259
|
if (signal.event === "done" && !options2?.actOnDone) return;
|
|
@@ -8160,7 +8305,7 @@ function launchPhaseSession(item, phaseNumber, phase, phaseLabel2, claudeSession
|
|
|
8160
8305
|
}
|
|
8161
8306
|
|
|
8162
8307
|
// src/commands/backlog/resolvePhaseResult.ts
|
|
8163
|
-
import { existsSync as
|
|
8308
|
+
import { existsSync as existsSync27, unlinkSync as unlinkSync4 } from "fs";
|
|
8164
8309
|
import chalk42 from "chalk";
|
|
8165
8310
|
|
|
8166
8311
|
// src/commands/backlog/handleIncompletePhase.ts
|
|
@@ -8182,7 +8327,7 @@ async function handleIncompletePhase() {
|
|
|
8182
8327
|
// src/commands/backlog/resolvePhaseResult.ts
|
|
8183
8328
|
function cleanupSignal() {
|
|
8184
8329
|
const statusPath = getSignalPath();
|
|
8185
|
-
if (statusPath &&
|
|
8330
|
+
if (statusPath && existsSync27(statusPath)) {
|
|
8186
8331
|
unlinkSync4(statusPath);
|
|
8187
8332
|
}
|
|
8188
8333
|
}
|
|
@@ -8193,7 +8338,7 @@ async function isTerminalStatus(itemId2) {
|
|
|
8193
8338
|
}
|
|
8194
8339
|
async function resolvePhaseResult(phaseIndex, itemId2) {
|
|
8195
8340
|
const signalPath = getSignalPath();
|
|
8196
|
-
if (!signalPath || !
|
|
8341
|
+
if (!signalPath || !existsSync27(signalPath)) {
|
|
8197
8342
|
if (await isTerminalStatus(itemId2)) return { kind: "abort" };
|
|
8198
8343
|
const action = await handleIncompletePhase();
|
|
8199
8344
|
if (action === "abort") return { kind: "abort" };
|
|
@@ -8272,9 +8417,9 @@ async function persistPhaseSessionId(itemId2, phaseIdx, claudeSessionId) {
|
|
|
8272
8417
|
}
|
|
8273
8418
|
|
|
8274
8419
|
// src/shared/emitActivity.ts
|
|
8275
|
-
import { mkdirSync as mkdirSync9, readFileSync as
|
|
8420
|
+
import { mkdirSync as mkdirSync9, readFileSync as readFileSync19, rmSync as rmSync2, writeFileSync as writeFileSync19 } from "fs";
|
|
8276
8421
|
import { homedir as homedir10 } from "os";
|
|
8277
|
-
import { dirname as
|
|
8422
|
+
import { dirname as dirname18, join as join24 } from "path";
|
|
8278
8423
|
import { z as z5 } from "zod";
|
|
8279
8424
|
var activitySchema = z5.object({
|
|
8280
8425
|
kind: z5.enum(["command", "backlog"]),
|
|
@@ -8289,18 +8434,18 @@ var activitySchema = z5.object({
|
|
|
8289
8434
|
startedAt: z5.number()
|
|
8290
8435
|
});
|
|
8291
8436
|
function activityPath(sessionId) {
|
|
8292
|
-
return
|
|
8437
|
+
return join24(homedir10(), ".assist", "activity", `activity-${sessionId}.json`);
|
|
8293
8438
|
}
|
|
8294
8439
|
function emitActivity(activity2) {
|
|
8295
8440
|
const sessionId = process.env.ASSIST_ACTIVITY_ID;
|
|
8296
8441
|
if (!sessionId) return;
|
|
8297
8442
|
const path91 = activityPath(sessionId);
|
|
8298
|
-
mkdirSync9(
|
|
8443
|
+
mkdirSync9(dirname18(path91), { recursive: true });
|
|
8299
8444
|
writeFileSync19(path91, JSON.stringify({ ...activity2, startedAt: Date.now() }));
|
|
8300
8445
|
}
|
|
8301
8446
|
function readActivity(path91) {
|
|
8302
8447
|
try {
|
|
8303
|
-
return JSON.parse(
|
|
8448
|
+
return JSON.parse(readFileSync19(path91, "utf8"));
|
|
8304
8449
|
} catch {
|
|
8305
8450
|
return void 0;
|
|
8306
8451
|
}
|
|
@@ -8311,7 +8456,7 @@ function reconcileActivity(sessionId, activity2) {
|
|
|
8311
8456
|
return;
|
|
8312
8457
|
}
|
|
8313
8458
|
const path91 = activityPath(sessionId);
|
|
8314
|
-
mkdirSync9(
|
|
8459
|
+
mkdirSync9(dirname18(path91), { recursive: true });
|
|
8315
8460
|
writeFileSync19(path91, JSON.stringify(activity2));
|
|
8316
8461
|
}
|
|
8317
8462
|
function removeActivity(sessionId) {
|
|
@@ -8370,13 +8515,13 @@ import * as fs16 from "fs";
|
|
|
8370
8515
|
import * as path25 from "path";
|
|
8371
8516
|
|
|
8372
8517
|
// src/commands/sessions/shared/codex/codexSessionsDir.ts
|
|
8373
|
-
import { existsSync as
|
|
8518
|
+
import { existsSync as existsSync28 } from "fs";
|
|
8374
8519
|
import * as path24 from "path";
|
|
8375
8520
|
function codexSessionsDir() {
|
|
8376
8521
|
return path24.join(harnesses.codex.homeDir, "sessions");
|
|
8377
8522
|
}
|
|
8378
8523
|
function hasCodexSessions() {
|
|
8379
|
-
return
|
|
8524
|
+
return existsSync28(codexSessionsDir());
|
|
8380
8525
|
}
|
|
8381
8526
|
|
|
8382
8527
|
// src/commands/sessions/shared/codex/discoverCodexRolloutPaths.ts
|
|
@@ -9406,10 +9551,10 @@ import { WebSocketServer } from "ws";
|
|
|
9406
9551
|
|
|
9407
9552
|
// src/shared/getInstallDir.ts
|
|
9408
9553
|
import { execSync as execSync24 } from "child_process";
|
|
9409
|
-
import { dirname as
|
|
9410
|
-
import { fileURLToPath as
|
|
9411
|
-
var __filename2 =
|
|
9412
|
-
var __dirname3 =
|
|
9554
|
+
import { dirname as dirname20, resolve as resolve8 } from "path";
|
|
9555
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
9556
|
+
var __filename2 = fileURLToPath4(import.meta.url);
|
|
9557
|
+
var __dirname3 = dirname20(__filename2);
|
|
9413
9558
|
function getInstallDir() {
|
|
9414
9559
|
return resolve8(__dirname3, "..");
|
|
9415
9560
|
}
|
|
@@ -9652,7 +9797,7 @@ function originForCwd(cwd) {
|
|
|
9652
9797
|
}
|
|
9653
9798
|
|
|
9654
9799
|
// src/commands/sessions/daemon/repoDirExists.ts
|
|
9655
|
-
import { existsSync as
|
|
9800
|
+
import { existsSync as existsSync29 } from "fs";
|
|
9656
9801
|
|
|
9657
9802
|
// src/commands/sessions/web/windowsCwdToWslPath.ts
|
|
9658
9803
|
function windowsCwdToWslPath(cwd) {
|
|
@@ -9670,7 +9815,7 @@ function toGitCwd(cwd) {
|
|
|
9670
9815
|
|
|
9671
9816
|
// src/commands/sessions/daemon/repoDirExists.ts
|
|
9672
9817
|
function repoDirExists(cwd) {
|
|
9673
|
-
return
|
|
9818
|
+
return existsSync29(toGitCwd(cwd));
|
|
9674
9819
|
}
|
|
9675
9820
|
|
|
9676
9821
|
// src/commands/sessions/daemon/worktree/git.ts
|
|
@@ -9767,20 +9912,20 @@ function gitCommonDir(cwd) {
|
|
|
9767
9912
|
}
|
|
9768
9913
|
|
|
9769
9914
|
// src/shared/loadJson.ts
|
|
9770
|
-
import { existsSync as
|
|
9915
|
+
import { existsSync as existsSync30, mkdirSync as mkdirSync11, readFileSync as readFileSync20, writeFileSync as writeFileSync20 } from "fs";
|
|
9771
9916
|
import { homedir as homedir12 } from "os";
|
|
9772
|
-
import { join as
|
|
9917
|
+
import { join as join28 } from "path";
|
|
9773
9918
|
function getStoreDir() {
|
|
9774
|
-
return process.env.ASSIST_STORE_DIR ||
|
|
9919
|
+
return process.env.ASSIST_STORE_DIR || join28(homedir12(), ".assist");
|
|
9775
9920
|
}
|
|
9776
9921
|
function getStorePath(filename) {
|
|
9777
|
-
return
|
|
9922
|
+
return join28(getStoreDir(), filename);
|
|
9778
9923
|
}
|
|
9779
9924
|
function loadJson(filename) {
|
|
9780
9925
|
const path91 = getStorePath(filename);
|
|
9781
|
-
if (
|
|
9926
|
+
if (existsSync30(path91)) {
|
|
9782
9927
|
try {
|
|
9783
|
-
return JSON.parse(
|
|
9928
|
+
return JSON.parse(readFileSync20(path91, "utf8"));
|
|
9784
9929
|
} catch {
|
|
9785
9930
|
return {};
|
|
9786
9931
|
}
|
|
@@ -9789,7 +9934,7 @@ function loadJson(filename) {
|
|
|
9789
9934
|
}
|
|
9790
9935
|
function saveJson(filename, data) {
|
|
9791
9936
|
const dir = getStoreDir();
|
|
9792
|
-
if (!
|
|
9937
|
+
if (!existsSync30(dir)) {
|
|
9793
9938
|
mkdirSync11(dir, { recursive: true });
|
|
9794
9939
|
}
|
|
9795
9940
|
writeFileSync20(getStorePath(filename), JSON.stringify(data, null, 2));
|
|
@@ -9853,16 +9998,16 @@ function hostedGroup(cwd, origin, clone) {
|
|
|
9853
9998
|
|
|
9854
9999
|
// src/shared/createBundleHandler.ts
|
|
9855
10000
|
import { createHash } from "crypto";
|
|
9856
|
-
import { readFileSync as
|
|
9857
|
-
import { dirname as
|
|
9858
|
-
import { fileURLToPath as
|
|
10001
|
+
import { readFileSync as readFileSync21, statSync as statSync3 } from "fs";
|
|
10002
|
+
import { dirname as dirname21, join as join29 } from "path";
|
|
10003
|
+
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
9859
10004
|
function createBundleHandler(importMetaUrl, bundlePath, contentType = "application/javascript") {
|
|
9860
|
-
const file =
|
|
10005
|
+
const file = join29(dirname21(fileURLToPath5(importMetaUrl)), bundlePath);
|
|
9861
10006
|
let cache5;
|
|
9862
10007
|
return (req, res) => {
|
|
9863
10008
|
const mtimeMs = statSync3(file).mtimeMs;
|
|
9864
10009
|
if (cache5?.mtimeMs !== mtimeMs) {
|
|
9865
|
-
const body =
|
|
10010
|
+
const body = readFileSync21(file, "utf8");
|
|
9866
10011
|
const etag = `"${createHash("sha256").update(body).digest("hex").slice(0, 16)}"`;
|
|
9867
10012
|
cache5 = { body, etag, mtimeMs };
|
|
9868
10013
|
}
|
|
@@ -9992,15 +10137,15 @@ async function loadItemSummaries(orm, origin) {
|
|
|
9992
10137
|
}
|
|
9993
10138
|
|
|
9994
10139
|
// src/commands/backlog/resolveRepoLocation.ts
|
|
9995
|
-
import { existsSync as
|
|
10140
|
+
import { existsSync as existsSync31 } from "fs";
|
|
9996
10141
|
|
|
9997
10142
|
// src/commands/backlog/cloneTargetDir.ts
|
|
9998
|
-
import { join as
|
|
10143
|
+
import { join as join30, resolve as resolve9 } from "path";
|
|
9999
10144
|
function cloneTargetDir(origin, baseDir) {
|
|
10000
10145
|
if (origin.startsWith("local:")) return null;
|
|
10001
10146
|
const repoName = origin.split("/").filter(Boolean).pop();
|
|
10002
10147
|
if (!repoName) return null;
|
|
10003
|
-
return resolve9(
|
|
10148
|
+
return resolve9(join30(baseDir, repoName));
|
|
10004
10149
|
}
|
|
10005
10150
|
|
|
10006
10151
|
// src/commands/backlog/resolveRepoLocation.ts
|
|
@@ -10008,7 +10153,7 @@ function resolveRepoLocation(origin, knownCwd, baseDir) {
|
|
|
10008
10153
|
if (knownCwd) return { cwd: knownCwd };
|
|
10009
10154
|
const target = cloneTargetDir(origin, baseDir);
|
|
10010
10155
|
if (!target) return {};
|
|
10011
|
-
if (
|
|
10156
|
+
if (existsSync31(target) && getCurrentOrigin(target) === origin)
|
|
10012
10157
|
return { cwd: target };
|
|
10013
10158
|
return { cloneTarget: target };
|
|
10014
10159
|
}
|
|
@@ -10849,7 +10994,7 @@ async function getBackups(_req, res) {
|
|
|
10849
10994
|
}
|
|
10850
10995
|
|
|
10851
10996
|
// src/shared/globalConfigTargetFor.ts
|
|
10852
|
-
import { existsSync as
|
|
10997
|
+
import { existsSync as existsSync32 } from "fs";
|
|
10853
10998
|
import { posix as posix2 } from "path";
|
|
10854
10999
|
|
|
10855
11000
|
// src/shared/windowsHomeFromWsl.ts
|
|
@@ -10870,7 +11015,7 @@ function globalConfigTargetFor(cwd) {
|
|
|
10870
11015
|
ok: false,
|
|
10871
11016
|
error: `${cwd} runs on the Windows host, whose ~/.assist.yml cannot be located because sessions.windowsProjectsRoot is unset. Set it with: assist config set sessions.windowsProjectsRoot /mnt/c/Users/<you>/.claude/projects`
|
|
10872
11017
|
};
|
|
10873
|
-
if (!
|
|
11018
|
+
if (!existsSync32(winHome))
|
|
10874
11019
|
return {
|
|
10875
11020
|
ok: false,
|
|
10876
11021
|
error: `${cwd} runs on the Windows host, whose home ${winHome} is not reachable from here. Check that the Windows drive is mounted and sessions.windowsProjectsRoot points at it.`
|
|
@@ -11214,20 +11359,20 @@ function handleServerRuns(req, res) {
|
|
|
11214
11359
|
|
|
11215
11360
|
// src/commands/sessions/web/getReviewSynthesis.ts
|
|
11216
11361
|
import { execFile as execFile4 } from "child_process";
|
|
11217
|
-
import { readFileSync as
|
|
11362
|
+
import { readFileSync as readFileSync22 } from "fs";
|
|
11218
11363
|
import { homedir as homedir13 } from "os";
|
|
11219
|
-
import { basename as
|
|
11364
|
+
import { basename as basename11, join as join32 } from "path";
|
|
11220
11365
|
import { promisify as promisify3 } from "util";
|
|
11221
11366
|
|
|
11222
11367
|
// src/commands/sessions/web/findSynthesisForBranch.ts
|
|
11223
|
-
import { existsSync as
|
|
11224
|
-
import { basename as
|
|
11368
|
+
import { existsSync as existsSync33, readdirSync as readdirSync3, statSync as statSync4 } from "fs";
|
|
11369
|
+
import { basename as basename10, dirname as dirname22, join as join31 } from "path";
|
|
11225
11370
|
function findSynthesisForBranch(repoReviewsDir, branch2) {
|
|
11226
|
-
const branchKeyPath =
|
|
11227
|
-
const parent =
|
|
11228
|
-
const branchPrefix =
|
|
11229
|
-
if (!
|
|
11230
|
-
const synthesisFiles =
|
|
11371
|
+
const branchKeyPath = join31(repoReviewsDir, `${branch2}-`);
|
|
11372
|
+
const parent = dirname22(branchKeyPath);
|
|
11373
|
+
const branchPrefix = basename10(branchKeyPath);
|
|
11374
|
+
if (!existsSync33(parent)) return null;
|
|
11375
|
+
const synthesisFiles = readdirSync3(parent).filter((name) => name.startsWith(branchPrefix)).map((name) => join31(parent, name, "synthesis.md")).filter((path91) => existsSync33(path91)).map((path91) => ({ path: path91, mtime: statSync4(path91).mtimeMs })).sort((a, b) => b.mtime - a.mtime);
|
|
11231
11376
|
return synthesisFiles[0]?.path ?? null;
|
|
11232
11377
|
}
|
|
11233
11378
|
|
|
@@ -11245,11 +11390,11 @@ async function resolveSynthesisPath(cwd) {
|
|
|
11245
11390
|
runGit2(cwd, ["rev-parse", "--show-toplevel"]),
|
|
11246
11391
|
runGit2(cwd, ["rev-parse", "--abbrev-ref", "HEAD"])
|
|
11247
11392
|
]);
|
|
11248
|
-
const repoReviewsDir =
|
|
11393
|
+
const repoReviewsDir = join32(
|
|
11249
11394
|
homedir13(),
|
|
11250
11395
|
".assist",
|
|
11251
11396
|
"reviews",
|
|
11252
|
-
|
|
11397
|
+
basename11(repoRoot2)
|
|
11253
11398
|
);
|
|
11254
11399
|
return findSynthesisForBranch(repoReviewsDir, branch2);
|
|
11255
11400
|
}
|
|
@@ -11262,7 +11407,7 @@ async function getReviewSynthesis(req, res) {
|
|
|
11262
11407
|
respondJson(res, 404, { error: "No synthesis found" });
|
|
11263
11408
|
return;
|
|
11264
11409
|
}
|
|
11265
|
-
respondJson(res, 200, { synthesis:
|
|
11410
|
+
respondJson(res, 200, { synthesis: readFileSync22(path91, "utf8") });
|
|
11266
11411
|
} catch {
|
|
11267
11412
|
respondJson(res, 404, { error: "No synthesis found" });
|
|
11268
11413
|
}
|
|
@@ -11485,8 +11630,8 @@ function subsequenceScore(text18, query) {
|
|
|
11485
11630
|
function scoreFilePath(path91, query) {
|
|
11486
11631
|
const needle = query.trim().toLowerCase();
|
|
11487
11632
|
if (!needle) return 0;
|
|
11488
|
-
const
|
|
11489
|
-
const inBasename = subsequenceScore(
|
|
11633
|
+
const basename29 = path91.slice(path91.lastIndexOf("/") + 1);
|
|
11634
|
+
const inBasename = subsequenceScore(basename29, needle);
|
|
11490
11635
|
if (inBasename !== null) return BASENAME_WEIGHT + inBasename;
|
|
11491
11636
|
return subsequenceScore(path91, needle);
|
|
11492
11637
|
}
|
|
@@ -11658,7 +11803,7 @@ async function listNewsItems(_req, res) {
|
|
|
11658
11803
|
import path33 from "path";
|
|
11659
11804
|
|
|
11660
11805
|
// src/commands/rules/readScopedRules.ts
|
|
11661
|
-
import { existsSync as
|
|
11806
|
+
import { existsSync as existsSync35, readFileSync as readFileSync23 } from "fs";
|
|
11662
11807
|
import path32 from "path";
|
|
11663
11808
|
|
|
11664
11809
|
// src/commands/rules/rulesSectionRange.ts
|
|
@@ -11707,11 +11852,11 @@ function parseRulesSection(content) {
|
|
|
11707
11852
|
}
|
|
11708
11853
|
|
|
11709
11854
|
// src/commands/rules/scopeDirectory.ts
|
|
11710
|
-
import { existsSync as
|
|
11855
|
+
import { existsSync as existsSync34, statSync as statSync5 } from "fs";
|
|
11711
11856
|
import path31 from "path";
|
|
11712
11857
|
function scopeDirectory(target) {
|
|
11713
11858
|
const resolved = path31.resolve(target);
|
|
11714
|
-
return
|
|
11859
|
+
return existsSync34(resolved) && statSync5(resolved).isDirectory() ? resolved : path31.dirname(resolved);
|
|
11715
11860
|
}
|
|
11716
11861
|
|
|
11717
11862
|
// src/commands/rules/readScopedRules.ts
|
|
@@ -11722,7 +11867,7 @@ function scopedClaudeFiles(target) {
|
|
|
11722
11867
|
let current = startDir;
|
|
11723
11868
|
while (true) {
|
|
11724
11869
|
const candidate = path32.join(current, "CLAUDE.md");
|
|
11725
|
-
if (
|
|
11870
|
+
if (existsSync35(candidate)) files.push(candidate);
|
|
11726
11871
|
if (current === root || current === path32.dirname(current)) break;
|
|
11727
11872
|
current = path32.dirname(current);
|
|
11728
11873
|
}
|
|
@@ -11730,7 +11875,7 @@ function scopedClaudeFiles(target) {
|
|
|
11730
11875
|
}
|
|
11731
11876
|
function readScopedRules(target) {
|
|
11732
11877
|
return scopedClaudeFiles(target).flatMap(
|
|
11733
|
-
(source) => parseRulesSection(
|
|
11878
|
+
(source) => parseRulesSection(readFileSync23(source, "utf8")).map((rule) => ({
|
|
11734
11879
|
...rule,
|
|
11735
11880
|
source
|
|
11736
11881
|
}))
|
|
@@ -13023,7 +13168,7 @@ function uploadSizeLimit(contentType) {
|
|
|
13023
13168
|
// src/commands/sessions/web/writeTempImage.ts
|
|
13024
13169
|
import { mkdtemp, writeFile as writeFile2 } from "fs/promises";
|
|
13025
13170
|
import { tmpdir } from "os";
|
|
13026
|
-
import { extname, join as
|
|
13171
|
+
import { extname, join as join33 } from "path";
|
|
13027
13172
|
var EXT_BY_MIME = {
|
|
13028
13173
|
"image/png": "png",
|
|
13029
13174
|
"image/jpeg": "jpg",
|
|
@@ -13054,8 +13199,8 @@ function safeBaseName(name) {
|
|
|
13054
13199
|
return base.replace(/^-+|-+$/g, "").slice(0, 60) || "screenshot";
|
|
13055
13200
|
}
|
|
13056
13201
|
async function writeTempImage(name, contentType, body) {
|
|
13057
|
-
const dir = await mkdtemp(
|
|
13058
|
-
const filePath =
|
|
13202
|
+
const dir = await mkdtemp(join33(tmpdir(), "assist-pr-img-"));
|
|
13203
|
+
const filePath = join33(
|
|
13059
13204
|
dir,
|
|
13060
13205
|
`${safeBaseName(name)}.${pickExtension(name, contentType)}`
|
|
13061
13206
|
);
|
|
@@ -13106,17 +13251,17 @@ import { readFile as readFile2, stat as stat3, writeFile as writeFile3 } from "f
|
|
|
13106
13251
|
|
|
13107
13252
|
// src/commands/sessions/web/formatWithOxfmt.ts
|
|
13108
13253
|
import { execFile as execFile8 } from "child_process";
|
|
13109
|
-
import { existsSync as
|
|
13110
|
-
import { dirname as
|
|
13254
|
+
import { existsSync as existsSync36 } from "fs";
|
|
13255
|
+
import { dirname as dirname23, join as join34 } from "path";
|
|
13111
13256
|
import { promisify as promisify8 } from "util";
|
|
13112
13257
|
var execFileAsync7 = promisify8(execFile8);
|
|
13113
13258
|
var TIMEOUT_MS = 15e3;
|
|
13114
13259
|
function findOxfmtScript(root) {
|
|
13115
13260
|
let dir = root;
|
|
13116
13261
|
for (; ; ) {
|
|
13117
|
-
const candidate =
|
|
13118
|
-
if (
|
|
13119
|
-
const parent =
|
|
13262
|
+
const candidate = join34(dir, "node_modules", "oxfmt", "bin", "oxfmt");
|
|
13263
|
+
if (existsSync36(candidate)) return candidate;
|
|
13264
|
+
const parent = dirname23(dir);
|
|
13120
13265
|
if (parent === dir) return void 0;
|
|
13121
13266
|
dir = parent;
|
|
13122
13267
|
}
|
|
@@ -13186,7 +13331,7 @@ async function writeFileContent(req, res) {
|
|
|
13186
13331
|
|
|
13187
13332
|
// src/commands/sessions/web/createCssHandler.ts
|
|
13188
13333
|
import { createHash as createHash2 } from "crypto";
|
|
13189
|
-
import { readFileSync as
|
|
13334
|
+
import { readFileSync as readFileSync24 } from "fs";
|
|
13190
13335
|
import { createRequire as createRequire2 } from "module";
|
|
13191
13336
|
var require3 = createRequire2(import.meta.url);
|
|
13192
13337
|
function createCssHandler(packageEntry) {
|
|
@@ -13194,7 +13339,7 @@ function createCssHandler(packageEntry) {
|
|
|
13194
13339
|
return (req, res) => {
|
|
13195
13340
|
if (!cache5) {
|
|
13196
13341
|
const resolved = require3.resolve(packageEntry);
|
|
13197
|
-
const body =
|
|
13342
|
+
const body = readFileSync24(resolved, "utf8");
|
|
13198
13343
|
const etag = `"${createHash2("sha256").update(body).digest("hex").slice(0, 16)}"`;
|
|
13199
13344
|
cache5 = { body, etag };
|
|
13200
13345
|
}
|
|
@@ -14007,7 +14152,7 @@ function registerAssociateJiraCommand(cmd) {
|
|
|
14007
14152
|
|
|
14008
14153
|
// src/commands/backlog/cloneRepo.ts
|
|
14009
14154
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
14010
|
-
import { existsSync as
|
|
14155
|
+
import { existsSync as existsSync38 } from "fs";
|
|
14011
14156
|
import { mkdir as mkdir3 } from "fs/promises";
|
|
14012
14157
|
import chalk69 from "chalk";
|
|
14013
14158
|
|
|
@@ -14043,7 +14188,7 @@ async function cloneRepo(originRaw) {
|
|
|
14043
14188
|
if (!target) {
|
|
14044
14189
|
return fail2(`Could not derive a repository name from "${origin}".`);
|
|
14045
14190
|
}
|
|
14046
|
-
if (
|
|
14191
|
+
if (existsSync38(target)) {
|
|
14047
14192
|
return fail2(`Clone target already exists: ${target}`);
|
|
14048
14193
|
}
|
|
14049
14194
|
await mkdir3(baseDir, { recursive: true });
|
|
@@ -14595,9 +14740,9 @@ function ensureRemoteOrigin() {
|
|
|
14595
14740
|
|
|
14596
14741
|
// src/commands/backlog/add/shared.ts
|
|
14597
14742
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
14598
|
-
import { mkdtempSync, readFileSync as
|
|
14743
|
+
import { mkdtempSync, readFileSync as readFileSync25, unlinkSync as unlinkSync6, writeFileSync as writeFileSync21 } from "fs";
|
|
14599
14744
|
import { tmpdir as tmpdir2 } from "os";
|
|
14600
|
-
import { join as
|
|
14745
|
+
import { join as join38 } from "path";
|
|
14601
14746
|
import enquirer6 from "enquirer";
|
|
14602
14747
|
async function promptType() {
|
|
14603
14748
|
const { type } = await enquirer6.prompt({
|
|
@@ -14637,15 +14782,15 @@ async function promptDescription() {
|
|
|
14637
14782
|
}
|
|
14638
14783
|
function openEditor() {
|
|
14639
14784
|
const editor = process.env.EDITOR || process.env.VISUAL || "vi";
|
|
14640
|
-
const dir = mkdtempSync(
|
|
14641
|
-
const filePath =
|
|
14785
|
+
const dir = mkdtempSync(join38(tmpdir2(), "assist-"));
|
|
14786
|
+
const filePath = join38(dir, "description.md");
|
|
14642
14787
|
writeFileSync21(filePath, "");
|
|
14643
14788
|
const result = spawnSync3(editor, [filePath], { stdio: "inherit" });
|
|
14644
14789
|
if (result.status !== 0) {
|
|
14645
14790
|
unlinkSync6(filePath);
|
|
14646
14791
|
return void 0;
|
|
14647
14792
|
}
|
|
14648
|
-
const content =
|
|
14793
|
+
const content = readFileSync25(filePath, "utf8").trim();
|
|
14649
14794
|
unlinkSync6(filePath);
|
|
14650
14795
|
return content || void 0;
|
|
14651
14796
|
}
|
|
@@ -14821,7 +14966,7 @@ async function list2(options2) {
|
|
|
14821
14966
|
import chalk82 from "chalk";
|
|
14822
14967
|
|
|
14823
14968
|
// src/commands/backlog/readJsonPayload.ts
|
|
14824
|
-
import { readFileSync as
|
|
14969
|
+
import { readFileSync as readFileSync26 } from "fs";
|
|
14825
14970
|
import chalk80 from "chalk";
|
|
14826
14971
|
function fail3(message3) {
|
|
14827
14972
|
console.error(chalk80.red(message3));
|
|
@@ -14833,7 +14978,7 @@ function describe(error) {
|
|
|
14833
14978
|
async function readSource(source) {
|
|
14834
14979
|
try {
|
|
14835
14980
|
if (source === "-") return (await readStdinBuffer()).toString("utf8");
|
|
14836
|
-
return
|
|
14981
|
+
return readFileSync26(source, "utf8");
|
|
14837
14982
|
} catch (error) {
|
|
14838
14983
|
return fail3(
|
|
14839
14984
|
`Cannot read the payload from ${source === "-" ? "stdin" : source}: ${describe(error)}`
|
|
@@ -16660,7 +16805,7 @@ function registerBranch(program2) {
|
|
|
16660
16805
|
}
|
|
16661
16806
|
|
|
16662
16807
|
// src/commands/cliHook/index.ts
|
|
16663
|
-
import { basename as
|
|
16808
|
+
import { basename as basename13 } from "path";
|
|
16664
16809
|
|
|
16665
16810
|
// src/shared/splitCompound.ts
|
|
16666
16811
|
import { parse } from "shell-quote";
|
|
@@ -17226,17 +17371,17 @@ function extractGraphqlQuery(args) {
|
|
|
17226
17371
|
}
|
|
17227
17372
|
|
|
17228
17373
|
// src/shared/loadCliReads.ts
|
|
17229
|
-
import { existsSync as
|
|
17230
|
-
import { dirname as
|
|
17231
|
-
import { fileURLToPath as
|
|
17232
|
-
var __filename3 =
|
|
17233
|
-
var __dirname4 =
|
|
17374
|
+
import { existsSync as existsSync39, readFileSync as readFileSync27, writeFileSync as writeFileSync22 } from "fs";
|
|
17375
|
+
import { dirname as dirname24, resolve as resolve12 } from "path";
|
|
17376
|
+
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
17377
|
+
var __filename3 = fileURLToPath6(import.meta.url);
|
|
17378
|
+
var __dirname4 = dirname24(__filename3);
|
|
17234
17379
|
function packageRoot() {
|
|
17235
17380
|
return __dirname4;
|
|
17236
17381
|
}
|
|
17237
17382
|
function readLines(path91) {
|
|
17238
|
-
if (!
|
|
17239
|
-
return
|
|
17383
|
+
if (!existsSync39(path91)) return [];
|
|
17384
|
+
return readFileSync27(path91, "utf8").split("\n").filter((line) => line.trim() !== "");
|
|
17240
17385
|
}
|
|
17241
17386
|
var cachedReads;
|
|
17242
17387
|
var cachedWrites;
|
|
@@ -17282,14 +17427,14 @@ function findCliWrite(command) {
|
|
|
17282
17427
|
}
|
|
17283
17428
|
|
|
17284
17429
|
// src/shared/readSettingsPerms.ts
|
|
17285
|
-
import { existsSync as
|
|
17430
|
+
import { existsSync as existsSync40, readFileSync as readFileSync28 } from "fs";
|
|
17286
17431
|
import { homedir as homedir15 } from "os";
|
|
17287
|
-
import { join as
|
|
17432
|
+
import { join as join39 } from "path";
|
|
17288
17433
|
function readSettingsPerms(key) {
|
|
17289
17434
|
const paths = [
|
|
17290
|
-
|
|
17291
|
-
|
|
17292
|
-
|
|
17435
|
+
join39(homedir15(), ".claude", "settings.json"),
|
|
17436
|
+
join39(process.cwd(), ".claude", "settings.json"),
|
|
17437
|
+
join39(process.cwd(), ".claude", "settings.local.json")
|
|
17293
17438
|
];
|
|
17294
17439
|
const entries = [];
|
|
17295
17440
|
for (const p of paths) {
|
|
@@ -17298,9 +17443,9 @@ function readSettingsPerms(key) {
|
|
|
17298
17443
|
return entries;
|
|
17299
17444
|
}
|
|
17300
17445
|
function readPermissionArray(filePath, key) {
|
|
17301
|
-
if (!
|
|
17446
|
+
if (!existsSync40(filePath)) return [];
|
|
17302
17447
|
try {
|
|
17303
|
-
const data = JSON.parse(
|
|
17448
|
+
const data = JSON.parse(readFileSync28(filePath, "utf8"));
|
|
17304
17449
|
const arr = data?.permissions?.[key];
|
|
17305
17450
|
return Array.isArray(arr) ? arr.filter((e) => typeof e === "string") : [];
|
|
17306
17451
|
} catch {
|
|
@@ -17505,11 +17650,11 @@ function decideCommand(toolName, rawCommand) {
|
|
|
17505
17650
|
// src/commands/cliHook/logDeniedToolCall.ts
|
|
17506
17651
|
import { mkdirSync as mkdirSync12 } from "fs";
|
|
17507
17652
|
import { homedir as homedir16 } from "os";
|
|
17508
|
-
import { join as
|
|
17653
|
+
import { join as join40 } from "path";
|
|
17509
17654
|
import Database from "better-sqlite3";
|
|
17510
17655
|
var _db;
|
|
17511
17656
|
function getDbDir() {
|
|
17512
|
-
return
|
|
17657
|
+
return join40(homedir16(), ".assist");
|
|
17513
17658
|
}
|
|
17514
17659
|
function initSchema(db) {
|
|
17515
17660
|
db.exec(`
|
|
@@ -17528,7 +17673,7 @@ function openPromptsDb(dir) {
|
|
|
17528
17673
|
if (_db) return _db;
|
|
17529
17674
|
const dbDir = dir ?? getDbDir();
|
|
17530
17675
|
mkdirSync12(dbDir, { recursive: true });
|
|
17531
|
-
const db = new Database(
|
|
17676
|
+
const db = new Database(join40(dbDir, "assist.db"));
|
|
17532
17677
|
db.pragma("journal_mode = WAL");
|
|
17533
17678
|
initSchema(db);
|
|
17534
17679
|
_db = db;
|
|
@@ -17599,7 +17744,7 @@ async function cliHook() {
|
|
|
17599
17744
|
logDeniedToolCall({
|
|
17600
17745
|
tool: input.toolName,
|
|
17601
17746
|
command: input.command,
|
|
17602
|
-
repo:
|
|
17747
|
+
repo: basename13(process.cwd()),
|
|
17603
17748
|
sessionId: process.env.CLAUDE_SESSION_ID,
|
|
17604
17749
|
denyReason: decision.permissionDecisionReason
|
|
17605
17750
|
});
|
|
@@ -17647,9 +17792,9 @@ ${reasons.join("\n")}`);
|
|
|
17647
17792
|
}
|
|
17648
17793
|
|
|
17649
17794
|
// src/commands/permitCliReads/index.ts
|
|
17650
|
-
import { existsSync as
|
|
17795
|
+
import { existsSync as existsSync41, mkdirSync as mkdirSync13, readFileSync as readFileSync29, writeFileSync as writeFileSync23 } from "fs";
|
|
17651
17796
|
import { homedir as homedir17 } from "os";
|
|
17652
|
-
import { join as
|
|
17797
|
+
import { join as join41 } from "path";
|
|
17653
17798
|
|
|
17654
17799
|
// src/commands/permitCliReads/assertCliExists.ts
|
|
17655
17800
|
function assertCliExists(cli) {
|
|
@@ -17912,15 +18057,15 @@ function updateSettings(cli, commands) {
|
|
|
17912
18057
|
// src/commands/permitCliReads/index.ts
|
|
17913
18058
|
function logPath(cli) {
|
|
17914
18059
|
const safeName = cli.replace(/\s+/g, "-");
|
|
17915
|
-
return
|
|
18060
|
+
return join41(homedir17(), ".assist", `cli-discover-${safeName}.log`);
|
|
17916
18061
|
}
|
|
17917
18062
|
function readCache(cli) {
|
|
17918
18063
|
const path91 = logPath(cli);
|
|
17919
|
-
if (!
|
|
17920
|
-
return
|
|
18064
|
+
if (!existsSync41(path91)) return void 0;
|
|
18065
|
+
return readFileSync29(path91, "utf8");
|
|
17921
18066
|
}
|
|
17922
18067
|
function writeCache(cli, output) {
|
|
17923
|
-
const dir =
|
|
18068
|
+
const dir = join41(homedir17(), ".assist");
|
|
17924
18069
|
mkdirSync13(dir, { recursive: true });
|
|
17925
18070
|
writeFileSync23(logPath(cli), output);
|
|
17926
18071
|
}
|
|
@@ -18051,33 +18196,33 @@ function registerCliHook(program2) {
|
|
|
18051
18196
|
}
|
|
18052
18197
|
|
|
18053
18198
|
// src/commands/codeComment/codeCommentConfirm.ts
|
|
18054
|
-
import { existsSync as
|
|
18199
|
+
import { existsSync as existsSync43, readFileSync as readFileSync31, unlinkSync as unlinkSync8, writeFileSync as writeFileSync24 } from "fs";
|
|
18055
18200
|
import chalk121 from "chalk";
|
|
18056
18201
|
|
|
18057
18202
|
// src/commands/codeComment/getRestrictedDir.ts
|
|
18058
18203
|
import { homedir as homedir18 } from "os";
|
|
18059
|
-
import { join as
|
|
18204
|
+
import { join as join42 } from "path";
|
|
18060
18205
|
function getRestrictedDir() {
|
|
18061
|
-
return
|
|
18206
|
+
return join42(homedir18(), ".assist", "restricted");
|
|
18062
18207
|
}
|
|
18063
18208
|
function getPinStatePath(pin) {
|
|
18064
|
-
return
|
|
18209
|
+
return join42(getRestrictedDir(), `code-comment-${pin}.json`);
|
|
18065
18210
|
}
|
|
18066
18211
|
|
|
18067
18212
|
// src/commands/codeComment/sweepRestrictedDir.ts
|
|
18068
|
-
import { readdirSync as
|
|
18069
|
-
import { join as
|
|
18213
|
+
import { readdirSync as readdirSync6, statSync as statSync7, unlinkSync as unlinkSync7 } from "fs";
|
|
18214
|
+
import { join as join43 } from "path";
|
|
18070
18215
|
var STALE_AFTER_MS = 30 * 60 * 1e3;
|
|
18071
18216
|
function sweepRestrictedDir(dir = getRestrictedDir()) {
|
|
18072
18217
|
let entries;
|
|
18073
18218
|
try {
|
|
18074
|
-
entries =
|
|
18219
|
+
entries = readdirSync6(dir);
|
|
18075
18220
|
} catch {
|
|
18076
18221
|
return;
|
|
18077
18222
|
}
|
|
18078
18223
|
const cutoff = Date.now() - STALE_AFTER_MS;
|
|
18079
18224
|
for (const entry of entries) {
|
|
18080
|
-
const path91 =
|
|
18225
|
+
const path91 = join43(dir, entry);
|
|
18081
18226
|
try {
|
|
18082
18227
|
if (statSync7(path91).mtimeMs < cutoff) unlinkSync7(path91);
|
|
18083
18228
|
} catch {
|
|
@@ -18087,12 +18232,12 @@ function sweepRestrictedDir(dir = getRestrictedDir()) {
|
|
|
18087
18232
|
}
|
|
18088
18233
|
|
|
18089
18234
|
// src/commands/codeComment/readPinState.ts
|
|
18090
|
-
import { existsSync as
|
|
18235
|
+
import { existsSync as existsSync42, readFileSync as readFileSync30 } from "fs";
|
|
18091
18236
|
function readPinState(pin) {
|
|
18092
18237
|
const path91 = getPinStatePath(pin);
|
|
18093
|
-
if (!
|
|
18238
|
+
if (!existsSync42(path91)) return void 0;
|
|
18094
18239
|
try {
|
|
18095
|
-
const state = JSON.parse(
|
|
18240
|
+
const state = JSON.parse(readFileSync30(path91, "utf8"));
|
|
18096
18241
|
if (state.pin !== pin) return void 0;
|
|
18097
18242
|
return state;
|
|
18098
18243
|
} catch {
|
|
@@ -18109,12 +18254,12 @@ function codeCommentConfirm(pin) {
|
|
|
18109
18254
|
process.exitCode = 1;
|
|
18110
18255
|
return;
|
|
18111
18256
|
}
|
|
18112
|
-
if (!
|
|
18257
|
+
if (!existsSync43(state.file)) {
|
|
18113
18258
|
console.error(chalk121.red(`Target file no longer exists: ${state.file}`));
|
|
18114
18259
|
process.exitCode = 1;
|
|
18115
18260
|
return;
|
|
18116
18261
|
}
|
|
18117
|
-
const original =
|
|
18262
|
+
const original = readFileSync31(state.file, "utf8");
|
|
18118
18263
|
const lines2 = original.split("\n");
|
|
18119
18264
|
const index3 = state.line - 1;
|
|
18120
18265
|
if (index3 > lines2.length) {
|
|
@@ -18431,9 +18576,9 @@ function findUnmergedPaths() {
|
|
|
18431
18576
|
}
|
|
18432
18577
|
|
|
18433
18578
|
// src/commands/commit/abortOnConflicts.ts
|
|
18434
|
-
function abort(headline2,
|
|
18579
|
+
function abort(headline2, guidance) {
|
|
18435
18580
|
console.error(`Error: refusing to commit \u2014 ${headline2}`);
|
|
18436
|
-
console.error(
|
|
18581
|
+
console.error(guidance);
|
|
18437
18582
|
console.error("Nothing was committed or pushed.");
|
|
18438
18583
|
process.exit(1);
|
|
18439
18584
|
}
|
|
@@ -19619,19 +19764,19 @@ import { cp } from "fs/promises";
|
|
|
19619
19764
|
import chalk139 from "chalk";
|
|
19620
19765
|
|
|
19621
19766
|
// src/commands/criteriaExtension/criteriaExtensionDir.ts
|
|
19622
|
-
import { existsSync as
|
|
19623
|
-
import { dirname as
|
|
19624
|
-
import { fileURLToPath as
|
|
19625
|
-
var moduleDir =
|
|
19767
|
+
import { existsSync as existsSync44 } from "fs";
|
|
19768
|
+
import { dirname as dirname25, join as join44 } from "path";
|
|
19769
|
+
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
19770
|
+
var moduleDir = dirname25(fileURLToPath7(import.meta.url));
|
|
19626
19771
|
function criteriaExtensionDir() {
|
|
19627
|
-
const bundled =
|
|
19772
|
+
const bundled = join44(
|
|
19628
19773
|
moduleDir,
|
|
19629
19774
|
"commands",
|
|
19630
19775
|
"criteriaExtension",
|
|
19631
19776
|
"criteria-extension"
|
|
19632
19777
|
);
|
|
19633
|
-
if (
|
|
19634
|
-
return
|
|
19778
|
+
if (existsSync44(bundled)) return bundled;
|
|
19779
|
+
return join44(moduleDir, "..", "..", "..", "criteria-extension");
|
|
19635
19780
|
}
|
|
19636
19781
|
|
|
19637
19782
|
// src/commands/criteriaExtension/criteriaExtension.ts
|
|
@@ -19660,28 +19805,28 @@ async function criteriaExtension() {
|
|
|
19660
19805
|
// src/commands/criteriaExtension/signCriteriaExtension.ts
|
|
19661
19806
|
import { rm as rm3 } from "fs/promises";
|
|
19662
19807
|
import { homedir as homedir19, tmpdir as tmpdir4 } from "os";
|
|
19663
|
-
import { join as
|
|
19808
|
+
import { join as join49 } from "path";
|
|
19664
19809
|
import chalk141 from "chalk";
|
|
19665
19810
|
|
|
19666
19811
|
// src/commands/criteriaExtension/copySignedXpi.ts
|
|
19667
19812
|
import { copyFile } from "fs/promises";
|
|
19668
|
-
import { join as
|
|
19813
|
+
import { join as join45 } from "path";
|
|
19669
19814
|
var SIGNED_XPI_NAME = "criteria-extension.xpi";
|
|
19670
19815
|
async function copySignedXpi(xpi, dir) {
|
|
19671
|
-
const fixed2 =
|
|
19816
|
+
const fixed2 = join45(dir, SIGNED_XPI_NAME);
|
|
19672
19817
|
if (fixed2 === xpi) return fixed2;
|
|
19673
19818
|
await copyFile(xpi, fixed2);
|
|
19674
19819
|
return fixed2;
|
|
19675
19820
|
}
|
|
19676
19821
|
|
|
19677
19822
|
// src/commands/criteriaExtension/findSignedXpi.ts
|
|
19678
|
-
import { existsSync as
|
|
19823
|
+
import { existsSync as existsSync45 } from "fs";
|
|
19679
19824
|
import { readdir } from "fs/promises";
|
|
19680
|
-
import { join as
|
|
19825
|
+
import { join as join46 } from "path";
|
|
19681
19826
|
async function findSignedXpi(dir) {
|
|
19682
|
-
if (!
|
|
19827
|
+
if (!existsSync45(dir)) return null;
|
|
19683
19828
|
const name = (await readdir(dir)).find((entry) => entry.endsWith(".xpi"));
|
|
19684
|
-
return name ?
|
|
19829
|
+
return name ? join46(dir, name) : null;
|
|
19685
19830
|
}
|
|
19686
19831
|
|
|
19687
19832
|
// src/commands/criteriaExtension/signedAddonInstallPath.ts
|
|
@@ -19703,11 +19848,11 @@ async function signedAddonInstallPath(xpi) {
|
|
|
19703
19848
|
}
|
|
19704
19849
|
|
|
19705
19850
|
// src/commands/criteriaExtension/signPreflightProblem.ts
|
|
19706
|
-
import { existsSync as
|
|
19707
|
-
import { join as
|
|
19851
|
+
import { existsSync as existsSync46 } from "fs";
|
|
19852
|
+
import { join as join47 } from "path";
|
|
19708
19853
|
var KEY_URL = "https://addons.mozilla.org/en-US/developers/addon/api/key/";
|
|
19709
19854
|
function signPreflightProblem(source) {
|
|
19710
|
-
if (!
|
|
19855
|
+
if (!existsSync46(join47(source, "content.js")))
|
|
19711
19856
|
return {
|
|
19712
19857
|
message: `no content.js in ${source}`,
|
|
19713
19858
|
hint: "run npm run build to bundle the content script"
|
|
@@ -19722,7 +19867,7 @@ function signPreflightProblem(source) {
|
|
|
19722
19867
|
|
|
19723
19868
|
// src/commands/criteriaExtension/stageCriteriaExtension.ts
|
|
19724
19869
|
import { cp as cp3, mkdir as mkdir4, readFile as readFile4, rm as rm2, writeFile as writeFile4 } from "fs/promises";
|
|
19725
|
-
import { join as
|
|
19870
|
+
import { join as join48 } from "path";
|
|
19726
19871
|
|
|
19727
19872
|
// src/commands/criteriaExtension/stampManifestVersion.ts
|
|
19728
19873
|
function stampManifestVersion(manifest, version2) {
|
|
@@ -19736,7 +19881,7 @@ async function stageCriteriaExtension(source, staging, version2) {
|
|
|
19736
19881
|
await rm2(staging, { recursive: true, force: true });
|
|
19737
19882
|
await mkdir4(staging, { recursive: true });
|
|
19738
19883
|
await cp3(source, staging, { recursive: true });
|
|
19739
|
-
const manifest =
|
|
19884
|
+
const manifest = join48(staging, "manifest.json");
|
|
19740
19885
|
const stamped = stampManifestVersion(
|
|
19741
19886
|
await readFile4(manifest, "utf8"),
|
|
19742
19887
|
version2
|
|
@@ -19745,8 +19890,8 @@ async function stageCriteriaExtension(source, staging, version2) {
|
|
|
19745
19890
|
}
|
|
19746
19891
|
|
|
19747
19892
|
// src/commands/criteriaExtension/signCriteriaExtension.ts
|
|
19748
|
-
var ARTIFACTS_DIR =
|
|
19749
|
-
var STAGING_DIR =
|
|
19893
|
+
var ARTIFACTS_DIR = join49(homedir19(), ".assist", "criteria-extension");
|
|
19894
|
+
var STAGING_DIR = join49(tmpdir4(), "assist-criteria-extension");
|
|
19750
19895
|
async function signCriteriaExtension() {
|
|
19751
19896
|
const source = criteriaExtensionDir();
|
|
19752
19897
|
const problem = signPreflightProblem(source);
|
|
@@ -19869,21 +20014,21 @@ import { unlinkSync as unlinkSync9, writeFileSync as writeFileSync26 } from "fs"
|
|
|
19869
20014
|
import chalk143 from "chalk";
|
|
19870
20015
|
|
|
19871
20016
|
// src/commands/dbMigration/getMigrationPinPath.ts
|
|
19872
|
-
import { join as
|
|
20017
|
+
import { join as join50 } from "path";
|
|
19873
20018
|
function getMigrationPinPath(pin) {
|
|
19874
|
-
return
|
|
20019
|
+
return join50(getRestrictedDir(), `db-migration-pin-${pin}.json`);
|
|
19875
20020
|
}
|
|
19876
20021
|
function getMigrationApprovalPath(migrationId) {
|
|
19877
|
-
return
|
|
20022
|
+
return join50(getRestrictedDir(), `db-migration-approval-${migrationId}.json`);
|
|
19878
20023
|
}
|
|
19879
20024
|
|
|
19880
20025
|
// src/commands/dbMigration/readMigrationPinState.ts
|
|
19881
|
-
import { existsSync as
|
|
20026
|
+
import { existsSync as existsSync47, readFileSync as readFileSync32 } from "fs";
|
|
19882
20027
|
function readMigrationPinState(pin) {
|
|
19883
20028
|
const path91 = getMigrationPinPath(pin);
|
|
19884
|
-
if (!
|
|
20029
|
+
if (!existsSync47(path91)) return void 0;
|
|
19885
20030
|
try {
|
|
19886
|
-
const state = JSON.parse(
|
|
20031
|
+
const state = JSON.parse(readFileSync32(path91, "utf8"));
|
|
19887
20032
|
if (state.pin !== pin) return void 0;
|
|
19888
20033
|
if (!Number.isInteger(state.migrationId)) return void 0;
|
|
19889
20034
|
return state;
|
|
@@ -19970,7 +20115,7 @@ function registerDbMigration(parent) {
|
|
|
19970
20115
|
}
|
|
19971
20116
|
|
|
19972
20117
|
// src/commands/deploy/redirect.ts
|
|
19973
|
-
import { existsSync as
|
|
20118
|
+
import { existsSync as existsSync48, readFileSync as readFileSync33, writeFileSync as writeFileSync28 } from "fs";
|
|
19974
20119
|
import chalk145 from "chalk";
|
|
19975
20120
|
var TRAILING_SLASH_SCRIPT = ` <script>
|
|
19976
20121
|
if (!window.location.pathname.endsWith('/')) {
|
|
@@ -19979,11 +20124,11 @@ var TRAILING_SLASH_SCRIPT = ` <script>
|
|
|
19979
20124
|
</script>`;
|
|
19980
20125
|
function redirect() {
|
|
19981
20126
|
const indexPath = "index.html";
|
|
19982
|
-
if (!
|
|
20127
|
+
if (!existsSync48(indexPath)) {
|
|
19983
20128
|
console.log(chalk145.yellow("No index.html found"));
|
|
19984
20129
|
return;
|
|
19985
20130
|
}
|
|
19986
|
-
const content =
|
|
20131
|
+
const content = readFileSync33(indexPath, "utf8");
|
|
19987
20132
|
if (content.includes("window.location.pathname.endsWith('/')")) {
|
|
19988
20133
|
console.log(chalk145.dim("Trailing slash script already present"));
|
|
19989
20134
|
return;
|
|
@@ -20008,14 +20153,14 @@ function registerDeploy(program2) {
|
|
|
20008
20153
|
|
|
20009
20154
|
// src/commands/devlog/list/index.ts
|
|
20010
20155
|
import { execFileSync as execFileSync3 } from "child_process";
|
|
20011
|
-
import { basename as
|
|
20156
|
+
import { basename as basename15 } from "path";
|
|
20012
20157
|
|
|
20013
20158
|
// src/commands/devlog/loadBlogSkipDays.ts
|
|
20014
20159
|
import { homedir as homedir20 } from "os";
|
|
20015
|
-
import { join as
|
|
20016
|
-
var BLOG_REPO_ROOT =
|
|
20160
|
+
import { join as join51 } from "path";
|
|
20161
|
+
var BLOG_REPO_ROOT = join51(homedir20(), "git/blog");
|
|
20017
20162
|
function loadBlogSkipDays(repoName) {
|
|
20018
|
-
const config = loadRawYaml(
|
|
20163
|
+
const config = loadRawYaml(join51(BLOG_REPO_ROOT, "assist.yml"));
|
|
20019
20164
|
const devlog = config.devlog;
|
|
20020
20165
|
const skip2 = devlog?.skip;
|
|
20021
20166
|
return new Set(skip2?.[repoName]);
|
|
@@ -20026,17 +20171,17 @@ import { execSync as execSync37 } from "child_process";
|
|
|
20026
20171
|
import chalk146 from "chalk";
|
|
20027
20172
|
|
|
20028
20173
|
// src/shared/getRepoName.ts
|
|
20029
|
-
import { existsSync as
|
|
20030
|
-
import { basename as
|
|
20174
|
+
import { existsSync as existsSync49, readFileSync as readFileSync34 } from "fs";
|
|
20175
|
+
import { basename as basename14, join as join52 } from "path";
|
|
20031
20176
|
function getRepoName() {
|
|
20032
20177
|
const config = loadConfig();
|
|
20033
20178
|
if (config.devlog?.name) {
|
|
20034
20179
|
return config.devlog.name;
|
|
20035
20180
|
}
|
|
20036
|
-
const packageJsonPath =
|
|
20037
|
-
if (
|
|
20181
|
+
const packageJsonPath = join52(process.cwd(), "package.json");
|
|
20182
|
+
if (existsSync49(packageJsonPath)) {
|
|
20038
20183
|
try {
|
|
20039
|
-
const content =
|
|
20184
|
+
const content = readFileSync34(packageJsonPath, "utf8");
|
|
20040
20185
|
const pkg = JSON.parse(content);
|
|
20041
20186
|
if (pkg.name) {
|
|
20042
20187
|
return pkg.name;
|
|
@@ -20044,41 +20189,41 @@ function getRepoName() {
|
|
|
20044
20189
|
} catch {
|
|
20045
20190
|
}
|
|
20046
20191
|
}
|
|
20047
|
-
return
|
|
20192
|
+
return basename14(process.cwd());
|
|
20048
20193
|
}
|
|
20049
20194
|
|
|
20050
20195
|
// src/commands/devlog/loadDevlogEntries.ts
|
|
20051
|
-
import { readdirSync as
|
|
20052
|
-
import { join as
|
|
20053
|
-
var DEVLOG_DIR =
|
|
20196
|
+
import { readdirSync as readdirSync7, readFileSync as readFileSync35 } from "fs";
|
|
20197
|
+
import { join as join53 } from "path";
|
|
20198
|
+
var DEVLOG_DIR = join53(BLOG_REPO_ROOT, "src/content/devlog");
|
|
20054
20199
|
function extractFrontmatter(content) {
|
|
20055
20200
|
const fm = content.match(/^---\n([\s\S]*?)\n---/);
|
|
20056
20201
|
return fm?.[1] ?? null;
|
|
20057
20202
|
}
|
|
20058
|
-
function matchField(
|
|
20059
|
-
return
|
|
20203
|
+
function matchField(frontmatter2, pattern2) {
|
|
20204
|
+
return frontmatter2.match(pattern2)?.[1]?.trim() ?? null;
|
|
20060
20205
|
}
|
|
20061
20206
|
function parseFrontmatter(content, filename) {
|
|
20062
|
-
const
|
|
20063
|
-
if (!
|
|
20064
|
-
const date = matchField(
|
|
20065
|
-
const tagsRaw = matchField(
|
|
20207
|
+
const frontmatter2 = extractFrontmatter(content);
|
|
20208
|
+
if (!frontmatter2) return null;
|
|
20209
|
+
const date = matchField(frontmatter2, /date:\s*"?(\d{4}-\d{2}-\d{2})"?/);
|
|
20210
|
+
const tagsRaw = matchField(frontmatter2, /tags:\s*\[([^\]]*)\]/);
|
|
20066
20211
|
if (!date || !tagsRaw) return null;
|
|
20067
20212
|
const repoTag = tagsRaw.split(",")[0]?.trim();
|
|
20068
20213
|
if (!repoTag) return null;
|
|
20069
20214
|
return {
|
|
20070
20215
|
date,
|
|
20071
20216
|
repoTag,
|
|
20072
|
-
version: matchField(
|
|
20073
|
-
title: matchField(
|
|
20217
|
+
version: matchField(frontmatter2, /version:\s*(.+)/),
|
|
20218
|
+
title: matchField(frontmatter2, /title:\s*(.+)/),
|
|
20074
20219
|
filename
|
|
20075
20220
|
};
|
|
20076
20221
|
}
|
|
20077
20222
|
function readDevlogFiles(callback) {
|
|
20078
20223
|
try {
|
|
20079
|
-
const files =
|
|
20224
|
+
const files = readdirSync7(DEVLOG_DIR).filter((f) => f.endsWith(".md"));
|
|
20080
20225
|
for (const file of files) {
|
|
20081
|
-
const content =
|
|
20226
|
+
const content = readFileSync35(join53(DEVLOG_DIR, file), "utf8");
|
|
20082
20227
|
const parsed = parseFrontmatter(content, file);
|
|
20083
20228
|
if (parsed) callback(parsed);
|
|
20084
20229
|
}
|
|
@@ -20180,7 +20325,7 @@ function list3(options2) {
|
|
|
20180
20325
|
const config = loadConfig();
|
|
20181
20326
|
const days = options2.days ?? 30;
|
|
20182
20327
|
const ignore3 = options2.ignore ?? config.devlog?.ignore ?? [];
|
|
20183
|
-
const repoName =
|
|
20328
|
+
const repoName = basename15(process.cwd());
|
|
20184
20329
|
const skipDays = loadBlogSkipDays(repoName);
|
|
20185
20330
|
const devlogEntries = loadDevlogEntries(repoName);
|
|
20186
20331
|
const args = ["log"];
|
|
@@ -20466,11 +20611,11 @@ function repos(options2) {
|
|
|
20466
20611
|
|
|
20467
20612
|
// src/commands/devlog/skip.ts
|
|
20468
20613
|
import { writeFileSync as writeFileSync29 } from "fs";
|
|
20469
|
-
import { join as
|
|
20614
|
+
import { join as join54 } from "path";
|
|
20470
20615
|
import chalk151 from "chalk";
|
|
20471
20616
|
import { stringify as stringifyYaml3 } from "yaml";
|
|
20472
20617
|
function getBlogConfigPath() {
|
|
20473
|
-
return
|
|
20618
|
+
return join54(BLOG_REPO_ROOT, "assist.yml");
|
|
20474
20619
|
}
|
|
20475
20620
|
function skip(date) {
|
|
20476
20621
|
if (!/^\d{4}-\d{2}-\d{2}$/.test(date)) {
|
|
@@ -20531,20 +20676,20 @@ function registerDevlog(program2) {
|
|
|
20531
20676
|
}
|
|
20532
20677
|
|
|
20533
20678
|
// src/commands/dotnet/checkBuildLocks.ts
|
|
20534
|
-
import { closeSync as closeSync3, openSync as openSync3, readdirSync as
|
|
20535
|
-
import { join as
|
|
20679
|
+
import { closeSync as closeSync3, openSync as openSync3, readdirSync as readdirSync8 } from "fs";
|
|
20680
|
+
import { join as join55 } from "path";
|
|
20536
20681
|
import chalk153 from "chalk";
|
|
20537
20682
|
var SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "packages"]);
|
|
20538
20683
|
function isLockedDll(debugDir) {
|
|
20539
20684
|
let files;
|
|
20540
20685
|
try {
|
|
20541
|
-
files =
|
|
20686
|
+
files = readdirSync8(debugDir, { recursive: true });
|
|
20542
20687
|
} catch {
|
|
20543
20688
|
return null;
|
|
20544
20689
|
}
|
|
20545
20690
|
for (const file of files) {
|
|
20546
20691
|
if (!file.toLowerCase().endsWith(".dll")) continue;
|
|
20547
|
-
const dllPath =
|
|
20692
|
+
const dllPath = join55(debugDir, file);
|
|
20548
20693
|
try {
|
|
20549
20694
|
const fd = openSync3(dllPath, "r+");
|
|
20550
20695
|
closeSync3(fd);
|
|
@@ -20557,18 +20702,18 @@ function isLockedDll(debugDir) {
|
|
|
20557
20702
|
function findFirstLockedDll(dir) {
|
|
20558
20703
|
let entries;
|
|
20559
20704
|
try {
|
|
20560
|
-
entries =
|
|
20705
|
+
entries = readdirSync8(dir);
|
|
20561
20706
|
} catch {
|
|
20562
20707
|
return null;
|
|
20563
20708
|
}
|
|
20564
20709
|
if (entries.includes("bin")) {
|
|
20565
|
-
const locked = isLockedDll(
|
|
20710
|
+
const locked = isLockedDll(join55(dir, "bin", "Debug"));
|
|
20566
20711
|
if (locked) return locked;
|
|
20567
20712
|
}
|
|
20568
20713
|
for (const entry of entries) {
|
|
20569
20714
|
if (SKIP_DIRS.has(entry) || entry === "bin" || entry.startsWith("."))
|
|
20570
20715
|
continue;
|
|
20571
|
-
const found = findFirstLockedDll(
|
|
20716
|
+
const found = findFirstLockedDll(join55(dir, entry));
|
|
20572
20717
|
if (found) return found;
|
|
20573
20718
|
}
|
|
20574
20719
|
return null;
|
|
@@ -20591,11 +20736,11 @@ async function checkBuildLocksCommand() {
|
|
|
20591
20736
|
}
|
|
20592
20737
|
|
|
20593
20738
|
// src/commands/dotnet/buildTree.ts
|
|
20594
|
-
import { readFileSync as
|
|
20739
|
+
import { readFileSync as readFileSync36 } from "fs";
|
|
20595
20740
|
import path41 from "path";
|
|
20596
20741
|
var PROJECT_REF_RE = /<ProjectReference\s+Include="([^"]+)"/g;
|
|
20597
20742
|
function getProjectRefs(csprojPath) {
|
|
20598
|
-
const content =
|
|
20743
|
+
const content = readFileSync36(csprojPath, "utf8");
|
|
20599
20744
|
const refs = [];
|
|
20600
20745
|
for (const match of content.matchAll(PROJECT_REF_RE)) {
|
|
20601
20746
|
refs.push(match[1].replace(/\\/g, "/"));
|
|
@@ -20612,7 +20757,7 @@ function buildTree(csprojPath, repoRoot2, visited = /* @__PURE__ */ new Set()) {
|
|
|
20612
20757
|
for (const ref of getProjectRefs(abs)) {
|
|
20613
20758
|
const childAbs = path41.resolve(dir, ref);
|
|
20614
20759
|
try {
|
|
20615
|
-
|
|
20760
|
+
readFileSync36(childAbs);
|
|
20616
20761
|
node.children.push(buildTree(childAbs, repoRoot2, visited));
|
|
20617
20762
|
} catch {
|
|
20618
20763
|
node.children.push({
|
|
@@ -20637,14 +20782,14 @@ function collectAllDeps(node) {
|
|
|
20637
20782
|
}
|
|
20638
20783
|
|
|
20639
20784
|
// src/commands/dotnet/findContainingSolutions.ts
|
|
20640
|
-
import { readdirSync as
|
|
20785
|
+
import { readdirSync as readdirSync9, readFileSync as readFileSync37, statSync as statSync8 } from "fs";
|
|
20641
20786
|
import path42 from "path";
|
|
20642
20787
|
function findSlnFiles(dir, maxDepth, depth = 0) {
|
|
20643
20788
|
if (depth > maxDepth) return [];
|
|
20644
20789
|
const results = [];
|
|
20645
20790
|
let entries;
|
|
20646
20791
|
try {
|
|
20647
|
-
entries =
|
|
20792
|
+
entries = readdirSync9(dir);
|
|
20648
20793
|
} catch {
|
|
20649
20794
|
return results;
|
|
20650
20795
|
}
|
|
@@ -20672,7 +20817,7 @@ function findContainingSolutions(csprojPath, repoRoot2) {
|
|
|
20672
20817
|
const pattern2 = new RegExp(`[\\\\"/]${escapeRegex(csprojBasename)}"`);
|
|
20673
20818
|
for (const sln of slnFiles) {
|
|
20674
20819
|
try {
|
|
20675
|
-
const content =
|
|
20820
|
+
const content = readFileSync37(sln, "utf8");
|
|
20676
20821
|
if (pattern2.test(content)) {
|
|
20677
20822
|
matches.push(path42.relative(repoRoot2, sln));
|
|
20678
20823
|
}
|
|
@@ -20736,12 +20881,12 @@ function printJson(tree, totalCount, solutions) {
|
|
|
20736
20881
|
}
|
|
20737
20882
|
|
|
20738
20883
|
// src/commands/dotnet/resolveCsproj.ts
|
|
20739
|
-
import { existsSync as
|
|
20884
|
+
import { existsSync as existsSync50 } from "fs";
|
|
20740
20885
|
import path43 from "path";
|
|
20741
20886
|
import chalk155 from "chalk";
|
|
20742
20887
|
function resolveCsproj(csprojPath) {
|
|
20743
20888
|
const resolved = path43.resolve(csprojPath);
|
|
20744
|
-
if (!
|
|
20889
|
+
if (!existsSync50(resolved)) {
|
|
20745
20890
|
console.error(chalk155.red(`File not found: ${resolved}`));
|
|
20746
20891
|
process.exit(1);
|
|
20747
20892
|
}
|
|
@@ -20909,17 +21054,17 @@ function filterIssues(issues, all, cliOnly, cliSuppress) {
|
|
|
20909
21054
|
}
|
|
20910
21055
|
|
|
20911
21056
|
// src/commands/dotnet/resolveSolution.ts
|
|
20912
|
-
import { existsSync as
|
|
21057
|
+
import { existsSync as existsSync51 } from "fs";
|
|
20913
21058
|
import path44 from "path";
|
|
20914
21059
|
import chalk159 from "chalk";
|
|
20915
21060
|
|
|
20916
21061
|
// src/commands/dotnet/findSolution.ts
|
|
20917
|
-
import { readdirSync as
|
|
20918
|
-
import { dirname as
|
|
21062
|
+
import { readdirSync as readdirSync10 } from "fs";
|
|
21063
|
+
import { dirname as dirname26, join as join56 } from "path";
|
|
20919
21064
|
import chalk158 from "chalk";
|
|
20920
21065
|
function findSlnInDir(dir) {
|
|
20921
21066
|
try {
|
|
20922
|
-
return
|
|
21067
|
+
return readdirSync10(dir).filter((f) => f.endsWith(".sln")).map((f) => join56(dir, f));
|
|
20923
21068
|
} catch {
|
|
20924
21069
|
return [];
|
|
20925
21070
|
}
|
|
@@ -20940,7 +21085,7 @@ function findSolution() {
|
|
|
20940
21085
|
process.exit(1);
|
|
20941
21086
|
}
|
|
20942
21087
|
if (current === ceiling) break;
|
|
20943
|
-
current =
|
|
21088
|
+
current = dirname26(current);
|
|
20944
21089
|
}
|
|
20945
21090
|
console.error(chalk158.red("No .sln file found between cwd and repo root"));
|
|
20946
21091
|
process.exit(1);
|
|
@@ -20950,7 +21095,7 @@ function findSolution() {
|
|
|
20950
21095
|
function resolveSolution(sln) {
|
|
20951
21096
|
if (sln) {
|
|
20952
21097
|
const resolved = path44.resolve(sln);
|
|
20953
|
-
if (!
|
|
21098
|
+
if (!existsSync51(resolved)) {
|
|
20954
21099
|
console.error(chalk159.red(`Solution file not found: ${resolved}`));
|
|
20955
21100
|
process.exit(1);
|
|
20956
21101
|
}
|
|
@@ -20990,7 +21135,7 @@ function parseInspectReport(json) {
|
|
|
20990
21135
|
|
|
20991
21136
|
// src/commands/dotnet/runInspectCode.ts
|
|
20992
21137
|
import { execSync as execSync41 } from "child_process";
|
|
20993
|
-
import { existsSync as
|
|
21138
|
+
import { existsSync as existsSync52, readFileSync as readFileSync38, unlinkSync as unlinkSync10 } from "fs";
|
|
20994
21139
|
import { tmpdir as tmpdir5 } from "os";
|
|
20995
21140
|
import path45 from "path";
|
|
20996
21141
|
import chalk160 from "chalk";
|
|
@@ -21021,11 +21166,11 @@ function runInspectCode(slnPath, include, swea) {
|
|
|
21021
21166
|
console.error(chalk160.red("jb inspectcode failed"));
|
|
21022
21167
|
process.exit(1);
|
|
21023
21168
|
}
|
|
21024
|
-
if (!
|
|
21169
|
+
if (!existsSync52(reportPath)) {
|
|
21025
21170
|
console.error(chalk160.red("Report file not generated"));
|
|
21026
21171
|
process.exit(1);
|
|
21027
21172
|
}
|
|
21028
|
-
const xml =
|
|
21173
|
+
const xml = readFileSync38(reportPath, "utf8");
|
|
21029
21174
|
unlinkSync10(reportPath);
|
|
21030
21175
|
return xml;
|
|
21031
21176
|
}
|
|
@@ -21310,11 +21455,11 @@ function decideCommentGuard(input, existingContent) {
|
|
|
21310
21455
|
}
|
|
21311
21456
|
|
|
21312
21457
|
// src/commands/dbMigration/consumeMigrationApproval.ts
|
|
21313
|
-
import { existsSync as
|
|
21458
|
+
import { existsSync as existsSync53, unlinkSync as unlinkSync11 } from "fs";
|
|
21314
21459
|
function consumeMigrationApproval(migrationId) {
|
|
21315
21460
|
sweepRestrictedDir();
|
|
21316
21461
|
const path91 = getMigrationApprovalPath(migrationId);
|
|
21317
|
-
if (!
|
|
21462
|
+
if (!existsSync53(path91)) return false;
|
|
21318
21463
|
try {
|
|
21319
21464
|
unlinkSync11(path91);
|
|
21320
21465
|
return true;
|
|
@@ -21434,7 +21579,7 @@ function aggregateCommitters(authorLists) {
|
|
|
21434
21579
|
import { spawnSync as spawnSync4 } from "child_process";
|
|
21435
21580
|
import { unlinkSync as unlinkSync12, writeFileSync as writeFileSync30 } from "fs";
|
|
21436
21581
|
import { tmpdir as tmpdir6 } from "os";
|
|
21437
|
-
import { join as
|
|
21582
|
+
import { join as join57 } from "path";
|
|
21438
21583
|
|
|
21439
21584
|
// src/shared/throwOnGraphqlErrors.ts
|
|
21440
21585
|
function throwOnGraphqlErrors(stdout) {
|
|
@@ -21463,7 +21608,7 @@ function buildArgs2(queryFile, vars) {
|
|
|
21463
21608
|
return args;
|
|
21464
21609
|
}
|
|
21465
21610
|
function runGhGraphql(mutation, vars) {
|
|
21466
|
-
const queryFile =
|
|
21611
|
+
const queryFile = join57(tmpdir6(), `gh-query-${Date.now()}.graphql`);
|
|
21467
21612
|
writeFileSync30(queryFile, mutation);
|
|
21468
21613
|
try {
|
|
21469
21614
|
const result = spawnSync4("gh", buildArgs2(queryFile, vars), {
|
|
@@ -22845,28 +22990,28 @@ function fetchIssue2(number, repo) {
|
|
|
22845
22990
|
}
|
|
22846
22991
|
|
|
22847
22992
|
// src/commands/github/issue/resumeIssueBody.ts
|
|
22848
|
-
import { existsSync as
|
|
22993
|
+
import { existsSync as existsSync54, readFileSync as readFileSync39 } from "fs";
|
|
22849
22994
|
|
|
22850
22995
|
// src/commands/github/issue/issueWorkingFile.ts
|
|
22851
|
-
import { join as
|
|
22996
|
+
import { join as join58 } from "path";
|
|
22852
22997
|
function issueWorkingFile(slug, number) {
|
|
22853
22998
|
const [owner = "unknown", repo = "unknown"] = slug.split("/");
|
|
22854
|
-
const dir =
|
|
22999
|
+
const dir = join58(getStoreDir(), "github-issues", owner, repo);
|
|
22855
23000
|
return {
|
|
22856
23001
|
dir,
|
|
22857
|
-
bodyPath:
|
|
22858
|
-
metaPath:
|
|
23002
|
+
bodyPath: join58(dir, `${number}.md`),
|
|
23003
|
+
metaPath: join58(dir, `${number}.json`)
|
|
22859
23004
|
};
|
|
22860
23005
|
}
|
|
22861
23006
|
|
|
22862
23007
|
// src/commands/github/issue/resumeIssueBody.ts
|
|
22863
23008
|
function resumeIssueBody(slug, number, updatedAt) {
|
|
22864
23009
|
const { bodyPath, metaPath } = issueWorkingFile(slug, number);
|
|
22865
|
-
if (!
|
|
23010
|
+
if (!existsSync54(bodyPath) || !existsSync54(metaPath)) return void 0;
|
|
22866
23011
|
try {
|
|
22867
|
-
const meta = JSON.parse(
|
|
23012
|
+
const meta = JSON.parse(readFileSync39(metaPath, "utf8"));
|
|
22868
23013
|
if (meta.updatedAt !== updatedAt) return void 0;
|
|
22869
|
-
return
|
|
23014
|
+
return readFileSync39(bodyPath, "utf8");
|
|
22870
23015
|
} catch {
|
|
22871
23016
|
return void 0;
|
|
22872
23017
|
}
|
|
@@ -23122,24 +23267,24 @@ async function countPendingHandovers(orm, origin) {
|
|
|
23122
23267
|
|
|
23123
23268
|
// src/commands/handover/migrateDiskHandovers.ts
|
|
23124
23269
|
import {
|
|
23125
|
-
existsSync as
|
|
23126
|
-
readdirSync as
|
|
23127
|
-
readFileSync as
|
|
23270
|
+
existsSync as existsSync55,
|
|
23271
|
+
readdirSync as readdirSync11,
|
|
23272
|
+
readFileSync as readFileSync40,
|
|
23128
23273
|
rmSync as rmSync3,
|
|
23129
23274
|
statSync as statSync9
|
|
23130
23275
|
} from "fs";
|
|
23131
|
-
import { basename as
|
|
23276
|
+
import { basename as basename16, join as join61 } from "path";
|
|
23132
23277
|
|
|
23133
23278
|
// src/commands/handover/getHandoverPath.ts
|
|
23134
|
-
import { join as
|
|
23279
|
+
import { join as join59 } from "path";
|
|
23135
23280
|
function getHandoverPath(cwd = process.cwd()) {
|
|
23136
|
-
return
|
|
23281
|
+
return join59(cwd, ".assist", "HANDOVER.md");
|
|
23137
23282
|
}
|
|
23138
23283
|
|
|
23139
23284
|
// src/commands/handover/getHandoversDir.ts
|
|
23140
|
-
import { join as
|
|
23285
|
+
import { join as join60 } from "path";
|
|
23141
23286
|
function getHandoversDir(cwd = process.cwd()) {
|
|
23142
|
-
return
|
|
23287
|
+
return join60(cwd, ".assist", "handovers");
|
|
23143
23288
|
}
|
|
23144
23289
|
|
|
23145
23290
|
// src/commands/handover/parseArchiveTimestamp.ts
|
|
@@ -23177,17 +23322,17 @@ function summariseHandoverContent(content) {
|
|
|
23177
23322
|
|
|
23178
23323
|
// src/commands/handover/migrateDiskHandovers.ts
|
|
23179
23324
|
function collectMarkdown(dir) {
|
|
23180
|
-
if (!
|
|
23325
|
+
if (!existsSync55(dir)) return [];
|
|
23181
23326
|
const out = [];
|
|
23182
|
-
for (const entry of
|
|
23183
|
-
const full =
|
|
23327
|
+
for (const entry of readdirSync11(dir, { withFileTypes: true })) {
|
|
23328
|
+
const full = join61(dir, entry.name);
|
|
23184
23329
|
if (entry.isDirectory()) out.push(...collectMarkdown(full));
|
|
23185
23330
|
else if (entry.isFile() && entry.name.endsWith(".md")) out.push(full);
|
|
23186
23331
|
}
|
|
23187
23332
|
return out;
|
|
23188
23333
|
}
|
|
23189
23334
|
async function migrateFile(orm, origin, file, createdAt) {
|
|
23190
|
-
const content =
|
|
23335
|
+
const content = readFileSync40(file, "utf8");
|
|
23191
23336
|
await saveHandover(orm, {
|
|
23192
23337
|
origin,
|
|
23193
23338
|
summary: summariseHandoverContent(content),
|
|
@@ -23199,12 +23344,12 @@ async function migrateFile(orm, origin, file, createdAt) {
|
|
|
23199
23344
|
async function migrateDiskHandovers(orm, origin, cwd = process.cwd()) {
|
|
23200
23345
|
let migrated = 0;
|
|
23201
23346
|
for (const file of collectMarkdown(getHandoversDir(cwd))) {
|
|
23202
|
-
const createdAt = parseArchiveTimestamp(
|
|
23347
|
+
const createdAt = parseArchiveTimestamp(basename16(file)) ?? statSync9(file).mtime;
|
|
23203
23348
|
await migrateFile(orm, origin, file, createdAt);
|
|
23204
23349
|
migrated++;
|
|
23205
23350
|
}
|
|
23206
23351
|
const handoverPath = getHandoverPath(cwd);
|
|
23207
|
-
if (
|
|
23352
|
+
if (existsSync55(handoverPath)) {
|
|
23208
23353
|
await migrateFile(orm, origin, handoverPath, statSync9(handoverPath).mtime);
|
|
23209
23354
|
migrated++;
|
|
23210
23355
|
}
|
|
@@ -23561,18 +23706,18 @@ function canonicalTreePath(path91) {
|
|
|
23561
23706
|
}
|
|
23562
23707
|
|
|
23563
23708
|
// src/commands/sessions/daemon/worktree/createWorktree.ts
|
|
23564
|
-
import { existsSync as
|
|
23565
|
-
import { basename as
|
|
23709
|
+
import { existsSync as existsSync56 } from "fs";
|
|
23710
|
+
import { basename as basename18, dirname as dirname27 } from "path";
|
|
23566
23711
|
|
|
23567
23712
|
// src/commands/sessions/daemon/worktree/planAllocation.ts
|
|
23568
|
-
import { basename as
|
|
23713
|
+
import { basename as basename17, join as join62 } from "path";
|
|
23569
23714
|
function planAllocation(clone, boundTreeRoots2) {
|
|
23570
23715
|
return boundTreeRoots2.has(clone) ? "spill" : "primary";
|
|
23571
23716
|
}
|
|
23572
23717
|
function nextWorktreePath(clone, base, isTaken) {
|
|
23573
|
-
const name =
|
|
23718
|
+
const name = basename17(clone);
|
|
23574
23719
|
for (let n = 2; n < 1e3; n++) {
|
|
23575
|
-
const candidate =
|
|
23720
|
+
const candidate = join62(base, `${name}-${n}`);
|
|
23576
23721
|
if (!isTaken(candidate)) return candidate;
|
|
23577
23722
|
}
|
|
23578
23723
|
throw new Error(`no free worktree suffix for ${clone}`);
|
|
@@ -23605,10 +23750,10 @@ function cloneHead(clone) {
|
|
|
23605
23750
|
|
|
23606
23751
|
// src/commands/sessions/daemon/worktree/createWorktree.ts
|
|
23607
23752
|
function createWorktree(clone, strategy, boundTreeRoots2, preferredPath) {
|
|
23608
|
-
const base = strategy.root ? expandTilde2(strategy.root) :
|
|
23753
|
+
const base = strategy.root ? expandTilde2(strategy.root) : dirname27(clone);
|
|
23609
23754
|
const registered = new Set(listWorktreePaths(clone));
|
|
23610
23755
|
const branches = new Set(listLocalBranches(clone));
|
|
23611
|
-
const isTaken = (candidate) => registered.has(candidate) ||
|
|
23756
|
+
const isTaken = (candidate) => registered.has(candidate) || existsSync56(candidate) || boundTreeRoots2.has(candidate) || branches.has(basename18(candidate));
|
|
23612
23757
|
const path91 = preferredPath && !isTaken(preferredPath) ? preferredPath : nextWorktreePath(clone, base, isTaken);
|
|
23613
23758
|
const start3 = worktreeStartPoint(clone, strategy.trunk);
|
|
23614
23759
|
gitSync(clone, [
|
|
@@ -23616,13 +23761,13 @@ function createWorktree(clone, strategy, boundTreeRoots2, preferredPath) {
|
|
|
23616
23761
|
"add",
|
|
23617
23762
|
start3.track ? "--track" : "--no-track",
|
|
23618
23763
|
"-b",
|
|
23619
|
-
|
|
23764
|
+
basename18(path91),
|
|
23620
23765
|
path91,
|
|
23621
23766
|
start3.ref
|
|
23622
23767
|
]);
|
|
23623
23768
|
recordWorktree(path91, clone, getCurrentOrigin(clone));
|
|
23624
23769
|
daemonLog(
|
|
23625
|
-
start3.track ? `worktree allocated ${path91} (branch ${
|
|
23770
|
+
start3.track ? `worktree allocated ${path91} (branch ${basename18(path91)} tracking ${start3.ref}) for clone ${clone}` : `worktree allocated ${path91} (branch ${basename18(path91)} off ${start3.ref}, no mainline tracking) for clone ${clone}`
|
|
23626
23771
|
);
|
|
23627
23772
|
return path91;
|
|
23628
23773
|
}
|
|
@@ -23634,7 +23779,7 @@ function keptInTree(cwd, reason4) {
|
|
|
23634
23779
|
}
|
|
23635
23780
|
|
|
23636
23781
|
// src/commands/sessions/daemon/worktree/treeDurability.ts
|
|
23637
|
-
import { existsSync as
|
|
23782
|
+
import { existsSync as existsSync57 } from "fs";
|
|
23638
23783
|
var treeIsGone = { durable: true, gone: true };
|
|
23639
23784
|
function treeDurability(state) {
|
|
23640
23785
|
if (state.dirty) return { durable: false, reason: "uncommitted changes" };
|
|
@@ -23665,14 +23810,14 @@ function* durabilityProbes() {
|
|
|
23665
23810
|
});
|
|
23666
23811
|
}
|
|
23667
23812
|
async function checkDurability(cwd) {
|
|
23668
|
-
if (!
|
|
23813
|
+
if (!existsSync57(cwd)) return treeIsGone;
|
|
23669
23814
|
const probes = durabilityProbes();
|
|
23670
23815
|
let step2 = probes.next();
|
|
23671
23816
|
while (!step2.done) step2 = probes.next(await gitResult(cwd, step2.value));
|
|
23672
23817
|
return step2.value;
|
|
23673
23818
|
}
|
|
23674
23819
|
function checkDurabilitySync(cwd) {
|
|
23675
|
-
if (!
|
|
23820
|
+
if (!existsSync57(cwd)) return treeIsGone;
|
|
23676
23821
|
const probes = durabilityProbes();
|
|
23677
23822
|
let step2 = probes.next();
|
|
23678
23823
|
while (!step2.done) step2 = probes.next(gitSyncResult(cwd, step2.value));
|
|
@@ -23917,20 +24062,20 @@ function persistedTreeRoots() {
|
|
|
23917
24062
|
}
|
|
23918
24063
|
|
|
23919
24064
|
// src/commands/sessions/daemon/worktree/seedWorktree.ts
|
|
23920
|
-
import { copyFileSync, existsSync as
|
|
23921
|
-
import { dirname as
|
|
24065
|
+
import { copyFileSync, existsSync as existsSync59, mkdirSync as mkdirSync17 } from "fs";
|
|
24066
|
+
import { dirname as dirname28, join as join64 } from "path";
|
|
23922
24067
|
|
|
23923
24068
|
// src/commands/sessions/daemon/worktree/runInstall.ts
|
|
23924
24069
|
import { spawn as spawn5 } from "child_process";
|
|
23925
24070
|
|
|
23926
24071
|
// src/commands/sessions/daemon/worktree/resolveInstallCommand.ts
|
|
23927
|
-
import { existsSync as
|
|
23928
|
-
import { join as
|
|
24072
|
+
import { existsSync as existsSync58 } from "fs";
|
|
24073
|
+
import { join as join63 } from "path";
|
|
23929
24074
|
function detectInstallCommand(repoRoot2) {
|
|
23930
|
-
if (!
|
|
23931
|
-
if (
|
|
23932
|
-
if (
|
|
23933
|
-
if (
|
|
24075
|
+
if (!existsSync58(join63(repoRoot2, "package.json"))) return null;
|
|
24076
|
+
if (existsSync58(join63(repoRoot2, "pnpm-lock.yaml"))) return "pnpm install";
|
|
24077
|
+
if (existsSync58(join63(repoRoot2, "yarn.lock"))) return "yarn install";
|
|
24078
|
+
if (existsSync58(join63(repoRoot2, "bun.lockb"))) return "bun install";
|
|
23934
24079
|
return "npm install";
|
|
23935
24080
|
}
|
|
23936
24081
|
function resolveInstallCommand(repoRoot2, install) {
|
|
@@ -24042,11 +24187,11 @@ function seedWorktree(worktreePath, clone, onSeeded = () => {
|
|
|
24042
24187
|
}
|
|
24043
24188
|
function copyConfigFiles(worktreePath, clone, copy) {
|
|
24044
24189
|
for (const rel of copy) {
|
|
24045
|
-
const src =
|
|
24046
|
-
if (!
|
|
24047
|
-
const dest =
|
|
24190
|
+
const src = join64(clone, rel);
|
|
24191
|
+
if (!existsSync59(src)) continue;
|
|
24192
|
+
const dest = join64(worktreePath, rel);
|
|
24048
24193
|
try {
|
|
24049
|
-
mkdirSync17(
|
|
24194
|
+
mkdirSync17(dirname28(dest), { recursive: true });
|
|
24050
24195
|
copyFileSync(src, dest);
|
|
24051
24196
|
daemonLog(`worktree ${worktreePath} seeded ${rel}`);
|
|
24052
24197
|
} catch (error) {
|
|
@@ -24349,13 +24494,13 @@ function registerLitellm(program2) {
|
|
|
24349
24494
|
}
|
|
24350
24495
|
|
|
24351
24496
|
// src/commands/mermaid/index.ts
|
|
24352
|
-
import { mkdirSync as mkdirSync18, readdirSync as
|
|
24497
|
+
import { mkdirSync as mkdirSync18, readdirSync as readdirSync12 } from "fs";
|
|
24353
24498
|
import { resolve as resolve16 } from "path";
|
|
24354
24499
|
import chalk175 from "chalk";
|
|
24355
24500
|
|
|
24356
24501
|
// src/commands/mermaid/exportFile.ts
|
|
24357
|
-
import { readFileSync as
|
|
24358
|
-
import { basename as
|
|
24502
|
+
import { readFileSync as readFileSync41, writeFileSync as writeFileSync32 } from "fs";
|
|
24503
|
+
import { basename as basename19, extname as extname2, resolve as resolve15 } from "path";
|
|
24359
24504
|
import chalk174 from "chalk";
|
|
24360
24505
|
|
|
24361
24506
|
// src/commands/mermaid/renderBlock.ts
|
|
@@ -24380,9 +24525,9 @@ async function renderBlock(krokiUrl, source) {
|
|
|
24380
24525
|
|
|
24381
24526
|
// src/commands/mermaid/exportFile.ts
|
|
24382
24527
|
async function exportFile(file, outDir, krokiUrl, onlyIndex) {
|
|
24383
|
-
const content =
|
|
24528
|
+
const content = readFileSync41(file, "utf8");
|
|
24384
24529
|
const blocks = extractMermaidBlocks(content);
|
|
24385
|
-
const stem =
|
|
24530
|
+
const stem = basename19(file, extname2(file));
|
|
24386
24531
|
if (onlyIndex !== void 0) {
|
|
24387
24532
|
if (onlyIndex < 1 || onlyIndex > blocks.length) {
|
|
24388
24533
|
console.error(
|
|
@@ -24431,7 +24576,7 @@ async function mermaidExport(file, options2 = {}) {
|
|
|
24431
24576
|
process.exit(1);
|
|
24432
24577
|
}
|
|
24433
24578
|
}
|
|
24434
|
-
const files = file ? [file] :
|
|
24579
|
+
const files = file ? [file] : readdirSync12(process.cwd()).filter((name) => name.toLowerCase().endsWith(".md")).sort();
|
|
24435
24580
|
if (files.length === 0) {
|
|
24436
24581
|
console.log(chalk175.gray("No markdown files found in current directory."));
|
|
24437
24582
|
return;
|
|
@@ -24514,7 +24659,7 @@ import { stringify as stringify2 } from "yaml";
|
|
|
24514
24659
|
|
|
24515
24660
|
// src/commands/miro/writeExtract.ts
|
|
24516
24661
|
import { mkdirSync as mkdirSync19, writeFileSync as writeFileSync33 } from "fs";
|
|
24517
|
-
import { dirname as
|
|
24662
|
+
import { dirname as dirname29 } from "path";
|
|
24518
24663
|
import { stringify } from "yaml";
|
|
24519
24664
|
function headerLines(header) {
|
|
24520
24665
|
const { rect } = header;
|
|
@@ -24527,7 +24672,7 @@ function headerLines(header) {
|
|
|
24527
24672
|
];
|
|
24528
24673
|
}
|
|
24529
24674
|
function writeExtract(file, header, texts) {
|
|
24530
|
-
mkdirSync19(
|
|
24675
|
+
mkdirSync19(dirname29(file), { recursive: true });
|
|
24531
24676
|
writeFileSync33(file, `${headerLines(header).join("\n")}
|
|
24532
24677
|
${stringify(texts)}`);
|
|
24533
24678
|
}
|
|
@@ -24592,14 +24737,14 @@ function applyIgnore(texts, ignore3) {
|
|
|
24592
24737
|
}
|
|
24593
24738
|
|
|
24594
24739
|
// src/commands/miro/readIgnoreList.ts
|
|
24595
|
-
import { existsSync as
|
|
24740
|
+
import { existsSync as existsSync60, readFileSync as readFileSync42 } from "fs";
|
|
24596
24741
|
import { parse as parse2 } from "yaml";
|
|
24597
24742
|
function readIgnoreList(file) {
|
|
24598
|
-
if (!
|
|
24743
|
+
if (!existsSync60(file))
|
|
24599
24744
|
throw new MiroExtractError(
|
|
24600
24745
|
`No ignore file at ${file}. Write a YAML list of the box texts to drop, or omit --ignore.`
|
|
24601
24746
|
);
|
|
24602
|
-
const parsed = parse2(
|
|
24747
|
+
const parsed = parse2(readFileSync42(file, "utf8"));
|
|
24603
24748
|
if (parsed === null || parsed === void 0) return [];
|
|
24604
24749
|
if (!Array.isArray(parsed) || parsed.some((entry) => typeof entry !== "string"))
|
|
24605
24750
|
throw new MiroExtractError(
|
|
@@ -24781,7 +24926,7 @@ async function pickAnchors(sessionId, items2) {
|
|
|
24781
24926
|
}
|
|
24782
24927
|
|
|
24783
24928
|
// src/commands/miro/readMiroItems.ts
|
|
24784
|
-
import { readFileSync as
|
|
24929
|
+
import { readFileSync as readFileSync43 } from "fs";
|
|
24785
24930
|
function tryParse(text18) {
|
|
24786
24931
|
try {
|
|
24787
24932
|
return JSON.parse(text18);
|
|
@@ -24810,7 +24955,7 @@ function parsePages(raw, file) {
|
|
|
24810
24955
|
return Array.isArray(parsed) ? parsed.map(toPage) : [toPage(parsed)];
|
|
24811
24956
|
}
|
|
24812
24957
|
function readMiroItems(file) {
|
|
24813
|
-
const items2 = parsePages(
|
|
24958
|
+
const items2 = parsePages(readFileSync43(file, "utf8"), file).flatMap(
|
|
24814
24959
|
(page) => page.data ?? []
|
|
24815
24960
|
);
|
|
24816
24961
|
if (items2.length === 0)
|
|
@@ -25000,7 +25145,7 @@ function registerMiro(program2) {
|
|
|
25000
25145
|
// src/commands/netcap/netcap.ts
|
|
25001
25146
|
import { mkdir as mkdir5 } from "fs/promises";
|
|
25002
25147
|
import { createServer as createServer2 } from "http";
|
|
25003
|
-
import { dirname as
|
|
25148
|
+
import { dirname as dirname31 } from "path";
|
|
25004
25149
|
import chalk179 from "chalk";
|
|
25005
25150
|
|
|
25006
25151
|
// src/commands/netcap/corsHeaders.ts
|
|
@@ -25079,15 +25224,15 @@ function createNetcapHandler(options2) {
|
|
|
25079
25224
|
// src/commands/netcap/prepareExtensionForLoad.ts
|
|
25080
25225
|
import { cp as cp4, readFile as readFile5, writeFile as writeFile5 } from "fs/promises";
|
|
25081
25226
|
import { networkInterfaces } from "os";
|
|
25082
|
-
import { join as
|
|
25227
|
+
import { join as join66 } from "path";
|
|
25083
25228
|
import chalk178 from "chalk";
|
|
25084
25229
|
|
|
25085
25230
|
// src/commands/netcap/netcapExtensionDir.ts
|
|
25086
|
-
import { dirname as
|
|
25087
|
-
import { fileURLToPath as
|
|
25088
|
-
var moduleDir2 =
|
|
25231
|
+
import { dirname as dirname30, join as join65 } from "path";
|
|
25232
|
+
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
25233
|
+
var moduleDir2 = dirname30(fileURLToPath8(import.meta.url));
|
|
25089
25234
|
function netcapExtensionDir() {
|
|
25090
|
-
return
|
|
25235
|
+
return join65(moduleDir2, "commands", "netcap", "netcap-extension");
|
|
25091
25236
|
}
|
|
25092
25237
|
|
|
25093
25238
|
// src/commands/netcap/prepareExtensionForLoad.ts
|
|
@@ -25102,7 +25247,7 @@ function lanIPv4() {
|
|
|
25102
25247
|
return void 0;
|
|
25103
25248
|
}
|
|
25104
25249
|
async function configureBackground(dir, host, port, filter) {
|
|
25105
|
-
const file =
|
|
25250
|
+
const file = join66(dir, "background.js");
|
|
25106
25251
|
const source = await readFile5(file, "utf8");
|
|
25107
25252
|
await writeFile5(
|
|
25108
25253
|
file,
|
|
@@ -25142,20 +25287,20 @@ async function prepareExtensionForLoad(port, filter = "") {
|
|
|
25142
25287
|
}
|
|
25143
25288
|
|
|
25144
25289
|
// src/commands/netcap/resolveNetcapOutPath.ts
|
|
25145
|
-
import { isAbsolute as isAbsolute4, join as
|
|
25290
|
+
import { isAbsolute as isAbsolute4, join as join68, resolve as resolve18 } from "path";
|
|
25146
25291
|
|
|
25147
25292
|
// src/commands/netcap/defaultCapturePath.ts
|
|
25148
25293
|
import { homedir as homedir21 } from "os";
|
|
25149
|
-
import { join as
|
|
25294
|
+
import { join as join67 } from "path";
|
|
25150
25295
|
function defaultCapturePath() {
|
|
25151
|
-
return
|
|
25296
|
+
return join67(homedir21(), ".assist", "netcap", "capture.jsonl");
|
|
25152
25297
|
}
|
|
25153
25298
|
|
|
25154
25299
|
// src/commands/netcap/resolveNetcapOutPath.ts
|
|
25155
25300
|
function resolveNetcapOutPath(out) {
|
|
25156
25301
|
if (!out) return defaultCapturePath();
|
|
25157
25302
|
const dir = isAbsolute4(out) ? out : resolve18(process.cwd(), out);
|
|
25158
|
-
return
|
|
25303
|
+
return join68(dir, "capture.jsonl");
|
|
25159
25304
|
}
|
|
25160
25305
|
|
|
25161
25306
|
// src/commands/netcap/netcap.ts
|
|
@@ -25163,7 +25308,7 @@ async function netcap(options2) {
|
|
|
25163
25308
|
const port = Number(options2.port);
|
|
25164
25309
|
const outPath = resolveNetcapOutPath(options2.out);
|
|
25165
25310
|
const filter = options2.filter ?? "";
|
|
25166
|
-
await mkdir5(
|
|
25311
|
+
await mkdir5(dirname31(outPath), { recursive: true });
|
|
25167
25312
|
const extensionPath = await prepareExtensionForLoad(port, filter);
|
|
25168
25313
|
let count8 = 0;
|
|
25169
25314
|
const handler = createNetcapHandler({
|
|
@@ -25202,11 +25347,11 @@ netcap stopped \u2014 captured ${count8} ${count8 === 1 ? "entry" : "entries"} t
|
|
|
25202
25347
|
|
|
25203
25348
|
// src/commands/netcap/netcapExtract.ts
|
|
25204
25349
|
import { writeFileSync as writeFileSync34 } from "fs";
|
|
25205
|
-
import { join as
|
|
25350
|
+
import { join as join69 } from "path";
|
|
25206
25351
|
import chalk180 from "chalk";
|
|
25207
25352
|
|
|
25208
25353
|
// src/commands/netcap/extractPostsFromCapture.ts
|
|
25209
|
-
import { readFileSync as
|
|
25354
|
+
import { readFileSync as readFileSync44 } from "fs";
|
|
25210
25355
|
|
|
25211
25356
|
// src/commands/netcap/parseRscRows.ts
|
|
25212
25357
|
var isRscRef = (v) => typeof v === "string" && /^\$[0-9a-fL@]/.test(v);
|
|
@@ -25602,7 +25747,7 @@ function extractVoyagerPosts(body) {
|
|
|
25602
25747
|
|
|
25603
25748
|
// src/commands/netcap/extractPostsFromCapture.ts
|
|
25604
25749
|
function captureEntries(captureFile) {
|
|
25605
|
-
const lines2 =
|
|
25750
|
+
const lines2 = readFileSync44(captureFile, "utf8").split("\n").filter(Boolean);
|
|
25606
25751
|
const entries = [];
|
|
25607
25752
|
for (const line of lines2) {
|
|
25608
25753
|
let entry;
|
|
@@ -25647,7 +25792,7 @@ function extractPostsFromCapture(captureFile) {
|
|
|
25647
25792
|
function netcapExtract(file) {
|
|
25648
25793
|
const captureFile = file ?? defaultCapturePath();
|
|
25649
25794
|
const posts = extractPostsFromCapture(captureFile);
|
|
25650
|
-
const outFile =
|
|
25795
|
+
const outFile = join69(captureFile, "..", "posts.json");
|
|
25651
25796
|
writeFileSync34(outFile, `${JSON.stringify(posts, null, 2)}
|
|
25652
25797
|
`);
|
|
25653
25798
|
console.log(
|
|
@@ -25967,11 +26112,11 @@ function extractResolves(content) {
|
|
|
25967
26112
|
}
|
|
25968
26113
|
function editPrBody(body, sections) {
|
|
25969
26114
|
const parsed = parsePrBody(body);
|
|
25970
|
-
const find = (
|
|
25971
|
-
const upsert = (
|
|
25972
|
-
const existing = find(
|
|
26115
|
+
const find = (heading2) => parsed.find((s) => s.heading.toLowerCase() === heading2.toLowerCase());
|
|
26116
|
+
const upsert = (heading2, content) => {
|
|
26117
|
+
const existing = find(heading2);
|
|
25973
26118
|
if (existing) existing.content = content;
|
|
25974
|
-
else parsed.push({ heading, content });
|
|
26119
|
+
else parsed.push({ heading: heading2, content });
|
|
25975
26120
|
};
|
|
25976
26121
|
if (sections.what !== void 0) upsert("What", sections.what);
|
|
25977
26122
|
const hasResolves = (sections.resolves?.length ?? 0) > 0;
|
|
@@ -26012,10 +26157,10 @@ function splitParagraphs(body) {
|
|
|
26012
26157
|
}
|
|
26013
26158
|
};
|
|
26014
26159
|
for (const line of body.split("\n")) {
|
|
26015
|
-
const
|
|
26016
|
-
if (
|
|
26160
|
+
const heading2 = line.match(/^#{1,6}\s+(.*)$/);
|
|
26161
|
+
if (heading2) {
|
|
26017
26162
|
flush();
|
|
26018
|
-
section3 =
|
|
26163
|
+
section3 = heading2[1].trim();
|
|
26019
26164
|
} else if (line.trim() === "") {
|
|
26020
26165
|
flush();
|
|
26021
26166
|
} else {
|
|
@@ -26090,17 +26235,17 @@ import { execSync as execSync46 } from "child_process";
|
|
|
26090
26235
|
import { execSync as execSync45 } from "child_process";
|
|
26091
26236
|
import { unlinkSync as unlinkSync14, writeFileSync as writeFileSync35 } from "fs";
|
|
26092
26237
|
import { tmpdir as tmpdir7 } from "os";
|
|
26093
|
-
import { join as
|
|
26238
|
+
import { join as join71 } from "path";
|
|
26094
26239
|
|
|
26095
26240
|
// src/commands/prs/loadCommentsCache.ts
|
|
26096
|
-
import { existsSync as
|
|
26241
|
+
import { existsSync as existsSync61, readFileSync as readFileSync45, unlinkSync as unlinkSync13 } from "fs";
|
|
26097
26242
|
import { parse as parse3 } from "yaml";
|
|
26098
26243
|
|
|
26099
26244
|
// src/commands/prs/commentsCachePath.ts
|
|
26100
26245
|
import { homedir as homedir22 } from "os";
|
|
26101
|
-
import { join as
|
|
26246
|
+
import { join as join70 } from "path";
|
|
26102
26247
|
function commentsCachePath(org, repo, prNumber) {
|
|
26103
|
-
return
|
|
26248
|
+
return join70(
|
|
26104
26249
|
homedir22(),
|
|
26105
26250
|
".assist",
|
|
26106
26251
|
"pr-comments",
|
|
@@ -26113,15 +26258,15 @@ function commentsCachePath(org, repo, prNumber) {
|
|
|
26113
26258
|
// src/commands/prs/loadCommentsCache.ts
|
|
26114
26259
|
function loadCommentsCache(org, repo, prNumber) {
|
|
26115
26260
|
const cachePath = commentsCachePath(org, repo, prNumber);
|
|
26116
|
-
if (!
|
|
26261
|
+
if (!existsSync61(cachePath)) {
|
|
26117
26262
|
return null;
|
|
26118
26263
|
}
|
|
26119
|
-
const content =
|
|
26264
|
+
const content = readFileSync45(cachePath, "utf8");
|
|
26120
26265
|
return parse3(content);
|
|
26121
26266
|
}
|
|
26122
26267
|
function deleteCommentsCache(org, repo, prNumber) {
|
|
26123
26268
|
const cachePath = commentsCachePath(org, repo, prNumber);
|
|
26124
|
-
if (
|
|
26269
|
+
if (existsSync61(cachePath)) {
|
|
26125
26270
|
unlinkSync13(cachePath);
|
|
26126
26271
|
console.log("No more unresolved line comments. Cache dropped.");
|
|
26127
26272
|
}
|
|
@@ -26149,7 +26294,7 @@ function replyToComment(org, repo, prNumber, commentId, message3) {
|
|
|
26149
26294
|
// src/commands/prs/resolveCommentWithReply.ts
|
|
26150
26295
|
function resolveThread(threadId) {
|
|
26151
26296
|
const mutation = `mutation($threadId: ID!) { resolveReviewThread(input: {threadId: $threadId}) { thread { isResolved } } }`;
|
|
26152
|
-
const queryFile =
|
|
26297
|
+
const queryFile = join71(tmpdir7(), `gh-mutation-${Date.now()}.graphql`);
|
|
26153
26298
|
writeFileSync35(queryFile, mutation);
|
|
26154
26299
|
try {
|
|
26155
26300
|
execSync45(
|
|
@@ -26234,10 +26379,10 @@ function fixed(commentId, sha) {
|
|
|
26234
26379
|
import { execSync as execSync47 } from "child_process";
|
|
26235
26380
|
import { unlinkSync as unlinkSync15, writeFileSync as writeFileSync36 } from "fs";
|
|
26236
26381
|
import { tmpdir as tmpdir8 } from "os";
|
|
26237
|
-
import { join as
|
|
26382
|
+
import { join as join72 } from "path";
|
|
26238
26383
|
var THREAD_QUERY = `query($owner: String!, $repo: String!, $prNumber: Int!) { repository(owner: $owner, name: $repo) { pullRequest(number: $prNumber) { reviewThreads(first: 100) { nodes { id isResolved comments(first: 100) { nodes { databaseId } } } } } } }`;
|
|
26239
26384
|
function fetchThreadIds(org, repo, prNumber) {
|
|
26240
|
-
const queryFile =
|
|
26385
|
+
const queryFile = join72(tmpdir8(), `gh-query-${Date.now()}.graphql`);
|
|
26241
26386
|
writeFileSync36(queryFile, THREAD_QUERY);
|
|
26242
26387
|
try {
|
|
26243
26388
|
const result = execSync47(
|
|
@@ -26307,30 +26452,30 @@ function fetchLineComments(org, repo, prNumber, threadInfo) {
|
|
|
26307
26452
|
|
|
26308
26453
|
// src/commands/prs/listComments/updateCommentsCache.ts
|
|
26309
26454
|
import { mkdirSync as mkdirSync20, writeFileSync as writeFileSync37 } from "fs";
|
|
26310
|
-
import { dirname as
|
|
26455
|
+
import { dirname as dirname32 } from "path";
|
|
26311
26456
|
import { stringify as stringify3 } from "yaml";
|
|
26312
26457
|
|
|
26313
26458
|
// src/commands/prs/removeStaleCommentsCaches.ts
|
|
26314
|
-
import { readdirSync as
|
|
26315
|
-
import { join as
|
|
26459
|
+
import { readdirSync as readdirSync13, unlinkSync as unlinkSync16 } from "fs";
|
|
26460
|
+
import { join as join73 } from "path";
|
|
26316
26461
|
var STALE_PATTERN = /^pr-\d+-comments\.yaml$/;
|
|
26317
26462
|
function removeStaleCommentsCaches(cwd = process.cwd()) {
|
|
26318
|
-
const dir =
|
|
26463
|
+
const dir = join73(cwd, ".assist");
|
|
26319
26464
|
let entries;
|
|
26320
26465
|
try {
|
|
26321
|
-
entries =
|
|
26466
|
+
entries = readdirSync13(dir);
|
|
26322
26467
|
} catch {
|
|
26323
26468
|
return;
|
|
26324
26469
|
}
|
|
26325
26470
|
for (const entry of entries.filter((e) => STALE_PATTERN.test(e))) {
|
|
26326
|
-
unlinkSync16(
|
|
26471
|
+
unlinkSync16(join73(dir, entry));
|
|
26327
26472
|
}
|
|
26328
26473
|
}
|
|
26329
26474
|
|
|
26330
26475
|
// src/commands/prs/listComments/updateCommentsCache.ts
|
|
26331
26476
|
function writeCommentsCache(org, repo, prNumber, comments3) {
|
|
26332
26477
|
const cachePath = commentsCachePath(org, repo, prNumber);
|
|
26333
|
-
mkdirSync20(
|
|
26478
|
+
mkdirSync20(dirname32(cachePath), { recursive: true });
|
|
26334
26479
|
const cacheData = {
|
|
26335
26480
|
prNumber,
|
|
26336
26481
|
fetchedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
@@ -27161,8 +27306,22 @@ function registerPrsEdit(prsCommand) {
|
|
|
27161
27306
|
).addHelpText("after", () => editHelpText()).action(edit);
|
|
27162
27307
|
}
|
|
27163
27308
|
|
|
27164
|
-
// src/commands/prs/
|
|
27165
|
-
var
|
|
27309
|
+
// src/commands/prs/resolvesBlurb.ts
|
|
27310
|
+
var RESOLVES_BOTH_PROMPT = ` --resolves <ref> Jira issue key or GitHub issue resolved by this PR;
|
|
27311
|
+
repeatable. A Jira key is appended inline to ## Why as its
|
|
27312
|
+
browse URL; a GitHub reference (#123, owner/repo#123, or a
|
|
27313
|
+
github.com issue URL) is appended as-is so that merging
|
|
27314
|
+
closes the issue. Unless one is already known from the
|
|
27315
|
+
session, ask the user whether this PR resolves a Jira or a
|
|
27316
|
+
GitHub issue and for the key or reference before raising;
|
|
27317
|
+
omit --resolves only if they say there isn't one.`;
|
|
27318
|
+
var RESOLVES_GITHUB_PROMPT = ` --resolves <ref> GitHub issue resolved by this PR; repeatable. Accepts #123,
|
|
27319
|
+
owner/repo#123, or a github.com issue URL, appended inline to
|
|
27320
|
+
## Why so that merging closes the issue. Unless an issue is
|
|
27321
|
+
already known from the session, ask the user whether this PR
|
|
27322
|
+
resolves a GitHub issue and for the reference before raising;
|
|
27323
|
+
omit --resolves only if they say there isn't one.`;
|
|
27324
|
+
var RESOLVES_JIRA_PROMPT = ` --resolves <key> Jira issue key resolved by this PR; repeatable. Each key's
|
|
27166
27325
|
browse URL is appended inline to ## Why. Unless a Jira key is
|
|
27167
27326
|
already known from the session, ask the user whether this PR
|
|
27168
27327
|
resolves a Jira issue and for the key before raising; omit
|
|
@@ -27171,12 +27330,20 @@ var RESOLVES_NO_PROMPT = ` --resolves <key> Jira issue key resolved by this PR
|
|
|
27171
27330
|
browse URL is appended inline to ## Why. Pass it when a Jira
|
|
27172
27331
|
key is known from the session or supplied by the user; omit
|
|
27173
27332
|
it otherwise.`;
|
|
27333
|
+
function resolvesBlurb(promptJira, promptGithub) {
|
|
27334
|
+
if (promptJira && promptGithub) return RESOLVES_BOTH_PROMPT;
|
|
27335
|
+
if (promptGithub) return RESOLVES_GITHUB_PROMPT;
|
|
27336
|
+
if (promptJira) return RESOLVES_JIRA_PROMPT;
|
|
27337
|
+
return RESOLVES_NO_PROMPT;
|
|
27338
|
+
}
|
|
27339
|
+
|
|
27340
|
+
// src/commands/prs/raiseGuidance.ts
|
|
27174
27341
|
var DRAFT_DEFAULT_ON = `This repo has prs.draft set, so a raise creates a draft pull request unless
|
|
27175
27342
|
--no-draft is passed.`;
|
|
27176
27343
|
var DRAFT_DEFAULT_OFF = `This repo leaves prs.draft off, so a raise creates a ready-for-review pull
|
|
27177
27344
|
request unless --draft is passed.`;
|
|
27178
|
-
function
|
|
27179
|
-
const resolves = promptJira
|
|
27345
|
+
function raiseGuidance(promptJira, promptGithub, draft) {
|
|
27346
|
+
const resolves = resolvesBlurb(promptJira, promptGithub);
|
|
27180
27347
|
const draftDefault = draft ? DRAFT_DEFAULT_ON : DRAFT_DEFAULT_OFF;
|
|
27181
27348
|
return `Raise a pull request for the current branch. Use a concise description with no
|
|
27182
27349
|
headers, and do not reference Claude or any AI assistance in the title or body.
|
|
@@ -27223,6 +27390,8 @@ If a pull request already exists for the branch, this command errors \u2014 pass
|
|
|
27223
27390
|
--force to fully overwrite its title and body, or use 'assist prs edit' to update
|
|
27224
27391
|
only individual sections (every other section of the existing body is preserved).`;
|
|
27225
27392
|
}
|
|
27393
|
+
|
|
27394
|
+
// src/commands/prs/raiseHelpText.ts
|
|
27226
27395
|
var TERMINAL_CONFIRM = `Before running this command, the user must see the full proposed title and body \u2014
|
|
27227
27396
|
do not assume they can see your reasoning or earlier tool output. Write the
|
|
27228
27397
|
complete title and body verbatim in your visible reply, then use the
|
|
@@ -27243,13 +27412,14 @@ is approved. The reviewer may also drop or paste screenshots or video into the
|
|
|
27243
27412
|
pane; on approval these are appended to the PR body under a ## Screenshots section
|
|
27244
27413
|
automatically (they are discarded on rejection), so you never author that section
|
|
27245
27414
|
yourself. Just compose the sections and run the command.`;
|
|
27246
|
-
function raiseHelpText(promptJira, draft) {
|
|
27415
|
+
function raiseHelpText(promptJira, promptGithub, draft) {
|
|
27247
27416
|
const config = loadConfig().prs;
|
|
27248
|
-
const
|
|
27417
|
+
const jira = promptJira ?? config?.promptJira ?? false;
|
|
27418
|
+
const github = promptGithub ?? config?.promptGithub ?? false;
|
|
27249
27419
|
const draftDefault = draft ?? config?.draft ?? false;
|
|
27250
27420
|
const confirm = process.env.ASSIST_SESSION === "1" ? WEB_CONFIRM : TERMINAL_CONFIRM;
|
|
27251
27421
|
return `
|
|
27252
|
-
${
|
|
27422
|
+
${raiseGuidance(jira, github, draftDefault)}
|
|
27253
27423
|
|
|
27254
27424
|
${confirm}
|
|
27255
27425
|
`;
|
|
@@ -27288,7 +27458,7 @@ function registerPrsRaise(prsCommand) {
|
|
|
27288
27458
|
}
|
|
27289
27459
|
|
|
27290
27460
|
// src/commands/readTime/readTime.ts
|
|
27291
|
-
import { readFileSync as
|
|
27461
|
+
import { readFileSync as readFileSync46 } from "fs";
|
|
27292
27462
|
|
|
27293
27463
|
// src/commands/readTime/countReadingWords.ts
|
|
27294
27464
|
var FENCE_PATTERN = /^\s*(```|~~~)/;
|
|
@@ -27449,7 +27619,7 @@ async function loadBody(target) {
|
|
|
27449
27619
|
}
|
|
27450
27620
|
function readDraftFile(path91) {
|
|
27451
27621
|
try {
|
|
27452
|
-
return
|
|
27622
|
+
return readFileSync46(path91, "utf8");
|
|
27453
27623
|
} catch {
|
|
27454
27624
|
console.error(`Error: Could not read \`${path91}\`.`);
|
|
27455
27625
|
console.error(
|
|
@@ -29290,8 +29460,8 @@ function findRootParent(file, importedBy, visited) {
|
|
|
29290
29460
|
function clusterFiles(graph) {
|
|
29291
29461
|
const clusters = /* @__PURE__ */ new Map();
|
|
29292
29462
|
for (const file of graph.files) {
|
|
29293
|
-
const
|
|
29294
|
-
if (
|
|
29463
|
+
const basename29 = path62.basename(file, path62.extname(file));
|
|
29464
|
+
if (basename29 === "index") continue;
|
|
29295
29465
|
const importers = graph.importedBy.get(file);
|
|
29296
29466
|
if (!importers || importers.size !== 1) continue;
|
|
29297
29467
|
const parent = [...importers][0];
|
|
@@ -29715,21 +29885,21 @@ ${annotateDiffWithLineNumbers(context.diff.trimEnd())}
|
|
|
29715
29885
|
|
|
29716
29886
|
// src/commands/review/buildReviewPaths.ts
|
|
29717
29887
|
import { homedir as homedir23 } from "os";
|
|
29718
|
-
import { basename as
|
|
29888
|
+
import { basename as basename20, join as join74 } from "path";
|
|
29719
29889
|
function buildReviewPaths(repoRoot2, key) {
|
|
29720
|
-
const reviewDir =
|
|
29890
|
+
const reviewDir = join74(
|
|
29721
29891
|
homedir23(),
|
|
29722
29892
|
".assist",
|
|
29723
29893
|
"reviews",
|
|
29724
|
-
|
|
29894
|
+
basename20(repoRoot2),
|
|
29725
29895
|
key
|
|
29726
29896
|
);
|
|
29727
29897
|
return {
|
|
29728
29898
|
reviewDir,
|
|
29729
|
-
requestPath:
|
|
29730
|
-
claudePath:
|
|
29731
|
-
codexPath:
|
|
29732
|
-
synthesisPath:
|
|
29899
|
+
requestPath: join74(reviewDir, "request.md"),
|
|
29900
|
+
claudePath: join74(reviewDir, "claude.md"),
|
|
29901
|
+
codexPath: join74(reviewDir, "codex.md"),
|
|
29902
|
+
synthesisPath: join74(reviewDir, "synthesis.md")
|
|
29733
29903
|
};
|
|
29734
29904
|
}
|
|
29735
29905
|
|
|
@@ -29871,7 +30041,7 @@ function gatherContext() {
|
|
|
29871
30041
|
}
|
|
29872
30042
|
|
|
29873
30043
|
// src/commands/review/postReviewToPr.ts
|
|
29874
|
-
import { readFileSync as
|
|
30044
|
+
import { readFileSync as readFileSync47 } from "fs";
|
|
29875
30045
|
|
|
29876
30046
|
// src/commands/review/carriedUnanchoredFindings.ts
|
|
29877
30047
|
function carriedUnanchoredFindings(unanchored) {
|
|
@@ -30322,7 +30492,7 @@ async function confirmPost(prNumber, work, options2) {
|
|
|
30322
30492
|
return promptConfirm(`Post ${work} to PR #${prNumber}?`, false);
|
|
30323
30493
|
}
|
|
30324
30494
|
async function postFindingsToPr(prInfo, synthesisPath, options2) {
|
|
30325
|
-
const markdown =
|
|
30495
|
+
const markdown = readFileSync47(synthesisPath, "utf8");
|
|
30326
30496
|
const { inDiff, unanchored } = selectPostableFindings(markdown, prInfo);
|
|
30327
30497
|
const carried = carriedUnanchoredFindings(unanchored);
|
|
30328
30498
|
if (inDiff.length === 0 && carried.length === 0) return NOTHING_POSTED;
|
|
@@ -30458,10 +30628,10 @@ async function handlePostSynthesis(synthesisPath, prInfo, options2) {
|
|
|
30458
30628
|
}
|
|
30459
30629
|
|
|
30460
30630
|
// src/commands/review/prepareReviewDir.ts
|
|
30461
|
-
import { existsSync as
|
|
30631
|
+
import { existsSync as existsSync62, mkdirSync as mkdirSync21, unlinkSync as unlinkSync17, writeFileSync as writeFileSync38 } from "fs";
|
|
30462
30632
|
function clearReviewFiles(paths) {
|
|
30463
30633
|
for (const path91 of [paths.claudePath, paths.codexPath, paths.synthesisPath]) {
|
|
30464
|
-
if (
|
|
30634
|
+
if (existsSync62(path91)) unlinkSync17(path91);
|
|
30465
30635
|
}
|
|
30466
30636
|
}
|
|
30467
30637
|
function prepareReviewDir(paths, requestBody, force) {
|
|
@@ -30523,7 +30693,7 @@ import { format } from "util";
|
|
|
30523
30693
|
|
|
30524
30694
|
// src/commands/review/createReviewLogSink.ts
|
|
30525
30695
|
import { appendFileSync as appendFileSync2, mkdirSync as mkdirSync22 } from "fs";
|
|
30526
|
-
import { join as
|
|
30696
|
+
import { join as join75 } from "path";
|
|
30527
30697
|
|
|
30528
30698
|
// src/shared/stripAnsi.ts
|
|
30529
30699
|
var ANSI = new RegExp(
|
|
@@ -30551,7 +30721,7 @@ function createReviewLogSink() {
|
|
|
30551
30721
|
},
|
|
30552
30722
|
attach(reviewDir) {
|
|
30553
30723
|
mkdirSync22(reviewDir, { recursive: true });
|
|
30554
|
-
logPath2 =
|
|
30724
|
+
logPath2 = join75(reviewDir, LOG_FILE);
|
|
30555
30725
|
const lines2 = [
|
|
30556
30726
|
"",
|
|
30557
30727
|
`=== ${(/* @__PURE__ */ new Date()).toISOString()} ===`,
|
|
@@ -30765,7 +30935,7 @@ function printReviewerFailures(results) {
|
|
|
30765
30935
|
}
|
|
30766
30936
|
|
|
30767
30937
|
// src/commands/review/runAndSynthesise.ts
|
|
30768
|
-
import { existsSync as
|
|
30938
|
+
import { existsSync as existsSync64, unlinkSync as unlinkSync19 } from "fs";
|
|
30769
30939
|
|
|
30770
30940
|
// src/commands/review/buildReviewerStdin.ts
|
|
30771
30941
|
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.
|
|
@@ -31232,7 +31402,7 @@ function buildCodexModelArgs() {
|
|
|
31232
31402
|
}
|
|
31233
31403
|
|
|
31234
31404
|
// src/commands/review/runCodexReviewer.ts
|
|
31235
|
-
import { existsSync as
|
|
31405
|
+
import { existsSync as existsSync63, unlinkSync as unlinkSync18 } from "fs";
|
|
31236
31406
|
|
|
31237
31407
|
// src/commands/review/parseCodexEvent.ts
|
|
31238
31408
|
function isItemStarted(value) {
|
|
@@ -31287,7 +31457,7 @@ async function runCodexReviewer(spec) {
|
|
|
31287
31457
|
reportReviewerToolUse(spec.name, event, spinner, override.model);
|
|
31288
31458
|
}
|
|
31289
31459
|
});
|
|
31290
|
-
if (result.exitCode !== 0 &&
|
|
31460
|
+
if (result.exitCode !== 0 && existsSync63(spec.outputPath)) {
|
|
31291
31461
|
unlinkSync18(spec.outputPath);
|
|
31292
31462
|
}
|
|
31293
31463
|
return finaliseReviewerRun(
|
|
@@ -31342,7 +31512,7 @@ async function runReviewers(reviewDir, claudePath, codexPath, stdinPrompt, optio
|
|
|
31342
31512
|
}
|
|
31343
31513
|
|
|
31344
31514
|
// src/commands/review/synthesise.ts
|
|
31345
|
-
import { readFileSync as
|
|
31515
|
+
import { readFileSync as readFileSync48 } from "fs";
|
|
31346
31516
|
|
|
31347
31517
|
// src/commands/review/buildSynthesisStdin.ts
|
|
31348
31518
|
var SYNTHESIS_PROMPT = `You are consolidating two independent code reviews of the same change. The original review request is in request.md. The two reviews are in claude.md and codex.md in the current working directory.
|
|
@@ -31407,7 +31577,7 @@ Files:
|
|
|
31407
31577
|
|
|
31408
31578
|
// src/commands/review/synthesise.ts
|
|
31409
31579
|
function printSummary2(synthesisPath) {
|
|
31410
|
-
const markdown =
|
|
31580
|
+
const markdown = readFileSync48(synthesisPath, "utf8");
|
|
31411
31581
|
console.log("");
|
|
31412
31582
|
console.log(buildReviewSummary(markdown));
|
|
31413
31583
|
console.log("");
|
|
@@ -31455,7 +31625,7 @@ async function runAndSynthesise(args) {
|
|
|
31455
31625
|
console.error("Both reviewers failed; skipping synthesis.");
|
|
31456
31626
|
return { ok: false, failures };
|
|
31457
31627
|
}
|
|
31458
|
-
if (anyFresh &&
|
|
31628
|
+
if (anyFresh && existsSync64(paths.synthesisPath)) {
|
|
31459
31629
|
unlinkSync19(paths.synthesisPath);
|
|
31460
31630
|
}
|
|
31461
31631
|
const synthesisResult = await synthesise(paths, { multi });
|
|
@@ -31648,7 +31818,7 @@ function registerReview(program2) {
|
|
|
31648
31818
|
}
|
|
31649
31819
|
|
|
31650
31820
|
// src/commands/rules/addRule.ts
|
|
31651
|
-
import { existsSync as
|
|
31821
|
+
import { existsSync as existsSync67, readFileSync as readFileSync52, writeFileSync as writeFileSync41 } from "fs";
|
|
31652
31822
|
import path72 from "path";
|
|
31653
31823
|
import chalk211 from "chalk";
|
|
31654
31824
|
|
|
@@ -31673,15 +31843,15 @@ function insertRuleBullet(content, rule) {
|
|
|
31673
31843
|
}
|
|
31674
31844
|
|
|
31675
31845
|
// src/commands/rules/nextRuleCode.ts
|
|
31676
|
-
import { readFileSync as
|
|
31846
|
+
import { readFileSync as readFileSync49 } from "fs";
|
|
31677
31847
|
|
|
31678
31848
|
// src/commands/rules/findClaudeFiles.ts
|
|
31679
|
-
import { readdirSync as
|
|
31849
|
+
import { readdirSync as readdirSync14 } from "fs";
|
|
31680
31850
|
import path68 from "path";
|
|
31681
31851
|
var SKIP_DIRECTORIES = /* @__PURE__ */ new Set(["node_modules", "dist", "build", "coverage"]);
|
|
31682
31852
|
function findClaudeFiles(dir) {
|
|
31683
31853
|
const results = [];
|
|
31684
|
-
for (const entry of
|
|
31854
|
+
for (const entry of readdirSync14(dir, { withFileTypes: true })) {
|
|
31685
31855
|
if (entry.isDirectory()) {
|
|
31686
31856
|
if (entry.name.startsWith(".") || SKIP_DIRECTORIES.has(entry.name))
|
|
31687
31857
|
continue;
|
|
@@ -31697,7 +31867,7 @@ function findClaudeFiles(dir) {
|
|
|
31697
31867
|
var CODE_PREFIX = "R";
|
|
31698
31868
|
function nextRuleCode(root) {
|
|
31699
31869
|
const numbers = findClaudeFiles(root).flatMap(
|
|
31700
|
-
(file) => parseRulesSection(
|
|
31870
|
+
(file) => parseRulesSection(readFileSync49(file, "utf8")).map(
|
|
31701
31871
|
(rule) => Number(/(\d+)\s*$/.exec(rule.code)?.[1] ?? 0)
|
|
31702
31872
|
)
|
|
31703
31873
|
);
|
|
@@ -31705,7 +31875,7 @@ function nextRuleCode(root) {
|
|
|
31705
31875
|
}
|
|
31706
31876
|
|
|
31707
31877
|
// src/commands/rules/resolveRuleScope.ts
|
|
31708
|
-
import { existsSync as
|
|
31878
|
+
import { existsSync as existsSync65 } from "fs";
|
|
31709
31879
|
import path69 from "path";
|
|
31710
31880
|
function resolveRuleScope(target) {
|
|
31711
31881
|
const resolved = path69.resolve(target);
|
|
@@ -31715,7 +31885,7 @@ function resolveRuleScope(target) {
|
|
|
31715
31885
|
let current = startDir;
|
|
31716
31886
|
while (true) {
|
|
31717
31887
|
const candidate = path69.join(current, "CLAUDE.md");
|
|
31718
|
-
if (
|
|
31888
|
+
if (existsSync65(candidate)) return candidate;
|
|
31719
31889
|
if (current === root || current === path69.dirname(current)) break;
|
|
31720
31890
|
current = path69.dirname(current);
|
|
31721
31891
|
}
|
|
@@ -31723,15 +31893,15 @@ function resolveRuleScope(target) {
|
|
|
31723
31893
|
}
|
|
31724
31894
|
|
|
31725
31895
|
// src/commands/rules/updateScopedRulesIndex.ts
|
|
31726
|
-
import { existsSync as
|
|
31896
|
+
import { existsSync as existsSync66, readFileSync as readFileSync51, writeFileSync as writeFileSync40 } from "fs";
|
|
31727
31897
|
import path71 from "path";
|
|
31728
31898
|
|
|
31729
31899
|
// src/commands/rules/scopedRuleDirectories.ts
|
|
31730
|
-
import { readFileSync as
|
|
31900
|
+
import { readFileSync as readFileSync50 } from "fs";
|
|
31731
31901
|
import path70 from "path";
|
|
31732
31902
|
function scopedRuleDirectories(root) {
|
|
31733
31903
|
return findClaudeFiles(root).filter(
|
|
31734
|
-
(file) => path70.dirname(file) !== root && parseRulesSection(
|
|
31904
|
+
(file) => path70.dirname(file) !== root && parseRulesSection(readFileSync50(file, "utf8")).length > 0
|
|
31735
31905
|
).map(
|
|
31736
31906
|
(file) => `${path70.relative(root, path70.dirname(file)).split(path70.sep).join("/")}/`
|
|
31737
31907
|
).sort();
|
|
@@ -31773,7 +31943,7 @@ function upsertScopedRulesPointer(content, directories) {
|
|
|
31773
31943
|
function updateScopedRulesIndex(root) {
|
|
31774
31944
|
const directories = scopedRuleDirectories(root);
|
|
31775
31945
|
const rootFile = path71.join(root, "CLAUDE.md");
|
|
31776
|
-
const before =
|
|
31946
|
+
const before = existsSync66(rootFile) ? readFileSync51(rootFile, "utf8") : "";
|
|
31777
31947
|
const after = upsertScopedRulesPointer(before, directories);
|
|
31778
31948
|
if (after !== before) writeFileSync40(rootFile, after);
|
|
31779
31949
|
return directories;
|
|
@@ -31781,7 +31951,7 @@ function updateScopedRulesIndex(root) {
|
|
|
31781
31951
|
|
|
31782
31952
|
// src/commands/rules/addRule.ts
|
|
31783
31953
|
function read2(file) {
|
|
31784
|
-
return
|
|
31954
|
+
return existsSync67(file) ? readFileSync52(file, "utf8") : "";
|
|
31785
31955
|
}
|
|
31786
31956
|
function addRule(text18, options2) {
|
|
31787
31957
|
const rule = text18.trim();
|
|
@@ -32264,11 +32434,11 @@ async function reviewProposedSlackMessage(target, body, workingPath) {
|
|
|
32264
32434
|
}
|
|
32265
32435
|
|
|
32266
32436
|
// src/commands/slack/slackWorkingFile.ts
|
|
32267
|
-
import { join as
|
|
32437
|
+
import { join as join76 } from "path";
|
|
32268
32438
|
function slackWorkingFile(channel) {
|
|
32269
32439
|
const slug = channel.replace(/^[#@]/, "").toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^-+|-+$/g, "") || "channel";
|
|
32270
|
-
const dir =
|
|
32271
|
-
return { dir, bodyPath:
|
|
32440
|
+
const dir = join76(getStoreDir(), "slack");
|
|
32441
|
+
return { dir, bodyPath: join76(dir, `${slug}.md`) };
|
|
32272
32442
|
}
|
|
32273
32443
|
|
|
32274
32444
|
// src/commands/slack/postSlackMessage.ts
|
|
@@ -32595,7 +32765,7 @@ function registerSql(program2) {
|
|
|
32595
32765
|
import * as fs48 from "fs";
|
|
32596
32766
|
import * as os5 from "os";
|
|
32597
32767
|
import * as path85 from "path";
|
|
32598
|
-
import { fileURLToPath as
|
|
32768
|
+
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
32599
32769
|
|
|
32600
32770
|
// src/commands/sync/pruneCommands.ts
|
|
32601
32771
|
import * as path76 from "path";
|
|
@@ -32801,9 +32971,9 @@ function quoteYaml(value) {
|
|
|
32801
32971
|
}
|
|
32802
32972
|
function commandToSkill(name, content) {
|
|
32803
32973
|
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);
|
|
32804
|
-
const
|
|
32974
|
+
const frontmatter2 = match ? match[1] : "";
|
|
32805
32975
|
const body = match ? content.slice(match[0].length) : content;
|
|
32806
|
-
const descriptionMatch =
|
|
32976
|
+
const descriptionMatch = frontmatter2.match(/^description:\s*(.*)$/m);
|
|
32807
32977
|
const description = descriptionMatch ? descriptionMatch[1].trim().replace(/^["']|["']$/g, "") : name;
|
|
32808
32978
|
const header = `---
|
|
32809
32979
|
name: ${name}
|
|
@@ -32886,11 +33056,11 @@ function unquote2(value) {
|
|
|
32886
33056
|
}
|
|
32887
33057
|
function commandToPrompt(name, content) {
|
|
32888
33058
|
const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);
|
|
32889
|
-
const
|
|
33059
|
+
const frontmatter2 = match ? match[1] : "";
|
|
32890
33060
|
const body = match ? content.slice(match[0].length) : content;
|
|
32891
|
-
const descriptionMatch =
|
|
33061
|
+
const descriptionMatch = frontmatter2.match(/^description:\s*(.*)$/m);
|
|
32892
33062
|
const description = descriptionMatch ? unquote2(descriptionMatch[1]) : name;
|
|
32893
|
-
const argsMatch =
|
|
33063
|
+
const argsMatch = frontmatter2.match(/^allowed_args:\s*(.*)$/m);
|
|
32894
33064
|
const argumentHint = argsMatch ? unquote2(argsMatch[1]) : void 0;
|
|
32895
33065
|
const header = [
|
|
32896
33066
|
"---",
|
|
@@ -32967,7 +33137,7 @@ async function syncSettings(claudeDir, targetBase, options2) {
|
|
|
32967
33137
|
}
|
|
32968
33138
|
|
|
32969
33139
|
// src/commands/sync.ts
|
|
32970
|
-
var __filename4 =
|
|
33140
|
+
var __filename4 = fileURLToPath9(import.meta.url);
|
|
32971
33141
|
var __dirname5 = path85.dirname(__filename4);
|
|
32972
33142
|
async function sync(options2) {
|
|
32973
33143
|
const config = loadConfig();
|
|
@@ -33024,7 +33194,7 @@ function registerSync(program2) {
|
|
|
33024
33194
|
}
|
|
33025
33195
|
|
|
33026
33196
|
// src/commands/transcript/clean.ts
|
|
33027
|
-
import { existsSync as
|
|
33197
|
+
import { existsSync as existsSync72 } from "fs";
|
|
33028
33198
|
|
|
33029
33199
|
// src/commands/transcript/convert/formatTimestamp.ts
|
|
33030
33200
|
function pad(value, width) {
|
|
@@ -33274,9 +33444,9 @@ function formatVttPassages(passages, notes = [], { sourceMarks = true } = {}) {
|
|
|
33274
33444
|
}
|
|
33275
33445
|
|
|
33276
33446
|
// src/commands/transcript/convert/readCleanedCues.ts
|
|
33277
|
-
import { readFileSync as
|
|
33447
|
+
import { readFileSync as readFileSync57 } from "fs";
|
|
33278
33448
|
function readCleanedCues(inputPath) {
|
|
33279
|
-
return deduplicateCues(parseVtt(
|
|
33449
|
+
return deduplicateCues(parseVtt(readFileSync57(inputPath, "utf8")));
|
|
33280
33450
|
}
|
|
33281
33451
|
|
|
33282
33452
|
// src/commands/transcript/clean.ts
|
|
@@ -33302,7 +33472,7 @@ function clean(file, options2 = {}) {
|
|
|
33302
33472
|
);
|
|
33303
33473
|
process.exit(1);
|
|
33304
33474
|
}
|
|
33305
|
-
if (!
|
|
33475
|
+
if (!existsSync72(file)) {
|
|
33306
33476
|
console.error(`Error: VTT file not found: ${file}`);
|
|
33307
33477
|
process.exit(1);
|
|
33308
33478
|
}
|
|
@@ -33385,21 +33555,21 @@ async function configure() {
|
|
|
33385
33555
|
}
|
|
33386
33556
|
|
|
33387
33557
|
// src/commands/transcript/list.ts
|
|
33388
|
-
import { existsSync as
|
|
33389
|
-
import { join as
|
|
33558
|
+
import { existsSync as existsSync73, readdirSync as readdirSync21, statSync as statSync11 } from "fs";
|
|
33559
|
+
import { join as join87 } from "path";
|
|
33390
33560
|
function list4() {
|
|
33391
33561
|
const { vttDir } = getTranscriptConfig();
|
|
33392
|
-
if (!
|
|
33393
|
-
for (const entry of
|
|
33562
|
+
if (!existsSync73(vttDir)) return;
|
|
33563
|
+
for (const entry of readdirSync21(vttDir)) {
|
|
33394
33564
|
if (!entry.endsWith(".vtt")) continue;
|
|
33395
|
-
if (statSync11(
|
|
33565
|
+
if (statSync11(join87(vttDir, entry)).isDirectory()) continue;
|
|
33396
33566
|
console.log(entry);
|
|
33397
33567
|
}
|
|
33398
33568
|
}
|
|
33399
33569
|
|
|
33400
33570
|
// src/commands/transcript/move.ts
|
|
33401
|
-
import { existsSync as
|
|
33402
|
-
import { basename as
|
|
33571
|
+
import { existsSync as existsSync74, mkdirSync as mkdirSync29, renameSync as renameSync2, writeFileSync as writeFileSync46 } from "fs";
|
|
33572
|
+
import { basename as basename23, join as join88 } from "path";
|
|
33403
33573
|
|
|
33404
33574
|
// src/commands/transcript/convertVttToMarkdown.ts
|
|
33405
33575
|
function convertVttToMarkdown(inputPath) {
|
|
@@ -33409,9 +33579,9 @@ function convertVttToMarkdown(inputPath) {
|
|
|
33409
33579
|
// src/commands/transcript/move.ts
|
|
33410
33580
|
var DATE_REGEX = /^\d{4}-\d{2}-\d{2}$/;
|
|
33411
33581
|
function archiveRawVtt(vttDir, sourcePath, filename) {
|
|
33412
|
-
const processedDir =
|
|
33582
|
+
const processedDir = join88(vttDir, "processed");
|
|
33413
33583
|
mkdirSync29(processedDir, { recursive: true });
|
|
33414
|
-
renameSync2(sourcePath,
|
|
33584
|
+
renameSync2(sourcePath, join88(processedDir, filename));
|
|
33415
33585
|
}
|
|
33416
33586
|
function move(file, options2) {
|
|
33417
33587
|
const { date, client } = options2;
|
|
@@ -33420,27 +33590,27 @@ function move(file, options2) {
|
|
|
33420
33590
|
process.exit(1);
|
|
33421
33591
|
}
|
|
33422
33592
|
const { vttDir, transcriptsDir, summaryDir } = getTranscriptConfig();
|
|
33423
|
-
const filename =
|
|
33424
|
-
const sourcePath =
|
|
33425
|
-
if (!
|
|
33593
|
+
const filename = basename23(file);
|
|
33594
|
+
const sourcePath = join88(vttDir, filename);
|
|
33595
|
+
if (!existsSync74(sourcePath)) {
|
|
33426
33596
|
console.error(`Error: VTT file not found: ${sourcePath}`);
|
|
33427
33597
|
process.exit(1);
|
|
33428
33598
|
}
|
|
33429
|
-
const base =
|
|
33599
|
+
const base = basename23(filename, ".vtt").replace(/ Transcription$/, "");
|
|
33430
33600
|
const outputName = `${date} ${base}.md`;
|
|
33431
|
-
const formattedDir =
|
|
33601
|
+
const formattedDir = join88(transcriptsDir, client);
|
|
33432
33602
|
mkdirSync29(formattedDir, { recursive: true });
|
|
33433
|
-
const formattedPath =
|
|
33603
|
+
const formattedPath = join88(formattedDir, outputName);
|
|
33434
33604
|
writeFileSync46(formattedPath, convertVttToMarkdown(sourcePath), "utf8");
|
|
33435
33605
|
archiveRawVtt(vttDir, sourcePath, filename);
|
|
33436
|
-
const summaryPath =
|
|
33606
|
+
const summaryPath = join88(summaryDir, client, outputName);
|
|
33437
33607
|
console.log(`Formatted transcript: ${formattedPath}`);
|
|
33438
33608
|
console.log(`Summary target: ${summaryPath}`);
|
|
33439
33609
|
}
|
|
33440
33610
|
|
|
33441
33611
|
// src/commands/transcript/merge.ts
|
|
33442
|
-
import { existsSync as
|
|
33443
|
-
import { basename as
|
|
33612
|
+
import { existsSync as existsSync75, writeFileSync as writeFileSync47 } from "fs";
|
|
33613
|
+
import { basename as basename24 } from "path";
|
|
33444
33614
|
|
|
33445
33615
|
// src/commands/transcript/failTranscript.ts
|
|
33446
33616
|
function failTranscript(message3) {
|
|
@@ -33583,10 +33753,10 @@ function widenAudience(passages) {
|
|
|
33583
33753
|
|
|
33584
33754
|
// src/commands/transcript/merge.ts
|
|
33585
33755
|
function readSource2(file) {
|
|
33586
|
-
if (!
|
|
33756
|
+
if (!existsSync75(file)) failTranscript(`VTT file not found: ${file}`);
|
|
33587
33757
|
const cues = readCleanedCues(file);
|
|
33588
33758
|
if (cues.length === 0) failTranscript(`no cues found in: ${file}`);
|
|
33589
|
-
return { path: file, name:
|
|
33759
|
+
return { path: file, name: basename24(file), cues };
|
|
33590
33760
|
}
|
|
33591
33761
|
function wholePassages(sources) {
|
|
33592
33762
|
return sources.map((source) => ({
|
|
@@ -33747,50 +33917,50 @@ function registerVerify(program2) {
|
|
|
33747
33917
|
|
|
33748
33918
|
// src/commands/voice/devices.ts
|
|
33749
33919
|
import { spawnSync as spawnSync9 } from "child_process";
|
|
33750
|
-
import { join as
|
|
33920
|
+
import { join as join90 } from "path";
|
|
33751
33921
|
|
|
33752
33922
|
// src/commands/voice/shared.ts
|
|
33753
33923
|
import { homedir as homedir25 } from "os";
|
|
33754
|
-
import { dirname as
|
|
33755
|
-
import { fileURLToPath as
|
|
33756
|
-
var __dirname6 =
|
|
33757
|
-
var VOICE_DIR =
|
|
33924
|
+
import { dirname as dirname37, join as join89 } from "path";
|
|
33925
|
+
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
33926
|
+
var __dirname6 = dirname37(fileURLToPath10(import.meta.url));
|
|
33927
|
+
var VOICE_DIR = join89(homedir25(), ".assist", "voice");
|
|
33758
33928
|
var voicePaths = {
|
|
33759
33929
|
dir: VOICE_DIR,
|
|
33760
|
-
pid:
|
|
33761
|
-
log:
|
|
33762
|
-
venv:
|
|
33763
|
-
lock:
|
|
33930
|
+
pid: join89(VOICE_DIR, "voice.pid"),
|
|
33931
|
+
log: join89(VOICE_DIR, "voice.log"),
|
|
33932
|
+
venv: join89(VOICE_DIR, ".venv"),
|
|
33933
|
+
lock: join89(VOICE_DIR, "voice.lock")
|
|
33764
33934
|
};
|
|
33765
33935
|
function getPythonDir() {
|
|
33766
|
-
return
|
|
33936
|
+
return join89(__dirname6, "commands", "voice", "python");
|
|
33767
33937
|
}
|
|
33768
33938
|
function getVenvPython() {
|
|
33769
|
-
return process.platform === "win32" ?
|
|
33939
|
+
return process.platform === "win32" ? join89(voicePaths.venv, "Scripts", "python.exe") : join89(voicePaths.venv, "bin", "python");
|
|
33770
33940
|
}
|
|
33771
33941
|
function getLockDir() {
|
|
33772
33942
|
const config = loadConfig();
|
|
33773
33943
|
return config.voice?.lockDir ?? VOICE_DIR;
|
|
33774
33944
|
}
|
|
33775
33945
|
function getLockFile() {
|
|
33776
|
-
return
|
|
33946
|
+
return join89(getLockDir(), "voice.lock");
|
|
33777
33947
|
}
|
|
33778
33948
|
|
|
33779
33949
|
// src/commands/voice/devices.ts
|
|
33780
33950
|
function devices() {
|
|
33781
|
-
const script =
|
|
33951
|
+
const script = join90(getPythonDir(), "list_devices.py");
|
|
33782
33952
|
spawnSync9(getVenvPython(), [script], { stdio: "inherit" });
|
|
33783
33953
|
}
|
|
33784
33954
|
|
|
33785
33955
|
// src/commands/voice/logs.ts
|
|
33786
|
-
import { existsSync as
|
|
33956
|
+
import { existsSync as existsSync76, readFileSync as readFileSync58 } from "fs";
|
|
33787
33957
|
function logs(options2) {
|
|
33788
|
-
if (!
|
|
33958
|
+
if (!existsSync76(voicePaths.log)) {
|
|
33789
33959
|
console.log("No voice log file found");
|
|
33790
33960
|
return;
|
|
33791
33961
|
}
|
|
33792
33962
|
const count8 = Number.parseInt(options2.lines ?? "150", 10);
|
|
33793
|
-
const content =
|
|
33963
|
+
const content = readFileSync58(voicePaths.log, "utf8").trim();
|
|
33794
33964
|
if (!content) {
|
|
33795
33965
|
console.log("Voice log is empty");
|
|
33796
33966
|
return;
|
|
@@ -33813,12 +33983,12 @@ function logs(options2) {
|
|
|
33813
33983
|
// src/commands/voice/setup.ts
|
|
33814
33984
|
import { spawnSync as spawnSync10 } from "child_process";
|
|
33815
33985
|
import { mkdirSync as mkdirSync31 } from "fs";
|
|
33816
|
-
import { join as
|
|
33986
|
+
import { join as join92 } from "path";
|
|
33817
33987
|
|
|
33818
33988
|
// src/commands/voice/checkLockFile.ts
|
|
33819
33989
|
import { execSync as execSync60 } from "child_process";
|
|
33820
|
-
import { existsSync as
|
|
33821
|
-
import { join as
|
|
33990
|
+
import { existsSync as existsSync77, mkdirSync as mkdirSync30, readFileSync as readFileSync59, writeFileSync as writeFileSync48 } from "fs";
|
|
33991
|
+
import { join as join91 } from "path";
|
|
33822
33992
|
function isProcessAlive2(pid) {
|
|
33823
33993
|
try {
|
|
33824
33994
|
process.kill(pid, 0);
|
|
@@ -33829,9 +33999,9 @@ function isProcessAlive2(pid) {
|
|
|
33829
33999
|
}
|
|
33830
34000
|
function checkLockFile() {
|
|
33831
34001
|
const lockFile = getLockFile();
|
|
33832
|
-
if (!
|
|
34002
|
+
if (!existsSync77(lockFile)) return;
|
|
33833
34003
|
try {
|
|
33834
|
-
const lock2 = JSON.parse(
|
|
34004
|
+
const lock2 = JSON.parse(readFileSync59(lockFile, "utf8"));
|
|
33835
34005
|
if (lock2.pid && isProcessAlive2(lock2.pid)) {
|
|
33836
34006
|
console.error(
|
|
33837
34007
|
`Voice daemon already running (PID ${lock2.pid}, env: ${lock2.env}). Stop it first with: assist voice stop`
|
|
@@ -33842,7 +34012,7 @@ function checkLockFile() {
|
|
|
33842
34012
|
}
|
|
33843
34013
|
}
|
|
33844
34014
|
function bootstrapVenv() {
|
|
33845
|
-
if (
|
|
34015
|
+
if (existsSync77(getVenvPython())) return;
|
|
33846
34016
|
console.log("Setting up Python environment...");
|
|
33847
34017
|
const pythonDir = getPythonDir();
|
|
33848
34018
|
execSync60(
|
|
@@ -33855,7 +34025,7 @@ function bootstrapVenv() {
|
|
|
33855
34025
|
}
|
|
33856
34026
|
function writeLockFile(pid) {
|
|
33857
34027
|
const lockFile = getLockFile();
|
|
33858
|
-
mkdirSync30(
|
|
34028
|
+
mkdirSync30(join91(lockFile, ".."), { recursive: true });
|
|
33859
34029
|
writeFileSync48(
|
|
33860
34030
|
lockFile,
|
|
33861
34031
|
JSON.stringify({
|
|
@@ -33871,7 +34041,7 @@ function setup() {
|
|
|
33871
34041
|
mkdirSync31(voicePaths.dir, { recursive: true });
|
|
33872
34042
|
bootstrapVenv();
|
|
33873
34043
|
console.log("\nDownloading models...\n");
|
|
33874
|
-
const script =
|
|
34044
|
+
const script = join92(getPythonDir(), "setup_models.py");
|
|
33875
34045
|
const result = spawnSync10(getVenvPython(), [script], {
|
|
33876
34046
|
stdio: "inherit",
|
|
33877
34047
|
env: { ...process.env, VOICE_LOG_FILE: voicePaths.log }
|
|
@@ -33885,7 +34055,7 @@ function setup() {
|
|
|
33885
34055
|
// src/commands/voice/start.ts
|
|
33886
34056
|
import { spawn as spawn8 } from "child_process";
|
|
33887
34057
|
import { mkdirSync as mkdirSync32, writeFileSync as writeFileSync49 } from "fs";
|
|
33888
|
-
import { join as
|
|
34058
|
+
import { join as join93 } from "path";
|
|
33889
34059
|
|
|
33890
34060
|
// src/commands/voice/buildDaemonEnv.ts
|
|
33891
34061
|
function buildDaemonEnv(options2) {
|
|
@@ -33923,7 +34093,7 @@ function start2(options2) {
|
|
|
33923
34093
|
bootstrapVenv();
|
|
33924
34094
|
const debug = options2.debug || options2.foreground || process.platform === "win32";
|
|
33925
34095
|
const env = buildDaemonEnv({ debug });
|
|
33926
|
-
const script =
|
|
34096
|
+
const script = join93(getPythonDir(), "voice_daemon.py");
|
|
33927
34097
|
const python = getVenvPython();
|
|
33928
34098
|
if (options2.foreground) {
|
|
33929
34099
|
spawnForeground(python, script, env);
|
|
@@ -33933,7 +34103,7 @@ function start2(options2) {
|
|
|
33933
34103
|
}
|
|
33934
34104
|
|
|
33935
34105
|
// src/commands/voice/status.ts
|
|
33936
|
-
import { existsSync as
|
|
34106
|
+
import { existsSync as existsSync78, readFileSync as readFileSync60 } from "fs";
|
|
33937
34107
|
function isProcessAlive3(pid) {
|
|
33938
34108
|
try {
|
|
33939
34109
|
process.kill(pid, 0);
|
|
@@ -33943,16 +34113,16 @@ function isProcessAlive3(pid) {
|
|
|
33943
34113
|
}
|
|
33944
34114
|
}
|
|
33945
34115
|
function readRecentLogs(count8) {
|
|
33946
|
-
if (!
|
|
33947
|
-
const lines2 =
|
|
34116
|
+
if (!existsSync78(voicePaths.log)) return [];
|
|
34117
|
+
const lines2 = readFileSync60(voicePaths.log, "utf8").trim().split("\n");
|
|
33948
34118
|
return lines2.slice(-count8);
|
|
33949
34119
|
}
|
|
33950
34120
|
function status2() {
|
|
33951
|
-
if (!
|
|
34121
|
+
if (!existsSync78(voicePaths.pid)) {
|
|
33952
34122
|
console.log("Voice daemon: not running (no PID file)");
|
|
33953
34123
|
return;
|
|
33954
34124
|
}
|
|
33955
|
-
const pid = Number.parseInt(
|
|
34125
|
+
const pid = Number.parseInt(readFileSync60(voicePaths.pid, "utf8").trim(), 10);
|
|
33956
34126
|
const alive = isProcessAlive3(pid);
|
|
33957
34127
|
console.log(`Voice daemon: ${alive ? "running" : "dead"} (PID ${pid})`);
|
|
33958
34128
|
const recent = readRecentLogs(5);
|
|
@@ -33971,13 +34141,13 @@ function status2() {
|
|
|
33971
34141
|
}
|
|
33972
34142
|
|
|
33973
34143
|
// src/commands/voice/stop.ts
|
|
33974
|
-
import { existsSync as
|
|
34144
|
+
import { existsSync as existsSync79, readFileSync as readFileSync61, unlinkSync as unlinkSync20 } from "fs";
|
|
33975
34145
|
function stop2() {
|
|
33976
|
-
if (!
|
|
34146
|
+
if (!existsSync79(voicePaths.pid)) {
|
|
33977
34147
|
console.log("Voice daemon is not running (no PID file)");
|
|
33978
34148
|
return;
|
|
33979
34149
|
}
|
|
33980
|
-
const pid = Number.parseInt(
|
|
34150
|
+
const pid = Number.parseInt(readFileSync61(voicePaths.pid, "utf8").trim(), 10);
|
|
33981
34151
|
try {
|
|
33982
34152
|
process.kill(pid, "SIGTERM");
|
|
33983
34153
|
console.log(`Sent SIGTERM to voice daemon (PID ${pid})`);
|
|
@@ -33990,7 +34160,7 @@ function stop2() {
|
|
|
33990
34160
|
}
|
|
33991
34161
|
try {
|
|
33992
34162
|
const lockFile = getLockFile();
|
|
33993
|
-
if (
|
|
34163
|
+
if (existsSync79(lockFile)) unlinkSync20(lockFile);
|
|
33994
34164
|
} catch {
|
|
33995
34165
|
}
|
|
33996
34166
|
console.log("Voice daemon stopped");
|
|
@@ -34054,11 +34224,11 @@ function changedPaths(from, cwd) {
|
|
|
34054
34224
|
}
|
|
34055
34225
|
|
|
34056
34226
|
// src/commands/watch/readBuiltVersion.ts
|
|
34057
|
-
import { join as
|
|
34227
|
+
import { join as join94 } from "path";
|
|
34058
34228
|
function readBuiltVersion(cwd) {
|
|
34059
34229
|
try {
|
|
34060
34230
|
const root = runGit3(["rev-parse", "--show-toplevel"], cwd);
|
|
34061
|
-
return readPackageJson(
|
|
34231
|
+
return readPackageJson(join94(root, "package.json")).version ?? "unknown";
|
|
34062
34232
|
} catch {
|
|
34063
34233
|
return "unknown";
|
|
34064
34234
|
}
|
|
@@ -34395,7 +34565,7 @@ function resolveParams(params, cliArgs) {
|
|
|
34395
34565
|
}
|
|
34396
34566
|
|
|
34397
34567
|
// src/commands/run/resolveRunCwd.ts
|
|
34398
|
-
import { existsSync as
|
|
34568
|
+
import { existsSync as existsSync80 } from "fs";
|
|
34399
34569
|
import { resolve as resolve19 } from "path";
|
|
34400
34570
|
var MissingRunCwdError = class extends Error {
|
|
34401
34571
|
constructor(runName, cwd) {
|
|
@@ -34408,25 +34578,25 @@ var MissingRunCwdError = class extends Error {
|
|
|
34408
34578
|
function resolveRunCwd(config, baseDir = runConfigBaseDir()) {
|
|
34409
34579
|
if (!config.cwd) return void 0;
|
|
34410
34580
|
const cwd = resolve19(baseDir, config.cwd);
|
|
34411
|
-
if (!
|
|
34581
|
+
if (!existsSync80(cwd)) throw new MissingRunCwdError(config.name, cwd);
|
|
34412
34582
|
return cwd;
|
|
34413
34583
|
}
|
|
34414
34584
|
|
|
34415
34585
|
// src/commands/run/runCommandToCompletion.ts
|
|
34416
34586
|
import { spawn as spawn9 } from "child_process";
|
|
34417
|
-
import { existsSync as
|
|
34587
|
+
import { existsSync as existsSync82 } from "fs";
|
|
34418
34588
|
|
|
34419
34589
|
// src/commands/run/resolveCommand.ts
|
|
34420
34590
|
import { execFileSync as execFileSync18 } from "child_process";
|
|
34421
|
-
import { existsSync as
|
|
34422
|
-
import { dirname as
|
|
34591
|
+
import { existsSync as existsSync81 } from "fs";
|
|
34592
|
+
import { dirname as dirname38, join as join95, resolve as resolve20 } from "path";
|
|
34423
34593
|
function resolveCommand2(command) {
|
|
34424
34594
|
if (process.platform !== "win32" || command !== "bash") return command;
|
|
34425
34595
|
try {
|
|
34426
34596
|
const gitPath = execFileSync18("where", ["git"], { encoding: "utf8" }).trim().split("\r\n")[0];
|
|
34427
|
-
const gitRoot = resolve20(
|
|
34428
|
-
const gitBash =
|
|
34429
|
-
if (
|
|
34597
|
+
const gitRoot = resolve20(dirname38(gitPath), "..");
|
|
34598
|
+
const gitBash = join95(gitRoot, "bin", "bash.exe");
|
|
34599
|
+
if (existsSync81(gitBash)) return gitBash;
|
|
34430
34600
|
} catch {
|
|
34431
34601
|
return command;
|
|
34432
34602
|
}
|
|
@@ -34436,7 +34606,7 @@ function resolveCommand2(command) {
|
|
|
34436
34606
|
// src/commands/run/runCommandToCompletion.ts
|
|
34437
34607
|
function runCommandToCompletion(command, args, env, cwd, quiet) {
|
|
34438
34608
|
return new Promise((resolveResult) => {
|
|
34439
|
-
if (cwd && !
|
|
34609
|
+
if (cwd && !existsSync82(cwd)) {
|
|
34440
34610
|
resolveResult({
|
|
34441
34611
|
kind: "failed",
|
|
34442
34612
|
message: `Failed to execute command: cwd ${cwd} does not exist`
|
|
@@ -34852,17 +35022,17 @@ async function auth() {
|
|
|
34852
35022
|
|
|
34853
35023
|
// src/commands/roam/postRoamActivity.ts
|
|
34854
35024
|
import { execFileSync as execFileSync20 } from "child_process";
|
|
34855
|
-
import { readdirSync as
|
|
34856
|
-
import { join as
|
|
35025
|
+
import { readdirSync as readdirSync22, readFileSync as readFileSync62, statSync as statSync12 } from "fs";
|
|
35026
|
+
import { join as join96 } from "path";
|
|
34857
35027
|
function findPortFile(roamDir) {
|
|
34858
35028
|
let entries;
|
|
34859
35029
|
try {
|
|
34860
|
-
entries =
|
|
35030
|
+
entries = readdirSync22(roamDir);
|
|
34861
35031
|
} catch {
|
|
34862
35032
|
return void 0;
|
|
34863
35033
|
}
|
|
34864
35034
|
const candidates = entries.filter((name) => /^roam-local-api(-[^.]+)?\.port$/.test(name)).map((name) => {
|
|
34865
|
-
const path91 =
|
|
35035
|
+
const path91 = join96(roamDir, name);
|
|
34866
35036
|
try {
|
|
34867
35037
|
return { path: path91, mtimeMs: statSync12(path91).mtimeMs };
|
|
34868
35038
|
} catch {
|
|
@@ -34879,11 +35049,11 @@ var PID_BY_APP = {
|
|
|
34879
35049
|
function postRoamActivity(app, event) {
|
|
34880
35050
|
const appData = process.env.APPDATA;
|
|
34881
35051
|
if (!appData) return;
|
|
34882
|
-
const portFile = findPortFile(
|
|
35052
|
+
const portFile = findPortFile(join96(appData, "Roam"));
|
|
34883
35053
|
if (!portFile) return;
|
|
34884
35054
|
let port;
|
|
34885
35055
|
try {
|
|
34886
|
-
port =
|
|
35056
|
+
port = readFileSync62(portFile, "utf8").trim();
|
|
34887
35057
|
} catch {
|
|
34888
35058
|
return;
|
|
34889
35059
|
}
|
|
@@ -35015,7 +35185,7 @@ async function run3(name, args) {
|
|
|
35015
35185
|
|
|
35016
35186
|
// src/commands/run/add.ts
|
|
35017
35187
|
import { mkdirSync as mkdirSync33, writeFileSync as writeFileSync50 } from "fs";
|
|
35018
|
-
import { join as
|
|
35188
|
+
import { join as join97 } from "path";
|
|
35019
35189
|
|
|
35020
35190
|
// src/commands/run/extractOption.ts
|
|
35021
35191
|
function extractOption(args, flag) {
|
|
@@ -35076,7 +35246,7 @@ function saveNewRunConfig(name, command, args, cwd) {
|
|
|
35076
35246
|
saveConfig(config);
|
|
35077
35247
|
}
|
|
35078
35248
|
function createCommandFile(name) {
|
|
35079
|
-
const dir =
|
|
35249
|
+
const dir = join97(".claude", "commands");
|
|
35080
35250
|
mkdirSync33(dir, { recursive: true });
|
|
35081
35251
|
const content = `---
|
|
35082
35252
|
description: Run ${name}
|
|
@@ -35084,7 +35254,7 @@ description: Run ${name}
|
|
|
35084
35254
|
|
|
35085
35255
|
Run \`assist run ${name} $ARGUMENTS 2>&1\`.
|
|
35086
35256
|
`;
|
|
35087
|
-
const filePath =
|
|
35257
|
+
const filePath = join97(dir, `${name}.md`);
|
|
35088
35258
|
writeFileSync50(filePath, content);
|
|
35089
35259
|
console.log(`Created command file: ${filePath}`);
|
|
35090
35260
|
}
|
|
@@ -35140,8 +35310,8 @@ function link2() {
|
|
|
35140
35310
|
}
|
|
35141
35311
|
|
|
35142
35312
|
// src/commands/run/remove.ts
|
|
35143
|
-
import { existsSync as
|
|
35144
|
-
import { join as
|
|
35313
|
+
import { existsSync as existsSync83, unlinkSync as unlinkSync21 } from "fs";
|
|
35314
|
+
import { join as join98 } from "path";
|
|
35145
35315
|
function findRemoveIndex() {
|
|
35146
35316
|
const idx = process.argv.indexOf("remove");
|
|
35147
35317
|
if (idx === -1 || idx + 1 >= process.argv.length) return -1;
|
|
@@ -35156,8 +35326,8 @@ function parseRemoveName() {
|
|
|
35156
35326
|
return process.argv[idx + 1];
|
|
35157
35327
|
}
|
|
35158
35328
|
function deleteCommandFile(name) {
|
|
35159
|
-
const filePath =
|
|
35160
|
-
if (
|
|
35329
|
+
const filePath = join98(".claude", "commands", `${name}.md`);
|
|
35330
|
+
if (existsSync83(filePath)) {
|
|
35161
35331
|
unlinkSync21(filePath);
|
|
35162
35332
|
console.log(`Deleted command file: ${filePath}`);
|
|
35163
35333
|
}
|
|
@@ -35202,9 +35372,9 @@ function registerRun(program2) {
|
|
|
35202
35372
|
|
|
35203
35373
|
// src/commands/screenshot/index.ts
|
|
35204
35374
|
import { execSync as execSync62 } from "child_process";
|
|
35205
|
-
import { existsSync as
|
|
35375
|
+
import { existsSync as existsSync84, mkdirSync as mkdirSync34, unlinkSync as unlinkSync22, writeFileSync as writeFileSync51 } from "fs";
|
|
35206
35376
|
import { tmpdir as tmpdir9 } from "os";
|
|
35207
|
-
import { join as
|
|
35377
|
+
import { join as join99, resolve as resolve21 } from "path";
|
|
35208
35378
|
import chalk229 from "chalk";
|
|
35209
35379
|
|
|
35210
35380
|
// src/commands/screenshot/captureWindowPs1.ts
|
|
@@ -35334,14 +35504,14 @@ Write-Output $OutputPath
|
|
|
35334
35504
|
|
|
35335
35505
|
// src/commands/screenshot/index.ts
|
|
35336
35506
|
function buildOutputPath(outputDir, processName) {
|
|
35337
|
-
if (!
|
|
35507
|
+
if (!existsSync84(outputDir)) {
|
|
35338
35508
|
mkdirSync34(outputDir, { recursive: true });
|
|
35339
35509
|
}
|
|
35340
35510
|
const timestamp6 = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
35341
35511
|
return resolve21(outputDir, `${processName}-${timestamp6}.png`);
|
|
35342
35512
|
}
|
|
35343
35513
|
function runPowerShellScript(processName, outputPath) {
|
|
35344
|
-
const scriptPath =
|
|
35514
|
+
const scriptPath = join99(tmpdir9(), `assist-screenshot-${Date.now()}.ps1`);
|
|
35345
35515
|
writeFileSync51(scriptPath, captureWindowPs1, "utf8");
|
|
35346
35516
|
try {
|
|
35347
35517
|
execSync62(
|
|
@@ -35418,11 +35588,11 @@ function applyLine(result, pending, line) {
|
|
|
35418
35588
|
}
|
|
35419
35589
|
|
|
35420
35590
|
// src/commands/sessions/daemon/readDaemonPidFile.ts
|
|
35421
|
-
import { readFileSync as
|
|
35591
|
+
import { readFileSync as readFileSync63 } from "fs";
|
|
35422
35592
|
function readDaemonPidFile() {
|
|
35423
35593
|
try {
|
|
35424
35594
|
const pid = Number.parseInt(
|
|
35425
|
-
|
|
35595
|
+
readFileSync63(daemonPaths.pid, "utf8").trim(),
|
|
35426
35596
|
10
|
|
35427
35597
|
);
|
|
35428
35598
|
return Number.isInteger(pid) ? pid : void 0;
|
|
@@ -35685,12 +35855,12 @@ function toSessionRunInfo({
|
|
|
35685
35855
|
}
|
|
35686
35856
|
|
|
35687
35857
|
// src/commands/sessions/daemon/worktree/joinRefusal.ts
|
|
35688
|
-
import { existsSync as
|
|
35858
|
+
import { existsSync as existsSync85 } from "fs";
|
|
35689
35859
|
function joinRefusal(session) {
|
|
35690
35860
|
if (session.commandType === "run") return "a server run has no agent stream";
|
|
35691
35861
|
if (session.closing === true) return "the session is closing";
|
|
35692
35862
|
if (!session.cwd) return "the session has no working directory";
|
|
35693
|
-
if (!
|
|
35863
|
+
if (!existsSync85(session.cwd))
|
|
35694
35864
|
return "the session's workspace no longer exists";
|
|
35695
35865
|
return void 0;
|
|
35696
35866
|
}
|
|
@@ -35854,11 +36024,11 @@ function sessionBase(id, status3) {
|
|
|
35854
36024
|
}
|
|
35855
36025
|
|
|
35856
36026
|
// src/commands/sessions/daemon/spawnPty.ts
|
|
35857
|
-
import { existsSync as
|
|
36027
|
+
import { existsSync as existsSync87 } from "fs";
|
|
35858
36028
|
import * as pty from "node-pty";
|
|
35859
36029
|
|
|
35860
36030
|
// src/commands/sessions/daemon/ensureSpawnHelperExecutable.ts
|
|
35861
|
-
import { chmodSync, existsSync as
|
|
36031
|
+
import { chmodSync, existsSync as existsSync86, statSync as statSync13 } from "fs";
|
|
35862
36032
|
import { createRequire as createRequire3 } from "module";
|
|
35863
36033
|
import path86 from "path";
|
|
35864
36034
|
var require4 = createRequire3(import.meta.url);
|
|
@@ -35873,7 +36043,7 @@ function ensureSpawnHelperExecutable() {
|
|
|
35873
36043
|
`${process.platform}-${process.arch}`,
|
|
35874
36044
|
"spawn-helper"
|
|
35875
36045
|
);
|
|
35876
|
-
if (!
|
|
36046
|
+
if (!existsSync86(helper)) return;
|
|
35877
36047
|
const mode = statSync13(helper).mode;
|
|
35878
36048
|
if ((mode & 73) === 0) chmodSync(helper, mode | 493);
|
|
35879
36049
|
}
|
|
@@ -35909,7 +36079,7 @@ function spawnPty(args, cwd, sessionId, extraEnv) {
|
|
|
35909
36079
|
});
|
|
35910
36080
|
}
|
|
35911
36081
|
function refuseMissingCwd(cwd, sessionId) {
|
|
35912
|
-
if (!cwd ||
|
|
36082
|
+
if (!cwd || existsSync87(cwd)) return;
|
|
35913
36083
|
daemonLog(
|
|
35914
36084
|
`${sessionId ? `session ${sessionId}` : "pty"} not spawned: working directory ${cwd} no longer exists`
|
|
35915
36085
|
);
|
|
@@ -35989,8 +36159,8 @@ function serverRunMeta(runName, cwd) {
|
|
|
35989
36159
|
// src/commands/sessions/daemon/readDesignSystemPrompt.ts
|
|
35990
36160
|
import * as fs49 from "fs";
|
|
35991
36161
|
import * as path87 from "path";
|
|
35992
|
-
import { fileURLToPath as
|
|
35993
|
-
var __filename5 =
|
|
36162
|
+
import { fileURLToPath as fileURLToPath11 } from "url";
|
|
36163
|
+
var __filename5 = fileURLToPath11(import.meta.url);
|
|
35994
36164
|
var __dirname7 = path87.dirname(__filename5);
|
|
35995
36165
|
function readDesignSystemPrompt() {
|
|
35996
36166
|
const promptPath = path87.join(
|
|
@@ -36091,17 +36261,17 @@ function setStatus2(session, newStatus) {
|
|
|
36091
36261
|
}
|
|
36092
36262
|
|
|
36093
36263
|
// src/commands/sessions/daemon/worktree/reapWorktree.ts
|
|
36094
|
-
import { existsSync as
|
|
36095
|
-
import { basename as
|
|
36264
|
+
import { existsSync as existsSync89 } from "fs";
|
|
36265
|
+
import { basename as basename25 } from "path";
|
|
36096
36266
|
|
|
36097
36267
|
// src/commands/sessions/daemon/worktree/deleteStrandedTree.ts
|
|
36098
|
-
import { existsSync as
|
|
36099
|
-
import { join as
|
|
36268
|
+
import { existsSync as existsSync88 } from "fs";
|
|
36269
|
+
import { join as join102 } from "path";
|
|
36100
36270
|
|
|
36101
36271
|
// src/commands/sessions/daemon/worktree/deleteTreeDirectly.ts
|
|
36102
36272
|
import { statSync as statSync14 } from "fs";
|
|
36103
36273
|
import { rm as rm4 } from "fs/promises";
|
|
36104
|
-
import { join as
|
|
36274
|
+
import { join as join101 } from "path";
|
|
36105
36275
|
async function deleteTreeDirectly(clone, worktreePath, why) {
|
|
36106
36276
|
if (holdsAGitDirectoryRatherThanALink(worktreePath)) {
|
|
36107
36277
|
const refusal = "it is a clone of its own, not a linked worktree";
|
|
@@ -36129,7 +36299,7 @@ async function deleteTreeDirectly(clone, worktreePath, why) {
|
|
|
36129
36299
|
return { removed: true };
|
|
36130
36300
|
}
|
|
36131
36301
|
function holdsAGitDirectoryRatherThanALink(worktreePath) {
|
|
36132
|
-
return statSync14(
|
|
36302
|
+
return statSync14(join101(worktreePath, ".git"), {
|
|
36133
36303
|
throwIfNoEntry: false
|
|
36134
36304
|
})?.isDirectory() === true;
|
|
36135
36305
|
}
|
|
@@ -36165,7 +36335,7 @@ async function deleteStrandedTree(clone, worktreePath, cause) {
|
|
|
36165
36335
|
);
|
|
36166
36336
|
}
|
|
36167
36337
|
function strandedReason(worktreePath, cause) {
|
|
36168
|
-
if (!
|
|
36338
|
+
if (!existsSync88(join102(worktreePath, ".git")))
|
|
36169
36339
|
return "its .git link is already gone";
|
|
36170
36340
|
if (/not a working tree|not a git repository/i.test(reason2(cause)))
|
|
36171
36341
|
return "git no longer recognises it as a working tree";
|
|
@@ -36217,7 +36387,7 @@ function reason3(error) {
|
|
|
36217
36387
|
|
|
36218
36388
|
// src/commands/sessions/daemon/worktree/reapWorktree.ts
|
|
36219
36389
|
async function reapWorktree(worktreePath, force = false) {
|
|
36220
|
-
if (!
|
|
36390
|
+
if (!existsSync89(worktreePath)) {
|
|
36221
36391
|
forgetWorktree(worktreePath);
|
|
36222
36392
|
daemonLog(
|
|
36223
36393
|
`worktree ${worktreePath} already gone; its record was forgotten`
|
|
@@ -36235,14 +36405,14 @@ async function reapWorktree(worktreePath, force = false) {
|
|
|
36235
36405
|
const clone = owningClone(worktreePath);
|
|
36236
36406
|
const removal = await removeTree(clone, worktreePath, force);
|
|
36237
36407
|
if (!removal.removed) return removal;
|
|
36238
|
-
await deleteWorktreeBranch(clone,
|
|
36408
|
+
await deleteWorktreeBranch(clone, basename25(worktreePath));
|
|
36239
36409
|
forgetWorktree(worktreePath);
|
|
36240
36410
|
daemonLog(`worktree ${worktreePath} reaped${force ? " (forced)" : ""}`);
|
|
36241
36411
|
return removal;
|
|
36242
36412
|
}
|
|
36243
36413
|
function owningClone(worktreePath) {
|
|
36244
36414
|
const recorded = worktreeAttributionIncludingReaped(worktreePath)?.clone;
|
|
36245
|
-
if (recorded &&
|
|
36415
|
+
if (recorded && existsSync89(recorded)) return recorded;
|
|
36246
36416
|
const detected = mainWorktree(worktreePath);
|
|
36247
36417
|
if (detected) return detected;
|
|
36248
36418
|
daemonLog(
|
|
@@ -36373,12 +36543,12 @@ function closeGateApplies(sessions, session) {
|
|
|
36373
36543
|
}
|
|
36374
36544
|
|
|
36375
36545
|
// src/commands/sessions/daemon/worktree/watchGitState.ts
|
|
36376
|
-
import { existsSync as
|
|
36546
|
+
import { existsSync as existsSync90, watch } from "fs";
|
|
36377
36547
|
var DEBOUNCE_MS = 500;
|
|
36378
36548
|
var POLL_MS = 3e4;
|
|
36379
36549
|
function watchGitState(cwd, onChange) {
|
|
36380
36550
|
const common = gitCommonDir(cwd);
|
|
36381
|
-
if (!common || !
|
|
36551
|
+
if (!common || !existsSync90(common)) return void 0;
|
|
36382
36552
|
const watchers = [
|
|
36383
36553
|
watchGitDir(common, onChange),
|
|
36384
36554
|
pollGitState(cwd, onChange)
|
|
@@ -36869,10 +37039,10 @@ function emitSessionOutput(session, clients, data) {
|
|
|
36869
37039
|
}
|
|
36870
37040
|
|
|
36871
37041
|
// src/commands/sessions/daemon/exitReason.ts
|
|
36872
|
-
import { existsSync as
|
|
37042
|
+
import { existsSync as existsSync91 } from "fs";
|
|
36873
37043
|
import { resolve as resolve22 } from "path";
|
|
36874
37044
|
function exitDetail(session) {
|
|
36875
|
-
if (session.cwd && !
|
|
37045
|
+
if (session.cwd && !existsSync91(session.cwd))
|
|
36876
37046
|
return `working directory ${session.cwd} no longer exists`;
|
|
36877
37047
|
return missingRunConfigCwd(session);
|
|
36878
37048
|
}
|
|
@@ -36886,7 +37056,7 @@ function missingRunConfigCwd(session) {
|
|
|
36886
37056
|
const config = resolveRunConfig(session.runName, dir);
|
|
36887
37057
|
if (!config?.cwd) return void 0;
|
|
36888
37058
|
const configured = resolve22(runConfigBaseDirFrom(dir), config.cwd);
|
|
36889
|
-
if (
|
|
37059
|
+
if (existsSync91(configured)) return void 0;
|
|
36890
37060
|
return `run config "${config.name}": cwd ${configured} does not exist`;
|
|
36891
37061
|
}
|
|
36892
37062
|
|
|
@@ -36923,8 +37093,8 @@ function handleFailedResume(session, exitCode, onStatusChange) {
|
|
|
36923
37093
|
}
|
|
36924
37094
|
|
|
36925
37095
|
// src/commands/sessions/daemon/watchActivity.ts
|
|
36926
|
-
import { existsSync as
|
|
36927
|
-
import { dirname as
|
|
37096
|
+
import { existsSync as existsSync92, mkdirSync as mkdirSync35, watch as watch2 } from "fs";
|
|
37097
|
+
import { dirname as dirname40 } from "path";
|
|
36928
37098
|
|
|
36929
37099
|
// src/commands/sessions/daemon/applyActivityToSession.ts
|
|
36930
37100
|
function applyActivityToSession(session, activity2) {
|
|
@@ -36986,7 +37156,7 @@ var DEBOUNCE_MS2 = 50;
|
|
|
36986
37156
|
function watchActivity(session, notify2, onClaudeSessionId) {
|
|
36987
37157
|
if (session.commandType !== "assist" || !session.cwd) return;
|
|
36988
37158
|
const path91 = activityPath(session.id);
|
|
36989
|
-
const dir =
|
|
37159
|
+
const dir = dirname40(path91);
|
|
36990
37160
|
try {
|
|
36991
37161
|
mkdirSync35(dir, { recursive: true });
|
|
36992
37162
|
} catch {
|
|
@@ -37009,7 +37179,7 @@ function watchActivity(session, notify2, onClaudeSessionId) {
|
|
|
37009
37179
|
if (timer) clearTimeout(timer);
|
|
37010
37180
|
timer = setTimeout(read3, DEBOUNCE_MS2);
|
|
37011
37181
|
});
|
|
37012
|
-
if (
|
|
37182
|
+
if (existsSync92(path91)) read3();
|
|
37013
37183
|
}
|
|
37014
37184
|
function refreshActivity(session) {
|
|
37015
37185
|
if (session.commandType !== "assist" || !session.cwd) return;
|
|
@@ -38732,8 +38902,8 @@ function rearmStoppedSessions(sessions, notify2) {
|
|
|
38732
38902
|
}
|
|
38733
38903
|
|
|
38734
38904
|
// src/commands/sessions/daemon/worktree/reconcileWorktreesOnRestore.ts
|
|
38735
|
-
import { existsSync as
|
|
38736
|
-
import { basename as
|
|
38905
|
+
import { existsSync as existsSync95 } from "fs";
|
|
38906
|
+
import { basename as basename27 } from "path";
|
|
38737
38907
|
|
|
38738
38908
|
// src/commands/sessions/daemon/worktree/accountedTrees.ts
|
|
38739
38909
|
function accountedTrees(sessions) {
|
|
@@ -38787,9 +38957,9 @@ function bindResumedWorktree(session, cwd, notify2) {
|
|
|
38787
38957
|
}
|
|
38788
38958
|
|
|
38789
38959
|
// src/commands/sessions/daemon/worktree/reclaimVanishedWorktrees.ts
|
|
38790
|
-
import { existsSync as
|
|
38960
|
+
import { existsSync as existsSync94 } from "fs";
|
|
38791
38961
|
async function reclaimVanishedWorktrees(clone, paths) {
|
|
38792
|
-
if (!
|
|
38962
|
+
if (!existsSync94(clone)) {
|
|
38793
38963
|
for (const { path: path91 } of paths) forgetWorktree(path91);
|
|
38794
38964
|
daemonLog(
|
|
38795
38965
|
`clone ${clone} is gone; forgot ${paths.length} worktree record(s) it owned`
|
|
@@ -38875,7 +39045,7 @@ function capped(lines2) {
|
|
|
38875
39045
|
}
|
|
38876
39046
|
|
|
38877
39047
|
// src/commands/sessions/daemon/worktree/resurfaceOrphanedWorktree.ts
|
|
38878
|
-
import { basename as
|
|
39048
|
+
import { basename as basename26 } from "path";
|
|
38879
39049
|
function resurfaceOrphanedWorktree(sessions, spawnWith, recovered, notify2) {
|
|
38880
39050
|
const { orphan, reason: reason4, held } = recovered;
|
|
38881
39051
|
let id;
|
|
@@ -38898,7 +39068,7 @@ function orphanedSession(id, recovered) {
|
|
|
38898
39068
|
const { orphan, reason: reason4, held } = recovered;
|
|
38899
39069
|
return {
|
|
38900
39070
|
...sessionBase(id, "stopped"),
|
|
38901
|
-
name: `recovered ${
|
|
39071
|
+
name: `recovered ${basename26(orphan.path)}`,
|
|
38902
39072
|
subtitle: `${held.summary} in ${orphan.path}`,
|
|
38903
39073
|
commandType: "claude",
|
|
38904
39074
|
pty: null,
|
|
@@ -38955,11 +39125,11 @@ async function recoverOrphanedWorktrees(sessions, spawnWith, notify2) {
|
|
|
38955
39125
|
);
|
|
38956
39126
|
continue;
|
|
38957
39127
|
}
|
|
38958
|
-
if (!
|
|
39128
|
+
if (!existsSync95(path91)) {
|
|
38959
39129
|
logVanishedTree(sessions, path91);
|
|
38960
39130
|
vanished.set(clone, [
|
|
38961
39131
|
...vanished.get(clone) ?? [],
|
|
38962
|
-
{ path: path91, branch:
|
|
39132
|
+
{ path: path91, branch: basename27(path91) }
|
|
38963
39133
|
]);
|
|
38964
39134
|
continue;
|
|
38965
39135
|
}
|
|
@@ -39600,14 +39770,14 @@ async function defaultConnect() {
|
|
|
39600
39770
|
}
|
|
39601
39771
|
|
|
39602
39772
|
// src/commands/sessions/daemon/hasPersistedWindowsSessions.ts
|
|
39603
|
-
import { existsSync as
|
|
39773
|
+
import { existsSync as existsSync96, readFileSync as readFileSync65 } from "fs";
|
|
39604
39774
|
import { posix as posix3 } from "path";
|
|
39605
39775
|
function hasPersistedWindowsSessions() {
|
|
39606
39776
|
const sessionsFile = windowsSessionsFileFromWsl();
|
|
39607
39777
|
if (!sessionsFile) return false;
|
|
39608
39778
|
try {
|
|
39609
|
-
if (!
|
|
39610
|
-
const data = JSON.parse(
|
|
39779
|
+
if (!existsSync96(sessionsFile)) return false;
|
|
39780
|
+
const data = JSON.parse(readFileSync65(sessionsFile, "utf8"));
|
|
39611
39781
|
return Array.isArray(data) && data.length > 0;
|
|
39612
39782
|
} catch (error) {
|
|
39613
39783
|
const message3 = error instanceof Error ? error.message : String(error);
|
|
@@ -40341,7 +40511,7 @@ function setAutoAdvance(sessions, id, enabled) {
|
|
|
40341
40511
|
}
|
|
40342
40512
|
|
|
40343
40513
|
// src/commands/sessions/daemon/worktree/resumeInTree.ts
|
|
40344
|
-
import { existsSync as
|
|
40514
|
+
import { existsSync as existsSync99 } from "fs";
|
|
40345
40515
|
|
|
40346
40516
|
// src/commands/sessions/daemon/resumeSession.ts
|
|
40347
40517
|
function resumeSession(id, sessionId, cwd, name, holdPty, harness) {
|
|
@@ -40372,11 +40542,11 @@ function resumeSession(id, sessionId, cwd, name, holdPty, harness) {
|
|
|
40372
40542
|
}
|
|
40373
40543
|
|
|
40374
40544
|
// src/commands/sessions/daemon/worktree/resumeInReplacementTree.ts
|
|
40375
|
-
import { existsSync as
|
|
40545
|
+
import { existsSync as existsSync98 } from "fs";
|
|
40376
40546
|
|
|
40377
40547
|
// src/commands/sessions/daemon/worktree/carryTranscriptToTree.ts
|
|
40378
|
-
import { copyFileSync as copyFileSync7, existsSync as
|
|
40379
|
-
import { join as
|
|
40548
|
+
import { copyFileSync as copyFileSync7, existsSync as existsSync97, mkdirSync as mkdirSync37 } from "fs";
|
|
40549
|
+
import { join as join104 } from "path";
|
|
40380
40550
|
function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
|
|
40381
40551
|
const dir = projectDirForCwd(toCwd);
|
|
40382
40552
|
if (dir === projectDirForCwd(fromCwd)) {
|
|
@@ -40385,8 +40555,8 @@ function carryTranscriptToTree(claudeSessionId, fromCwd, toCwd) {
|
|
|
40385
40555
|
);
|
|
40386
40556
|
return;
|
|
40387
40557
|
}
|
|
40388
|
-
const dest =
|
|
40389
|
-
if (
|
|
40558
|
+
const dest = join104(dir, `${claudeSessionId}.jsonl`);
|
|
40559
|
+
if (existsSync97(dest)) {
|
|
40390
40560
|
daemonLog(`transcript ${claudeSessionId} already present in ${dir}`);
|
|
40391
40561
|
return;
|
|
40392
40562
|
}
|
|
@@ -40437,7 +40607,7 @@ function resumeInReplacementTree(ctx, claudeSessionId, missingCwd, name, harness
|
|
|
40437
40607
|
}
|
|
40438
40608
|
function cloneForReapedTree(missingCwd) {
|
|
40439
40609
|
const clone = worktreeAttributionIncludingReaped(missingCwd)?.clone;
|
|
40440
|
-
if (!clone || !
|
|
40610
|
+
if (!clone || !existsSync98(clone))
|
|
40441
40611
|
throw new Error(
|
|
40442
40612
|
`working directory no longer exists and no clone is recorded to re-allocate from: ${missingCwd}`
|
|
40443
40613
|
);
|
|
@@ -40446,7 +40616,7 @@ function cloneForReapedTree(missingCwd) {
|
|
|
40446
40616
|
|
|
40447
40617
|
// src/commands/sessions/daemon/worktree/resumeInTree.ts
|
|
40448
40618
|
function resumeInTree(ctx, sessionId, cwd, name, harness) {
|
|
40449
|
-
if (!
|
|
40619
|
+
if (!existsSync99(cwd))
|
|
40450
40620
|
return resumeInReplacementTree(ctx, sessionId, cwd, name, harness);
|
|
40451
40621
|
const id = ctx.spawnWith(
|
|
40452
40622
|
(sid) => resumeSession(sid, sessionId, cwd, name, void 0, harness)
|
|
@@ -41032,7 +41202,7 @@ function handleConnection(socket, manager) {
|
|
|
41032
41202
|
import { unlinkSync as unlinkSync23, writeFileSync as writeFileSync52 } from "fs";
|
|
41033
41203
|
|
|
41034
41204
|
// src/commands/sessions/daemon/startPidFileWatchdog.ts
|
|
41035
|
-
import { readFileSync as
|
|
41205
|
+
import { readFileSync as readFileSync66 } from "fs";
|
|
41036
41206
|
var WATCHDOG_INTERVAL_MS = 5e3;
|
|
41037
41207
|
function startPidFileWatchdog(onLost, intervalMs = WATCHDOG_INTERVAL_MS) {
|
|
41038
41208
|
const timer = setInterval(() => {
|
|
@@ -41043,7 +41213,7 @@ function startPidFileWatchdog(onLost, intervalMs = WATCHDOG_INTERVAL_MS) {
|
|
|
41043
41213
|
}
|
|
41044
41214
|
function ownsPidFile() {
|
|
41045
41215
|
try {
|
|
41046
|
-
return
|
|
41216
|
+
return readFileSync66(daemonPaths.pid, "utf8").trim() === String(process.pid);
|
|
41047
41217
|
} catch {
|
|
41048
41218
|
return false;
|
|
41049
41219
|
}
|
|
@@ -41536,10 +41706,10 @@ function buildLimitsSegment(rateLimits) {
|
|
|
41536
41706
|
}
|
|
41537
41707
|
|
|
41538
41708
|
// src/commands/readGitBranch.ts
|
|
41539
|
-
import { readFileSync as
|
|
41540
|
-
import { isAbsolute as isAbsolute5, join as
|
|
41709
|
+
import { readFileSync as readFileSync68, statSync as statSync16 } from "fs";
|
|
41710
|
+
import { isAbsolute as isAbsolute5, join as join105, resolve as resolve23 } from "path";
|
|
41541
41711
|
function resolveGitDir(cwd) {
|
|
41542
|
-
const dotGit =
|
|
41712
|
+
const dotGit = join105(cwd, ".git");
|
|
41543
41713
|
let stat4;
|
|
41544
41714
|
try {
|
|
41545
41715
|
stat4 = statSync16(dotGit);
|
|
@@ -41551,7 +41721,7 @@ function resolveGitDir(cwd) {
|
|
|
41551
41721
|
}
|
|
41552
41722
|
let contents;
|
|
41553
41723
|
try {
|
|
41554
|
-
contents =
|
|
41724
|
+
contents = readFileSync68(dotGit, "utf8");
|
|
41555
41725
|
} catch {
|
|
41556
41726
|
return null;
|
|
41557
41727
|
}
|
|
@@ -41569,7 +41739,7 @@ function readGitBranch(cwd) {
|
|
|
41569
41739
|
}
|
|
41570
41740
|
let head;
|
|
41571
41741
|
try {
|
|
41572
|
-
head =
|
|
41742
|
+
head = readFileSync68(join105(gitDir, "HEAD"), "utf8");
|
|
41573
41743
|
} catch {
|
|
41574
41744
|
return null;
|
|
41575
41745
|
}
|
|
@@ -41727,6 +41897,7 @@ program.command("coverage").description("Print global statement coverage percent
|
|
|
41727
41897
|
var screenshotCommand = program.command("screenshot").description("Capture a screenshot of a running application window").argument("<process>", "Name of the running process (e.g. notepad, code)").action(screenshot);
|
|
41728
41898
|
configHelp(screenshotCommand, rootConfigHelp.screenshot);
|
|
41729
41899
|
registerActivity(program);
|
|
41900
|
+
registerAdvise(program);
|
|
41730
41901
|
registerBackup(program);
|
|
41731
41902
|
registerDb(program);
|
|
41732
41903
|
registerDbMigration(program);
|