@staff0rd/assist 0.384.3 → 0.385.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 +4 -1
- package/claude/commands/design.md +24 -0
- package/claude/skills/accessibility-audit.md +51 -0
- package/claude/skills/ai-slop-check.md +71 -0
- package/claude/skills/component-extract.md +52 -0
- package/claude/skills/design-system-extract.md +75 -0
- package/claude/skills/discovery-questions.md +60 -0
- package/claude/skills/frontend-aesthetic-direction.md +76 -0
- package/claude/skills/generate-variations.md +40 -0
- package/claude/skills/hierarchy-rhythm-review.md +50 -0
- package/claude/skills/interaction-states-pass.md +38 -0
- package/claude/skills/make-a-deck.md +43 -0
- package/claude/skills/make-a-prototype.md +56 -0
- package/claude/skills/make-tweakable.md +66 -0
- package/claude/skills/polish-pass.md +43 -0
- package/claude/skills/wireframe.md +48 -0
- package/claude/system-prompt.md +661 -0
- package/dist/commands/sessions/web/bundle.js +65 -65
- package/dist/index.js +219 -170
- 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.385.0",
|
|
10
10
|
type: "module",
|
|
11
11
|
main: "dist/index.js",
|
|
12
12
|
bin: {
|
|
@@ -140,10 +140,10 @@ import { stringify as stringifyYaml } from "yaml";
|
|
|
140
140
|
// src/shared/loadRawYaml.ts
|
|
141
141
|
import { existsSync, readFileSync } from "fs";
|
|
142
142
|
import { parse as parseYaml } from "yaml";
|
|
143
|
-
function loadRawYaml(
|
|
144
|
-
if (!existsSync(
|
|
143
|
+
function loadRawYaml(path60) {
|
|
144
|
+
if (!existsSync(path60)) return {};
|
|
145
145
|
try {
|
|
146
|
-
const content = readFileSync(
|
|
146
|
+
const content = readFileSync(path60, "utf8");
|
|
147
147
|
return parseYaml(content) || {};
|
|
148
148
|
} catch {
|
|
149
149
|
return {};
|
|
@@ -1201,8 +1201,8 @@ function getPreferredRemoteRepo(cwd) {
|
|
|
1201
1201
|
function gitRefUrl(kind, ref, cwd) {
|
|
1202
1202
|
const repo = getPreferredRemoteRepo(cwd);
|
|
1203
1203
|
if (!repo) return void 0;
|
|
1204
|
-
const
|
|
1205
|
-
return `https://github.com/${repo.org}/${repo.repo}/${
|
|
1204
|
+
const path60 = kind === "branch" ? "tree" : "commit";
|
|
1205
|
+
return `https://github.com/${repo.org}/${repo.repo}/${path60}/${ref}`;
|
|
1206
1206
|
}
|
|
1207
1207
|
|
|
1208
1208
|
// src/commands/commit/collectCommitRefs.ts
|
|
@@ -2934,9 +2934,9 @@ import { existsSync as existsSync12, readFileSync as readFileSync9 } from "fs";
|
|
|
2934
2934
|
|
|
2935
2935
|
// src/commands/verify/forbiddenStrings/findForbiddenStrings.ts
|
|
2936
2936
|
import { minimatch as minimatch2 } from "minimatch";
|
|
2937
|
-
function resolveStringsAtPath(data,
|
|
2937
|
+
function resolveStringsAtPath(data, path60) {
|
|
2938
2938
|
let current = data;
|
|
2939
|
-
for (const segment of
|
|
2939
|
+
for (const segment of path60.split(".")) {
|
|
2940
2940
|
if (current === null || typeof current !== "object") return [];
|
|
2941
2941
|
current = current[segment];
|
|
2942
2942
|
}
|
|
@@ -2949,10 +2949,10 @@ function resolveStringsAtPath(data, path58) {
|
|
|
2949
2949
|
}
|
|
2950
2950
|
function findRuleViolations(data, rule) {
|
|
2951
2951
|
const violations = [];
|
|
2952
|
-
for (const
|
|
2953
|
-
for (const value of resolveStringsAtPath(data,
|
|
2952
|
+
for (const path60 of rule.paths) {
|
|
2953
|
+
for (const value of resolveStringsAtPath(data, path60)) {
|
|
2954
2954
|
if (minimatch2(value, rule.disallowed))
|
|
2955
|
-
violations.push({ file: rule.file, path:
|
|
2955
|
+
violations.push({ file: rule.file, path: path60, value });
|
|
2956
2956
|
}
|
|
2957
2957
|
}
|
|
2958
2958
|
return violations;
|
|
@@ -2991,8 +2991,8 @@ function forbiddenStrings() {
|
|
|
2991
2991
|
process.exit(0);
|
|
2992
2992
|
}
|
|
2993
2993
|
console.log("Forbidden strings found:\n");
|
|
2994
|
-
for (const { file, path:
|
|
2995
|
-
console.log(` ${file} ${
|
|
2994
|
+
for (const { file, path: path60, value } of violations) {
|
|
2995
|
+
console.log(` ${file} ${path60}: ${value}`);
|
|
2996
2996
|
}
|
|
2997
2997
|
console.log(`
|
|
2998
2998
|
Total: ${violations.length} forbidden string(s).`);
|
|
@@ -4475,10 +4475,10 @@ var hooksSettings = {
|
|
|
4475
4475
|
}
|
|
4476
4476
|
};
|
|
4477
4477
|
function ensureHooksSettings() {
|
|
4478
|
-
const
|
|
4479
|
-
mkdirSync5(dirname12(
|
|
4480
|
-
writeFileSync15(
|
|
4481
|
-
return
|
|
4478
|
+
const path60 = daemonPaths.hooksSettings;
|
|
4479
|
+
mkdirSync5(dirname12(path60), { recursive: true });
|
|
4480
|
+
writeFileSync15(path60, JSON.stringify(hooksSettings, null, 2));
|
|
4481
|
+
return path60;
|
|
4482
4482
|
}
|
|
4483
4483
|
|
|
4484
4484
|
// src/shared/spawnClaude.ts
|
|
@@ -4736,9 +4736,9 @@ var LOCAL_FILES = ["backlog.jsonl", "backlog.db"];
|
|
|
4736
4736
|
function backupLocalBacklogFiles(dir) {
|
|
4737
4737
|
const moved = [];
|
|
4738
4738
|
for (const name of LOCAL_FILES) {
|
|
4739
|
-
const
|
|
4740
|
-
if (existsSync18(
|
|
4741
|
-
renameSync(
|
|
4739
|
+
const path60 = join15(dir, ".assist", name);
|
|
4740
|
+
if (existsSync18(path60)) {
|
|
4741
|
+
renameSync(path60, `${path60}.bak`);
|
|
4742
4742
|
moved.push(`${name} \u2192 ${name}.bak`);
|
|
4743
4743
|
}
|
|
4744
4744
|
}
|
|
@@ -5177,8 +5177,8 @@ var backlogItemSchema = z3.strictObject({
|
|
|
5177
5177
|
var backlogFileSchema = z3.array(backlogItemSchema);
|
|
5178
5178
|
|
|
5179
5179
|
// src/commands/backlog/parseBacklogJsonl.ts
|
|
5180
|
-
function parseBacklogJsonl(
|
|
5181
|
-
const content = readFileSync13(
|
|
5180
|
+
function parseBacklogJsonl(path60) {
|
|
5181
|
+
const content = readFileSync13(path60, "utf8").trim();
|
|
5182
5182
|
if (content.length === 0) return [];
|
|
5183
5183
|
return content.split("\n").map((line) => line.trim()).filter(Boolean).map((line) => backlogItemSchema.parse(JSON.parse(line)));
|
|
5184
5184
|
}
|
|
@@ -5260,8 +5260,8 @@ function findBacklogUp(startDir) {
|
|
|
5260
5260
|
|
|
5261
5261
|
// src/commands/backlog/getCurrentOrigin.ts
|
|
5262
5262
|
import { execFileSync } from "child_process";
|
|
5263
|
-
function stripLeadingSlashes(
|
|
5264
|
-
return
|
|
5263
|
+
function stripLeadingSlashes(path60) {
|
|
5264
|
+
return path60.replace(/^\/+/, "");
|
|
5265
5265
|
}
|
|
5266
5266
|
function normalizeOrigin(raw) {
|
|
5267
5267
|
const trimmed = raw.trim().replace(/\.git$/i, "").replace(/\/+$/, "");
|
|
@@ -5768,24 +5768,24 @@ function getOwnerPath(itemId2) {
|
|
|
5768
5768
|
function recordSignalOwner(itemId2) {
|
|
5769
5769
|
const sessionId = process.env.ASSIST_SESSION_ID;
|
|
5770
5770
|
if (!sessionId) return;
|
|
5771
|
-
const
|
|
5772
|
-
mkdirSync7(dirname14(
|
|
5773
|
-
writeFileSync17(
|
|
5771
|
+
const path60 = getOwnerPath(itemId2);
|
|
5772
|
+
mkdirSync7(dirname14(path60), { recursive: true });
|
|
5773
|
+
writeFileSync17(path60, JSON.stringify({ sessionId }));
|
|
5774
5774
|
}
|
|
5775
5775
|
function readSignalOwner(itemId2) {
|
|
5776
|
-
const
|
|
5777
|
-
if (!existsSync21(
|
|
5776
|
+
const path60 = getOwnerPath(itemId2);
|
|
5777
|
+
if (!existsSync21(path60)) return void 0;
|
|
5778
5778
|
try {
|
|
5779
|
-
const parsed = JSON.parse(readFileSync14(
|
|
5779
|
+
const parsed = JSON.parse(readFileSync14(path60, "utf8"));
|
|
5780
5780
|
return parsed.sessionId;
|
|
5781
5781
|
} catch {
|
|
5782
5782
|
return void 0;
|
|
5783
5783
|
}
|
|
5784
5784
|
}
|
|
5785
5785
|
function clearSignalOwner(itemId2) {
|
|
5786
|
-
const
|
|
5786
|
+
const path60 = getOwnerPath(itemId2);
|
|
5787
5787
|
try {
|
|
5788
|
-
rmSync(
|
|
5788
|
+
rmSync(path60);
|
|
5789
5789
|
} catch {
|
|
5790
5790
|
}
|
|
5791
5791
|
}
|
|
@@ -5822,19 +5822,19 @@ function resolveSignalTarget(event, data) {
|
|
|
5822
5822
|
function writeSignal(event, data) {
|
|
5823
5823
|
const target = resolveSignalTarget(event, data);
|
|
5824
5824
|
if (!target) return;
|
|
5825
|
-
const
|
|
5826
|
-
if (!
|
|
5825
|
+
const path60 = getSignalPath(target);
|
|
5826
|
+
if (!path60) return;
|
|
5827
5827
|
const signal = { event, sessionId: target, ...data };
|
|
5828
|
-
mkdirSync8(dirname15(
|
|
5829
|
-
writeFileSync18(
|
|
5828
|
+
mkdirSync8(dirname15(path60), { recursive: true });
|
|
5829
|
+
writeFileSync18(path60, JSON.stringify(signal));
|
|
5830
5830
|
}
|
|
5831
5831
|
|
|
5832
5832
|
// src/commands/backlog/readSignal.ts
|
|
5833
5833
|
function readSignal() {
|
|
5834
|
-
const
|
|
5835
|
-
if (!
|
|
5834
|
+
const path60 = getSignalPath();
|
|
5835
|
+
if (!path60 || !existsSync22(path60)) return void 0;
|
|
5836
5836
|
try {
|
|
5837
|
-
return JSON.parse(readFileSync15(
|
|
5837
|
+
return JSON.parse(readFileSync15(path60, "utf8"));
|
|
5838
5838
|
} catch {
|
|
5839
5839
|
return void 0;
|
|
5840
5840
|
}
|
|
@@ -5929,13 +5929,13 @@ function activityPath(sessionId) {
|
|
|
5929
5929
|
function emitActivity(activity2) {
|
|
5930
5930
|
const sessionId = process.env.ASSIST_ACTIVITY_ID;
|
|
5931
5931
|
if (!sessionId) return;
|
|
5932
|
-
const
|
|
5933
|
-
mkdirSync9(dirname16(
|
|
5934
|
-
writeFileSync19(
|
|
5932
|
+
const path60 = activityPath(sessionId);
|
|
5933
|
+
mkdirSync9(dirname16(path60), { recursive: true });
|
|
5934
|
+
writeFileSync19(path60, JSON.stringify({ ...activity2, startedAt: Date.now() }));
|
|
5935
5935
|
}
|
|
5936
|
-
function readActivity(
|
|
5936
|
+
function readActivity(path60) {
|
|
5937
5937
|
try {
|
|
5938
|
-
return JSON.parse(readFileSync16(
|
|
5938
|
+
return JSON.parse(readFileSync16(path60, "utf8"));
|
|
5939
5939
|
} catch {
|
|
5940
5940
|
return void 0;
|
|
5941
5941
|
}
|
|
@@ -5945,9 +5945,9 @@ function reconcileActivity(sessionId, activity2) {
|
|
|
5945
5945
|
removeActivity(sessionId);
|
|
5946
5946
|
return;
|
|
5947
5947
|
}
|
|
5948
|
-
const
|
|
5949
|
-
mkdirSync9(dirname16(
|
|
5950
|
-
writeFileSync19(
|
|
5948
|
+
const path60 = activityPath(sessionId);
|
|
5949
|
+
mkdirSync9(dirname16(path60), { recursive: true });
|
|
5950
|
+
writeFileSync19(path60, JSON.stringify(activity2));
|
|
5951
5951
|
}
|
|
5952
5952
|
function removeActivity(sessionId) {
|
|
5953
5953
|
try {
|
|
@@ -7171,8 +7171,8 @@ async function getBacklogExists(req, res) {
|
|
|
7171
7171
|
// src/commands/backlog/originDisplayName.ts
|
|
7172
7172
|
function originDisplayName(origin) {
|
|
7173
7173
|
if (origin.startsWith("local:")) {
|
|
7174
|
-
const
|
|
7175
|
-
const segments =
|
|
7174
|
+
const path60 = origin.slice("local:".length).replace(/\/+$/, "");
|
|
7175
|
+
const segments = path60.split("/").filter(Boolean);
|
|
7176
7176
|
return segments[segments.length - 1] ?? origin;
|
|
7177
7177
|
}
|
|
7178
7178
|
const firstSlash = origin.indexOf("/");
|
|
@@ -7563,7 +7563,7 @@ function findSynthesisForBranch(repoReviewsDir, branch2) {
|
|
|
7563
7563
|
const parent = dirname20(branchKeyPath);
|
|
7564
7564
|
const branchPrefix = basename4(branchKeyPath);
|
|
7565
7565
|
if (!existsSync25(parent)) return null;
|
|
7566
|
-
const synthesisFiles = readdirSync(parent).filter((name) => name.startsWith(branchPrefix)).map((name) => join23(parent, name, "synthesis.md")).filter((
|
|
7566
|
+
const synthesisFiles = readdirSync(parent).filter((name) => name.startsWith(branchPrefix)).map((name) => join23(parent, name, "synthesis.md")).filter((path60) => existsSync25(path60)).map((path60) => ({ path: path60, mtime: statSync2(path60).mtimeMs })).sort((a, b) => b.mtime - a.mtime);
|
|
7567
7567
|
return synthesisFiles[0]?.path ?? null;
|
|
7568
7568
|
}
|
|
7569
7569
|
|
|
@@ -7612,12 +7612,12 @@ async function getReviewSynthesis(req, res) {
|
|
|
7612
7612
|
const cwd = getCwdParam(req, res);
|
|
7613
7613
|
if (!cwd) return;
|
|
7614
7614
|
try {
|
|
7615
|
-
const
|
|
7616
|
-
if (!
|
|
7615
|
+
const path60 = await resolveSynthesisPath(cwd);
|
|
7616
|
+
if (!path60) {
|
|
7617
7617
|
respondJson(res, 404, { error: "No synthesis found" });
|
|
7618
7618
|
return;
|
|
7619
7619
|
}
|
|
7620
|
-
respondJson(res, 200, { synthesis: readFileSync18(
|
|
7620
|
+
respondJson(res, 200, { synthesis: readFileSync18(path60, "utf8") });
|
|
7621
7621
|
} catch {
|
|
7622
7622
|
respondJson(res, 404, { error: "No synthesis found" });
|
|
7623
7623
|
}
|
|
@@ -7695,10 +7695,10 @@ function getStorePath(filename) {
|
|
|
7695
7695
|
return join25(getStoreDir(), filename);
|
|
7696
7696
|
}
|
|
7697
7697
|
function loadJson(filename) {
|
|
7698
|
-
const
|
|
7699
|
-
if (existsSync26(
|
|
7698
|
+
const path60 = getStorePath(filename);
|
|
7699
|
+
if (existsSync26(path60)) {
|
|
7700
7700
|
try {
|
|
7701
|
-
return JSON.parse(readFileSync19(
|
|
7701
|
+
return JSON.parse(readFileSync19(path60, "utf8"));
|
|
7702
7702
|
} catch {
|
|
7703
7703
|
return {};
|
|
7704
7704
|
}
|
|
@@ -10926,9 +10926,9 @@ var __dirname4 = dirname21(__filename3);
|
|
|
10926
10926
|
function packageRoot() {
|
|
10927
10927
|
return __dirname4;
|
|
10928
10928
|
}
|
|
10929
|
-
function readLines(
|
|
10930
|
-
if (!existsSync27(
|
|
10931
|
-
return readFileSync22(
|
|
10929
|
+
function readLines(path60) {
|
|
10930
|
+
if (!existsSync27(path60)) return [];
|
|
10931
|
+
return readFileSync22(path60, "utf8").split("\n").filter((line) => line.trim() !== "");
|
|
10932
10932
|
}
|
|
10933
10933
|
var cachedReads;
|
|
10934
10934
|
var cachedWrites;
|
|
@@ -11393,14 +11393,14 @@ function showProgress(p, label2) {
|
|
|
11393
11393
|
const pct = Math.round(p.done / p.total * 100);
|
|
11394
11394
|
process.stderr.write(`\r\x1B[K[${pct}%] Scanning ${label2}...`);
|
|
11395
11395
|
}
|
|
11396
|
-
async function resolveCommand(cli,
|
|
11397
|
-
showProgress(p,
|
|
11398
|
-
const subHelp = await runHelp([cli, ...
|
|
11396
|
+
async function resolveCommand(cli, path60, description, depth, p) {
|
|
11397
|
+
showProgress(p, path60.join(" "));
|
|
11398
|
+
const subHelp = await runHelp([cli, ...path60]);
|
|
11399
11399
|
if (!subHelp || !hasSubcommands(subHelp)) {
|
|
11400
|
-
return [{ path:
|
|
11400
|
+
return [{ path: path60, description }];
|
|
11401
11401
|
}
|
|
11402
|
-
const children = await discoverAt(cli,
|
|
11403
|
-
return children.length > 0 ? children : [{ path:
|
|
11402
|
+
const children = await discoverAt(cli, path60, depth + 1, p);
|
|
11403
|
+
return children.length > 0 ? children : [{ path: path60, description }];
|
|
11404
11404
|
}
|
|
11405
11405
|
async function discoverAt(cli, parentPath, depth, p) {
|
|
11406
11406
|
if (depth > SAFETY_DEPTH) return [];
|
|
@@ -11548,9 +11548,9 @@ function logPath(cli) {
|
|
|
11548
11548
|
return join29(homedir15(), ".assist", `cli-discover-${safeName}.log`);
|
|
11549
11549
|
}
|
|
11550
11550
|
function readCache(cli) {
|
|
11551
|
-
const
|
|
11552
|
-
if (!existsSync29(
|
|
11553
|
-
return readFileSync24(
|
|
11551
|
+
const path60 = logPath(cli);
|
|
11552
|
+
if (!existsSync29(path60)) return void 0;
|
|
11553
|
+
return readFileSync24(path60, "utf8");
|
|
11554
11554
|
}
|
|
11555
11555
|
function writeCache(cli, output) {
|
|
11556
11556
|
const dir = join29(homedir15(), ".assist");
|
|
@@ -11722,9 +11722,9 @@ function sweepRestrictedDir(dir = getRestrictedDir()) {
|
|
|
11722
11722
|
}
|
|
11723
11723
|
const cutoff = Date.now() - STALE_AFTER_MS;
|
|
11724
11724
|
for (const entry of entries) {
|
|
11725
|
-
const
|
|
11725
|
+
const path60 = join31(dir, entry);
|
|
11726
11726
|
try {
|
|
11727
|
-
if (statSync3(
|
|
11727
|
+
if (statSync3(path60).mtimeMs < cutoff) unlinkSync7(path60);
|
|
11728
11728
|
} catch {
|
|
11729
11729
|
continue;
|
|
11730
11730
|
}
|
|
@@ -11734,10 +11734,10 @@ function sweepRestrictedDir(dir = getRestrictedDir()) {
|
|
|
11734
11734
|
// src/commands/codeComment/readPinState.ts
|
|
11735
11735
|
import { existsSync as existsSync30, readFileSync as readFileSync25 } from "fs";
|
|
11736
11736
|
function readPinState(pin) {
|
|
11737
|
-
const
|
|
11738
|
-
if (!existsSync30(
|
|
11737
|
+
const path60 = getPinStatePath(pin);
|
|
11738
|
+
if (!existsSync30(path60)) return void 0;
|
|
11739
11739
|
try {
|
|
11740
|
-
const state = JSON.parse(readFileSync25(
|
|
11740
|
+
const state = JSON.parse(readFileSync25(path60, "utf8"));
|
|
11741
11741
|
if (state.pin !== pin) return void 0;
|
|
11742
11742
|
return state;
|
|
11743
11743
|
} catch {
|
|
@@ -12503,8 +12503,8 @@ function stepIntoNested(container, key, nextKey) {
|
|
|
12503
12503
|
}
|
|
12504
12504
|
return ensureObject(container, resolved);
|
|
12505
12505
|
}
|
|
12506
|
-
function setNestedValue(obj,
|
|
12507
|
-
const keys =
|
|
12506
|
+
function setNestedValue(obj, path60, value) {
|
|
12507
|
+
const keys = path60.split(".");
|
|
12508
12508
|
const result = { ...obj };
|
|
12509
12509
|
let current = result;
|
|
12510
12510
|
for (let i = 0; i < keys.length - 1; i++) {
|
|
@@ -12584,9 +12584,9 @@ function isTraversable(value) {
|
|
|
12584
12584
|
function stepInto(current, key) {
|
|
12585
12585
|
return isTraversable(current) ? current[key] : void 0;
|
|
12586
12586
|
}
|
|
12587
|
-
function getNestedValue(obj,
|
|
12587
|
+
function getNestedValue(obj, path60) {
|
|
12588
12588
|
let current = obj;
|
|
12589
|
-
for (const key of
|
|
12589
|
+
for (const key of path60.split(".")) current = stepInto(current, key);
|
|
12590
12590
|
return current;
|
|
12591
12591
|
}
|
|
12592
12592
|
|
|
@@ -15080,9 +15080,9 @@ function parseRscRows(flight) {
|
|
|
15080
15080
|
}
|
|
15081
15081
|
function makeRscResolver(rows) {
|
|
15082
15082
|
return (ref) => {
|
|
15083
|
-
const [id, ...
|
|
15083
|
+
const [id, ...path60] = ref.slice(1).replace(/^[L@]/, "").split(":");
|
|
15084
15084
|
let v = rows[id];
|
|
15085
|
-
for (const key of
|
|
15085
|
+
for (const key of path60) {
|
|
15086
15086
|
if (v == null || typeof v !== "object") return void 0;
|
|
15087
15087
|
v = v[key];
|
|
15088
15088
|
}
|
|
@@ -15729,15 +15729,15 @@ function postComment(vars) {
|
|
|
15729
15729
|
const stdout = startLine === void 0 ? runGhGraphql(MUTATION_SINGLE, base) : runGhGraphql(MUTATION_MULTI, { ...base, startLine });
|
|
15730
15730
|
assertThreadCreated(stdout);
|
|
15731
15731
|
}
|
|
15732
|
-
function comment2(
|
|
15732
|
+
function comment2(path60, line, body, startLine) {
|
|
15733
15733
|
validateBody(body);
|
|
15734
15734
|
validateLine(line);
|
|
15735
15735
|
if (startLine !== void 0) validateLine(startLine);
|
|
15736
15736
|
try {
|
|
15737
15737
|
const prId = getCurrentPrNodeId();
|
|
15738
|
-
postComment({ prId, body, path:
|
|
15738
|
+
postComment({ prId, body, path: path60, line, startLine });
|
|
15739
15739
|
const range = startLine !== void 0 ? `${startLine}-${line}` : `${line}`;
|
|
15740
|
-
console.log(`Added review comment on ${
|
|
15740
|
+
console.log(`Added review comment on ${path60}:${range}`);
|
|
15741
15741
|
} catch (error) {
|
|
15742
15742
|
if (isGhNotInstalled(error)) {
|
|
15743
15743
|
console.error("Error: GitHub CLI (gh) is not installed.");
|
|
@@ -16603,8 +16603,8 @@ function registerPrs(program2) {
|
|
|
16603
16603
|
prsCommand.command("reply <comment-id> <body>").description("Reply to a comment thread without resolving it").action((commentId, body) => {
|
|
16604
16604
|
reply(Number.parseInt(commentId, 10), body);
|
|
16605
16605
|
});
|
|
16606
|
-
prsCommand.command("comment <path> <line> <body>").description("Add a line comment to the pending review").action((
|
|
16607
|
-
comment2(
|
|
16606
|
+
prsCommand.command("comment <path> <line> <body>").description("Add a line comment to the pending review").action((path60, line, body) => {
|
|
16607
|
+
comment2(path60, Number.parseInt(line, 10), body);
|
|
16608
16608
|
});
|
|
16609
16609
|
configHelp(prsCommand, prsConfigHelp);
|
|
16610
16610
|
}
|
|
@@ -16857,10 +16857,10 @@ function resolveOpSecret(reference) {
|
|
|
16857
16857
|
}
|
|
16858
16858
|
|
|
16859
16859
|
// src/commands/ravendb/ravenFetch.ts
|
|
16860
|
-
async function ravenFetch(connection,
|
|
16860
|
+
async function ravenFetch(connection, path60) {
|
|
16861
16861
|
const apiKey = resolveOpSecret(connection.apiKeyRef);
|
|
16862
16862
|
let accessToken = await getAccessToken(apiKey);
|
|
16863
|
-
const url = `${connection.url}${
|
|
16863
|
+
const url = `${connection.url}${path60}`;
|
|
16864
16864
|
const headers = {
|
|
16865
16865
|
Authorization: `Bearer ${accessToken}`,
|
|
16866
16866
|
"Content-Type": "application/json"
|
|
@@ -16964,16 +16964,16 @@ import chalk165 from "chalk";
|
|
|
16964
16964
|
// src/commands/ravendb/buildQueryPath.ts
|
|
16965
16965
|
function buildQueryPath(opts) {
|
|
16966
16966
|
const db = encodeURIComponent(opts.db);
|
|
16967
|
-
let
|
|
16967
|
+
let path60;
|
|
16968
16968
|
if (opts.collection) {
|
|
16969
|
-
|
|
16969
|
+
path60 = `/databases/${db}/indexes/dynamic/${encodeURIComponent(opts.collection)}?start=${opts.start}&pageSize=${opts.pageSize}&sort=${encodeURIComponent(opts.sort)}`;
|
|
16970
16970
|
} else {
|
|
16971
|
-
|
|
16971
|
+
path60 = `/databases/${db}/queries?start=${opts.start}&pageSize=${opts.pageSize}`;
|
|
16972
16972
|
}
|
|
16973
16973
|
if (opts.query) {
|
|
16974
|
-
|
|
16974
|
+
path60 += `&query=${encodeURIComponent(opts.query)}`;
|
|
16975
16975
|
}
|
|
16976
|
-
return
|
|
16976
|
+
return path60;
|
|
16977
16977
|
}
|
|
16978
16978
|
|
|
16979
16979
|
// src/commands/ravendb/fetchAllPages.ts
|
|
@@ -16982,7 +16982,7 @@ async function fetchAllPages(connection, opts) {
|
|
|
16982
16982
|
let start3 = 0;
|
|
16983
16983
|
while (true) {
|
|
16984
16984
|
const effectivePageSize = opts.limit !== void 0 ? Math.min(opts.pageSize, opts.limit - allResults.length) : opts.pageSize;
|
|
16985
|
-
const
|
|
16985
|
+
const path60 = buildQueryPath({
|
|
16986
16986
|
db: connection.database,
|
|
16987
16987
|
collection: opts.collection,
|
|
16988
16988
|
start: start3,
|
|
@@ -16990,7 +16990,7 @@ async function fetchAllPages(connection, opts) {
|
|
|
16990
16990
|
sort: opts.sort,
|
|
16991
16991
|
query: opts.query
|
|
16992
16992
|
});
|
|
16993
|
-
const data = await ravenFetch(connection,
|
|
16993
|
+
const data = await ravenFetch(connection, path60);
|
|
16994
16994
|
const results = data.Results ?? [];
|
|
16995
16995
|
const totalResults = data.TotalResults ?? 0;
|
|
16996
16996
|
if (results.length === 0) break;
|
|
@@ -19354,8 +19354,8 @@ async function handlePostSynthesis(synthesisPath, options2) {
|
|
|
19354
19354
|
// src/commands/review/prepareReviewDir.ts
|
|
19355
19355
|
import { existsSync as existsSync41, mkdirSync as mkdirSync17, unlinkSync as unlinkSync14, writeFileSync as writeFileSync34 } from "fs";
|
|
19356
19356
|
function clearReviewFiles(paths) {
|
|
19357
|
-
for (const
|
|
19358
|
-
if (existsSync41(
|
|
19357
|
+
for (const path60 of [paths.claudePath, paths.codexPath, paths.synthesisPath]) {
|
|
19358
|
+
if (existsSync41(path60)) unlinkSync14(path60);
|
|
19359
19359
|
}
|
|
19360
19360
|
}
|
|
19361
19361
|
function prepareReviewDir(paths, requestBody, force) {
|
|
@@ -20503,8 +20503,8 @@ import chalk186 from "chalk";
|
|
|
20503
20503
|
|
|
20504
20504
|
// src/commands/seq/fetchSeq.ts
|
|
20505
20505
|
import chalk183 from "chalk";
|
|
20506
|
-
async function fetchSeq(conn,
|
|
20507
|
-
const url = `${conn.url}${
|
|
20506
|
+
async function fetchSeq(conn, path60, params) {
|
|
20507
|
+
const url = `${conn.url}${path60}?${params}`;
|
|
20508
20508
|
const response = await fetch(url, {
|
|
20509
20509
|
headers: {
|
|
20510
20510
|
Accept: "application/json",
|
|
@@ -21986,9 +21986,9 @@ function findPortFile(roamDir) {
|
|
|
21986
21986
|
return void 0;
|
|
21987
21987
|
}
|
|
21988
21988
|
const candidates = entries.filter((name) => /^roam-local-api(-[^.]+)?\.port$/.test(name)).map((name) => {
|
|
21989
|
-
const
|
|
21989
|
+
const path60 = join59(roamDir, name);
|
|
21990
21990
|
try {
|
|
21991
|
-
return { path:
|
|
21991
|
+
return { path: path60, mtimeMs: statSync8(path60).mtimeMs };
|
|
21992
21992
|
} catch {
|
|
21993
21993
|
return void 0;
|
|
21994
21994
|
}
|
|
@@ -22407,11 +22407,11 @@ function findLinkIndex() {
|
|
|
22407
22407
|
function parseLinkArgs() {
|
|
22408
22408
|
const idx = findLinkIndex();
|
|
22409
22409
|
if (idx === -1) return null;
|
|
22410
|
-
const
|
|
22410
|
+
const path60 = process.argv[idx + 1];
|
|
22411
22411
|
const rest = process.argv.slice(idx + 2);
|
|
22412
22412
|
const { value: prefix2 } = extractOption(rest, "--prefix");
|
|
22413
22413
|
if (!prefix2) return null;
|
|
22414
|
-
return { path:
|
|
22414
|
+
return { path: path60, prefix: prefix2 };
|
|
22415
22415
|
}
|
|
22416
22416
|
function hasDuplicateLink(runList, linkPath) {
|
|
22417
22417
|
return runList.some(
|
|
@@ -22999,7 +22999,8 @@ function toSessionInfo({
|
|
|
22999
22999
|
autoRun,
|
|
23000
23000
|
autoAdvance,
|
|
23001
23001
|
starred,
|
|
23002
|
-
usedPct
|
|
23002
|
+
usedPct,
|
|
23003
|
+
design
|
|
23003
23004
|
}) {
|
|
23004
23005
|
return {
|
|
23005
23006
|
id,
|
|
@@ -23021,7 +23022,8 @@ function toSessionInfo({
|
|
|
23021
23022
|
autoRun,
|
|
23022
23023
|
autoAdvance,
|
|
23023
23024
|
starred,
|
|
23024
|
-
usedPct
|
|
23025
|
+
usedPct,
|
|
23026
|
+
design
|
|
23025
23027
|
};
|
|
23026
23028
|
}
|
|
23027
23029
|
|
|
@@ -23184,12 +23186,27 @@ function createAssistSession(id, assistArgs, cwd, meta) {
|
|
|
23184
23186
|
// src/commands/sessions/daemon/createSession.ts
|
|
23185
23187
|
import { randomUUID as randomUUID4 } from "crypto";
|
|
23186
23188
|
|
|
23189
|
+
// src/commands/sessions/daemon/readDesignSystemPrompt.ts
|
|
23190
|
+
import * as fs33 from "fs";
|
|
23191
|
+
import * as path54 from "path";
|
|
23192
|
+
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
23193
|
+
var __filename4 = fileURLToPath7(import.meta.url);
|
|
23194
|
+
var __dirname6 = path54.dirname(__filename4);
|
|
23195
|
+
function readDesignSystemPrompt() {
|
|
23196
|
+
const promptPath = path54.join(__dirname6, "..", "claude", "system-prompt.md");
|
|
23197
|
+
return fs33.readFileSync(promptPath, "utf8");
|
|
23198
|
+
}
|
|
23199
|
+
|
|
23187
23200
|
// src/commands/sessions/daemon/spawnClaude.ts
|
|
23188
23201
|
function spawnClaude2(opts = {}) {
|
|
23189
23202
|
return spawnPty(buildArgs3(opts), opts.cwd, opts.sessionId);
|
|
23190
23203
|
}
|
|
23191
23204
|
function buildArgs3(opts) {
|
|
23192
23205
|
const base = ["claude", "--settings", ensureHooksSettings()];
|
|
23206
|
+
if (opts.design) {
|
|
23207
|
+
base.push("--append-system-prompt", readDesignSystemPrompt());
|
|
23208
|
+
base.push("--permission-mode", "auto");
|
|
23209
|
+
}
|
|
23193
23210
|
if (opts.resumeSessionId) {
|
|
23194
23211
|
return opts.prompt ? [...base, "--resume", opts.resumeSessionId, opts.prompt] : [...base, "--resume", opts.resumeSessionId];
|
|
23195
23212
|
}
|
|
@@ -23217,16 +23234,17 @@ function sessionBase(id, status2) {
|
|
|
23217
23234
|
scrollback: ""
|
|
23218
23235
|
};
|
|
23219
23236
|
}
|
|
23220
|
-
function createSession(id, prompt, cwd) {
|
|
23237
|
+
function createSession(id, prompt, cwd, design) {
|
|
23221
23238
|
const claudeSessionId = randomUUID4();
|
|
23222
23239
|
return {
|
|
23223
23240
|
...sessionBase(id, prompt ? "running" : "waiting"),
|
|
23224
23241
|
name: prompt?.slice(0, 40) || `Session ${id}`,
|
|
23225
23242
|
commandType: "claude",
|
|
23226
|
-
pty: spawnClaude2({ prompt, cwd, sessionId: id, claudeSessionId }),
|
|
23243
|
+
pty: spawnClaude2({ prompt, cwd, sessionId: id, claudeSessionId, design }),
|
|
23227
23244
|
cwd,
|
|
23228
23245
|
claudeSessionId,
|
|
23229
|
-
initialPrompt: prompt
|
|
23246
|
+
initialPrompt: prompt,
|
|
23247
|
+
design
|
|
23230
23248
|
};
|
|
23231
23249
|
}
|
|
23232
23250
|
function createRunSession(id, runName, runArgs, cwd) {
|
|
@@ -23519,7 +23537,7 @@ async function recordWindowTokens(db, window, resetsAt, tokensUp, tokensDown) {
|
|
|
23519
23537
|
}
|
|
23520
23538
|
|
|
23521
23539
|
// src/commands/sessions/shared/transcriptUsage.ts
|
|
23522
|
-
import * as
|
|
23540
|
+
import * as fs34 from "fs";
|
|
23523
23541
|
function transcriptUsage(lines) {
|
|
23524
23542
|
const byId = /* @__PURE__ */ new Map();
|
|
23525
23543
|
for (const line of lines) {
|
|
@@ -23543,7 +23561,7 @@ function transcriptUsage(lines) {
|
|
|
23543
23561
|
return [...byId.values()];
|
|
23544
23562
|
}
|
|
23545
23563
|
async function readTranscriptUsage(transcriptPath) {
|
|
23546
|
-
const content = await
|
|
23564
|
+
const content = await fs34.promises.readFile(transcriptPath, "utf8");
|
|
23547
23565
|
return transcriptUsage(content.split("\n"));
|
|
23548
23566
|
}
|
|
23549
23567
|
|
|
@@ -23592,7 +23610,7 @@ function recordSessionUsage(sessions, claudeSessionId, transcriptPath, usedPct,
|
|
|
23592
23610
|
|
|
23593
23611
|
// src/commands/sessions/daemon/watchActivity.ts
|
|
23594
23612
|
import { existsSync as existsSync54, mkdirSync as mkdirSync24, watch } from "fs";
|
|
23595
|
-
import { dirname as
|
|
23613
|
+
import { dirname as dirname29 } from "path";
|
|
23596
23614
|
|
|
23597
23615
|
// src/commands/sessions/daemon/applyReviewPause.ts
|
|
23598
23616
|
function applyReviewPause(session, activity2) {
|
|
@@ -23645,8 +23663,8 @@ async function seedRunningMsFromUsage(session, notify2) {
|
|
|
23645
23663
|
var DEBOUNCE_MS = 50;
|
|
23646
23664
|
function watchActivity(session, notify2) {
|
|
23647
23665
|
if (session.commandType !== "assist" || !session.cwd) return;
|
|
23648
|
-
const
|
|
23649
|
-
const dir =
|
|
23666
|
+
const path60 = activityPath(session.id);
|
|
23667
|
+
const dir = dirname29(path60);
|
|
23650
23668
|
try {
|
|
23651
23669
|
mkdirSync24(dir, { recursive: true });
|
|
23652
23670
|
} catch {
|
|
@@ -23656,7 +23674,7 @@ function watchActivity(session, notify2) {
|
|
|
23656
23674
|
let timer = null;
|
|
23657
23675
|
const read = () => {
|
|
23658
23676
|
timer = null;
|
|
23659
|
-
const activity2 = readActivity(
|
|
23677
|
+
const activity2 = readActivity(path60);
|
|
23660
23678
|
if (!activity2) return;
|
|
23661
23679
|
session.activity = activity2;
|
|
23662
23680
|
if (activity2.claudeSessionId)
|
|
@@ -23666,11 +23684,11 @@ function watchActivity(session, notify2) {
|
|
|
23666
23684
|
notify2();
|
|
23667
23685
|
};
|
|
23668
23686
|
session.activityWatcher = watch(dir, (_event, filename) => {
|
|
23669
|
-
if (filename && !
|
|
23687
|
+
if (filename && !path60.endsWith(filename)) return;
|
|
23670
23688
|
if (timer) clearTimeout(timer);
|
|
23671
23689
|
timer = setTimeout(read, DEBOUNCE_MS);
|
|
23672
23690
|
});
|
|
23673
|
-
if (existsSync54(
|
|
23691
|
+
if (existsSync54(path60)) read();
|
|
23674
23692
|
}
|
|
23675
23693
|
function refreshActivity(session) {
|
|
23676
23694
|
if (session.commandType !== "assist" || !session.cwd) return;
|
|
@@ -24815,8 +24833,8 @@ var SessionManager = class {
|
|
|
24815
24833
|
return session.id;
|
|
24816
24834
|
}
|
|
24817
24835
|
spawnWith = (create) => this.add(create(sessionLimits.nextId(this.sessions.size, this.idCounter)));
|
|
24818
|
-
spawn(prompt, cwd) {
|
|
24819
|
-
return this.spawnWith((id) => createSession(id, prompt, cwd));
|
|
24836
|
+
spawn(prompt, cwd, design) {
|
|
24837
|
+
return this.spawnWith((id) => createSession(id, prompt, cwd, design));
|
|
24820
24838
|
}
|
|
24821
24839
|
spawnRun(runName, runArgs, cwd) {
|
|
24822
24840
|
return this.spawnWith((id) => createRunSession(id, runName, runArgs, cwd));
|
|
@@ -24908,7 +24926,7 @@ import * as net3 from "net";
|
|
|
24908
24926
|
import { createInterface as createInterface9 } from "readline";
|
|
24909
24927
|
|
|
24910
24928
|
// src/commands/sessions/shared/parseTranscript.ts
|
|
24911
|
-
import * as
|
|
24929
|
+
import * as fs35 from "fs";
|
|
24912
24930
|
|
|
24913
24931
|
// src/commands/sessions/shared/toolTarget.ts
|
|
24914
24932
|
function toolTarget(input) {
|
|
@@ -24960,7 +24978,7 @@ async function parseTranscript(sessionId) {
|
|
|
24960
24978
|
const filePath = await findSessionJsonlPath(sessionId);
|
|
24961
24979
|
if (!filePath) return [];
|
|
24962
24980
|
try {
|
|
24963
|
-
const raw = await
|
|
24981
|
+
const raw = await fs35.promises.readFile(filePath, "utf8");
|
|
24964
24982
|
return parseTranscriptLines(raw.split("\n"));
|
|
24965
24983
|
} catch {
|
|
24966
24984
|
return [];
|
|
@@ -25007,6 +25025,18 @@ var lifecycleHandlers = {
|
|
|
25007
25025
|
shutdown: handleShutdown
|
|
25008
25026
|
};
|
|
25009
25027
|
|
|
25028
|
+
// src/commands/sessions/daemon/spawnCreate.ts
|
|
25029
|
+
function spawnCreate(m, d) {
|
|
25030
|
+
const design = d.design === true;
|
|
25031
|
+
if (design)
|
|
25032
|
+
daemonLog(`create: design session (cwd=${d.cwd ?? ""})`);
|
|
25033
|
+
return m.spawn(
|
|
25034
|
+
d.prompt,
|
|
25035
|
+
d.cwd,
|
|
25036
|
+
design
|
|
25037
|
+
);
|
|
25038
|
+
}
|
|
25039
|
+
|
|
25010
25040
|
// src/commands/sessions/daemon/messageHandlers.ts
|
|
25011
25041
|
function creator(isNew, spawn12) {
|
|
25012
25042
|
return (client, m, d) => {
|
|
@@ -25023,10 +25053,7 @@ var messageHandlers = {
|
|
|
25023
25053
|
ping: (client) => sendTo(client, { type: "pong", pid: process.pid }),
|
|
25024
25054
|
"subscribe-logs": (client, m, d) => m.clients.subscribeLogs(client, d.replay !== false),
|
|
25025
25055
|
hello: (client) => sendTo(client, buildHello()),
|
|
25026
|
-
create: creator(
|
|
25027
|
-
true,
|
|
25028
|
-
(m, d) => m.spawn(d.prompt, d.cwd)
|
|
25029
|
-
),
|
|
25056
|
+
create: creator(true, spawnCreate),
|
|
25030
25057
|
"create-run": creator(
|
|
25031
25058
|
true,
|
|
25032
25059
|
(m, d) => m.spawnRun(
|
|
@@ -25132,7 +25159,7 @@ function handleConnection(socket, manager) {
|
|
|
25132
25159
|
import { unlinkSync as unlinkSync20, writeFileSync as writeFileSync41 } from "fs";
|
|
25133
25160
|
|
|
25134
25161
|
// src/commands/sessions/daemon/startPidFileWatchdog.ts
|
|
25135
|
-
import { readFileSync as
|
|
25162
|
+
import { readFileSync as readFileSync47 } from "fs";
|
|
25136
25163
|
var WATCHDOG_INTERVAL_MS = 5e3;
|
|
25137
25164
|
function startPidFileWatchdog(onLost, intervalMs = WATCHDOG_INTERVAL_MS) {
|
|
25138
25165
|
const timer = setInterval(() => {
|
|
@@ -25143,7 +25170,7 @@ function startPidFileWatchdog(onLost, intervalMs = WATCHDOG_INTERVAL_MS) {
|
|
|
25143
25170
|
}
|
|
25144
25171
|
function ownsPidFile() {
|
|
25145
25172
|
try {
|
|
25146
|
-
return
|
|
25173
|
+
return readFileSync47(daemonPaths.pid, "utf8").trim() === String(process.pid);
|
|
25147
25174
|
} catch {
|
|
25148
25175
|
return false;
|
|
25149
25176
|
}
|
|
@@ -25272,17 +25299,17 @@ function registerDaemon(program2) {
|
|
|
25272
25299
|
}
|
|
25273
25300
|
|
|
25274
25301
|
// src/commands/sessions/summarise/index.ts
|
|
25275
|
-
import * as
|
|
25302
|
+
import * as fs38 from "fs";
|
|
25276
25303
|
import chalk195 from "chalk";
|
|
25277
25304
|
|
|
25278
25305
|
// src/commands/sessions/summarise/shared.ts
|
|
25279
|
-
import * as
|
|
25306
|
+
import * as fs36 from "fs";
|
|
25280
25307
|
function writeSummary(jsonlPath2, summary) {
|
|
25281
|
-
|
|
25308
|
+
fs36.writeFileSync(summaryPathFor(jsonlPath2), `${summary.trim()}
|
|
25282
25309
|
`, "utf8");
|
|
25283
25310
|
}
|
|
25284
25311
|
function hasSummary(jsonlPath2) {
|
|
25285
|
-
return
|
|
25312
|
+
return fs36.existsSync(summaryPathFor(jsonlPath2));
|
|
25286
25313
|
}
|
|
25287
25314
|
function summaryPathFor(jsonlPath2) {
|
|
25288
25315
|
return jsonlPath2.replace(/\.jsonl$/, ".summary");
|
|
@@ -25292,7 +25319,7 @@ function summaryPathFor(jsonlPath2) {
|
|
|
25292
25319
|
import { execFileSync as execFileSync10 } from "child_process";
|
|
25293
25320
|
|
|
25294
25321
|
// src/commands/sessions/summarise/iterateUserMessages.ts
|
|
25295
|
-
import * as
|
|
25322
|
+
import * as fs37 from "fs";
|
|
25296
25323
|
|
|
25297
25324
|
// src/commands/sessions/summarise/parseUserLine.ts
|
|
25298
25325
|
function parseUserLine(line) {
|
|
@@ -25323,13 +25350,13 @@ function parseUserLine(line) {
|
|
|
25323
25350
|
function* iterateUserMessages(filePath, maxBytes = 65536) {
|
|
25324
25351
|
let content;
|
|
25325
25352
|
try {
|
|
25326
|
-
const fd =
|
|
25353
|
+
const fd = fs37.openSync(filePath, "r");
|
|
25327
25354
|
try {
|
|
25328
25355
|
const buf = Buffer.alloc(maxBytes);
|
|
25329
|
-
const bytesRead =
|
|
25356
|
+
const bytesRead = fs37.readSync(fd, buf, 0, buf.length, 0);
|
|
25330
25357
|
content = buf.toString("utf8", 0, bytesRead);
|
|
25331
25358
|
} finally {
|
|
25332
|
-
|
|
25359
|
+
fs37.closeSync(fd);
|
|
25333
25360
|
}
|
|
25334
25361
|
} catch {
|
|
25335
25362
|
return;
|
|
@@ -25449,7 +25476,7 @@ function selectCandidates(files, options2) {
|
|
|
25449
25476
|
const candidates = options2.force ? files : files.filter((f) => !hasSummary(f));
|
|
25450
25477
|
candidates.sort((a, b) => {
|
|
25451
25478
|
try {
|
|
25452
|
-
return
|
|
25479
|
+
return fs38.statSync(b).mtimeMs - fs38.statSync(a).mtimeMs;
|
|
25453
25480
|
} catch {
|
|
25454
25481
|
return 0;
|
|
25455
25482
|
}
|
|
@@ -25582,10 +25609,10 @@ function buildLimitsSegment(rateLimits) {
|
|
|
25582
25609
|
}
|
|
25583
25610
|
|
|
25584
25611
|
// src/commands/readGitBranch.ts
|
|
25585
|
-
import { readFileSync as
|
|
25586
|
-
import { isAbsolute as isAbsolute2, join as
|
|
25612
|
+
import { readFileSync as readFileSync49, statSync as statSync11 } from "fs";
|
|
25613
|
+
import { isAbsolute as isAbsolute2, join as join65, resolve as resolve16 } from "path";
|
|
25587
25614
|
function resolveGitDir(cwd) {
|
|
25588
|
-
const dotGit =
|
|
25615
|
+
const dotGit = join65(cwd, ".git");
|
|
25589
25616
|
let stat2;
|
|
25590
25617
|
try {
|
|
25591
25618
|
stat2 = statSync11(dotGit);
|
|
@@ -25597,7 +25624,7 @@ function resolveGitDir(cwd) {
|
|
|
25597
25624
|
}
|
|
25598
25625
|
let contents;
|
|
25599
25626
|
try {
|
|
25600
|
-
contents =
|
|
25627
|
+
contents = readFileSync49(dotGit, "utf8");
|
|
25601
25628
|
} catch {
|
|
25602
25629
|
return null;
|
|
25603
25630
|
}
|
|
@@ -25615,7 +25642,7 @@ function readGitBranch(cwd) {
|
|
|
25615
25642
|
}
|
|
25616
25643
|
let head;
|
|
25617
25644
|
try {
|
|
25618
|
-
head =
|
|
25645
|
+
head = readFileSync49(join65(gitDir, "HEAD"), "utf8");
|
|
25619
25646
|
} catch {
|
|
25620
25647
|
return null;
|
|
25621
25648
|
}
|
|
@@ -25678,21 +25705,21 @@ async function statusLine() {
|
|
|
25678
25705
|
}
|
|
25679
25706
|
|
|
25680
25707
|
// src/commands/sync.ts
|
|
25681
|
-
import * as
|
|
25708
|
+
import * as fs42 from "fs";
|
|
25682
25709
|
import * as os2 from "os";
|
|
25683
|
-
import * as
|
|
25684
|
-
import { fileURLToPath as
|
|
25710
|
+
import * as path58 from "path";
|
|
25711
|
+
import { fileURLToPath as fileURLToPath8 } from "url";
|
|
25685
25712
|
|
|
25686
25713
|
// src/commands/sync/syncClaudeMd.ts
|
|
25687
|
-
import * as
|
|
25688
|
-
import * as
|
|
25714
|
+
import * as fs39 from "fs";
|
|
25715
|
+
import * as path55 from "path";
|
|
25689
25716
|
import chalk198 from "chalk";
|
|
25690
25717
|
async function syncClaudeMd(claudeDir, targetBase, options2) {
|
|
25691
|
-
const source =
|
|
25692
|
-
const target =
|
|
25693
|
-
const sourceContent =
|
|
25694
|
-
if (
|
|
25695
|
-
const targetContent =
|
|
25718
|
+
const source = path55.join(claudeDir, "CLAUDE.md");
|
|
25719
|
+
const target = path55.join(targetBase, "CLAUDE.md");
|
|
25720
|
+
const sourceContent = fs39.readFileSync(source, "utf8");
|
|
25721
|
+
if (fs39.existsSync(target)) {
|
|
25722
|
+
const targetContent = fs39.readFileSync(target, "utf8");
|
|
25696
25723
|
if (sourceContent !== targetContent) {
|
|
25697
25724
|
console.log(
|
|
25698
25725
|
chalk198.yellow("\n\u26A0\uFE0F Warning: CLAUDE.md differs from existing file")
|
|
@@ -25709,21 +25736,42 @@ async function syncClaudeMd(claudeDir, targetBase, options2) {
|
|
|
25709
25736
|
}
|
|
25710
25737
|
}
|
|
25711
25738
|
}
|
|
25712
|
-
|
|
25739
|
+
fs39.copyFileSync(source, target);
|
|
25713
25740
|
console.log("Copied CLAUDE.md to ~/.claude/CLAUDE.md");
|
|
25714
25741
|
}
|
|
25715
25742
|
|
|
25743
|
+
// src/commands/sync/syncDesign.ts
|
|
25744
|
+
import * as fs40 from "fs";
|
|
25745
|
+
import * as path56 from "path";
|
|
25746
|
+
function syncDesign(claudeDir, targetBase) {
|
|
25747
|
+
const systemPromptSource = path56.join(claudeDir, "system-prompt.md");
|
|
25748
|
+
const systemPromptTarget = path56.join(targetBase, "system-prompt.md");
|
|
25749
|
+
fs40.copyFileSync(systemPromptSource, systemPromptTarget);
|
|
25750
|
+
console.log("Copied system-prompt.md to ~/.claude/system-prompt.md");
|
|
25751
|
+
const skillsSource = path56.join(claudeDir, "skills");
|
|
25752
|
+
const skillsTarget = path56.join(targetBase, "skills");
|
|
25753
|
+
fs40.mkdirSync(skillsTarget, { recursive: true });
|
|
25754
|
+
const files = fs40.readdirSync(skillsSource);
|
|
25755
|
+
for (const file of files) {
|
|
25756
|
+
fs40.copyFileSync(
|
|
25757
|
+
path56.join(skillsSource, file),
|
|
25758
|
+
path56.join(skillsTarget, file)
|
|
25759
|
+
);
|
|
25760
|
+
}
|
|
25761
|
+
console.log(`Synced ${files.length} design skill(s) to ~/.claude/skills`);
|
|
25762
|
+
}
|
|
25763
|
+
|
|
25716
25764
|
// src/commands/sync/syncSettings.ts
|
|
25717
|
-
import * as
|
|
25718
|
-
import * as
|
|
25765
|
+
import * as fs41 from "fs";
|
|
25766
|
+
import * as path57 from "path";
|
|
25719
25767
|
import chalk199 from "chalk";
|
|
25720
25768
|
async function syncSettings(claudeDir, targetBase, options2) {
|
|
25721
|
-
const source =
|
|
25722
|
-
const target =
|
|
25723
|
-
const sourceContent =
|
|
25769
|
+
const source = path57.join(claudeDir, "settings.json");
|
|
25770
|
+
const target = path57.join(targetBase, "settings.json");
|
|
25771
|
+
const sourceContent = fs41.readFileSync(source, "utf8");
|
|
25724
25772
|
const sourceSettings = JSON.parse(sourceContent);
|
|
25725
|
-
const targetExists =
|
|
25726
|
-
const targetContent = targetExists ?
|
|
25773
|
+
const targetExists = fs41.existsSync(target);
|
|
25774
|
+
const targetContent = targetExists ? fs41.readFileSync(target, "utf8") : "";
|
|
25727
25775
|
const preservedUserSettings = targetExists ? JSON.parse(targetContent) : {};
|
|
25728
25776
|
const mergedContent = JSON.stringify(
|
|
25729
25777
|
{ ...preservedUserSettings, ...sourceSettings },
|
|
@@ -25752,29 +25800,30 @@ async function syncSettings(claudeDir, targetBase, options2) {
|
|
|
25752
25800
|
}
|
|
25753
25801
|
}
|
|
25754
25802
|
}
|
|
25755
|
-
|
|
25803
|
+
fs41.writeFileSync(target, mergedContent);
|
|
25756
25804
|
console.log("Copied settings.json to ~/.claude/settings.json");
|
|
25757
25805
|
}
|
|
25758
25806
|
|
|
25759
25807
|
// src/commands/sync.ts
|
|
25760
|
-
var
|
|
25761
|
-
var
|
|
25808
|
+
var __filename5 = fileURLToPath8(import.meta.url);
|
|
25809
|
+
var __dirname7 = path58.dirname(__filename5);
|
|
25762
25810
|
async function sync(options2) {
|
|
25763
25811
|
const config = loadConfig();
|
|
25764
25812
|
const yes = options2?.yes ?? config.sync.autoConfirm;
|
|
25765
|
-
const claudeDir =
|
|
25766
|
-
const targetBase =
|
|
25813
|
+
const claudeDir = path58.join(__dirname7, "..", "claude");
|
|
25814
|
+
const targetBase = path58.join(os2.homedir(), ".claude");
|
|
25767
25815
|
syncCommands(claudeDir, targetBase);
|
|
25816
|
+
syncDesign(claudeDir, targetBase);
|
|
25768
25817
|
await syncSettings(claudeDir, targetBase, { yes });
|
|
25769
25818
|
await syncClaudeMd(claudeDir, targetBase, { yes });
|
|
25770
25819
|
}
|
|
25771
25820
|
function syncCommands(claudeDir, targetBase) {
|
|
25772
|
-
const sourceDir =
|
|
25773
|
-
const targetDir =
|
|
25774
|
-
|
|
25775
|
-
const files =
|
|
25821
|
+
const sourceDir = path58.join(claudeDir, "commands");
|
|
25822
|
+
const targetDir = path58.join(targetBase, "commands");
|
|
25823
|
+
fs42.mkdirSync(targetDir, { recursive: true });
|
|
25824
|
+
const files = fs42.readdirSync(sourceDir);
|
|
25776
25825
|
for (const file of files) {
|
|
25777
|
-
|
|
25826
|
+
fs42.copyFileSync(path58.join(sourceDir, file), path58.join(targetDir, file));
|
|
25778
25827
|
console.log(`Copied ${file} to ${targetDir}`);
|
|
25779
25828
|
}
|
|
25780
25829
|
console.log(`Synced ${files.length} command(s) to ~/.claude/commands`);
|
|
@@ -25782,7 +25831,7 @@ function syncCommands(claudeDir, targetBase) {
|
|
|
25782
25831
|
|
|
25783
25832
|
// src/commands/update.ts
|
|
25784
25833
|
import { execSync as execSync55 } from "child_process";
|
|
25785
|
-
import * as
|
|
25834
|
+
import * as path59 from "path";
|
|
25786
25835
|
|
|
25787
25836
|
// src/commands/restartDaemonAfterUpdate.ts
|
|
25788
25837
|
async function restartDaemonAfterUpdate() {
|
|
@@ -25801,12 +25850,12 @@ async function restartDaemonAfterUpdate() {
|
|
|
25801
25850
|
// src/commands/update.ts
|
|
25802
25851
|
function isGlobalNpmInstall(dir) {
|
|
25803
25852
|
try {
|
|
25804
|
-
const resolved =
|
|
25805
|
-
if (resolved.split(
|
|
25853
|
+
const resolved = path59.resolve(dir);
|
|
25854
|
+
if (resolved.split(path59.sep).includes("node_modules")) {
|
|
25806
25855
|
return true;
|
|
25807
25856
|
}
|
|
25808
25857
|
const globalPrefix = execSync55("npm prefix -g", { stdio: "pipe" }).toString().trim();
|
|
25809
|
-
return resolved.toLowerCase().startsWith(
|
|
25858
|
+
return resolved.toLowerCase().startsWith(path59.resolve(globalPrefix).toLowerCase());
|
|
25810
25859
|
} catch {
|
|
25811
25860
|
return false;
|
|
25812
25861
|
}
|