@makerbi/openclaude 0.14.7 → 0.14.9
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/cli.mjs +266 -158
- package/dist/sdk.mjs +15 -15
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -232303,7 +232303,7 @@ var init_metadata = __esm(() => {
|
|
|
232303
232303
|
isClaudeAiAuth: isClaudeAISubscriber(),
|
|
232304
232304
|
version: "99.0.0",
|
|
232305
232305
|
versionBase: getVersionBase(),
|
|
232306
|
-
buildTime: "2026-05-26T10:
|
|
232306
|
+
buildTime: "2026-05-26T10:36:27.285Z",
|
|
232307
232307
|
deploymentEnvironment: env2.detectDeploymentEnvironment(),
|
|
232308
232308
|
...isEnvTruthy(process.env.GITHUB_ACTIONS) && {
|
|
232309
232309
|
githubEventName: process.env.GITHUB_EVENT_NAME,
|
|
@@ -366113,7 +366113,7 @@ var init_xdg = () => {};
|
|
|
366113
366113
|
|
|
366114
366114
|
// src/utils/nativeInstaller/download.ts
|
|
366115
366115
|
import { createHash as createHash12 } from "crypto";
|
|
366116
|
-
import { chmod as chmod4, writeFile as writeFile12 } from "fs/promises";
|
|
366116
|
+
import { chmod as chmod4, readFile as readFile14, writeFile as writeFile12 } from "fs/promises";
|
|
366117
366117
|
import { join as join60 } from "path";
|
|
366118
366118
|
function normalizeReleaseTag(version2) {
|
|
366119
366119
|
return version2.startsWith("v") ? version2 : `v${version2}`;
|
|
@@ -366124,6 +366124,91 @@ function normalizeReleaseVersion(tagName) {
|
|
|
366124
366124
|
function getGitHubReleaseAssetName(platform4) {
|
|
366125
366125
|
return platform4.startsWith("win32") ? `openclaude-${platform4}.exe` : `openclaude-${platform4}`;
|
|
366126
366126
|
}
|
|
366127
|
+
function getCurlExecutable() {
|
|
366128
|
+
return process.platform === "win32" ? "curl.exe" : "curl";
|
|
366129
|
+
}
|
|
366130
|
+
function getNullOutputPath() {
|
|
366131
|
+
return process.platform === "win32" ? "NUL" : "/dev/null";
|
|
366132
|
+
}
|
|
366133
|
+
function parseReleaseVersionFromUrl(url3) {
|
|
366134
|
+
const match = url3.trim().match(/\/releases\/tag\/(v?\d+\.\d+\.\d+(?:-\S+)?)$/);
|
|
366135
|
+
return match ? normalizeReleaseVersion(match[1]) : null;
|
|
366136
|
+
}
|
|
366137
|
+
function shouldFallbackToCurl(error42) {
|
|
366138
|
+
const message = error42 instanceof Error ? error42.message : String(error42);
|
|
366139
|
+
if (axios_default.isAxiosError(error42)) {
|
|
366140
|
+
return !error42.response;
|
|
366141
|
+
}
|
|
366142
|
+
return /EAI_AGAIN|ECONNRESET|ETIMEDOUT|ENOTFOUND|network|timeout/i.test(message);
|
|
366143
|
+
}
|
|
366144
|
+
async function getLatestVersionFromGitHubLatestRedirect() {
|
|
366145
|
+
const latestUrl = `${GITHUB_RELEASES_WEB_URL}/latest`;
|
|
366146
|
+
const { stdout, stderr, code, error: error42 } = await execFileNoThrowWithCwd(getCurlExecutable(), [
|
|
366147
|
+
"-L",
|
|
366148
|
+
"--silent",
|
|
366149
|
+
"--show-error",
|
|
366150
|
+
"--max-time",
|
|
366151
|
+
"30",
|
|
366152
|
+
"--output",
|
|
366153
|
+
getNullOutputPath(),
|
|
366154
|
+
"--write-out",
|
|
366155
|
+
"%{url_effective}",
|
|
366156
|
+
latestUrl
|
|
366157
|
+
], {
|
|
366158
|
+
timeout: 35000,
|
|
366159
|
+
preserveOutputOnError: true
|
|
366160
|
+
});
|
|
366161
|
+
if (code !== 0) {
|
|
366162
|
+
logForDebugging(`GitHub latest redirect fallback failed: ${error42 || stderr || `curl exited with code ${code}`}`, { level: "warn" });
|
|
366163
|
+
return null;
|
|
366164
|
+
}
|
|
366165
|
+
return parseReleaseVersionFromUrl(stdout);
|
|
366166
|
+
}
|
|
366167
|
+
async function fetchJsonWithCurl(url3, timeoutMs) {
|
|
366168
|
+
const { stdout, stderr, code, error: error42 } = await execFileNoThrowWithCwd(getCurlExecutable(), [
|
|
366169
|
+
"-L",
|
|
366170
|
+
"--fail",
|
|
366171
|
+
"--silent",
|
|
366172
|
+
"--show-error",
|
|
366173
|
+
"--max-time",
|
|
366174
|
+
String(Math.ceil(timeoutMs / 1000)),
|
|
366175
|
+
url3
|
|
366176
|
+
], {
|
|
366177
|
+
timeout: timeoutMs + 5000,
|
|
366178
|
+
preserveOutputOnError: true
|
|
366179
|
+
});
|
|
366180
|
+
if (code !== 0) {
|
|
366181
|
+
throw new Error(`curl failed with code ${code}: ${error42 || stderr || "no error output"}`);
|
|
366182
|
+
}
|
|
366183
|
+
return JSON.parse(stdout);
|
|
366184
|
+
}
|
|
366185
|
+
async function downloadFileWithCurl(url3, outputPath, timeoutMs) {
|
|
366186
|
+
const { stderr, code, error: error42 } = await execFileNoThrowWithCwd(getCurlExecutable(), [
|
|
366187
|
+
"-L",
|
|
366188
|
+
"--fail",
|
|
366189
|
+
"--silent",
|
|
366190
|
+
"--show-error",
|
|
366191
|
+
"--max-time",
|
|
366192
|
+
String(Math.ceil(timeoutMs / 1000)),
|
|
366193
|
+
"--output",
|
|
366194
|
+
outputPath,
|
|
366195
|
+
url3
|
|
366196
|
+
], {
|
|
366197
|
+
timeout: timeoutMs + 5000,
|
|
366198
|
+
preserveOutputOnError: true
|
|
366199
|
+
});
|
|
366200
|
+
if (code !== 0) {
|
|
366201
|
+
throw new Error(`curl failed with code ${code}: ${error42 || stderr || "no error output"}`);
|
|
366202
|
+
}
|
|
366203
|
+
}
|
|
366204
|
+
function verifyChecksum(data, expectedChecksum) {
|
|
366205
|
+
const hash = createHash12("sha256");
|
|
366206
|
+
hash.update(data);
|
|
366207
|
+
const actualChecksum = hash.digest("hex");
|
|
366208
|
+
if (actualChecksum !== expectedChecksum) {
|
|
366209
|
+
throw new Error(`Checksum mismatch: expected ${expectedChecksum}, got ${actualChecksum}`);
|
|
366210
|
+
}
|
|
366211
|
+
}
|
|
366127
366212
|
function isReleaseVersion(value) {
|
|
366128
366213
|
return typeof value === "string" && /^v?\d+\.\d+\.\d+(-\S+)?$/.test(value);
|
|
366129
366214
|
}
|
|
@@ -366180,6 +366265,13 @@ async function getLatestVersionFromGitHubReleases2(channel = "latest") {
|
|
|
366180
366265
|
});
|
|
366181
366266
|
return normalizeReleaseVersion(tagName.trim());
|
|
366182
366267
|
} catch (error42) {
|
|
366268
|
+
if (channel === "latest") {
|
|
366269
|
+
const fallbackVersion = await getLatestVersionFromGitHubLatestRedirect();
|
|
366270
|
+
if (fallbackVersion) {
|
|
366271
|
+
logForDebugging(`Resolved latest GitHub release via redirect fallback: ${fallbackVersion}`, { level: "warn" });
|
|
366272
|
+
return fallbackVersion;
|
|
366273
|
+
}
|
|
366274
|
+
}
|
|
366183
366275
|
const latencyMs = Date.now() - startTime;
|
|
366184
366276
|
const errorMessage2 = error42 instanceof Error ? error42.message : String(error42);
|
|
366185
366277
|
let httpStatus;
|
|
@@ -366320,12 +366412,7 @@ async function downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath,
|
|
|
366320
366412
|
...requestConfig
|
|
366321
366413
|
});
|
|
366322
366414
|
clearStallTimer();
|
|
366323
|
-
|
|
366324
|
-
hash.update(response.data);
|
|
366325
|
-
const actualChecksum = hash.digest("hex");
|
|
366326
|
-
if (actualChecksum !== expectedChecksum) {
|
|
366327
|
-
throw new Error(`Checksum mismatch: expected ${expectedChecksum}, got ${actualChecksum}`);
|
|
366328
|
-
}
|
|
366415
|
+
verifyChecksum(Buffer.from(response.data), expectedChecksum);
|
|
366329
366416
|
await writeFile12(binaryPath, Buffer.from(response.data));
|
|
366330
366417
|
await chmod4(binaryPath, 493);
|
|
366331
366418
|
return;
|
|
@@ -366347,6 +366434,19 @@ async function downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath,
|
|
|
366347
366434
|
}
|
|
366348
366435
|
throw lastError ?? new Error("Download failed after all retries");
|
|
366349
366436
|
}
|
|
366437
|
+
async function downloadAndVerifyGitHubReleaseBinary(binaryUrl, expectedChecksum, binaryPath) {
|
|
366438
|
+
try {
|
|
366439
|
+
await downloadAndVerifyBinary(binaryUrl, expectedChecksum, binaryPath);
|
|
366440
|
+
} catch (error42) {
|
|
366441
|
+
if (!shouldFallbackToCurl(error42)) {
|
|
366442
|
+
throw error42;
|
|
366443
|
+
}
|
|
366444
|
+
logForDebugging(`GitHub Release binary download via axios failed (${error42 instanceof Error ? error42.message : String(error42)}); retrying with curl`, { level: "warn" });
|
|
366445
|
+
await downloadFileWithCurl(binaryUrl, binaryPath, 5 * 60000);
|
|
366446
|
+
verifyChecksum(await readFile14(binaryPath), expectedChecksum);
|
|
366447
|
+
await chmod4(binaryPath, 493);
|
|
366448
|
+
}
|
|
366449
|
+
}
|
|
366350
366450
|
async function downloadVersionFromGitHubRelease(version2, stagingPath) {
|
|
366351
366451
|
const fs2 = getFsImplementation();
|
|
366352
366452
|
await fs2.rm(stagingPath, { recursive: true, force: true });
|
|
@@ -366357,11 +366457,19 @@ async function downloadVersionFromGitHubRelease(version2, stagingPath) {
|
|
|
366357
366457
|
let manifest;
|
|
366358
366458
|
const manifestUrl = `${GITHUB_RELEASE_DOWNLOAD_BASE_URL}/${tag2}/manifest.json`;
|
|
366359
366459
|
try {
|
|
366360
|
-
|
|
366361
|
-
|
|
366362
|
-
|
|
366363
|
-
|
|
366364
|
-
|
|
366460
|
+
try {
|
|
366461
|
+
const manifestResponse = await axios_default.get(manifestUrl, {
|
|
366462
|
+
timeout: 30000,
|
|
366463
|
+
responseType: "json"
|
|
366464
|
+
});
|
|
366465
|
+
manifest = manifestResponse.data;
|
|
366466
|
+
} catch (error42) {
|
|
366467
|
+
if (!shouldFallbackToCurl(error42)) {
|
|
366468
|
+
throw error42;
|
|
366469
|
+
}
|
|
366470
|
+
logForDebugging(`GitHub Release manifest fetch via axios failed (${error42 instanceof Error ? error42.message : String(error42)}); retrying with curl`, { level: "warn" });
|
|
366471
|
+
manifest = await fetchJsonWithCurl(manifestUrl, 30000);
|
|
366472
|
+
}
|
|
366365
366473
|
} catch (error42) {
|
|
366366
366474
|
const latencyMs = Date.now() - startTime;
|
|
366367
366475
|
const errorMessage2 = error42 instanceof Error ? error42.message : String(error42);
|
|
@@ -366389,7 +366497,7 @@ async function downloadVersionFromGitHubRelease(version2, stagingPath) {
|
|
|
366389
366497
|
await fs2.mkdir(stagingPath);
|
|
366390
366498
|
const binaryPath = join60(stagingPath, binaryName);
|
|
366391
366499
|
try {
|
|
366392
|
-
await
|
|
366500
|
+
await downloadAndVerifyGitHubReleaseBinary(binaryUrl, expectedChecksum, binaryPath);
|
|
366393
366501
|
const latencyMs = Date.now() - startTime;
|
|
366394
366502
|
logEvent("tengu_binary_download_success", {
|
|
366395
366503
|
latency_ms: latencyMs
|
|
@@ -366420,7 +366528,7 @@ async function downloadVersion(version2, stagingPath) {
|
|
|
366420
366528
|
await downloadVersionFromGitHubRelease(version2, stagingPath);
|
|
366421
366529
|
return "binary";
|
|
366422
366530
|
}
|
|
366423
|
-
var GITHUB_RELEASES_API_URL = "https://api.github.com/repos/AndersonBY/openclaude/releases", GITHUB_RELEASE_DOWNLOAD_BASE_URL = "https://github.com/AndersonBY/openclaude/releases/download", ARTIFACTORY_REGISTRY_URL, DEFAULT_STALL_TIMEOUT_MS = 60000, MAX_DOWNLOAD_RETRIES = 3, StallTimeoutError;
|
|
366531
|
+
var GITHUB_RELEASES_API_URL = "https://api.github.com/repos/AndersonBY/openclaude/releases", GITHUB_RELEASES_WEB_URL = "https://github.com/AndersonBY/openclaude/releases", GITHUB_RELEASE_DOWNLOAD_BASE_URL = "https://github.com/AndersonBY/openclaude/releases/download", ARTIFACTORY_REGISTRY_URL, DEFAULT_STALL_TIMEOUT_MS = 60000, MAX_DOWNLOAD_RETRIES = 3, StallTimeoutError;
|
|
366424
366532
|
var init_download = __esm(() => {
|
|
366425
366533
|
init_axios2();
|
|
366426
366534
|
init_debug();
|
|
@@ -366676,7 +366784,7 @@ import {
|
|
|
366676
366784
|
access as access2,
|
|
366677
366785
|
chmod as chmod5,
|
|
366678
366786
|
copyFile as copyFile2,
|
|
366679
|
-
readFile as
|
|
366787
|
+
readFile as readFile15,
|
|
366680
366788
|
lstat as lstat5,
|
|
366681
366789
|
mkdir as mkdir12,
|
|
366682
366790
|
readdir as readdir8,
|
|
@@ -367058,8 +367166,8 @@ async function updateSymlink(symlinkPath, targetPath) {
|
|
|
367058
367166
|
const targetStats = await stat20(targetPath);
|
|
367059
367167
|
if (existingStats.size === targetStats.size) {
|
|
367060
367168
|
const [existingContent, targetContent] = await Promise.all([
|
|
367061
|
-
|
|
367062
|
-
|
|
367169
|
+
readFile15(symlinkPath),
|
|
367170
|
+
readFile15(targetPath)
|
|
367063
367171
|
]);
|
|
367064
367172
|
if (existingContent.equals(targetContent)) {
|
|
367065
367173
|
return false;
|
|
@@ -373070,7 +373178,7 @@ function appendCappedMessage(prev, item) {
|
|
|
373070
373178
|
var TEAMMATE_MESSAGES_UI_CAP = 50;
|
|
373071
373179
|
|
|
373072
373180
|
// src/utils/tasks.ts
|
|
373073
|
-
import { mkdir as mkdir13, readdir as readdir9, readFile as
|
|
373181
|
+
import { mkdir as mkdir13, readdir as readdir9, readFile as readFile16, unlink as unlink8, writeFile as writeFile14 } from "fs/promises";
|
|
373074
373182
|
import { join as join64 } from "path";
|
|
373075
373183
|
function setLeaderTeamName(teamName) {
|
|
373076
373184
|
if (leaderTeamName === teamName)
|
|
@@ -373095,7 +373203,7 @@ function getHighWaterMarkPath(taskListId) {
|
|
|
373095
373203
|
async function readHighWaterMark(taskListId) {
|
|
373096
373204
|
const path12 = getHighWaterMarkPath(taskListId);
|
|
373097
373205
|
try {
|
|
373098
|
-
const content = (await
|
|
373206
|
+
const content = (await readFile16(path12, "utf-8")).trim();
|
|
373099
373207
|
const value = parseInt(content, 10);
|
|
373100
373208
|
return isNaN(value) ? 0 : value;
|
|
373101
373209
|
} catch {
|
|
@@ -373219,7 +373327,7 @@ async function createTask(taskListId, taskData) {
|
|
|
373219
373327
|
async function getTask(taskListId, taskId) {
|
|
373220
373328
|
const path12 = getTaskPath(taskListId, taskId);
|
|
373221
373329
|
try {
|
|
373222
|
-
const content = await
|
|
373330
|
+
const content = await readFile16(path12, "utf-8");
|
|
373223
373331
|
const data = jsonParse(content);
|
|
373224
373332
|
if (process.env.USER_TYPE === "ant") {
|
|
373225
373333
|
if (data.status === "open")
|
|
@@ -376252,7 +376360,7 @@ __export(exports_teammateMailbox, {
|
|
|
376252
376360
|
PlanApprovalRequestMessageSchema: () => PlanApprovalRequestMessageSchema,
|
|
376253
376361
|
ModeSetRequestMessageSchema: () => ModeSetRequestMessageSchema
|
|
376254
376362
|
});
|
|
376255
|
-
import { mkdir as mkdir14, readFile as
|
|
376363
|
+
import { mkdir as mkdir14, readFile as readFile17, writeFile as writeFile15 } from "fs/promises";
|
|
376256
376364
|
import { join as join65 } from "path";
|
|
376257
376365
|
function getInboxPath(agentName, teamName) {
|
|
376258
376366
|
const team = teamName || getTeamName() || "default";
|
|
@@ -376274,7 +376382,7 @@ async function readMailbox(agentName, teamName) {
|
|
|
376274
376382
|
const inboxPath = getInboxPath(agentName, teamName);
|
|
376275
376383
|
logForDebugging(`[TeammateMailbox] readMailbox: path=${inboxPath}`);
|
|
376276
376384
|
try {
|
|
376277
|
-
const content = await
|
|
376385
|
+
const content = await readFile17(inboxPath, "utf-8");
|
|
376278
376386
|
const messages = jsonParse(content);
|
|
376279
376387
|
logForDebugging(`[TeammateMailbox] readMailbox: read ${messages.length} message(s)`);
|
|
376280
376388
|
return messages;
|
|
@@ -379450,7 +379558,7 @@ __export(exports_teamHelpers, {
|
|
|
379450
379558
|
addHiddenPaneId: () => addHiddenPaneId
|
|
379451
379559
|
});
|
|
379452
379560
|
import { mkdirSync as mkdirSync6, readFileSync as readFileSync11, writeFileSync as writeFileSync4 } from "fs";
|
|
379453
|
-
import { mkdir as mkdir15, readFile as
|
|
379561
|
+
import { mkdir as mkdir15, readFile as readFile18, rm as rm4, writeFile as writeFile16 } from "fs/promises";
|
|
379454
379562
|
import { join as join66 } from "path";
|
|
379455
379563
|
function sanitizeName(name) {
|
|
379456
379564
|
return name.replace(/[^a-zA-Z0-9]/g, "-").toLowerCase();
|
|
@@ -379477,7 +379585,7 @@ function readTeamFile(teamName) {
|
|
|
379477
379585
|
}
|
|
379478
379586
|
async function readTeamFileAsync(teamName) {
|
|
379479
379587
|
try {
|
|
379480
|
-
const content = await
|
|
379588
|
+
const content = await readFile18(getTeamFilePath(teamName), "utf-8");
|
|
379481
379589
|
return jsonParse(content);
|
|
379482
379590
|
} catch (e) {
|
|
379483
379591
|
if (getErrnoCode2(e) === "ENOENT")
|
|
@@ -379656,7 +379764,7 @@ async function destroyWorktree(worktreePath) {
|
|
|
379656
379764
|
const gitFilePath = join66(worktreePath, ".git");
|
|
379657
379765
|
let mainRepoPath = null;
|
|
379658
379766
|
try {
|
|
379659
|
-
const gitFileContent = (await
|
|
379767
|
+
const gitFileContent = (await readFile18(gitFilePath, "utf-8")).trim();
|
|
379660
379768
|
const match = gitFileContent.match(/^gitdir:\s*(.+)$/);
|
|
379661
379769
|
if (match && match[1]) {
|
|
379662
379770
|
const worktreeGitDir = match[1];
|
|
@@ -394866,7 +394974,7 @@ import {
|
|
|
394866
394974
|
copyFile as copyFile3,
|
|
394867
394975
|
link as link3,
|
|
394868
394976
|
mkdir as mkdir16,
|
|
394869
|
-
readFile as
|
|
394977
|
+
readFile as readFile19,
|
|
394870
394978
|
stat as stat21,
|
|
394871
394979
|
unlink as unlink9
|
|
394872
394980
|
} from "fs/promises";
|
|
@@ -395223,8 +395331,8 @@ async function checkOriginFileChanged(originalFile, backupFileName, originalStat
|
|
|
395223
395331
|
return compareStatsAndContent(originalStats, backupStats, async () => {
|
|
395224
395332
|
try {
|
|
395225
395333
|
const [originalContent, backupContent] = await Promise.all([
|
|
395226
|
-
|
|
395227
|
-
|
|
395334
|
+
readFile19(originalFile, "utf-8"),
|
|
395335
|
+
readFile19(backupPath, "utf-8")
|
|
395228
395336
|
]);
|
|
395229
395337
|
return originalContent !== backupContent;
|
|
395230
395338
|
} catch {
|
|
@@ -395495,7 +395603,7 @@ async function notifyVscodeSnapshotFilesUpdated(oldState, newState) {
|
|
|
395495
395603
|
}
|
|
395496
395604
|
async function readFileAsyncOrNull(path12) {
|
|
395497
395605
|
try {
|
|
395498
|
-
return await
|
|
395606
|
+
return await readFile19(path12, "utf-8");
|
|
395499
395607
|
} catch {
|
|
395500
395608
|
return null;
|
|
395501
395609
|
}
|
|
@@ -396538,7 +396646,7 @@ var init_plans = __esm(() => {
|
|
|
396538
396646
|
});
|
|
396539
396647
|
|
|
396540
396648
|
// src/utils/sessionEnvironment.ts
|
|
396541
|
-
import { mkdir as mkdir17, readdir as readdir10, readFile as
|
|
396649
|
+
import { mkdir as mkdir17, readdir as readdir10, readFile as readFile20, writeFile as writeFile18 } from "fs/promises";
|
|
396542
396650
|
import { join as join69 } from "path";
|
|
396543
396651
|
async function getSessionEnvDirPath() {
|
|
396544
396652
|
const sessionEnvDir = join69(getClaudeConfigHomeDir(), "session-env", getSessionId());
|
|
@@ -396577,7 +396685,7 @@ async function getSessionEnvironmentScript() {
|
|
|
396577
396685
|
const envFile = process.env.CLAUDE_ENV_FILE;
|
|
396578
396686
|
if (envFile) {
|
|
396579
396687
|
try {
|
|
396580
|
-
const envScript = (await
|
|
396688
|
+
const envScript = (await readFile20(envFile, "utf8")).trim();
|
|
396581
396689
|
if (envScript) {
|
|
396582
396690
|
scripts.push(envScript);
|
|
396583
396691
|
logForDebugging(`Session environment loaded from CLAUDE_ENV_FILE: ${envFile} (${envScript.length} chars)`);
|
|
@@ -396596,7 +396704,7 @@ async function getSessionEnvironmentScript() {
|
|
|
396596
396704
|
for (const file2 of hookFiles) {
|
|
396597
396705
|
const filePath = join69(sessionEnvDir, file2);
|
|
396598
396706
|
try {
|
|
396599
|
-
const content = (await
|
|
396707
|
+
const content = (await readFile20(filePath, "utf8")).trim();
|
|
396600
396708
|
if (content) {
|
|
396601
396709
|
scripts.push(content);
|
|
396602
396710
|
}
|
|
@@ -400179,7 +400287,7 @@ var init_LSPDiagnosticRegistry = __esm(() => {
|
|
|
400179
400287
|
});
|
|
400180
400288
|
|
|
400181
400289
|
// src/utils/plugins/lspPluginIntegration.ts
|
|
400182
|
-
import { readFile as
|
|
400290
|
+
import { readFile as readFile22 } from "fs/promises";
|
|
400183
400291
|
import { join as join72, relative as relative11, resolve as resolve22 } from "path";
|
|
400184
400292
|
function validatePathWithinPlugin(pluginPath, relativePath) {
|
|
400185
400293
|
const resolvedPluginPath = resolve22(pluginPath);
|
|
@@ -400194,7 +400302,7 @@ async function loadPluginLspServers(plugin, errors4 = []) {
|
|
|
400194
400302
|
const servers = {};
|
|
400195
400303
|
const lspJsonPath = join72(plugin.path, ".lsp.json");
|
|
400196
400304
|
try {
|
|
400197
|
-
const content = await
|
|
400305
|
+
const content = await readFile22(lspJsonPath, "utf-8");
|
|
400198
400306
|
const parsed = jsonParse(content);
|
|
400199
400307
|
const result = exports_external.record(exports_external.string(), LspServerConfigSchema()).safeParse(parsed);
|
|
400200
400308
|
if (result.success) {
|
|
@@ -400251,7 +400359,7 @@ async function loadLspServersFromManifest(declaration, pluginPath, pluginName, e
|
|
|
400251
400359
|
continue;
|
|
400252
400360
|
}
|
|
400253
400361
|
try {
|
|
400254
|
-
const content = await
|
|
400362
|
+
const content = await readFile22(validatedPath, "utf-8");
|
|
400255
400363
|
const parsed = jsonParse(content);
|
|
400256
400364
|
const result = exports_external.record(exports_external.string(), LspServerConfigSchema()).safeParse(parsed);
|
|
400257
400365
|
if (result.success) {
|
|
@@ -407275,7 +407383,7 @@ var init_UI6 = __esm(() => {
|
|
|
407275
407383
|
});
|
|
407276
407384
|
|
|
407277
407385
|
// src/tools/BashTool/utils.ts
|
|
407278
|
-
import { readFile as
|
|
407386
|
+
import { readFile as readFile23, stat as stat26 } from "fs/promises";
|
|
407279
407387
|
function stripEmptyLines(content) {
|
|
407280
407388
|
const lines = content.split(`
|
|
407281
407389
|
`);
|
|
@@ -407327,7 +407435,7 @@ async function resizeShellImageOutput(stdout, outputFilePath, outputFileSize) {
|
|
|
407327
407435
|
const size = outputFileSize ?? (await stat26(outputFilePath)).size;
|
|
407328
407436
|
if (size > MAX_IMAGE_FILE_SIZE)
|
|
407329
407437
|
return null;
|
|
407330
|
-
source = await
|
|
407438
|
+
source = await readFile23(outputFilePath, "utf8");
|
|
407331
407439
|
}
|
|
407332
407440
|
const parsed = parseDataUri(source);
|
|
407333
407441
|
if (!parsed)
|
|
@@ -414882,7 +414990,7 @@ var init_fileOperationAnalytics = __esm(() => {
|
|
|
414882
414990
|
});
|
|
414883
414991
|
|
|
414884
414992
|
// src/utils/gitDiff.ts
|
|
414885
|
-
import { access as access4, readFile as
|
|
414993
|
+
import { access as access4, readFile as readFile24 } from "fs/promises";
|
|
414886
414994
|
import { dirname as dirname31, join as join76, relative as relative13, sep as sep16 } from "path";
|
|
414887
414995
|
async function fetchGitDiff() {
|
|
414888
414996
|
const isGit = await getIsGit();
|
|
@@ -415133,7 +415241,7 @@ async function generateSyntheticDiff(gitPath, absoluteFilePath) {
|
|
|
415133
415241
|
if (!isFileWithinReadSizeLimit(absoluteFilePath, MAX_DIFF_SIZE_BYTES)) {
|
|
415134
415242
|
return null;
|
|
415135
415243
|
}
|
|
415136
|
-
const content = await
|
|
415244
|
+
const content = await readFile24(absoluteFilePath, "utf-8");
|
|
415137
415245
|
const lines = content.split(`
|
|
415138
415246
|
`);
|
|
415139
415247
|
if (lines.length > 0 && lines.at(-1) === "") {
|
|
@@ -442292,7 +442400,7 @@ var init_listSessionsImpl = __esm(() => {
|
|
|
442292
442400
|
});
|
|
442293
442401
|
|
|
442294
442402
|
// src/services/autoDream/consolidationLock.ts
|
|
442295
|
-
import { mkdir as mkdir21, readFile as
|
|
442403
|
+
import { mkdir as mkdir21, readFile as readFile25, stat as stat28, unlink as unlink12, utimes, writeFile as writeFile20 } from "fs/promises";
|
|
442296
442404
|
import { join as join80 } from "path";
|
|
442297
442405
|
function lockPath() {
|
|
442298
442406
|
return join80(getAutoMemPath(), LOCK_FILE);
|
|
@@ -442310,7 +442418,7 @@ async function tryAcquireConsolidationLock() {
|
|
|
442310
442418
|
let mtimeMs;
|
|
442311
442419
|
let holderPid;
|
|
442312
442420
|
try {
|
|
442313
|
-
const [s, raw] = await Promise.all([stat28(path15),
|
|
442421
|
+
const [s, raw] = await Promise.all([stat28(path15), readFile25(path15, "utf8")]);
|
|
442314
442422
|
mtimeMs = s.mtimeMs;
|
|
442315
442423
|
const parsed = parseInt(raw.trim(), 10);
|
|
442316
442424
|
holderPid = Number.isFinite(parsed) ? parsed : undefined;
|
|
@@ -442325,7 +442433,7 @@ async function tryAcquireConsolidationLock() {
|
|
|
442325
442433
|
await writeFile20(path15, String(process.pid));
|
|
442326
442434
|
let verify;
|
|
442327
442435
|
try {
|
|
442328
|
-
verify = await
|
|
442436
|
+
verify = await readFile25(path15, "utf8");
|
|
442329
442437
|
} catch {
|
|
442330
442438
|
return null;
|
|
442331
442439
|
}
|
|
@@ -444636,7 +444744,7 @@ var require_querystring = __commonJS((exports) => {
|
|
|
444636
444744
|
|
|
444637
444745
|
// node_modules/needle/lib/multipart.js
|
|
444638
444746
|
var require_multipart = __commonJS((exports) => {
|
|
444639
|
-
var
|
|
444747
|
+
var readFile26 = __require("fs").readFile;
|
|
444640
444748
|
var basename24 = __require("path").basename;
|
|
444641
444749
|
exports.build = function(data, boundary, callback) {
|
|
444642
444750
|
if (typeof data != "object" || typeof data.pipe == "function")
|
|
@@ -444688,7 +444796,7 @@ var require_multipart = __commonJS((exports) => {
|
|
|
444688
444796
|
var filename = part.filename ? part.filename : part.file ? basename24(part.file) : name;
|
|
444689
444797
|
if (part.buffer)
|
|
444690
444798
|
return append2(part.buffer, filename, true);
|
|
444691
|
-
|
|
444799
|
+
readFile26(part.file, function(err2, data) {
|
|
444692
444800
|
if (err2)
|
|
444693
444801
|
return callback(err2);
|
|
444694
444802
|
append2(data, filename, true);
|
|
@@ -457460,7 +457568,7 @@ var init_TeamDeleteTool = __esm(() => {
|
|
|
457460
457568
|
});
|
|
457461
457569
|
|
|
457462
457570
|
// src/utils/concurrentSessions.ts
|
|
457463
|
-
import { chmod as chmod7, mkdir as mkdir22, readdir as readdir12, readFile as
|
|
457571
|
+
import { chmod as chmod7, mkdir as mkdir22, readdir as readdir12, readFile as readFile26, unlink as unlink13, writeFile as writeFile22 } from "fs/promises";
|
|
457464
457572
|
import { join as join81 } from "path";
|
|
457465
457573
|
function getSessionsDir() {
|
|
457466
457574
|
return join81(getClaudeConfigHomeDir(), "sessions");
|
|
@@ -457505,7 +457613,7 @@ async function registerSession() {
|
|
|
457505
457613
|
async function updatePidFile(patch) {
|
|
457506
457614
|
const pidFile = join81(getSessionsDir(), `${process.pid}.json`);
|
|
457507
457615
|
try {
|
|
457508
|
-
const data = jsonParse(await
|
|
457616
|
+
const data = jsonParse(await readFile26(pidFile, "utf8"));
|
|
457509
457617
|
await writeFile22(pidFile, jsonStringify({ ...data, ...patch }));
|
|
457510
457618
|
} catch (e2) {
|
|
457511
457619
|
logForDebugging(`[concurrentSessions] updatePidFile failed: ${errorMessage(e2)}`);
|
|
@@ -462950,7 +463058,7 @@ var init_types10 = __esm(() => {
|
|
|
462950
463058
|
|
|
462951
463059
|
// src/services/teamMemorySync/index.ts
|
|
462952
463060
|
import { createHash as createHash17 } from "crypto";
|
|
462953
|
-
import { mkdir as mkdir23, readdir as readdir13, readFile as
|
|
463061
|
+
import { mkdir as mkdir23, readdir as readdir13, readFile as readFile27, stat as stat31, writeFile as writeFile23 } from "fs/promises";
|
|
462954
463062
|
import { join as join82, relative as relative19, sep as sep21 } from "path";
|
|
462955
463063
|
function createSyncState() {
|
|
462956
463064
|
return {
|
|
@@ -463266,7 +463374,7 @@ async function readLocalTeamMemory(maxEntries) {
|
|
|
463266
463374
|
logForDebugging(`team-memory-sync: skipping oversized file ${entry.name} (${stats.size} > ${MAX_FILE_SIZE_BYTES3} bytes)`, { level: "info" });
|
|
463267
463375
|
return;
|
|
463268
463376
|
}
|
|
463269
|
-
const content = await
|
|
463377
|
+
const content = await readFile27(fullPath, "utf8");
|
|
463270
463378
|
const relPath = relative19(teamDir, fullPath).replaceAll("\\", "/");
|
|
463271
463379
|
const secretMatches = scanForSecrets(content);
|
|
463272
463380
|
if (secretMatches.length > 0) {
|
|
@@ -463329,7 +463437,7 @@ async function writeRemoteEntriesToLocal(entries) {
|
|
|
463329
463437
|
return false;
|
|
463330
463438
|
}
|
|
463331
463439
|
try {
|
|
463332
|
-
const existing = await
|
|
463440
|
+
const existing = await readFile27(validatedPath, "utf8");
|
|
463333
463441
|
if (existing === content) {
|
|
463334
463442
|
return false;
|
|
463335
463443
|
}
|
|
@@ -469028,7 +469136,7 @@ var init_config3 = __esm(() => {
|
|
|
469028
469136
|
|
|
469029
469137
|
// src/utils/readFileInRange.ts
|
|
469030
469138
|
import { createReadStream as createReadStream2, fstat } from "fs";
|
|
469031
|
-
import { stat as fsStat3, readFile as
|
|
469139
|
+
import { stat as fsStat3, readFile as readFile28 } from "fs/promises";
|
|
469032
469140
|
async function readFileInRange(filePath, offset = 0, maxLines, maxBytes, signal, options2) {
|
|
469033
469141
|
signal?.throwIfAborted();
|
|
469034
469142
|
const truncateOnByteLimit = options2?.truncateOnByteLimit ?? false;
|
|
@@ -469040,7 +469148,7 @@ async function readFileInRange(filePath, offset = 0, maxLines, maxBytes, signal,
|
|
|
469040
469148
|
if (!truncateOnByteLimit && maxBytes !== undefined && stats.size > maxBytes) {
|
|
469041
469149
|
throw new FileTooLargeError(stats.size, maxBytes);
|
|
469042
469150
|
}
|
|
469043
|
-
const text = await
|
|
469151
|
+
const text = await readFile28(filePath, { encoding: "utf8", signal });
|
|
469044
469152
|
return readFileInRangeFast(text, stats.mtimeMs, offset, maxLines, truncateOnByteLimit ? maxBytes : undefined);
|
|
469045
469153
|
}
|
|
469046
469154
|
return readFileInRangeStreaming(filePath, offset, maxLines, maxBytes, truncateOnByteLimit, signal);
|
|
@@ -471691,7 +471799,7 @@ function getAnthropicEnvMetadata() {
|
|
|
471691
471799
|
function getBuildAgeMinutes() {
|
|
471692
471800
|
if (false)
|
|
471693
471801
|
;
|
|
471694
|
-
const buildTime = new Date("2026-05-26T10:
|
|
471802
|
+
const buildTime = new Date("2026-05-26T10:36:27.285Z").getTime();
|
|
471695
471803
|
if (isNaN(buildTime))
|
|
471696
471804
|
return;
|
|
471697
471805
|
return Math.floor((Date.now() - buildTime) / 60000);
|
|
@@ -473597,7 +473705,7 @@ var init_postCompactCleanup = __esm(() => {
|
|
|
473597
473705
|
});
|
|
473598
473706
|
|
|
473599
473707
|
// src/services/SessionMemory/prompts.ts
|
|
473600
|
-
import { readFile as
|
|
473708
|
+
import { readFile as readFile29 } from "fs/promises";
|
|
473601
473709
|
import { join as join85 } from "path";
|
|
473602
473710
|
function getDefaultUpdatePrompt() {
|
|
473603
473711
|
return `IMPORTANT: This message and these instructions are NOT part of the actual user conversation. Do NOT include any references to "note-taking", "session notes extraction", or these update instructions in the notes content.
|
|
@@ -473641,7 +473749,7 @@ REMEMBER: Use the Edit tool in parallel and stop. Do not continue after the edit
|
|
|
473641
473749
|
async function loadSessionMemoryTemplate() {
|
|
473642
473750
|
const templatePath = join85(getClaudeConfigHomeDir(), "session-memory", "config", "template.md");
|
|
473643
473751
|
try {
|
|
473644
|
-
return await
|
|
473752
|
+
return await readFile29(templatePath, { encoding: "utf-8" });
|
|
473645
473753
|
} catch (e2) {
|
|
473646
473754
|
const code = getErrnoCode2(e2);
|
|
473647
473755
|
if (code === "ENOENT") {
|
|
@@ -473654,7 +473762,7 @@ async function loadSessionMemoryTemplate() {
|
|
|
473654
473762
|
async function loadSessionMemoryPrompt() {
|
|
473655
473763
|
const promptPath = join85(getClaudeConfigHomeDir(), "session-memory", "config", "prompt.md");
|
|
473656
473764
|
try {
|
|
473657
|
-
return await
|
|
473765
|
+
return await readFile29(promptPath, { encoding: "utf-8" });
|
|
473658
473766
|
} catch (e2) {
|
|
473659
473767
|
const code = getErrnoCode2(e2);
|
|
473660
473768
|
if (code === "ENOENT") {
|
|
@@ -475315,7 +475423,7 @@ var init_toolSearch = __esm(() => {
|
|
|
475315
475423
|
|
|
475316
475424
|
// src/services/vcr.ts
|
|
475317
475425
|
import { createHash as createHash18, randomUUID as randomUUID20 } from "crypto";
|
|
475318
|
-
import { mkdir as mkdir25, readFile as
|
|
475426
|
+
import { mkdir as mkdir25, readFile as readFile30, writeFile as writeFile24 } from "fs/promises";
|
|
475319
475427
|
import { dirname as dirname36, join as join86 } from "path";
|
|
475320
475428
|
function shouldUseVCR() {
|
|
475321
475429
|
if (false) {}
|
|
@@ -475331,7 +475439,7 @@ async function withFixture(input, fixtureName, f) {
|
|
|
475331
475439
|
const hash = createHash18("sha1").update(jsonStringify(input)).digest("hex").slice(0, 12);
|
|
475332
475440
|
const filename = join86(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${fixtureName}-${hash}.json`);
|
|
475333
475441
|
try {
|
|
475334
|
-
const cached3 = jsonParse(await
|
|
475442
|
+
const cached3 = jsonParse(await readFile30(filename, { encoding: "utf8" }));
|
|
475335
475443
|
return cached3;
|
|
475336
475444
|
} catch (e2) {
|
|
475337
475445
|
const code = getErrnoCode2(e2);
|
|
@@ -475365,7 +475473,7 @@ async function withVCR(messages, f) {
|
|
|
475365
475473
|
const dehydratedInput = mapMessages(messagesForAPI.map((_) => _.message.content), dehydrateValue);
|
|
475366
475474
|
const filename = join86(process.env.CLAUDE_CODE_TEST_FIXTURES_ROOT ?? getCwd(), `fixtures/${dehydratedInput.map((_) => createHash18("sha1").update(jsonStringify(_)).digest("hex").slice(0, 6)).join("-")}.json`);
|
|
475367
475475
|
try {
|
|
475368
|
-
const cached3 = jsonParse(await
|
|
475476
|
+
const cached3 = jsonParse(await readFile30(filename, { encoding: "utf8" }));
|
|
475369
475477
|
cached3.output.forEach(addCachedCostToTotalSessionCost);
|
|
475370
475478
|
return cached3.output.map((message, index) => mapMessage(message, hydrateValue, index, randomUUID20()));
|
|
475371
475479
|
} catch (e2) {
|
|
@@ -475829,7 +475937,7 @@ var init_tokenEstimation = __esm(() => {
|
|
|
475829
475937
|
|
|
475830
475938
|
// src/utils/pdf.ts
|
|
475831
475939
|
import { randomUUID as randomUUID21 } from "crypto";
|
|
475832
|
-
import { mkdir as mkdir26, readdir as readdir15, readFile as
|
|
475940
|
+
import { mkdir as mkdir26, readdir as readdir15, readFile as readFile31 } from "fs/promises";
|
|
475833
475941
|
import { join as join87 } from "path";
|
|
475834
475942
|
async function readPDF(filePath) {
|
|
475835
475943
|
try {
|
|
@@ -475851,7 +475959,7 @@ async function readPDF(filePath) {
|
|
|
475851
475959
|
}
|
|
475852
475960
|
};
|
|
475853
475961
|
}
|
|
475854
|
-
const fileBuffer = await
|
|
475962
|
+
const fileBuffer = await readFile31(filePath);
|
|
475855
475963
|
const header = fileBuffer.subarray(0, 5).toString("ascii");
|
|
475856
475964
|
if (!header.startsWith("%PDF-")) {
|
|
475857
475965
|
return {
|
|
@@ -479714,7 +479822,7 @@ import {
|
|
|
479714
479822
|
chmod as chmod8,
|
|
479715
479823
|
lstat as lstat6,
|
|
479716
479824
|
readdir as readdir18,
|
|
479717
|
-
readFile as
|
|
479825
|
+
readFile as readFile32,
|
|
479718
479826
|
rename as rename3,
|
|
479719
479827
|
rm as rm5,
|
|
479720
479828
|
stat as stat35,
|
|
@@ -479859,7 +479967,7 @@ async function collectFilesForZip(baseDir, relativePath, files, visited) {
|
|
|
479859
479967
|
await collectFilesForZip(baseDir, relPath, files, visited);
|
|
479860
479968
|
} else if (fileStat.isFile()) {
|
|
479861
479969
|
try {
|
|
479862
|
-
const content = await
|
|
479970
|
+
const content = await readFile32(fullPath);
|
|
479863
479971
|
files[relPath] = [
|
|
479864
479972
|
new Uint8Array(content),
|
|
479865
479973
|
{ os: 3, attrs: (fileStat.mode & 65535) << 16 }
|
|
@@ -480379,7 +480487,7 @@ var init_officialMarketplace = __esm(() => {
|
|
|
480379
480487
|
});
|
|
480380
480488
|
|
|
480381
480489
|
// src/utils/plugins/officialMarketplaceGcs.ts
|
|
480382
|
-
import { chmod as chmod9, mkdir as mkdir27, readFile as
|
|
480490
|
+
import { chmod as chmod9, mkdir as mkdir27, readFile as readFile33, rename as rename4, rm as rm7, writeFile as writeFile27 } from "fs/promises";
|
|
480383
480491
|
import { dirname as dirname40, join as join92, resolve as resolve31, sep as sep22 } from "path";
|
|
480384
480492
|
async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCacheDir) {
|
|
480385
480493
|
const cacheDir = resolve31(marketplacesCacheDir);
|
|
@@ -480404,7 +480512,7 @@ async function fetchOfficialMarketplaceFromGcs(installLocation, marketplacesCach
|
|
|
480404
480512
|
throw new Error("latest pointer returned empty body");
|
|
480405
480513
|
}
|
|
480406
480514
|
const sentinelPath = join92(installLocation, ".gcs-sha");
|
|
480407
|
-
const currentSha = await
|
|
480515
|
+
const currentSha = await readFile33(sentinelPath, "utf8").then((s) => s.trim(), () => null);
|
|
480408
480516
|
if (currentSha === sha) {
|
|
480409
480517
|
outcome = "noop";
|
|
480410
480518
|
return sha;
|
|
@@ -482507,7 +482615,7 @@ var init_pluginInstallationHelpers = __esm(() => {
|
|
|
482507
482615
|
import {
|
|
482508
482616
|
copyFile as copyFile7,
|
|
482509
482617
|
readdir as readdir20,
|
|
482510
|
-
readFile as
|
|
482618
|
+
readFile as readFile34,
|
|
482511
482619
|
readlink as readlink2,
|
|
482512
482620
|
realpath as realpath11,
|
|
482513
482621
|
rename as rename6,
|
|
@@ -482913,7 +483021,7 @@ async function cachePlugin(source, options2) {
|
|
|
482913
483021
|
let manifest;
|
|
482914
483022
|
if (await pathExists2(manifestPath)) {
|
|
482915
483023
|
try {
|
|
482916
|
-
const content = await
|
|
483024
|
+
const content = await readFile34(manifestPath, { encoding: "utf-8" });
|
|
482917
483025
|
const parsed = jsonParse(content);
|
|
482918
483026
|
const result = PluginManifestSchema().safeParse(parsed);
|
|
482919
483027
|
if (result.success) {
|
|
@@ -482937,7 +483045,7 @@ async function cachePlugin(source, options2) {
|
|
|
482937
483045
|
}
|
|
482938
483046
|
} else if (await pathExists2(legacyManifestPath)) {
|
|
482939
483047
|
try {
|
|
482940
|
-
const content = await
|
|
483048
|
+
const content = await readFile34(legacyManifestPath, {
|
|
482941
483049
|
encoding: "utf-8"
|
|
482942
483050
|
});
|
|
482943
483051
|
const parsed = jsonParse(content);
|
|
@@ -482987,7 +483095,7 @@ async function loadPluginManifest(manifestPath, pluginName, source) {
|
|
|
482987
483095
|
};
|
|
482988
483096
|
}
|
|
482989
483097
|
try {
|
|
482990
|
-
const content = await
|
|
483098
|
+
const content = await readFile34(manifestPath, { encoding: "utf-8" });
|
|
482991
483099
|
const parsedJson = jsonParse(content);
|
|
482992
483100
|
const result = PluginManifestSchema().safeParse(parsedJson);
|
|
482993
483101
|
if (result.success) {
|
|
@@ -483013,7 +483121,7 @@ async function loadPluginHooks2(hooksConfigPath, pluginName) {
|
|
|
483013
483121
|
if (!await pathExists2(hooksConfigPath)) {
|
|
483014
483122
|
throw new Error(`Hooks file not found at ${hooksConfigPath} for plugin ${pluginName}. If the manifest declares hooks, the file must exist.`);
|
|
483015
483123
|
}
|
|
483016
|
-
const content = await
|
|
483124
|
+
const content = await readFile34(hooksConfigPath, { encoding: "utf-8" });
|
|
483017
483125
|
const rawHooksConfig = jsonParse(content);
|
|
483018
483126
|
const validatedPluginHooks = PluginHooksSchema().parse(rawHooksConfig);
|
|
483019
483127
|
return validatedPluginHooks.hooks;
|
|
@@ -483410,7 +483518,7 @@ function parsePluginSettings(raw) {
|
|
|
483410
483518
|
async function loadPluginSettings(pluginPath, manifest) {
|
|
483411
483519
|
const settingsJsonPath = join96(pluginPath, "settings.json");
|
|
483412
483520
|
try {
|
|
483413
|
-
const content = await
|
|
483521
|
+
const content = await readFile34(settingsJsonPath, { encoding: "utf-8" });
|
|
483414
483522
|
const parsed = jsonParse(content);
|
|
483415
483523
|
if (isRecord3(parsed)) {
|
|
483416
483524
|
const filtered = parsePluginSettings(parsed);
|
|
@@ -491800,7 +491908,7 @@ __export(exports_terminalSetup, {
|
|
|
491800
491908
|
call: () => call5
|
|
491801
491909
|
});
|
|
491802
491910
|
import { randomBytes as randomBytes14 } from "crypto";
|
|
491803
|
-
import { copyFile as copyFile8, mkdir as mkdir28, readFile as
|
|
491911
|
+
import { copyFile as copyFile8, mkdir as mkdir28, readFile as readFile35, writeFile as writeFile29 } from "fs/promises";
|
|
491804
491912
|
import { homedir as homedir28, platform as platform4 } from "os";
|
|
491805
491913
|
import { dirname as dirname46, join as join99 } from "path";
|
|
491806
491914
|
import { pathToFileURL as pathToFileURL7 } from "url";
|
|
@@ -491947,7 +492055,7 @@ async function installBindingsForVSCodeTerminal(editor = "VSCode", theme) {
|
|
|
491947
492055
|
let keybindings = [];
|
|
491948
492056
|
let fileExists = false;
|
|
491949
492057
|
try {
|
|
491950
|
-
content = await
|
|
492058
|
+
content = await readFile35(keybindingsPath, {
|
|
491951
492059
|
encoding: "utf-8"
|
|
491952
492060
|
});
|
|
491953
492061
|
fileExists = true;
|
|
@@ -492094,7 +492202,7 @@ chars = "\\u001B\\r"`;
|
|
|
492094
492202
|
let configExists = false;
|
|
492095
492203
|
for (const path17 of configPaths) {
|
|
492096
492204
|
try {
|
|
492097
|
-
configContent = await
|
|
492205
|
+
configContent = await readFile35(path17, {
|
|
492098
492206
|
encoding: "utf-8"
|
|
492099
492207
|
});
|
|
492100
492208
|
configPath = path17;
|
|
@@ -492156,7 +492264,7 @@ async function installBindingsForZed(theme) {
|
|
|
492156
492264
|
let keymapContent = "[]";
|
|
492157
492265
|
let fileExists = false;
|
|
492158
492266
|
try {
|
|
492159
|
-
keymapContent = await
|
|
492267
|
+
keymapContent = await readFile35(keymapPath, {
|
|
492160
492268
|
encoding: "utf-8"
|
|
492161
492269
|
});
|
|
492162
492270
|
fileExists = true;
|
|
@@ -492229,7 +492337,7 @@ var init_terminalSetup = __esm(() => {
|
|
|
492229
492337
|
|
|
492230
492338
|
// src/utils/pasteStore.ts
|
|
492231
492339
|
import { createHash as createHash20 } from "crypto";
|
|
492232
|
-
import { mkdir as mkdir29, readdir as readdir21, readFile as
|
|
492340
|
+
import { mkdir as mkdir29, readdir as readdir21, readFile as readFile36, stat as stat39, unlink as unlink15, writeFile as writeFile30 } from "fs/promises";
|
|
492233
492341
|
import { join as join100 } from "path";
|
|
492234
492342
|
function getPasteStoreDir() {
|
|
492235
492343
|
return join100(getClaudeConfigHomeDir(), PASTE_STORE_DIR);
|
|
@@ -492254,7 +492362,7 @@ async function storePastedText(hash, content) {
|
|
|
492254
492362
|
async function retrievePastedText(hash) {
|
|
492255
492363
|
try {
|
|
492256
492364
|
const pastePath = getPastePath(hash);
|
|
492257
|
-
return await
|
|
492365
|
+
return await readFile36(pastePath, { encoding: "utf8" });
|
|
492258
492366
|
} catch (error42) {
|
|
492259
492367
|
if (!isENOENT(error42)) {
|
|
492260
492368
|
logForDebugging(`Failed to retrieve paste ${hash}: ${error42}`);
|
|
@@ -496107,7 +496215,7 @@ var init_issue = __esm(() => {
|
|
|
496107
496215
|
});
|
|
496108
496216
|
|
|
496109
496217
|
// src/components/Feedback.tsx
|
|
496110
|
-
import { readFile as
|
|
496218
|
+
import { readFile as readFile37, stat as stat40 } from "fs/promises";
|
|
496111
496219
|
function redactSensitiveInfo(text) {
|
|
496112
496220
|
let redacted = text;
|
|
496113
496221
|
redacted = redacted.replace(/"(sk-ant[^\s"']{24,})"/g, '"[REDACTED_API_KEY]"');
|
|
@@ -496146,7 +496254,7 @@ async function loadRawTranscriptJsonl() {
|
|
|
496146
496254
|
});
|
|
496147
496255
|
return null;
|
|
496148
496256
|
}
|
|
496149
|
-
return await
|
|
496257
|
+
return await readFile37(transcriptPath, "utf-8");
|
|
496150
496258
|
} catch {
|
|
496151
496259
|
return null;
|
|
496152
496260
|
}
|
|
@@ -499830,7 +499938,7 @@ function buildPrimarySection() {
|
|
|
499830
499938
|
}, undefined, false, undefined, this);
|
|
499831
499939
|
return [{
|
|
499832
499940
|
label: "Version",
|
|
499833
|
-
value: "0.14.
|
|
499941
|
+
value: "0.14.9"
|
|
499834
499942
|
}, {
|
|
499835
499943
|
label: "Session name",
|
|
499836
499944
|
value: nameValue
|
|
@@ -514725,7 +514833,7 @@ function getReleaseTagUrl(version2 = publicBuildVersion) {
|
|
|
514725
514833
|
return `${OPENCLAUDE_RELEASES_URL}/tag/v${normalizePublicVersion(version2)}`;
|
|
514726
514834
|
}
|
|
514727
514835
|
function getPublicBuildVersion() {
|
|
514728
|
-
return "0.14.
|
|
514836
|
+
return "0.14.9";
|
|
514729
514837
|
}
|
|
514730
514838
|
var import_semver9, OPENCLAUDE_RELEASES_URL = "https://github.com/AndersonBY/openclaude/releases", fallbackBuildVersion, publicBuildVersion;
|
|
514731
514839
|
var init_version = __esm(() => {
|
|
@@ -527513,7 +527621,7 @@ var init_AddMarketplace = __esm(() => {
|
|
|
527513
527621
|
|
|
527514
527622
|
// src/utils/plugins/installCounts.ts
|
|
527515
527623
|
import { randomBytes as randomBytes15 } from "crypto";
|
|
527516
|
-
import { readFile as
|
|
527624
|
+
import { readFile as readFile38, rename as rename7, unlink as unlink16, writeFile as writeFile35 } from "fs/promises";
|
|
527517
527625
|
import { join as join118 } from "path";
|
|
527518
527626
|
function getInstallCountsCachePath() {
|
|
527519
527627
|
return join118(getPluginsDirectory(), INSTALL_COUNTS_CACHE_FILENAME);
|
|
@@ -527521,7 +527629,7 @@ function getInstallCountsCachePath() {
|
|
|
527521
527629
|
async function loadInstallCountsCache() {
|
|
527522
527630
|
const cachePath = getInstallCountsCachePath();
|
|
527523
527631
|
try {
|
|
527524
|
-
const content = await
|
|
527632
|
+
const content = await readFile38(cachePath, { encoding: "utf-8" });
|
|
527525
527633
|
const parsed = jsonParse(content);
|
|
527526
527634
|
if (typeof parsed !== "object" || parsed === null || !("version" in parsed) || !("fetchedAt" in parsed) || !("counts" in parsed)) {
|
|
527527
527635
|
logForDebugging("Install counts cache has invalid structure");
|
|
@@ -531401,7 +531509,7 @@ var init_ManageMarketplaces = __esm(() => {
|
|
|
531401
531509
|
|
|
531402
531510
|
// src/utils/plugins/pluginFlagging.ts
|
|
531403
531511
|
import { randomBytes as randomBytes16 } from "crypto";
|
|
531404
|
-
import { readFile as
|
|
531512
|
+
import { readFile as readFile39, rename as rename8, unlink as unlink17, writeFile as writeFile36 } from "fs/promises";
|
|
531405
531513
|
import { join as join119 } from "path";
|
|
531406
531514
|
function getFlaggedPluginsPath() {
|
|
531407
531515
|
return join119(getPluginsDirectory(), FLAGGED_PLUGINS_FILENAME);
|
|
@@ -531428,7 +531536,7 @@ function parsePluginsData(content) {
|
|
|
531428
531536
|
}
|
|
531429
531537
|
async function readFromDisk() {
|
|
531430
531538
|
try {
|
|
531431
|
-
const content = await
|
|
531539
|
+
const content = await readFile39(getFlaggedPluginsPath(), {
|
|
531432
531540
|
encoding: "utf-8"
|
|
531433
531541
|
});
|
|
531434
531542
|
return parsePluginsData(content);
|
|
@@ -534697,7 +534805,7 @@ function parsePluginArgs(args) {
|
|
|
534697
534805
|
}
|
|
534698
534806
|
|
|
534699
534807
|
// src/utils/plugins/validatePlugin.ts
|
|
534700
|
-
import { readdir as readdir25, readFile as
|
|
534808
|
+
import { readdir as readdir25, readFile as readFile41, stat as stat43 } from "fs/promises";
|
|
534701
534809
|
import * as path20 from "path";
|
|
534702
534810
|
function detectManifestType(filePath) {
|
|
534703
534811
|
const fileName = path20.basename(filePath);
|
|
@@ -534737,7 +534845,7 @@ async function validatePluginManifest(filePath) {
|
|
|
534737
534845
|
const absolutePath = path20.resolve(filePath);
|
|
534738
534846
|
let content;
|
|
534739
534847
|
try {
|
|
534740
|
-
content = await
|
|
534848
|
+
content = await readFile41(absolutePath, { encoding: "utf-8" });
|
|
534741
534849
|
} catch (error42) {
|
|
534742
534850
|
const code = getErrnoCode2(error42);
|
|
534743
534851
|
let message;
|
|
@@ -534861,7 +534969,7 @@ async function validateMarketplaceManifest(filePath) {
|
|
|
534861
534969
|
const absolutePath = path20.resolve(filePath);
|
|
534862
534970
|
let content;
|
|
534863
534971
|
try {
|
|
534864
|
-
content = await
|
|
534972
|
+
content = await readFile41(absolutePath, { encoding: "utf-8" });
|
|
534865
534973
|
} catch (error42) {
|
|
534866
534974
|
const code = getErrnoCode2(error42);
|
|
534867
534975
|
let message;
|
|
@@ -534947,7 +535055,7 @@ async function validateMarketplaceManifest(filePath) {
|
|
|
534947
535055
|
const pluginJsonPath = path20.join(marketplaceRoot, entry.source, ".claude-plugin", "plugin.json");
|
|
534948
535056
|
let manifestVersion;
|
|
534949
535057
|
try {
|
|
534950
|
-
const raw = await
|
|
535058
|
+
const raw = await readFile41(pluginJsonPath, { encoding: "utf-8" });
|
|
534951
535059
|
const parsed2 = jsonParse(raw);
|
|
534952
535060
|
if (typeof parsed2.version === "string") {
|
|
534953
535061
|
manifestVersion = parsed2.version;
|
|
@@ -535064,7 +535172,7 @@ function validateComponentFile(filePath, content, fileType) {
|
|
|
535064
535172
|
async function validateHooksJson(filePath) {
|
|
535065
535173
|
let content;
|
|
535066
535174
|
try {
|
|
535067
|
-
content = await
|
|
535175
|
+
content = await readFile41(filePath, { encoding: "utf-8" });
|
|
535068
535176
|
} catch (e2) {
|
|
535069
535177
|
const code = getErrnoCode2(e2);
|
|
535070
535178
|
if (code === "ENOENT") {
|
|
@@ -535157,7 +535265,7 @@ async function validatePluginContents(pluginDir) {
|
|
|
535157
535265
|
for (const filePath of files) {
|
|
535158
535266
|
let content;
|
|
535159
535267
|
try {
|
|
535160
|
-
content = await
|
|
535268
|
+
content = await readFile41(filePath, { encoding: "utf-8" });
|
|
535161
535269
|
} catch (e2) {
|
|
535162
535270
|
if (isENOENT(e2))
|
|
535163
535271
|
continue;
|
|
@@ -535226,7 +535334,7 @@ async function validateManifest2(filePath) {
|
|
|
535226
535334
|
return validateMarketplaceManifest(filePath);
|
|
535227
535335
|
case "unknown": {
|
|
535228
535336
|
try {
|
|
535229
|
-
const content = await
|
|
535337
|
+
const content = await readFile41(absolutePath, { encoding: "utf-8" });
|
|
535230
535338
|
const parsed = jsonParse(content);
|
|
535231
535339
|
if (Array.isArray(parsed.plugins)) {
|
|
535232
535340
|
return validateMarketplaceManifest(filePath);
|
|
@@ -541502,7 +541610,7 @@ ${args ? "Additional user input: " + args : ""}
|
|
|
541502
541610
|
});
|
|
541503
541611
|
|
|
541504
541612
|
// src/utils/releaseNotes.ts
|
|
541505
|
-
import { mkdir as mkdir34, readFile as
|
|
541613
|
+
import { mkdir as mkdir34, readFile as readFile42, writeFile as writeFile37 } from "fs/promises";
|
|
541506
541614
|
import { dirname as dirname54, join as join122 } from "path";
|
|
541507
541615
|
function getChangelogCachePath() {
|
|
541508
541616
|
return join122(getClaudeConfigHomeDir(), "cache", "changelog.md");
|
|
@@ -541653,7 +541761,7 @@ async function getStoredChangelog() {
|
|
|
541653
541761
|
}
|
|
541654
541762
|
const cachePath = getChangelogCachePath();
|
|
541655
541763
|
try {
|
|
541656
|
-
const content = await
|
|
541764
|
+
const content = await readFile42(cachePath, "utf-8");
|
|
541657
541765
|
changelogMemoryCache = content;
|
|
541658
541766
|
return content;
|
|
541659
541767
|
} catch {
|
|
@@ -556498,7 +556606,7 @@ __export(exports_thinkback, {
|
|
|
556498
556606
|
playAnimation: () => playAnimation,
|
|
556499
556607
|
call: () => call49
|
|
556500
556608
|
});
|
|
556501
|
-
import { readFile as
|
|
556609
|
+
import { readFile as readFile43 } from "fs/promises";
|
|
556502
556610
|
import { join as join123 } from "path";
|
|
556503
556611
|
function getMarketplaceName() {
|
|
556504
556612
|
return OFFICIAL_MARKETPLACE_NAME;
|
|
@@ -556527,7 +556635,7 @@ async function playAnimation(skillDir) {
|
|
|
556527
556635
|
const dataPath = join123(skillDir, "year_in_review.js");
|
|
556528
556636
|
const playerPath = join123(skillDir, "player.js");
|
|
556529
556637
|
try {
|
|
556530
|
-
await
|
|
556638
|
+
await readFile43(dataPath);
|
|
556531
556639
|
} catch (e2) {
|
|
556532
556640
|
if (isENOENT(e2)) {
|
|
556533
556641
|
return {
|
|
@@ -556542,7 +556650,7 @@ async function playAnimation(skillDir) {
|
|
|
556542
556650
|
};
|
|
556543
556651
|
}
|
|
556544
556652
|
try {
|
|
556545
|
-
await
|
|
556653
|
+
await readFile43(playerPath);
|
|
556546
556654
|
} catch (e2) {
|
|
556547
556655
|
if (isENOENT(e2)) {
|
|
556548
556656
|
return {
|
|
@@ -564681,7 +564789,7 @@ __export(exports_branch, {
|
|
|
564681
564789
|
call: () => call59
|
|
564682
564790
|
});
|
|
564683
564791
|
import { randomUUID as randomUUID26 } from "crypto";
|
|
564684
|
-
import { mkdir as mkdir35, readFile as
|
|
564792
|
+
import { mkdir as mkdir35, readFile as readFile44, writeFile as writeFile38 } from "fs/promises";
|
|
564685
564793
|
function deriveFirstPrompt(firstUserMessage) {
|
|
564686
564794
|
const content = firstUserMessage?.message?.content;
|
|
564687
564795
|
if (!content)
|
|
@@ -564700,7 +564808,7 @@ async function createFork(customTitle) {
|
|
|
564700
564808
|
await mkdir35(projectDir, { recursive: true, mode: 448 });
|
|
564701
564809
|
let transcriptContent;
|
|
564702
564810
|
try {
|
|
564703
|
-
transcriptContent = await
|
|
564811
|
+
transcriptContent = await readFile44(currentTranscriptPath);
|
|
564704
564812
|
} catch {
|
|
564705
564813
|
throw new Error("No conversation to branch");
|
|
564706
564814
|
}
|
|
@@ -571062,7 +571170,7 @@ var init_rewind = __esm(() => {
|
|
|
571062
571170
|
|
|
571063
571171
|
// src/utils/heapDumpService.ts
|
|
571064
571172
|
import { createWriteStream as createWriteStream3, writeFileSync as writeFileSync6 } from "fs";
|
|
571065
|
-
import { readdir as readdir26, readFile as
|
|
571173
|
+
import { readdir as readdir26, readFile as readFile45, writeFile as writeFile39 } from "fs/promises";
|
|
571066
571174
|
import { join as join127 } from "path";
|
|
571067
571175
|
import { pipeline as pipeline2 } from "stream/promises";
|
|
571068
571176
|
import {
|
|
@@ -571087,7 +571195,7 @@ async function captureMemoryDiagnostics(trigger, dumpNumber = 0) {
|
|
|
571087
571195
|
} catch {}
|
|
571088
571196
|
let smapsRollup;
|
|
571089
571197
|
try {
|
|
571090
|
-
smapsRollup = await
|
|
571198
|
+
smapsRollup = await readFile45("/proc/self/smaps_rollup", "utf8");
|
|
571091
571199
|
} catch {}
|
|
571092
571200
|
const nativeMemory = usage.rss - usage.heapUsed;
|
|
571093
571201
|
const bytesPerSecond = uptimeSeconds > 0 ? usage.rss / uptimeSeconds : 0;
|
|
@@ -571738,7 +571846,7 @@ var init_bridge_kick = __esm(() => {
|
|
|
571738
571846
|
var call66 = async () => {
|
|
571739
571847
|
return {
|
|
571740
571848
|
type: "text",
|
|
571741
|
-
value: `${"99.0.0"} (built ${"2026-05-26T10:
|
|
571849
|
+
value: `${"99.0.0"} (built ${"2026-05-26T10:36:27.285Z"})`
|
|
571742
571850
|
};
|
|
571743
571851
|
}, version2, version_default;
|
|
571744
571852
|
var init_version2 = __esm(() => {
|
|
@@ -571890,7 +571998,7 @@ var init_init2 = __esm(() => {
|
|
|
571890
571998
|
});
|
|
571891
571999
|
|
|
571892
572000
|
// src/services/wiki/indexBuilder.ts
|
|
571893
|
-
import { readdir as readdir27, readFile as
|
|
572001
|
+
import { readdir as readdir27, readFile as readFile46, writeFile as writeFile41 } from "fs/promises";
|
|
571894
572002
|
import { basename as basename42, relative as relative29 } from "path";
|
|
571895
572003
|
async function listMarkdownFiles(dir) {
|
|
571896
572004
|
const entries = await readdir27(dir, { withFileTypes: true });
|
|
@@ -571906,7 +572014,7 @@ async function listMarkdownFiles(dir) {
|
|
|
571906
572014
|
return files2.sort();
|
|
571907
572015
|
}
|
|
571908
572016
|
async function getPageTitle(path21) {
|
|
571909
|
-
const content = await
|
|
572017
|
+
const content = await readFile46(path21, "utf8");
|
|
571910
572018
|
const titleLine = content.split(`
|
|
571911
572019
|
`).map((line) => line.trim()).find((line) => line.startsWith("# "));
|
|
571912
572020
|
return titleLine ? titleLine.replace(/^#\s+/, "") : basename42(path21, ".md");
|
|
@@ -571973,7 +572081,7 @@ function extractTitleFromText(fallbackName, content) {
|
|
|
571973
572081
|
}
|
|
571974
572082
|
|
|
571975
572083
|
// src/services/wiki/ingest.ts
|
|
571976
|
-
import { appendFile as appendFile5, readFile as
|
|
572084
|
+
import { appendFile as appendFile5, readFile as readFile47, stat as stat44, writeFile as writeFile42 } from "fs/promises";
|
|
571977
572085
|
import { basename as basename43, extname as extname16, isAbsolute as isAbsolute24, relative as relative30, resolve as resolve40 } from "path";
|
|
571978
572086
|
function buildSourceNote(params) {
|
|
571979
572087
|
const { title, sourcePath, ingestedAt, summary, excerpt } = params;
|
|
@@ -572009,7 +572117,7 @@ async function ingestLocalWikiSource(cwd2, rawPath) {
|
|
|
572009
572117
|
if (!fileInfo.isFile()) {
|
|
572010
572118
|
throw new Error(`Not a file: ${resolvedPath}`);
|
|
572011
572119
|
}
|
|
572012
|
-
const content = await
|
|
572120
|
+
const content = await readFile47(resolvedPath, "utf8");
|
|
572013
572121
|
const relSourcePath = relative30(cwd2, resolvedPath).replace(/\\/g, "/");
|
|
572014
572122
|
const ingestedAt = new Date().toISOString();
|
|
572015
572123
|
const baseName = basename43(resolvedPath, extname16(resolvedPath));
|
|
@@ -573552,7 +573660,7 @@ var init_setupPortable = __esm(() => {
|
|
|
573552
573660
|
});
|
|
573553
573661
|
|
|
573554
573662
|
// src/utils/claudeInChrome/setup.ts
|
|
573555
|
-
import { chmod as chmod10, mkdir as mkdir38, readFile as
|
|
573663
|
+
import { chmod as chmod10, mkdir as mkdir38, readFile as readFile48, writeFile as writeFile43 } from "fs/promises";
|
|
573556
573664
|
import { homedir as homedir31 } from "os";
|
|
573557
573665
|
import { join as join130 } from "path";
|
|
573558
573666
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
@@ -573661,7 +573769,7 @@ async function installChromeNativeHostManifest(manifestBinaryPath) {
|
|
|
573661
573769
|
let anyManifestUpdated = false;
|
|
573662
573770
|
for (const manifestDir of manifestDirs) {
|
|
573663
573771
|
const manifestPath = join130(manifestDir, NATIVE_HOST_MANIFEST_NAME);
|
|
573664
|
-
const existingContent = await
|
|
573772
|
+
const existingContent = await readFile48(manifestPath, "utf-8").catch(() => null);
|
|
573665
573773
|
if (existingContent === manifestContent) {
|
|
573666
573774
|
continue;
|
|
573667
573775
|
}
|
|
@@ -573724,7 +573832,7 @@ ${command9}
|
|
|
573724
573832
|
# Generated by Claude Code - do not edit manually
|
|
573725
573833
|
exec ${command9}
|
|
573726
573834
|
`;
|
|
573727
|
-
const existingContent = await
|
|
573835
|
+
const existingContent = await readFile48(wrapperPath, "utf-8").catch(() => null);
|
|
573728
573836
|
if (existingContent === scriptContent) {
|
|
573729
573837
|
return wrapperPath;
|
|
573730
573838
|
}
|
|
@@ -581488,7 +581596,7 @@ __export(exports_insights, {
|
|
|
581488
581596
|
import {
|
|
581489
581597
|
mkdir as mkdir41,
|
|
581490
581598
|
readdir as readdir30,
|
|
581491
|
-
readFile as
|
|
581599
|
+
readFile as readFile49,
|
|
581492
581600
|
unlink as unlink20,
|
|
581493
581601
|
writeFile as writeFile45
|
|
581494
581602
|
} from "fs/promises";
|
|
@@ -581853,7 +581961,7 @@ async function formatTranscriptWithSummarization(log) {
|
|
|
581853
581961
|
async function loadCachedFacets(sessionId) {
|
|
581854
581962
|
const facetPath = join136(getFacetsDir(), `${sessionId}.json`);
|
|
581855
581963
|
try {
|
|
581856
|
-
const content = await
|
|
581964
|
+
const content = await readFile49(facetPath, { encoding: "utf-8" });
|
|
581857
581965
|
const parsed = jsonParse(content);
|
|
581858
581966
|
if (!isValidSessionFacets(parsed)) {
|
|
581859
581967
|
try {
|
|
@@ -581879,7 +581987,7 @@ async function saveFacets(facets) {
|
|
|
581879
581987
|
async function loadCachedSessionMeta(sessionId) {
|
|
581880
581988
|
const metaPath = join136(getSessionMetaDir(), `${sessionId}.json`);
|
|
581881
581989
|
try {
|
|
581882
|
-
const content = await
|
|
581990
|
+
const content = await readFile49(metaPath, { encoding: "utf-8" });
|
|
581883
581991
|
return jsonParse(content);
|
|
581884
581992
|
} catch {
|
|
581885
581993
|
return null;
|
|
@@ -584108,7 +584216,7 @@ import {
|
|
|
584108
584216
|
open as fsOpen2,
|
|
584109
584217
|
mkdir as mkdir42,
|
|
584110
584218
|
readdir as readdir31,
|
|
584111
|
-
readFile as
|
|
584219
|
+
readFile as readFile50,
|
|
584112
584220
|
stat as stat46,
|
|
584113
584221
|
unlink as unlink21,
|
|
584114
584222
|
writeFile as writeFile46
|
|
@@ -584161,7 +584269,7 @@ async function writeAgentMetadata(agentId, metadata) {
|
|
|
584161
584269
|
async function readAgentMetadata(agentId) {
|
|
584162
584270
|
const path21 = getAgentMetadataPath(agentId);
|
|
584163
584271
|
try {
|
|
584164
|
-
const raw = await
|
|
584272
|
+
const raw = await readFile50(path21, "utf-8");
|
|
584165
584273
|
return JSON.parse(raw);
|
|
584166
584274
|
} catch (e2) {
|
|
584167
584275
|
if (isFsInaccessible(e2))
|
|
@@ -584184,7 +584292,7 @@ async function writeRemoteAgentMetadata(taskId, metadata) {
|
|
|
584184
584292
|
async function readRemoteAgentMetadata(taskId) {
|
|
584185
584293
|
const path21 = getRemoteAgentMetadataPath(taskId);
|
|
584186
584294
|
try {
|
|
584187
|
-
const raw = await
|
|
584295
|
+
const raw = await readFile50(path21, "utf-8");
|
|
584188
584296
|
return JSON.parse(raw);
|
|
584189
584297
|
} catch (e2) {
|
|
584190
584298
|
if (isFsInaccessible(e2))
|
|
@@ -584217,7 +584325,7 @@ async function listRemoteAgentMetadata() {
|
|
|
584217
584325
|
if (!entry.isFile() || !entry.name.endsWith(".meta.json"))
|
|
584218
584326
|
continue;
|
|
584219
584327
|
try {
|
|
584220
|
-
const raw = await
|
|
584328
|
+
const raw = await readFile50(join137(dir, entry.name), "utf-8");
|
|
584221
584329
|
results.push(JSON.parse(raw));
|
|
584222
584330
|
} catch (e2) {
|
|
584223
584331
|
logForDebugging(`listRemoteAgentMetadata: skipping ${entry.name}: ${String(e2)}`);
|
|
@@ -584559,7 +584667,7 @@ class Project {
|
|
|
584559
584667
|
logForDebugging(`Skipping tombstone removal: session file too large (${formatFileSize(fileSize)})`, { level: "warn" });
|
|
584560
584668
|
return;
|
|
584561
584669
|
}
|
|
584562
|
-
const content = await
|
|
584670
|
+
const content = await readFile50(this.sessionFile, { encoding: "utf-8" });
|
|
584563
584671
|
const lines = content.split(`
|
|
584564
584672
|
`).filter((line) => {
|
|
584565
584673
|
if (!line.trim())
|
|
@@ -585580,7 +585688,7 @@ async function loadTranscriptFromFile(filePath) {
|
|
|
585580
585688
|
worktreeSession: worktreeStates.has(sessionId) ? worktreeStates.get(sessionId) : undefined
|
|
585581
585689
|
};
|
|
585582
585690
|
}
|
|
585583
|
-
const content = await
|
|
585691
|
+
const content = await readFile50(filePath, { encoding: "utf-8" });
|
|
585584
585692
|
let parsed;
|
|
585585
585693
|
try {
|
|
585586
585694
|
parsed = jsonParse(content);
|
|
@@ -586242,7 +586350,7 @@ async function loadTranscriptFile(filePath, opts) {
|
|
|
586242
586350
|
}
|
|
586243
586351
|
}
|
|
586244
586352
|
}
|
|
586245
|
-
buf ??= await
|
|
586353
|
+
buf ??= await readFile50(filePath);
|
|
586246
586354
|
if (!opts?.keepAllLeaves && !hasPreservedSegment && !isEnvTruthy(process.env.CLAUDE_CODE_DISABLE_PRECOMPACT_SKIP) && buf.length > SKIP_PRECOMPACT_THRESHOLD) {
|
|
586247
586355
|
buf = walkChainBeforeParse(buf);
|
|
586248
586356
|
}
|
|
@@ -593943,7 +594051,7 @@ import {
|
|
|
593943
594051
|
copyFile as copyFile9,
|
|
593944
594052
|
mkdir as mkdir44,
|
|
593945
594053
|
readdir as readdir32,
|
|
593946
|
-
readFile as
|
|
594054
|
+
readFile as readFile51,
|
|
593947
594055
|
stat as stat49,
|
|
593948
594056
|
symlink as symlink5,
|
|
593949
594057
|
utimes as utimes2
|
|
@@ -594123,7 +594231,7 @@ async function getOrCreateWorktree(repoRoot, slug, options2) {
|
|
|
594123
594231
|
async function copyWorktreeIncludeFiles(repoRoot, worktreePath) {
|
|
594124
594232
|
let includeContent;
|
|
594125
594233
|
try {
|
|
594126
|
-
includeContent = await
|
|
594234
|
+
includeContent = await readFile51(join142(repoRoot, ".worktreeinclude"), "utf-8");
|
|
594127
594235
|
} catch {
|
|
594128
594236
|
return [];
|
|
594129
594237
|
}
|
|
@@ -599693,7 +599801,7 @@ __export(exports_upstreamproxy, {
|
|
|
599693
599801
|
getUpstreamProxyEnv: () => getUpstreamProxyEnv,
|
|
599694
599802
|
SESSION_TOKEN_PATH: () => SESSION_TOKEN_PATH
|
|
599695
599803
|
});
|
|
599696
|
-
import { mkdir as mkdir45, readFile as
|
|
599804
|
+
import { mkdir as mkdir45, readFile as readFile52, unlink as unlink23, writeFile as writeFile47 } from "fs/promises";
|
|
599697
599805
|
import { homedir as homedir33 } from "os";
|
|
599698
599806
|
import { join as join143 } from "path";
|
|
599699
599807
|
async function initUpstreamProxy(opts) {
|
|
@@ -599780,7 +599888,7 @@ function isValidPemContent(content) {
|
|
|
599780
599888
|
}
|
|
599781
599889
|
async function readToken(path21) {
|
|
599782
599890
|
try {
|
|
599783
|
-
const raw = await
|
|
599891
|
+
const raw = await readFile52(path21, "utf8");
|
|
599784
599892
|
return raw.trim() || null;
|
|
599785
599893
|
} catch (err2) {
|
|
599786
599894
|
if (isENOENT(err2))
|
|
@@ -599833,7 +599941,7 @@ async function downloadCaBundle(baseUrl, systemCaPath, outPath) {
|
|
|
599833
599941
|
logForDebugging(`[upstreamproxy] ca-cert response is not valid PEM; proxy disabled`, { level: "warn" });
|
|
599834
599942
|
return false;
|
|
599835
599943
|
}
|
|
599836
|
-
const systemCa = await
|
|
599944
|
+
const systemCa = await readFile52(systemCaPath, "utf8").catch(() => "");
|
|
599837
599945
|
await mkdir45(join143(outPath, ".."), { recursive: true });
|
|
599838
599946
|
await writeFile47(outPath, systemCa + `
|
|
599839
599947
|
` + ccrCa, "utf8");
|
|
@@ -604196,7 +604304,7 @@ function printStartupScreen(modelOverride) {
|
|
|
604196
604304
|
const sLen = ` ● ${sL} Ready — type /help to begin`.length;
|
|
604197
604305
|
out.push(boxRow(sRow, W2, sLen, BORDER));
|
|
604198
604306
|
out.push(`${ansiRgb(...BORDER)}╚${"═".repeat(W2 - 2)}╝${RESET2}`);
|
|
604199
|
-
out.push(` ${DIM2}${ansiRgb(...DIMCOL)}openclaude ${RESET2}${ansiRgb(...ACCENT)}v${"0.14.
|
|
604307
|
+
out.push(` ${DIM2}${ansiRgb(...DIMCOL)}openclaude ${RESET2}${ansiRgb(...ACCENT)}v${"0.14.9"}${RESET2}`);
|
|
604200
604308
|
out.push("");
|
|
604201
604309
|
process.stdout.write(out.join(`
|
|
604202
604310
|
`) + `
|
|
@@ -650173,7 +650281,7 @@ var init_cronJitterConfig = __esm(() => {
|
|
|
650173
650281
|
});
|
|
650174
650282
|
|
|
650175
650283
|
// src/utils/cronTasksLock.ts
|
|
650176
|
-
import { mkdir as mkdir48, readFile as
|
|
650284
|
+
import { mkdir as mkdir48, readFile as readFile53, unlink as unlink26, writeFile as writeFile50 } from "fs/promises";
|
|
650177
650285
|
import { dirname as dirname64, join as join155 } from "path";
|
|
650178
650286
|
function getLockPath(dir) {
|
|
650179
650287
|
return join155(dir ?? getProjectRoot(), LOCK_FILE_REL);
|
|
@@ -650181,7 +650289,7 @@ function getLockPath(dir) {
|
|
|
650181
650289
|
async function readLock(dir) {
|
|
650182
650290
|
let raw;
|
|
650183
650291
|
try {
|
|
650184
|
-
raw = await
|
|
650292
|
+
raw = await readFile53(getLockPath(dir), "utf8");
|
|
650185
650293
|
} catch {
|
|
650186
650294
|
return;
|
|
650187
650295
|
}
|
|
@@ -655507,7 +655615,7 @@ function WelcomeV2() {
|
|
|
655507
655615
|
dimColor: true,
|
|
655508
655616
|
children: [
|
|
655509
655617
|
"v",
|
|
655510
|
-
"0.14.
|
|
655618
|
+
"0.14.9",
|
|
655511
655619
|
" "
|
|
655512
655620
|
]
|
|
655513
655621
|
}, undefined, true, undefined, this)
|
|
@@ -655707,7 +655815,7 @@ function WelcomeV2() {
|
|
|
655707
655815
|
dimColor: true,
|
|
655708
655816
|
children: [
|
|
655709
655817
|
"v",
|
|
655710
|
-
"0.14.
|
|
655818
|
+
"0.14.9",
|
|
655711
655819
|
" "
|
|
655712
655820
|
]
|
|
655713
655821
|
}, undefined, true, undefined, this)
|
|
@@ -655933,7 +656041,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
655933
656041
|
dimColor: true,
|
|
655934
656042
|
children: [
|
|
655935
656043
|
"v",
|
|
655936
|
-
"0.14.
|
|
656044
|
+
"0.14.9",
|
|
655937
656045
|
" "
|
|
655938
656046
|
]
|
|
655939
656047
|
}, undefined, true, undefined, this);
|
|
@@ -656187,7 +656295,7 @@ function AppleTerminalWelcomeV2(t0) {
|
|
|
656187
656295
|
dimColor: true,
|
|
656188
656296
|
children: [
|
|
656189
656297
|
"v",
|
|
656190
|
-
"0.14.
|
|
656298
|
+
"0.14.9",
|
|
656191
656299
|
" "
|
|
656192
656300
|
]
|
|
656193
656301
|
}, undefined, true, undefined, this);
|
|
@@ -663231,7 +663339,7 @@ __export(exports_claudeDesktop, {
|
|
|
663231
663339
|
readClaudeDesktopMcpServers: () => readClaudeDesktopMcpServers,
|
|
663232
663340
|
getClaudeDesktopConfigPath: () => getClaudeDesktopConfigPath
|
|
663233
663341
|
});
|
|
663234
|
-
import { readdir as readdir34, readFile as
|
|
663342
|
+
import { readdir as readdir34, readFile as readFile54, stat as stat55 } from "fs/promises";
|
|
663235
663343
|
import { homedir as homedir41 } from "os";
|
|
663236
663344
|
import { join as join159 } from "path";
|
|
663237
663345
|
async function getClaudeDesktopConfigPath() {
|
|
@@ -663279,7 +663387,7 @@ async function readClaudeDesktopMcpServers() {
|
|
|
663279
663387
|
const configPath = await getClaudeDesktopConfigPath();
|
|
663280
663388
|
let configContent;
|
|
663281
663389
|
try {
|
|
663282
|
-
configContent = await
|
|
663390
|
+
configContent = await readFile54(configPath, { encoding: "utf8" });
|
|
663283
663391
|
} catch (e2) {
|
|
663284
663392
|
const code = getErrnoCode2(e2);
|
|
663285
663393
|
if (code === "ENOENT") {
|
|
@@ -666629,11 +666737,11 @@ var init_sessionUrl = __esm(() => {
|
|
|
666629
666737
|
});
|
|
666630
666738
|
|
|
666631
666739
|
// src/utils/plugins/zipCacheAdapters.ts
|
|
666632
|
-
import { readFile as
|
|
666740
|
+
import { readFile as readFile55 } from "fs/promises";
|
|
666633
666741
|
import { join as join161 } from "path";
|
|
666634
666742
|
async function readZipCacheKnownMarketplaces() {
|
|
666635
666743
|
try {
|
|
666636
|
-
const content = await
|
|
666744
|
+
const content = await readFile55(getZipCacheKnownMarketplacesPath(), "utf-8");
|
|
666637
666745
|
const parsed = KnownMarketplacesFileSchema().safeParse(jsonParse(content));
|
|
666638
666746
|
if (!parsed.success) {
|
|
666639
666747
|
logForDebugging(`Invalid known_marketplaces.json in zip cache: ${parsed.error.message}`, { level: "error" });
|
|
@@ -666666,7 +666774,7 @@ async function readMarketplaceJsonContent(dir) {
|
|
|
666666
666774
|
];
|
|
666667
666775
|
for (const candidate of candidates) {
|
|
666668
666776
|
try {
|
|
666669
|
-
return await
|
|
666777
|
+
return await readFile55(candidate, "utf-8");
|
|
666670
666778
|
} catch {}
|
|
666671
666779
|
}
|
|
666672
666780
|
return null;
|
|
@@ -667119,7 +667227,7 @@ __export(exports_bridgePointer, {
|
|
|
667119
667227
|
clearBridgePointer: () => clearBridgePointer,
|
|
667120
667228
|
BRIDGE_POINTER_TTL_MS: () => BRIDGE_POINTER_TTL_MS
|
|
667121
667229
|
});
|
|
667122
|
-
import { mkdir as mkdir50, readFile as
|
|
667230
|
+
import { mkdir as mkdir50, readFile as readFile56, stat as stat57, unlink as unlink27, writeFile as writeFile54 } from "fs/promises";
|
|
667123
667231
|
import { dirname as dirname68, join as join162 } from "path";
|
|
667124
667232
|
function getBridgePointerPath(dir) {
|
|
667125
667233
|
return join162(getProjectsDir(), sanitizePath2(dir), "bridge-pointer.json");
|
|
@@ -667140,7 +667248,7 @@ async function readBridgePointer(dir) {
|
|
|
667140
667248
|
let mtimeMs;
|
|
667141
667249
|
try {
|
|
667142
667250
|
mtimeMs = (await stat57(path24)).mtimeMs;
|
|
667143
|
-
raw = await
|
|
667251
|
+
raw = await readFile56(path24, "utf8");
|
|
667144
667252
|
} catch {
|
|
667145
667253
|
return null;
|
|
667146
667254
|
}
|
|
@@ -669150,7 +669258,7 @@ __export(exports_print, {
|
|
|
669150
669258
|
createCanUseToolWithPermissionPrompt: () => createCanUseToolWithPermissionPrompt,
|
|
669151
669259
|
canBatchWith: () => canBatchWith
|
|
669152
669260
|
});
|
|
669153
|
-
import { readFile as
|
|
669261
|
+
import { readFile as readFile57, stat as stat58 } from "fs/promises";
|
|
669154
669262
|
import { dirname as dirname69 } from "path";
|
|
669155
669263
|
import { cwd as cwd3 } from "process";
|
|
669156
669264
|
import { randomUUID as randomUUID54 } from "crypto";
|
|
@@ -670523,7 +670631,7 @@ ${m.text}
|
|
|
670523
670631
|
const normalizedPath = expandPath(message.request.path);
|
|
670524
670632
|
const diskMtime = Math.floor((await stat58(normalizedPath)).mtimeMs);
|
|
670525
670633
|
if (diskMtime <= message.request.mtime) {
|
|
670526
|
-
const raw = await
|
|
670634
|
+
const raw = await readFile57(normalizedPath, "utf-8");
|
|
670527
670635
|
const content = (raw.charCodeAt(0) === 65279 ? raw.slice(1) : raw).replaceAll(`\r
|
|
670528
670636
|
`, `
|
|
670529
670637
|
`);
|
|
@@ -673732,7 +673840,7 @@ __export(exports_update, {
|
|
|
673732
673840
|
async function update() {
|
|
673733
673841
|
if (getAPIProvider() !== "firstParty") {
|
|
673734
673842
|
writeToStdout(source_default.yellow(`Auto-update is not available for third-party provider builds.
|
|
673735
|
-
`) + `Current version: ${"0.14.
|
|
673843
|
+
`) + `Current version: ${"0.14.9"}
|
|
673736
673844
|
|
|
673737
673845
|
` + `To update, reinstall from npm:
|
|
673738
673846
|
` + source_default.bold(` npm install -g ${"@makerbi/openclaude"}@latest`) + `
|
|
@@ -673743,7 +673851,7 @@ async function update() {
|
|
|
673743
673851
|
await gracefulShutdown(0);
|
|
673744
673852
|
}
|
|
673745
673853
|
logEvent("tengu_update_check", {});
|
|
673746
|
-
writeToStdout(`Current version: ${"0.14.
|
|
673854
|
+
writeToStdout(`Current version: ${"0.14.9"}
|
|
673747
673855
|
`);
|
|
673748
673856
|
const channel = getInitialSettings()?.autoUpdatesChannel ?? "latest";
|
|
673749
673857
|
writeToStdout(`Checking for updates to ${channel} version...
|
|
@@ -673828,8 +673936,8 @@ async function update() {
|
|
|
673828
673936
|
writeToStdout(`Claude is managed by Homebrew.
|
|
673829
673937
|
`);
|
|
673830
673938
|
const latest = await getLatestVersion(channel);
|
|
673831
|
-
if (latest && !gte("0.14.
|
|
673832
|
-
writeToStdout(`Update available: ${"0.14.
|
|
673939
|
+
if (latest && !gte("0.14.9", latest)) {
|
|
673940
|
+
writeToStdout(`Update available: ${"0.14.9"} → ${latest}
|
|
673833
673941
|
`);
|
|
673834
673942
|
writeToStdout(`
|
|
673835
673943
|
`);
|
|
@@ -673845,8 +673953,8 @@ async function update() {
|
|
|
673845
673953
|
writeToStdout(`Claude is managed by winget.
|
|
673846
673954
|
`);
|
|
673847
673955
|
const latest = await getLatestVersion(channel);
|
|
673848
|
-
if (latest && !gte("0.14.
|
|
673849
|
-
writeToStdout(`Update available: ${"0.14.
|
|
673956
|
+
if (latest && !gte("0.14.9", latest)) {
|
|
673957
|
+
writeToStdout(`Update available: ${"0.14.9"} → ${latest}
|
|
673850
673958
|
`);
|
|
673851
673959
|
writeToStdout(`
|
|
673852
673960
|
`);
|
|
@@ -673862,8 +673970,8 @@ async function update() {
|
|
|
673862
673970
|
writeToStdout(`Claude is managed by apk.
|
|
673863
673971
|
`);
|
|
673864
673972
|
const latest = await getLatestVersion(channel);
|
|
673865
|
-
if (latest && !gte("0.14.
|
|
673866
|
-
writeToStdout(`Update available: ${"0.14.
|
|
673973
|
+
if (latest && !gte("0.14.9", latest)) {
|
|
673974
|
+
writeToStdout(`Update available: ${"0.14.9"} → ${latest}
|
|
673867
673975
|
`);
|
|
673868
673976
|
writeToStdout(`
|
|
673869
673977
|
`);
|
|
@@ -673928,11 +674036,11 @@ async function update() {
|
|
|
673928
674036
|
`);
|
|
673929
674037
|
await gracefulShutdown(1);
|
|
673930
674038
|
}
|
|
673931
|
-
if (result.latestVersion === "0.14.
|
|
673932
|
-
writeToStdout(source_default.green(`OpenClaude is up to date (${"0.14.
|
|
674039
|
+
if (result.latestVersion === "0.14.9") {
|
|
674040
|
+
writeToStdout(source_default.green(`OpenClaude is up to date (${"0.14.9"})`) + `
|
|
673933
674041
|
`);
|
|
673934
674042
|
} else {
|
|
673935
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.14.
|
|
674043
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.14.9"} to version ${result.latestVersion}`) + `
|
|
673936
674044
|
`);
|
|
673937
674045
|
await regenerateCompletionCache();
|
|
673938
674046
|
}
|
|
@@ -673992,12 +674100,12 @@ async function update() {
|
|
|
673992
674100
|
`);
|
|
673993
674101
|
await gracefulShutdown(1);
|
|
673994
674102
|
}
|
|
673995
|
-
if (latestVersion === "0.14.
|
|
673996
|
-
writeToStdout(source_default.green(`OpenClaude is up to date (${"0.14.
|
|
674103
|
+
if (latestVersion === "0.14.9") {
|
|
674104
|
+
writeToStdout(source_default.green(`OpenClaude is up to date (${"0.14.9"})`) + `
|
|
673997
674105
|
`);
|
|
673998
674106
|
await gracefulShutdown(0);
|
|
673999
674107
|
}
|
|
674000
|
-
writeToStdout(`New version available: ${latestVersion} (current: ${"0.14.
|
|
674108
|
+
writeToStdout(`New version available: ${latestVersion} (current: ${"0.14.9"})
|
|
674001
674109
|
`);
|
|
674002
674110
|
writeToStdout(`Installing update...
|
|
674003
674111
|
`);
|
|
@@ -674042,7 +674150,7 @@ async function update() {
|
|
|
674042
674150
|
logForDebugging(`update: Installation status: ${status2}`);
|
|
674043
674151
|
switch (status2) {
|
|
674044
674152
|
case "success":
|
|
674045
|
-
writeToStdout(source_default.green(`Successfully updated from ${"0.14.
|
|
674153
|
+
writeToStdout(source_default.green(`Successfully updated from ${"0.14.9"} to version ${latestVersion}`) + `
|
|
674046
674154
|
`);
|
|
674047
674155
|
await regenerateCompletionCache();
|
|
674048
674156
|
break;
|
|
@@ -676095,7 +676203,7 @@ Usage: openclaude --remote "your task description"`, () => gracefulShutdown(1));
|
|
|
676095
676203
|
pendingHookMessages
|
|
676096
676204
|
}, renderAndRun);
|
|
676097
676205
|
}
|
|
676098
|
-
}).version("0.14.
|
|
676206
|
+
}).version("0.14.9 (OpenClaude)", "-v, --version", "Output the version number");
|
|
676099
676207
|
program2.option("-w, --worktree [name]", "Create a new git worktree for this session (optionally specify a name)");
|
|
676100
676208
|
program2.option("--tmux", "Create a tmux session for the worktree (requires --worktree). Uses iTerm2 native panes when available; use --tmux=classic for traditional tmux.");
|
|
676101
676209
|
if (canUserConfigureAdvisor()) {
|
|
@@ -676672,7 +676780,7 @@ if (false) {}
|
|
|
676672
676780
|
async function main2() {
|
|
676673
676781
|
const args = process.argv.slice(2);
|
|
676674
676782
|
if (args.length === 1 && (args[0] === "--version" || args[0] === "-v" || args[0] === "-V")) {
|
|
676675
|
-
console.log(`${"0.14.
|
|
676783
|
+
console.log(`${"0.14.9"} (OpenClaude)`);
|
|
676676
676784
|
return;
|
|
676677
676785
|
}
|
|
676678
676786
|
if (args.includes("--provider")) {
|
|
@@ -676825,4 +676933,4 @@ async function main2() {
|
|
|
676825
676933
|
}
|
|
676826
676934
|
main2();
|
|
676827
676935
|
|
|
676828
|
-
//# debugId=
|
|
676936
|
+
//# debugId=86F0C6D47371392E64756E2164756E21
|