@cnwenf/occ 2.1.256 → 2.1.258
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 +78 -13
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -262807,6 +262807,61 @@ var init_tmuxSocket = __esm(() => {
|
|
|
262807
262807
|
init_platform2();
|
|
262808
262808
|
});
|
|
262809
262809
|
|
|
262810
|
+
// src/utils/shell/pidNamespace.ts
|
|
262811
|
+
var exports_pidNamespace = {};
|
|
262812
|
+
__export(exports_pidNamespace, {
|
|
262813
|
+
wrapWithPidNamespace: () => wrapWithPidNamespace,
|
|
262814
|
+
isPidNamespaceAvailable: () => isPidNamespaceAvailable,
|
|
262815
|
+
_resetPidNamespaceCache: () => _resetPidNamespaceCache,
|
|
262816
|
+
PID_NAMESPACE_DISABLE_ENV: () => PID_NAMESPACE_DISABLE_ENV
|
|
262817
|
+
});
|
|
262818
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
262819
|
+
function isPidNamespaceAvailable() {
|
|
262820
|
+
if (_availabilityCache !== undefined)
|
|
262821
|
+
return _availabilityCache;
|
|
262822
|
+
_availabilityCache = computePidNamespaceAvailable();
|
|
262823
|
+
return _availabilityCache;
|
|
262824
|
+
}
|
|
262825
|
+
function computePidNamespaceAvailable() {
|
|
262826
|
+
if (getPlatform() !== "linux")
|
|
262827
|
+
return false;
|
|
262828
|
+
if (process.env[PID_NAMESPACE_DISABLE_ENV])
|
|
262829
|
+
return false;
|
|
262830
|
+
try {
|
|
262831
|
+
execFileSync2("test", ["-e", "/proc/self/ns/pid"], { stdio: "ignore" });
|
|
262832
|
+
} catch {
|
|
262833
|
+
return false;
|
|
262834
|
+
}
|
|
262835
|
+
try {
|
|
262836
|
+
execFileSync2("command", ["-v", "unshare"], {
|
|
262837
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
262838
|
+
shell: "bash"
|
|
262839
|
+
});
|
|
262840
|
+
} catch {
|
|
262841
|
+
try {
|
|
262842
|
+
execFileSync2("unshare", ["--help"], { stdio: "ignore" });
|
|
262843
|
+
} catch {
|
|
262844
|
+
return false;
|
|
262845
|
+
}
|
|
262846
|
+
}
|
|
262847
|
+
return true;
|
|
262848
|
+
}
|
|
262849
|
+
function wrapWithPidNamespace(shellPath, commandString) {
|
|
262850
|
+
if (!isPidNamespaceAvailable())
|
|
262851
|
+
return commandString;
|
|
262852
|
+
const innerShell = quote([shellPath]);
|
|
262853
|
+
const innerCmd = quote([commandString]);
|
|
262854
|
+
return `unshare --user --map-root-user --pid --fork -- ${innerShell} -c ${innerCmd}`;
|
|
262855
|
+
}
|
|
262856
|
+
function _resetPidNamespaceCache() {
|
|
262857
|
+
_availabilityCache = undefined;
|
|
262858
|
+
}
|
|
262859
|
+
var PID_NAMESPACE_DISABLE_ENV = "CLAUDE_CODE_DISABLE_PID_NAMESPACE", _availabilityCache;
|
|
262860
|
+
var init_pidNamespace = __esm(() => {
|
|
262861
|
+
init_platform2();
|
|
262862
|
+
init_shellQuote();
|
|
262863
|
+
});
|
|
262864
|
+
|
|
262810
262865
|
// src/utils/shell/bashProvider.ts
|
|
262811
262866
|
import { access } from "fs/promises";
|
|
262812
262867
|
import { tmpdir as osTmpdir } from "os";
|
|
@@ -262885,8 +262940,8 @@ ${quotedCommand.slice(0, 500)}`);
|
|
|
262885
262940
|
}
|
|
262886
262941
|
if (opts.useSandbox) {
|
|
262887
262942
|
try {
|
|
262888
|
-
const { wrapWithPidNamespace } = (()
|
|
262889
|
-
commandString =
|
|
262943
|
+
const { wrapWithPidNamespace: wrapWithPidNamespace2 } = (init_pidNamespace(), __toCommonJS(exports_pidNamespace));
|
|
262944
|
+
commandString = wrapWithPidNamespace2(commandString);
|
|
262890
262945
|
} catch {}
|
|
262891
262946
|
}
|
|
262892
262947
|
return { commandString, cwdFilePath };
|
|
@@ -263047,7 +263102,7 @@ var init_powershellProvider = __esm(() => {
|
|
|
263047
263102
|
});
|
|
263048
263103
|
|
|
263049
263104
|
// src/utils/Shell.ts
|
|
263050
|
-
import { execFileSync as
|
|
263105
|
+
import { execFileSync as execFileSync3, spawn as spawn7 } from "child_process";
|
|
263051
263106
|
import { constants as fsConstants4, readFileSync as readFileSync19, unlinkSync as unlinkSync3 } from "fs";
|
|
263052
263107
|
import { mkdir as mkdir12, open as open6, realpath as realpath8 } from "fs/promises";
|
|
263053
263108
|
import { isAbsolute as isAbsolute12, resolve as resolve23 } from "path";
|
|
@@ -263059,7 +263114,7 @@ function isExecutable(shellPath) {
|
|
|
263059
263114
|
return true;
|
|
263060
263115
|
} catch (_err) {
|
|
263061
263116
|
try {
|
|
263062
|
-
|
|
263117
|
+
execFileSync3(shellPath, ["--version"], {
|
|
263063
263118
|
timeout: 1000,
|
|
263064
263119
|
stdio: "ignore"
|
|
263065
263120
|
});
|
|
@@ -268021,7 +268076,7 @@ var DEFAULT_MAX_LISTENERS = 50;
|
|
|
268021
268076
|
var init_abortController = () => {};
|
|
268022
268077
|
|
|
268023
268078
|
// src/utils/idePathConversion.ts
|
|
268024
|
-
import { execFileSync as
|
|
268079
|
+
import { execFileSync as execFileSync4 } from "child_process";
|
|
268025
268080
|
|
|
268026
268081
|
class WindowsToWSLConverter {
|
|
268027
268082
|
wslDistroName;
|
|
@@ -268038,7 +268093,7 @@ class WindowsToWSLConverter {
|
|
|
268038
268093
|
}
|
|
268039
268094
|
}
|
|
268040
268095
|
try {
|
|
268041
|
-
const result =
|
|
268096
|
+
const result = execFileSync4("wslpath", ["-u", windowsPath], {
|
|
268042
268097
|
encoding: "utf8",
|
|
268043
268098
|
stdio: ["pipe", "pipe", "ignore"]
|
|
268044
268099
|
}).trim();
|
|
@@ -268051,7 +268106,7 @@ class WindowsToWSLConverter {
|
|
|
268051
268106
|
if (!wslPath)
|
|
268052
268107
|
return wslPath;
|
|
268053
268108
|
try {
|
|
268054
|
-
const result =
|
|
268109
|
+
const result = execFileSync4("wslpath", ["-w", wslPath], {
|
|
268055
268110
|
encoding: "utf8",
|
|
268056
268111
|
stdio: ["pipe", "pipe", "ignore"]
|
|
268057
268112
|
}).trim();
|
|
@@ -472570,12 +472625,16 @@ function UserToolSuccessMessage({
|
|
|
472570
472625
|
return null;
|
|
472571
472626
|
}
|
|
472572
472627
|
const rendersAsAssistantText = tool.userFacingName(undefined) === "";
|
|
472628
|
+
const MAX_COLLAPSED_ROWS = verbose ? undefined : 12;
|
|
472629
|
+
const [expanded, setExpanded] = React32.useState(verbose);
|
|
472573
472630
|
return /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(ThemedBox_default, {
|
|
472574
472631
|
flexDirection: "column",
|
|
472575
472632
|
children: [
|
|
472576
472633
|
/* @__PURE__ */ jsx_dev_runtime120.jsxDEV(ThemedBox_default, {
|
|
472577
472634
|
flexDirection: "column",
|
|
472578
472635
|
width: rendersAsAssistantText ? undefined : width,
|
|
472636
|
+
maxHeight: expanded ? undefined : MAX_COLLAPSED_ROWS,
|
|
472637
|
+
overflow: expanded ? undefined : "hidden",
|
|
472579
472638
|
children: [
|
|
472580
472639
|
renderedMessage,
|
|
472581
472640
|
feature("BASH_CLASSIFIER") ? classifierRule && /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(MessageResponse, {
|
|
@@ -472601,6 +472660,10 @@ function UserToolSuccessMessage({
|
|
|
472601
472660
|
}, undefined, false, undefined, this) : null
|
|
472602
472661
|
]
|
|
472603
472662
|
}, undefined, true, undefined, this),
|
|
472663
|
+
!expanded && /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(ThemedText, {
|
|
472664
|
+
dimColor: true,
|
|
472665
|
+
children: " \xB7 \u2193 'e' to show full tool output"
|
|
472666
|
+
}, undefined, false, undefined, this),
|
|
472604
472667
|
/* @__PURE__ */ jsx_dev_runtime120.jsxDEV(SentryErrorBoundary, {
|
|
472605
472668
|
children: /* @__PURE__ */ jsx_dev_runtime120.jsxDEV(HookProgressMessage, {
|
|
472606
472669
|
hookEvent: "PostToolUse",
|
|
@@ -475638,6 +475701,7 @@ async function* runAgent({
|
|
|
475638
475701
|
override,
|
|
475639
475702
|
model,
|
|
475640
475703
|
maxTurns,
|
|
475704
|
+
subagentDepth,
|
|
475641
475705
|
preserveToolUseResults,
|
|
475642
475706
|
availableTools,
|
|
475643
475707
|
allowedTools,
|
|
@@ -512472,6 +512536,7 @@ You MUST call the ${SYNTHETIC_OUTPUT_TOOL_NAME} tool exactly once at the end of
|
|
|
512472
512536
|
canShowPermissionPrompts: false,
|
|
512473
512537
|
querySource: "workflow",
|
|
512474
512538
|
model: opts.model,
|
|
512539
|
+
subagentDepth: (ctx.toolUseContext.subagentDepth ?? 0) + 1,
|
|
512475
512540
|
maxTurns: opts.schema ? 30 : undefined,
|
|
512476
512541
|
availableTools: ctx.availableTools,
|
|
512477
512542
|
worktreePath,
|
|
@@ -636904,7 +636969,7 @@ __export(exports_insights, {
|
|
|
636904
636969
|
deduplicateSessionBranches: () => deduplicateSessionBranches,
|
|
636905
636970
|
buildExportData: () => buildExportData
|
|
636906
636971
|
});
|
|
636907
|
-
import { execFileSync as
|
|
636972
|
+
import { execFileSync as execFileSync5 } from "child_process";
|
|
636908
636973
|
import { constants as fsConstants8 } from "fs";
|
|
636909
636974
|
import {
|
|
636910
636975
|
copyFile as copyFile10,
|
|
@@ -639027,7 +639092,7 @@ Find something genuinely interesting or amusing from the session summaries.`,
|
|
|
639027
639092
|
const s3Url = `https://s3-frontend.infra.ant.dev/anthropic-serve/atamkin/cc-user-reports/${filename}`;
|
|
639028
639093
|
reportUrl = s3Url;
|
|
639029
639094
|
try {
|
|
639030
|
-
|
|
639095
|
+
execFileSync5("ff", ["cp", htmlPath, s3Path], {
|
|
639031
639096
|
timeout: 60000,
|
|
639032
639097
|
stdio: "pipe"
|
|
639033
639098
|
});
|
|
@@ -650518,7 +650583,7 @@ var init_chromeNativeHost = __esm(() => {
|
|
|
650518
650583
|
});
|
|
650519
650584
|
|
|
650520
650585
|
// src/daemon/process.ts
|
|
650521
|
-
import { execFileSync as
|
|
650586
|
+
import { execFileSync as execFileSync6 } from "child_process";
|
|
650522
650587
|
function isPidAlive(pid) {
|
|
650523
650588
|
if (!pid || pid <= 0)
|
|
650524
650589
|
return false;
|
|
@@ -650534,7 +650599,7 @@ function getProcessStartMs(pid) {
|
|
|
650534
650599
|
return null;
|
|
650535
650600
|
let out;
|
|
650536
650601
|
try {
|
|
650537
|
-
out =
|
|
650602
|
+
out = execFileSync6("ps", ["-o", "lstart=", "-p", String(pid)], {
|
|
650538
650603
|
encoding: "utf-8",
|
|
650539
650604
|
stdio: ["ignore", "pipe", "ignore"],
|
|
650540
650605
|
timeout: 2000
|
|
@@ -653872,11 +653937,11 @@ var init_lockfile = __esm(() => {
|
|
|
653872
653937
|
});
|
|
653873
653938
|
|
|
653874
653939
|
// src/daemon/respawn.ts
|
|
653875
|
-
import { execFileSync as
|
|
653940
|
+
import { execFileSync as execFileSync7 } from "child_process";
|
|
653876
653941
|
function findOrphanedWorkers() {
|
|
653877
653942
|
let out;
|
|
653878
653943
|
try {
|
|
653879
|
-
out =
|
|
653944
|
+
out = execFileSync7("ps", ["-e", "-o", "pid=,ppid=,command="], {
|
|
653880
653945
|
encoding: "utf-8",
|
|
653881
653946
|
stdio: ["ignore", "pipe", "ignore"],
|
|
653882
653947
|
timeout: 3000
|