ccman 3.3.6 → 3.3.7

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 CHANGED
@@ -15,7 +15,7 @@ var init_package = __esm({
15
15
  "../core/package.json"() {
16
16
  package_default = {
17
17
  name: "@ccman/core",
18
- version: "3.3.6",
18
+ version: "3.3.7",
19
19
  type: "module",
20
20
  description: "Core business logic for ccman - Manage Codex, Claude Code, Gemini CLI, and MCP configurations",
21
21
  main: "./dist/index.js",
@@ -229,6 +229,15 @@ function fileExists(filePath) {
229
229
  return false;
230
230
  }
231
231
  }
232
+ function backupFile(filePath) {
233
+ if (!fileExists(filePath)) {
234
+ throw new Error(`File not found: ${filePath}`);
235
+ }
236
+ const backupPath = `${filePath}.bak`;
237
+ fs.copyFileSync(filePath, backupPath);
238
+ fs.chmodSync(backupPath, 384);
239
+ return backupPath;
240
+ }
232
241
  var init_file = __esm({
233
242
  "../core/dist/utils/file.js"() {
234
243
  "use strict";
@@ -314,6 +323,9 @@ function writeCodexConfig(provider) {
314
323
  if (mergedConfig.features && typeof mergedConfig.features === "object" && !Array.isArray(mergedConfig.features) && "web_search_request" in mergedConfig.features) {
315
324
  delete mergedConfig.features.web_search_request;
316
325
  }
326
+ if ("web_search_request" in mergedConfig) {
327
+ delete mergedConfig.web_search_request;
328
+ }
317
329
  if (mergedConfig.features && typeof mergedConfig.features === "object" && !Array.isArray(mergedConfig.features)) {
318
330
  for (const key of ["plan_tool", "view_image_tool", "rmcp_client", "streamable_shell"]) {
319
331
  if (key in mergedConfig.features) {
@@ -324,9 +336,6 @@ function writeCodexConfig(provider) {
324
336
  delete mergedConfig.features;
325
337
  }
326
338
  }
327
- if (!mergedConfig.web_search) {
328
- mergedConfig.web_search = "live";
329
- }
330
339
  const providerKey = resolveCodexProviderKey(provider);
331
340
  mergedConfig.model_provider = providerKey;
332
341
  mergedConfig.model = provider.model || mergedConfig.model || "gpt-5.2-codex";
@@ -342,15 +351,14 @@ function writeCodexConfig(provider) {
342
351
  };
343
352
  fs2.writeFileSync(configPath, stringifyToml(mergedConfig), { mode: 384 });
344
353
  const authPath = getCodexAuthPath();
345
- let auth;
346
354
  if (fileExists(authPath)) {
347
- const content = fs2.readFileSync(authPath, "utf-8");
348
- auth = JSON.parse(content);
349
- } else {
350
- auth = { OPENAI_API_KEY: "" };
355
+ try {
356
+ backupFile(authPath);
357
+ } catch {
358
+ }
351
359
  }
352
- auth.OPENAI_API_KEY = provider.apiKey;
353
- fs2.writeFileSync(authPath, JSON.stringify(auth, null, 2), { mode: 384 });
360
+ const auth = { OPENAI_API_KEY: provider.apiKey };
361
+ writeJSON(authPath, auth);
354
362
  }
355
363
  var __filename, __dirname, CODEX_DEFAULT_CONFIG;
356
364
  var init_codex = __esm({
@@ -365,13 +373,9 @@ var init_codex = __esm({
365
373
  model: "gpt-5.2-codex",
366
374
  model_reasoning_effort: "high",
367
375
  model_verbosity: "high",
368
- web_search: "live",
376
+ network_access: "enabled",
369
377
  disable_response_storage: true,
370
- windows_wsl_setup_acknowledged: true,
371
- sandbox_mode: "workspace-write",
372
- sandbox_workspace_write: {
373
- network_access: true
374
- }
378
+ windows_wsl_setup_acknowledged: true
375
379
  };
376
380
  }
377
381
  });
@@ -2202,7 +2206,7 @@ function getFileSize(filePath) {
2202
2206
  return 0;
2203
2207
  }
2204
2208
  }
2205
- function backupFile(filePath) {
2209
+ function backupFile2(filePath) {
2206
2210
  const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/:/g, "-").split(".")[0];
2207
2211
  const backupPath = `${filePath}.backup-${timestamp}`;
2208
2212
  fs11.copyFileSync(filePath, backupPath);
@@ -2269,7 +2273,7 @@ function cleanClaudeJson(options = {}) {
2269
2273
  if (!fs11.existsSync(filePath)) {
2270
2274
  throw new Error(`${filePath} \u6587\u4EF6\u4E0D\u5B58\u5728`);
2271
2275
  }
2272
- const backupPath = backupFile(filePath);
2276
+ const backupPath = backupFile2(filePath);
2273
2277
  const sizeBefore = getFileSize(filePath);
2274
2278
  const content = fs11.readFileSync(filePath, "utf-8");
2275
2279
  const config = JSON.parse(content);
@@ -8,14 +8,6 @@
8
8
  model = "gpt-5.2-codex"
9
9
  model_reasoning_effort = "high"
10
10
  model_verbosity = "high"
11
+ network_access = "enabled"
11
12
  disable_response_storage = true
12
13
  windows_wsl_setup_acknowledged = true
13
-
14
- # Web 搜索策略(替代旧的 [features].web_search_request)
15
- web_search = "live" # "live" | "cached" | "disabled"
16
-
17
- # 沙箱与网络访问:workspace-write + 允许联网
18
- sandbox_mode = "workspace-write"
19
-
20
- [sandbox_workspace_write]
21
- network_access = true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccman",
3
- "version": "3.3.6",
3
+ "version": "3.3.7",
4
4
  "type": "module",
5
5
  "description": "Manage Codex, Claude Code, Gemini CLI, OpenCode, and MCP API service provider configurations",
6
6
  "main": "./dist/index.js",