@aipanel/provider-deepseek 1.2.21 → 1.2.23
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/es/api.d.ts +2 -4
- package/es/api.js +6 -3
- package/es/index.d.ts +6 -3
- package/es/index.js +5 -1
- package/es/provider.js +2 -2
- package/es/types.d.ts +8 -105
- package/es/types.js +0 -19
- package/lib/api.cjs +6 -3
- package/lib/api.d.ts +2 -4
- package/lib/index.d.ts +6 -3
- package/lib/provider.cjs +2 -2
- package/lib/types.cjs +0 -27
- package/lib/types.d.ts +8 -105
- package/package.json +9 -3
package/es/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SessionSummary } from "
|
|
1
|
+
import type { SessionCreateValue, SessionSummary } from "@deepseek-ai/dsh-api-session-controller/types";
|
|
2
2
|
/**
|
|
3
3
|
* dsh 会话 API 客户端。
|
|
4
4
|
* dsh 使用自定义四象限 RPC envelope({type:'client-request',rpcId,method,payload} →
|
|
@@ -63,9 +63,7 @@ export declare class DeepSeekAPI {
|
|
|
63
63
|
/** 在当前目录下创建会话(dsh 仅返回 { sessionId, agentPreset? },非完整 SessionSummary)。
|
|
64
64
|
* 与旧逻辑一致:先确保 projectDir 对应的 workspace 存在(workspace/create 幂等 get-or-create),
|
|
65
65
|
* 再用 workspaceId 调 session/create,让新会话挂到该 workspace。 */
|
|
66
|
-
createSession(projectDir: string, retries?: number): Promise<
|
|
67
|
-
sessionId: string;
|
|
68
|
-
}>;
|
|
66
|
+
createSession(projectDir: string, retries?: number): Promise<SessionCreateValue>;
|
|
69
67
|
/** 归档会话(dsh 无硬删除,仅归档;幂等) */
|
|
70
68
|
archiveSession(sessionId: string, retries?: number): Promise<void>;
|
|
71
69
|
/**
|
package/es/api.js
CHANGED
|
@@ -143,6 +143,8 @@ const _DeepSeekAPI = class _DeepSeekAPI {
|
|
|
143
143
|
await this.ensureAuthenticated();
|
|
144
144
|
const message = {
|
|
145
145
|
type: "client-request",
|
|
146
|
+
// 官方 RpcId 仅为编译期 brand(运行期即普通字符串),此处按 wire 边界断言,
|
|
147
|
+
// 避免为一个 brand 把 dsh-client-connection 变成 provider 的运行时依赖。
|
|
146
148
|
rpcId: randomUUID(),
|
|
147
149
|
method,
|
|
148
150
|
payload: { args }
|
|
@@ -301,10 +303,11 @@ const _DeepSeekAPI = class _DeepSeekAPI {
|
|
|
301
303
|
try {
|
|
302
304
|
const msg = JSON.parse(String(ev.data));
|
|
303
305
|
if (!msg || msg.streamId !== streamId) return;
|
|
304
|
-
if (msg.type === "item" && msg.value?.type === "baseline"
|
|
306
|
+
if (msg.type === "item" && msg.value?.type === "baseline") {
|
|
307
|
+
const baseline = msg.value.value;
|
|
305
308
|
finish(void 0, {
|
|
306
|
-
items:
|
|
307
|
-
archivedSessionIds:
|
|
309
|
+
items: baseline.items ?? [],
|
|
310
|
+
archivedSessionIds: baseline.archivedSessionIds ?? []
|
|
308
311
|
});
|
|
309
312
|
} else if (msg.type === "error") {
|
|
310
313
|
finish(new Error(`dsh workspace/follow failed: ${msg.error?.message ?? "unknown"}`));
|
package/es/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DeepSeek Harness Web Provider
|
|
3
3
|
* 实现 WebProvider 契约:进程管理、RPC 会话 API、dsh 侧插件编排、CLI 环境检查。
|
|
4
|
-
*
|
|
4
|
+
* dsh 专属常量自持,类型一律引用官方声明。
|
|
5
5
|
*/
|
|
6
6
|
import type { ProviderInitContext, WebProvider } from "@aipanel/core";
|
|
7
7
|
/** 约定工厂:核心层动态加载本包后调用,初始化动作完全由 Provider 定义 */
|
|
@@ -11,5 +11,8 @@ export type { DeepSeekWebProviderConfig, DeepSeekWebProviderDeps } from "./provi
|
|
|
11
11
|
export { startDeepSeekWeb, type DeepSeekWebOptions } from "./deepseek-web";
|
|
12
12
|
export { buildDshOverlay, writeDshOverlay } from "./profile";
|
|
13
13
|
export { checkDeepSeekInstalled, getDeepSeekVersion, killOrphanDeepSeekProcesses } from "./system";
|
|
14
|
-
export { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_LOOPBACK_HOST, DSH_DEFAULT_PORT } from "./constants";
|
|
15
|
-
export type { DeepSeekProviderOptions, DeepSeekPermissionPreset, DeepSeekBusyEnter
|
|
14
|
+
export { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_LOOPBACK_HOST, DSH_DEFAULT_PORT, } from "./constants";
|
|
15
|
+
export type { DeepSeekProviderOptions, DeepSeekPermissionPreset, DeepSeekBusyEnter } from "./types";
|
|
16
|
+
export type { ClientRequest, RpcMessage, ServerResponse } from "@deepseek-ai/dsh-client-connection";
|
|
17
|
+
export type { SessionCreateValue, SessionListValue, SessionSummary, } from "@deepseek-ai/dsh-api-session-controller/types";
|
|
18
|
+
export type { WorkspaceBaseline, WorkspaceCreateValue, WorkspaceView, } from "@deepseek-ai/dsh-api-workspace-controller/types";
|
package/es/index.js
CHANGED
|
@@ -11,7 +11,11 @@ import { DeepSeekAPI } from "./api.js";
|
|
|
11
11
|
import { startDeepSeekWeb } from "./deepseek-web.js";
|
|
12
12
|
import { buildDshOverlay, writeDshOverlay } from "./profile.js";
|
|
13
13
|
import { checkDeepSeekInstalled, getDeepSeekVersion, killOrphanDeepSeekProcesses } from "./system.js";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
DEFAULT_DEEPSEEK_PROVIDER_OPTIONS,
|
|
16
|
+
DSH_LOOPBACK_HOST as DSH_LOOPBACK_HOST2,
|
|
17
|
+
DSH_DEFAULT_PORT
|
|
18
|
+
} from "./constants.js";
|
|
15
19
|
export {
|
|
16
20
|
DEFAULT_DEEPSEEK_PROVIDER_OPTIONS,
|
|
17
21
|
DSH_DEFAULT_PORT,
|
package/es/provider.js
CHANGED
|
@@ -214,10 +214,10 @@ Please upgrade:
|
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
function toChatSession(s, url) {
|
|
217
|
+
const title = s.projections?.values?.title;
|
|
217
218
|
return {
|
|
218
219
|
id: s.sessionId,
|
|
219
|
-
|
|
220
|
-
title: s.projections?.values?.title ?? "",
|
|
220
|
+
title: typeof title === "string" ? title : "",
|
|
221
221
|
updatedAt: s.updatedAt,
|
|
222
222
|
parentId: s.parentSessionId,
|
|
223
223
|
url
|
package/es/types.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DeepSeek Harness Provider 专属类型
|
|
3
|
-
*
|
|
3
|
+
* dsh 契约(RPC envelope / 会话与工作区 wire / 事件词表 / 取值域)一律引用官方声明,
|
|
4
|
+
* 不在此复刻;这里只保留本包自有的配置类型,核心层不感知。
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
export type
|
|
6
|
+
import type { BusyEnterBehavior } from "@deepseek-ai/dsh-client-ui-conversation";
|
|
7
|
+
import type { SandboxMode } from "@deepseek-ai/dsh-sandbox";
|
|
8
|
+
/** 权限预设(对应 dsh settings permission.defaultPreset;取值域同官方 SandboxMode) */
|
|
9
|
+
export type DeepSeekPermissionPreset = SandboxMode;
|
|
10
|
+
/** 繁忙时 Enter 键行为(对应 dsh settings ui-conversation.busyEnter;取值同官方 BusyEnterBehavior) */
|
|
11
|
+
export type DeepSeekBusyEnter = BusyEnterBehavior;
|
|
9
12
|
/**
|
|
10
13
|
* DeepSeek Provider 专属配置(对应插件配置的 providerOptions 段)
|
|
11
14
|
* 保留字符串索引签名,以赋给 PluginOptions 的 Record<string, unknown> 泛型约束。
|
|
@@ -37,103 +40,3 @@ export type DeepSeekProviderOptions = {
|
|
|
37
40
|
*/
|
|
38
41
|
[key: string]: unknown;
|
|
39
42
|
};
|
|
40
|
-
/**
|
|
41
|
-
* dsh API 四象限 RPC envelope(客户端请求 / 服务端响应)。
|
|
42
|
-
* 字段为 type/rpcId/method/payload + result:{ok,value|error},不是标准 JSON-RPC。
|
|
43
|
-
*/
|
|
44
|
-
/** 客户端 → 服务端 请求体(POST /api/<method>) */
|
|
45
|
-
export interface ClientRequest {
|
|
46
|
-
type: "client-request";
|
|
47
|
-
rpcId: string;
|
|
48
|
-
method: string;
|
|
49
|
-
payload: Record<string, unknown>;
|
|
50
|
-
}
|
|
51
|
-
/** 服务端 → 客户端 响应体 */
|
|
52
|
-
export interface ServerResponse {
|
|
53
|
-
type: "server-response";
|
|
54
|
-
rpcId: string;
|
|
55
|
-
result: {
|
|
56
|
-
ok: true;
|
|
57
|
-
value: unknown;
|
|
58
|
-
} | {
|
|
59
|
-
ok: false;
|
|
60
|
-
error: {
|
|
61
|
-
code?: string;
|
|
62
|
-
message?: string;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/** 服务端推送帧(SSE data 载荷) */
|
|
67
|
-
export interface ServerRequest {
|
|
68
|
-
type: "server-request";
|
|
69
|
-
rpcId: string;
|
|
70
|
-
method: string;
|
|
71
|
-
payload: Record<string, unknown>;
|
|
72
|
-
}
|
|
73
|
-
/** 会话摘要(POST /api/session.list 的 items 项) */
|
|
74
|
-
export interface SessionSummary {
|
|
75
|
-
sessionId: string;
|
|
76
|
-
updatedAt: number;
|
|
77
|
-
running: boolean;
|
|
78
|
-
blank: boolean;
|
|
79
|
-
parentSessionId?: string;
|
|
80
|
-
origin?: "subagent";
|
|
81
|
-
cwd?: string;
|
|
82
|
-
agentPreset?: string;
|
|
83
|
-
/** 会话投影(标题等派生值存在 projections.values.title) */
|
|
84
|
-
projections?: {
|
|
85
|
-
values?: {
|
|
86
|
-
title?: string | null;
|
|
87
|
-
[key: string]: unknown;
|
|
88
|
-
};
|
|
89
|
-
[key: string]: unknown;
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
/** session.list 的 value:容器对象(不是数组),会话在 items 下 */
|
|
93
|
-
export interface SessionListResult {
|
|
94
|
-
items: SessionSummary[];
|
|
95
|
-
}
|
|
96
|
-
/** 工作区视图(POST /api/workspace.list 的 items 项,用于按目录匹配会话) */
|
|
97
|
-
export interface WorkspaceView {
|
|
98
|
-
workspaceId: string;
|
|
99
|
-
path: string;
|
|
100
|
-
title: string;
|
|
101
|
-
sessionIds: string[];
|
|
102
|
-
createdAt: string;
|
|
103
|
-
updatedAt: string;
|
|
104
|
-
}
|
|
105
|
-
/** workspace.list 的 value:容器对象(不是数组),工作区在 items 下,archivedSessionIds 为已归档会话 */
|
|
106
|
-
export interface WorkspaceListResult {
|
|
107
|
-
items: WorkspaceView[];
|
|
108
|
-
archivedSessionIds: string[];
|
|
109
|
-
}
|
|
110
|
-
/** workspace.create 的 value(幂等:已存在则返回既有 workspace,created=false) */
|
|
111
|
-
export interface WorkspaceCreateResult {
|
|
112
|
-
workspace: WorkspaceView;
|
|
113
|
-
created: boolean;
|
|
114
|
-
}
|
|
115
|
-
/** 会话流式事件(session/event 的 event 字段) */
|
|
116
|
-
export interface SessionStreamEvent {
|
|
117
|
-
type: string;
|
|
118
|
-
seq: number;
|
|
119
|
-
time?: number;
|
|
120
|
-
data?: Record<string, unknown>;
|
|
121
|
-
}
|
|
122
|
-
/** dsh 会话日志事件类型(用于 thinking/status 推导的稳定子集) */
|
|
123
|
-
export declare const SESSION_EVENT_TYPES: {
|
|
124
|
-
/** 回合开始 → 视为 streaming */
|
|
125
|
-
readonly TURN_START: "turn/start";
|
|
126
|
-
/** 回合结束(稳定停等) */
|
|
127
|
-
readonly TURN_END: "turn/end";
|
|
128
|
-
/** 步骤开始 */
|
|
129
|
-
readonly STEP_START: "step/start";
|
|
130
|
-
/** 步骤结束 */
|
|
131
|
-
readonly STEP_END: "step/end";
|
|
132
|
-
/** 助手输出完成 */
|
|
133
|
-
readonly ASSISTANT_MESSAGE: "assistant/message";
|
|
134
|
-
/** 助手输出增量分片 */
|
|
135
|
-
readonly ASSISTANT_CHUNK: "assistant/chunk";
|
|
136
|
-
/** 思考增量分片 */
|
|
137
|
-
readonly THINKING_DELTA: "thinking/delta";
|
|
138
|
-
};
|
|
139
|
-
export type SessionEventType = (typeof SESSION_EVENT_TYPES)[keyof typeof SESSION_EVENT_TYPES];
|
package/es/types.js
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const SESSION_EVENT_TYPES = {
|
|
2
|
-
/** 回合开始 → 视为 streaming */
|
|
3
|
-
TURN_START: "turn/start",
|
|
4
|
-
/** 回合结束(稳定停等) */
|
|
5
|
-
TURN_END: "turn/end",
|
|
6
|
-
/** 步骤开始 */
|
|
7
|
-
STEP_START: "step/start",
|
|
8
|
-
/** 步骤结束 */
|
|
9
|
-
STEP_END: "step/end",
|
|
10
|
-
/** 助手输出完成 */
|
|
11
|
-
ASSISTANT_MESSAGE: "assistant/message",
|
|
12
|
-
/** 助手输出增量分片 */
|
|
13
|
-
ASSISTANT_CHUNK: "assistant/chunk",
|
|
14
|
-
/** 思考增量分片 */
|
|
15
|
-
THINKING_DELTA: "thinking/delta"
|
|
16
|
-
};
|
|
17
|
-
export {
|
|
18
|
-
SESSION_EVENT_TYPES
|
|
19
|
-
};
|
package/lib/api.cjs
CHANGED
|
@@ -174,6 +174,8 @@ const _DeepSeekAPI = class _DeepSeekAPI {
|
|
|
174
174
|
await this.ensureAuthenticated();
|
|
175
175
|
const message = {
|
|
176
176
|
type: "client-request",
|
|
177
|
+
// 官方 RpcId 仅为编译期 brand(运行期即普通字符串),此处按 wire 边界断言,
|
|
178
|
+
// 避免为一个 brand 把 dsh-client-connection 变成 provider 的运行时依赖。
|
|
177
179
|
rpcId: (0, import_node_crypto.randomUUID)(),
|
|
178
180
|
method,
|
|
179
181
|
payload: { args }
|
|
@@ -332,10 +334,11 @@ const _DeepSeekAPI = class _DeepSeekAPI {
|
|
|
332
334
|
try {
|
|
333
335
|
const msg = JSON.parse(String(ev.data));
|
|
334
336
|
if (!msg || msg.streamId !== streamId) return;
|
|
335
|
-
if (msg.type === "item" && msg.value?.type === "baseline"
|
|
337
|
+
if (msg.type === "item" && msg.value?.type === "baseline") {
|
|
338
|
+
const baseline = msg.value.value;
|
|
336
339
|
finish(void 0, {
|
|
337
|
-
items:
|
|
338
|
-
archivedSessionIds:
|
|
340
|
+
items: baseline.items ?? [],
|
|
341
|
+
archivedSessionIds: baseline.archivedSessionIds ?? []
|
|
339
342
|
});
|
|
340
343
|
} else if (msg.type === "error") {
|
|
341
344
|
finish(new Error(`dsh workspace/follow failed: ${msg.error?.message ?? "unknown"}`));
|
package/lib/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SessionSummary } from "
|
|
1
|
+
import type { SessionCreateValue, SessionSummary } from "@deepseek-ai/dsh-api-session-controller/types";
|
|
2
2
|
/**
|
|
3
3
|
* dsh 会话 API 客户端。
|
|
4
4
|
* dsh 使用自定义四象限 RPC envelope({type:'client-request',rpcId,method,payload} →
|
|
@@ -63,9 +63,7 @@ export declare class DeepSeekAPI {
|
|
|
63
63
|
/** 在当前目录下创建会话(dsh 仅返回 { sessionId, agentPreset? },非完整 SessionSummary)。
|
|
64
64
|
* 与旧逻辑一致:先确保 projectDir 对应的 workspace 存在(workspace/create 幂等 get-or-create),
|
|
65
65
|
* 再用 workspaceId 调 session/create,让新会话挂到该 workspace。 */
|
|
66
|
-
createSession(projectDir: string, retries?: number): Promise<
|
|
67
|
-
sessionId: string;
|
|
68
|
-
}>;
|
|
66
|
+
createSession(projectDir: string, retries?: number): Promise<SessionCreateValue>;
|
|
69
67
|
/** 归档会话(dsh 无硬删除,仅归档;幂等) */
|
|
70
68
|
archiveSession(sessionId: string, retries?: number): Promise<void>;
|
|
71
69
|
/**
|
package/lib/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DeepSeek Harness Web Provider
|
|
3
3
|
* 实现 WebProvider 契约:进程管理、RPC 会话 API、dsh 侧插件编排、CLI 环境检查。
|
|
4
|
-
*
|
|
4
|
+
* dsh 专属常量自持,类型一律引用官方声明。
|
|
5
5
|
*/
|
|
6
6
|
import type { ProviderInitContext, WebProvider } from "@aipanel/core";
|
|
7
7
|
/** 约定工厂:核心层动态加载本包后调用,初始化动作完全由 Provider 定义 */
|
|
@@ -11,5 +11,8 @@ export type { DeepSeekWebProviderConfig, DeepSeekWebProviderDeps } from "./provi
|
|
|
11
11
|
export { startDeepSeekWeb, type DeepSeekWebOptions } from "./deepseek-web";
|
|
12
12
|
export { buildDshOverlay, writeDshOverlay } from "./profile";
|
|
13
13
|
export { checkDeepSeekInstalled, getDeepSeekVersion, killOrphanDeepSeekProcesses } from "./system";
|
|
14
|
-
export { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_LOOPBACK_HOST, DSH_DEFAULT_PORT } from "./constants";
|
|
15
|
-
export type { DeepSeekProviderOptions, DeepSeekPermissionPreset, DeepSeekBusyEnter
|
|
14
|
+
export { DEFAULT_DEEPSEEK_PROVIDER_OPTIONS, DSH_LOOPBACK_HOST, DSH_DEFAULT_PORT, } from "./constants";
|
|
15
|
+
export type { DeepSeekProviderOptions, DeepSeekPermissionPreset, DeepSeekBusyEnter } from "./types";
|
|
16
|
+
export type { ClientRequest, RpcMessage, ServerResponse } from "@deepseek-ai/dsh-client-connection";
|
|
17
|
+
export type { SessionCreateValue, SessionListValue, SessionSummary, } from "@deepseek-ai/dsh-api-session-controller/types";
|
|
18
|
+
export type { WorkspaceBaseline, WorkspaceCreateValue, WorkspaceView, } from "@deepseek-ai/dsh-api-workspace-controller/types";
|
package/lib/provider.cjs
CHANGED
|
@@ -223,10 +223,10 @@ Please upgrade:
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
function toChatSession(s, url) {
|
|
226
|
+
const title = s.projections?.values?.title;
|
|
226
227
|
return {
|
|
227
228
|
id: s.sessionId,
|
|
228
|
-
|
|
229
|
-
title: s.projections?.values?.title ?? "",
|
|
229
|
+
title: typeof title === "string" ? title : "",
|
|
230
230
|
updatedAt: s.updatedAt,
|
|
231
231
|
parentId: s.parentSessionId,
|
|
232
232
|
url
|
package/lib/types.cjs
CHANGED
|
@@ -2,10 +2,6 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
-
};
|
|
9
5
|
var __copyProps = (to, from, except, desc) => {
|
|
10
6
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
7
|
for (let key of __getOwnPropNames(from))
|
|
@@ -16,27 +12,4 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
12
|
};
|
|
17
13
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
14
|
var types_exports = {};
|
|
19
|
-
__export(types_exports, {
|
|
20
|
-
SESSION_EVENT_TYPES: () => SESSION_EVENT_TYPES
|
|
21
|
-
});
|
|
22
15
|
module.exports = __toCommonJS(types_exports);
|
|
23
|
-
const SESSION_EVENT_TYPES = {
|
|
24
|
-
/** 回合开始 → 视为 streaming */
|
|
25
|
-
TURN_START: "turn/start",
|
|
26
|
-
/** 回合结束(稳定停等) */
|
|
27
|
-
TURN_END: "turn/end",
|
|
28
|
-
/** 步骤开始 */
|
|
29
|
-
STEP_START: "step/start",
|
|
30
|
-
/** 步骤结束 */
|
|
31
|
-
STEP_END: "step/end",
|
|
32
|
-
/** 助手输出完成 */
|
|
33
|
-
ASSISTANT_MESSAGE: "assistant/message",
|
|
34
|
-
/** 助手输出增量分片 */
|
|
35
|
-
ASSISTANT_CHUNK: "assistant/chunk",
|
|
36
|
-
/** 思考增量分片 */
|
|
37
|
-
THINKING_DELTA: "thinking/delta"
|
|
38
|
-
};
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
SESSION_EVENT_TYPES
|
|
42
|
-
});
|
package/lib/types.d.ts
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* DeepSeek Harness Provider 专属类型
|
|
3
|
-
*
|
|
3
|
+
* dsh 契约(RPC envelope / 会话与工作区 wire / 事件词表 / 取值域)一律引用官方声明,
|
|
4
|
+
* 不在此复刻;这里只保留本包自有的配置类型,核心层不感知。
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
export type
|
|
6
|
+
import type { BusyEnterBehavior } from "@deepseek-ai/dsh-client-ui-conversation";
|
|
7
|
+
import type { SandboxMode } from "@deepseek-ai/dsh-sandbox";
|
|
8
|
+
/** 权限预设(对应 dsh settings permission.defaultPreset;取值域同官方 SandboxMode) */
|
|
9
|
+
export type DeepSeekPermissionPreset = SandboxMode;
|
|
10
|
+
/** 繁忙时 Enter 键行为(对应 dsh settings ui-conversation.busyEnter;取值同官方 BusyEnterBehavior) */
|
|
11
|
+
export type DeepSeekBusyEnter = BusyEnterBehavior;
|
|
9
12
|
/**
|
|
10
13
|
* DeepSeek Provider 专属配置(对应插件配置的 providerOptions 段)
|
|
11
14
|
* 保留字符串索引签名,以赋给 PluginOptions 的 Record<string, unknown> 泛型约束。
|
|
@@ -37,103 +40,3 @@ export type DeepSeekProviderOptions = {
|
|
|
37
40
|
*/
|
|
38
41
|
[key: string]: unknown;
|
|
39
42
|
};
|
|
40
|
-
/**
|
|
41
|
-
* dsh API 四象限 RPC envelope(客户端请求 / 服务端响应)。
|
|
42
|
-
* 字段为 type/rpcId/method/payload + result:{ok,value|error},不是标准 JSON-RPC。
|
|
43
|
-
*/
|
|
44
|
-
/** 客户端 → 服务端 请求体(POST /api/<method>) */
|
|
45
|
-
export interface ClientRequest {
|
|
46
|
-
type: "client-request";
|
|
47
|
-
rpcId: string;
|
|
48
|
-
method: string;
|
|
49
|
-
payload: Record<string, unknown>;
|
|
50
|
-
}
|
|
51
|
-
/** 服务端 → 客户端 响应体 */
|
|
52
|
-
export interface ServerResponse {
|
|
53
|
-
type: "server-response";
|
|
54
|
-
rpcId: string;
|
|
55
|
-
result: {
|
|
56
|
-
ok: true;
|
|
57
|
-
value: unknown;
|
|
58
|
-
} | {
|
|
59
|
-
ok: false;
|
|
60
|
-
error: {
|
|
61
|
-
code?: string;
|
|
62
|
-
message?: string;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/** 服务端推送帧(SSE data 载荷) */
|
|
67
|
-
export interface ServerRequest {
|
|
68
|
-
type: "server-request";
|
|
69
|
-
rpcId: string;
|
|
70
|
-
method: string;
|
|
71
|
-
payload: Record<string, unknown>;
|
|
72
|
-
}
|
|
73
|
-
/** 会话摘要(POST /api/session.list 的 items 项) */
|
|
74
|
-
export interface SessionSummary {
|
|
75
|
-
sessionId: string;
|
|
76
|
-
updatedAt: number;
|
|
77
|
-
running: boolean;
|
|
78
|
-
blank: boolean;
|
|
79
|
-
parentSessionId?: string;
|
|
80
|
-
origin?: "subagent";
|
|
81
|
-
cwd?: string;
|
|
82
|
-
agentPreset?: string;
|
|
83
|
-
/** 会话投影(标题等派生值存在 projections.values.title) */
|
|
84
|
-
projections?: {
|
|
85
|
-
values?: {
|
|
86
|
-
title?: string | null;
|
|
87
|
-
[key: string]: unknown;
|
|
88
|
-
};
|
|
89
|
-
[key: string]: unknown;
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
/** session.list 的 value:容器对象(不是数组),会话在 items 下 */
|
|
93
|
-
export interface SessionListResult {
|
|
94
|
-
items: SessionSummary[];
|
|
95
|
-
}
|
|
96
|
-
/** 工作区视图(POST /api/workspace.list 的 items 项,用于按目录匹配会话) */
|
|
97
|
-
export interface WorkspaceView {
|
|
98
|
-
workspaceId: string;
|
|
99
|
-
path: string;
|
|
100
|
-
title: string;
|
|
101
|
-
sessionIds: string[];
|
|
102
|
-
createdAt: string;
|
|
103
|
-
updatedAt: string;
|
|
104
|
-
}
|
|
105
|
-
/** workspace.list 的 value:容器对象(不是数组),工作区在 items 下,archivedSessionIds 为已归档会话 */
|
|
106
|
-
export interface WorkspaceListResult {
|
|
107
|
-
items: WorkspaceView[];
|
|
108
|
-
archivedSessionIds: string[];
|
|
109
|
-
}
|
|
110
|
-
/** workspace.create 的 value(幂等:已存在则返回既有 workspace,created=false) */
|
|
111
|
-
export interface WorkspaceCreateResult {
|
|
112
|
-
workspace: WorkspaceView;
|
|
113
|
-
created: boolean;
|
|
114
|
-
}
|
|
115
|
-
/** 会话流式事件(session/event 的 event 字段) */
|
|
116
|
-
export interface SessionStreamEvent {
|
|
117
|
-
type: string;
|
|
118
|
-
seq: number;
|
|
119
|
-
time?: number;
|
|
120
|
-
data?: Record<string, unknown>;
|
|
121
|
-
}
|
|
122
|
-
/** dsh 会话日志事件类型(用于 thinking/status 推导的稳定子集) */
|
|
123
|
-
export declare const SESSION_EVENT_TYPES: {
|
|
124
|
-
/** 回合开始 → 视为 streaming */
|
|
125
|
-
readonly TURN_START: "turn/start";
|
|
126
|
-
/** 回合结束(稳定停等) */
|
|
127
|
-
readonly TURN_END: "turn/end";
|
|
128
|
-
/** 步骤开始 */
|
|
129
|
-
readonly STEP_START: "step/start";
|
|
130
|
-
/** 步骤结束 */
|
|
131
|
-
readonly STEP_END: "step/end";
|
|
132
|
-
/** 助手输出完成 */
|
|
133
|
-
readonly ASSISTANT_MESSAGE: "assistant/message";
|
|
134
|
-
/** 助手输出增量分片 */
|
|
135
|
-
readonly ASSISTANT_CHUNK: "assistant/chunk";
|
|
136
|
-
/** 思考增量分片 */
|
|
137
|
-
readonly THINKING_DELTA: "thinking/delta";
|
|
138
|
-
};
|
|
139
|
-
export type SessionEventType = (typeof SESSION_EVENT_TYPES)[keyof typeof SESSION_EVENT_TYPES];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aipanel/provider-deepseek",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.23",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "lib/index.cjs",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -21,10 +21,16 @@
|
|
|
21
21
|
"registry": "https://registry.npmjs.org/"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"
|
|
25
|
-
"
|
|
24
|
+
"@aipanel/core": "1.2.23",
|
|
25
|
+
"execa": "^9.6.1"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.1.6-alpha.2",
|
|
29
|
+
"@deepseek-ai/dsh-api-workspace-controller": "^0.1.6-alpha.2",
|
|
30
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
|
|
31
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.6-alpha.2",
|
|
32
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.6-alpha.2",
|
|
33
|
+
"@deepseek-ai/dsh-sandbox": "^0.1.6-alpha.2",
|
|
28
34
|
"esbuild": "^0.25.0"
|
|
29
35
|
},
|
|
30
36
|
"scripts": {
|