@cnwenf/occ 2.1.271 → 2.1.273
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.js +299 -134
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
|
-
globalThis.MACRO={"VERSION":"2.1.
|
|
2
|
+
globalThis.MACRO={"VERSION":"2.1.273","BUILD_TIME":"2026-07-17T05:38:29.136Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
|
|
3
3
|
// @bun
|
|
4
4
|
var __create = Object.create;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf;
|
|
@@ -178434,6 +178434,12 @@ var init_terminal_focus_state = __esm(() => {
|
|
|
178434
178434
|
});
|
|
178435
178435
|
|
|
178436
178436
|
// src/ink/terminal-querier.ts
|
|
178437
|
+
function osc52Read() {
|
|
178438
|
+
return {
|
|
178439
|
+
request: osc(OSC2.CLIPBOARD, "c", "?"),
|
|
178440
|
+
match: (r4) => r4.type === "osc" && r4.code === OSC2.CLIPBOARD
|
|
178441
|
+
};
|
|
178442
|
+
}
|
|
178437
178443
|
function xtversion() {
|
|
178438
178444
|
return {
|
|
178439
178445
|
request: csi(">0q"),
|
|
@@ -448125,8 +448131,69 @@ var init_use_declared_cursor = __esm(() => {
|
|
|
448125
448131
|
import_react47 = __toESM(require_react(), 1);
|
|
448126
448132
|
});
|
|
448127
448133
|
|
|
448134
|
+
// src/utils/osc52ClipboardRead.ts
|
|
448135
|
+
function parseOSC52ResponseData(data) {
|
|
448136
|
+
if (!data)
|
|
448137
|
+
return null;
|
|
448138
|
+
const sep25 = data.indexOf(";");
|
|
448139
|
+
const b64 = sep25 >= 0 ? data.slice(sep25 + 1) : data;
|
|
448140
|
+
if (!b64)
|
|
448141
|
+
return null;
|
|
448142
|
+
try {
|
|
448143
|
+
const buf = Buffer.from(b64, "base64");
|
|
448144
|
+
return buf.length > 0 ? buf : null;
|
|
448145
|
+
} catch (e4) {
|
|
448146
|
+
logError2(e4);
|
|
448147
|
+
return null;
|
|
448148
|
+
}
|
|
448149
|
+
}
|
|
448150
|
+
function looksLikeImageBytes(buf) {
|
|
448151
|
+
if (buf.length < 4)
|
|
448152
|
+
return false;
|
|
448153
|
+
if (buf[0] === 137 && buf[1] === 80 && buf[2] === 78 && buf[3] === 71)
|
|
448154
|
+
return true;
|
|
448155
|
+
if (buf[0] === 255 && buf[1] === 216 && buf[2] === 255)
|
|
448156
|
+
return true;
|
|
448157
|
+
if (buf[0] === 71 && buf[1] === 73 && buf[2] === 70 && buf[3] === 56)
|
|
448158
|
+
return true;
|
|
448159
|
+
if (buf.length >= 12 && buf[0] === 82 && buf[1] === 73 && buf[2] === 70 && buf[3] === 70 && buf[8] === 87 && buf[9] === 69 && buf[10] === 66 && buf[11] === 80)
|
|
448160
|
+
return true;
|
|
448161
|
+
if (buf[0] === 66 && buf[1] === 77)
|
|
448162
|
+
return true;
|
|
448163
|
+
return false;
|
|
448164
|
+
}
|
|
448165
|
+
async function readClipboardImageViaOSC52(querier) {
|
|
448166
|
+
if (!querier)
|
|
448167
|
+
return null;
|
|
448168
|
+
try {
|
|
448169
|
+
const [response3] = await Promise.all([
|
|
448170
|
+
querier.send(osc52Read()),
|
|
448171
|
+
querier.flush()
|
|
448172
|
+
]);
|
|
448173
|
+
if (!response3 || response3.type !== "osc" || response3.code !== 52) {
|
|
448174
|
+
return null;
|
|
448175
|
+
}
|
|
448176
|
+
const buf = parseOSC52ResponseData(response3.data);
|
|
448177
|
+
if (!buf || !looksLikeImageBytes(buf)) {
|
|
448178
|
+
return null;
|
|
448179
|
+
}
|
|
448180
|
+
const mediaType = detectImageFormatFromBase64(buf.toString("base64"));
|
|
448181
|
+
return { buffer: buf, mediaType };
|
|
448182
|
+
} catch (e4) {
|
|
448183
|
+
logError2(e4);
|
|
448184
|
+
return null;
|
|
448185
|
+
}
|
|
448186
|
+
}
|
|
448187
|
+
var init_osc52ClipboardRead = __esm(() => {
|
|
448188
|
+
init_terminal_querier();
|
|
448189
|
+
init_imageResizer();
|
|
448190
|
+
init_log3();
|
|
448191
|
+
});
|
|
448192
|
+
|
|
448128
448193
|
// src/utils/imagePaste.ts
|
|
448129
448194
|
import { randomBytes as randomBytes9 } from "crypto";
|
|
448195
|
+
import { homedir as homedir27, tmpdir as tmpdir8 } from "os";
|
|
448196
|
+
import { writeFileSync as writeFileSync9 } from "fs";
|
|
448130
448197
|
import { basename as basename21, extname as extname12, isAbsolute as isAbsolute20, join as join93 } from "path";
|
|
448131
448198
|
function getClipboardCommands() {
|
|
448132
448199
|
const platform5 = process.platform;
|
|
@@ -448164,8 +448231,21 @@ function getClipboardCommands() {
|
|
|
448164
448231
|
};
|
|
448165
448232
|
}
|
|
448166
448233
|
async function hasImageInClipboard() {
|
|
448234
|
+
const overrideSrc = getClipboardImageSrcOverride();
|
|
448235
|
+
if (overrideSrc && getFsImplementation().existsSync(overrideSrc)) {
|
|
448236
|
+
return true;
|
|
448237
|
+
}
|
|
448167
448238
|
if (process.platform !== "darwin") {
|
|
448168
|
-
|
|
448239
|
+
const { commands: commands7 } = getClipboardCommands();
|
|
448240
|
+
try {
|
|
448241
|
+
const result2 = await execa(commands7.checkImage, {
|
|
448242
|
+
shell: true,
|
|
448243
|
+
reject: false
|
|
448244
|
+
});
|
|
448245
|
+
return result2.exitCode === 0;
|
|
448246
|
+
} catch {
|
|
448247
|
+
return false;
|
|
448248
|
+
}
|
|
448169
448249
|
}
|
|
448170
448250
|
if (feature("NATIVE_CLIPBOARD_IMAGE") && getFeatureValue_CACHED_MAY_BE_STALE("tengu_collage_kaleidoscope", true)) {
|
|
448171
448251
|
try {
|
|
@@ -448277,6 +448357,66 @@ async function getImagePathFromClipboard() {
|
|
|
448277
448357
|
return null;
|
|
448278
448358
|
}
|
|
448279
448359
|
}
|
|
448360
|
+
function getClipboardImageSrcOverride() {
|
|
448361
|
+
const v6 = process.env[CLIPBOARD_IMAGE_SRC_ENV];
|
|
448362
|
+
return v6 && v6.length > 0 ? v6 : undefined;
|
|
448363
|
+
}
|
|
448364
|
+
function getClipboardWatchPath() {
|
|
448365
|
+
const v6 = process.env[CLIPBOARD_WATCH_PATH_ENV];
|
|
448366
|
+
if (v6 !== undefined)
|
|
448367
|
+
return v6.length > 0 ? v6 : undefined;
|
|
448368
|
+
return DEFAULT_CLIPBOARD_WATCH_PATH;
|
|
448369
|
+
}
|
|
448370
|
+
async function saveClipboardImageToTempFile(opts = {}) {
|
|
448371
|
+
try {
|
|
448372
|
+
const overrideSrc = getClipboardImageSrcOverride();
|
|
448373
|
+
if (overrideSrc && getFsImplementation().existsSync(overrideSrc)) {
|
|
448374
|
+
const buffer2 = getFsImplementation().readFileBytesSync(overrideSrc);
|
|
448375
|
+
const mediaType = detectImageFormatFromBase64(buffer2.toString("base64"));
|
|
448376
|
+
return writeUniqueTempImageFile(buffer2, mediaType);
|
|
448377
|
+
}
|
|
448378
|
+
if (opts.querier) {
|
|
448379
|
+
const osc52 = await readClipboardImageViaOSC52(opts.querier);
|
|
448380
|
+
if (osc52) {
|
|
448381
|
+
const ext = osc52.mediaType.replace(/^image\//, "") || "png";
|
|
448382
|
+
const resized = await maybeResizeAndDownsampleImageBuffer(osc52.buffer, osc52.buffer.length, ext);
|
|
448383
|
+
return writeUniqueTempImageFile(resized.buffer, `image/${resized.mediaType}`, resized.dimensions);
|
|
448384
|
+
}
|
|
448385
|
+
}
|
|
448386
|
+
const watchPath = getClipboardWatchPath();
|
|
448387
|
+
if (watchPath && getFsImplementation().existsSync(watchPath)) {
|
|
448388
|
+
const buffer2 = getFsImplementation().readFileBytesSync(watchPath);
|
|
448389
|
+
if (buffer2.length > 0) {
|
|
448390
|
+
const ext = detectImageFormatFromBase64(buffer2.toString("base64"));
|
|
448391
|
+
const extName = ext.replace(/^image\//, "") || "png";
|
|
448392
|
+
const resized = await maybeResizeAndDownsampleImageBuffer(buffer2, buffer2.length, extName);
|
|
448393
|
+
return writeUniqueTempImageFile(resized.buffer, `image/${resized.mediaType}`, resized.dimensions);
|
|
448394
|
+
}
|
|
448395
|
+
}
|
|
448396
|
+
const image = await getImageFromClipboard();
|
|
448397
|
+
if (!image) {
|
|
448398
|
+
return null;
|
|
448399
|
+
}
|
|
448400
|
+
const buffer = Buffer.from(image.base64, "base64");
|
|
448401
|
+
return writeUniqueTempImageFile(buffer, image.mediaType, image.dimensions);
|
|
448402
|
+
} catch (e4) {
|
|
448403
|
+
logError2(e4);
|
|
448404
|
+
return null;
|
|
448405
|
+
}
|
|
448406
|
+
}
|
|
448407
|
+
function writeUniqueTempImageFile(buffer, mediaType, dimensions) {
|
|
448408
|
+
const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (process.platform === "win32" ? process.env.TEMP || "C:\\Temp" : tmpdir8());
|
|
448409
|
+
const ext = mediaType.replace(/^image\//, "").toLowerCase();
|
|
448410
|
+
const safeExt = TEMP_IMAGE_EXT_ALLOW.test(ext) ? ext.replace("jpeg", "jpg") : "png";
|
|
448411
|
+
const name3 = `occ-clipboard-${Date.now()}-${randomBytes9(6).toString("hex")}.${safeExt}`;
|
|
448412
|
+
const filePath = join93(baseTmpDir, name3);
|
|
448413
|
+
writeFileSync9(filePath, buffer);
|
|
448414
|
+
return {
|
|
448415
|
+
path: filePath,
|
|
448416
|
+
mediaType: `image/${safeExt === "jpg" ? "jpeg" : safeExt}`,
|
|
448417
|
+
dimensions
|
|
448418
|
+
};
|
|
448419
|
+
}
|
|
448280
448420
|
function removeOuterQuotes(text2) {
|
|
448281
448421
|
if (text2.startsWith('"') && text2.endsWith('"') || text2.startsWith("'") && text2.endsWith("'")) {
|
|
448282
448422
|
return text2.slice(1, -1);
|
|
@@ -448349,7 +448489,7 @@ async function tryReadImageFromPath(text2) {
|
|
|
448349
448489
|
dimensions: resized.dimensions
|
|
448350
448490
|
};
|
|
448351
448491
|
}
|
|
448352
|
-
var PASTE_THRESHOLD = 800, IMAGE_EXTENSION_REGEX;
|
|
448492
|
+
var PASTE_THRESHOLD = 800, CLIPBOARD_IMAGE_SRC_ENV = "OCC_CLIPBOARD_IMAGE_SRC", CLIPBOARD_WATCH_PATH_ENV = "OCC_CLIPBOARD_WATCH_PATH", DEFAULT_CLIPBOARD_WATCH_PATH, TEMP_IMAGE_EXT_ALLOW, IMAGE_EXTENSION_REGEX;
|
|
448353
448493
|
var init_imagePaste = __esm(() => {
|
|
448354
448494
|
init_featureFlags();
|
|
448355
448495
|
init_execa();
|
|
@@ -448361,6 +448501,9 @@ var init_imagePaste = __esm(() => {
|
|
|
448361
448501
|
init_fsOperations();
|
|
448362
448502
|
init_imageResizer();
|
|
448363
448503
|
init_log3();
|
|
448504
|
+
init_osc52ClipboardRead();
|
|
448505
|
+
DEFAULT_CLIPBOARD_WATCH_PATH = join93(homedir27(), ".occ", "clipboard-latest.png");
|
|
448506
|
+
TEMP_IMAGE_EXT_ALLOW = /^(png|jpe?g|gif|webp|bmp)$/i;
|
|
448364
448507
|
IMAGE_EXTENSION_REGEX = /\.(png|jpe?g|gif|webp)$/i;
|
|
448365
448508
|
});
|
|
448366
448509
|
|
|
@@ -457827,7 +457970,7 @@ var init_InProcessBackend = __esm(() => {
|
|
|
457827
457970
|
});
|
|
457828
457971
|
|
|
457829
457972
|
// src/utils/swarm/backends/it2Setup.ts
|
|
457830
|
-
import { homedir as
|
|
457973
|
+
import { homedir as homedir28 } from "os";
|
|
457831
457974
|
async function detectPythonPackageManager() {
|
|
457832
457975
|
const uvResult = await execFileNoThrow("which", ["uv"]);
|
|
457833
457976
|
if (uvResult.code === 0) {
|
|
@@ -457862,18 +458005,18 @@ async function installIt2(packageManager) {
|
|
|
457862
458005
|
switch (packageManager) {
|
|
457863
458006
|
case "uvx":
|
|
457864
458007
|
result = await execFileNoThrowWithCwd("uv", ["tool", "install", "it2"], {
|
|
457865
|
-
cwd:
|
|
458008
|
+
cwd: homedir28()
|
|
457866
458009
|
});
|
|
457867
458010
|
break;
|
|
457868
458011
|
case "pipx":
|
|
457869
458012
|
result = await execFileNoThrowWithCwd("pipx", ["install", "it2"], {
|
|
457870
|
-
cwd:
|
|
458013
|
+
cwd: homedir28()
|
|
457871
458014
|
});
|
|
457872
458015
|
break;
|
|
457873
458016
|
case "pip":
|
|
457874
|
-
result = await execFileNoThrowWithCwd("pip", ["install", "--user", "it2"], { cwd:
|
|
458017
|
+
result = await execFileNoThrowWithCwd("pip", ["install", "--user", "it2"], { cwd: homedir28() });
|
|
457875
458018
|
if (result.code !== 0) {
|
|
457876
|
-
result = await execFileNoThrowWithCwd("pip3", ["install", "--user", "it2"], { cwd:
|
|
458019
|
+
result = await execFileNoThrowWithCwd("pip3", ["install", "--user", "it2"], { cwd: homedir28() });
|
|
457877
458020
|
}
|
|
457878
458021
|
break;
|
|
457879
458022
|
}
|
|
@@ -459148,7 +459291,7 @@ __export(exports_teamHelpers, {
|
|
|
459148
459291
|
cleanupSessionTeams: () => cleanupSessionTeams,
|
|
459149
459292
|
addHiddenPaneId: () => addHiddenPaneId
|
|
459150
459293
|
});
|
|
459151
|
-
import { mkdirSync as mkdirSync8, readFileSync as readFileSync21, writeFileSync as
|
|
459294
|
+
import { mkdirSync as mkdirSync8, readFileSync as readFileSync21, writeFileSync as writeFileSync10 } from "fs";
|
|
459152
459295
|
import { mkdir as mkdir25, readFile as readFile33, rm as rm5, writeFile as writeFile25 } from "fs/promises";
|
|
459153
459296
|
import { join as join96 } from "path";
|
|
459154
459297
|
function sanitizeName(name3) {
|
|
@@ -459188,7 +459331,7 @@ async function readTeamFileAsync(teamName) {
|
|
|
459188
459331
|
function writeTeamFile(teamName, teamFile) {
|
|
459189
459332
|
const teamDir = getTeamDir(teamName);
|
|
459190
459333
|
mkdirSync8(teamDir, { recursive: true });
|
|
459191
|
-
|
|
459334
|
+
writeFileSync10(getTeamFilePath(teamName), jsonStringify(teamFile, null, 2));
|
|
459192
459335
|
}
|
|
459193
459336
|
async function writeTeamFileAsync(teamName, teamFile) {
|
|
459194
459337
|
const teamDir = getTeamDir(teamName);
|
|
@@ -476844,11 +476987,11 @@ var init_filesApi = __esm(() => {
|
|
|
476844
476987
|
|
|
476845
476988
|
// src/utils/tempfile.ts
|
|
476846
476989
|
import { createHash as createHash23, randomUUID as randomUUID19 } from "crypto";
|
|
476847
|
-
import { tmpdir as
|
|
476990
|
+
import { tmpdir as tmpdir9 } from "os";
|
|
476848
476991
|
import { join as join98 } from "path";
|
|
476849
476992
|
function generateTempFilePath(prefix = "claude-prompt", extension = ".md", options) {
|
|
476850
476993
|
const id = options?.contentHash ? createHash23("sha256").update(options.contentHash).digest("hex").slice(0, 16) : randomUUID19();
|
|
476851
|
-
return join98(
|
|
476994
|
+
return join98(tmpdir9(), `${prefix}-${id}${extension}`);
|
|
476852
476995
|
}
|
|
476853
476996
|
var init_tempfile = () => {};
|
|
476854
476997
|
|
|
@@ -572705,7 +572848,7 @@ var init_PipeTransport = __esm(() => {
|
|
|
572705
572848
|
|
|
572706
572849
|
// node_modules/.bun/puppeteer-core@24.43.1/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserLauncher.js
|
|
572707
572850
|
import { existsSync as existsSync14 } from "fs";
|
|
572708
|
-
import { tmpdir as
|
|
572851
|
+
import { tmpdir as tmpdir10 } from "os";
|
|
572709
572852
|
import { join as join102 } from "path";
|
|
572710
572853
|
|
|
572711
572854
|
class BrowserLauncher {
|
|
@@ -572904,7 +573047,7 @@ class BrowserLauncher {
|
|
|
572904
573047
|
});
|
|
572905
573048
|
}
|
|
572906
573049
|
getProfilePath() {
|
|
572907
|
-
return join102(this.puppeteer.configuration.temporaryDirectory ??
|
|
573050
|
+
return join102(this.puppeteer.configuration.temporaryDirectory ?? tmpdir10(), `puppeteer_dev_${this.browser}_profile-`);
|
|
572908
573051
|
}
|
|
572909
573052
|
resolveExecutablePath(headless, validatePath2 = true) {
|
|
572910
573053
|
let executablePath = this.puppeteer.configuration.executablePath;
|
|
@@ -584668,10 +584811,10 @@ __export(exports_ListPeersTool, {
|
|
|
584668
584811
|
LIST_AGENTS_TOOL_NAME: () => LIST_AGENTS_TOOL_NAME
|
|
584669
584812
|
});
|
|
584670
584813
|
import { readdir as readdir21, readFile as readFile39 } from "fs/promises";
|
|
584671
|
-
import { homedir as
|
|
584814
|
+
import { homedir as homedir29 } from "os";
|
|
584672
584815
|
import { join as join107 } from "path";
|
|
584673
584816
|
function getSessionsDir2() {
|
|
584674
|
-
return join107(
|
|
584817
|
+
return join107(homedir29(), ".claude", "sessions");
|
|
584675
584818
|
}
|
|
584676
584819
|
async function listLocalSessions() {
|
|
584677
584820
|
const dir = getSessionsDir2();
|
|
@@ -585533,7 +585676,7 @@ __export(exports_workflowDiscovery, {
|
|
|
585533
585676
|
PROJECT_WORKFLOWS_DIR: () => PROJECT_WORKFLOWS_DIR
|
|
585534
585677
|
});
|
|
585535
585678
|
import { existsSync as existsSync16, readdirSync as readdirSync8, statSync as statSync14 } from "fs";
|
|
585536
|
-
import { homedir as
|
|
585679
|
+
import { homedir as homedir30 } from "os";
|
|
585537
585680
|
import { join as join108 } from "path";
|
|
585538
585681
|
function isWorkflowsEnabled() {
|
|
585539
585682
|
if (process.env.CLAUDE_CODE_WORKFLOWS_DISABLED === "1")
|
|
@@ -585544,7 +585687,7 @@ function projectWorkflowsDir(cwd2) {
|
|
|
585544
585687
|
return join108(cwd2, PROJECT_WORKFLOWS_DIR);
|
|
585545
585688
|
}
|
|
585546
585689
|
function userWorkflowsDir() {
|
|
585547
|
-
return join108(
|
|
585690
|
+
return join108(homedir30(), USER_WORKFLOWS_DIR);
|
|
585548
585691
|
}
|
|
585549
585692
|
function listScripts(dir, source2) {
|
|
585550
585693
|
let entries;
|
|
@@ -585970,7 +586113,7 @@ var init_WorkflowProgressTree = __esm(() => {
|
|
|
585970
586113
|
});
|
|
585971
586114
|
|
|
585972
586115
|
// src/utils/wfProgress.ts
|
|
585973
|
-
import { existsSync as existsSync17, mkdirSync as mkdirSync9, readFileSync as readFileSync27, readdirSync as readdirSync9, unlinkSync as unlinkSync4, writeFileSync as
|
|
586116
|
+
import { existsSync as existsSync17, mkdirSync as mkdirSync9, readFileSync as readFileSync27, readdirSync as readdirSync9, unlinkSync as unlinkSync4, writeFileSync as writeFileSync11, renameSync as renameSync3 } from "fs";
|
|
585974
586117
|
import { join as join109 } from "path";
|
|
585975
586118
|
function getWfProgressDir() {
|
|
585976
586119
|
return join109(getClaudeConfigHomeDir(), "wf-progress");
|
|
@@ -585986,7 +586129,7 @@ function writeWorkflowProgress(runId, data) {
|
|
|
585986
586129
|
};
|
|
585987
586130
|
const target = join109(dir, `${runId}.json`);
|
|
585988
586131
|
const tmp = join109(dir, `${runId}.json.tmp`);
|
|
585989
|
-
|
|
586132
|
+
writeFileSync11(tmp, JSON.stringify(payload), { encoding: "utf-8" });
|
|
585990
586133
|
renameSync3(tmp, target);
|
|
585991
586134
|
} catch {}
|
|
585992
586135
|
}
|
|
@@ -588871,7 +589014,7 @@ var init_modeValidation2 = __esm(() => {
|
|
|
588871
589014
|
});
|
|
588872
589015
|
|
|
588873
589016
|
// src/tools/PowerShellTool/pathValidation.ts
|
|
588874
|
-
import { homedir as
|
|
589017
|
+
import { homedir as homedir31 } from "os";
|
|
588875
589018
|
import { isAbsolute as isAbsolute25, resolve as resolve43 } from "path";
|
|
588876
589019
|
function matchesParam(paramLower, paramList) {
|
|
588877
589020
|
for (const p4 of paramList) {
|
|
@@ -588894,7 +589037,7 @@ function formatDirectoryList2(directories) {
|
|
|
588894
589037
|
}
|
|
588895
589038
|
function expandTilde2(filePath) {
|
|
588896
589039
|
if (filePath === "~" || filePath.startsWith("~/") || filePath.startsWith("~\\")) {
|
|
588897
|
-
return
|
|
589040
|
+
return homedir31() + filePath.slice(1);
|
|
588898
589041
|
}
|
|
588899
589042
|
return filePath;
|
|
588900
589043
|
}
|
|
@@ -596280,7 +596423,7 @@ __export(exports_src3, {
|
|
|
596280
596423
|
ComputerUseAPI: () => ComputerUseAPI
|
|
596281
596424
|
});
|
|
596282
596425
|
import { readFileSync as readFileSync28, unlinkSync as unlinkSync5 } from "fs";
|
|
596283
|
-
import { tmpdir as
|
|
596426
|
+
import { tmpdir as tmpdir11 } from "os";
|
|
596284
596427
|
import { join as join112 } from "path";
|
|
596285
596428
|
function jxaSync(script) {
|
|
596286
596429
|
const result = Bun.spawnSync({
|
|
@@ -596309,7 +596452,7 @@ async function jxa(script) {
|
|
|
596309
596452
|
return text2.trim();
|
|
596310
596453
|
}
|
|
596311
596454
|
async function captureScreenToBase64(args) {
|
|
596312
|
-
const tmpFile = join112(
|
|
596455
|
+
const tmpFile = join112(tmpdir11(), `cu-screenshot-${Date.now()}.png`);
|
|
596313
596456
|
const proc = Bun.spawn(["screencapture", ...args, tmpFile], {
|
|
596314
596457
|
stdout: "pipe",
|
|
596315
596458
|
stderr: "pipe"
|
|
@@ -608930,7 +609073,7 @@ import {
|
|
|
608930
609073
|
stat as stat36,
|
|
608931
609074
|
writeFile as writeFile36
|
|
608932
609075
|
} from "fs/promises";
|
|
608933
|
-
import { tmpdir as
|
|
609076
|
+
import { tmpdir as tmpdir12 } from "os";
|
|
608934
609077
|
import { basename as basename35, dirname as dirname50, join as join118 } from "path";
|
|
608935
609078
|
function isPluginZipCacheEnabled() {
|
|
608936
609079
|
return isEnvTruthy(process.env.CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE);
|
|
@@ -608970,7 +609113,7 @@ async function getSessionPluginCachePath() {
|
|
|
608970
609113
|
if (!sessionPluginCachePromise) {
|
|
608971
609114
|
sessionPluginCachePromise = (async () => {
|
|
608972
609115
|
const suffix = randomBytes10(8).toString("hex");
|
|
608973
|
-
const dir = join118(
|
|
609116
|
+
const dir = join118(tmpdir12(), `claude-plugin-session-${suffix}`);
|
|
608974
609117
|
await getFsImplementation().mkdir(dir);
|
|
608975
609118
|
sessionPluginCachePath = dir;
|
|
608976
609119
|
logForDebugging(`Created session plugin cache at ${dir}`);
|
|
@@ -624648,7 +624791,7 @@ __export(exports_mcpServer2, {
|
|
|
624648
624791
|
runComputerUseMcpServer: () => runComputerUseMcpServer,
|
|
624649
624792
|
createComputerUseMcpServerForCli: () => createComputerUseMcpServerForCli
|
|
624650
624793
|
});
|
|
624651
|
-
import { homedir as
|
|
624794
|
+
import { homedir as homedir32 } from "os";
|
|
624652
624795
|
async function tryGetInstalledAppNames() {
|
|
624653
624796
|
const adapter2 = getComputerUseHostAdapter();
|
|
624654
624797
|
const enumP = adapter2.executor.listInstalledApps();
|
|
@@ -624664,7 +624807,7 @@ async function tryGetInstalledAppNames() {
|
|
|
624664
624807
|
logForDebugging(`[Computer Use MCP] app enumeration exceeded ${APP_ENUM_TIMEOUT_MS}ms or failed; tool description omits list`);
|
|
624665
624808
|
return;
|
|
624666
624809
|
}
|
|
624667
|
-
return filterAppsForDescription(installed,
|
|
624810
|
+
return filterAppsForDescription(installed, homedir32());
|
|
624668
624811
|
}
|
|
624669
624812
|
async function createComputerUseMcpServerForCli() {
|
|
624670
624813
|
const adapter2 = getComputerUseHostAdapter();
|
|
@@ -632314,7 +632457,7 @@ var init_projectOnboardingState = __esm(() => {
|
|
|
632314
632457
|
|
|
632315
632458
|
// src/utils/appleTerminalBackup.ts
|
|
632316
632459
|
import { stat as stat39 } from "fs/promises";
|
|
632317
|
-
import { homedir as
|
|
632460
|
+
import { homedir as homedir33 } from "os";
|
|
632318
632461
|
import { join as join128 } from "path";
|
|
632319
632462
|
function markTerminalSetupInProgress(backupPath) {
|
|
632320
632463
|
saveGlobalConfig((current) => ({
|
|
@@ -632337,7 +632480,7 @@ function getTerminalRecoveryInfo() {
|
|
|
632337
632480
|
};
|
|
632338
632481
|
}
|
|
632339
632482
|
function getTerminalPlistPath() {
|
|
632340
|
-
return join128(
|
|
632483
|
+
return join128(homedir33(), "Library", "Preferences", "com.apple.Terminal.plist");
|
|
632341
632484
|
}
|
|
632342
632485
|
async function backupTerminalPreferences() {
|
|
632343
632486
|
const terminalPlistPath = getTerminalPlistPath();
|
|
@@ -632408,11 +632551,11 @@ var init_appleTerminalBackup = __esm(() => {
|
|
|
632408
632551
|
});
|
|
632409
632552
|
|
|
632410
632553
|
// src/utils/completionCache.ts
|
|
632411
|
-
import { homedir as
|
|
632554
|
+
import { homedir as homedir34 } from "os";
|
|
632412
632555
|
import { dirname as dirname57, join as join129 } from "path";
|
|
632413
632556
|
function detectShell() {
|
|
632414
632557
|
const shell = process.env.SHELL || "";
|
|
632415
|
-
const home =
|
|
632558
|
+
const home = homedir34();
|
|
632416
632559
|
const claudeDir = join129(home, ".claude");
|
|
632417
632560
|
if (shell.endsWith("/zsh") || shell.endsWith("/zsh.exe")) {
|
|
632418
632561
|
const cacheFile = join129(claudeDir, "completion.zsh");
|
|
@@ -632489,7 +632632,7 @@ __export(exports_terminalSetup, {
|
|
|
632489
632632
|
});
|
|
632490
632633
|
import { randomBytes as randomBytes15 } from "crypto";
|
|
632491
632634
|
import { copyFile as copyFile9, mkdir as mkdir39, readFile as readFile48, writeFile as writeFile41 } from "fs/promises";
|
|
632492
|
-
import { homedir as
|
|
632635
|
+
import { homedir as homedir35, platform as platform5 } from "os";
|
|
632493
632636
|
import { dirname as dirname58, join as join130 } from "path";
|
|
632494
632637
|
import { pathToFileURL as pathToFileURL7 } from "url";
|
|
632495
632638
|
function isVSCodeRemoteSSH() {
|
|
@@ -632625,7 +632768,7 @@ async function installBindingsForVSCodeTerminal(editor = "VSCode", theme) {
|
|
|
632625
632768
|
]`)}${EOL7}`;
|
|
632626
632769
|
}
|
|
632627
632770
|
const editorDir = editor === "VSCode" ? "Code" : editor;
|
|
632628
|
-
const userDirPath = join130(
|
|
632771
|
+
const userDirPath = join130(homedir35(), platform5() === "win32" ? join130("AppData", "Roaming", editorDir, "User") : platform5() === "darwin" ? join130("Library", "Application Support", editorDir, "User") : join130(".config", editorDir, "User"));
|
|
632629
632772
|
const keybindingsPath = join130(userDirPath, "keybindings.json");
|
|
632630
632773
|
try {
|
|
632631
632774
|
await mkdir39(userDirPath, {
|
|
@@ -632778,7 +632921,7 @@ chars = "\\u001B\\r"`;
|
|
|
632778
632921
|
if (xdgConfigHome) {
|
|
632779
632922
|
configPaths.push(join130(xdgConfigHome, "alacritty", "alacritty.toml"));
|
|
632780
632923
|
} else {
|
|
632781
|
-
configPaths.push(join130(
|
|
632924
|
+
configPaths.push(join130(homedir35(), ".config", "alacritty", "alacritty.toml"));
|
|
632782
632925
|
}
|
|
632783
632926
|
if (platform5() === "win32") {
|
|
632784
632927
|
const appData = process.env.APPDATA;
|
|
@@ -632844,7 +632987,7 @@ chars = "\\u001B\\r"`;
|
|
|
632844
632987
|
}
|
|
632845
632988
|
}
|
|
632846
632989
|
async function installBindingsForZed(theme) {
|
|
632847
|
-
const zedDir = join130(
|
|
632990
|
+
const zedDir = join130(homedir35(), ".config", "zed");
|
|
632848
632991
|
const keymapPath = join130(zedDir, "keymap.json");
|
|
632849
632992
|
try {
|
|
632850
632993
|
await mkdir39(zedDir, {
|
|
@@ -634721,7 +634864,8 @@ import { basename as basename40 } from "path";
|
|
|
634721
634864
|
function usePasteHandler({
|
|
634722
634865
|
onPaste,
|
|
634723
634866
|
onInput,
|
|
634724
|
-
onImagePaste
|
|
634867
|
+
onImagePaste,
|
|
634868
|
+
querier
|
|
634725
634869
|
}) {
|
|
634726
634870
|
const [pasteState, setPasteState] = import_react91.default.useState({ chunks: [], timeoutId: null });
|
|
634727
634871
|
const [isPasting, setIsPasting] = import_react91.default.useState(false);
|
|
@@ -634736,26 +634880,36 @@ function usePasteHandler({
|
|
|
634736
634880
|
const checkClipboardForImageImpl = import_react91.default.useCallback(() => {
|
|
634737
634881
|
if (!onImagePaste || !isMountedRef.current)
|
|
634738
634882
|
return;
|
|
634739
|
-
|
|
634740
|
-
|
|
634741
|
-
|
|
634742
|
-
|
|
634743
|
-
|
|
634744
|
-
|
|
634745
|
-
|
|
634746
|
-
|
|
634747
|
-
|
|
634748
|
-
|
|
634749
|
-
|
|
634883
|
+
(async () => {
|
|
634884
|
+
try {
|
|
634885
|
+
if (querier) {
|
|
634886
|
+
const osc52 = await readClipboardImageViaOSC52(querier);
|
|
634887
|
+
if (osc52 && isMountedRef.current) {
|
|
634888
|
+
onImagePaste(osc52.buffer.toString("base64"), osc52.mediaType, undefined, undefined);
|
|
634889
|
+
return;
|
|
634890
|
+
}
|
|
634891
|
+
}
|
|
634892
|
+
const imageData = await getImageFromClipboard();
|
|
634893
|
+
if (imageData && isMountedRef.current) {
|
|
634894
|
+
onImagePaste(imageData.base64, imageData.mediaType, undefined, imageData.dimensions);
|
|
634895
|
+
}
|
|
634896
|
+
} catch (error52) {
|
|
634897
|
+
if (isMountedRef.current) {
|
|
634898
|
+
logError2(error52);
|
|
634899
|
+
}
|
|
634900
|
+
} finally {
|
|
634901
|
+
if (isMountedRef.current) {
|
|
634902
|
+
setIsPasting(false);
|
|
634903
|
+
}
|
|
634750
634904
|
}
|
|
634751
|
-
});
|
|
634752
|
-
}, [onImagePaste]);
|
|
634905
|
+
})();
|
|
634906
|
+
}, [onImagePaste, querier]);
|
|
634753
634907
|
const checkClipboardForImage = useDebounceCallback(checkClipboardForImageImpl, CLIPBOARD_CHECK_DEBOUNCE_MS);
|
|
634754
634908
|
const resetPasteTimeout = import_react91.default.useCallback((currentTimeoutId2) => {
|
|
634755
634909
|
if (currentTimeoutId2) {
|
|
634756
634910
|
clearTimeout(currentTimeoutId2);
|
|
634757
634911
|
}
|
|
634758
|
-
return setTimeout((setPasteState2, onImagePaste2, onPaste2, setIsPasting2, checkClipboardForImage2, isMacOS2, pastePendingRef2) => {
|
|
634912
|
+
return setTimeout((setPasteState2, onImagePaste2, onPaste2, setIsPasting2, checkClipboardForImage2, isMacOS2, hasQuerier, pastePendingRef2) => {
|
|
634759
634913
|
pastePendingRef2.current = false;
|
|
634760
634914
|
setPasteState2(({ chunks }) => {
|
|
634761
634915
|
const pastedText = chunks.join("").replace(/\[I$/, "").replace(/\[O$/, "");
|
|
@@ -634788,7 +634942,7 @@ function usePasteHandler({
|
|
|
634788
634942
|
});
|
|
634789
634943
|
return { chunks: [], timeoutId: null };
|
|
634790
634944
|
}
|
|
634791
|
-
if (isMacOS2 && onImagePaste2 && pastedText.length === 0) {
|
|
634945
|
+
if ((isMacOS2 || hasQuerier) && onImagePaste2 && pastedText.length === 0) {
|
|
634792
634946
|
checkClipboardForImage2();
|
|
634793
634947
|
return { chunks: [], timeoutId: null };
|
|
634794
634948
|
}
|
|
@@ -634798,8 +634952,8 @@ function usePasteHandler({
|
|
|
634798
634952
|
setIsPasting2(false);
|
|
634799
634953
|
return { chunks: [], timeoutId: null };
|
|
634800
634954
|
});
|
|
634801
|
-
}, PASTE_COMPLETION_TIMEOUT_MS, setPasteState, onImagePaste, onPaste, setIsPasting, checkClipboardForImage, isMacOS, pastePendingRef);
|
|
634802
|
-
}, [checkClipboardForImage, isMacOS, onImagePaste, onPaste]);
|
|
634955
|
+
}, PASTE_COMPLETION_TIMEOUT_MS, setPasteState, onImagePaste, onPaste, setIsPasting, checkClipboardForImage, isMacOS, !!querier, pastePendingRef);
|
|
634956
|
+
}, [checkClipboardForImage, isMacOS, onImagePaste, onPaste, querier]);
|
|
634803
634957
|
const wrappedOnInput = (input2, key4, event) => {
|
|
634804
634958
|
const isFromPaste = event.keypress.isPasted;
|
|
634805
634959
|
if (isFromPaste) {
|
|
@@ -634807,7 +634961,7 @@ function usePasteHandler({
|
|
|
634807
634961
|
}
|
|
634808
634962
|
const hasImageFilePath = input2.split(/ (?=\/|[A-Za-z]:\\)/).flatMap((part) => part.split(`
|
|
634809
634963
|
`)).some((line) => isImageFilePath(line.trim()));
|
|
634810
|
-
if (isFromPaste && input2.length === 0 && isMacOS && onImagePaste) {
|
|
634964
|
+
if (isFromPaste && input2.length === 0 && (isMacOS || querier) && onImagePaste) {
|
|
634811
634965
|
checkClipboardForImage();
|
|
634812
634966
|
setIsPasting(false);
|
|
634813
634967
|
return;
|
|
@@ -634839,6 +634993,7 @@ var init_usePasteHandler = __esm(() => {
|
|
|
634839
634993
|
init_log3();
|
|
634840
634994
|
init_dist6();
|
|
634841
634995
|
init_imagePaste();
|
|
634996
|
+
init_osc52ClipboardRead();
|
|
634842
634997
|
init_platform2();
|
|
634843
634998
|
import_react91 = __toESM(require_react(), 1);
|
|
634844
634999
|
});
|
|
@@ -635146,6 +635301,7 @@ function BaseTextInput(t0) {
|
|
|
635146
635301
|
t22 = $4[3];
|
|
635147
635302
|
}
|
|
635148
635303
|
const cursorRef = useDeclaredCursor(t22);
|
|
635304
|
+
const { internal_querier } = use_stdin_default();
|
|
635149
635305
|
const {
|
|
635150
635306
|
wrappedOnInput,
|
|
635151
635307
|
isPasting: t32
|
|
@@ -635157,7 +635313,8 @@ function BaseTextInput(t0) {
|
|
|
635157
635313
|
}
|
|
635158
635314
|
onInput(input2, key4);
|
|
635159
635315
|
},
|
|
635160
|
-
onImagePaste: props.onImagePaste
|
|
635316
|
+
onImagePaste: props.onImagePaste,
|
|
635317
|
+
querier: internal_querier
|
|
635161
635318
|
});
|
|
635162
635319
|
const isPasting = t32;
|
|
635163
635320
|
const {
|
|
@@ -637168,7 +637325,7 @@ __export(exports_workerRegistry, {
|
|
|
637168
637325
|
DEFAULT_PREWARM_PER_SWEEP: () => DEFAULT_PREWARM_PER_SWEEP
|
|
637169
637326
|
});
|
|
637170
637327
|
import { spawn as spawn13 } from "child_process";
|
|
637171
|
-
import { existsSync as existsSync19, readFileSync as readFileSync29, writeFileSync as
|
|
637328
|
+
import { existsSync as existsSync19, readFileSync as readFileSync29, writeFileSync as writeFileSync12 } from "fs";
|
|
637172
637329
|
import { join as join135 } from "path";
|
|
637173
637330
|
function getDaemonJsonPath() {
|
|
637174
637331
|
return join135(getClaudeConfigHomeDir(), "daemon.json");
|
|
@@ -637238,12 +637395,12 @@ function writeDaemonStatus() {
|
|
|
637238
637395
|
id: r4.id,
|
|
637239
637396
|
exitCode: r4.exitCode
|
|
637240
637397
|
}));
|
|
637241
|
-
|
|
637398
|
+
writeFileSync12(getDaemonStatusPath(), JSON.stringify(snapshot2), { encoding: "utf-8" });
|
|
637242
637399
|
} catch {}
|
|
637243
637400
|
}
|
|
637244
637401
|
function writeDaemonJson(config7) {
|
|
637245
637402
|
try {
|
|
637246
|
-
|
|
637403
|
+
writeFileSync12(getDaemonJsonPath(), JSON.stringify(config7, null, 2), {
|
|
637247
637404
|
encoding: "utf-8"
|
|
637248
637405
|
});
|
|
637249
637406
|
} catch {}
|
|
@@ -637533,8 +637690,8 @@ var init_respawn = __esm(() => {
|
|
|
637533
637690
|
});
|
|
637534
637691
|
|
|
637535
637692
|
// src/daemon/install.ts
|
|
637536
|
-
import { existsSync as existsSync20, mkdirSync as mkdirSync10, writeFileSync as
|
|
637537
|
-
import { homedir as
|
|
637693
|
+
import { existsSync as existsSync20, mkdirSync as mkdirSync10, writeFileSync as writeFileSync13, unlinkSync as unlinkSync6 } from "fs";
|
|
637694
|
+
import { homedir as homedir36 } from "os";
|
|
637538
637695
|
import { join as join136 } from "path";
|
|
637539
637696
|
import { spawnSync as spawnSync9 } from "child_process";
|
|
637540
637697
|
function detectInstallPlatform() {
|
|
@@ -637550,10 +637707,10 @@ function cliEntry() {
|
|
|
637550
637707
|
return process.argv[1] ?? "dist/cli.js";
|
|
637551
637708
|
}
|
|
637552
637709
|
function launchdPlistPath() {
|
|
637553
|
-
return join136(
|
|
637710
|
+
return join136(homedir36(), "Library", "LaunchAgents", "com.anthropic.claude.daemon.plist");
|
|
637554
637711
|
}
|
|
637555
637712
|
function systemdUnitPath() {
|
|
637556
|
-
return join136(
|
|
637713
|
+
return join136(homedir36(), ".config", "systemd", "user", "claude-daemon.service");
|
|
637557
637714
|
}
|
|
637558
637715
|
function installPersistentService() {
|
|
637559
637716
|
const plat = detectInstallPlatform();
|
|
@@ -637588,13 +637745,13 @@ function installLaunchd() {
|
|
|
637588
637745
|
<key>KeepAlive</key>
|
|
637589
637746
|
<true/>
|
|
637590
637747
|
<key>StandardOutPath</key>
|
|
637591
|
-
<string>${join136(
|
|
637748
|
+
<string>${join136(homedir36(), ".claude", "daemon.log")}</string>
|
|
637592
637749
|
<key>StandardErrorPath</key>
|
|
637593
|
-
<string>${join136(
|
|
637750
|
+
<string>${join136(homedir36(), ".claude", "daemon.log")}</string>
|
|
637594
637751
|
</dict>
|
|
637595
637752
|
</plist>
|
|
637596
637753
|
`;
|
|
637597
|
-
|
|
637754
|
+
writeFileSync13(plistPath, plist, { encoding: "utf-8" });
|
|
637598
637755
|
spawnSync9("launchctl", ["unload", plistPath], { stdio: "ignore" });
|
|
637599
637756
|
const res = spawnSync9("launchctl", ["load", plistPath], { encoding: "utf-8" });
|
|
637600
637757
|
logEvent2("daemon_install_launchd", { ok: res.status === 0 });
|
|
@@ -637612,13 +637769,13 @@ Type=simple
|
|
|
637612
637769
|
ExecStart=${process.execPath} ${cliEntry()} daemon start
|
|
637613
637770
|
Restart=on-failure
|
|
637614
637771
|
RestartSec=2
|
|
637615
|
-
StandardOutput=append:${join136(
|
|
637616
|
-
StandardError=append:${join136(
|
|
637772
|
+
StandardOutput=append:${join136(homedir36(), ".claude", "daemon.log")}
|
|
637773
|
+
StandardError=append:${join136(homedir36(), ".claude", "daemon.log")}
|
|
637617
637774
|
|
|
637618
637775
|
[Install]
|
|
637619
637776
|
WantedBy=default.target
|
|
637620
637777
|
`;
|
|
637621
|
-
|
|
637778
|
+
writeFileSync13(unitPath, unit, { encoding: "utf-8" });
|
|
637622
637779
|
spawnSync9("systemctl", ["--user", "daemon-reload"], { stdio: "ignore" });
|
|
637623
637780
|
spawnSync9("systemctl", ["--user", "enable", "claude-daemon.service"], { stdio: "ignore" });
|
|
637624
637781
|
spawnSync9("loginctl", ["enable-linger", process.env.USER ?? "root"], {
|
|
@@ -637659,7 +637816,7 @@ var init_install2 = __esm(() => {
|
|
|
637659
637816
|
import { createServer as createServer7 } from "http";
|
|
637660
637817
|
import { randomBytes as randomBytes16 } from "crypto";
|
|
637661
637818
|
import { join as join137 } from "path";
|
|
637662
|
-
import { existsSync as existsSync21, readFileSync as readFileSync30, writeFileSync as
|
|
637819
|
+
import { existsSync as existsSync21, readFileSync as readFileSync30, writeFileSync as writeFileSync14, unlinkSync as unlinkSync7 } from "fs";
|
|
637663
637820
|
function getRemoteControlSocketPath() {
|
|
637664
637821
|
return join137(getClaudeConfigHomeDir(), REMOTE_SOCKET_NAME);
|
|
637665
637822
|
}
|
|
@@ -637695,7 +637852,7 @@ function loadPromptMirror() {
|
|
|
637695
637852
|
}
|
|
637696
637853
|
function savePromptMirror() {
|
|
637697
637854
|
try {
|
|
637698
|
-
|
|
637855
|
+
writeFileSync14(getRemoteControlPromptsPath(), JSON.stringify(promptQueue), {
|
|
637699
637856
|
encoding: "utf-8"
|
|
637700
637857
|
});
|
|
637701
637858
|
} catch {}
|
|
@@ -637729,7 +637886,7 @@ function loadChannelMirror() {
|
|
|
637729
637886
|
}
|
|
637730
637887
|
function saveChannelMirror() {
|
|
637731
637888
|
try {
|
|
637732
|
-
|
|
637889
|
+
writeFileSync14(getRemoteControlChannelPath(), activeChannel ? JSON.stringify(activeChannel) : "null", { encoding: "utf-8" });
|
|
637733
637890
|
} catch {}
|
|
637734
637891
|
}
|
|
637735
637892
|
function getActiveChannel() {
|
|
@@ -641058,7 +641215,7 @@ __export(exports_copy, {
|
|
|
641058
641215
|
call: () => call17
|
|
641059
641216
|
});
|
|
641060
641217
|
import { mkdir as mkdir41, writeFile as writeFile45 } from "fs/promises";
|
|
641061
|
-
import { tmpdir as
|
|
641218
|
+
import { tmpdir as tmpdir13 } from "os";
|
|
641062
641219
|
import { join as join141 } from "path";
|
|
641063
641220
|
function extractCodeBlocks(markdown) {
|
|
641064
641221
|
const tokens = g4.lexer(stripPromptXMLTags(markdown));
|
|
@@ -641453,7 +641610,7 @@ var init_copy = __esm(() => {
|
|
|
641453
641610
|
import_compiler_runtime128 = __toESM(require_compiler_runtime(), 1);
|
|
641454
641611
|
import_react99 = __toESM(require_react(), 1);
|
|
641455
641612
|
jsx_runtime175 = __toESM(require_jsx_runtime(), 1);
|
|
641456
|
-
COPY_DIR = join141(
|
|
641613
|
+
COPY_DIR = join141(tmpdir13(), "claude");
|
|
641457
641614
|
});
|
|
641458
641615
|
|
|
641459
641616
|
// src/commands/copy/index.ts
|
|
@@ -654252,10 +654409,10 @@ var init_MemoryFileSelector = __esm(() => {
|
|
|
654252
654409
|
});
|
|
654253
654410
|
|
|
654254
654411
|
// src/components/memory/MemoryUpdateNotification.tsx
|
|
654255
|
-
import { homedir as
|
|
654412
|
+
import { homedir as homedir37 } from "os";
|
|
654256
654413
|
import { relative as relative27 } from "path";
|
|
654257
654414
|
function getRelativeMemoryPath(path36) {
|
|
654258
|
-
const homeDir =
|
|
654415
|
+
const homeDir = homedir37();
|
|
654259
654416
|
const cwd2 = getCwd();
|
|
654260
654417
|
const relativeToHome = path36.startsWith(homeDir) ? "~" + path36.slice(homeDir.length) : null;
|
|
654261
654418
|
const relativeToCwd = path36.startsWith(cwd2) ? "./" + relative27(cwd2, path36) : null;
|
|
@@ -665218,7 +665375,7 @@ var init_pluginStartupCheck = __esm(() => {
|
|
|
665218
665375
|
});
|
|
665219
665376
|
|
|
665220
665377
|
// src/utils/plugins/parseMarketplaceInput.ts
|
|
665221
|
-
import { homedir as
|
|
665378
|
+
import { homedir as homedir38 } from "os";
|
|
665222
665379
|
import { resolve as resolve52 } from "path";
|
|
665223
665380
|
async function parseMarketplaceInput(input2) {
|
|
665224
665381
|
const trimmed = input2.trim();
|
|
@@ -665254,7 +665411,7 @@ async function parseMarketplaceInput(input2) {
|
|
|
665254
665411
|
const isWindows3 = process.platform === "win32";
|
|
665255
665412
|
const isWindowsPath = isWindows3 && (trimmed.startsWith(".\\") || trimmed.startsWith("..\\") || /^[a-zA-Z]:[/\\]/.test(trimmed));
|
|
665256
665413
|
if (trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("/") || trimmed.startsWith("~") || isWindowsPath) {
|
|
665257
|
-
const resolvedPath = resolve52(trimmed.startsWith("~") ? trimmed.replace(/^~/,
|
|
665414
|
+
const resolvedPath = resolve52(trimmed.startsWith("~") ? trimmed.replace(/^~/, homedir38()) : trimmed);
|
|
665258
665415
|
let stats;
|
|
665259
665416
|
try {
|
|
665260
665417
|
stats = await fs24.stat(resolvedPath);
|
|
@@ -681901,7 +682058,7 @@ var init_referral = __esm(() => {
|
|
|
681901
682058
|
});
|
|
681902
682059
|
|
|
681903
682060
|
// src/components/LogoV2/feedConfigs.tsx
|
|
681904
|
-
import { homedir as
|
|
682061
|
+
import { homedir as homedir39 } from "os";
|
|
681905
682062
|
function createRecentActivityFeed(activities) {
|
|
681906
682063
|
const lines2 = activities.map((log3) => {
|
|
681907
682064
|
const time3 = formatRelativeTimeAgo(log3.modified);
|
|
@@ -681946,7 +682103,7 @@ function createProjectOnboardingFeed(steps) {
|
|
|
681946
682103
|
text: `${checkmark}${text2}`
|
|
681947
682104
|
};
|
|
681948
682105
|
});
|
|
681949
|
-
const warningText = getCwd() ===
|
|
682106
|
+
const warningText = getCwd() === homedir39() ? "Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead." : undefined;
|
|
681950
682107
|
if (warningText) {
|
|
681951
682108
|
lines2.push({
|
|
681952
682109
|
text: warningText
|
|
@@ -705513,7 +705670,7 @@ var init_rewind = __esm(() => {
|
|
|
705513
705670
|
});
|
|
705514
705671
|
|
|
705515
705672
|
// src/utils/heapDumpService.ts
|
|
705516
|
-
import { createWriteStream as createWriteStream5, writeFileSync as
|
|
705673
|
+
import { createWriteStream as createWriteStream5, writeFileSync as writeFileSync15 } from "fs";
|
|
705517
705674
|
import { readdir as readdir31, readFile as readFile59, writeFile as writeFile53 } from "fs/promises";
|
|
705518
705675
|
import { join as join154 } from "path";
|
|
705519
705676
|
import { pipeline as pipeline4 } from "stream/promises";
|
|
@@ -705652,7 +705809,7 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
|
705652
705809
|
}
|
|
705653
705810
|
async function writeHeapSnapshot(filepath) {
|
|
705654
705811
|
if (typeof Bun !== "undefined") {
|
|
705655
|
-
|
|
705812
|
+
writeFileSync15(filepath, Bun.generateHeapSnapshot("v8", "arraybuffer"), {
|
|
705656
705813
|
mode: 384
|
|
705657
705814
|
});
|
|
705658
705815
|
Bun.gc(true);
|
|
@@ -707520,7 +707677,7 @@ var init_setupPortable = __esm(() => {
|
|
|
707520
707677
|
|
|
707521
707678
|
// src/utils/claudeInChrome/setup.ts
|
|
707522
707679
|
import { chmod as chmod10, mkdir as mkdir48, readFile as readFile60, writeFile as writeFile54 } from "fs/promises";
|
|
707523
|
-
import { homedir as
|
|
707680
|
+
import { homedir as homedir40 } from "os";
|
|
707524
707681
|
import { join as join156 } from "path";
|
|
707525
707682
|
import { fileURLToPath as fileURLToPath9 } from "url";
|
|
707526
707683
|
function shouldEnableClaudeInChrome(chromeFlag) {
|
|
@@ -707600,7 +707757,7 @@ function setupClaudeInChrome() {
|
|
|
707600
707757
|
function getNativeMessagingHostsDirs() {
|
|
707601
707758
|
const platform6 = getPlatform();
|
|
707602
707759
|
if (platform6 === "windows") {
|
|
707603
|
-
const home =
|
|
707760
|
+
const home = homedir40();
|
|
707604
707761
|
const appData = process.env.APPDATA || join156(home, "AppData", "Local");
|
|
707605
707762
|
return [join156(appData, "Claude Code", "ChromeNativeHost")];
|
|
707606
707763
|
}
|
|
@@ -712749,7 +712906,7 @@ var init_force_snip = __esm(() => {
|
|
|
712749
712906
|
});
|
|
712750
712907
|
|
|
712751
712908
|
// src/utils/effort/workflowSavePath.ts
|
|
712752
|
-
import { homedir as
|
|
712909
|
+
import { homedir as homedir41 } from "os";
|
|
712753
712910
|
import { join as join158, sep as sep41 } from "path";
|
|
712754
712911
|
function userWorkflowsDir2() {
|
|
712755
712912
|
return join158(getClaudeConfigHomeDir(), "workflows");
|
|
@@ -712761,7 +712918,7 @@ function resolveWorkflowsDir(scope, cwd2) {
|
|
|
712761
712918
|
return join158(cwd2, ".claude", "workflows");
|
|
712762
712919
|
}
|
|
712763
712920
|
function tildeShortenPath(absPath) {
|
|
712764
|
-
const home =
|
|
712921
|
+
const home = homedir41();
|
|
712765
712922
|
if (absPath === home)
|
|
712766
712923
|
return "~";
|
|
712767
712924
|
if (absPath.startsWith(home + sep41))
|
|
@@ -712782,7 +712939,7 @@ var init_workflowSavePath = __esm(() => {
|
|
|
712782
712939
|
});
|
|
712783
712940
|
|
|
712784
712941
|
// src/components/WorkflowDetailDialog.tsx
|
|
712785
|
-
import { existsSync as existsSync25, mkdirSync as mkdirSync13, readFileSync as readFileSync32, writeFileSync as
|
|
712942
|
+
import { existsSync as existsSync25, mkdirSync as mkdirSync13, readFileSync as readFileSync32, writeFileSync as writeFileSync16 } from "fs";
|
|
712786
712943
|
function launchTypeOf(_task) {
|
|
712787
712944
|
return "background";
|
|
712788
712945
|
}
|
|
@@ -712839,7 +712996,7 @@ function saveDynamicWorkflow(task, scope, overwrite) {
|
|
|
712839
712996
|
}
|
|
712840
712997
|
try {
|
|
712841
712998
|
mkdirSync13(targetDir, { recursive: true });
|
|
712842
|
-
|
|
712999
|
+
writeFileSync16(targetPath, source2, {
|
|
712843
713000
|
encoding: "utf8",
|
|
712844
713001
|
flag: overwrite ? "w" : "wx"
|
|
712845
713002
|
});
|
|
@@ -713881,7 +714038,7 @@ import {
|
|
|
713881
714038
|
unlink as unlink25,
|
|
713882
714039
|
writeFile as writeFile55
|
|
713883
714040
|
} from "fs/promises";
|
|
713884
|
-
import { tmpdir as
|
|
714041
|
+
import { tmpdir as tmpdir14 } from "os";
|
|
713885
714042
|
import { extname as extname17, join as join159 } from "path";
|
|
713886
714043
|
function getAnalysisModel() {
|
|
713887
714044
|
return getDefaultOpusModel();
|
|
@@ -715644,7 +715801,7 @@ var init_insights = __esm(() => {
|
|
|
715644
715801
|
} : async () => 0;
|
|
715645
715802
|
collectFromRemoteHost = process.env.USER_TYPE === "ant" ? async (homespace, destDir) => {
|
|
715646
715803
|
const result = { copied: 0, skipped: 0 };
|
|
715647
|
-
const tempDir = await mkdtemp5(join159(
|
|
715804
|
+
const tempDir = await mkdtemp5(join159(tmpdir14(), "claude-hs-"));
|
|
715648
715805
|
try {
|
|
715649
715806
|
const scpResult = await execFileNoThrow("scp", ["-rq", `${homespace}.coder:/root/.claude/projects/`, tempDir], { timeout: 300000 });
|
|
715650
715807
|
if (scpResult.code !== 0) {
|
|
@@ -720143,7 +720300,7 @@ var init_agentMemory = __esm(() => {
|
|
|
720143
720300
|
|
|
720144
720301
|
// src/utils/permissions/filesystem.ts
|
|
720145
720302
|
import { randomBytes as randomBytes19 } from "crypto";
|
|
720146
|
-
import { homedir as
|
|
720303
|
+
import { homedir as homedir42, tmpdir as tmpdir15 } from "os";
|
|
720147
720304
|
import { join as join163, normalize as normalize16, posix as posix8, sep as sep43 } from "path";
|
|
720148
720305
|
function normalizeCaseForComparison2(path39) {
|
|
720149
720306
|
return path39.toLowerCase();
|
|
@@ -720157,7 +720314,7 @@ function getClaudeSkillScope(filePath) {
|
|
|
720157
720314
|
prefix: "/.claude/skills/"
|
|
720158
720315
|
},
|
|
720159
720316
|
{
|
|
720160
|
-
dir: expandPath(join163(
|
|
720317
|
+
dir: expandPath(join163(homedir42(), ".claude", "skills")),
|
|
720161
720318
|
prefix: "~/.claude/skills/"
|
|
720162
720319
|
}
|
|
720163
720320
|
];
|
|
@@ -720471,7 +720628,7 @@ function patternWithRoot(pattern, source2) {
|
|
|
720471
720628
|
} else if (pattern.startsWith(`~${DIR_SEP}`)) {
|
|
720472
720629
|
return {
|
|
720473
720630
|
relativePattern: pattern.slice(1),
|
|
720474
|
-
root:
|
|
720631
|
+
root: homedir42().normalize("NFC")
|
|
720475
720632
|
};
|
|
720476
720633
|
} else if (pattern.startsWith(DIR_SEP)) {
|
|
720477
720634
|
return {
|
|
@@ -720502,7 +720659,7 @@ function getCachedPatternMatchers(toolPermissionContext, toolType, behavior) {
|
|
|
720502
720659
|
toolType,
|
|
720503
720660
|
behavior,
|
|
720504
720661
|
getPlatform(),
|
|
720505
|
-
|
|
720662
|
+
homedir42(),
|
|
720506
720663
|
getCwd(),
|
|
720507
720664
|
getOriginalCwd(),
|
|
720508
720665
|
additionalDirs
|
|
@@ -721087,7 +721244,7 @@ var init_filesystem = __esm(() => {
|
|
|
721087
721244
|
];
|
|
721088
721245
|
DIR_SEP = posix8.sep;
|
|
721089
721246
|
getClaudeTempDir = memoize_default(function getClaudeTempDir2() {
|
|
721090
|
-
const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (getPlatform() === "windows" ?
|
|
721247
|
+
const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (getPlatform() === "windows" ? tmpdir15() : "/tmp");
|
|
721091
721248
|
const fs25 = getFsImplementation();
|
|
721092
721249
|
let resolvedBaseTmpDir = baseTmpDir;
|
|
721093
721250
|
try {
|
|
@@ -727337,7 +727494,7 @@ import {
|
|
|
727337
727494
|
unlink as unlink28
|
|
727338
727495
|
} from "fs/promises";
|
|
727339
727496
|
import { createServer as createServer8 } from "net";
|
|
727340
|
-
import { homedir as
|
|
727497
|
+
import { homedir as homedir43, platform as platform6 } from "os";
|
|
727341
727498
|
import { join as join166 } from "path";
|
|
727342
727499
|
function log3(message, ...args) {
|
|
727343
727500
|
if (LOG_FILE) {
|
|
@@ -727676,7 +727833,7 @@ var init_chromeNativeHost = __esm(() => {
|
|
|
727676
727833
|
init_slowOperations();
|
|
727677
727834
|
init_common4();
|
|
727678
727835
|
MAX_MESSAGE_SIZE = 1024 * 1024;
|
|
727679
|
-
LOG_FILE = process.env.USER_TYPE === "ant" ? join166(
|
|
727836
|
+
LOG_FILE = process.env.USER_TYPE === "ant" ? join166(homedir43(), ".claude", "debug", "chrome-native-host.txt") : undefined;
|
|
727680
727837
|
messageSchema = lazySchema(() => exports_external.object({
|
|
727681
727838
|
type: exports_external.string()
|
|
727682
727839
|
}).passthrough());
|
|
@@ -728260,7 +728417,7 @@ var init_pollConfig = __esm(() => {
|
|
|
728260
728417
|
// src/bridge/sessionRunner.ts
|
|
728261
728418
|
import { spawn as spawn16 } from "child_process";
|
|
728262
728419
|
import { createWriteStream as createWriteStream6 } from "fs";
|
|
728263
|
-
import { tmpdir as
|
|
728420
|
+
import { tmpdir as tmpdir16 } from "os";
|
|
728264
728421
|
import { dirname as dirname72, join as join167 } from "path";
|
|
728265
728422
|
import { createInterface as createInterface3 } from "readline";
|
|
728266
728423
|
function safeFilenameId(id) {
|
|
@@ -728394,7 +728551,7 @@ function createSessionSpawner(deps) {
|
|
|
728394
728551
|
debugFile = `${deps.debugFile}-${safeId}`;
|
|
728395
728552
|
}
|
|
728396
728553
|
} else if (deps.verbose || process.env.USER_TYPE === "ant") {
|
|
728397
|
-
debugFile = join167(
|
|
728554
|
+
debugFile = join167(tmpdir16(), "claude", `bridge-session-${safeId}.log`);
|
|
728398
728555
|
}
|
|
728399
728556
|
let transcriptStream = null;
|
|
728400
728557
|
let transcriptPath;
|
|
@@ -728937,7 +729094,7 @@ __export(exports_bridgeMain, {
|
|
|
728937
729094
|
BridgeHeadlessPermanentError: () => BridgeHeadlessPermanentError
|
|
728938
729095
|
});
|
|
728939
729096
|
import { randomUUID as randomUUID42 } from "crypto";
|
|
728940
|
-
import { hostname as hostname4, tmpdir as
|
|
729097
|
+
import { hostname as hostname4, tmpdir as tmpdir17 } from "os";
|
|
728941
729098
|
import { basename as basename51, join as join170, resolve as resolve56 } from "path";
|
|
728942
729099
|
async function isMultiSessionSpawnEnabled() {
|
|
728943
729100
|
return checkGate_CACHED_OR_BLOCKING("tengu_ccr_bridge_multi_session");
|
|
@@ -729069,7 +729226,7 @@ async function runBridgeLoop(config8, environmentId, environmentSecret, api5, sp
|
|
|
729069
729226
|
const ext = config8.debugFile.lastIndexOf(".");
|
|
729070
729227
|
debugGlob = ext > 0 ? `${config8.debugFile.slice(0, ext)}-*${config8.debugFile.slice(ext)}` : `${config8.debugFile}-*`;
|
|
729071
729228
|
} else {
|
|
729072
|
-
debugGlob = join170(
|
|
729229
|
+
debugGlob = join170(tmpdir17(), "claude", "bridge-session-*.log");
|
|
729073
729230
|
}
|
|
729074
729231
|
logger30.setDebugLogPath(debugGlob);
|
|
729075
729232
|
}
|
|
@@ -729460,7 +729617,7 @@ async function runBridgeLoop(config8, environmentId, environmentSecret, api5, sp
|
|
|
729460
729617
|
sessionDebugFile = `${config8.debugFile}-${safeId}`;
|
|
729461
729618
|
}
|
|
729462
729619
|
} else if (config8.verbose || process.env.USER_TYPE === "ant") {
|
|
729463
|
-
sessionDebugFile = join170(
|
|
729620
|
+
sessionDebugFile = join170(tmpdir17(), "claude", `bridge-session-${safeId}.log`);
|
|
729464
729621
|
}
|
|
729465
729622
|
if (sessionDebugFile) {
|
|
729466
729623
|
logger30.logVerbose(`Debug log: ${sessionDebugFile}`);
|
|
@@ -730679,7 +730836,7 @@ __export(exports_daemon2, {
|
|
|
730679
730836
|
attachHandler: () => attachHandler,
|
|
730680
730837
|
appendDaemonLog: () => appendDaemonLog
|
|
730681
730838
|
});
|
|
730682
|
-
import { existsSync as existsSync27, mkdirSync as mkdirSync14, readFileSync as readFileSync34, writeFileSync as
|
|
730839
|
+
import { existsSync as existsSync27, mkdirSync as mkdirSync14, readFileSync as readFileSync34, writeFileSync as writeFileSync17, appendFileSync as appendFileSync4 } from "fs";
|
|
730683
730840
|
import { join as join171 } from "path";
|
|
730684
730841
|
import { execSync as execSync4 } from "child_process";
|
|
730685
730842
|
function daemonLogPath2() {
|
|
@@ -730903,8 +731060,8 @@ function writeScheduledConfig(tasks2) {
|
|
|
730903
731060
|
}
|
|
730904
731061
|
current.scheduled = tasks2;
|
|
730905
731062
|
mkdirSync14(join171(path39, ".."), { recursive: true });
|
|
730906
|
-
|
|
730907
|
-
|
|
731063
|
+
writeFileSync17(path39, JSON.stringify(current, null, 2), { encoding: "utf-8" });
|
|
731064
|
+
writeFileSync17(scheduledStatusPath(), JSON.stringify({ tasks: tasks2, updatedAt: Date.now() }, null, 2), {
|
|
730908
731065
|
encoding: "utf-8"
|
|
730909
731066
|
});
|
|
730910
731067
|
}
|
|
@@ -733693,7 +733850,7 @@ __export(exports_upstreamproxy, {
|
|
|
733693
733850
|
SESSION_TOKEN_PATH: () => SESSION_TOKEN_PATH
|
|
733694
733851
|
});
|
|
733695
733852
|
import { mkdir as mkdir57, readFile as readFile65, unlink as unlink30, writeFile as writeFile58 } from "fs/promises";
|
|
733696
|
-
import { homedir as
|
|
733853
|
+
import { homedir as homedir44 } from "os";
|
|
733697
733854
|
import { join as join172 } from "path";
|
|
733698
733855
|
async function initUpstreamProxy(opts) {
|
|
733699
733856
|
if (!isEnvTruthy(process.env.CLAUDE_CODE_REMOTE)) {
|
|
@@ -733715,7 +733872,7 @@ async function initUpstreamProxy(opts) {
|
|
|
733715
733872
|
}
|
|
733716
733873
|
setNonDumpable();
|
|
733717
733874
|
const baseUrl = opts?.ccrBaseUrl ?? process.env.ANTHROPIC_BASE_URL ?? "https://api.anthropic.com";
|
|
733718
|
-
const caBundlePath = opts?.caBundlePath ?? join172(
|
|
733875
|
+
const caBundlePath = opts?.caBundlePath ?? join172(homedir44(), ".ccr", "ca-bundle.crt");
|
|
733719
733876
|
const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
|
|
733720
733877
|
if (!caOk)
|
|
733721
733878
|
return state3;
|
|
@@ -746682,7 +746839,7 @@ var init_ShowInIDEPrompt = __esm(() => {
|
|
|
746682
746839
|
});
|
|
746683
746840
|
|
|
746684
746841
|
// src/components/permissions/FilePermissionDialog/permissionOptions.tsx
|
|
746685
|
-
import { homedir as
|
|
746842
|
+
import { homedir as homedir45 } from "os";
|
|
746686
746843
|
import { basename as basename56, join as join174, sep as sep44 } from "path";
|
|
746687
746844
|
function isInClaudeFolder(filePath) {
|
|
746688
746845
|
const absolutePath = expandPath(filePath);
|
|
@@ -746693,7 +746850,7 @@ function isInClaudeFolder(filePath) {
|
|
|
746693
746850
|
}
|
|
746694
746851
|
function isInGlobalClaudeFolder(filePath) {
|
|
746695
746852
|
const absolutePath = expandPath(filePath);
|
|
746696
|
-
const globalClaudeFolderPath = join174(
|
|
746853
|
+
const globalClaudeFolderPath = join174(homedir45(), ".claude");
|
|
746697
746854
|
const normalizedAbsolutePath = normalizeCaseForComparison2(absolutePath);
|
|
746698
746855
|
const normalizedGlobalClaudeFolderPath = normalizeCaseForComparison2(globalClaudeFolderPath);
|
|
746699
746856
|
return normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + sep44.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + "/");
|
|
@@ -770148,22 +770305,30 @@ function PromptInput({
|
|
|
770148
770305
|
}
|
|
770149
770306
|
}
|
|
770150
770307
|
}, [previousModeBeforeAuto, toolPermissionContext, setAppState, setToolPermissionContext]);
|
|
770308
|
+
const { internal_querier } = use_stdin_default();
|
|
770151
770309
|
const handleImagePaste = import_react261.useCallback(() => {
|
|
770152
|
-
|
|
770153
|
-
if (
|
|
770154
|
-
|
|
770310
|
+
saveClipboardImageToTempFile({ querier: internal_querier }).then((saved) => {
|
|
770311
|
+
if (saved) {
|
|
770312
|
+
insertTextAtCursor(`${saved.path}
|
|
770313
|
+
`);
|
|
770314
|
+
addNotification({
|
|
770315
|
+
key: "clipboard-image-saved",
|
|
770316
|
+
text: `Saved clipboard image \u2192 ${saved.path}`,
|
|
770317
|
+
priority: "immediate",
|
|
770318
|
+
timeoutMs: 4000
|
|
770319
|
+
});
|
|
770155
770320
|
} else {
|
|
770156
770321
|
const shortcutDisplay = getShortcutDisplay("chat:imagePaste", "Chat", "ctrl+v");
|
|
770157
|
-
const message = env4.isSSH() ? "No image found
|
|
770322
|
+
const message = env4.isSSH() ? "No image found. SSH clipboard paths tried: OSC 52 read (terminal may block it), local clipboard, ~/.occ/clipboard-latest.png. Fix: enable OSC 52 read in your terminal (iTerm2/kitty/wezterm), or run `occ-clipboard-watch` on your Mac to auto-scp screenshots here, then press Ctrl+V." : `No image found in clipboard. Use ${shortcutDisplay} to paste images.`;
|
|
770158
770323
|
addNotification({
|
|
770159
770324
|
key: "no-image-in-clipboard",
|
|
770160
770325
|
text: message,
|
|
770161
770326
|
priority: "immediate",
|
|
770162
|
-
timeoutMs:
|
|
770327
|
+
timeoutMs: 8000
|
|
770163
770328
|
});
|
|
770164
770329
|
}
|
|
770165
770330
|
});
|
|
770166
|
-
}, [addNotification,
|
|
770331
|
+
}, [addNotification, insertTextAtCursor, internal_querier]);
|
|
770167
770332
|
const keybindingContext = useOptionalKeybindingContext();
|
|
770168
770333
|
import_react261.useEffect(() => {
|
|
770169
770334
|
if (!keybindingContext || isModalOverlayActive)
|
|
@@ -781131,7 +781296,7 @@ var require_lib20 = __commonJS((exports, module) => {
|
|
|
781131
781296
|
|
|
781132
781297
|
// src/utils/cleanup.ts
|
|
781133
781298
|
import * as fs25 from "fs/promises";
|
|
781134
|
-
import { homedir as
|
|
781299
|
+
import { homedir as homedir46 } from "os";
|
|
781135
781300
|
import { join as join175 } from "path";
|
|
781136
781301
|
function getCutoffDate() {
|
|
781137
781302
|
const settings = getSettings_DEPRECATED() || {};
|
|
@@ -781445,7 +781610,7 @@ async function cleanupNpmCacheForAnthropicPackages() {
|
|
|
781445
781610
|
return;
|
|
781446
781611
|
}
|
|
781447
781612
|
logForDebugging("npm cache cleanup: starting");
|
|
781448
|
-
const npmCachePath = join175(
|
|
781613
|
+
const npmCachePath = join175(homedir46(), ".npm", "_cacache");
|
|
781449
781614
|
const NPM_CACHE_RETENTION_COUNT = 5;
|
|
781450
781615
|
const startTime2 = Date.now();
|
|
781451
781616
|
try {
|
|
@@ -795373,10 +795538,10 @@ function FleetViewScreen(props) {
|
|
|
795373
795538
|
for (const task of Object.values(tasks2)) {
|
|
795374
795539
|
if (task.status === "running" && task.pid) {
|
|
795375
795540
|
try {
|
|
795376
|
-
const { writeFileSync:
|
|
795541
|
+
const { writeFileSync: writeFileSync18 } = __require("fs");
|
|
795377
795542
|
const { join: join181 } = __require("path");
|
|
795378
795543
|
const heartbeatPath = join181(__require("os").tmpdir(), `.fleetview-heartbeat-${task.pid}`);
|
|
795379
|
-
|
|
795544
|
+
writeFileSync18(heartbeatPath, String(Date.now()));
|
|
795380
795545
|
} catch {}
|
|
795381
795546
|
}
|
|
795382
795547
|
}
|
|
@@ -796449,7 +796614,7 @@ __export(exports_REPL, {
|
|
|
796449
796614
|
});
|
|
796450
796615
|
import { spawnSync as spawnSync14 } from "child_process";
|
|
796451
796616
|
import { dirname as dirname79, join as join182 } from "path";
|
|
796452
|
-
import { tmpdir as
|
|
796617
|
+
import { tmpdir as tmpdir18 } from "os";
|
|
796453
796618
|
import { writeFile as writeFile62 } from "fs/promises";
|
|
796454
796619
|
import { randomUUID as randomUUID63 } from "crypto";
|
|
796455
796620
|
function TranscriptModeFooter(t0) {
|
|
@@ -799236,7 +799401,7 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input.
|
|
|
799236
799401
|
const w4 = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
799237
799402
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w4);
|
|
799238
799403
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
799239
|
-
const path43 = join182(
|
|
799404
|
+
const path43 = join182(tmpdir18(), `cc-transcript-${Date.now()}.txt`);
|
|
799240
799405
|
await writeFile62(path43, text2);
|
|
799241
799406
|
const opened = openFileInExternalEditor(path43);
|
|
799242
799407
|
setStatus(opened ? `opening ${path43}` : `wrote ${path43} \xB7 no $VISUAL/$EDITOR set`);
|
|
@@ -802997,7 +803162,7 @@ var exports_TrustDialog = {};
|
|
|
802997
803162
|
__export(exports_TrustDialog, {
|
|
802998
803163
|
TrustDialog: () => TrustDialog
|
|
802999
803164
|
});
|
|
803000
|
-
import { homedir as
|
|
803165
|
+
import { homedir as homedir48 } from "os";
|
|
803001
803166
|
function TrustDialog(t0) {
|
|
803002
803167
|
const $4 = import_compiler_runtime356.c(33);
|
|
803003
803168
|
const {
|
|
@@ -803108,7 +803273,7 @@ function TrustDialog(t0) {
|
|
|
803108
803273
|
let t13;
|
|
803109
803274
|
if ($4[13] !== hasAnyBashExecution) {
|
|
803110
803275
|
t12 = () => {
|
|
803111
|
-
const isHomeDir =
|
|
803276
|
+
const isHomeDir = homedir48() === getCwd();
|
|
803112
803277
|
logEvent2("tengu_trust_dialog_shown", {
|
|
803113
803278
|
isHomeDir,
|
|
803114
803279
|
hasMcpServers,
|
|
@@ -803137,7 +803302,7 @@ function TrustDialog(t0) {
|
|
|
803137
803302
|
gracefulShutdownSync(1);
|
|
803138
803303
|
return;
|
|
803139
803304
|
}
|
|
803140
|
-
const isHomeDir_0 =
|
|
803305
|
+
const isHomeDir_0 = homedir48() === getCwd();
|
|
803141
803306
|
logEvent2("tengu_trust_dialog_accept", {
|
|
803142
803307
|
isHomeDir: isHomeDir_0,
|
|
803143
803308
|
hasMcpServers,
|
|
@@ -808629,7 +808794,7 @@ var init_bundled3 = __esm(() => {
|
|
|
808629
808794
|
|
|
808630
808795
|
// src/utils/deepLink/banner.ts
|
|
808631
808796
|
import { stat as stat53 } from "fs/promises";
|
|
808632
|
-
import { homedir as
|
|
808797
|
+
import { homedir as homedir49 } from "os";
|
|
808633
808798
|
import { join as join183, sep as sep48 } from "path";
|
|
808634
808799
|
function buildDeepLinkBanner(info) {
|
|
808635
808800
|
const lines2 = [
|
|
@@ -808668,7 +808833,7 @@ async function mtimeOrUndefined(p4) {
|
|
|
808668
808833
|
}
|
|
808669
808834
|
}
|
|
808670
808835
|
function tildify(p4) {
|
|
808671
|
-
const home =
|
|
808836
|
+
const home = homedir49();
|
|
808672
808837
|
if (p4 === home)
|
|
808673
808838
|
return "~";
|
|
808674
808839
|
if (p4.startsWith(home + sep48))
|
|
@@ -809969,7 +810134,7 @@ __export(exports_protocolHandler, {
|
|
|
809969
810134
|
handleUrlSchemeLaunch: () => handleUrlSchemeLaunch,
|
|
809970
810135
|
handleDeepLinkUri: () => handleDeepLinkUri
|
|
809971
810136
|
});
|
|
809972
|
-
import { homedir as
|
|
810137
|
+
import { homedir as homedir50 } from "os";
|
|
809973
810138
|
async function handleDeepLinkUri(uri3) {
|
|
809974
810139
|
logForDebugging(`Handling deep link URI: ${uri3}`);
|
|
809975
810140
|
let action2;
|
|
@@ -810023,7 +810188,7 @@ async function resolveCwd(action2) {
|
|
|
810023
810188
|
}
|
|
810024
810189
|
logForDebugging(`No local clone found for repo ${action2.repo}, falling back to home`);
|
|
810025
810190
|
}
|
|
810026
|
-
return { cwd:
|
|
810191
|
+
return { cwd: homedir50() };
|
|
810027
810192
|
}
|
|
810028
810193
|
var init_protocolHandler = __esm(() => {
|
|
810029
810194
|
init_debug();
|
|
@@ -810266,7 +810431,7 @@ var init_sessionMemory = __esm(() => {
|
|
|
810266
810431
|
|
|
810267
810432
|
// src/utils/iTermBackup.ts
|
|
810268
810433
|
import { copyFile as copyFile12, stat as stat54 } from "fs/promises";
|
|
810269
|
-
import { homedir as
|
|
810434
|
+
import { homedir as homedir51 } from "os";
|
|
810270
810435
|
import { join as join186 } from "path";
|
|
810271
810436
|
function markITerm2SetupComplete() {
|
|
810272
810437
|
saveGlobalConfig((current) => ({
|
|
@@ -810282,7 +810447,7 @@ function getIterm2RecoveryInfo() {
|
|
|
810282
810447
|
};
|
|
810283
810448
|
}
|
|
810284
810449
|
function getITerm2PlistPath() {
|
|
810285
|
-
return join186(
|
|
810450
|
+
return join186(homedir51(), "Library", "Preferences", "com.googlecode.iterm2.plist");
|
|
810286
810451
|
}
|
|
810287
810452
|
async function checkAndRestoreITerm2Backup() {
|
|
810288
810453
|
const { inProgress, backupPath } = getIterm2RecoveryInfo();
|
|
@@ -816392,7 +816557,7 @@ __export(exports_claudeDesktop, {
|
|
|
816392
816557
|
getClaudeDesktopConfigPath: () => getClaudeDesktopConfigPath
|
|
816393
816558
|
});
|
|
816394
816559
|
import { readdir as readdir38, readFile as readFile70, stat as stat56 } from "fs/promises";
|
|
816395
|
-
import { homedir as
|
|
816560
|
+
import { homedir as homedir52 } from "os";
|
|
816396
816561
|
import { join as join189 } from "path";
|
|
816397
816562
|
async function getClaudeDesktopConfigPath() {
|
|
816398
816563
|
const platform7 = getPlatform();
|
|
@@ -816400,7 +816565,7 @@ async function getClaudeDesktopConfigPath() {
|
|
|
816400
816565
|
throw new Error(`Unsupported platform: ${platform7} - Claude Desktop integration only works on macOS and WSL.`);
|
|
816401
816566
|
}
|
|
816402
816567
|
if (platform7 === "macos") {
|
|
816403
|
-
return join189(
|
|
816568
|
+
return join189(homedir52(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
|
|
816404
816569
|
}
|
|
816405
816570
|
const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
|
|
816406
816571
|
if (windowsHome) {
|
|
@@ -817400,11 +817565,11 @@ var exports_install = {};
|
|
|
817400
817565
|
__export(exports_install, {
|
|
817401
817566
|
install: () => install2
|
|
817402
817567
|
});
|
|
817403
|
-
import { homedir as
|
|
817568
|
+
import { homedir as homedir53 } from "os";
|
|
817404
817569
|
import { join as join190 } from "path";
|
|
817405
817570
|
function getInstallationPath2() {
|
|
817406
817571
|
const isWindows3 = env4.platform === "win32";
|
|
817407
|
-
const homeDir =
|
|
817572
|
+
const homeDir = homedir53();
|
|
817408
817573
|
if (isWindows3) {
|
|
817409
817574
|
const windowsPath = join190(homeDir, ".local", "bin", "claude.exe");
|
|
817410
817575
|
return windowsPath.replace(/\//g, "\\");
|