@cnwenf/occ 2.1.271 → 2.1.272
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 +111 -52
- 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.272","BUILD_TIME":"2026-07-17T04:12:49.768Z","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;
|
|
@@ -448127,6 +448127,8 @@ var init_use_declared_cursor = __esm(() => {
|
|
|
448127
448127
|
|
|
448128
448128
|
// src/utils/imagePaste.ts
|
|
448129
448129
|
import { randomBytes as randomBytes9 } from "crypto";
|
|
448130
|
+
import { writeFileSync as writeFileSync9 } from "fs";
|
|
448131
|
+
import { tmpdir as tmpdir8 } from "os";
|
|
448130
448132
|
import { basename as basename21, extname as extname12, isAbsolute as isAbsolute20, join as join93 } from "path";
|
|
448131
448133
|
function getClipboardCommands() {
|
|
448132
448134
|
const platform5 = process.platform;
|
|
@@ -448164,8 +448166,21 @@ function getClipboardCommands() {
|
|
|
448164
448166
|
};
|
|
448165
448167
|
}
|
|
448166
448168
|
async function hasImageInClipboard() {
|
|
448169
|
+
const overrideSrc = getClipboardImageSrcOverride();
|
|
448170
|
+
if (overrideSrc && getFsImplementation().existsSync(overrideSrc)) {
|
|
448171
|
+
return true;
|
|
448172
|
+
}
|
|
448167
448173
|
if (process.platform !== "darwin") {
|
|
448168
|
-
|
|
448174
|
+
const { commands: commands7 } = getClipboardCommands();
|
|
448175
|
+
try {
|
|
448176
|
+
const result2 = await execa(commands7.checkImage, {
|
|
448177
|
+
shell: true,
|
|
448178
|
+
reject: false
|
|
448179
|
+
});
|
|
448180
|
+
return result2.exitCode === 0;
|
|
448181
|
+
} catch {
|
|
448182
|
+
return false;
|
|
448183
|
+
}
|
|
448169
448184
|
}
|
|
448170
448185
|
if (feature("NATIVE_CLIPBOARD_IMAGE") && getFeatureValue_CACHED_MAY_BE_STALE("tengu_collage_kaleidoscope", true)) {
|
|
448171
448186
|
try {
|
|
@@ -448277,6 +448292,42 @@ async function getImagePathFromClipboard() {
|
|
|
448277
448292
|
return null;
|
|
448278
448293
|
}
|
|
448279
448294
|
}
|
|
448295
|
+
function getClipboardImageSrcOverride() {
|
|
448296
|
+
const v6 = process.env[CLIPBOARD_IMAGE_SRC_ENV];
|
|
448297
|
+
return v6 && v6.length > 0 ? v6 : undefined;
|
|
448298
|
+
}
|
|
448299
|
+
async function saveClipboardImageToTempFile() {
|
|
448300
|
+
try {
|
|
448301
|
+
const overrideSrc = getClipboardImageSrcOverride();
|
|
448302
|
+
if (overrideSrc && getFsImplementation().existsSync(overrideSrc)) {
|
|
448303
|
+
const buffer2 = getFsImplementation().readFileBytesSync(overrideSrc);
|
|
448304
|
+
const mediaType = detectImageFormatFromBase64(buffer2.toString("base64"));
|
|
448305
|
+
return writeUniqueTempImageFile(buffer2, mediaType);
|
|
448306
|
+
}
|
|
448307
|
+
const image = await getImageFromClipboard();
|
|
448308
|
+
if (!image) {
|
|
448309
|
+
return null;
|
|
448310
|
+
}
|
|
448311
|
+
const buffer = Buffer.from(image.base64, "base64");
|
|
448312
|
+
return writeUniqueTempImageFile(buffer, image.mediaType, image.dimensions);
|
|
448313
|
+
} catch (e4) {
|
|
448314
|
+
logError2(e4);
|
|
448315
|
+
return null;
|
|
448316
|
+
}
|
|
448317
|
+
}
|
|
448318
|
+
function writeUniqueTempImageFile(buffer, mediaType, dimensions) {
|
|
448319
|
+
const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (process.platform === "win32" ? process.env.TEMP || "C:\\Temp" : tmpdir8());
|
|
448320
|
+
const ext = mediaType.replace(/^image\//, "").toLowerCase();
|
|
448321
|
+
const safeExt = TEMP_IMAGE_EXT_ALLOW.test(ext) ? ext.replace("jpeg", "jpg") : "png";
|
|
448322
|
+
const name3 = `occ-clipboard-${Date.now()}-${randomBytes9(6).toString("hex")}.${safeExt}`;
|
|
448323
|
+
const filePath = join93(baseTmpDir, name3);
|
|
448324
|
+
writeFileSync9(filePath, buffer);
|
|
448325
|
+
return {
|
|
448326
|
+
path: filePath,
|
|
448327
|
+
mediaType: `image/${safeExt === "jpg" ? "jpeg" : safeExt}`,
|
|
448328
|
+
dimensions
|
|
448329
|
+
};
|
|
448330
|
+
}
|
|
448280
448331
|
function removeOuterQuotes(text2) {
|
|
448281
448332
|
if (text2.startsWith('"') && text2.endsWith('"') || text2.startsWith("'") && text2.endsWith("'")) {
|
|
448282
448333
|
return text2.slice(1, -1);
|
|
@@ -448349,7 +448400,7 @@ async function tryReadImageFromPath(text2) {
|
|
|
448349
448400
|
dimensions: resized.dimensions
|
|
448350
448401
|
};
|
|
448351
448402
|
}
|
|
448352
|
-
var PASTE_THRESHOLD = 800, IMAGE_EXTENSION_REGEX;
|
|
448403
|
+
var PASTE_THRESHOLD = 800, CLIPBOARD_IMAGE_SRC_ENV = "OCC_CLIPBOARD_IMAGE_SRC", TEMP_IMAGE_EXT_ALLOW, IMAGE_EXTENSION_REGEX;
|
|
448353
448404
|
var init_imagePaste = __esm(() => {
|
|
448354
448405
|
init_featureFlags();
|
|
448355
448406
|
init_execa();
|
|
@@ -448361,6 +448412,7 @@ var init_imagePaste = __esm(() => {
|
|
|
448361
448412
|
init_fsOperations();
|
|
448362
448413
|
init_imageResizer();
|
|
448363
448414
|
init_log3();
|
|
448415
|
+
TEMP_IMAGE_EXT_ALLOW = /^(png|jpe?g|gif|webp|bmp)$/i;
|
|
448364
448416
|
IMAGE_EXTENSION_REGEX = /\.(png|jpe?g|gif|webp)$/i;
|
|
448365
448417
|
});
|
|
448366
448418
|
|
|
@@ -459148,7 +459200,7 @@ __export(exports_teamHelpers, {
|
|
|
459148
459200
|
cleanupSessionTeams: () => cleanupSessionTeams,
|
|
459149
459201
|
addHiddenPaneId: () => addHiddenPaneId
|
|
459150
459202
|
});
|
|
459151
|
-
import { mkdirSync as mkdirSync8, readFileSync as readFileSync21, writeFileSync as
|
|
459203
|
+
import { mkdirSync as mkdirSync8, readFileSync as readFileSync21, writeFileSync as writeFileSync10 } from "fs";
|
|
459152
459204
|
import { mkdir as mkdir25, readFile as readFile33, rm as rm5, writeFile as writeFile25 } from "fs/promises";
|
|
459153
459205
|
import { join as join96 } from "path";
|
|
459154
459206
|
function sanitizeName(name3) {
|
|
@@ -459188,7 +459240,7 @@ async function readTeamFileAsync(teamName) {
|
|
|
459188
459240
|
function writeTeamFile(teamName, teamFile) {
|
|
459189
459241
|
const teamDir = getTeamDir(teamName);
|
|
459190
459242
|
mkdirSync8(teamDir, { recursive: true });
|
|
459191
|
-
|
|
459243
|
+
writeFileSync10(getTeamFilePath(teamName), jsonStringify(teamFile, null, 2));
|
|
459192
459244
|
}
|
|
459193
459245
|
async function writeTeamFileAsync(teamName, teamFile) {
|
|
459194
459246
|
const teamDir = getTeamDir(teamName);
|
|
@@ -476844,11 +476896,11 @@ var init_filesApi = __esm(() => {
|
|
|
476844
476896
|
|
|
476845
476897
|
// src/utils/tempfile.ts
|
|
476846
476898
|
import { createHash as createHash23, randomUUID as randomUUID19 } from "crypto";
|
|
476847
|
-
import { tmpdir as
|
|
476899
|
+
import { tmpdir as tmpdir9 } from "os";
|
|
476848
476900
|
import { join as join98 } from "path";
|
|
476849
476901
|
function generateTempFilePath(prefix = "claude-prompt", extension = ".md", options) {
|
|
476850
476902
|
const id = options?.contentHash ? createHash23("sha256").update(options.contentHash).digest("hex").slice(0, 16) : randomUUID19();
|
|
476851
|
-
return join98(
|
|
476903
|
+
return join98(tmpdir9(), `${prefix}-${id}${extension}`);
|
|
476852
476904
|
}
|
|
476853
476905
|
var init_tempfile = () => {};
|
|
476854
476906
|
|
|
@@ -572705,7 +572757,7 @@ var init_PipeTransport = __esm(() => {
|
|
|
572705
572757
|
|
|
572706
572758
|
// node_modules/.bun/puppeteer-core@24.43.1/node_modules/puppeteer-core/lib/esm/puppeteer/node/BrowserLauncher.js
|
|
572707
572759
|
import { existsSync as existsSync14 } from "fs";
|
|
572708
|
-
import { tmpdir as
|
|
572760
|
+
import { tmpdir as tmpdir10 } from "os";
|
|
572709
572761
|
import { join as join102 } from "path";
|
|
572710
572762
|
|
|
572711
572763
|
class BrowserLauncher {
|
|
@@ -572904,7 +572956,7 @@ class BrowserLauncher {
|
|
|
572904
572956
|
});
|
|
572905
572957
|
}
|
|
572906
572958
|
getProfilePath() {
|
|
572907
|
-
return join102(this.puppeteer.configuration.temporaryDirectory ??
|
|
572959
|
+
return join102(this.puppeteer.configuration.temporaryDirectory ?? tmpdir10(), `puppeteer_dev_${this.browser}_profile-`);
|
|
572908
572960
|
}
|
|
572909
572961
|
resolveExecutablePath(headless, validatePath2 = true) {
|
|
572910
572962
|
let executablePath = this.puppeteer.configuration.executablePath;
|
|
@@ -585970,7 +586022,7 @@ var init_WorkflowProgressTree = __esm(() => {
|
|
|
585970
586022
|
});
|
|
585971
586023
|
|
|
585972
586024
|
// src/utils/wfProgress.ts
|
|
585973
|
-
import { existsSync as existsSync17, mkdirSync as mkdirSync9, readFileSync as readFileSync27, readdirSync as readdirSync9, unlinkSync as unlinkSync4, writeFileSync as
|
|
586025
|
+
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
586026
|
import { join as join109 } from "path";
|
|
585975
586027
|
function getWfProgressDir() {
|
|
585976
586028
|
return join109(getClaudeConfigHomeDir(), "wf-progress");
|
|
@@ -585986,7 +586038,7 @@ function writeWorkflowProgress(runId, data) {
|
|
|
585986
586038
|
};
|
|
585987
586039
|
const target = join109(dir, `${runId}.json`);
|
|
585988
586040
|
const tmp = join109(dir, `${runId}.json.tmp`);
|
|
585989
|
-
|
|
586041
|
+
writeFileSync11(tmp, JSON.stringify(payload), { encoding: "utf-8" });
|
|
585990
586042
|
renameSync3(tmp, target);
|
|
585991
586043
|
} catch {}
|
|
585992
586044
|
}
|
|
@@ -596280,7 +596332,7 @@ __export(exports_src3, {
|
|
|
596280
596332
|
ComputerUseAPI: () => ComputerUseAPI
|
|
596281
596333
|
});
|
|
596282
596334
|
import { readFileSync as readFileSync28, unlinkSync as unlinkSync5 } from "fs";
|
|
596283
|
-
import { tmpdir as
|
|
596335
|
+
import { tmpdir as tmpdir11 } from "os";
|
|
596284
596336
|
import { join as join112 } from "path";
|
|
596285
596337
|
function jxaSync(script) {
|
|
596286
596338
|
const result = Bun.spawnSync({
|
|
@@ -596309,7 +596361,7 @@ async function jxa(script) {
|
|
|
596309
596361
|
return text2.trim();
|
|
596310
596362
|
}
|
|
596311
596363
|
async function captureScreenToBase64(args) {
|
|
596312
|
-
const tmpFile = join112(
|
|
596364
|
+
const tmpFile = join112(tmpdir11(), `cu-screenshot-${Date.now()}.png`);
|
|
596313
596365
|
const proc = Bun.spawn(["screencapture", ...args, tmpFile], {
|
|
596314
596366
|
stdout: "pipe",
|
|
596315
596367
|
stderr: "pipe"
|
|
@@ -608930,7 +608982,7 @@ import {
|
|
|
608930
608982
|
stat as stat36,
|
|
608931
608983
|
writeFile as writeFile36
|
|
608932
608984
|
} from "fs/promises";
|
|
608933
|
-
import { tmpdir as
|
|
608985
|
+
import { tmpdir as tmpdir12 } from "os";
|
|
608934
608986
|
import { basename as basename35, dirname as dirname50, join as join118 } from "path";
|
|
608935
608987
|
function isPluginZipCacheEnabled() {
|
|
608936
608988
|
return isEnvTruthy(process.env.CLAUDE_CODE_PLUGIN_USE_ZIP_CACHE);
|
|
@@ -608970,7 +609022,7 @@ async function getSessionPluginCachePath() {
|
|
|
608970
609022
|
if (!sessionPluginCachePromise) {
|
|
608971
609023
|
sessionPluginCachePromise = (async () => {
|
|
608972
609024
|
const suffix = randomBytes10(8).toString("hex");
|
|
608973
|
-
const dir = join118(
|
|
609025
|
+
const dir = join118(tmpdir12(), `claude-plugin-session-${suffix}`);
|
|
608974
609026
|
await getFsImplementation().mkdir(dir);
|
|
608975
609027
|
sessionPluginCachePath = dir;
|
|
608976
609028
|
logForDebugging(`Created session plugin cache at ${dir}`);
|
|
@@ -637168,7 +637220,7 @@ __export(exports_workerRegistry, {
|
|
|
637168
637220
|
DEFAULT_PREWARM_PER_SWEEP: () => DEFAULT_PREWARM_PER_SWEEP
|
|
637169
637221
|
});
|
|
637170
637222
|
import { spawn as spawn13 } from "child_process";
|
|
637171
|
-
import { existsSync as existsSync19, readFileSync as readFileSync29, writeFileSync as
|
|
637223
|
+
import { existsSync as existsSync19, readFileSync as readFileSync29, writeFileSync as writeFileSync12 } from "fs";
|
|
637172
637224
|
import { join as join135 } from "path";
|
|
637173
637225
|
function getDaemonJsonPath() {
|
|
637174
637226
|
return join135(getClaudeConfigHomeDir(), "daemon.json");
|
|
@@ -637238,12 +637290,12 @@ function writeDaemonStatus() {
|
|
|
637238
637290
|
id: r4.id,
|
|
637239
637291
|
exitCode: r4.exitCode
|
|
637240
637292
|
}));
|
|
637241
|
-
|
|
637293
|
+
writeFileSync12(getDaemonStatusPath(), JSON.stringify(snapshot2), { encoding: "utf-8" });
|
|
637242
637294
|
} catch {}
|
|
637243
637295
|
}
|
|
637244
637296
|
function writeDaemonJson(config7) {
|
|
637245
637297
|
try {
|
|
637246
|
-
|
|
637298
|
+
writeFileSync12(getDaemonJsonPath(), JSON.stringify(config7, null, 2), {
|
|
637247
637299
|
encoding: "utf-8"
|
|
637248
637300
|
});
|
|
637249
637301
|
} catch {}
|
|
@@ -637533,7 +637585,7 @@ var init_respawn = __esm(() => {
|
|
|
637533
637585
|
});
|
|
637534
637586
|
|
|
637535
637587
|
// src/daemon/install.ts
|
|
637536
|
-
import { existsSync as existsSync20, mkdirSync as mkdirSync10, writeFileSync as
|
|
637588
|
+
import { existsSync as existsSync20, mkdirSync as mkdirSync10, writeFileSync as writeFileSync13, unlinkSync as unlinkSync6 } from "fs";
|
|
637537
637589
|
import { homedir as homedir35 } from "os";
|
|
637538
637590
|
import { join as join136 } from "path";
|
|
637539
637591
|
import { spawnSync as spawnSync9 } from "child_process";
|
|
@@ -637594,7 +637646,7 @@ function installLaunchd() {
|
|
|
637594
637646
|
</dict>
|
|
637595
637647
|
</plist>
|
|
637596
637648
|
`;
|
|
637597
|
-
|
|
637649
|
+
writeFileSync13(plistPath, plist, { encoding: "utf-8" });
|
|
637598
637650
|
spawnSync9("launchctl", ["unload", plistPath], { stdio: "ignore" });
|
|
637599
637651
|
const res = spawnSync9("launchctl", ["load", plistPath], { encoding: "utf-8" });
|
|
637600
637652
|
logEvent2("daemon_install_launchd", { ok: res.status === 0 });
|
|
@@ -637618,7 +637670,7 @@ StandardError=append:${join136(homedir35(), ".claude", "daemon.log")}
|
|
|
637618
637670
|
[Install]
|
|
637619
637671
|
WantedBy=default.target
|
|
637620
637672
|
`;
|
|
637621
|
-
|
|
637673
|
+
writeFileSync13(unitPath, unit, { encoding: "utf-8" });
|
|
637622
637674
|
spawnSync9("systemctl", ["--user", "daemon-reload"], { stdio: "ignore" });
|
|
637623
637675
|
spawnSync9("systemctl", ["--user", "enable", "claude-daemon.service"], { stdio: "ignore" });
|
|
637624
637676
|
spawnSync9("loginctl", ["enable-linger", process.env.USER ?? "root"], {
|
|
@@ -637659,7 +637711,7 @@ var init_install2 = __esm(() => {
|
|
|
637659
637711
|
import { createServer as createServer7 } from "http";
|
|
637660
637712
|
import { randomBytes as randomBytes16 } from "crypto";
|
|
637661
637713
|
import { join as join137 } from "path";
|
|
637662
|
-
import { existsSync as existsSync21, readFileSync as readFileSync30, writeFileSync as
|
|
637714
|
+
import { existsSync as existsSync21, readFileSync as readFileSync30, writeFileSync as writeFileSync14, unlinkSync as unlinkSync7 } from "fs";
|
|
637663
637715
|
function getRemoteControlSocketPath() {
|
|
637664
637716
|
return join137(getClaudeConfigHomeDir(), REMOTE_SOCKET_NAME);
|
|
637665
637717
|
}
|
|
@@ -637695,7 +637747,7 @@ function loadPromptMirror() {
|
|
|
637695
637747
|
}
|
|
637696
637748
|
function savePromptMirror() {
|
|
637697
637749
|
try {
|
|
637698
|
-
|
|
637750
|
+
writeFileSync14(getRemoteControlPromptsPath(), JSON.stringify(promptQueue), {
|
|
637699
637751
|
encoding: "utf-8"
|
|
637700
637752
|
});
|
|
637701
637753
|
} catch {}
|
|
@@ -637729,7 +637781,7 @@ function loadChannelMirror() {
|
|
|
637729
637781
|
}
|
|
637730
637782
|
function saveChannelMirror() {
|
|
637731
637783
|
try {
|
|
637732
|
-
|
|
637784
|
+
writeFileSync14(getRemoteControlChannelPath(), activeChannel ? JSON.stringify(activeChannel) : "null", { encoding: "utf-8" });
|
|
637733
637785
|
} catch {}
|
|
637734
637786
|
}
|
|
637735
637787
|
function getActiveChannel() {
|
|
@@ -641058,7 +641110,7 @@ __export(exports_copy, {
|
|
|
641058
641110
|
call: () => call17
|
|
641059
641111
|
});
|
|
641060
641112
|
import { mkdir as mkdir41, writeFile as writeFile45 } from "fs/promises";
|
|
641061
|
-
import { tmpdir as
|
|
641113
|
+
import { tmpdir as tmpdir13 } from "os";
|
|
641062
641114
|
import { join as join141 } from "path";
|
|
641063
641115
|
function extractCodeBlocks(markdown) {
|
|
641064
641116
|
const tokens = g4.lexer(stripPromptXMLTags(markdown));
|
|
@@ -641453,7 +641505,7 @@ var init_copy = __esm(() => {
|
|
|
641453
641505
|
import_compiler_runtime128 = __toESM(require_compiler_runtime(), 1);
|
|
641454
641506
|
import_react99 = __toESM(require_react(), 1);
|
|
641455
641507
|
jsx_runtime175 = __toESM(require_jsx_runtime(), 1);
|
|
641456
|
-
COPY_DIR = join141(
|
|
641508
|
+
COPY_DIR = join141(tmpdir13(), "claude");
|
|
641457
641509
|
});
|
|
641458
641510
|
|
|
641459
641511
|
// src/commands/copy/index.ts
|
|
@@ -705513,7 +705565,7 @@ var init_rewind = __esm(() => {
|
|
|
705513
705565
|
});
|
|
705514
705566
|
|
|
705515
705567
|
// src/utils/heapDumpService.ts
|
|
705516
|
-
import { createWriteStream as createWriteStream5, writeFileSync as
|
|
705568
|
+
import { createWriteStream as createWriteStream5, writeFileSync as writeFileSync15 } from "fs";
|
|
705517
705569
|
import { readdir as readdir31, readFile as readFile59, writeFile as writeFile53 } from "fs/promises";
|
|
705518
705570
|
import { join as join154 } from "path";
|
|
705519
705571
|
import { pipeline as pipeline4 } from "stream/promises";
|
|
@@ -705652,7 +705704,7 @@ async function performHeapDump(trigger = "manual", dumpNumber = 0) {
|
|
|
705652
705704
|
}
|
|
705653
705705
|
async function writeHeapSnapshot(filepath) {
|
|
705654
705706
|
if (typeof Bun !== "undefined") {
|
|
705655
|
-
|
|
705707
|
+
writeFileSync15(filepath, Bun.generateHeapSnapshot("v8", "arraybuffer"), {
|
|
705656
705708
|
mode: 384
|
|
705657
705709
|
});
|
|
705658
705710
|
Bun.gc(true);
|
|
@@ -712782,7 +712834,7 @@ var init_workflowSavePath = __esm(() => {
|
|
|
712782
712834
|
});
|
|
712783
712835
|
|
|
712784
712836
|
// src/components/WorkflowDetailDialog.tsx
|
|
712785
|
-
import { existsSync as existsSync25, mkdirSync as mkdirSync13, readFileSync as readFileSync32, writeFileSync as
|
|
712837
|
+
import { existsSync as existsSync25, mkdirSync as mkdirSync13, readFileSync as readFileSync32, writeFileSync as writeFileSync16 } from "fs";
|
|
712786
712838
|
function launchTypeOf(_task) {
|
|
712787
712839
|
return "background";
|
|
712788
712840
|
}
|
|
@@ -712839,7 +712891,7 @@ function saveDynamicWorkflow(task, scope, overwrite) {
|
|
|
712839
712891
|
}
|
|
712840
712892
|
try {
|
|
712841
712893
|
mkdirSync13(targetDir, { recursive: true });
|
|
712842
|
-
|
|
712894
|
+
writeFileSync16(targetPath, source2, {
|
|
712843
712895
|
encoding: "utf8",
|
|
712844
712896
|
flag: overwrite ? "w" : "wx"
|
|
712845
712897
|
});
|
|
@@ -713881,7 +713933,7 @@ import {
|
|
|
713881
713933
|
unlink as unlink25,
|
|
713882
713934
|
writeFile as writeFile55
|
|
713883
713935
|
} from "fs/promises";
|
|
713884
|
-
import { tmpdir as
|
|
713936
|
+
import { tmpdir as tmpdir14 } from "os";
|
|
713885
713937
|
import { extname as extname17, join as join159 } from "path";
|
|
713886
713938
|
function getAnalysisModel() {
|
|
713887
713939
|
return getDefaultOpusModel();
|
|
@@ -715644,7 +715696,7 @@ var init_insights = __esm(() => {
|
|
|
715644
715696
|
} : async () => 0;
|
|
715645
715697
|
collectFromRemoteHost = process.env.USER_TYPE === "ant" ? async (homespace, destDir) => {
|
|
715646
715698
|
const result = { copied: 0, skipped: 0 };
|
|
715647
|
-
const tempDir = await mkdtemp5(join159(
|
|
715699
|
+
const tempDir = await mkdtemp5(join159(tmpdir14(), "claude-hs-"));
|
|
715648
715700
|
try {
|
|
715649
715701
|
const scpResult = await execFileNoThrow("scp", ["-rq", `${homespace}.coder:/root/.claude/projects/`, tempDir], { timeout: 300000 });
|
|
715650
715702
|
if (scpResult.code !== 0) {
|
|
@@ -720143,7 +720195,7 @@ var init_agentMemory = __esm(() => {
|
|
|
720143
720195
|
|
|
720144
720196
|
// src/utils/permissions/filesystem.ts
|
|
720145
720197
|
import { randomBytes as randomBytes19 } from "crypto";
|
|
720146
|
-
import { homedir as homedir41, tmpdir as
|
|
720198
|
+
import { homedir as homedir41, tmpdir as tmpdir15 } from "os";
|
|
720147
720199
|
import { join as join163, normalize as normalize16, posix as posix8, sep as sep43 } from "path";
|
|
720148
720200
|
function normalizeCaseForComparison2(path39) {
|
|
720149
720201
|
return path39.toLowerCase();
|
|
@@ -721087,7 +721139,7 @@ var init_filesystem = __esm(() => {
|
|
|
721087
721139
|
];
|
|
721088
721140
|
DIR_SEP = posix8.sep;
|
|
721089
721141
|
getClaudeTempDir = memoize_default(function getClaudeTempDir2() {
|
|
721090
|
-
const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (getPlatform() === "windows" ?
|
|
721142
|
+
const baseTmpDir = process.env.CLAUDE_CODE_TMPDIR || (getPlatform() === "windows" ? tmpdir15() : "/tmp");
|
|
721091
721143
|
const fs25 = getFsImplementation();
|
|
721092
721144
|
let resolvedBaseTmpDir = baseTmpDir;
|
|
721093
721145
|
try {
|
|
@@ -728260,7 +728312,7 @@ var init_pollConfig = __esm(() => {
|
|
|
728260
728312
|
// src/bridge/sessionRunner.ts
|
|
728261
728313
|
import { spawn as spawn16 } from "child_process";
|
|
728262
728314
|
import { createWriteStream as createWriteStream6 } from "fs";
|
|
728263
|
-
import { tmpdir as
|
|
728315
|
+
import { tmpdir as tmpdir16 } from "os";
|
|
728264
728316
|
import { dirname as dirname72, join as join167 } from "path";
|
|
728265
728317
|
import { createInterface as createInterface3 } from "readline";
|
|
728266
728318
|
function safeFilenameId(id) {
|
|
@@ -728394,7 +728446,7 @@ function createSessionSpawner(deps) {
|
|
|
728394
728446
|
debugFile = `${deps.debugFile}-${safeId}`;
|
|
728395
728447
|
}
|
|
728396
728448
|
} else if (deps.verbose || process.env.USER_TYPE === "ant") {
|
|
728397
|
-
debugFile = join167(
|
|
728449
|
+
debugFile = join167(tmpdir16(), "claude", `bridge-session-${safeId}.log`);
|
|
728398
728450
|
}
|
|
728399
728451
|
let transcriptStream = null;
|
|
728400
728452
|
let transcriptPath;
|
|
@@ -728937,7 +728989,7 @@ __export(exports_bridgeMain, {
|
|
|
728937
728989
|
BridgeHeadlessPermanentError: () => BridgeHeadlessPermanentError
|
|
728938
728990
|
});
|
|
728939
728991
|
import { randomUUID as randomUUID42 } from "crypto";
|
|
728940
|
-
import { hostname as hostname4, tmpdir as
|
|
728992
|
+
import { hostname as hostname4, tmpdir as tmpdir17 } from "os";
|
|
728941
728993
|
import { basename as basename51, join as join170, resolve as resolve56 } from "path";
|
|
728942
728994
|
async function isMultiSessionSpawnEnabled() {
|
|
728943
728995
|
return checkGate_CACHED_OR_BLOCKING("tengu_ccr_bridge_multi_session");
|
|
@@ -729069,7 +729121,7 @@ async function runBridgeLoop(config8, environmentId, environmentSecret, api5, sp
|
|
|
729069
729121
|
const ext = config8.debugFile.lastIndexOf(".");
|
|
729070
729122
|
debugGlob = ext > 0 ? `${config8.debugFile.slice(0, ext)}-*${config8.debugFile.slice(ext)}` : `${config8.debugFile}-*`;
|
|
729071
729123
|
} else {
|
|
729072
|
-
debugGlob = join170(
|
|
729124
|
+
debugGlob = join170(tmpdir17(), "claude", "bridge-session-*.log");
|
|
729073
729125
|
}
|
|
729074
729126
|
logger30.setDebugLogPath(debugGlob);
|
|
729075
729127
|
}
|
|
@@ -729460,7 +729512,7 @@ async function runBridgeLoop(config8, environmentId, environmentSecret, api5, sp
|
|
|
729460
729512
|
sessionDebugFile = `${config8.debugFile}-${safeId}`;
|
|
729461
729513
|
}
|
|
729462
729514
|
} else if (config8.verbose || process.env.USER_TYPE === "ant") {
|
|
729463
|
-
sessionDebugFile = join170(
|
|
729515
|
+
sessionDebugFile = join170(tmpdir17(), "claude", `bridge-session-${safeId}.log`);
|
|
729464
729516
|
}
|
|
729465
729517
|
if (sessionDebugFile) {
|
|
729466
729518
|
logger30.logVerbose(`Debug log: ${sessionDebugFile}`);
|
|
@@ -730679,7 +730731,7 @@ __export(exports_daemon2, {
|
|
|
730679
730731
|
attachHandler: () => attachHandler,
|
|
730680
730732
|
appendDaemonLog: () => appendDaemonLog
|
|
730681
730733
|
});
|
|
730682
|
-
import { existsSync as existsSync27, mkdirSync as mkdirSync14, readFileSync as readFileSync34, writeFileSync as
|
|
730734
|
+
import { existsSync as existsSync27, mkdirSync as mkdirSync14, readFileSync as readFileSync34, writeFileSync as writeFileSync17, appendFileSync as appendFileSync4 } from "fs";
|
|
730683
730735
|
import { join as join171 } from "path";
|
|
730684
730736
|
import { execSync as execSync4 } from "child_process";
|
|
730685
730737
|
function daemonLogPath2() {
|
|
@@ -730903,8 +730955,8 @@ function writeScheduledConfig(tasks2) {
|
|
|
730903
730955
|
}
|
|
730904
730956
|
current.scheduled = tasks2;
|
|
730905
730957
|
mkdirSync14(join171(path39, ".."), { recursive: true });
|
|
730906
|
-
|
|
730907
|
-
|
|
730958
|
+
writeFileSync17(path39, JSON.stringify(current, null, 2), { encoding: "utf-8" });
|
|
730959
|
+
writeFileSync17(scheduledStatusPath(), JSON.stringify({ tasks: tasks2, updatedAt: Date.now() }, null, 2), {
|
|
730908
730960
|
encoding: "utf-8"
|
|
730909
730961
|
});
|
|
730910
730962
|
}
|
|
@@ -770149,21 +770201,28 @@ function PromptInput({
|
|
|
770149
770201
|
}
|
|
770150
770202
|
}, [previousModeBeforeAuto, toolPermissionContext, setAppState, setToolPermissionContext]);
|
|
770151
770203
|
const handleImagePaste = import_react261.useCallback(() => {
|
|
770152
|
-
|
|
770153
|
-
if (
|
|
770154
|
-
|
|
770204
|
+
saveClipboardImageToTempFile().then((saved) => {
|
|
770205
|
+
if (saved) {
|
|
770206
|
+
insertTextAtCursor(`${saved.path}
|
|
770207
|
+
`);
|
|
770208
|
+
addNotification({
|
|
770209
|
+
key: "clipboard-image-saved",
|
|
770210
|
+
text: `Saved clipboard image \u2192 ${saved.path}`,
|
|
770211
|
+
priority: "immediate",
|
|
770212
|
+
timeoutMs: 4000
|
|
770213
|
+
});
|
|
770155
770214
|
} else {
|
|
770156
770215
|
const shortcutDisplay = getShortcutDisplay("chat:imagePaste", "Chat", "ctrl+v");
|
|
770157
|
-
const message = env4.isSSH() ? "No image found in clipboard. You're SSH'd
|
|
770216
|
+
const message = env4.isSSH() ? "No image found in clipboard. You're SSH'd \u2014 copy the screenshot to the dev machine (e.g. scp) and set OCC_CLIPBOARD_IMAGE_SRC to its path, then press Ctrl+V." : `No image found in clipboard. Use ${shortcutDisplay} to paste images.`;
|
|
770158
770217
|
addNotification({
|
|
770159
770218
|
key: "no-image-in-clipboard",
|
|
770160
770219
|
text: message,
|
|
770161
770220
|
priority: "immediate",
|
|
770162
|
-
timeoutMs:
|
|
770221
|
+
timeoutMs: 6000
|
|
770163
770222
|
});
|
|
770164
770223
|
}
|
|
770165
770224
|
});
|
|
770166
|
-
}, [addNotification,
|
|
770225
|
+
}, [addNotification, insertTextAtCursor]);
|
|
770167
770226
|
const keybindingContext = useOptionalKeybindingContext();
|
|
770168
770227
|
import_react261.useEffect(() => {
|
|
770169
770228
|
if (!keybindingContext || isModalOverlayActive)
|
|
@@ -795373,10 +795432,10 @@ function FleetViewScreen(props) {
|
|
|
795373
795432
|
for (const task of Object.values(tasks2)) {
|
|
795374
795433
|
if (task.status === "running" && task.pid) {
|
|
795375
795434
|
try {
|
|
795376
|
-
const { writeFileSync:
|
|
795435
|
+
const { writeFileSync: writeFileSync18 } = __require("fs");
|
|
795377
795436
|
const { join: join181 } = __require("path");
|
|
795378
795437
|
const heartbeatPath = join181(__require("os").tmpdir(), `.fleetview-heartbeat-${task.pid}`);
|
|
795379
|
-
|
|
795438
|
+
writeFileSync18(heartbeatPath, String(Date.now()));
|
|
795380
795439
|
} catch {}
|
|
795381
795440
|
}
|
|
795382
795441
|
}
|
|
@@ -796449,7 +796508,7 @@ __export(exports_REPL, {
|
|
|
796449
796508
|
});
|
|
796450
796509
|
import { spawnSync as spawnSync14 } from "child_process";
|
|
796451
796510
|
import { dirname as dirname79, join as join182 } from "path";
|
|
796452
|
-
import { tmpdir as
|
|
796511
|
+
import { tmpdir as tmpdir18 } from "os";
|
|
796453
796512
|
import { writeFile as writeFile62 } from "fs/promises";
|
|
796454
796513
|
import { randomUUID as randomUUID63 } from "crypto";
|
|
796455
796514
|
function TranscriptModeFooter(t0) {
|
|
@@ -799236,7 +799295,7 @@ Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input.
|
|
|
799236
799295
|
const w4 = Math.max(80, (process.stdout.columns ?? 80) - 6);
|
|
799237
799296
|
const raw = await renderMessagesToPlainText(deferredMessages, tools, w4);
|
|
799238
799297
|
const text2 = raw.replace(/[ \t]+$/gm, "");
|
|
799239
|
-
const path43 = join182(
|
|
799298
|
+
const path43 = join182(tmpdir18(), `cc-transcript-${Date.now()}.txt`);
|
|
799240
799299
|
await writeFile62(path43, text2);
|
|
799241
799300
|
const opened = openFileInExternalEditor(path43);
|
|
799242
799301
|
setStatus(opened ? `opening ${path43}` : `wrote ${path43} \xB7 no $VISUAL/$EDITOR set`);
|