chatccc 0.2.76 → 0.2.78

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chatccc",
3
- "version": "0.2.76",
3
+ "version": "0.2.78",
4
4
  "description": "Feishu bot bridge for Claude Code",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -55,7 +55,7 @@
55
55
  "@types/qrcode-terminal": "^0.12.2",
56
56
  "@types/ws": "^8.18.1",
57
57
  "typescript": "^5.0.0",
58
- "vitest": "^4.1.5"
58
+ "vitest": "^3.2.4"
59
59
  },
60
60
  "engines": {
61
61
  "node": ">=20"
@@ -581,7 +581,7 @@ describe("createClaudeAdapter — sessionOpts 形状", () => {
581
581
  permissionMode: "bypassPermissions",
582
582
  allowDangerouslySkipPermissions: true,
583
583
  autoCompactEnabled: true,
584
- settingSources: ["project", "local"],
584
+ settingSources: ["user", "project", "local"],
585
585
  });
586
586
  });
587
587
 
@@ -856,7 +856,7 @@ describe("createClaudeAdapter — env 注入", () => {
856
856
  expect(opts.env.CLAUDE_CODE_EFFORT_LEVEL).toBeUndefined();
857
857
  });
858
858
 
859
- it("第三方 API 配置时仍然加载 CLAUDE.md(settingSources 始终为 project+local)", async () => {
859
+ it("第三方 API 配置时仍然加载 CLAUDE.md(settingSources 包含 user+project+local)", async () => {
860
860
  setupMockCreateSession();
861
861
  const adapter = createClaudeAdapter({
862
862
  model: "",
@@ -869,7 +869,7 @@ describe("createClaudeAdapter — env 注入", () => {
869
869
  await adapter.createSession("/cwd");
870
870
 
871
871
  const opts = sdk.unstable_v2_createSession.mock.calls[0][0];
872
- expect(opts.settingSources).toEqual(["project", "local"]);
872
+ expect(opts.settingSources).toEqual(["user", "project", "local"]);
873
873
  });
874
874
 
875
875
  it("不修改主进程 process.env(永不污染)", async () => {
@@ -117,10 +117,12 @@ function buildSdkEnv(
117
117
  function resolveSettingSources(
118
118
  _apiKey: string | undefined,
119
119
  _baseUrl: string | undefined,
120
- ): Array<"project" | "local"> {
120
+ ): Array<"user" | "project" | "local"> {
121
121
  // CLAUDE.md / CLAUDE.local.md 是 Agent 指令文件,与 API 来源无关,
122
122
  // 无论使用官方 Anthropic 还是第三方网关都应加载。
123
- return ["project", "local"];
123
+ // 包含 "user" 以使 ~/.claude/settings.json 中的配置(如 mcpServers)生效;
124
+ // buildSdkEnv() 会删除可能冲突的 env 变量,确保网关配置不被覆盖。
125
+ return ["user", "project", "local"];
124
126
  }
125
127
 
126
128
  // ---------------------------------------------------------------------------
@@ -153,7 +153,10 @@ function printScanMaterial(content: string): void {
153
153
  platformLog(content);
154
154
  platformLog("========== 终端二维码 ==========");
155
155
  terminalQr.generate(content, { small: true }, (renderedQr) => {
156
- platformLog(renderedQr);
156
+ // 逐行用裸 console.log 输出,避免 platformLog 前缀导致首行错位
157
+ for (const line of renderedQr.split("\n")) {
158
+ console.log(` ${line}`);
159
+ }
157
160
  });
158
161
  platformLog("========== 请使用微信扫描上方二维码登录 ==========\n");
159
162
  }