@chatcode/cco-llm-chatcode-config 0.1.0 → 0.1.2
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/README.md +5 -5
- package/README.zh.md +6 -6
- package/lib/client.js +41 -19
- package/lib/index.js +8 -5
- package/lib/index.js.map +1 -1
- package/package.json +8 -9
- package/vendor/dsh-llm-pi-ai/src/config.ts +1 -1
- package/vendor/dsh-llm-pi-ai/tests/adapter.spec.ts +10 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chatcode/cco-llm-chatcode-config",
|
|
3
3
|
"description": "ChatCode CLI plugin for ChatCode models, shared account access, and operations reporting",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://gitee.com/shiguifeng/dsh-llm-chatcode-config.git"
|
|
@@ -46,13 +46,6 @@
|
|
|
46
46
|
"platform": "web"
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
|
-
"scripts": {
|
|
50
|
-
"build": "tsdown",
|
|
51
|
-
"typecheck": "tsc --noEmit",
|
|
52
|
-
"test": "vitest run",
|
|
53
|
-
"prepack": "pnpm run build",
|
|
54
|
-
"verify:brand": "node scripts/verify-brand.mjs"
|
|
55
|
-
},
|
|
56
49
|
"peerDependencies": {
|
|
57
50
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
58
51
|
"@deepseek-ai/dsh-anonymous-user-id": ">=0.1.6-alpha.1 <0.2.0",
|
|
@@ -117,5 +110,11 @@
|
|
|
117
110
|
"tsdown": "^0.22.2",
|
|
118
111
|
"typescript": "^5.9.0",
|
|
119
112
|
"vitest": "^4.0.0"
|
|
113
|
+
},
|
|
114
|
+
"scripts": {
|
|
115
|
+
"build": "tsdown",
|
|
116
|
+
"typecheck": "tsc --noEmit",
|
|
117
|
+
"test": "vitest run",
|
|
118
|
+
"verify:brand": "node scripts/verify-brand.mjs"
|
|
120
119
|
}
|
|
121
|
-
}
|
|
120
|
+
}
|
|
@@ -40,7 +40,7 @@ import type {
|
|
|
40
40
|
import { buildProvider, supportedProtocols } from './provider.ts'
|
|
41
41
|
|
|
42
42
|
/** Default maximum idle interval while an adapter stream read is outstanding. */
|
|
43
|
-
export const DEFAULT_STREAM_IDLE_TIMEOUT_MS =
|
|
43
|
+
export const DEFAULT_STREAM_IDLE_TIMEOUT_MS = 600_000
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Default request-level bound on base64-encoded image payload. Every image in
|
|
@@ -14,7 +14,11 @@ import * as LlmPiAi from '@deepseek-ai/dsh-llm-pi-ai'
|
|
|
14
14
|
import { PiAiAdapter } from '@deepseek-ai/dsh-llm-pi-ai'
|
|
15
15
|
import { MAX_TIMER_DELAY_MS } from '@deepseek-ai/dsh-timeout'
|
|
16
16
|
import { getBuiltinModels } from '@earendil-works/pi-ai/providers/all'
|
|
17
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
DEFAULT_MAX_REQUEST_IMAGE_BYTES,
|
|
19
|
+
DEFAULT_STREAM_IDLE_TIMEOUT_MS,
|
|
20
|
+
resolveProfiles,
|
|
21
|
+
} from '../src/config.ts'
|
|
18
22
|
import { memoryAuth } from './auth-double.ts'
|
|
19
23
|
import { assemble } from './assemble.ts'
|
|
20
24
|
import { closeMockServers, mockServer, textEvents } from './mock-server.ts'
|
|
@@ -817,6 +821,7 @@ describe('provider profile lifecycle', () => {
|
|
|
817
821
|
|
|
818
822
|
it('validates empty, underspecified, legacy-shaped, and explicitly blank profiles', () => {
|
|
819
823
|
expect(DEFAULT_MAX_REQUEST_IMAGE_BYTES).toBe(20 * 1024 * 1024)
|
|
824
|
+
expect(DEFAULT_STREAM_IDLE_TIMEOUT_MS).toBe(600_000)
|
|
820
825
|
// Empty and omitted dicts are the dormant zero-route posture, not errors.
|
|
821
826
|
expect(resolveProfiles({}).size).toBe(0)
|
|
822
827
|
expect(resolveProfiles(undefined).size).toBe(0)
|
|
@@ -835,6 +840,10 @@ describe('provider profile lifecycle', () => {
|
|
|
835
840
|
.toBe(DEFAULT_MAX_REQUEST_IMAGE_BYTES)
|
|
836
841
|
expect(resolveProfiles({ openai: { maxRequestImageBytes: 1024 } }).get('openai')?.maxRequestImageBytes)
|
|
837
842
|
.toBe(1024)
|
|
843
|
+
expect(resolveProfiles({ openai: {} }).get('openai')?.streamIdleTimeoutMs)
|
|
844
|
+
.toBe(DEFAULT_STREAM_IDLE_TIMEOUT_MS)
|
|
845
|
+
expect(resolveProfiles({ openai: { streamIdleTimeoutMs: 42_000 } }).get('openai')?.streamIdleTimeoutMs)
|
|
846
|
+
.toBe(42_000)
|
|
838
847
|
})
|
|
839
848
|
|
|
840
849
|
it.each(['maxRetries', 'maxRetryDelayMs'] as const)(
|