chatccc 0.2.250 → 0.2.252
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/deepccc-agent/os-prompts/darwin.md +8 -8
- package/deepccc-agent/os-prompts/linux.md +8 -8
- package/deepccc-agent/os-prompts/win32.md +11 -11
- package/deepccc-agent/package-lock.json +2027 -2027
- package/deepccc-agent/package.json +65 -65
- package/deepccc-agent/src/__tests__/chat-session.test.ts +877 -852
- package/deepccc-agent/src/__tests__/context.test.ts +341 -341
- package/deepccc-agent/src/__tests__/skills.test.ts +284 -284
- package/deepccc-agent/src/context.ts +465 -465
- package/deepccc-agent/src/file-tools.ts +38 -38
- package/deepccc-agent/src/index.ts +72 -37
- package/deepccc-agent/src/skills.ts +205 -205
- package/package.json +74 -74
- package/src/__tests__/builtin-chat-session.test.ts +532 -532
- package/src/__tests__/builtin-context.test.ts +319 -319
- package/src/__tests__/builtin-skills.test.ts +284 -284
- package/src/__tests__/config-utils.test.ts +40 -40
- package/src/__tests__/session-ccc-config.test.ts +66 -66
- package/src/__tests__/web-ui.test.ts +438 -438
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
|
|
3
|
-
const createCccAdapterMock = vi.hoisted(() => vi.fn(() => ({
|
|
4
|
-
displayName: "CCC Agent",
|
|
5
|
-
sessionDescPrefix: "CCC Session:",
|
|
6
|
-
createSession: vi.fn(),
|
|
7
|
-
prompt: vi.fn(),
|
|
8
|
-
getSessionInfo: vi.fn(),
|
|
9
|
-
closeSession: vi.fn(),
|
|
10
|
-
})));
|
|
11
|
-
|
|
12
|
-
vi.mock("../adapters/ccc-adapter.ts", () => ({
|
|
13
|
-
createCccAdapter: createCccAdapterMock,
|
|
14
|
-
}));
|
|
15
|
-
|
|
16
|
-
import { config } from "../config.ts";
|
|
17
|
-
import { _clearAdapterCacheForTest, getAdapterForTool } from "../session.ts";
|
|
18
|
-
|
|
19
|
-
describe("CCC Agent ChatCCC configuration", () => {
|
|
20
|
-
const original = { ...config.ccc };
|
|
21
|
-
|
|
22
|
-
afterEach(() => {
|
|
23
|
-
Object.assign(config.ccc, original);
|
|
24
|
-
_clearAdapterCacheForTest();
|
|
25
|
-
createCccAdapterMock.mockClear();
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
it("injects ChatCCC credentials and endpoint instead of relying on ~/.deepccc", () => {
|
|
29
|
-
Object.assign(config.ccc, {
|
|
30
|
-
DEEPSEEK_API_KEY: "chatccc-api-key",
|
|
31
|
-
DEEPSEEK_BASE_URL: "https://chatccc.example.com/v1",
|
|
32
|
-
model: "chatccc-model",
|
|
33
|
-
effort: "high",
|
|
34
|
-
provider: "",
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
getAdapterForTool("ccc");
|
|
38
|
-
|
|
39
|
-
// provider 留空时不传 → ChatSession 跟随 DeepCCC 内核配置(~/.deepccc/config.json 或 DEEPCCC_PROVIDER)
|
|
40
|
-
expect(createCccAdapterMock).toHaveBeenCalledWith({
|
|
41
|
-
apiKey: "chatccc-api-key",
|
|
42
|
-
baseURL: "https://chatccc.example.com/v1",
|
|
43
|
-
model: "chatccc-model",
|
|
44
|
-
effort: "high",
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it("forwards ccc.provider override to createCccAdapter", () => {
|
|
49
|
-
Object.assign(config.ccc, {
|
|
50
|
-
DEEPSEEK_API_KEY: "chatccc-api-key",
|
|
51
|
-
DEEPSEEK_BASE_URL: "https://chatccc.example.com/v1",
|
|
52
|
-
model: "chatccc-model",
|
|
53
|
-
effort: "",
|
|
54
|
-
provider: "anthropic",
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
getAdapterForTool("ccc");
|
|
58
|
-
|
|
59
|
-
expect(createCccAdapterMock).toHaveBeenCalledWith({
|
|
60
|
-
apiKey: "chatccc-api-key",
|
|
61
|
-
baseURL: "https://chatccc.example.com/v1",
|
|
62
|
-
model: "chatccc-model",
|
|
63
|
-
provider: "anthropic",
|
|
64
|
-
});
|
|
65
|
-
});
|
|
66
|
-
});
|
|
1
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
|
|
3
|
+
const createCccAdapterMock = vi.hoisted(() => vi.fn(() => ({
|
|
4
|
+
displayName: "CCC Agent",
|
|
5
|
+
sessionDescPrefix: "CCC Session:",
|
|
6
|
+
createSession: vi.fn(),
|
|
7
|
+
prompt: vi.fn(),
|
|
8
|
+
getSessionInfo: vi.fn(),
|
|
9
|
+
closeSession: vi.fn(),
|
|
10
|
+
})));
|
|
11
|
+
|
|
12
|
+
vi.mock("../adapters/ccc-adapter.ts", () => ({
|
|
13
|
+
createCccAdapter: createCccAdapterMock,
|
|
14
|
+
}));
|
|
15
|
+
|
|
16
|
+
import { config } from "../config.ts";
|
|
17
|
+
import { _clearAdapterCacheForTest, getAdapterForTool } from "../session.ts";
|
|
18
|
+
|
|
19
|
+
describe("CCC Agent ChatCCC configuration", () => {
|
|
20
|
+
const original = { ...config.ccc };
|
|
21
|
+
|
|
22
|
+
afterEach(() => {
|
|
23
|
+
Object.assign(config.ccc, original);
|
|
24
|
+
_clearAdapterCacheForTest();
|
|
25
|
+
createCccAdapterMock.mockClear();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("injects ChatCCC credentials and endpoint instead of relying on ~/.deepccc", () => {
|
|
29
|
+
Object.assign(config.ccc, {
|
|
30
|
+
DEEPSEEK_API_KEY: "chatccc-api-key",
|
|
31
|
+
DEEPSEEK_BASE_URL: "https://chatccc.example.com/v1",
|
|
32
|
+
model: "chatccc-model",
|
|
33
|
+
effort: "high",
|
|
34
|
+
provider: "",
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
getAdapterForTool("ccc");
|
|
38
|
+
|
|
39
|
+
// provider 留空时不传 → ChatSession 跟随 DeepCCC 内核配置(~/.deepccc/config.json 或 DEEPCCC_PROVIDER)
|
|
40
|
+
expect(createCccAdapterMock).toHaveBeenCalledWith({
|
|
41
|
+
apiKey: "chatccc-api-key",
|
|
42
|
+
baseURL: "https://chatccc.example.com/v1",
|
|
43
|
+
model: "chatccc-model",
|
|
44
|
+
effort: "high",
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("forwards ccc.provider override to createCccAdapter", () => {
|
|
49
|
+
Object.assign(config.ccc, {
|
|
50
|
+
DEEPSEEK_API_KEY: "chatccc-api-key",
|
|
51
|
+
DEEPSEEK_BASE_URL: "https://chatccc.example.com/v1",
|
|
52
|
+
model: "chatccc-model",
|
|
53
|
+
effort: "",
|
|
54
|
+
provider: "anthropic",
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
getAdapterForTool("ccc");
|
|
58
|
+
|
|
59
|
+
expect(createCccAdapterMock).toHaveBeenCalledWith({
|
|
60
|
+
apiKey: "chatccc-api-key",
|
|
61
|
+
baseURL: "https://chatccc.example.com/v1",
|
|
62
|
+
model: "chatccc-model",
|
|
63
|
+
provider: "anthropic",
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
});
|