@deepseek-ai/dsh-session-log-deepseek 0.1.7-rc.2 → 0.2.0-rc.1
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 +4 -2
- package/README.zh.md +4 -2
- package/lib/index.js +3 -3
- package/lib/types/index.d.ts +11 -5
- package/lib/types/index.js +4 -4
- package/package.json +18 -18
package/README.i18n.yaml
CHANGED
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
en: e2aa29e41bc101c4
|
|
16
16
|
zh: 2ef629f2a444bc13
|
|
17
17
|
/deepseek-ai-dsh-session-log-deepseek/configuration:
|
|
18
|
-
en:
|
|
19
|
-
zh:
|
|
18
|
+
en: 1b899e63d8039643
|
|
19
|
+
zh: d489461bbb618b5d
|
|
20
20
|
/deepseek-ai-dsh-session-log-deepseek/request-field:
|
|
21
21
|
en: 197814e2c48d05b5
|
|
22
22
|
zh: f4616fb23a3c7a32
|
package/README.md
CHANGED
|
@@ -27,10 +27,12 @@ Incremental canonical session-log upload for official DeepSeek LLM API requests.
|
|
|
27
27
|
|
|
28
28
|
| Key | Default | Meaning |
|
|
29
29
|
|---|---:|---|
|
|
30
|
-
| `enabled` | `true` |
|
|
30
|
+
| `enabled` | `true` | Send the `dsh_session_log` contribution. Changes apply to the next request; `false` stops Session-log upload. |
|
|
31
31
|
| `maxBytes` | 8 MiB | Largest serialized `dsh_session_log` field, in UTF-8 bytes, that one request carries. |
|
|
32
32
|
|
|
33
|
-
Shipped profiles mount the plugin, so the default configuration registers the request field and appends the acceptance watermark;
|
|
33
|
+
Shipped profiles mount the plugin, so the default configuration registers the request field and appends the acceptance watermark; `enabled: false` stops the contribution. The Web switch can override bundle defaults through the active profile; home patches and command-line overlays retain precedence and reject conflicting form writes.
|
|
34
|
+
|
|
35
|
+
The Web **Settings → General → Upload Session Log when using the official model API** switch persists `enabled` through the Host configuration. In-flight requests keep their prepared payload. Re-enabling resumes the unaccepted suffix, including events recorded while disabled. OpenTelemetry feedback uploads have a separate setting.
|
|
34
36
|
|
|
35
37
|
<a id="request-field"></a>
|
|
36
38
|
## Request field
|
package/README.zh.md
CHANGED
|
@@ -27,10 +27,12 @@ kind: "package-reference"
|
|
|
27
27
|
|
|
28
28
|
| 配置键 | 默认值 | 含义 |
|
|
29
29
|
|---|---:|---|
|
|
30
|
-
| `enabled` | `true` |
|
|
30
|
+
| `enabled` | `true` | 发送 `dsh_session_log` 贡献。修改从下一次请求生效;设为 `false` 可停止会话日志上传。 |
|
|
31
31
|
| `maxBytes` | 8 MiB | 单次请求携带的 `dsh_session_log` 字段序列化后的最大 UTF-8 字节数。 |
|
|
32
32
|
|
|
33
|
-
随附 profile
|
|
33
|
+
随附 profile 会挂载该插件,因此默认配置会注册请求字段并追加接受水位;`enabled: false` 会停止贡献。Web 开关可通过当前 profile 覆盖组合包默认值;home patch 和命令行 overlay 保持更高优先级,会拒绝与其冲突的表单写入。
|
|
34
|
+
|
|
35
|
+
Web **设置 → 通用 → 在使用官方模型 API 时上传 Session Log** 开关通过 Host 配置持久化 `enabled`。进行中的请求保留已准备的载荷。重新开启后继续上传尚未确认的后缀,包括关闭期间记录的事件。OpenTelemetry 反馈上传使用独立设置。
|
|
34
36
|
|
|
35
37
|
<a id="request-field"></a>
|
|
36
38
|
## 请求字段
|
package/lib/index.js
CHANGED
|
@@ -15,7 +15,7 @@ const name = "session-log-deepseek";
|
|
|
15
15
|
const inject = ["deepseekLlmApiExtensions", "sessions"];
|
|
16
16
|
/** Validated Session-log request contribution configuration. */
|
|
17
17
|
const Config = z.object({
|
|
18
|
-
enabled: z.boolean().default(true),
|
|
18
|
+
enabled: z.boolean().default(true).volatile(),
|
|
19
19
|
maxBytes: z.number().step(1).min(1).default(8 * 1024 * 1024)
|
|
20
20
|
});
|
|
21
21
|
const acceptanceFolds = /* @__PURE__ */ new WeakMap();
|
|
@@ -128,14 +128,14 @@ function acceptedThrough(session) {
|
|
|
128
128
|
return throughSeq;
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
131
|
-
* Register the incremental
|
|
131
|
+
* Register the incremental request contribution; enablement is read for each request.
|
|
132
132
|
* @param ctx - plugin context carrying Sessions and the DeepSeek request-extension registry.
|
|
133
133
|
* @param config - validated configuration.
|
|
134
134
|
*/
|
|
135
135
|
function apply(ctx, config) {
|
|
136
|
-
if (config.enabled !== true) return;
|
|
137
136
|
const { maxBytes } = config;
|
|
138
137
|
ctx.deepseekLlmApiExtensions.register("dsh_session_log", { prepare: (request) => {
|
|
138
|
+
if (!config.enabled.get()) return void 0;
|
|
139
139
|
if (request.sessionId === void 0) return void 0;
|
|
140
140
|
const session = ctx.sessions.get(brandString(request.sessionId));
|
|
141
141
|
if (session === void 0) return void 0;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* can conservatively resend uncertain tails without maintaining another store.
|
|
5
5
|
* @module @deepseek-ai/dsh-session-log-deepseek
|
|
6
6
|
*/
|
|
7
|
-
import type { Context } from '@deepseek-ai/cordis';
|
|
7
|
+
import type { Context, Volatile } from '@deepseek-ai/cordis';
|
|
8
8
|
import z from '@deepseek-ai/schemastery';
|
|
9
9
|
import type { Session, SessionSeqCursor } from '@deepseek-ai/dsh-session';
|
|
10
10
|
export type * from './types.ts';
|
|
@@ -15,16 +15,22 @@ export declare const inject: string[];
|
|
|
15
15
|
/** Session-log request contribution configuration. */
|
|
16
16
|
export interface Config {
|
|
17
17
|
/** Contribute `dsh_session_log` to official DeepSeek requests. Defaults to `true`. */
|
|
18
|
-
enabled
|
|
18
|
+
enabled: Volatile<boolean>;
|
|
19
19
|
/**
|
|
20
20
|
* Largest serialized `dsh_session_log` field, in UTF-8 bytes, that one request carries.
|
|
21
21
|
* A request uploads the longest pending event prefix that fits; later requests continue
|
|
22
22
|
* after its acceptance. Defaults to 8 MiB.
|
|
23
23
|
*/
|
|
24
|
-
maxBytes
|
|
24
|
+
maxBytes: number;
|
|
25
25
|
}
|
|
26
26
|
/** Validated Session-log request contribution configuration. */
|
|
27
|
-
export declare const Config: z<
|
|
27
|
+
export declare const Config: z<Schemastery.ObjectS<NoInfer<{
|
|
28
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
29
|
+
maxBytes: z<number, number, "defined">;
|
|
30
|
+
}>>, Schemastery.ObjectT<NoInfer<{
|
|
31
|
+
enabled: z<boolean, boolean, "volatile-defined">;
|
|
32
|
+
maxBytes: z<number, number, "defined">;
|
|
33
|
+
}>>, "plain">;
|
|
28
34
|
/**
|
|
29
35
|
* Highest confirmed sequence for this exact Session format generation.
|
|
30
36
|
* @param session - canonical log whose matching acceptance events are folded.
|
|
@@ -32,7 +38,7 @@ export declare const Config: z<Config>;
|
|
|
32
38
|
*/
|
|
33
39
|
export declare function acceptedThrough(session: Session): SessionSeqCursor;
|
|
34
40
|
/**
|
|
35
|
-
* Register the incremental
|
|
41
|
+
* Register the incremental request contribution; enablement is read for each request.
|
|
36
42
|
* @param ctx - plugin context carrying Sessions and the DeepSeek request-extension registry.
|
|
37
43
|
* @param config - validated configuration.
|
|
38
44
|
*/
|
package/lib/types/index.js
CHANGED
|
@@ -14,7 +14,7 @@ export const name = 'session-log-deepseek';
|
|
|
14
14
|
export const inject = ['deepseekLlmApiExtensions', 'sessions'];
|
|
15
15
|
/** Validated Session-log request contribution configuration. */
|
|
16
16
|
export const Config = z.object({
|
|
17
|
-
enabled: z.boolean().default(true),
|
|
17
|
+
enabled: z.boolean().default(true).volatile(),
|
|
18
18
|
maxBytes: z.number().step(1).min(1).default(8 * 1024 * 1024),
|
|
19
19
|
});
|
|
20
20
|
const acceptanceFolds = new WeakMap();
|
|
@@ -134,17 +134,17 @@ export function acceptedThrough(session) {
|
|
|
134
134
|
return throughSeq;
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
|
-
* Register the incremental
|
|
137
|
+
* Register the incremental request contribution; enablement is read for each request.
|
|
138
138
|
* @param ctx - plugin context carrying Sessions and the DeepSeek request-extension registry.
|
|
139
139
|
* @param config - validated configuration.
|
|
140
140
|
*/
|
|
141
141
|
export function apply(ctx, config) {
|
|
142
|
-
if (config.enabled !== true)
|
|
143
|
-
return;
|
|
144
142
|
// Schemastery validates and fills the defaults before `apply` runs.
|
|
145
143
|
const { maxBytes } = config;
|
|
146
144
|
ctx.deepseekLlmApiExtensions.register('dsh_session_log', {
|
|
147
145
|
prepare: (request) => {
|
|
146
|
+
if (!config.enabled.get())
|
|
147
|
+
return undefined;
|
|
148
148
|
// TODO: Define an explicit wire result for direct or stale-session calls if they become a supported product path.
|
|
149
149
|
if (request.sessionId === undefined)
|
|
150
150
|
return undefined;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-session-log-deepseek",
|
|
3
3
|
"description": "Incremental lossless session-log request extension for the official DeepSeek LLM API",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0-rc.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -37,29 +37,29 @@
|
|
|
37
37
|
],
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@deepseek-ai/dsh-brand": "0.
|
|
41
|
-
"@deepseek-ai/dsh-util-values": "0.
|
|
40
|
+
"@deepseek-ai/dsh-brand": "0.2.0-rc.1",
|
|
41
|
+
"@deepseek-ai/dsh-util-values": "0.2.0-rc.1",
|
|
42
42
|
"@deepseek-ai/schemastery": "~3.18.4"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
|
-
"@deepseek-ai/
|
|
46
|
-
"@deepseek-ai/dsh-
|
|
47
|
-
"@deepseek-ai/dsh-
|
|
48
|
-
"@deepseek-ai/
|
|
45
|
+
"@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.2.0-rc.1",
|
|
46
|
+
"@deepseek-ai/dsh-invariants": "0.2.0-rc.1",
|
|
47
|
+
"@deepseek-ai/dsh-session": "0.2.0-rc.1",
|
|
48
|
+
"@deepseek-ai/cordis": "~4.0.4"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@deepseek-ai/cordis": "~4.0.4",
|
|
52
51
|
"@deepseek-ai/cordis-plugin-include": "~1.0.9",
|
|
53
52
|
"@deepseek-ai/cordis-plugin-loader": "~1.0.5",
|
|
54
|
-
"@deepseek-ai/dsh-command-feedback": "0.
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/dsh-llm": "0.
|
|
58
|
-
"@deepseek-ai/dsh-llm-deepseek": "0.
|
|
59
|
-
"@deepseek-ai/dsh-llm-
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-
|
|
62
|
-
"@deepseek-ai/dsh-session": "0.
|
|
63
|
-
"@deepseek-ai/dsh-
|
|
53
|
+
"@deepseek-ai/dsh-command-feedback": "0.2.0-rc.1",
|
|
54
|
+
"@deepseek-ai/dsh-invariants": "0.2.0-rc.1",
|
|
55
|
+
"@deepseek-ai/dsh-llm": "0.2.0-rc.1",
|
|
56
|
+
"@deepseek-ai/dsh-deepseek-llm-api-extensions": "0.2.0-rc.1",
|
|
57
|
+
"@deepseek-ai/dsh-llm-deepseek-api-key": "0.2.0-rc.1",
|
|
58
|
+
"@deepseek-ai/dsh-llm-mock-server": "0.2.0-rc.1",
|
|
59
|
+
"@deepseek-ai/dsh-llm-deepseek": "0.2.0-rc.1",
|
|
60
|
+
"@deepseek-ai/dsh-message-feedback": "0.2.0-rc.1",
|
|
61
|
+
"@deepseek-ai/dsh-session": "0.2.0-rc.1",
|
|
62
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "0.2.0-rc.1",
|
|
63
|
+
"@deepseek-ai/cordis": "~4.0.4"
|
|
64
64
|
}
|
|
65
65
|
}
|