@cnwenf/occ 2.1.272 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +197 -91
  2. 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.272","BUILD_TIME":"2026-07-17T04:12:49.768Z","FEEDBACK_CHANNEL":"","ISSUES_EXPLAINER":"","NATIVE_PACKAGE_URL":"","PACKAGE_URL":"@cnwenf/occ","VERSION_CHANGELOG":""};
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,10 +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";
448130
448196
  import { writeFileSync as writeFileSync9 } from "fs";
448131
- import { tmpdir as tmpdir8 } from "os";
448132
448197
  import { basename as basename21, extname as extname12, isAbsolute as isAbsolute20, join as join93 } from "path";
448133
448198
  function getClipboardCommands() {
448134
448199
  const platform5 = process.platform;
@@ -448296,7 +448361,13 @@ function getClipboardImageSrcOverride() {
448296
448361
  const v6 = process.env[CLIPBOARD_IMAGE_SRC_ENV];
448297
448362
  return v6 && v6.length > 0 ? v6 : undefined;
448298
448363
  }
448299
- async function saveClipboardImageToTempFile() {
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 = {}) {
448300
448371
  try {
448301
448372
  const overrideSrc = getClipboardImageSrcOverride();
448302
448373
  if (overrideSrc && getFsImplementation().existsSync(overrideSrc)) {
@@ -448304,6 +448375,24 @@ async function saveClipboardImageToTempFile() {
448304
448375
  const mediaType = detectImageFormatFromBase64(buffer2.toString("base64"));
448305
448376
  return writeUniqueTempImageFile(buffer2, mediaType);
448306
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
+ }
448307
448396
  const image = await getImageFromClipboard();
448308
448397
  if (!image) {
448309
448398
  return null;
@@ -448400,7 +448489,7 @@ async function tryReadImageFromPath(text2) {
448400
448489
  dimensions: resized.dimensions
448401
448490
  };
448402
448491
  }
448403
- var PASTE_THRESHOLD = 800, CLIPBOARD_IMAGE_SRC_ENV = "OCC_CLIPBOARD_IMAGE_SRC", TEMP_IMAGE_EXT_ALLOW, 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;
448404
448493
  var init_imagePaste = __esm(() => {
448405
448494
  init_featureFlags();
448406
448495
  init_execa();
@@ -448412,6 +448501,8 @@ var init_imagePaste = __esm(() => {
448412
448501
  init_fsOperations();
448413
448502
  init_imageResizer();
448414
448503
  init_log3();
448504
+ init_osc52ClipboardRead();
448505
+ DEFAULT_CLIPBOARD_WATCH_PATH = join93(homedir27(), ".occ", "clipboard-latest.png");
448415
448506
  TEMP_IMAGE_EXT_ALLOW = /^(png|jpe?g|gif|webp|bmp)$/i;
448416
448507
  IMAGE_EXTENSION_REGEX = /\.(png|jpe?g|gif|webp)$/i;
448417
448508
  });
@@ -457879,7 +457970,7 @@ var init_InProcessBackend = __esm(() => {
457879
457970
  });
457880
457971
 
457881
457972
  // src/utils/swarm/backends/it2Setup.ts
457882
- import { homedir as homedir27 } from "os";
457973
+ import { homedir as homedir28 } from "os";
457883
457974
  async function detectPythonPackageManager() {
457884
457975
  const uvResult = await execFileNoThrow("which", ["uv"]);
457885
457976
  if (uvResult.code === 0) {
@@ -457914,18 +458005,18 @@ async function installIt2(packageManager) {
457914
458005
  switch (packageManager) {
457915
458006
  case "uvx":
457916
458007
  result = await execFileNoThrowWithCwd("uv", ["tool", "install", "it2"], {
457917
- cwd: homedir27()
458008
+ cwd: homedir28()
457918
458009
  });
457919
458010
  break;
457920
458011
  case "pipx":
457921
458012
  result = await execFileNoThrowWithCwd("pipx", ["install", "it2"], {
457922
- cwd: homedir27()
458013
+ cwd: homedir28()
457923
458014
  });
457924
458015
  break;
457925
458016
  case "pip":
457926
- result = await execFileNoThrowWithCwd("pip", ["install", "--user", "it2"], { cwd: homedir27() });
458017
+ result = await execFileNoThrowWithCwd("pip", ["install", "--user", "it2"], { cwd: homedir28() });
457927
458018
  if (result.code !== 0) {
457928
- result = await execFileNoThrowWithCwd("pip3", ["install", "--user", "it2"], { cwd: homedir27() });
458019
+ result = await execFileNoThrowWithCwd("pip3", ["install", "--user", "it2"], { cwd: homedir28() });
457929
458020
  }
457930
458021
  break;
457931
458022
  }
@@ -584720,10 +584811,10 @@ __export(exports_ListPeersTool, {
584720
584811
  LIST_AGENTS_TOOL_NAME: () => LIST_AGENTS_TOOL_NAME
584721
584812
  });
584722
584813
  import { readdir as readdir21, readFile as readFile39 } from "fs/promises";
584723
- import { homedir as homedir28 } from "os";
584814
+ import { homedir as homedir29 } from "os";
584724
584815
  import { join as join107 } from "path";
584725
584816
  function getSessionsDir2() {
584726
- return join107(homedir28(), ".claude", "sessions");
584817
+ return join107(homedir29(), ".claude", "sessions");
584727
584818
  }
584728
584819
  async function listLocalSessions() {
584729
584820
  const dir = getSessionsDir2();
@@ -585585,7 +585676,7 @@ __export(exports_workflowDiscovery, {
585585
585676
  PROJECT_WORKFLOWS_DIR: () => PROJECT_WORKFLOWS_DIR
585586
585677
  });
585587
585678
  import { existsSync as existsSync16, readdirSync as readdirSync8, statSync as statSync14 } from "fs";
585588
- import { homedir as homedir29 } from "os";
585679
+ import { homedir as homedir30 } from "os";
585589
585680
  import { join as join108 } from "path";
585590
585681
  function isWorkflowsEnabled() {
585591
585682
  if (process.env.CLAUDE_CODE_WORKFLOWS_DISABLED === "1")
@@ -585596,7 +585687,7 @@ function projectWorkflowsDir(cwd2) {
585596
585687
  return join108(cwd2, PROJECT_WORKFLOWS_DIR);
585597
585688
  }
585598
585689
  function userWorkflowsDir() {
585599
- return join108(homedir29(), USER_WORKFLOWS_DIR);
585690
+ return join108(homedir30(), USER_WORKFLOWS_DIR);
585600
585691
  }
585601
585692
  function listScripts(dir, source2) {
585602
585693
  let entries;
@@ -588923,7 +589014,7 @@ var init_modeValidation2 = __esm(() => {
588923
589014
  });
588924
589015
 
588925
589016
  // src/tools/PowerShellTool/pathValidation.ts
588926
- import { homedir as homedir30 } from "os";
589017
+ import { homedir as homedir31 } from "os";
588927
589018
  import { isAbsolute as isAbsolute25, resolve as resolve43 } from "path";
588928
589019
  function matchesParam(paramLower, paramList) {
588929
589020
  for (const p4 of paramList) {
@@ -588946,7 +589037,7 @@ function formatDirectoryList2(directories) {
588946
589037
  }
588947
589038
  function expandTilde2(filePath) {
588948
589039
  if (filePath === "~" || filePath.startsWith("~/") || filePath.startsWith("~\\")) {
588949
- return homedir30() + filePath.slice(1);
589040
+ return homedir31() + filePath.slice(1);
588950
589041
  }
588951
589042
  return filePath;
588952
589043
  }
@@ -624700,7 +624791,7 @@ __export(exports_mcpServer2, {
624700
624791
  runComputerUseMcpServer: () => runComputerUseMcpServer,
624701
624792
  createComputerUseMcpServerForCli: () => createComputerUseMcpServerForCli
624702
624793
  });
624703
- import { homedir as homedir31 } from "os";
624794
+ import { homedir as homedir32 } from "os";
624704
624795
  async function tryGetInstalledAppNames() {
624705
624796
  const adapter2 = getComputerUseHostAdapter();
624706
624797
  const enumP = adapter2.executor.listInstalledApps();
@@ -624716,7 +624807,7 @@ async function tryGetInstalledAppNames() {
624716
624807
  logForDebugging(`[Computer Use MCP] app enumeration exceeded ${APP_ENUM_TIMEOUT_MS}ms or failed; tool description omits list`);
624717
624808
  return;
624718
624809
  }
624719
- return filterAppsForDescription(installed, homedir31());
624810
+ return filterAppsForDescription(installed, homedir32());
624720
624811
  }
624721
624812
  async function createComputerUseMcpServerForCli() {
624722
624813
  const adapter2 = getComputerUseHostAdapter();
@@ -632366,7 +632457,7 @@ var init_projectOnboardingState = __esm(() => {
632366
632457
 
632367
632458
  // src/utils/appleTerminalBackup.ts
632368
632459
  import { stat as stat39 } from "fs/promises";
632369
- import { homedir as homedir32 } from "os";
632460
+ import { homedir as homedir33 } from "os";
632370
632461
  import { join as join128 } from "path";
632371
632462
  function markTerminalSetupInProgress(backupPath) {
632372
632463
  saveGlobalConfig((current) => ({
@@ -632389,7 +632480,7 @@ function getTerminalRecoveryInfo() {
632389
632480
  };
632390
632481
  }
632391
632482
  function getTerminalPlistPath() {
632392
- return join128(homedir32(), "Library", "Preferences", "com.apple.Terminal.plist");
632483
+ return join128(homedir33(), "Library", "Preferences", "com.apple.Terminal.plist");
632393
632484
  }
632394
632485
  async function backupTerminalPreferences() {
632395
632486
  const terminalPlistPath = getTerminalPlistPath();
@@ -632460,11 +632551,11 @@ var init_appleTerminalBackup = __esm(() => {
632460
632551
  });
632461
632552
 
632462
632553
  // src/utils/completionCache.ts
632463
- import { homedir as homedir33 } from "os";
632554
+ import { homedir as homedir34 } from "os";
632464
632555
  import { dirname as dirname57, join as join129 } from "path";
632465
632556
  function detectShell() {
632466
632557
  const shell = process.env.SHELL || "";
632467
- const home = homedir33();
632558
+ const home = homedir34();
632468
632559
  const claudeDir = join129(home, ".claude");
632469
632560
  if (shell.endsWith("/zsh") || shell.endsWith("/zsh.exe")) {
632470
632561
  const cacheFile = join129(claudeDir, "completion.zsh");
@@ -632541,7 +632632,7 @@ __export(exports_terminalSetup, {
632541
632632
  });
632542
632633
  import { randomBytes as randomBytes15 } from "crypto";
632543
632634
  import { copyFile as copyFile9, mkdir as mkdir39, readFile as readFile48, writeFile as writeFile41 } from "fs/promises";
632544
- import { homedir as homedir34, platform as platform5 } from "os";
632635
+ import { homedir as homedir35, platform as platform5 } from "os";
632545
632636
  import { dirname as dirname58, join as join130 } from "path";
632546
632637
  import { pathToFileURL as pathToFileURL7 } from "url";
632547
632638
  function isVSCodeRemoteSSH() {
@@ -632677,7 +632768,7 @@ async function installBindingsForVSCodeTerminal(editor = "VSCode", theme) {
632677
632768
  ]`)}${EOL7}`;
632678
632769
  }
632679
632770
  const editorDir = editor === "VSCode" ? "Code" : editor;
632680
- const userDirPath = join130(homedir34(), platform5() === "win32" ? join130("AppData", "Roaming", editorDir, "User") : platform5() === "darwin" ? join130("Library", "Application Support", editorDir, "User") : join130(".config", editorDir, "User"));
632771
+ const userDirPath = join130(homedir35(), platform5() === "win32" ? join130("AppData", "Roaming", editorDir, "User") : platform5() === "darwin" ? join130("Library", "Application Support", editorDir, "User") : join130(".config", editorDir, "User"));
632681
632772
  const keybindingsPath = join130(userDirPath, "keybindings.json");
632682
632773
  try {
632683
632774
  await mkdir39(userDirPath, {
@@ -632830,7 +632921,7 @@ chars = "\\u001B\\r"`;
632830
632921
  if (xdgConfigHome) {
632831
632922
  configPaths.push(join130(xdgConfigHome, "alacritty", "alacritty.toml"));
632832
632923
  } else {
632833
- configPaths.push(join130(homedir34(), ".config", "alacritty", "alacritty.toml"));
632924
+ configPaths.push(join130(homedir35(), ".config", "alacritty", "alacritty.toml"));
632834
632925
  }
632835
632926
  if (platform5() === "win32") {
632836
632927
  const appData = process.env.APPDATA;
@@ -632896,7 +632987,7 @@ chars = "\\u001B\\r"`;
632896
632987
  }
632897
632988
  }
632898
632989
  async function installBindingsForZed(theme) {
632899
- const zedDir = join130(homedir34(), ".config", "zed");
632990
+ const zedDir = join130(homedir35(), ".config", "zed");
632900
632991
  const keymapPath = join130(zedDir, "keymap.json");
632901
632992
  try {
632902
632993
  await mkdir39(zedDir, {
@@ -634773,7 +634864,8 @@ import { basename as basename40 } from "path";
634773
634864
  function usePasteHandler({
634774
634865
  onPaste,
634775
634866
  onInput,
634776
- onImagePaste
634867
+ onImagePaste,
634868
+ querier
634777
634869
  }) {
634778
634870
  const [pasteState, setPasteState] = import_react91.default.useState({ chunks: [], timeoutId: null });
634779
634871
  const [isPasting, setIsPasting] = import_react91.default.useState(false);
@@ -634788,26 +634880,36 @@ function usePasteHandler({
634788
634880
  const checkClipboardForImageImpl = import_react91.default.useCallback(() => {
634789
634881
  if (!onImagePaste || !isMountedRef.current)
634790
634882
  return;
634791
- getImageFromClipboard().then((imageData) => {
634792
- if (imageData && isMountedRef.current) {
634793
- onImagePaste(imageData.base64, imageData.mediaType, undefined, imageData.dimensions);
634794
- }
634795
- }).catch((error52) => {
634796
- if (isMountedRef.current) {
634797
- logError2(error52);
634798
- }
634799
- }).finally(() => {
634800
- if (isMountedRef.current) {
634801
- setIsPasting(false);
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
+ }
634802
634904
  }
634803
- });
634804
- }, [onImagePaste]);
634905
+ })();
634906
+ }, [onImagePaste, querier]);
634805
634907
  const checkClipboardForImage = useDebounceCallback(checkClipboardForImageImpl, CLIPBOARD_CHECK_DEBOUNCE_MS);
634806
634908
  const resetPasteTimeout = import_react91.default.useCallback((currentTimeoutId2) => {
634807
634909
  if (currentTimeoutId2) {
634808
634910
  clearTimeout(currentTimeoutId2);
634809
634911
  }
634810
- return setTimeout((setPasteState2, onImagePaste2, onPaste2, setIsPasting2, checkClipboardForImage2, isMacOS2, pastePendingRef2) => {
634912
+ return setTimeout((setPasteState2, onImagePaste2, onPaste2, setIsPasting2, checkClipboardForImage2, isMacOS2, hasQuerier, pastePendingRef2) => {
634811
634913
  pastePendingRef2.current = false;
634812
634914
  setPasteState2(({ chunks }) => {
634813
634915
  const pastedText = chunks.join("").replace(/\[I$/, "").replace(/\[O$/, "");
@@ -634840,7 +634942,7 @@ function usePasteHandler({
634840
634942
  });
634841
634943
  return { chunks: [], timeoutId: null };
634842
634944
  }
634843
- if (isMacOS2 && onImagePaste2 && pastedText.length === 0) {
634945
+ if ((isMacOS2 || hasQuerier) && onImagePaste2 && pastedText.length === 0) {
634844
634946
  checkClipboardForImage2();
634845
634947
  return { chunks: [], timeoutId: null };
634846
634948
  }
@@ -634850,8 +634952,8 @@ function usePasteHandler({
634850
634952
  setIsPasting2(false);
634851
634953
  return { chunks: [], timeoutId: null };
634852
634954
  });
634853
- }, PASTE_COMPLETION_TIMEOUT_MS, setPasteState, onImagePaste, onPaste, setIsPasting, checkClipboardForImage, isMacOS, pastePendingRef);
634854
- }, [checkClipboardForImage, isMacOS, onImagePaste, onPaste]);
634955
+ }, PASTE_COMPLETION_TIMEOUT_MS, setPasteState, onImagePaste, onPaste, setIsPasting, checkClipboardForImage, isMacOS, !!querier, pastePendingRef);
634956
+ }, [checkClipboardForImage, isMacOS, onImagePaste, onPaste, querier]);
634855
634957
  const wrappedOnInput = (input2, key4, event) => {
634856
634958
  const isFromPaste = event.keypress.isPasted;
634857
634959
  if (isFromPaste) {
@@ -634859,7 +634961,7 @@ function usePasteHandler({
634859
634961
  }
634860
634962
  const hasImageFilePath = input2.split(/ (?=\/|[A-Za-z]:\\)/).flatMap((part) => part.split(`
634861
634963
  `)).some((line) => isImageFilePath(line.trim()));
634862
- if (isFromPaste && input2.length === 0 && isMacOS && onImagePaste) {
634964
+ if (isFromPaste && input2.length === 0 && (isMacOS || querier) && onImagePaste) {
634863
634965
  checkClipboardForImage();
634864
634966
  setIsPasting(false);
634865
634967
  return;
@@ -634891,6 +634993,7 @@ var init_usePasteHandler = __esm(() => {
634891
634993
  init_log3();
634892
634994
  init_dist6();
634893
634995
  init_imagePaste();
634996
+ init_osc52ClipboardRead();
634894
634997
  init_platform2();
634895
634998
  import_react91 = __toESM(require_react(), 1);
634896
634999
  });
@@ -635198,6 +635301,7 @@ function BaseTextInput(t0) {
635198
635301
  t22 = $4[3];
635199
635302
  }
635200
635303
  const cursorRef = useDeclaredCursor(t22);
635304
+ const { internal_querier } = use_stdin_default();
635201
635305
  const {
635202
635306
  wrappedOnInput,
635203
635307
  isPasting: t32
@@ -635209,7 +635313,8 @@ function BaseTextInput(t0) {
635209
635313
  }
635210
635314
  onInput(input2, key4);
635211
635315
  },
635212
- onImagePaste: props.onImagePaste
635316
+ onImagePaste: props.onImagePaste,
635317
+ querier: internal_querier
635213
635318
  });
635214
635319
  const isPasting = t32;
635215
635320
  const {
@@ -637586,7 +637691,7 @@ var init_respawn = __esm(() => {
637586
637691
 
637587
637692
  // src/daemon/install.ts
637588
637693
  import { existsSync as existsSync20, mkdirSync as mkdirSync10, writeFileSync as writeFileSync13, unlinkSync as unlinkSync6 } from "fs";
637589
- import { homedir as homedir35 } from "os";
637694
+ import { homedir as homedir36 } from "os";
637590
637695
  import { join as join136 } from "path";
637591
637696
  import { spawnSync as spawnSync9 } from "child_process";
637592
637697
  function detectInstallPlatform() {
@@ -637602,10 +637707,10 @@ function cliEntry() {
637602
637707
  return process.argv[1] ?? "dist/cli.js";
637603
637708
  }
637604
637709
  function launchdPlistPath() {
637605
- return join136(homedir35(), "Library", "LaunchAgents", "com.anthropic.claude.daemon.plist");
637710
+ return join136(homedir36(), "Library", "LaunchAgents", "com.anthropic.claude.daemon.plist");
637606
637711
  }
637607
637712
  function systemdUnitPath() {
637608
- return join136(homedir35(), ".config", "systemd", "user", "claude-daemon.service");
637713
+ return join136(homedir36(), ".config", "systemd", "user", "claude-daemon.service");
637609
637714
  }
637610
637715
  function installPersistentService() {
637611
637716
  const plat = detectInstallPlatform();
@@ -637640,9 +637745,9 @@ function installLaunchd() {
637640
637745
  <key>KeepAlive</key>
637641
637746
  <true/>
637642
637747
  <key>StandardOutPath</key>
637643
- <string>${join136(homedir35(), ".claude", "daemon.log")}</string>
637748
+ <string>${join136(homedir36(), ".claude", "daemon.log")}</string>
637644
637749
  <key>StandardErrorPath</key>
637645
- <string>${join136(homedir35(), ".claude", "daemon.log")}</string>
637750
+ <string>${join136(homedir36(), ".claude", "daemon.log")}</string>
637646
637751
  </dict>
637647
637752
  </plist>
637648
637753
  `;
@@ -637664,8 +637769,8 @@ Type=simple
637664
637769
  ExecStart=${process.execPath} ${cliEntry()} daemon start
637665
637770
  Restart=on-failure
637666
637771
  RestartSec=2
637667
- StandardOutput=append:${join136(homedir35(), ".claude", "daemon.log")}
637668
- StandardError=append:${join136(homedir35(), ".claude", "daemon.log")}
637772
+ StandardOutput=append:${join136(homedir36(), ".claude", "daemon.log")}
637773
+ StandardError=append:${join136(homedir36(), ".claude", "daemon.log")}
637669
637774
 
637670
637775
  [Install]
637671
637776
  WantedBy=default.target
@@ -654304,10 +654409,10 @@ var init_MemoryFileSelector = __esm(() => {
654304
654409
  });
654305
654410
 
654306
654411
  // src/components/memory/MemoryUpdateNotification.tsx
654307
- import { homedir as homedir36 } from "os";
654412
+ import { homedir as homedir37 } from "os";
654308
654413
  import { relative as relative27 } from "path";
654309
654414
  function getRelativeMemoryPath(path36) {
654310
- const homeDir = homedir36();
654415
+ const homeDir = homedir37();
654311
654416
  const cwd2 = getCwd();
654312
654417
  const relativeToHome = path36.startsWith(homeDir) ? "~" + path36.slice(homeDir.length) : null;
654313
654418
  const relativeToCwd = path36.startsWith(cwd2) ? "./" + relative27(cwd2, path36) : null;
@@ -665270,7 +665375,7 @@ var init_pluginStartupCheck = __esm(() => {
665270
665375
  });
665271
665376
 
665272
665377
  // src/utils/plugins/parseMarketplaceInput.ts
665273
- import { homedir as homedir37 } from "os";
665378
+ import { homedir as homedir38 } from "os";
665274
665379
  import { resolve as resolve52 } from "path";
665275
665380
  async function parseMarketplaceInput(input2) {
665276
665381
  const trimmed = input2.trim();
@@ -665306,7 +665411,7 @@ async function parseMarketplaceInput(input2) {
665306
665411
  const isWindows3 = process.platform === "win32";
665307
665412
  const isWindowsPath = isWindows3 && (trimmed.startsWith(".\\") || trimmed.startsWith("..\\") || /^[a-zA-Z]:[/\\]/.test(trimmed));
665308
665413
  if (trimmed.startsWith("./") || trimmed.startsWith("../") || trimmed.startsWith("/") || trimmed.startsWith("~") || isWindowsPath) {
665309
- const resolvedPath = resolve52(trimmed.startsWith("~") ? trimmed.replace(/^~/, homedir37()) : trimmed);
665414
+ const resolvedPath = resolve52(trimmed.startsWith("~") ? trimmed.replace(/^~/, homedir38()) : trimmed);
665310
665415
  let stats;
665311
665416
  try {
665312
665417
  stats = await fs24.stat(resolvedPath);
@@ -681953,7 +682058,7 @@ var init_referral = __esm(() => {
681953
682058
  });
681954
682059
 
681955
682060
  // src/components/LogoV2/feedConfigs.tsx
681956
- import { homedir as homedir38 } from "os";
682061
+ import { homedir as homedir39 } from "os";
681957
682062
  function createRecentActivityFeed(activities) {
681958
682063
  const lines2 = activities.map((log3) => {
681959
682064
  const time3 = formatRelativeTimeAgo(log3.modified);
@@ -681998,7 +682103,7 @@ function createProjectOnboardingFeed(steps) {
681998
682103
  text: `${checkmark}${text2}`
681999
682104
  };
682000
682105
  });
682001
- const warningText = getCwd() === homedir38() ? "Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead." : undefined;
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;
682002
682107
  if (warningText) {
682003
682108
  lines2.push({
682004
682109
  text: warningText
@@ -707572,7 +707677,7 @@ var init_setupPortable = __esm(() => {
707572
707677
 
707573
707678
  // src/utils/claudeInChrome/setup.ts
707574
707679
  import { chmod as chmod10, mkdir as mkdir48, readFile as readFile60, writeFile as writeFile54 } from "fs/promises";
707575
- import { homedir as homedir39 } from "os";
707680
+ import { homedir as homedir40 } from "os";
707576
707681
  import { join as join156 } from "path";
707577
707682
  import { fileURLToPath as fileURLToPath9 } from "url";
707578
707683
  function shouldEnableClaudeInChrome(chromeFlag) {
@@ -707652,7 +707757,7 @@ function setupClaudeInChrome() {
707652
707757
  function getNativeMessagingHostsDirs() {
707653
707758
  const platform6 = getPlatform();
707654
707759
  if (platform6 === "windows") {
707655
- const home = homedir39();
707760
+ const home = homedir40();
707656
707761
  const appData = process.env.APPDATA || join156(home, "AppData", "Local");
707657
707762
  return [join156(appData, "Claude Code", "ChromeNativeHost")];
707658
707763
  }
@@ -712801,7 +712906,7 @@ var init_force_snip = __esm(() => {
712801
712906
  });
712802
712907
 
712803
712908
  // src/utils/effort/workflowSavePath.ts
712804
- import { homedir as homedir40 } from "os";
712909
+ import { homedir as homedir41 } from "os";
712805
712910
  import { join as join158, sep as sep41 } from "path";
712806
712911
  function userWorkflowsDir2() {
712807
712912
  return join158(getClaudeConfigHomeDir(), "workflows");
@@ -712813,7 +712918,7 @@ function resolveWorkflowsDir(scope, cwd2) {
712813
712918
  return join158(cwd2, ".claude", "workflows");
712814
712919
  }
712815
712920
  function tildeShortenPath(absPath) {
712816
- const home = homedir40();
712921
+ const home = homedir41();
712817
712922
  if (absPath === home)
712818
712923
  return "~";
712819
712924
  if (absPath.startsWith(home + sep41))
@@ -720195,7 +720300,7 @@ var init_agentMemory = __esm(() => {
720195
720300
 
720196
720301
  // src/utils/permissions/filesystem.ts
720197
720302
  import { randomBytes as randomBytes19 } from "crypto";
720198
- import { homedir as homedir41, tmpdir as tmpdir15 } from "os";
720303
+ import { homedir as homedir42, tmpdir as tmpdir15 } from "os";
720199
720304
  import { join as join163, normalize as normalize16, posix as posix8, sep as sep43 } from "path";
720200
720305
  function normalizeCaseForComparison2(path39) {
720201
720306
  return path39.toLowerCase();
@@ -720209,7 +720314,7 @@ function getClaudeSkillScope(filePath) {
720209
720314
  prefix: "/.claude/skills/"
720210
720315
  },
720211
720316
  {
720212
- dir: expandPath(join163(homedir41(), ".claude", "skills")),
720317
+ dir: expandPath(join163(homedir42(), ".claude", "skills")),
720213
720318
  prefix: "~/.claude/skills/"
720214
720319
  }
720215
720320
  ];
@@ -720523,7 +720628,7 @@ function patternWithRoot(pattern, source2) {
720523
720628
  } else if (pattern.startsWith(`~${DIR_SEP}`)) {
720524
720629
  return {
720525
720630
  relativePattern: pattern.slice(1),
720526
- root: homedir41().normalize("NFC")
720631
+ root: homedir42().normalize("NFC")
720527
720632
  };
720528
720633
  } else if (pattern.startsWith(DIR_SEP)) {
720529
720634
  return {
@@ -720554,7 +720659,7 @@ function getCachedPatternMatchers(toolPermissionContext, toolType, behavior) {
720554
720659
  toolType,
720555
720660
  behavior,
720556
720661
  getPlatform(),
720557
- homedir41(),
720662
+ homedir42(),
720558
720663
  getCwd(),
720559
720664
  getOriginalCwd(),
720560
720665
  additionalDirs
@@ -727389,7 +727494,7 @@ import {
727389
727494
  unlink as unlink28
727390
727495
  } from "fs/promises";
727391
727496
  import { createServer as createServer8 } from "net";
727392
- import { homedir as homedir42, platform as platform6 } from "os";
727497
+ import { homedir as homedir43, platform as platform6 } from "os";
727393
727498
  import { join as join166 } from "path";
727394
727499
  function log3(message, ...args) {
727395
727500
  if (LOG_FILE) {
@@ -727728,7 +727833,7 @@ var init_chromeNativeHost = __esm(() => {
727728
727833
  init_slowOperations();
727729
727834
  init_common4();
727730
727835
  MAX_MESSAGE_SIZE = 1024 * 1024;
727731
- LOG_FILE = process.env.USER_TYPE === "ant" ? join166(homedir42(), ".claude", "debug", "chrome-native-host.txt") : undefined;
727836
+ LOG_FILE = process.env.USER_TYPE === "ant" ? join166(homedir43(), ".claude", "debug", "chrome-native-host.txt") : undefined;
727732
727837
  messageSchema = lazySchema(() => exports_external.object({
727733
727838
  type: exports_external.string()
727734
727839
  }).passthrough());
@@ -733745,7 +733850,7 @@ __export(exports_upstreamproxy, {
733745
733850
  SESSION_TOKEN_PATH: () => SESSION_TOKEN_PATH
733746
733851
  });
733747
733852
  import { mkdir as mkdir57, readFile as readFile65, unlink as unlink30, writeFile as writeFile58 } from "fs/promises";
733748
- import { homedir as homedir43 } from "os";
733853
+ import { homedir as homedir44 } from "os";
733749
733854
  import { join as join172 } from "path";
733750
733855
  async function initUpstreamProxy(opts) {
733751
733856
  if (!isEnvTruthy(process.env.CLAUDE_CODE_REMOTE)) {
@@ -733767,7 +733872,7 @@ async function initUpstreamProxy(opts) {
733767
733872
  }
733768
733873
  setNonDumpable();
733769
733874
  const baseUrl = opts?.ccrBaseUrl ?? process.env.ANTHROPIC_BASE_URL ?? "https://api.anthropic.com";
733770
- const caBundlePath = opts?.caBundlePath ?? join172(homedir43(), ".ccr", "ca-bundle.crt");
733875
+ const caBundlePath = opts?.caBundlePath ?? join172(homedir44(), ".ccr", "ca-bundle.crt");
733771
733876
  const caOk = await downloadCaBundle(baseUrl, opts?.systemCaPath ?? SYSTEM_CA_BUNDLE, caBundlePath);
733772
733877
  if (!caOk)
733773
733878
  return state3;
@@ -746734,7 +746839,7 @@ var init_ShowInIDEPrompt = __esm(() => {
746734
746839
  });
746735
746840
 
746736
746841
  // src/components/permissions/FilePermissionDialog/permissionOptions.tsx
746737
- import { homedir as homedir44 } from "os";
746842
+ import { homedir as homedir45 } from "os";
746738
746843
  import { basename as basename56, join as join174, sep as sep44 } from "path";
746739
746844
  function isInClaudeFolder(filePath) {
746740
746845
  const absolutePath = expandPath(filePath);
@@ -746745,7 +746850,7 @@ function isInClaudeFolder(filePath) {
746745
746850
  }
746746
746851
  function isInGlobalClaudeFolder(filePath) {
746747
746852
  const absolutePath = expandPath(filePath);
746748
- const globalClaudeFolderPath = join174(homedir44(), ".claude");
746853
+ const globalClaudeFolderPath = join174(homedir45(), ".claude");
746749
746854
  const normalizedAbsolutePath = normalizeCaseForComparison2(absolutePath);
746750
746855
  const normalizedGlobalClaudeFolderPath = normalizeCaseForComparison2(globalClaudeFolderPath);
746751
746856
  return normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + sep44.toLowerCase()) || normalizedAbsolutePath.startsWith(normalizedGlobalClaudeFolderPath + "/");
@@ -770200,8 +770305,9 @@ function PromptInput({
770200
770305
  }
770201
770306
  }
770202
770307
  }, [previousModeBeforeAuto, toolPermissionContext, setAppState, setToolPermissionContext]);
770308
+ const { internal_querier } = use_stdin_default();
770203
770309
  const handleImagePaste = import_react261.useCallback(() => {
770204
- saveClipboardImageToTempFile().then((saved) => {
770310
+ saveClipboardImageToTempFile({ querier: internal_querier }).then((saved) => {
770205
770311
  if (saved) {
770206
770312
  insertTextAtCursor(`${saved.path}
770207
770313
  `);
@@ -770213,16 +770319,16 @@ function PromptInput({
770213
770319
  });
770214
770320
  } else {
770215
770321
  const shortcutDisplay = getShortcutDisplay("chat:imagePaste", "Chat", "ctrl+v");
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.`;
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.`;
770217
770323
  addNotification({
770218
770324
  key: "no-image-in-clipboard",
770219
770325
  text: message,
770220
770326
  priority: "immediate",
770221
- timeoutMs: 6000
770327
+ timeoutMs: 8000
770222
770328
  });
770223
770329
  }
770224
770330
  });
770225
- }, [addNotification, insertTextAtCursor]);
770331
+ }, [addNotification, insertTextAtCursor, internal_querier]);
770226
770332
  const keybindingContext = useOptionalKeybindingContext();
770227
770333
  import_react261.useEffect(() => {
770228
770334
  if (!keybindingContext || isModalOverlayActive)
@@ -781190,7 +781296,7 @@ var require_lib20 = __commonJS((exports, module) => {
781190
781296
 
781191
781297
  // src/utils/cleanup.ts
781192
781298
  import * as fs25 from "fs/promises";
781193
- import { homedir as homedir45 } from "os";
781299
+ import { homedir as homedir46 } from "os";
781194
781300
  import { join as join175 } from "path";
781195
781301
  function getCutoffDate() {
781196
781302
  const settings = getSettings_DEPRECATED() || {};
@@ -781504,7 +781610,7 @@ async function cleanupNpmCacheForAnthropicPackages() {
781504
781610
  return;
781505
781611
  }
781506
781612
  logForDebugging("npm cache cleanup: starting");
781507
- const npmCachePath = join175(homedir45(), ".npm", "_cacache");
781613
+ const npmCachePath = join175(homedir46(), ".npm", "_cacache");
781508
781614
  const NPM_CACHE_RETENTION_COUNT = 5;
781509
781615
  const startTime2 = Date.now();
781510
781616
  try {
@@ -803056,7 +803162,7 @@ var exports_TrustDialog = {};
803056
803162
  __export(exports_TrustDialog, {
803057
803163
  TrustDialog: () => TrustDialog
803058
803164
  });
803059
- import { homedir as homedir47 } from "os";
803165
+ import { homedir as homedir48 } from "os";
803060
803166
  function TrustDialog(t0) {
803061
803167
  const $4 = import_compiler_runtime356.c(33);
803062
803168
  const {
@@ -803167,7 +803273,7 @@ function TrustDialog(t0) {
803167
803273
  let t13;
803168
803274
  if ($4[13] !== hasAnyBashExecution) {
803169
803275
  t12 = () => {
803170
- const isHomeDir = homedir47() === getCwd();
803276
+ const isHomeDir = homedir48() === getCwd();
803171
803277
  logEvent2("tengu_trust_dialog_shown", {
803172
803278
  isHomeDir,
803173
803279
  hasMcpServers,
@@ -803196,7 +803302,7 @@ function TrustDialog(t0) {
803196
803302
  gracefulShutdownSync(1);
803197
803303
  return;
803198
803304
  }
803199
- const isHomeDir_0 = homedir47() === getCwd();
803305
+ const isHomeDir_0 = homedir48() === getCwd();
803200
803306
  logEvent2("tengu_trust_dialog_accept", {
803201
803307
  isHomeDir: isHomeDir_0,
803202
803308
  hasMcpServers,
@@ -808688,7 +808794,7 @@ var init_bundled3 = __esm(() => {
808688
808794
 
808689
808795
  // src/utils/deepLink/banner.ts
808690
808796
  import { stat as stat53 } from "fs/promises";
808691
- import { homedir as homedir48 } from "os";
808797
+ import { homedir as homedir49 } from "os";
808692
808798
  import { join as join183, sep as sep48 } from "path";
808693
808799
  function buildDeepLinkBanner(info) {
808694
808800
  const lines2 = [
@@ -808727,7 +808833,7 @@ async function mtimeOrUndefined(p4) {
808727
808833
  }
808728
808834
  }
808729
808835
  function tildify(p4) {
808730
- const home = homedir48();
808836
+ const home = homedir49();
808731
808837
  if (p4 === home)
808732
808838
  return "~";
808733
808839
  if (p4.startsWith(home + sep48))
@@ -810028,7 +810134,7 @@ __export(exports_protocolHandler, {
810028
810134
  handleUrlSchemeLaunch: () => handleUrlSchemeLaunch,
810029
810135
  handleDeepLinkUri: () => handleDeepLinkUri
810030
810136
  });
810031
- import { homedir as homedir49 } from "os";
810137
+ import { homedir as homedir50 } from "os";
810032
810138
  async function handleDeepLinkUri(uri3) {
810033
810139
  logForDebugging(`Handling deep link URI: ${uri3}`);
810034
810140
  let action2;
@@ -810082,7 +810188,7 @@ async function resolveCwd(action2) {
810082
810188
  }
810083
810189
  logForDebugging(`No local clone found for repo ${action2.repo}, falling back to home`);
810084
810190
  }
810085
- return { cwd: homedir49() };
810191
+ return { cwd: homedir50() };
810086
810192
  }
810087
810193
  var init_protocolHandler = __esm(() => {
810088
810194
  init_debug();
@@ -810325,7 +810431,7 @@ var init_sessionMemory = __esm(() => {
810325
810431
 
810326
810432
  // src/utils/iTermBackup.ts
810327
810433
  import { copyFile as copyFile12, stat as stat54 } from "fs/promises";
810328
- import { homedir as homedir50 } from "os";
810434
+ import { homedir as homedir51 } from "os";
810329
810435
  import { join as join186 } from "path";
810330
810436
  function markITerm2SetupComplete() {
810331
810437
  saveGlobalConfig((current) => ({
@@ -810341,7 +810447,7 @@ function getIterm2RecoveryInfo() {
810341
810447
  };
810342
810448
  }
810343
810449
  function getITerm2PlistPath() {
810344
- return join186(homedir50(), "Library", "Preferences", "com.googlecode.iterm2.plist");
810450
+ return join186(homedir51(), "Library", "Preferences", "com.googlecode.iterm2.plist");
810345
810451
  }
810346
810452
  async function checkAndRestoreITerm2Backup() {
810347
810453
  const { inProgress, backupPath } = getIterm2RecoveryInfo();
@@ -816451,7 +816557,7 @@ __export(exports_claudeDesktop, {
816451
816557
  getClaudeDesktopConfigPath: () => getClaudeDesktopConfigPath
816452
816558
  });
816453
816559
  import { readdir as readdir38, readFile as readFile70, stat as stat56 } from "fs/promises";
816454
- import { homedir as homedir51 } from "os";
816560
+ import { homedir as homedir52 } from "os";
816455
816561
  import { join as join189 } from "path";
816456
816562
  async function getClaudeDesktopConfigPath() {
816457
816563
  const platform7 = getPlatform();
@@ -816459,7 +816565,7 @@ async function getClaudeDesktopConfigPath() {
816459
816565
  throw new Error(`Unsupported platform: ${platform7} - Claude Desktop integration only works on macOS and WSL.`);
816460
816566
  }
816461
816567
  if (platform7 === "macos") {
816462
- return join189(homedir51(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
816568
+ return join189(homedir52(), "Library", "Application Support", "Claude", "claude_desktop_config.json");
816463
816569
  }
816464
816570
  const windowsHome = process.env.USERPROFILE ? process.env.USERPROFILE.replace(/\\/g, "/") : null;
816465
816571
  if (windowsHome) {
@@ -817459,11 +817565,11 @@ var exports_install = {};
817459
817565
  __export(exports_install, {
817460
817566
  install: () => install2
817461
817567
  });
817462
- import { homedir as homedir52 } from "os";
817568
+ import { homedir as homedir53 } from "os";
817463
817569
  import { join as join190 } from "path";
817464
817570
  function getInstallationPath2() {
817465
817571
  const isWindows3 = env4.platform === "win32";
817466
- const homeDir = homedir52();
817572
+ const homeDir = homedir53();
817467
817573
  if (isWindows3) {
817468
817574
  const windowsPath = join190(homeDir, ".local", "bin", "claude.exe");
817469
817575
  return windowsPath.replace(/\//g, "\\");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cnwenf/occ",
3
- "version": "2.1.272",
3
+ "version": "2.1.273",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "bin": {