@cnwenf/occ 2.1.257 → 2.1.259
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 +87 -14
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -208988,7 +208988,17 @@ var init_ripgrep = __esm(() => {
|
|
|
208988
208988
|
}
|
|
208989
208989
|
const rgRoot = path13.resolve(__dirname3, "vendor", "ripgrep");
|
|
208990
208990
|
const command4 = process.platform === "win32" ? path13.resolve(rgRoot, `${process.arch}-win32`, "rg.exe") : path13.resolve(rgRoot, `${process.arch}-${process.platform}`, "rg");
|
|
208991
|
-
|
|
208991
|
+
try {
|
|
208992
|
+
const fs9 = __require("fs");
|
|
208993
|
+
if (fs9.existsSync(command4)) {
|
|
208994
|
+
return { mode: "builtin", command: command4, args: [] };
|
|
208995
|
+
}
|
|
208996
|
+
} catch {}
|
|
208997
|
+
const { cmd: systemRg } = findExecutable2("rg", []);
|
|
208998
|
+
if (systemRg !== "rg") {
|
|
208999
|
+
return { mode: "system", command: "rg", args: [] };
|
|
209000
|
+
}
|
|
209001
|
+
return { mode: "system", command: "grep", args: ["-rn"] };
|
|
208992
209002
|
});
|
|
208993
209003
|
RipgrepTimeoutError = class RipgrepTimeoutError extends Error {
|
|
208994
209004
|
partialResults;
|
|
@@ -262807,6 +262817,61 @@ var init_tmuxSocket = __esm(() => {
|
|
|
262807
262817
|
init_platform2();
|
|
262808
262818
|
});
|
|
262809
262819
|
|
|
262820
|
+
// src/utils/shell/pidNamespace.ts
|
|
262821
|
+
var exports_pidNamespace = {};
|
|
262822
|
+
__export(exports_pidNamespace, {
|
|
262823
|
+
wrapWithPidNamespace: () => wrapWithPidNamespace,
|
|
262824
|
+
isPidNamespaceAvailable: () => isPidNamespaceAvailable,
|
|
262825
|
+
_resetPidNamespaceCache: () => _resetPidNamespaceCache,
|
|
262826
|
+
PID_NAMESPACE_DISABLE_ENV: () => PID_NAMESPACE_DISABLE_ENV
|
|
262827
|
+
});
|
|
262828
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
262829
|
+
function isPidNamespaceAvailable() {
|
|
262830
|
+
if (_availabilityCache !== undefined)
|
|
262831
|
+
return _availabilityCache;
|
|
262832
|
+
_availabilityCache = computePidNamespaceAvailable();
|
|
262833
|
+
return _availabilityCache;
|
|
262834
|
+
}
|
|
262835
|
+
function computePidNamespaceAvailable() {
|
|
262836
|
+
if (getPlatform() !== "linux")
|
|
262837
|
+
return false;
|
|
262838
|
+
if (process.env[PID_NAMESPACE_DISABLE_ENV])
|
|
262839
|
+
return false;
|
|
262840
|
+
try {
|
|
262841
|
+
execFileSync2("test", ["-e", "/proc/self/ns/pid"], { stdio: "ignore" });
|
|
262842
|
+
} catch {
|
|
262843
|
+
return false;
|
|
262844
|
+
}
|
|
262845
|
+
try {
|
|
262846
|
+
execFileSync2("command", ["-v", "unshare"], {
|
|
262847
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
262848
|
+
shell: "bash"
|
|
262849
|
+
});
|
|
262850
|
+
} catch {
|
|
262851
|
+
try {
|
|
262852
|
+
execFileSync2("unshare", ["--help"], { stdio: "ignore" });
|
|
262853
|
+
} catch {
|
|
262854
|
+
return false;
|
|
262855
|
+
}
|
|
262856
|
+
}
|
|
262857
|
+
return true;
|
|
262858
|
+
}
|
|
262859
|
+
function wrapWithPidNamespace(shellPath, commandString) {
|
|
262860
|
+
if (!isPidNamespaceAvailable())
|
|
262861
|
+
return commandString;
|
|
262862
|
+
const innerShell = quote([shellPath]);
|
|
262863
|
+
const innerCmd = quote([commandString]);
|
|
262864
|
+
return `unshare --user --map-root-user --pid --fork -- ${innerShell} -c ${innerCmd}`;
|
|
262865
|
+
}
|
|
262866
|
+
function _resetPidNamespaceCache() {
|
|
262867
|
+
_availabilityCache = undefined;
|
|
262868
|
+
}
|
|
262869
|
+
var PID_NAMESPACE_DISABLE_ENV = "CLAUDE_CODE_DISABLE_PID_NAMESPACE", _availabilityCache;
|
|
262870
|
+
var init_pidNamespace = __esm(() => {
|
|
262871
|
+
init_platform2();
|
|
262872
|
+
init_shellQuote();
|
|
262873
|
+
});
|
|
262874
|
+
|
|
262810
262875
|
// src/utils/shell/bashProvider.ts
|
|
262811
262876
|
import { access } from "fs/promises";
|
|
262812
262877
|
import { tmpdir as osTmpdir } from "os";
|
|
@@ -262885,8 +262950,8 @@ ${quotedCommand.slice(0, 500)}`);
|
|
|
262885
262950
|
}
|
|
262886
262951
|
if (opts.useSandbox) {
|
|
262887
262952
|
try {
|
|
262888
|
-
const { wrapWithPidNamespace } = (()
|
|
262889
|
-
commandString =
|
|
262953
|
+
const { wrapWithPidNamespace: wrapWithPidNamespace2 } = (init_pidNamespace(), __toCommonJS(exports_pidNamespace));
|
|
262954
|
+
commandString = wrapWithPidNamespace2(commandString);
|
|
262890
262955
|
} catch {}
|
|
262891
262956
|
}
|
|
262892
262957
|
return { commandString, cwdFilePath };
|
|
@@ -263047,7 +263112,7 @@ var init_powershellProvider = __esm(() => {
|
|
|
263047
263112
|
});
|
|
263048
263113
|
|
|
263049
263114
|
// src/utils/Shell.ts
|
|
263050
|
-
import { execFileSync as
|
|
263115
|
+
import { execFileSync as execFileSync3, spawn as spawn7 } from "child_process";
|
|
263051
263116
|
import { constants as fsConstants4, readFileSync as readFileSync19, unlinkSync as unlinkSync3 } from "fs";
|
|
263052
263117
|
import { mkdir as mkdir12, open as open6, realpath as realpath8 } from "fs/promises";
|
|
263053
263118
|
import { isAbsolute as isAbsolute12, resolve as resolve23 } from "path";
|
|
@@ -263059,7 +263124,7 @@ function isExecutable(shellPath) {
|
|
|
263059
263124
|
return true;
|
|
263060
263125
|
} catch (_err) {
|
|
263061
263126
|
try {
|
|
263062
|
-
|
|
263127
|
+
execFileSync3(shellPath, ["--version"], {
|
|
263063
263128
|
timeout: 1000,
|
|
263064
263129
|
stdio: "ignore"
|
|
263065
263130
|
});
|
|
@@ -268021,7 +268086,7 @@ var DEFAULT_MAX_LISTENERS = 50;
|
|
|
268021
268086
|
var init_abortController = () => {};
|
|
268022
268087
|
|
|
268023
268088
|
// src/utils/idePathConversion.ts
|
|
268024
|
-
import { execFileSync as
|
|
268089
|
+
import { execFileSync as execFileSync4 } from "child_process";
|
|
268025
268090
|
|
|
268026
268091
|
class WindowsToWSLConverter {
|
|
268027
268092
|
wslDistroName;
|
|
@@ -268038,7 +268103,7 @@ class WindowsToWSLConverter {
|
|
|
268038
268103
|
}
|
|
268039
268104
|
}
|
|
268040
268105
|
try {
|
|
268041
|
-
const result =
|
|
268106
|
+
const result = execFileSync4("wslpath", ["-u", windowsPath], {
|
|
268042
268107
|
encoding: "utf8",
|
|
268043
268108
|
stdio: ["pipe", "pipe", "ignore"]
|
|
268044
268109
|
}).trim();
|
|
@@ -268051,7 +268116,7 @@ class WindowsToWSLConverter {
|
|
|
268051
268116
|
if (!wslPath)
|
|
268052
268117
|
return wslPath;
|
|
268053
268118
|
try {
|
|
268054
|
-
const result =
|
|
268119
|
+
const result = execFileSync4("wslpath", ["-w", wslPath], {
|
|
268055
268120
|
encoding: "utf8",
|
|
268056
268121
|
stdio: ["pipe", "pipe", "ignore"]
|
|
268057
268122
|
}).trim();
|
|
@@ -472570,12 +472635,16 @@ function UserToolSuccessMessage({
|
|
|
472570
472635
|
return null;
|
|
472571
472636
|
}
|
|
472572
472637
|
const rendersAsAssistantText = tool.userFacingName(undefined) === "";
|
|
472638
|
+
const MAX_COLLAPSED_ROWS = verbose ? undefined : 12;
|
|
472639
|
+
const [expanded, setExpanded] = React32.useState(verbose);
|
|
472573
472640
|
return /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(ThemedBox_default, {
|
|
472574
472641
|
flexDirection: "column",
|
|
472575
472642
|
children: [
|
|
472576
472643
|
/* @__PURE__ */ jsx_dev_runtime120.jsxDEV(ThemedBox_default, {
|
|
472577
472644
|
flexDirection: "column",
|
|
472578
472645
|
width: rendersAsAssistantText ? undefined : width,
|
|
472646
|
+
maxHeight: expanded ? undefined : MAX_COLLAPSED_ROWS,
|
|
472647
|
+
overflow: expanded ? undefined : "hidden",
|
|
472579
472648
|
children: [
|
|
472580
472649
|
renderedMessage,
|
|
472581
472650
|
feature("BASH_CLASSIFIER") ? classifierRule && /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(MessageResponse, {
|
|
@@ -472601,6 +472670,10 @@ function UserToolSuccessMessage({
|
|
|
472601
472670
|
}, undefined, false, undefined, this) : null
|
|
472602
472671
|
]
|
|
472603
472672
|
}, undefined, true, undefined, this),
|
|
472673
|
+
!expanded && /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(ThemedText, {
|
|
472674
|
+
dimColor: true,
|
|
472675
|
+
children: " \xB7 \u2193 'e' to show full tool output"
|
|
472676
|
+
}, undefined, false, undefined, this),
|
|
472604
472677
|
/* @__PURE__ */ jsx_dev_runtime120.jsxDEV(SentryErrorBoundary, {
|
|
472605
472678
|
children: /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(HookProgressMessage, {
|
|
472606
472679
|
hookEvent: "PostToolUse",
|
|
@@ -636906,7 +636979,7 @@ __export(exports_insights, {
|
|
|
636906
636979
|
deduplicateSessionBranches: () => deduplicateSessionBranches,
|
|
636907
636980
|
buildExportData: () => buildExportData
|
|
636908
636981
|
});
|
|
636909
|
-
import { execFileSync as
|
|
636982
|
+
import { execFileSync as execFileSync5 } from "child_process";
|
|
636910
636983
|
import { constants as fsConstants8 } from "fs";
|
|
636911
636984
|
import {
|
|
636912
636985
|
copyFile as copyFile10,
|
|
@@ -639029,7 +639102,7 @@ Find something genuinely interesting or amusing from the session summaries.`,
|
|
|
639029
639102
|
const s3Url = `https://s3-frontend.infra.ant.dev/anthropic-serve/atamkin/cc-user-reports/${filename}`;
|
|
639030
639103
|
reportUrl = s3Url;
|
|
639031
639104
|
try {
|
|
639032
|
-
|
|
639105
|
+
execFileSync5("ff", ["cp", htmlPath, s3Path], {
|
|
639033
639106
|
timeout: 60000,
|
|
639034
639107
|
stdio: "pipe"
|
|
639035
639108
|
});
|
|
@@ -650520,7 +650593,7 @@ var init_chromeNativeHost = __esm(() => {
|
|
|
650520
650593
|
});
|
|
650521
650594
|
|
|
650522
650595
|
// src/daemon/process.ts
|
|
650523
|
-
import { execFileSync as
|
|
650596
|
+
import { execFileSync as execFileSync6 } from "child_process";
|
|
650524
650597
|
function isPidAlive(pid) {
|
|
650525
650598
|
if (!pid || pid <= 0)
|
|
650526
650599
|
return false;
|
|
@@ -650536,7 +650609,7 @@ function getProcessStartMs(pid) {
|
|
|
650536
650609
|
return null;
|
|
650537
650610
|
let out;
|
|
650538
650611
|
try {
|
|
650539
|
-
out =
|
|
650612
|
+
out = execFileSync6("ps", ["-o", "lstart=", "-p", String(pid)], {
|
|
650540
650613
|
encoding: "utf-8",
|
|
650541
650614
|
stdio: ["ignore", "pipe", "ignore"],
|
|
650542
650615
|
timeout: 2000
|
|
@@ -653874,11 +653947,11 @@ var init_lockfile = __esm(() => {
|
|
|
653874
653947
|
});
|
|
653875
653948
|
|
|
653876
653949
|
// src/daemon/respawn.ts
|
|
653877
|
-
import { execFileSync as
|
|
653950
|
+
import { execFileSync as execFileSync7 } from "child_process";
|
|
653878
653951
|
function findOrphanedWorkers() {
|
|
653879
653952
|
let out;
|
|
653880
653953
|
try {
|
|
653881
|
-
out =
|
|
653954
|
+
out = execFileSync7("ps", ["-e", "-o", "pid=,ppid=,command="], {
|
|
653882
653955
|
encoding: "utf-8",
|
|
653883
653956
|
stdio: ["ignore", "pipe", "ignore"],
|
|
653884
653957
|
timeout: 3000
|