@funnycode/myclaude 0.1.199 → 0.1.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/myclaude.js +238 -205
- package/dist/myclaude.mjs +238 -205
- package/package.json +1 -1
package/dist/myclaude.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
// MACRO - build-time constants (injected by build.ts)
|
|
5
5
|
// MACRO injected by build script
|
|
6
6
|
globalThis.MACRO = {
|
|
7
|
-
VERSION: "0.1.
|
|
8
|
-
BUILD_TIME: "2026-08-
|
|
7
|
+
VERSION: "0.1.200",
|
|
8
|
+
BUILD_TIME: "2026-08-16T02:15:29.761Z",
|
|
9
9
|
PACKAGE_URL: "@funnycode/myclaude",
|
|
10
10
|
NATIVE_PACKAGE_URL: "@funnycode/myclaude",
|
|
11
11
|
VERSION_CHANGELOG: '',
|
|
@@ -117157,7 +117157,7 @@ var package_default;
|
|
|
117157
117157
|
var init_package = __esm(() => {
|
|
117158
117158
|
package_default = {
|
|
117159
117159
|
name: "@funnycode/myclaude",
|
|
117160
|
-
version: "0.1.
|
|
117160
|
+
version: "0.1.200",
|
|
117161
117161
|
private: false,
|
|
117162
117162
|
description: "An open-source AI coding assistant in your terminal - powered by Claude",
|
|
117163
117163
|
license: "MIT",
|
|
@@ -484761,6 +484761,37 @@ var init_advisor2 = __esm(() => {
|
|
|
484761
484761
|
advisor_default = advisor;
|
|
484762
484762
|
});
|
|
484763
484763
|
|
|
484764
|
+
// src/commands/artifact.ts
|
|
484765
|
+
import { tmpdir as tmpdir11 } from "os";
|
|
484766
|
+
import { join as join132 } from "path";
|
|
484767
|
+
import { writeFileSync as writeFileSync9 } from "fs";
|
|
484768
|
+
var call64 = async (args, _context) => {
|
|
484769
|
+
const html = args.trim();
|
|
484770
|
+
if (!html) {
|
|
484771
|
+
return { type: "text", value: "Artifact preview: pass HTML to render" };
|
|
484772
|
+
}
|
|
484773
|
+
const file2 = join132(tmpdir11(), "myclaude-artifact-" + Date.now() + "-" + Math.random().toString(36).slice(2) + ".html");
|
|
484774
|
+
writeFileSync9(file2, html, "utf-8");
|
|
484775
|
+
const opened = await openBrowser("file://" + file2);
|
|
484776
|
+
return {
|
|
484777
|
+
type: "text",
|
|
484778
|
+
value: opened ? "Artifact preview opened in browser (" + file2 + ")" : "Artifact written to " + file2
|
|
484779
|
+
};
|
|
484780
|
+
}, artifact, artifact_default;
|
|
484781
|
+
var init_artifact = __esm(() => {
|
|
484782
|
+
init_browser();
|
|
484783
|
+
artifact = {
|
|
484784
|
+
type: "local",
|
|
484785
|
+
name: "artifact",
|
|
484786
|
+
description: "Render HTML and preview it in the default browser",
|
|
484787
|
+
argumentHint: "<html>",
|
|
484788
|
+
isEnabled: () => true,
|
|
484789
|
+
supportsNonInteractive: false,
|
|
484790
|
+
load: () => Promise.resolve({ call: call64 })
|
|
484791
|
+
};
|
|
484792
|
+
artifact_default = artifact;
|
|
484793
|
+
});
|
|
484794
|
+
|
|
484764
484795
|
// src/commands/git-flow/index.ts
|
|
484765
484796
|
async function runGit(args) {
|
|
484766
484797
|
const result = await execFileNoThrow(gitExe(), args, { preserveOutputOnError: false });
|
|
@@ -485087,7 +485118,7 @@ var init_frontend_tdd = __esm(() => {
|
|
|
485087
485118
|
|
|
485088
485119
|
// src/commands/remember.ts
|
|
485089
485120
|
import { appendFile as appendFile5, mkdir as mkdir36 } from "fs/promises";
|
|
485090
|
-
import { join as
|
|
485121
|
+
import { join as join133 } from "path";
|
|
485091
485122
|
function formatEntry(content) {
|
|
485092
485123
|
const now2 = new Date;
|
|
485093
485124
|
const ts = now2.toISOString().replace("T", " ").slice(0, 19);
|
|
@@ -485096,7 +485127,7 @@ function formatEntry(content) {
|
|
|
485096
485127
|
${content.trim()}
|
|
485097
485128
|
`;
|
|
485098
485129
|
}
|
|
485099
|
-
var
|
|
485130
|
+
var call65 = async (args) => {
|
|
485100
485131
|
const text2 = args.trim();
|
|
485101
485132
|
if (!text2) {
|
|
485102
485133
|
return {
|
|
@@ -485114,7 +485145,7 @@ Examples:
|
|
|
485114
485145
|
try {
|
|
485115
485146
|
const homeDir = getClaudeConfigHomeDir();
|
|
485116
485147
|
await mkdir36(homeDir, { recursive: true });
|
|
485117
|
-
const memFile =
|
|
485148
|
+
const memFile = join133(homeDir, "CLAUDE.md");
|
|
485118
485149
|
const entry = formatEntry(text2);
|
|
485119
485150
|
await appendFile5(memFile, entry, "utf-8");
|
|
485120
485151
|
return {
|
|
@@ -485137,7 +485168,7 @@ var init_remember = __esm(() => {
|
|
|
485137
485168
|
description: "Save important information to memory for reuse in future sessions",
|
|
485138
485169
|
argumentHint: "<what to remember>",
|
|
485139
485170
|
supportsNonInteractive: true,
|
|
485140
|
-
load: async () => ({ call:
|
|
485171
|
+
load: async () => ({ call: call65 })
|
|
485141
485172
|
};
|
|
485142
485173
|
remember_default = remember;
|
|
485143
485174
|
});
|
|
@@ -485145,7 +485176,7 @@ var init_remember = __esm(() => {
|
|
|
485145
485176
|
// src/skills/bundledSkills.ts
|
|
485146
485177
|
import { constants as fsConstants5 } from "fs";
|
|
485147
485178
|
import { mkdir as mkdir37, open as open14 } from "fs/promises";
|
|
485148
|
-
import { dirname as dirname59, isAbsolute as isAbsolute28, join as
|
|
485179
|
+
import { dirname as dirname59, isAbsolute as isAbsolute28, join as join134, normalize as normalize13, sep as pathSep3 } from "path";
|
|
485149
485180
|
function registerBundledSkill(definition) {
|
|
485150
485181
|
const { files: files3 } = definition;
|
|
485151
485182
|
let skillRoot;
|
|
@@ -485193,7 +485224,7 @@ function getBundledSkills() {
|
|
|
485193
485224
|
return [...bundledSkills];
|
|
485194
485225
|
}
|
|
485195
485226
|
function getBundledSkillExtractDir(skillName) {
|
|
485196
|
-
return
|
|
485227
|
+
return join134(getBundledSkillsRoot(), skillName);
|
|
485197
485228
|
}
|
|
485198
485229
|
async function extractBundledSkillFiles(skillName, files3) {
|
|
485199
485230
|
const dir = getBundledSkillExtractDir(skillName);
|
|
@@ -485235,7 +485266,7 @@ function resolveSkillFilePath(baseDir, relPath) {
|
|
|
485235
485266
|
if (isAbsolute28(normalized) || normalized.split(pathSep3).includes("..") || normalized.split("/").includes("..")) {
|
|
485236
485267
|
throw new Error(`bundled skill file path escapes skill dir: ${relPath}`);
|
|
485237
485268
|
}
|
|
485238
|
-
return
|
|
485269
|
+
return join134(baseDir, normalized);
|
|
485239
485270
|
}
|
|
485240
485271
|
function prependBaseDir(blocks, baseDir) {
|
|
485241
485272
|
const prefix = `Base directory for this skill: ${baseDir}
|
|
@@ -485551,12 +485582,12 @@ var init_ExitFlow = __esm(() => {
|
|
|
485551
485582
|
// src/commands/exit/exit.tsx
|
|
485552
485583
|
var exports_exit = {};
|
|
485553
485584
|
__export(exports_exit, {
|
|
485554
|
-
call: () =>
|
|
485585
|
+
call: () => call66
|
|
485555
485586
|
});
|
|
485556
485587
|
function getRandomGoodbyeMessage2() {
|
|
485557
485588
|
return sample_default(GOODBYE_MESSAGES2) ?? "Goodbye!";
|
|
485558
485589
|
}
|
|
485559
|
-
async function
|
|
485590
|
+
async function call66(onDone) {
|
|
485560
485591
|
if (false) {}
|
|
485561
485592
|
const showWorktree = getCurrentWorktreeSession() !== null;
|
|
485562
485593
|
if (showWorktree) {
|
|
@@ -485596,7 +485627,7 @@ var init_exit2 = __esm(() => {
|
|
|
485596
485627
|
});
|
|
485597
485628
|
|
|
485598
485629
|
// src/components/ExportDialog.tsx
|
|
485599
|
-
import { join as
|
|
485630
|
+
import { join as join135 } from "path";
|
|
485600
485631
|
function ExportDialog({
|
|
485601
485632
|
content,
|
|
485602
485633
|
defaultFilename,
|
|
@@ -485629,7 +485660,7 @@ function ExportDialog({
|
|
|
485629
485660
|
};
|
|
485630
485661
|
const handleFilenameSubmit = () => {
|
|
485631
485662
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
485632
|
-
const filepath =
|
|
485663
|
+
const filepath = join135(getCwd(), finalFilename);
|
|
485633
485664
|
try {
|
|
485634
485665
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
485635
485666
|
encoding: "utf-8",
|
|
@@ -485850,9 +485881,9 @@ var exports_export = {};
|
|
|
485850
485881
|
__export(exports_export, {
|
|
485851
485882
|
sanitizeFilename: () => sanitizeFilename,
|
|
485852
485883
|
extractFirstPrompt: () => extractFirstPrompt,
|
|
485853
|
-
call: () =>
|
|
485884
|
+
call: () => call67
|
|
485854
485885
|
});
|
|
485855
|
-
import { join as
|
|
485886
|
+
import { join as join136 } from "path";
|
|
485856
485887
|
function formatTimestamp(date6) {
|
|
485857
485888
|
const year = date6.getFullYear();
|
|
485858
485889
|
const month = String(date6.getMonth() + 1).padStart(2, "0");
|
|
@@ -485891,12 +485922,12 @@ async function exportWithReactRenderer(context2) {
|
|
|
485891
485922
|
const tools = context2.options.tools || [];
|
|
485892
485923
|
return renderMessagesToPlainText(context2.messages, tools);
|
|
485893
485924
|
}
|
|
485894
|
-
async function
|
|
485925
|
+
async function call67(onDone, context2, args) {
|
|
485895
485926
|
const content = await exportWithReactRenderer(context2);
|
|
485896
485927
|
const filename = args.trim();
|
|
485897
485928
|
if (filename) {
|
|
485898
485929
|
const finalFilename = filename.endsWith(".txt") ? filename : filename.replace(/\.[^.]+$/, "") + ".txt";
|
|
485899
|
-
const filepath =
|
|
485930
|
+
const filepath = join136(getCwd(), finalFilename);
|
|
485900
485931
|
try {
|
|
485901
485932
|
writeFileSync_DEPRECATED(filepath, content, {
|
|
485902
485933
|
encoding: "utf-8",
|
|
@@ -485951,7 +485982,7 @@ var init_export2 = __esm(() => {
|
|
|
485951
485982
|
// src/commands/model/model.tsx
|
|
485952
485983
|
var exports_model2 = {};
|
|
485953
485984
|
__export(exports_model2, {
|
|
485954
|
-
call: () =>
|
|
485985
|
+
call: () => call68
|
|
485955
485986
|
});
|
|
485956
485987
|
function ModelPickerWrapper(t0) {
|
|
485957
485988
|
const $3 = import_compiler_runtime269.c(17);
|
|
@@ -486199,7 +486230,7 @@ function renderModelLabel(model) {
|
|
|
486199
486230
|
const rendered = renderDefaultModelSetting(model ?? getDefaultMainLoopModelSetting());
|
|
486200
486231
|
return model === null ? `${rendered} (default)` : rendered;
|
|
486201
486232
|
}
|
|
486202
|
-
var import_compiler_runtime269, React107, jsx_dev_runtime347,
|
|
486233
|
+
var import_compiler_runtime269, React107, jsx_dev_runtime347, call68 = async (onDone, _context, args) => {
|
|
486203
486234
|
args = args?.trim() || "";
|
|
486204
486235
|
if (COMMON_INFO_ARGS.includes(args)) {
|
|
486205
486236
|
logEvent("tengu_model_command_inline_help", {
|
|
@@ -486268,7 +486299,7 @@ var init_model3 = __esm(() => {
|
|
|
486268
486299
|
// src/commands/tag/tag.tsx
|
|
486269
486300
|
var exports_tag = {};
|
|
486270
486301
|
__export(exports_tag, {
|
|
486271
|
-
call: () =>
|
|
486302
|
+
call: () => call69
|
|
486272
486303
|
});
|
|
486273
486304
|
function ConfirmRemoveTag(t0) {
|
|
486274
486305
|
const $3 = import_compiler_runtime270.c(11);
|
|
@@ -486492,7 +486523,7 @@ Examples:
|
|
|
486492
486523
|
React108.useEffect(t1, t2);
|
|
486493
486524
|
return null;
|
|
486494
486525
|
}
|
|
486495
|
-
async function
|
|
486526
|
+
async function call69(onDone, _context, args) {
|
|
486496
486527
|
args = args?.trim() || "";
|
|
486497
486528
|
if (COMMON_INFO_ARGS.includes(args) || COMMON_HELP_ARGS.includes(args)) {
|
|
486498
486529
|
return /* @__PURE__ */ jsx_dev_runtime348.jsxDEV(ShowHelp, {
|
|
@@ -486540,9 +486571,9 @@ var init_tag2 = __esm(() => {
|
|
|
486540
486571
|
// src/commands/output-style/output-style.tsx
|
|
486541
486572
|
var exports_output_style = {};
|
|
486542
486573
|
__export(exports_output_style, {
|
|
486543
|
-
call: () =>
|
|
486574
|
+
call: () => call70
|
|
486544
486575
|
});
|
|
486545
|
-
async function
|
|
486576
|
+
async function call70(onDone) {
|
|
486546
486577
|
onDone("/output-style has been deprecated. Use /config to change your output style, or set it in your settings file. Changes take effect on the next session.", {
|
|
486547
486578
|
display: "system"
|
|
486548
486579
|
});
|
|
@@ -487061,9 +487092,9 @@ var init_RemoteEnvironmentDialog = __esm(() => {
|
|
|
487061
487092
|
// src/commands/remote-env/remote-env.tsx
|
|
487062
487093
|
var exports_remote_env = {};
|
|
487063
487094
|
__export(exports_remote_env, {
|
|
487064
|
-
call: () =>
|
|
487095
|
+
call: () => call71
|
|
487065
487096
|
});
|
|
487066
|
-
async function
|
|
487097
|
+
async function call71(onDone) {
|
|
487067
487098
|
return /* @__PURE__ */ jsx_dev_runtime350.jsxDEV(RemoteEnvironmentDialog, {
|
|
487068
487099
|
onDone
|
|
487069
487100
|
}, undefined, false, undefined, this);
|
|
@@ -487093,9 +487124,9 @@ var init_remote_env2 = __esm(() => {
|
|
|
487093
487124
|
// src/commands/upgrade/upgrade.tsx
|
|
487094
487125
|
var exports_upgrade = {};
|
|
487095
487126
|
__export(exports_upgrade, {
|
|
487096
|
-
call: () =>
|
|
487127
|
+
call: () => call72
|
|
487097
487128
|
});
|
|
487098
|
-
async function
|
|
487129
|
+
async function call72(onDone, context2) {
|
|
487099
487130
|
try {
|
|
487100
487131
|
if (isClaudeAISubscriber()) {
|
|
487101
487132
|
const tokens = getClaudeAIOAuthTokens();
|
|
@@ -487155,7 +487186,7 @@ var init_upgrade2 = __esm(() => {
|
|
|
487155
487186
|
// src/commands/rate-limit-options/rate-limit-options.tsx
|
|
487156
487187
|
var exports_rate_limit_options = {};
|
|
487157
487188
|
__export(exports_rate_limit_options, {
|
|
487158
|
-
call: () =>
|
|
487189
|
+
call: () => call73
|
|
487159
487190
|
});
|
|
487160
487191
|
function RateLimitOptionsMenu(t0) {
|
|
487161
487192
|
const $3 = import_compiler_runtime272.c(25);
|
|
@@ -487289,7 +487320,7 @@ function RateLimitOptionsMenu(t0) {
|
|
|
487289
487320
|
t5 = function handleSelect2(value) {
|
|
487290
487321
|
if (value === "upgrade") {
|
|
487291
487322
|
logEvent("tengu_rate_limit_options_menu_select_upgrade", {});
|
|
487292
|
-
|
|
487323
|
+
call72(onDone, context2).then((jsx) => {
|
|
487293
487324
|
if (jsx) {
|
|
487294
487325
|
setSubCommandJSX(jsx);
|
|
487295
487326
|
}
|
|
@@ -487349,7 +487380,7 @@ function RateLimitOptionsMenu(t0) {
|
|
|
487349
487380
|
}
|
|
487350
487381
|
return t7;
|
|
487351
487382
|
}
|
|
487352
|
-
async function
|
|
487383
|
+
async function call73(onDone, context2) {
|
|
487353
487384
|
return /* @__PURE__ */ jsx_dev_runtime352.jsxDEV(RateLimitOptionsMenu, {
|
|
487354
487385
|
onDone,
|
|
487355
487386
|
context: context2
|
|
@@ -487423,7 +487454,7 @@ var exports_effort = {};
|
|
|
487423
487454
|
__export(exports_effort, {
|
|
487424
487455
|
showCurrentEffort: () => showCurrentEffort,
|
|
487425
487456
|
executeEffort: () => executeEffort,
|
|
487426
|
-
call: () =>
|
|
487457
|
+
call: () => call74
|
|
487427
487458
|
});
|
|
487428
487459
|
function setEffortValue(effortValue) {
|
|
487429
487460
|
const persistable = toPersistableEffort(effortValue);
|
|
@@ -487574,7 +487605,7 @@ function ApplyEffortAndClose(t0) {
|
|
|
487574
487605
|
React110.useEffect(t1, t2);
|
|
487575
487606
|
return null;
|
|
487576
487607
|
}
|
|
487577
|
-
async function
|
|
487608
|
+
async function call74(onDone, _context, args) {
|
|
487578
487609
|
args = args?.trim() || "";
|
|
487579
487610
|
if (COMMON_HELP_ARGS2.includes(args)) {
|
|
487580
487611
|
onDone(`Usage: /effort [low|medium|high|max|auto]
|
|
@@ -487727,7 +487758,7 @@ var require_asciichart = __commonJS((exports) => {
|
|
|
487727
487758
|
// src/utils/statsCache.ts
|
|
487728
487759
|
import { randomBytes as randomBytes18 } from "crypto";
|
|
487729
487760
|
import { open as open15 } from "fs/promises";
|
|
487730
|
-
import { join as
|
|
487761
|
+
import { join as join137 } from "path";
|
|
487731
487762
|
async function withStatsCacheLock(fn) {
|
|
487732
487763
|
while (statsCacheLockPromise) {
|
|
487733
487764
|
await statsCacheLockPromise;
|
|
@@ -487744,7 +487775,7 @@ async function withStatsCacheLock(fn) {
|
|
|
487744
487775
|
}
|
|
487745
487776
|
}
|
|
487746
487777
|
function getStatsCachePath() {
|
|
487747
|
-
return
|
|
487778
|
+
return join137(getClaudeConfigHomeDir(), STATS_CACHE_FILENAME);
|
|
487748
487779
|
}
|
|
487749
487780
|
function getEmptyCache() {
|
|
487750
487781
|
return {
|
|
@@ -488411,13 +488442,13 @@ var init_ansiToPng = __esm(() => {
|
|
|
488411
488442
|
|
|
488412
488443
|
// src/utils/screenshotClipboard.ts
|
|
488413
488444
|
import { mkdir as mkdir38, unlink as unlink17, writeFile as writeFile39 } from "fs/promises";
|
|
488414
|
-
import { tmpdir as
|
|
488415
|
-
import { join as
|
|
488445
|
+
import { tmpdir as tmpdir12 } from "os";
|
|
488446
|
+
import { join as join138 } from "path";
|
|
488416
488447
|
async function copyAnsiToClipboard(ansiText, options) {
|
|
488417
488448
|
try {
|
|
488418
|
-
const tempDir =
|
|
488449
|
+
const tempDir = join138(tmpdir12(), "claude-code-screenshots");
|
|
488419
488450
|
await mkdir38(tempDir, { recursive: true });
|
|
488420
|
-
const pngPath =
|
|
488451
|
+
const pngPath = join138(tempDir, `screenshot-${Date.now()}.png`);
|
|
488421
488452
|
const pngBuffer = ansiToPng(ansiText, options);
|
|
488422
488453
|
await writeFile39(pngPath, pngBuffer);
|
|
488423
488454
|
const result = await copyPngToClipboard(pngPath);
|
|
@@ -488488,7 +488519,7 @@ var init_screenshotClipboard = __esm(() => {
|
|
|
488488
488519
|
|
|
488489
488520
|
// src/utils/stats.ts
|
|
488490
488521
|
import { open as open16 } from "fs/promises";
|
|
488491
|
-
import { basename as basename44, join as
|
|
488522
|
+
import { basename as basename44, join as join139, sep as sep36 } from "path";
|
|
488492
488523
|
async function processSessionFiles(sessionFiles, options = {}) {
|
|
488493
488524
|
const { fromDate, toDate } = options;
|
|
488494
488525
|
const fs14 = getFsImplementation();
|
|
@@ -488666,17 +488697,17 @@ async function getAllSessionFiles() {
|
|
|
488666
488697
|
return [];
|
|
488667
488698
|
throw e;
|
|
488668
488699
|
}
|
|
488669
|
-
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
488700
|
+
const projectDirs = allEntries.filter((dirent) => dirent.isDirectory()).map((dirent) => join139(projectsDir, dirent.name));
|
|
488670
488701
|
const projectResults = await Promise.all(projectDirs.map(async (projectDir) => {
|
|
488671
488702
|
try {
|
|
488672
488703
|
const entries = await fs14.readdir(projectDir);
|
|
488673
|
-
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) =>
|
|
488704
|
+
const mainFiles = entries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl")).map((dirent) => join139(projectDir, dirent.name));
|
|
488674
488705
|
const sessionDirs = entries.filter((dirent) => dirent.isDirectory());
|
|
488675
488706
|
const subagentResults = await Promise.all(sessionDirs.map(async (sessionDir) => {
|
|
488676
|
-
const subagentsDir =
|
|
488707
|
+
const subagentsDir = join139(projectDir, sessionDir.name, "subagents");
|
|
488677
488708
|
try {
|
|
488678
488709
|
const subagentEntries = await fs14.readdir(subagentsDir);
|
|
488679
|
-
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) =>
|
|
488710
|
+
return subagentEntries.filter((dirent) => dirent.isFile() && dirent.name.endsWith(".jsonl") && dirent.name.startsWith("agent-")).map((dirent) => join139(subagentsDir, dirent.name));
|
|
488680
488711
|
} catch {
|
|
488681
488712
|
return [];
|
|
488682
488713
|
}
|
|
@@ -490483,9 +490514,9 @@ var init_Stats = __esm(() => {
|
|
|
490483
490514
|
// src/commands/stats/stats.tsx
|
|
490484
490515
|
var exports_stats = {};
|
|
490485
490516
|
__export(exports_stats, {
|
|
490486
|
-
call: () =>
|
|
490517
|
+
call: () => call75
|
|
490487
490518
|
});
|
|
490488
|
-
var jsx_dev_runtime355,
|
|
490519
|
+
var jsx_dev_runtime355, call75 = async (onDone) => {
|
|
490489
490520
|
return /* @__PURE__ */ jsx_dev_runtime355.jsxDEV(Stats2, {
|
|
490490
490521
|
onClose: onDone
|
|
490491
490522
|
}, undefined, false, undefined, this);
|
|
@@ -491080,7 +491111,7 @@ var init_calendar = __esm(() => {
|
|
|
491080
491111
|
// src/commands/buddy/buddy.ts
|
|
491081
491112
|
var exports_buddy = {};
|
|
491082
491113
|
__export(exports_buddy, {
|
|
491083
|
-
call: () =>
|
|
491114
|
+
call: () => call76
|
|
491084
491115
|
});
|
|
491085
491116
|
function getXpBar(current, needed) {
|
|
491086
491117
|
const filled = Math.floor(current / needed * 10);
|
|
@@ -491283,7 +491314,7 @@ Subcommands:
|
|
|
491283
491314
|
mute Mute companion
|
|
491284
491315
|
unmute Unmute companion
|
|
491285
491316
|
|
|
491286
|
-
XP is earned through interactions. Level up to evolve your companion!`,
|
|
491317
|
+
XP is earned through interactions. Level up to evolve your companion!`, call76 = async (args) => {
|
|
491287
491318
|
const [subcommand] = args.trim().toLowerCase().split(/\s+/);
|
|
491288
491319
|
switch (subcommand) {
|
|
491289
491320
|
case "hatch":
|
|
@@ -491375,8 +491406,8 @@ import {
|
|
|
491375
491406
|
unlink as unlink18,
|
|
491376
491407
|
writeFile as writeFile40
|
|
491377
491408
|
} from "fs/promises";
|
|
491378
|
-
import { tmpdir as
|
|
491379
|
-
import { extname as extname14, join as
|
|
491409
|
+
import { tmpdir as tmpdir13 } from "os";
|
|
491410
|
+
import { extname as extname14, join as join140 } from "path";
|
|
491380
491411
|
function getAnalysisModel() {
|
|
491381
491412
|
return getDefaultSonnetModel();
|
|
491382
491413
|
}
|
|
@@ -491384,13 +491415,13 @@ function getInsightsModel() {
|
|
|
491384
491415
|
return getDefaultSonnetModel();
|
|
491385
491416
|
}
|
|
491386
491417
|
function getDataDir() {
|
|
491387
|
-
return
|
|
491418
|
+
return join140(getClaudeConfigHomeDir(), "usage-data");
|
|
491388
491419
|
}
|
|
491389
491420
|
function getFacetsDir() {
|
|
491390
|
-
return
|
|
491421
|
+
return join140(getDataDir(), "facets");
|
|
491391
491422
|
}
|
|
491392
491423
|
function getSessionMetaDir() {
|
|
491393
|
-
return
|
|
491424
|
+
return join140(getDataDir(), "session-meta");
|
|
491394
491425
|
}
|
|
491395
491426
|
function getLanguageFromPath(filePath) {
|
|
491396
491427
|
const ext = extname14(filePath).toLowerCase();
|
|
@@ -491735,7 +491766,7 @@ async function formatTranscriptWithSummarization(log2) {
|
|
|
491735
491766
|
`);
|
|
491736
491767
|
}
|
|
491737
491768
|
async function loadCachedFacets(sessionId) {
|
|
491738
|
-
const facetPath =
|
|
491769
|
+
const facetPath = join140(getFacetsDir(), `${sessionId}.json`);
|
|
491739
491770
|
try {
|
|
491740
491771
|
const content = await readFile47(facetPath, { encoding: "utf-8" });
|
|
491741
491772
|
const parsed = jsonParse(content);
|
|
@@ -491754,14 +491785,14 @@ async function saveFacets(facets) {
|
|
|
491754
491785
|
try {
|
|
491755
491786
|
await mkdir39(getFacetsDir(), { recursive: true });
|
|
491756
491787
|
} catch {}
|
|
491757
|
-
const facetPath =
|
|
491788
|
+
const facetPath = join140(getFacetsDir(), `${facets.session_id}.json`);
|
|
491758
491789
|
await writeFile40(facetPath, jsonStringify(facets, null, 2), {
|
|
491759
491790
|
encoding: "utf-8",
|
|
491760
491791
|
mode: 384
|
|
491761
491792
|
});
|
|
491762
491793
|
}
|
|
491763
491794
|
async function loadCachedSessionMeta(sessionId) {
|
|
491764
|
-
const metaPath =
|
|
491795
|
+
const metaPath = join140(getSessionMetaDir(), `${sessionId}.json`);
|
|
491765
491796
|
try {
|
|
491766
491797
|
const content = await readFile47(metaPath, { encoding: "utf-8" });
|
|
491767
491798
|
return jsonParse(content);
|
|
@@ -491773,7 +491804,7 @@ async function saveSessionMeta(meta3) {
|
|
|
491773
491804
|
try {
|
|
491774
491805
|
await mkdir39(getSessionMetaDir(), { recursive: true });
|
|
491775
491806
|
} catch {}
|
|
491776
|
-
const metaPath =
|
|
491807
|
+
const metaPath = join140(getSessionMetaDir(), `${meta3.session_id}.json`);
|
|
491777
491808
|
await writeFile40(metaPath, jsonStringify(meta3, null, 2), {
|
|
491778
491809
|
encoding: "utf-8",
|
|
491779
491810
|
mode: 384
|
|
@@ -492881,7 +492912,7 @@ async function scanAllSessions() {
|
|
|
492881
492912
|
} catch {
|
|
492882
492913
|
return [];
|
|
492883
492914
|
}
|
|
492884
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
492915
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join140(projectsDir, dirent.name));
|
|
492885
492916
|
const allSessions = [];
|
|
492886
492917
|
for (let i3 = 0;i3 < projectDirs.length; i3++) {
|
|
492887
492918
|
const sessionFiles = await getSessionFilesWithMtime(projectDirs[i3]);
|
|
@@ -492903,7 +492934,7 @@ async function scanAllSessions() {
|
|
|
492903
492934
|
async function generateUsageReport(options) {
|
|
492904
492935
|
let remoteStats;
|
|
492905
492936
|
if (process.env.USER_TYPE === "ant" && options?.collectRemote) {
|
|
492906
|
-
const destDir =
|
|
492937
|
+
const destDir = join140(getClaudeConfigHomeDir(), "projects");
|
|
492907
492938
|
const { hosts, totalCopied } = await collectAllRemoteHostData(destDir);
|
|
492908
492939
|
remoteStats = { hosts, totalCopied };
|
|
492909
492940
|
}
|
|
@@ -493042,7 +493073,7 @@ async function generateUsageReport(options) {
|
|
|
493042
493073
|
try {
|
|
493043
493074
|
await mkdir39(getDataDir(), { recursive: true });
|
|
493044
493075
|
} catch {}
|
|
493045
|
-
const htmlPath =
|
|
493076
|
+
const htmlPath = join140(getDataDir(), "report.html");
|
|
493046
493077
|
await writeFile40(htmlPath, htmlReport, {
|
|
493047
493078
|
encoding: "utf-8",
|
|
493048
493079
|
mode: 384
|
|
@@ -493138,13 +493169,13 @@ var init_insights = __esm(() => {
|
|
|
493138
493169
|
} : async () => 0;
|
|
493139
493170
|
collectFromRemoteHost = process.env.USER_TYPE === "ant" ? async (homespace, destDir) => {
|
|
493140
493171
|
const result = { copied: 0, skipped: 0 };
|
|
493141
|
-
const tempDir = await mkdtemp3(
|
|
493172
|
+
const tempDir = await mkdtemp3(join140(tmpdir13(), "claude-hs-"));
|
|
493142
493173
|
try {
|
|
493143
493174
|
const scpResult = await execFileNoThrow("scp", ["-rq", `${homespace}.coder:/root/.claude/projects/`, tempDir], { timeout: 300000 });
|
|
493144
493175
|
if (scpResult.code !== 0) {
|
|
493145
493176
|
return result;
|
|
493146
493177
|
}
|
|
493147
|
-
const projectsDir =
|
|
493178
|
+
const projectsDir = join140(tempDir, "projects");
|
|
493148
493179
|
let projectDirents;
|
|
493149
493180
|
try {
|
|
493150
493181
|
projectDirents = await readdir28(projectsDir, { withFileTypes: true });
|
|
@@ -493153,11 +493184,11 @@ var init_insights = __esm(() => {
|
|
|
493153
493184
|
}
|
|
493154
493185
|
await Promise.all(projectDirents.map(async (dirent) => {
|
|
493155
493186
|
const projectName = dirent.name;
|
|
493156
|
-
const projectPath =
|
|
493187
|
+
const projectPath = join140(projectsDir, projectName);
|
|
493157
493188
|
if (!dirent.isDirectory())
|
|
493158
493189
|
return;
|
|
493159
493190
|
const destProjectName = `${projectName}__${homespace}`;
|
|
493160
|
-
const destProjectPath =
|
|
493191
|
+
const destProjectPath = join140(destDir, destProjectName);
|
|
493161
493192
|
try {
|
|
493162
493193
|
await mkdir39(destProjectPath, { recursive: true });
|
|
493163
493194
|
} catch {}
|
|
@@ -493171,8 +493202,8 @@ var init_insights = __esm(() => {
|
|
|
493171
493202
|
const fileName = fileDirent.name;
|
|
493172
493203
|
if (!fileName.endsWith(".jsonl"))
|
|
493173
493204
|
return;
|
|
493174
|
-
const srcFile =
|
|
493175
|
-
const destFile =
|
|
493205
|
+
const srcFile = join140(projectPath, fileName);
|
|
493206
|
+
const destFile = join140(destProjectPath, fileName);
|
|
493176
493207
|
try {
|
|
493177
493208
|
await copyFile10(srcFile, destFile, fsConstants6.COPYFILE_EXCL);
|
|
493178
493209
|
result.copied++;
|
|
@@ -493792,6 +493823,7 @@ var init_commands2 = __esm(() => {
|
|
|
493792
493823
|
init_chrome2();
|
|
493793
493824
|
init_stickers2();
|
|
493794
493825
|
init_advisor2();
|
|
493826
|
+
init_artifact();
|
|
493795
493827
|
init_git_flow();
|
|
493796
493828
|
init_frontend_tdd();
|
|
493797
493829
|
init_remember();
|
|
@@ -493869,6 +493901,7 @@ var init_commands2 = __esm(() => {
|
|
|
493869
493901
|
COMMANDS = memoize_default(() => [
|
|
493870
493902
|
add_dir_default,
|
|
493871
493903
|
advisor_default,
|
|
493904
|
+
artifact_default,
|
|
493872
493905
|
achievements_default,
|
|
493873
493906
|
agents_default,
|
|
493874
493907
|
branch_default,
|
|
@@ -494134,7 +494167,7 @@ import {
|
|
|
494134
494167
|
unlink as unlink19,
|
|
494135
494168
|
writeFile as writeFile41
|
|
494136
494169
|
} from "fs/promises";
|
|
494137
|
-
import { basename as basename45, dirname as dirname61, join as
|
|
494170
|
+
import { basename as basename45, dirname as dirname61, join as join141 } from "path";
|
|
494138
494171
|
function isTranscriptMessage(entry) {
|
|
494139
494172
|
return entry.type === "user" || entry.type === "assistant" || entry.type === "attachment" || entry.type === "system";
|
|
494140
494173
|
}
|
|
@@ -494148,18 +494181,18 @@ function isEphemeralToolProgress(dataType) {
|
|
|
494148
494181
|
return typeof dataType === "string" && EPHEMERAL_PROGRESS_TYPES.has(dataType);
|
|
494149
494182
|
}
|
|
494150
494183
|
function getProjectsDir2() {
|
|
494151
|
-
return
|
|
494184
|
+
return join141(getClaudeConfigHomeDir(), "projects");
|
|
494152
494185
|
}
|
|
494153
494186
|
function getTranscriptPath() {
|
|
494154
494187
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
494155
|
-
return
|
|
494188
|
+
return join141(projectDir, `${getSessionId()}.jsonl`);
|
|
494156
494189
|
}
|
|
494157
494190
|
function getTranscriptPathForSession(sessionId) {
|
|
494158
494191
|
if (sessionId === getSessionId()) {
|
|
494159
494192
|
return getTranscriptPath();
|
|
494160
494193
|
}
|
|
494161
494194
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
494162
|
-
return
|
|
494195
|
+
return join141(projectDir, `${sessionId}.jsonl`);
|
|
494163
494196
|
}
|
|
494164
494197
|
function setAgentTranscriptSubdir(agentId, subdir) {
|
|
494165
494198
|
agentTranscriptSubdirs.set(agentId, subdir);
|
|
@@ -494171,8 +494204,8 @@ function getAgentTranscriptPath(agentId) {
|
|
|
494171
494204
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
494172
494205
|
const sessionId = getSessionId();
|
|
494173
494206
|
const subdir = agentTranscriptSubdirs.get(agentId);
|
|
494174
|
-
const base2 = subdir ?
|
|
494175
|
-
return
|
|
494207
|
+
const base2 = subdir ? join141(projectDir, sessionId, "subagents", subdir) : join141(projectDir, sessionId, "subagents");
|
|
494208
|
+
return join141(base2, `agent-${agentId}.jsonl`);
|
|
494176
494209
|
}
|
|
494177
494210
|
function getAgentMetadataPath(agentId) {
|
|
494178
494211
|
return getAgentTranscriptPath(agentId).replace(/\.jsonl$/, ".meta.json");
|
|
@@ -494195,10 +494228,10 @@ async function readAgentMetadata(agentId) {
|
|
|
494195
494228
|
}
|
|
494196
494229
|
function getRemoteAgentsDir() {
|
|
494197
494230
|
const projectDir = getSessionProjectDir() ?? getProjectDir2(getOriginalCwd());
|
|
494198
|
-
return
|
|
494231
|
+
return join141(projectDir, getSessionId(), "remote-agents");
|
|
494199
494232
|
}
|
|
494200
494233
|
function getRemoteAgentMetadataPath(taskId) {
|
|
494201
|
-
return
|
|
494234
|
+
return join141(getRemoteAgentsDir(), `remote-agent-${taskId}.meta.json`);
|
|
494202
494235
|
}
|
|
494203
494236
|
async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
494204
494237
|
const path25 = getRemoteAgentMetadataPath(taskId);
|
|
@@ -494241,7 +494274,7 @@ async function listRemoteAgentMetadata() {
|
|
|
494241
494274
|
if (!entry.isFile() || !entry.name.endsWith(".meta.json"))
|
|
494242
494275
|
continue;
|
|
494243
494276
|
try {
|
|
494244
|
-
const raw = await readFile48(
|
|
494277
|
+
const raw = await readFile48(join141(dir, entry.name), "utf-8");
|
|
494245
494278
|
results.push(JSON.parse(raw));
|
|
494246
494279
|
} catch (e) {
|
|
494247
494280
|
logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e)}`);
|
|
@@ -494251,7 +494284,7 @@ async function listRemoteAgentMetadata() {
|
|
|
494251
494284
|
}
|
|
494252
494285
|
function sessionIdExists(sessionId) {
|
|
494253
494286
|
const projectDir = getProjectDir2(getOriginalCwd());
|
|
494254
|
-
const sessionFile =
|
|
494287
|
+
const sessionFile = join141(projectDir, `${sessionId}.jsonl`);
|
|
494255
494288
|
const fs14 = getFsImplementation();
|
|
494256
494289
|
try {
|
|
494257
494290
|
fs14.statSync(sessionFile);
|
|
@@ -496220,7 +496253,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
496220
496253
|
};
|
|
496221
496254
|
}
|
|
496222
496255
|
async function loadSessionFile(sessionId) {
|
|
496223
|
-
const sessionFile =
|
|
496256
|
+
const sessionFile = join141(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), `${sessionId}.jsonl`);
|
|
496224
496257
|
return loadTranscriptFile(sessionFile);
|
|
496225
496258
|
}
|
|
496226
496259
|
function clearSessionMessagesCache() {
|
|
@@ -496288,7 +496321,7 @@ async function loadAllProjectsMessageLogsFull(limit2) {
|
|
|
496288
496321
|
} catch {
|
|
496289
496322
|
return [];
|
|
496290
496323
|
}
|
|
496291
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
496324
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join141(projectsDir, dirent.name));
|
|
496292
496325
|
const logsPerProject = await Promise.all(projectDirs.map((projectDir) => getLogsWithoutIndex(projectDir, limit2)));
|
|
496293
496326
|
const allLogs = logsPerProject.flat();
|
|
496294
496327
|
const deduped = new Map;
|
|
@@ -496313,7 +496346,7 @@ async function loadAllProjectsMessageLogsProgressive(limit2, initialEnrichCount
|
|
|
496313
496346
|
} catch {
|
|
496314
496347
|
return { logs: [], allStatLogs: [], nextIndex: 0 };
|
|
496315
496348
|
}
|
|
496316
|
-
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
496349
|
+
const projectDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join141(projectsDir, dirent.name));
|
|
496317
496350
|
const rawLogs = [];
|
|
496318
496351
|
for (const projectDir of projectDirs) {
|
|
496319
496352
|
rawLogs.push(...await getSessionFilesLite(projectDir, limit2));
|
|
@@ -496374,7 +496407,7 @@ async function getStatOnlyLogsForWorktrees(worktreePaths, limit2) {
|
|
|
496374
496407
|
for (const { path: wtPath, prefix } of indexed) {
|
|
496375
496408
|
if (dirName === prefix || dirName.startsWith(prefix + "-")) {
|
|
496376
496409
|
seenDirs.add(dirName);
|
|
496377
|
-
allLogs.push(...await getSessionFilesLite(
|
|
496410
|
+
allLogs.push(...await getSessionFilesLite(join141(projectsDir, dirent.name), undefined, wtPath));
|
|
496378
496411
|
break;
|
|
496379
496412
|
}
|
|
496380
496413
|
}
|
|
@@ -496443,7 +496476,7 @@ async function loadSubagentTranscripts(agentIds) {
|
|
|
496443
496476
|
return transcripts;
|
|
496444
496477
|
}
|
|
496445
496478
|
async function loadAllSubagentTranscriptsFromDisk() {
|
|
496446
|
-
const subagentsDir =
|
|
496479
|
+
const subagentsDir = join141(getSessionProjectDir() ?? getProjectDir2(getOriginalCwd()), getSessionId(), "subagents");
|
|
496447
496480
|
let entries;
|
|
496448
496481
|
try {
|
|
496449
496482
|
entries = await readdir29(subagentsDir, { withFileTypes: true });
|
|
@@ -496571,7 +496604,7 @@ async function getSessionFilesWithMtime(projectDir) {
|
|
|
496571
496604
|
const sessionId = validateUuid2(basename45(dirent.name, ".jsonl"));
|
|
496572
496605
|
if (!sessionId)
|
|
496573
496606
|
continue;
|
|
496574
|
-
candidates.push({ sessionId, filePath:
|
|
496607
|
+
candidates.push({ sessionId, filePath: join141(projectDir, dirent.name) });
|
|
496575
496608
|
}
|
|
496576
496609
|
await Promise.all(candidates.map(async ({ sessionId, filePath }) => {
|
|
496577
496610
|
try {
|
|
@@ -496969,7 +497002,7 @@ var init_sessionStorage = __esm(() => {
|
|
|
496969
497002
|
MAX_TRANSCRIPT_READ_BYTES = 50 * 1024 * 1024;
|
|
496970
497003
|
agentTranscriptSubdirs = new Map;
|
|
496971
497004
|
getProjectDir2 = memoize_default((projectDir) => {
|
|
496972
|
-
return
|
|
497005
|
+
return join141(getProjectsDir2(), sanitizePath2(projectDir));
|
|
496973
497006
|
});
|
|
496974
497007
|
METADATA_TYPE_MARKERS = [
|
|
496975
497008
|
'"type":"summary"',
|
|
@@ -497207,41 +497240,41 @@ var init_memdir = __esm(() => {
|
|
|
497207
497240
|
});
|
|
497208
497241
|
|
|
497209
497242
|
// src/tools/AgentTool/agentMemory.ts
|
|
497210
|
-
import { join as
|
|
497243
|
+
import { join as join142, normalize as normalize14, sep as sep37 } from "path";
|
|
497211
497244
|
function sanitizeAgentTypeForPath(agentType) {
|
|
497212
497245
|
return agentType.replace(/:/g, "-");
|
|
497213
497246
|
}
|
|
497214
497247
|
function getLocalAgentMemoryDir(dirName) {
|
|
497215
497248
|
if (process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR) {
|
|
497216
|
-
return
|
|
497249
|
+
return join142(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR, "projects", sanitizePath2(findCanonicalGitRoot(getProjectRoot()) ?? getProjectRoot()), "agent-memory-local", dirName) + sep37;
|
|
497217
497250
|
}
|
|
497218
|
-
return
|
|
497251
|
+
return join142(getCwd(), ".claude", "agent-memory-local", dirName) + sep37;
|
|
497219
497252
|
}
|
|
497220
497253
|
function getAgentMemoryDir(agentType, scope) {
|
|
497221
497254
|
const dirName = sanitizeAgentTypeForPath(agentType);
|
|
497222
497255
|
switch (scope) {
|
|
497223
497256
|
case "project":
|
|
497224
|
-
return
|
|
497257
|
+
return join142(getCwd(), ".claude", "agent-memory", dirName) + sep37;
|
|
497225
497258
|
case "local":
|
|
497226
497259
|
return getLocalAgentMemoryDir(dirName);
|
|
497227
497260
|
case "user":
|
|
497228
|
-
return
|
|
497261
|
+
return join142(getMemoryBaseDir(), "agent-memory", dirName) + sep37;
|
|
497229
497262
|
}
|
|
497230
497263
|
}
|
|
497231
497264
|
function isAgentMemoryPath(absolutePath) {
|
|
497232
497265
|
const normalizedPath = normalize14(absolutePath);
|
|
497233
497266
|
const memoryBase = getMemoryBaseDir();
|
|
497234
|
-
if (normalizedPath.startsWith(
|
|
497267
|
+
if (normalizedPath.startsWith(join142(memoryBase, "agent-memory") + sep37)) {
|
|
497235
497268
|
return true;
|
|
497236
497269
|
}
|
|
497237
|
-
if (normalizedPath.startsWith(
|
|
497270
|
+
if (normalizedPath.startsWith(join142(getCwd(), ".claude", "agent-memory") + sep37)) {
|
|
497238
497271
|
return true;
|
|
497239
497272
|
}
|
|
497240
497273
|
if (process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR) {
|
|
497241
|
-
if (normalizedPath.includes(sep37 + "agent-memory-local" + sep37) && normalizedPath.startsWith(
|
|
497274
|
+
if (normalizedPath.includes(sep37 + "agent-memory-local" + sep37) && normalizedPath.startsWith(join142(process.env.CLAUDE_CODE_REMOTE_MEMORY_DIR, "projects") + sep37)) {
|
|
497242
497275
|
return true;
|
|
497243
497276
|
}
|
|
497244
|
-
} else if (normalizedPath.startsWith(
|
|
497277
|
+
} else if (normalizedPath.startsWith(join142(getCwd(), ".claude", "agent-memory-local") + sep37)) {
|
|
497245
497278
|
return true;
|
|
497246
497279
|
}
|
|
497247
497280
|
return false;
|
|
@@ -497249,7 +497282,7 @@ function isAgentMemoryPath(absolutePath) {
|
|
|
497249
497282
|
function getMemoryScopeDisplay(memory2) {
|
|
497250
497283
|
switch (memory2) {
|
|
497251
497284
|
case "user":
|
|
497252
|
-
return `User (${
|
|
497285
|
+
return `User (${join142(getMemoryBaseDir(), "agent-memory")}/)`;
|
|
497253
497286
|
case "project":
|
|
497254
497287
|
return "Project (.claude/agent-memory/)";
|
|
497255
497288
|
case "local":
|
|
@@ -497291,8 +497324,8 @@ var init_agentMemory = __esm(() => {
|
|
|
497291
497324
|
|
|
497292
497325
|
// src/utils/permissions/filesystem.ts
|
|
497293
497326
|
import { randomBytes as randomBytes19 } from "crypto";
|
|
497294
|
-
import { homedir as homedir33, tmpdir as
|
|
497295
|
-
import { join as
|
|
497327
|
+
import { homedir as homedir33, tmpdir as tmpdir14 } from "os";
|
|
497328
|
+
import { join as join143, normalize as normalize15, posix as posix8, sep as sep38 } from "path";
|
|
497296
497329
|
function normalizeCaseForComparison2(path25) {
|
|
497297
497330
|
return path25.toLowerCase();
|
|
497298
497331
|
}
|
|
@@ -497301,11 +497334,11 @@ function getClaudeSkillScope(filePath) {
|
|
|
497301
497334
|
const absolutePathLower = normalizeCaseForComparison2(absolutePath);
|
|
497302
497335
|
const bases = [
|
|
497303
497336
|
{
|
|
497304
|
-
dir: expandPath(
|
|
497337
|
+
dir: expandPath(join143(getOriginalCwd(), ".claude", "skills")),
|
|
497305
497338
|
prefix: "/.claude/skills/"
|
|
497306
497339
|
},
|
|
497307
497340
|
{
|
|
497308
|
-
dir: expandPath(
|
|
497341
|
+
dir: expandPath(join143(homedir33(), ".claude", "skills")),
|
|
497309
497342
|
prefix: "~/.claude/skills/"
|
|
497310
497343
|
}
|
|
497311
497344
|
];
|
|
@@ -497360,21 +497393,21 @@ function isClaudeConfigFilePath(filePath) {
|
|
|
497360
497393
|
if (isClaudeSettingsPath(filePath)) {
|
|
497361
497394
|
return true;
|
|
497362
497395
|
}
|
|
497363
|
-
const commandsDir =
|
|
497364
|
-
const agentsDir =
|
|
497365
|
-
const skillsDir =
|
|
497396
|
+
const commandsDir = join143(getOriginalCwd(), ".claude", "commands");
|
|
497397
|
+
const agentsDir = join143(getOriginalCwd(), ".claude", "agents");
|
|
497398
|
+
const skillsDir = join143(getOriginalCwd(), ".claude", "skills");
|
|
497366
497399
|
return pathInWorkingPath(filePath, commandsDir) || pathInWorkingPath(filePath, agentsDir) || pathInWorkingPath(filePath, skillsDir);
|
|
497367
497400
|
}
|
|
497368
497401
|
function isSessionPlanFile(absolutePath) {
|
|
497369
|
-
const expectedPrefix =
|
|
497402
|
+
const expectedPrefix = join143(getPlansDirectory(), getPlanSlug());
|
|
497370
497403
|
const normalizedPath = normalize15(absolutePath);
|
|
497371
497404
|
return normalizedPath.startsWith(expectedPrefix) && normalizedPath.endsWith(".md");
|
|
497372
497405
|
}
|
|
497373
497406
|
function getSessionMemoryDir() {
|
|
497374
|
-
return
|
|
497407
|
+
return join143(getProjectDir2(getCwd()), getSessionId(), "session-memory") + sep38;
|
|
497375
497408
|
}
|
|
497376
497409
|
function getSessionMemoryPath() {
|
|
497377
|
-
return
|
|
497410
|
+
return join143(getSessionMemoryDir(), "summary.md");
|
|
497378
497411
|
}
|
|
497379
497412
|
function isSessionMemoryPath(absolutePath) {
|
|
497380
497413
|
const normalizedPath = normalize15(absolutePath);
|
|
@@ -497396,10 +497429,10 @@ function getClaudeTempDirName() {
|
|
|
497396
497429
|
return `claude-${uid}`;
|
|
497397
497430
|
}
|
|
497398
497431
|
function getProjectTempDir() {
|
|
497399
|
-
return
|
|
497432
|
+
return join143(getClaudeTempDir(), sanitizePath2(getOriginalCwd())) + sep38;
|
|
497400
497433
|
}
|
|
497401
497434
|
function getScratchpadDir() {
|
|
497402
|
-
return
|
|
497435
|
+
return join143(getProjectTempDir(), getSessionId(), "scratchpad");
|
|
497403
497436
|
}
|
|
497404
497437
|
async function ensureScratchpadDir() {
|
|
497405
497438
|
if (!isScratchpadEnabled()) {
|
|
@@ -497977,7 +498010,7 @@ function checkEditableInternalPath(absolutePath, input) {
|
|
|
497977
498010
|
}
|
|
497978
498011
|
};
|
|
497979
498012
|
}
|
|
497980
|
-
if (normalizeCaseForComparison2(normalizedPath) === normalizeCaseForComparison2(
|
|
498013
|
+
if (normalizeCaseForComparison2(normalizedPath) === normalizeCaseForComparison2(join143(getOriginalCwd(), ".claude", "launch.json"))) {
|
|
497981
498014
|
return {
|
|
497982
498015
|
behavior: "allow",
|
|
497983
498016
|
updatedInput: input,
|
|
@@ -498074,7 +498107,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
498074
498107
|
}
|
|
498075
498108
|
};
|
|
498076
498109
|
}
|
|
498077
|
-
const tasksDir =
|
|
498110
|
+
const tasksDir = join143(getClaudeConfigHomeDir(), "tasks") + sep38;
|
|
498078
498111
|
if (normalizedPath === tasksDir.slice(0, -1) || normalizedPath.startsWith(tasksDir)) {
|
|
498079
498112
|
return {
|
|
498080
498113
|
behavior: "allow",
|
|
@@ -498085,7 +498118,7 @@ function checkReadableInternalPath(absolutePath, input) {
|
|
|
498085
498118
|
}
|
|
498086
498119
|
};
|
|
498087
498120
|
}
|
|
498088
|
-
const teamsReadDir =
|
|
498121
|
+
const teamsReadDir = join143(getClaudeConfigHomeDir(), "teams") + sep38;
|
|
498089
498122
|
if (normalizedPath === teamsReadDir.slice(0, -1) || normalizedPath.startsWith(teamsReadDir)) {
|
|
498090
498123
|
return {
|
|
498091
498124
|
behavior: "allow",
|
|
@@ -498152,17 +498185,17 @@ var init_filesystem = __esm(() => {
|
|
|
498152
498185
|
];
|
|
498153
498186
|
DIR_SEP = posix8.sep;
|
|
498154
498187
|
getClaudeTempDir = memoize_default(function getClaudeTempDir2() {
|
|
498155
|
-
const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (getPlatform() === "windows" ?
|
|
498188
|
+
const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (getPlatform() === "windows" ? tmpdir14() : "/tmp");
|
|
498156
498189
|
const fs14 = getFsImplementation();
|
|
498157
498190
|
let resolvedBaseTmpDir = baseTmpDir;
|
|
498158
498191
|
try {
|
|
498159
498192
|
resolvedBaseTmpDir = fs14.realpathSync(baseTmpDir);
|
|
498160
498193
|
} catch {}
|
|
498161
|
-
return
|
|
498194
|
+
return join143(resolvedBaseTmpDir, getClaudeTempDirName()) + sep38;
|
|
498162
498195
|
});
|
|
498163
498196
|
getBundledSkillsRoot = memoize_default(function getBundledSkillsRoot2() {
|
|
498164
498197
|
const nonce = randomBytes19(16).toString("hex");
|
|
498165
|
-
return
|
|
498198
|
+
return join143(getClaudeTempDir(), "bundled-skills", MACRO.VERSION, nonce);
|
|
498166
498199
|
});
|
|
498167
498200
|
getResolvedWorkingDirPaths = memoize_default(getPathsForPermissionCheck);
|
|
498168
498201
|
});
|
|
@@ -498176,10 +498209,10 @@ import {
|
|
|
498176
498209
|
symlink as symlink4,
|
|
498177
498210
|
unlink as unlink20
|
|
498178
498211
|
} from "fs/promises";
|
|
498179
|
-
import { join as
|
|
498212
|
+
import { join as join144 } from "path";
|
|
498180
498213
|
function getTaskOutputDir() {
|
|
498181
498214
|
if (_taskOutputDir === undefined) {
|
|
498182
|
-
_taskOutputDir =
|
|
498215
|
+
_taskOutputDir = join144(getProjectTempDir(), getSessionId(), "tasks");
|
|
498183
498216
|
}
|
|
498184
498217
|
return _taskOutputDir;
|
|
498185
498218
|
}
|
|
@@ -498187,7 +498220,7 @@ async function ensureOutputDir() {
|
|
|
498187
498220
|
await mkdir41(getTaskOutputDir(), { recursive: true });
|
|
498188
498221
|
}
|
|
498189
498222
|
function getTaskOutputPath(taskId) {
|
|
498190
|
-
return
|
|
498223
|
+
return join144(getTaskOutputDir(), `${taskId}.output`);
|
|
498191
498224
|
}
|
|
498192
498225
|
function track(p) {
|
|
498193
498226
|
_pendingOps.add(p);
|
|
@@ -502469,7 +502502,7 @@ import {
|
|
|
502469
502502
|
symlink as symlink5,
|
|
502470
502503
|
utimes as utimes2
|
|
502471
502504
|
} from "fs/promises";
|
|
502472
|
-
import { basename as basename47, dirname as dirname62, join as
|
|
502505
|
+
import { basename as basename47, dirname as dirname62, join as join145 } from "path";
|
|
502473
502506
|
function validateWorktreeSlug(slug) {
|
|
502474
502507
|
if (slug.length > MAX_WORKTREE_SLUG_LENGTH) {
|
|
502475
502508
|
throw new Error(`Invalid worktree name: must be ${MAX_WORKTREE_SLUG_LENGTH} characters or fewer (got ${slug.length})`);
|
|
@@ -502492,8 +502525,8 @@ async function symlinkDirectories(repoRootPath, worktreePath, dirsToSymlink) {
|
|
|
502492
502525
|
logForDebugging(`Skipping symlink for "${dir}": path traversal detected`, { level: "warn" });
|
|
502493
502526
|
continue;
|
|
502494
502527
|
}
|
|
502495
|
-
const sourcePath =
|
|
502496
|
-
const destPath =
|
|
502528
|
+
const sourcePath = join145(repoRootPath, dir);
|
|
502529
|
+
const destPath = join145(worktreePath, dir);
|
|
502497
502530
|
try {
|
|
502498
502531
|
await symlink5(sourcePath, destPath, "dir");
|
|
502499
502532
|
logForDebugging(`Symlinked ${dir} from main repository to worktree to avoid disk bloat`);
|
|
@@ -502517,7 +502550,7 @@ function generateTmuxSessionName(repoPath, branch2) {
|
|
|
502517
502550
|
return combined.replace(/[/.]/g, "_");
|
|
502518
502551
|
}
|
|
502519
502552
|
function worktreesDir(repoRoot) {
|
|
502520
|
-
return
|
|
502553
|
+
return join145(repoRoot, ".claude", "worktrees");
|
|
502521
502554
|
}
|
|
502522
502555
|
function flattenSlug(slug) {
|
|
502523
502556
|
return slug.replaceAll("/", "+");
|
|
@@ -502526,7 +502559,7 @@ function worktreeBranchName(slug) {
|
|
|
502526
502559
|
return `worktree-${flattenSlug(slug)}`;
|
|
502527
502560
|
}
|
|
502528
502561
|
function worktreePathFor(repoRoot, slug) {
|
|
502529
|
-
return
|
|
502562
|
+
return join145(worktreesDir(repoRoot), flattenSlug(slug));
|
|
502530
502563
|
}
|
|
502531
502564
|
async function getOrCreateWorktree(repoRoot, slug, options) {
|
|
502532
502565
|
const worktreePath = worktreePathFor(repoRoot, slug);
|
|
@@ -502607,7 +502640,7 @@ async function getOrCreateWorktree(repoRoot, slug, options) {
|
|
|
502607
502640
|
async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
502608
502641
|
let includeContent;
|
|
502609
502642
|
try {
|
|
502610
|
-
includeContent = await readFile49(
|
|
502643
|
+
includeContent = await readFile49(join145(repoRoot, ".worktreeinclude"), "utf-8");
|
|
502611
502644
|
} catch {
|
|
502612
502645
|
return [];
|
|
502613
502646
|
}
|
|
@@ -502662,8 +502695,8 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
502662
502695
|
}
|
|
502663
502696
|
const copied = [];
|
|
502664
502697
|
for (const relativePath2 of files3) {
|
|
502665
|
-
const srcPath =
|
|
502666
|
-
const destPath =
|
|
502698
|
+
const srcPath = join145(repoRoot, relativePath2);
|
|
502699
|
+
const destPath = join145(worktreePath, relativePath2);
|
|
502667
502700
|
try {
|
|
502668
502701
|
await mkdir42(dirname62(destPath), { recursive: true });
|
|
502669
502702
|
await copyFile11(srcPath, destPath);
|
|
@@ -502679,9 +502712,9 @@ async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
|
502679
502712
|
}
|
|
502680
502713
|
async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
502681
502714
|
const localSettingsRelativePath = getRelativeSettingsFilePathForSource("localSettings");
|
|
502682
|
-
const sourceSettingsLocal =
|
|
502715
|
+
const sourceSettingsLocal = join145(repoRoot, localSettingsRelativePath);
|
|
502683
502716
|
try {
|
|
502684
|
-
const destSettingsLocal =
|
|
502717
|
+
const destSettingsLocal = join145(worktreePath, localSettingsRelativePath);
|
|
502685
502718
|
await mkdirRecursive(dirname62(destSettingsLocal));
|
|
502686
502719
|
await copyFile11(sourceSettingsLocal, destSettingsLocal);
|
|
502687
502720
|
logForDebugging(`Copied settings.local.json to worktree: ${destSettingsLocal}`);
|
|
@@ -502691,8 +502724,8 @@ async function performPostCreationSetup(repoRoot, worktreePath) {
|
|
|
502691
502724
|
logForDebugging(`Failed to copy settings.local.json: ${e.message}`, { level: "warn" });
|
|
502692
502725
|
}
|
|
502693
502726
|
}
|
|
502694
|
-
const huskyPath =
|
|
502695
|
-
const gitHooksPath =
|
|
502727
|
+
const huskyPath = join145(repoRoot, ".husky");
|
|
502728
|
+
const gitHooksPath = join145(repoRoot, ".git", "hooks");
|
|
502696
502729
|
let hooksPath = null;
|
|
502697
502730
|
for (const candidatePath of [huskyPath, gitHooksPath]) {
|
|
502698
502731
|
try {
|
|
@@ -502967,7 +503000,7 @@ async function cleanupStaleAgentWorktrees(cutoffDate) {
|
|
|
502967
503000
|
if (!EPHEMERAL_WORKTREE_PATTERNS.some((p) => p.test(slug))) {
|
|
502968
503001
|
continue;
|
|
502969
503002
|
}
|
|
502970
|
-
const worktreePath =
|
|
503003
|
+
const worktreePath = join145(dir, slug);
|
|
502971
503004
|
if (currentPath === worktreePath) {
|
|
502972
503005
|
continue;
|
|
502973
503006
|
}
|
|
@@ -506327,7 +506360,7 @@ import {
|
|
|
506327
506360
|
} from "fs/promises";
|
|
506328
506361
|
import { createServer as createServer7 } from "net";
|
|
506329
506362
|
import { homedir as homedir34, platform as platform5 } from "os";
|
|
506330
|
-
import { join as
|
|
506363
|
+
import { join as join146 } from "path";
|
|
506331
506364
|
function log2(message, ...args) {
|
|
506332
506365
|
if (LOG_FILE) {
|
|
506333
506366
|
const timestamp = new Date().toISOString();
|
|
@@ -506394,7 +506427,7 @@ class ChromeNativeHost {
|
|
|
506394
506427
|
try {
|
|
506395
506428
|
process.kill(pid, 0);
|
|
506396
506429
|
} catch {
|
|
506397
|
-
await unlink21(
|
|
506430
|
+
await unlink21(join146(socketDir, file2)).catch(() => {});
|
|
506398
506431
|
log2(`Removed stale socket for PID ${pid}`);
|
|
506399
506432
|
}
|
|
506400
506433
|
}
|
|
@@ -506665,7 +506698,7 @@ var init_chromeNativeHost = __esm(() => {
|
|
|
506665
506698
|
init_slowOperations();
|
|
506666
506699
|
init_common3();
|
|
506667
506700
|
MAX_MESSAGE_SIZE = 1024 * 1024;
|
|
506668
|
-
LOG_FILE = process.env.USER_TYPE === "ant" ?
|
|
506701
|
+
LOG_FILE = process.env.USER_TYPE === "ant" ? join146(homedir34(), ".claude", "debug", "chrome-native-host.txt") : undefined;
|
|
506669
506702
|
messageSchema = lazySchema(() => exports_external.object({
|
|
506670
506703
|
type: exports_external.string()
|
|
506671
506704
|
}).passthrough());
|
|
@@ -509346,7 +509379,7 @@ __export(exports_upstreamproxy, {
|
|
|
509346
509379
|
});
|
|
509347
509380
|
import { mkdir as mkdir44, readFile as readFile50, unlink as unlink22, writeFile as writeFile42 } from "fs/promises";
|
|
509348
509381
|
import { homedir as homedir35 } from "os";
|
|
509349
|
-
import { join as
|
|
509382
|
+
import { join as join147 } from "path";
|
|
509350
509383
|
async function initUpstreamProxy(opts) {
|
|
509351
509384
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_REMOTE)) {
|
|
509352
509385
|
return state;
|
|
@@ -509367,7 +509400,7 @@ async function initUpstreamProxy(opts) {
|
|
|
509367
509400
|
}
|
|
509368
509401
|
setNonDumpable();
|
|
509369
509402
|
const baseUrl = opts?.ccrBaseUrl ?? process.env.ANTHROPIC_BASE_URL ?? "https://api.anthropic.com";
|
|
509370
|
-
const caBundlePath = opts?.caBundlePath ??
|
|
509403
|
+
const caBundlePath = opts?.caBundlePath ?? join147(homedir35(), ".ccr", "ca-bundle.crt");
|
|
509371
509404
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
509372
509405
|
if (!caOk)
|
|
509373
509406
|
return state;
|
|
@@ -509467,7 +509500,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
|
|
|
509467
509500
|
}
|
|
509468
509501
|
const ccrCa = await resp.text();
|
|
509469
509502
|
const systemCa = await readFile50(systemCaPath, "utf8").catch(() => "");
|
|
509470
|
-
await mkdir44(
|
|
509503
|
+
await mkdir44(join147(outPath, ".."), { recursive: true });
|
|
509471
509504
|
await writeFile42(outPath, systemCa + `
|
|
509472
509505
|
` + ccrCa, "utf8");
|
|
509473
509506
|
return true;
|
|
@@ -517552,7 +517585,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
517552
517585
|
|
|
517553
517586
|
// src/components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
517554
517587
|
import { homedir as homedir36 } from "os";
|
|
517555
|
-
import { basename as basename51, join as
|
|
517588
|
+
import { basename as basename51, join as join148, sep as sep39 } from "path";
|
|
517556
517589
|
function isInClaudeFolder(filePath) {
|
|
517557
517590
|
const absolutePath = expandPath(filePath);
|
|
517558
517591
|
const claudeFolderPath = expandPath(`${getOriginalCwd()}/.claude`);
|
|
@@ -517562,7 +517595,7 @@ function isInClaudeFolder(filePath) {
|
|
|
517562
517595
|
}
|
|
517563
517596
|
function isInGlobalClaudeFolder(filePath) {
|
|
517564
517597
|
const absolutePath = expandPath(filePath);
|
|
517565
|
-
const globalClaudeFolderPath =
|
|
517598
|
+
const globalClaudeFolderPath = join148(homedir36(), ".claude");
|
|
517566
517599
|
const normalizedAbsolutePath = normalizeCaseForComparison2(absolutePath);
|
|
517567
517600
|
const normalizedGlobalClaudeFolderPath = normalizeCaseForComparison2(globalClaudeFolderPath);
|
|
517568
517601
|
return normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + sep39.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + "/");
|
|
@@ -539785,9 +539818,9 @@ function initSkillImprovement() {
|
|
|
539785
539818
|
async function applySkillImprovement(skillName, updates) {
|
|
539786
539819
|
if (!skillName)
|
|
539787
539820
|
return;
|
|
539788
|
-
const { join:
|
|
539821
|
+
const { join: join149 } = await import("path");
|
|
539789
539822
|
const fs14 = await import("fs/promises");
|
|
539790
|
-
const filePath =
|
|
539823
|
+
const filePath = join149(getCwd(), ".claude", "skills", skillName, "SKILL.md");
|
|
539791
539824
|
let currentContent;
|
|
539792
539825
|
try {
|
|
539793
539826
|
currentContent = await fs14.readFile(filePath, "utf-8");
|
|
@@ -539941,7 +539974,7 @@ function useMoreRight(_args) {
|
|
|
539941
539974
|
// src/utils/cleanup.ts
|
|
539942
539975
|
import * as fs14 from "fs/promises";
|
|
539943
539976
|
import { homedir as homedir37 } from "os";
|
|
539944
|
-
import { join as
|
|
539977
|
+
import { join as join149 } from "path";
|
|
539945
539978
|
function getCutoffDate() {
|
|
539946
539979
|
const settings = getSettings_DEPRECATED() || {};
|
|
539947
539980
|
const cleanupPeriodDays = settings.cleanupPeriodDays ?? DEFAULT_CLEANUP_PERIOD_DAYS;
|
|
@@ -539966,7 +539999,7 @@ async function cleanupOldFilesInDirectory(dirPath, cutoffDate, isMessagePath) {
|
|
|
539966
539999
|
try {
|
|
539967
540000
|
const timestamp = convertFileNameToDate(file2.name);
|
|
539968
540001
|
if (timestamp < cutoffDate) {
|
|
539969
|
-
await getFsImplementation().unlink(
|
|
540002
|
+
await getFsImplementation().unlink(join149(dirPath, file2.name));
|
|
539970
540003
|
if (isMessagePath) {
|
|
539971
540004
|
result.messages++;
|
|
539972
540005
|
} else {
|
|
@@ -539997,7 +540030,7 @@ async function cleanupOldMessageFiles() {
|
|
|
539997
540030
|
} catch {
|
|
539998
540031
|
return result;
|
|
539999
540032
|
}
|
|
540000
|
-
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) =>
|
|
540033
|
+
const mcpLogDirs = dirents.filter((dirent) => dirent.isDirectory() && dirent.name.startsWith("mcp-logs-")).map((dirent) => join149(baseCachePath, dirent.name));
|
|
540001
540034
|
for (const mcpLogDir of mcpLogDirs) {
|
|
540002
540035
|
result = addCleanupResults(result, await cleanupOldFilesInDirectory(mcpLogDir, cutoffDate, true));
|
|
540003
540036
|
await tryRmdir(mcpLogDir, fsImpl);
|
|
@@ -540036,7 +540069,7 @@ async function cleanupOldSessionFiles() {
|
|
|
540036
540069
|
for (const projectDirent of projectDirents) {
|
|
540037
540070
|
if (!projectDirent.isDirectory())
|
|
540038
540071
|
continue;
|
|
540039
|
-
const projectDir =
|
|
540072
|
+
const projectDir = join149(projectsDir, projectDirent.name);
|
|
540040
540073
|
let entries;
|
|
540041
540074
|
try {
|
|
540042
540075
|
entries = await fsImpl.readdir(projectDir);
|
|
@@ -540050,15 +540083,15 @@ async function cleanupOldSessionFiles() {
|
|
|
540050
540083
|
continue;
|
|
540051
540084
|
}
|
|
540052
540085
|
try {
|
|
540053
|
-
if (await unlinkIfOld(
|
|
540086
|
+
if (await unlinkIfOld(join149(projectDir, entry.name), cutoffDate, fsImpl)) {
|
|
540054
540087
|
result.messages++;
|
|
540055
540088
|
}
|
|
540056
540089
|
} catch {
|
|
540057
540090
|
result.errors++;
|
|
540058
540091
|
}
|
|
540059
540092
|
} else if (entry.isDirectory()) {
|
|
540060
|
-
const sessionDir =
|
|
540061
|
-
const toolResultsDir =
|
|
540093
|
+
const sessionDir = join149(projectDir, entry.name);
|
|
540094
|
+
const toolResultsDir = join149(sessionDir, TOOL_RESULTS_SUBDIR);
|
|
540062
540095
|
let toolDirs;
|
|
540063
540096
|
try {
|
|
540064
540097
|
toolDirs = await fsImpl.readdir(toolResultsDir);
|
|
@@ -540069,14 +540102,14 @@ async function cleanupOldSessionFiles() {
|
|
|
540069
540102
|
for (const toolEntry of toolDirs) {
|
|
540070
540103
|
if (toolEntry.isFile()) {
|
|
540071
540104
|
try {
|
|
540072
|
-
if (await unlinkIfOld(
|
|
540105
|
+
if (await unlinkIfOld(join149(toolResultsDir, toolEntry.name), cutoffDate, fsImpl)) {
|
|
540073
540106
|
result.messages++;
|
|
540074
540107
|
}
|
|
540075
540108
|
} catch {
|
|
540076
540109
|
result.errors++;
|
|
540077
540110
|
}
|
|
540078
540111
|
} else if (toolEntry.isDirectory()) {
|
|
540079
|
-
const toolDirPath =
|
|
540112
|
+
const toolDirPath = join149(toolResultsDir, toolEntry.name);
|
|
540080
540113
|
let toolFiles;
|
|
540081
540114
|
try {
|
|
540082
540115
|
toolFiles = await fsImpl.readdir(toolDirPath);
|
|
@@ -540087,7 +540120,7 @@ async function cleanupOldSessionFiles() {
|
|
|
540087
540120
|
if (!tf.isFile())
|
|
540088
540121
|
continue;
|
|
540089
540122
|
try {
|
|
540090
|
-
if (await unlinkIfOld(
|
|
540123
|
+
if (await unlinkIfOld(join149(toolDirPath, tf.name), cutoffDate, fsImpl)) {
|
|
540091
540124
|
result.messages++;
|
|
540092
540125
|
}
|
|
540093
540126
|
} catch {
|
|
@@ -540119,7 +540152,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
|
|
|
540119
540152
|
if (!dirent.isFile() || !dirent.name.endsWith(extension2))
|
|
540120
540153
|
continue;
|
|
540121
540154
|
try {
|
|
540122
|
-
if (await unlinkIfOld(
|
|
540155
|
+
if (await unlinkIfOld(join149(dirPath, dirent.name), cutoffDate, fsImpl)) {
|
|
540123
540156
|
result.messages++;
|
|
540124
540157
|
}
|
|
540125
540158
|
} catch {
|
|
@@ -540132,7 +540165,7 @@ async function cleanupSingleDirectory(dirPath, extension2, removeEmptyDir = true
|
|
|
540132
540165
|
return result;
|
|
540133
540166
|
}
|
|
540134
540167
|
function cleanupOldPlanFiles() {
|
|
540135
|
-
const plansDir =
|
|
540168
|
+
const plansDir = join149(getClaudeConfigHomeDir(), "plans");
|
|
540136
540169
|
return cleanupSingleDirectory(plansDir, ".md");
|
|
540137
540170
|
}
|
|
540138
540171
|
async function cleanupOldFileHistoryBackups() {
|
|
@@ -540141,14 +540174,14 @@ async function cleanupOldFileHistoryBackups() {
|
|
|
540141
540174
|
const fsImpl = getFsImplementation();
|
|
540142
540175
|
try {
|
|
540143
540176
|
const configDir = getClaudeConfigHomeDir();
|
|
540144
|
-
const fileHistoryStorageDir =
|
|
540177
|
+
const fileHistoryStorageDir = join149(configDir, "file-history");
|
|
540145
540178
|
let dirents;
|
|
540146
540179
|
try {
|
|
540147
540180
|
dirents = await fsImpl.readdir(fileHistoryStorageDir);
|
|
540148
540181
|
} catch {
|
|
540149
540182
|
return result;
|
|
540150
540183
|
}
|
|
540151
|
-
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
540184
|
+
const fileHistorySessionsDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join149(fileHistoryStorageDir, dirent.name));
|
|
540152
540185
|
await Promise.all(fileHistorySessionsDirs.map(async (fileHistorySessionDir) => {
|
|
540153
540186
|
try {
|
|
540154
540187
|
const stats2 = await fsImpl.stat(fileHistorySessionDir);
|
|
@@ -540175,14 +540208,14 @@ async function cleanupOldSessionEnvDirs() {
|
|
|
540175
540208
|
const fsImpl = getFsImplementation();
|
|
540176
540209
|
try {
|
|
540177
540210
|
const configDir = getClaudeConfigHomeDir();
|
|
540178
|
-
const sessionEnvBaseDir =
|
|
540211
|
+
const sessionEnvBaseDir = join149(configDir, "session-env");
|
|
540179
540212
|
let dirents;
|
|
540180
540213
|
try {
|
|
540181
540214
|
dirents = await fsImpl.readdir(sessionEnvBaseDir);
|
|
540182
540215
|
} catch {
|
|
540183
540216
|
return result;
|
|
540184
540217
|
}
|
|
540185
|
-
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) =>
|
|
540218
|
+
const sessionEnvDirs = dirents.filter((dirent) => dirent.isDirectory()).map((dirent) => join149(sessionEnvBaseDir, dirent.name));
|
|
540186
540219
|
for (const sessionEnvDir of sessionEnvDirs) {
|
|
540187
540220
|
try {
|
|
540188
540221
|
const stats2 = await fsImpl.stat(sessionEnvDir);
|
|
@@ -540204,7 +540237,7 @@ async function cleanupOldDebugLogs() {
|
|
|
540204
540237
|
const cutoffDate = getCutoffDate();
|
|
540205
540238
|
const result = { messages: 0, errors: 0 };
|
|
540206
540239
|
const fsImpl = getFsImplementation();
|
|
540207
|
-
const debugDir =
|
|
540240
|
+
const debugDir = join149(getClaudeConfigHomeDir(), "debug");
|
|
540208
540241
|
let dirents;
|
|
540209
540242
|
try {
|
|
540210
540243
|
dirents = await fsImpl.readdir(debugDir);
|
|
@@ -540216,7 +540249,7 @@ async function cleanupOldDebugLogs() {
|
|
|
540216
540249
|
continue;
|
|
540217
540250
|
}
|
|
540218
540251
|
try {
|
|
540219
|
-
if (await unlinkIfOld(
|
|
540252
|
+
if (await unlinkIfOld(join149(debugDir, dirent.name), cutoffDate, fsImpl)) {
|
|
540220
540253
|
result.messages++;
|
|
540221
540254
|
}
|
|
540222
540255
|
} catch {
|
|
@@ -540226,7 +540259,7 @@ async function cleanupOldDebugLogs() {
|
|
|
540226
540259
|
return result;
|
|
540227
540260
|
}
|
|
540228
540261
|
async function cleanupNpmCacheForAnthropicPackages() {
|
|
540229
|
-
const markerPath =
|
|
540262
|
+
const markerPath = join149(getClaudeConfigHomeDir(), ".npm-cache-cleanup");
|
|
540230
540263
|
try {
|
|
540231
540264
|
const stat48 = await fs14.stat(markerPath);
|
|
540232
540265
|
if (Date.now() - stat48.mtimeMs < ONE_DAY_MS) {
|
|
@@ -540241,7 +540274,7 @@ async function cleanupNpmCacheForAnthropicPackages() {
|
|
|
540241
540274
|
return;
|
|
540242
540275
|
}
|
|
540243
540276
|
logForDebugging("npm cache cleanup: starting");
|
|
540244
|
-
const npmCachePath =
|
|
540277
|
+
const npmCachePath = join149(homedir37(), ".npm", "_cacache");
|
|
540245
540278
|
const NPM_CACHE_RETENTION_COUNT = 5;
|
|
540246
540279
|
const startTime = Date.now();
|
|
540247
540280
|
try {
|
|
@@ -540296,7 +540329,7 @@ async function cleanupNpmCacheForAnthropicPackages() {
|
|
|
540296
540329
|
}
|
|
540297
540330
|
}
|
|
540298
540331
|
async function cleanupOldVersionsThrottled() {
|
|
540299
|
-
const markerPath =
|
|
540332
|
+
const markerPath = join149(getClaudeConfigHomeDir(), ".version-cleanup");
|
|
540300
540333
|
try {
|
|
540301
540334
|
const stat48 = await fs14.stat(markerPath);
|
|
540302
540335
|
if (Date.now() - stat48.mtimeMs < ONE_DAY_MS) {
|
|
@@ -543522,7 +543555,7 @@ __export(exports_asciicast, {
|
|
|
543522
543555
|
_resetRecordingStateForTesting: () => _resetRecordingStateForTesting
|
|
543523
543556
|
});
|
|
543524
543557
|
import { appendFile as appendFile7, rename as rename12 } from "fs/promises";
|
|
543525
|
-
import { basename as basename60, dirname as dirname63, join as
|
|
543558
|
+
import { basename as basename60, dirname as dirname63, join as join151 } from "path";
|
|
543526
543559
|
function getRecordFilePath() {
|
|
543527
543560
|
if (recordingState.filePath !== null) {
|
|
543528
543561
|
return recordingState.filePath;
|
|
@@ -543533,10 +543566,10 @@ function getRecordFilePath() {
|
|
|
543533
543566
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_TERMINAL_RECORDING)) {
|
|
543534
543567
|
return null;
|
|
543535
543568
|
}
|
|
543536
|
-
const projectsDir =
|
|
543537
|
-
const projectDir =
|
|
543569
|
+
const projectsDir = join151(getClaudeConfigHomeDir(), "projects");
|
|
543570
|
+
const projectDir = join151(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
543538
543571
|
recordingState.timestamp = Date.now();
|
|
543539
|
-
recordingState.filePath =
|
|
543572
|
+
recordingState.filePath = join151(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
543540
543573
|
return recordingState.filePath;
|
|
543541
543574
|
}
|
|
543542
543575
|
function _resetRecordingStateForTesting() {
|
|
@@ -543545,13 +543578,13 @@ function _resetRecordingStateForTesting() {
|
|
|
543545
543578
|
}
|
|
543546
543579
|
function getSessionRecordingPaths() {
|
|
543547
543580
|
const sessionId = getSessionId();
|
|
543548
|
-
const projectsDir =
|
|
543549
|
-
const projectDir =
|
|
543581
|
+
const projectsDir = join151(getClaudeConfigHomeDir(), "projects");
|
|
543582
|
+
const projectDir = join151(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
543550
543583
|
try {
|
|
543551
543584
|
const entries = getFsImplementation().readdirSync(projectDir);
|
|
543552
543585
|
const names = typeof entries[0] === "string" ? entries : entries.map((e) => e.name);
|
|
543553
543586
|
const files3 = names.filter((f) => f.startsWith(sessionId) && f.endsWith(".cast")).sort();
|
|
543554
|
-
return files3.map((f) =>
|
|
543587
|
+
return files3.map((f) => join151(projectDir, f));
|
|
543555
543588
|
} catch {
|
|
543556
543589
|
return [];
|
|
543557
543590
|
}
|
|
@@ -543561,9 +543594,9 @@ async function renameRecordingForSession() {
|
|
|
543561
543594
|
if (!oldPath || recordingState.timestamp === 0) {
|
|
543562
543595
|
return;
|
|
543563
543596
|
}
|
|
543564
|
-
const projectsDir =
|
|
543565
|
-
const projectDir =
|
|
543566
|
-
const newPath =
|
|
543597
|
+
const projectsDir = join151(getClaudeConfigHomeDir(), "projects");
|
|
543598
|
+
const projectDir = join151(projectsDir, sanitizePath2(getOriginalCwd()));
|
|
543599
|
+
const newPath = join151(projectDir, `${getSessionId()}-${recordingState.timestamp}.cast`);
|
|
543567
543600
|
if (oldPath === newPath) {
|
|
543568
543601
|
return;
|
|
543569
543602
|
}
|
|
@@ -546451,7 +546484,7 @@ var init_useChromeExtensionNotification = __esm(() => {
|
|
|
546451
546484
|
});
|
|
546452
546485
|
|
|
546453
546486
|
// src/utils/plugins/officialMarketplaceStartupCheck.ts
|
|
546454
|
-
import { join as
|
|
546487
|
+
import { join as join152 } from "path";
|
|
546455
546488
|
function isOfficialMarketplaceAutoInstallDisabled() {
|
|
546456
546489
|
return isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_OFFICIAL_MARKETPLACE_AUTOINSTALL);
|
|
546457
546490
|
}
|
|
@@ -546534,7 +546567,7 @@ async function checkAndInstallOfficialMarketplace() {
|
|
|
546534
546567
|
return { installed: false, skipped: true, reason: "policy_blocked" };
|
|
546535
546568
|
}
|
|
546536
546569
|
const cacheDir = getMarketplacesCacheDir();
|
|
546537
|
-
const installLocation =
|
|
546570
|
+
const installLocation = join152(cacheDir, OFFICIAL_MARKETPLACE_NAME);
|
|
546538
546571
|
const gcsSha = await fetchOfficialMarketplaceFromGcs(installLocation, cacheDir);
|
|
546539
546572
|
if (gcsSha !== null) {
|
|
546540
546573
|
const known = await loadKnownMarketplacesConfig();
|
|
@@ -549555,7 +549588,7 @@ var init_usePluginRecommendationBase = __esm(() => {
|
|
|
549555
549588
|
});
|
|
549556
549589
|
|
|
549557
549590
|
// src/hooks/useLspPluginRecommendation.tsx
|
|
549558
|
-
import { extname as extname16, join as
|
|
549591
|
+
import { extname as extname16, join as join153 } from "path";
|
|
549559
549592
|
function useLspPluginRecommendation() {
|
|
549560
549593
|
const $3 = import_compiler_runtime355.c(12);
|
|
549561
549594
|
const trackedFiles = useAppState(_temp234);
|
|
@@ -549640,7 +549673,7 @@ function useLspPluginRecommendation() {
|
|
|
549640
549673
|
case "yes": {
|
|
549641
549674
|
installPluginAndNotify(pluginId, pluginName, "lsp-plugin", addNotification, async (pluginData) => {
|
|
549642
549675
|
logForDebugging(`[useLspPluginRecommendation] Installing plugin: ${pluginId}`);
|
|
549643
|
-
const localSourcePath = typeof pluginData.entry.source === "string" ?
|
|
549676
|
+
const localSourcePath = typeof pluginData.entry.source === "string" ? join153(pluginData.marketplaceInstallLocation, pluginData.entry.source) : undefined;
|
|
549644
549677
|
await cacheAndRegisterPlugin(pluginId, pluginData.entry, "user", undefined, localSourcePath);
|
|
549645
549678
|
const settings = getSettingsForSource("userSettings");
|
|
549646
549679
|
updateSettingsForSource("userSettings", {
|
|
@@ -552460,8 +552493,8 @@ var exports_REPL = {};
|
|
|
552460
552493
|
__export(exports_REPL, {
|
|
552461
552494
|
REPL: () => REPL
|
|
552462
552495
|
});
|
|
552463
|
-
import { dirname as dirname65, join as
|
|
552464
|
-
import { tmpdir as
|
|
552496
|
+
import { dirname as dirname65, join as join154 } from "path";
|
|
552497
|
+
import { tmpdir as tmpdir15 } from "os";
|
|
552465
552498
|
import { writeFile as writeFile44 } from "fs/promises";
|
|
552466
552499
|
import { randomUUID as randomUUID47 } from "crypto";
|
|
552467
552500
|
function TranscriptModeFooter(t0) {
|
|
@@ -555079,7 +555112,7 @@ Note: ctrl + z now suspends myclaude, ctrl + _ undoes input.
|
|
|
555079
555112
|
const w2 = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
555080
555113
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w2);
|
|
555081
555114
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
555082
|
-
const path27 =
|
|
555115
|
+
const path27 = join154(tmpdir15(), `cc-transcript-${Date.now()}.txt`);
|
|
555083
555116
|
await writeFile44(path27, text2);
|
|
555084
555117
|
const opened = openFileInExternalEditor(path27);
|
|
555085
555118
|
setStatus(opened ? `opening ${path27}` : `wrote ${path27} · no $VISUAL/$EDITOR set`);
|
|
@@ -561070,16 +561103,16 @@ var init_codegraphCheck = __esm(() => {
|
|
|
561070
561103
|
|
|
561071
561104
|
// src/plugins/bundled/eccBuiltin.ts
|
|
561072
561105
|
import { readdirSync as readdirSync6, readFileSync as readFileSync18, existsSync as existsSync11 } from "fs";
|
|
561073
|
-
import { join as
|
|
561106
|
+
import { join as join155, dirname as dirname67, basename as basename61, extname as extname17 } from "path";
|
|
561074
561107
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
561075
561108
|
function resolveSeedDir() {
|
|
561076
561109
|
if (process.env.CLAUDE_CODE_PLUGIN_SEED_DIR) {
|
|
561077
561110
|
return process.env.CLAUDE_CODE_PLUGIN_SEED_DIR;
|
|
561078
561111
|
}
|
|
561079
|
-
const candidate =
|
|
561112
|
+
const candidate = join155(__dirname3, "..", "..", "..", "seed");
|
|
561080
561113
|
if (existsSync11(candidate))
|
|
561081
561114
|
return candidate;
|
|
561082
|
-
const bundleCandidate =
|
|
561115
|
+
const bundleCandidate = join155(__dirname3, "..", "seed");
|
|
561083
561116
|
if (existsSync11(bundleCandidate))
|
|
561084
561117
|
return bundleCandidate;
|
|
561085
561118
|
return candidate;
|
|
@@ -561115,9 +561148,9 @@ var init_eccBuiltin = __esm(() => {
|
|
|
561115
561148
|
__filename3 = fileURLToPath9(import.meta.url);
|
|
561116
561149
|
__dirname3 = dirname67(__filename3);
|
|
561117
561150
|
SEED_DIR = resolveSeedDir();
|
|
561118
|
-
ECC_DIR =
|
|
561119
|
-
ECC_COMMANDS_DIR =
|
|
561120
|
-
ECC_SKILLS_DIR =
|
|
561151
|
+
ECC_DIR = join155(SEED_DIR, "marketplaces", "ecc");
|
|
561152
|
+
ECC_COMMANDS_DIR = join155(ECC_DIR, "commands");
|
|
561153
|
+
ECC_SKILLS_DIR = join155(ECC_DIR, "skills");
|
|
561121
561154
|
try {
|
|
561122
561155
|
if (!existsSync11(ECC_DIR)) {
|
|
561123
561156
|
process._ecc_registered = 0;
|
|
@@ -561129,15 +561162,15 @@ var init_eccBuiltin = __esm(() => {
|
|
|
561129
561162
|
if (extname17(file2) !== ".md")
|
|
561130
561163
|
continue;
|
|
561131
561164
|
const name = basename61(file2, ".md");
|
|
561132
|
-
const content = readFileSync18(
|
|
561133
|
-
registerMarkdownSkill(name,
|
|
561165
|
+
const content = readFileSync18(join155(ECC_COMMANDS_DIR, file2), "utf-8");
|
|
561166
|
+
registerMarkdownSkill(name, join155(ECC_COMMANDS_DIR, file2), content, "Custom command");
|
|
561134
561167
|
count4++;
|
|
561135
561168
|
}
|
|
561136
561169
|
}
|
|
561137
561170
|
if (existsSync11(ECC_SKILLS_DIR)) {
|
|
561138
561171
|
const dirs = readdirSync6(ECC_SKILLS_DIR);
|
|
561139
561172
|
for (const dir of dirs) {
|
|
561140
|
-
const skillFile =
|
|
561173
|
+
const skillFile = join155(ECC_SKILLS_DIR, dir, "SKILL.md");
|
|
561141
561174
|
if (!existsSync11(skillFile))
|
|
561142
561175
|
continue;
|
|
561143
561176
|
const content = readFileSync18(skillFile, "utf-8");
|
|
@@ -564039,12 +564072,12 @@ var init_createDirectConnectSession = __esm(() => {
|
|
|
564039
564072
|
});
|
|
564040
564073
|
|
|
564041
564074
|
// src/utils/errorLogSink.ts
|
|
564042
|
-
import { dirname as dirname68, join as
|
|
564075
|
+
import { dirname as dirname68, join as join156 } from "path";
|
|
564043
564076
|
function getErrorsPath() {
|
|
564044
|
-
return
|
|
564077
|
+
return join156(CACHE_PATHS.errors(), DATE + ".jsonl");
|
|
564045
564078
|
}
|
|
564046
564079
|
function getMCPLogsPath(serverName) {
|
|
564047
|
-
return
|
|
564080
|
+
return join156(CACHE_PATHS.mcpLogs(serverName), DATE + ".jsonl");
|
|
564048
564081
|
}
|
|
564049
564082
|
function createJsonlWriter(options) {
|
|
564050
564083
|
const writer = createBufferedWriter(options);
|
|
@@ -564387,7 +564420,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
564387
564420
|
// src/utils/iTermBackup.ts
|
|
564388
564421
|
import { copyFile as copyFile12, stat as stat50 } from "fs/promises";
|
|
564389
564422
|
import { homedir as homedir39 } from "os";
|
|
564390
|
-
import { join as
|
|
564423
|
+
import { join as join157 } from "path";
|
|
564391
564424
|
function markITerm2SetupComplete() {
|
|
564392
564425
|
saveGlobalConfig((current) => ({
|
|
564393
564426
|
...current,
|
|
@@ -564402,7 +564435,7 @@ function getIterm2RecoveryInfo() {
|
|
|
564402
564435
|
};
|
|
564403
564436
|
}
|
|
564404
564437
|
function getITerm2PlistPath() {
|
|
564405
|
-
return
|
|
564438
|
+
return join157(homedir39(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
564406
564439
|
}
|
|
564407
564440
|
async function checkAndRestoreITerm2Backup() {
|
|
564408
564441
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -567767,7 +567800,7 @@ var init_idleTimeout = __esm(() => {
|
|
|
567767
567800
|
// src/bridge/inboundAttachments.ts
|
|
567768
567801
|
import { randomUUID as randomUUID50 } from "crypto";
|
|
567769
567802
|
import { mkdir as mkdir45, writeFile as writeFile46 } from "fs/promises";
|
|
567770
|
-
import { basename as basename62, join as
|
|
567803
|
+
import { basename as basename62, join as join158 } from "path";
|
|
567771
567804
|
function debug3(msg) {
|
|
567772
567805
|
logForDebugging(`[bridge:inbound-attach] ${msg}`);
|
|
567773
567806
|
}
|
|
@@ -567783,7 +567816,7 @@ function sanitizeFileName(name) {
|
|
|
567783
567816
|
return base2 || "attachment";
|
|
567784
567817
|
}
|
|
567785
567818
|
function uploadsDir() {
|
|
567786
|
-
return
|
|
567819
|
+
return join158(getClaudeConfigHomeDir(), "uploads", getSessionId());
|
|
567787
567820
|
}
|
|
567788
567821
|
async function resolveOne(att) {
|
|
567789
567822
|
const token = getBridgeAccessToken();
|
|
@@ -567812,7 +567845,7 @@ async function resolveOne(att) {
|
|
|
567812
567845
|
const safeName = sanitizeFileName(att.file_name);
|
|
567813
567846
|
const prefix = (att.file_uuid.slice(0, 8) || randomUUID50().slice(0, 8)).replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
567814
567847
|
const dir = uploadsDir();
|
|
567815
|
-
const outPath =
|
|
567848
|
+
const outPath = join158(dir, `${prefix}-${safeName}`);
|
|
567816
567849
|
try {
|
|
567817
567850
|
await mkdir45(dir, { recursive: true });
|
|
567818
567851
|
await writeFile46(outPath, data);
|
|
@@ -567912,7 +567945,7 @@ var init_sessionUrl = __esm(() => {
|
|
|
567912
567945
|
|
|
567913
567946
|
// src/utils/plugins/zipCacheAdapters.ts
|
|
567914
567947
|
import { readFile as readFile52 } from "fs/promises";
|
|
567915
|
-
import { join as
|
|
567948
|
+
import { join as join159 } from "path";
|
|
567916
567949
|
async function readZipCacheKnownMarketplaces() {
|
|
567917
567950
|
try {
|
|
567918
567951
|
const content = await readFile52(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
@@ -567937,13 +567970,13 @@ async function saveMarketplaceJsonToZipCache(marketplaceName, installLocation) {
|
|
|
567937
567970
|
const content = await readMarketplaceJsonContent(installLocation);
|
|
567938
567971
|
if (content !== null) {
|
|
567939
567972
|
const relPath = getMarketplaceJsonRelativePath(marketplaceName);
|
|
567940
|
-
await atomicWriteToZipCache(
|
|
567973
|
+
await atomicWriteToZipCache(join159(zipCachePath, relPath), content);
|
|
567941
567974
|
}
|
|
567942
567975
|
}
|
|
567943
567976
|
async function readMarketplaceJsonContent(dir) {
|
|
567944
567977
|
const candidates = [
|
|
567945
|
-
|
|
567946
|
-
|
|
567978
|
+
join159(dir, ".claude-plugin", "marketplace.json"),
|
|
567979
|
+
join159(dir, "marketplace.json"),
|
|
567947
567980
|
dir
|
|
567948
567981
|
];
|
|
567949
567982
|
for (const candidate of candidates) {
|
|
@@ -568402,9 +568435,9 @@ __export(exports_bridgePointer, {
|
|
|
568402
568435
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
568403
568436
|
});
|
|
568404
568437
|
import { mkdir as mkdir46, readFile as readFile53, stat as stat51, unlink as unlink23, writeFile as writeFile47 } from "fs/promises";
|
|
568405
|
-
import { dirname as dirname69, join as
|
|
568438
|
+
import { dirname as dirname69, join as join160 } from "path";
|
|
568406
568439
|
function getBridgePointerPath(dir) {
|
|
568407
|
-
return
|
|
568440
|
+
return join160(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
568408
568441
|
}
|
|
568409
568442
|
async function writeBridgePointer(dir, pointer) {
|
|
568410
568443
|
const path27 = getBridgePointerPath(dir);
|
|
@@ -574343,14 +574376,14 @@ __export(exports_claudeDesktop, {
|
|
|
574343
574376
|
});
|
|
574344
574377
|
import { readdir as readdir32, readFile as readFile55, stat as stat53 } from "fs/promises";
|
|
574345
574378
|
import { homedir as homedir40 } from "os";
|
|
574346
|
-
import { join as
|
|
574379
|
+
import { join as join161 } from "path";
|
|
574347
574380
|
async function getClaudeDesktopConfigPath() {
|
|
574348
574381
|
const platform6 = getPlatform();
|
|
574349
574382
|
if (!SUPPORTED_PLATFORMS.includes(platform6)) {
|
|
574350
574383
|
throw new Error(`Unsupported platform: ${platform6} - Claude Desktop integration only works on macOS and WSL.`);
|
|
574351
574384
|
}
|
|
574352
574385
|
if (platform6 === "macos") {
|
|
574353
|
-
return
|
|
574386
|
+
return join161(homedir40(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
574354
574387
|
}
|
|
574355
574388
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
574356
574389
|
if (windowsHome) {
|
|
@@ -574369,7 +574402,7 @@ async function getClaudeDesktopConfigPath() {
|
|
|
574369
574402
|
if (user.name === "Public" || user.name === "Default" || user.name === "Default User" || user.name === "All Users") {
|
|
574370
574403
|
continue;
|
|
574371
574404
|
}
|
|
574372
|
-
const potentialConfigPath =
|
|
574405
|
+
const potentialConfigPath = join161(usersDir, user.name, "AppData", "Roaming", "Claude", "claude_desktop_config.json");
|
|
574373
574406
|
try {
|
|
574374
574407
|
await stat53(potentialConfigPath);
|
|
574375
574408
|
return potentialConfigPath;
|
|
@@ -575278,12 +575311,12 @@ __export(exports_install, {
|
|
|
575278
575311
|
install: () => install
|
|
575279
575312
|
});
|
|
575280
575313
|
import { homedir as homedir41 } from "node:os";
|
|
575281
|
-
import { join as
|
|
575314
|
+
import { join as join162 } from "node:path";
|
|
575282
575315
|
function getInstallationPath2() {
|
|
575283
575316
|
const isWindows2 = env5.platform === "win32";
|
|
575284
575317
|
const homeDir = homedir41();
|
|
575285
575318
|
if (isWindows2) {
|
|
575286
|
-
const windowsPath =
|
|
575319
|
+
const windowsPath = join162(homeDir, ".local", "bin", "claude.exe");
|
|
575287
575320
|
return windowsPath.replace(/\//g, "\\");
|
|
575288
575321
|
}
|
|
575289
575322
|
return "~/.local/bin/claude";
|
|
@@ -576177,7 +576210,7 @@ __export(exports_main, {
|
|
|
576177
576210
|
main: () => main
|
|
576178
576211
|
});
|
|
576179
576212
|
import { readFileSync as readFileSync19 } from "fs";
|
|
576180
|
-
import { resolve as resolve50, join as
|
|
576213
|
+
import { resolve as resolve50, join as join163, dirname as dirname72 } from "path";
|
|
576181
576214
|
import { fileURLToPath as fileURLToPath10 } from "url";
|
|
576182
576215
|
import { existsSync as existsSync12 } from "fs";
|
|
576183
576216
|
function logManagedSettings() {
|
|
@@ -578647,7 +578680,7 @@ var init_main3 = __esm(() => {
|
|
|
578647
578680
|
if (!process.env.CLAUDE_CODE_PLUGIN_SEED_DIR) {
|
|
578648
578681
|
const __filename_main = fileURLToPath10(import.meta.url);
|
|
578649
578682
|
const __dirname_main = dirname72(__filename_main);
|
|
578650
|
-
const candidateSeed =
|
|
578683
|
+
const candidateSeed = join163(__dirname_main, "..", "seed");
|
|
578651
578684
|
if (existsSync12(candidateSeed)) {
|
|
578652
578685
|
process.env.CLAUDE_CODE_PLUGIN_SEED_DIR = candidateSeed;
|
|
578653
578686
|
}
|