ccem 2.60.0 → 2.62.0
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/index.js +29 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1964,6 +1964,29 @@ async function launchClaude(options) {
|
|
|
1964
1964
|
}
|
|
1965
1965
|
|
|
1966
1966
|
// src/permissions.ts
|
|
1967
|
+
var PERMISSION_RULE_LINE_WIDTH = 100;
|
|
1968
|
+
var wrapPermissionRule = (rule) => {
|
|
1969
|
+
return rule.split("\n").flatMap((line) => {
|
|
1970
|
+
const characters = Array.from(line);
|
|
1971
|
+
if (characters.length === 0) return [""];
|
|
1972
|
+
const chunks = [];
|
|
1973
|
+
for (let index = 0; index < characters.length; index += PERMISSION_RULE_LINE_WIDTH) {
|
|
1974
|
+
chunks.push(characters.slice(index, index + PERMISSION_RULE_LINE_WIDTH).join(""));
|
|
1975
|
+
}
|
|
1976
|
+
return chunks;
|
|
1977
|
+
});
|
|
1978
|
+
};
|
|
1979
|
+
var formatPermissionRulesForDisplay = (rules) => {
|
|
1980
|
+
if (rules.length === 0) return " (\u65E0)";
|
|
1981
|
+
const numberWidth = String(rules.length).length;
|
|
1982
|
+
return rules.flatMap((rule, index) => {
|
|
1983
|
+
const prefix = `${String(index + 1).padStart(numberWidth)}. `;
|
|
1984
|
+
const continuationPrefix = " ".repeat(prefix.length);
|
|
1985
|
+
return wrapPermissionRule(rule).map(
|
|
1986
|
+
(line, lineIndex) => `${lineIndex === 0 ? prefix : continuationPrefix}${line}`
|
|
1987
|
+
);
|
|
1988
|
+
}).join("\n");
|
|
1989
|
+
};
|
|
1967
1990
|
var readSettings = (settingsPath) => {
|
|
1968
1991
|
if (fs6.existsSync(settingsPath)) {
|
|
1969
1992
|
try {
|
|
@@ -2056,16 +2079,14 @@ var showCurrentMode = () => {
|
|
|
2056
2079
|
console.log(chalk3.yellow("\u5F53\u524D\u6A21\u5F0F: \u81EA\u5B9A\u4E49"));
|
|
2057
2080
|
}
|
|
2058
2081
|
console.log(chalk3.gray(`\u914D\u7F6E\u6587\u4EF6: ${settingsPath}`));
|
|
2059
|
-
const table = new Table2({
|
|
2060
|
-
head: ["\u7C7B\u578B", "\u89C4\u5219"],
|
|
2061
|
-
style: { head: ["cyan"] },
|
|
2062
|
-
colWidths: [10, 70]
|
|
2063
|
-
});
|
|
2064
2082
|
const allowRules = config3.permissions.allow || [];
|
|
2065
2083
|
const denyRules = config3.permissions.deny || [];
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
console.log(
|
|
2084
|
+
console.log(chalk3.cyan(`
|
|
2085
|
+
Allow (${allowRules.length})`));
|
|
2086
|
+
console.log(formatPermissionRulesForDisplay(allowRules));
|
|
2087
|
+
console.log(chalk3.cyan(`
|
|
2088
|
+
Deny (${denyRules.length})`));
|
|
2089
|
+
console.log(formatPermissionRulesForDisplay(denyRules));
|
|
2069
2090
|
};
|
|
2070
2091
|
var listAvailableModes = () => {
|
|
2071
2092
|
const table = new Table2({
|