@deepseek-ai/dsh-client-connection 0.1.1-rc.1 → 0.1.1-rc.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.i18n.yaml +2 -2
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/client.js +2 -3
- package/lib/index.js +4 -4
- package/lib/types/http-bridge.d.ts +2 -2
- package/lib/types/index.d.ts +1 -1
- package/package.json +17 -17
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/client/connection/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 71ef204a589bb67c15ccab58d3cac5a13782ce27
|
|
6
|
+
README.zh.md: 6d33ac3c13cdfceeba6e7472b618084267d09bbc
|
package/README.md
CHANGED
|
@@ -23,4 +23,4 @@ None; this package neither assembles nor sends a provider request.
|
|
|
23
23
|
## Known Limitations and Deferred Work
|
|
24
24
|
|
|
25
25
|
- **History resumes an unattached session** — opening history may create the host-side agent and add latency to the first open; there is no persistence-only read path.
|
|
26
|
-
- **The `/api` bridge buffers each request body in memory** — `maxRequestBodyBytes` (default
|
|
26
|
+
- **The `/api` bridge buffers each request body in memory** — `maxRequestBodyBytes` (default 300 MiB, sized for the default 200 MiB aggregate image limit after base64 expansion plus envelope headroom) is therefore also the per-request resident bound; a streaming body path would be needed to lower it without shrinking the image limits.
|
package/README.zh.md
CHANGED
|
@@ -23,4 +23,4 @@ node 半侧在桥接或 upgrade 前守卫 `/api` 下的每个入口(`src/api-r
|
|
|
23
23
|
## 已知限制与暂缓事项
|
|
24
24
|
|
|
25
25
|
- **History 会恢复未附加的会话**:打开 history 可能创建宿主侧 agent,并增加首次打开的延迟;没有仅从持久化读取的路径。
|
|
26
|
-
- **`/api` 桥把每个请求体整体缓冲在内存里**:`maxRequestBodyBytes`(默认
|
|
26
|
+
- **`/api` 桥把每个请求体整体缓冲在内存里**:`maxRequestBodyBytes`(默认 300 MiB,按默认 200 MiB 图片总量上限经 base64 膨胀加信封余量得出)因此同时是单请求的驻留内存上界;要降低它而不缩小图片限额,需要流式请求体路径。
|
package/lib/client.js
CHANGED
|
@@ -5263,9 +5263,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5263
5263
|
workspaceId: workspaceIdSchema.optional(),
|
|
5264
5264
|
cwd: string().optional(),
|
|
5265
5265
|
sessionId: sessionIdSchema.optional(),
|
|
5266
|
-
agentPreset: string().optional()
|
|
5267
|
-
|
|
5268
|
-
}).refine((payload) => payload.workspaceId === void 0 || payload.cwd === void 0, { message: "session.create accepts workspaceId or cwd, not both" }).refine((payload) => payload.reuseWorkspaceBlank !== true || payload.workspaceId !== void 0 && payload.sessionId !== void 0, { message: "session.create reuseWorkspaceBlank requires workspaceId and sessionId" });
|
|
5266
|
+
agentPreset: string().optional()
|
|
5267
|
+
}).refine((payload) => payload.workspaceId === void 0 || payload.cwd === void 0, { message: "session.create accepts workspaceId or cwd, not both" });
|
|
5269
5268
|
/** session.create response value. */
|
|
5270
5269
|
const sessionCreateValueSchema = object({
|
|
5271
5270
|
sessionId: sessionIdSchema,
|
package/lib/index.js
CHANGED
|
@@ -23,10 +23,10 @@ const HOST_EVENTS_PATH = `${API_PATH}/events.host`;
|
|
|
23
23
|
* web carrier; the fetch-shaped handler itself is transport-agnostic).
|
|
24
24
|
*/
|
|
25
25
|
/** Default carrier cap for all HTTP RPC bodies: sized for the default
|
|
26
|
-
* aggregate image limit (
|
|
27
|
-
* headroom (~
|
|
26
|
+
* aggregate image limit (200 MiB) after base64 expansion plus envelope
|
|
27
|
+
* headroom (~267.7 MiB required), rounded up for slack. The bridge buffers
|
|
28
28
|
* each body in memory, so this cap is also the per-request resident bound. */
|
|
29
|
-
const DEFAULT_MAX_REQUEST_BODY_BYTES =
|
|
29
|
+
const DEFAULT_MAX_REQUEST_BODY_BYTES = 300 * 1024 * 1024;
|
|
30
30
|
/**
|
|
31
31
|
* Bridge one node:http request to the fetch-shaped handler (client close
|
|
32
32
|
* aborts; SSE bodies stream out chunk by chunk).
|
|
@@ -529,7 +529,7 @@ const PRIVILEGED_METHODS = new Set([
|
|
|
529
529
|
*/
|
|
530
530
|
function apply(ctx, config) {
|
|
531
531
|
const trustedHosts = config?.trustedHosts ?? [];
|
|
532
|
-
const maxRequestBodyBytes = config?.maxRequestBodyBytes ??
|
|
532
|
+
const maxRequestBodyBytes = config?.maxRequestBodyBytes ?? 314572800;
|
|
533
533
|
for (const entry of trustedHosts) assertTrustedAuthority(entry);
|
|
534
534
|
if (ctx.get("apiProxy") !== void 0) assertImageBodyCapacity(ctx, maxRequestBodyBytes);
|
|
535
535
|
const fetchHandler = new HostConnectionService(ctx, trustedHosts).createSharedFetchHandler(API_PATH, { async fetch(request) {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
6
6
|
/** Default carrier cap for all HTTP RPC bodies: sized for the default
|
|
7
|
-
* aggregate image limit (
|
|
8
|
-
* headroom (~
|
|
7
|
+
* aggregate image limit (200 MiB) after base64 expansion plus envelope
|
|
8
|
+
* headroom (~267.7 MiB required), rounded up for slack. The bridge buffers
|
|
9
9
|
* each body in memory, so this cap is also the per-request resident bound. */
|
|
10
10
|
export declare const DEFAULT_MAX_REQUEST_BODY_BYTES: number;
|
|
11
11
|
/** Transport-independent request handler consumed by the Host HTTP bridge. */
|
package/lib/types/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export interface ConnectionConfig {
|
|
|
19
19
|
* that is not a bare, canonical authority fails the plugin load.
|
|
20
20
|
*/
|
|
21
21
|
trustedHosts?: string[];
|
|
22
|
-
/** Maximum buffered JSON body for every `/api` request. */
|
|
22
|
+
/** Maximum buffered JSON body for every `/api` request. Default: 300 MiB. */
|
|
23
23
|
maxRequestBodyBytes?: number;
|
|
24
24
|
}
|
|
25
25
|
export declare const Config: z<ConnectionConfig>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-connection",
|
|
3
3
|
"description": "Wire consumer layer: HTTP-up/WebSocket-down client, ConnectionController dual streams with reconnect, and fixture api",
|
|
4
|
-
"version": "0.1.1-rc.
|
|
4
|
+
"version": "0.1.1-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -48,26 +48,26 @@
|
|
|
48
48
|
"lib/types/**/*.d.ts"
|
|
49
49
|
],
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@deepseek-ai/dsh-host-webserver": "^0.1.1-rc.
|
|
52
|
-
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.
|
|
51
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.1-rc.2",
|
|
52
|
+
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|
|
53
53
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-tools": "^0.1.1-rc.
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
54
|
+
"@deepseek-ai/dsh-host-apiproxy": "^0.1.1-rc.2",
|
|
55
|
+
"@deepseek-ai/dsh-commands": "^0.1.1-rc.2",
|
|
56
|
+
"@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
|
|
57
|
+
"@deepseek-ai/dsh-session": "^0.1.1-rc.2",
|
|
58
|
+
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
|
|
59
|
+
"@deepseek-ai/dsh-attachment": "^0.1.1-rc.2"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@types/ws": "^8.18.1",
|
|
63
|
-
"@deepseek-ai/dsh-
|
|
64
|
-
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.1",
|
|
63
|
+
"@deepseek-ai/dsh-invariants": "^0.1.1-rc.2",
|
|
65
64
|
"@deepseek-ai/cordis": "^4.0.1",
|
|
66
|
-
"@deepseek-ai/dsh-
|
|
67
|
-
"@deepseek-ai/dsh-
|
|
68
|
-
"@deepseek-ai/dsh-llm": "^0.1.1-rc.
|
|
69
|
-
"@deepseek-ai/dsh-
|
|
70
|
-
"@deepseek-ai/dsh-
|
|
71
|
-
"@deepseek-ai/dsh-
|
|
65
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.1-rc.2",
|
|
66
|
+
"@deepseek-ai/dsh-attachment": "^0.1.1-rc.2",
|
|
67
|
+
"@deepseek-ai/dsh-llm": "^0.1.1-rc.2",
|
|
68
|
+
"@deepseek-ai/dsh-commands": "^0.1.1-rc.2",
|
|
69
|
+
"@deepseek-ai/dsh-session": "^0.1.1-rc.2",
|
|
70
|
+
"@deepseek-ai/dsh-tools": "^0.1.1-rc.2",
|
|
71
|
+
"@deepseek-ai/dsh-host-apiproxy": "^0.1.1-rc.2"
|
|
72
72
|
}
|
|
73
73
|
}
|