chatccc 0.2.192 → 0.2.194

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/src/session.ts CHANGED
@@ -27,9 +27,10 @@ import { logTrace } from "./trace.ts";
27
27
  import type { UnifiedBlock } from "./adapters/adapter-interface.ts";
28
28
  import type { ToolAdapter } from "./adapters/adapter-interface.ts";
29
29
  import type { ToolProcessInfo } from "./adapters/adapter-interface.ts";
30
- import { createClaudeAdapter } from "./adapters/claude-adapter.ts";
31
- import { createCursorAdapter } from "./adapters/cursor-adapter.ts";
32
- import { createCodexAdapter } from "./adapters/codex-adapter.ts";
30
+ import { createClaudeAdapter } from "./adapters/claude-adapter.ts";
31
+ import { createCursorAdapter } from "./adapters/cursor-adapter.ts";
32
+ import { createCodexAdapter } from "./adapters/codex-adapter.ts";
33
+ import { createCccAdapter } from "./adapters/ccc-adapter.ts";
33
34
  import { resourceMonitor, registerProcess, unregisterProcess } from "./adapters/resource-monitor.ts";
34
35
  import { buildImSkillsPromptCached, exportSkillSubDocs, clearImSkillsPromptCache } from "./im-skills.ts";
35
36
  import type { PlatformAdapter } from "./platform-adapter.ts";
@@ -370,8 +371,9 @@ export function getEffectiveModelForTool(tool: string, sessionId?: string): stri
370
371
  const override = sessionModelOverrides.get(sessionId);
371
372
  if (override) return override;
372
373
  }
373
- if (tool === "cursor") return config.cursor.model;
374
- if (tool === "codex") return config.codex.model;
374
+ if (tool === "cursor") return config.cursor.model;
375
+ if (tool === "codex") return config.codex.model;
376
+ if (tool === "ccc") return config.ccc.model;
375
377
  return CLAUDE_MODEL;
376
378
  }
377
379
 
@@ -420,6 +422,8 @@ export function getAdapterForTool(tool: string, sessionId?: string): ToolAdapter
420
422
  adapter = createCursorAdapter({ model: effectiveModel || undefined });
421
423
  } else if (tool === "codex") {
422
424
  adapter = createCodexAdapter({ model: effectiveModel || undefined, effort: effectiveEffort || undefined });
425
+ } else if (tool === "ccc") {
426
+ adapter = createCccAdapter({ model: effectiveModel || undefined });
423
427
  } else {
424
428
  adapter = createClaudeAdapter({
425
429
  model: effectiveModel,
@@ -859,12 +863,17 @@ function formatToolConfigForLog(tool: string, sessionModel?: string, sessionId?:
859
863
  if (tool === "codex") {
860
864
  const m = getEffectiveModelForTool(tool, sessionId);
861
865
  const e = getEffectiveEffortForTool(tool, sessionId);
862
- const modelStr = m.trim() !== "" ? m : "(由 codex config.toml 决定)";
863
- const effortStr = e.trim() !== ""
864
- ? `effort=${e}`
865
- : "effort=(由 codex config.toml 决定)";
866
- return `model=${modelStr}, ${effortStr}`;
867
- }
866
+ const modelStr = m.trim() !== "" ? m : "(由 codex config.toml 决定)";
867
+ const effortStr = e.trim() !== ""
868
+ ? `effort=${e}`
869
+ : "effort=(由 codex config.toml 决定)";
870
+ return `model=${modelStr}, ${effortStr}`;
871
+ }
872
+ if (tool === "ccc") {
873
+ const m = getEffectiveModelForTool(tool, sessionId);
874
+ const modelStr = m.trim() !== "" ? m : "(not configured)";
875
+ return `model=${modelStr}, baseURL=${config.ccc.DEEPSEEK_BASE_URL}`;
876
+ }
868
877
  return `model=${anthropicConfigDisplay(getModelForSession(sessionId))}, subagentModel=${anthropicConfigDisplay(CLAUDE_SUBAGENT_MODEL)}, effort=${anthropicConfigDisplay(getEffectiveEffortForTool(tool, sessionId))}`;
869
878
  }
870
879
 
@@ -1784,10 +1793,17 @@ async function resolveModelEffort(
1784
1793
  if (tool === "codex") {
1785
1794
  const m = getEffectiveModelForTool(tool, sessionId);
1786
1795
  const e = getEffectiveEffortForTool(tool, sessionId);
1787
- return {
1788
- model: m.trim() !== "" ? m : UNKNOWN_MODEL_PLACEHOLDER,
1789
- effort: e.trim() !== "" ? e : UNKNOWN_MODEL_PLACEHOLDER,
1790
- };
1796
+ return {
1797
+ model: m.trim() !== "" ? m : UNKNOWN_MODEL_PLACEHOLDER,
1798
+ effort: e.trim() !== "" ? e : UNKNOWN_MODEL_PLACEHOLDER,
1799
+ };
1800
+ }
1801
+ if (tool === "ccc") {
1802
+ const m = getEffectiveModelForTool(tool, sessionId);
1803
+ return {
1804
+ model: m.trim() !== "" ? m : UNKNOWN_MODEL_PLACEHOLDER,
1805
+ effort: null,
1806
+ };
1791
1807
  }
1792
1808
  return {
1793
1809
  model: anthropicConfigDisplay(getModelForSession(sessionId)),