@deepseek-ai/dsh-session-title 0.1.5-rc.2 → 0.1.6-alpha.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 +1 -1
- package/README.zh.md +4 -4
- package/lib/types/index.d.ts +4 -4
- package/lib/types/index.js +2 -0
- package/lib/types/invariant.js +2 -0
- package/lib/types/types.d.ts +2 -2
- package/package.json +17 -17
package/README.i18n.yaml
CHANGED
|
@@ -3,4 +3,4 @@
|
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/session/session-title/README.md
|
|
5
5
|
README.md: 09778e4e2b1cf1e6e6e4dc20dbe9237a4a0cc51f
|
|
6
|
-
README.zh.md:
|
|
6
|
+
README.zh.md: db9efaa2ab0a226fb318b9b564d72f6f7e56be12
|
package/README.zh.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "
|
|
2
|
+
description: "面向用户与维护者的日志支持型会话标题说明,用于选择标题来源、配置服务或排查标题状态。"
|
|
3
3
|
kind: "package-reference"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ kind: "package-reference"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
使用 `dsh-session-title` 为每个会话提供客户端可见标题,标题可以来自第一条符合条件的用户消息、可选异步生成器或显式用户重命名。已接受的标题在回放、恢复与分页后仍然存在,但绝不会进入模型输入。自动生成绝不会延迟主 agent
|
|
12
|
+
使用 `dsh-session-title` 为每个会话提供客户端可见标题,标题可以来自第一条符合条件的用户消息、可选异步生成器或显式用户重命名。已接受的标题在回放、恢复与分页后仍然存在,但绝不会进入模型输入。自动生成绝不会延迟主 agent(智能体)响应,较新的标题请求会取代旧工作。当客户端需要带可配置长度上限的持久标题,以及通过 `refresh()` 主动重新生成标题的路径时,请选择本包。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -54,7 +54,7 @@ kind: "package-reference"
|
|
|
54
54
|
|
|
55
55
|
### 添加提供方
|
|
56
56
|
|
|
57
|
-
可选异步提供方可通过 `ctx.sessionTitle.register(provider)` 注册一个;第二次注册会立即抛出。随附的模型支持提供方是[首消息](../session-title-first-prompt-llm/README.zh.md)与[全消息](../session-title-all-prompts-llm/README.zh.md),两者都使用共享的 [LLM
|
|
57
|
+
可选异步提供方可通过 `ctx.sessionTitle.register(provider)` 注册一个;第二次注册会立即抛出。随附的模型支持提供方是[首消息](../session-title-first-prompt-llm/README.zh.md)与[全消息](../session-title-all-prompts-llm/README.zh.md),两者都使用共享的 [LLM(大语言模型)生成策略](../session-title-llm/README.zh.md)。提供方只有在带标记、由循环构建的请求的确切路由与已记录 `request/header` 匹配时才启动,较新的修订会取代并中止旧工作。
|
|
58
58
|
|
|
59
59
|
### 读取标题
|
|
60
60
|
|
|
@@ -84,7 +84,7 @@ kind: "package-reference"
|
|
|
84
84
|
|---|---|
|
|
85
85
|
| [`src/index.ts`](src/index.ts) | 服务:配置、折叠、回退调度、提供方注册表、并发、`title` 投影单元 |
|
|
86
86
|
| [`src/normalize.ts`](src/normalize.ts) | 标题文本清洗、UTF-8 安全截断与确定性回退 |
|
|
87
|
-
| [`src/types.ts`](src/types.ts) | `title`
|
|
87
|
+
| [`src/types.ts`](src/types.ts) | `title` 投影键声明的归属位置 |
|
|
88
88
|
|
|
89
89
|
### 生命周期与并发
|
|
90
90
|
|
package/lib/types/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@ import { z as zod } from 'zod';
|
|
|
8
8
|
import type { Branded } from '@deepseek-ai/dsh-brand';
|
|
9
9
|
import type { Session, SessionEvent } from '@deepseek-ai/dsh-session';
|
|
10
10
|
import { SessionSeq } from '@deepseek-ai/dsh-session';
|
|
11
|
-
export type { SessionTitleEventData,
|
|
12
|
-
import type { SessionTitleEventData,
|
|
11
|
+
export type { SessionTitleEventData, SessionTitleModelIdentity, SessionTitleSnapshot, SessionTitleSource, SessionTitleUserMessage, TitleProjection, } from './types.ts';
|
|
12
|
+
import type { SessionTitleEventData, SessionTitleModelIdentity, SessionTitleSnapshot, SessionTitleUserMessage } from './types.ts';
|
|
13
13
|
/** Identifies one session-title provider registration. */
|
|
14
14
|
export type SessionTitleProviderId = Branded<'SessionTitleProviderId'>;
|
|
15
15
|
/**
|
|
@@ -60,7 +60,7 @@ export interface SessionTitleProviderRequest {
|
|
|
60
60
|
/** All eligible human messages through this generation revision. */
|
|
61
61
|
readonly messages: readonly SessionTitleUserMessage[];
|
|
62
62
|
/** Exact current logged main-request route, when one has been recorded. */
|
|
63
|
-
readonly route?:
|
|
63
|
+
readonly route?: SessionTitleModelIdentity;
|
|
64
64
|
/** Cancellation for supersession, disposal, timeout composition, or the explicit caller. */
|
|
65
65
|
readonly signal: AbortSignal;
|
|
66
66
|
}
|
|
@@ -71,7 +71,7 @@ export interface SessionTitleProviderResult {
|
|
|
71
71
|
/** Exact seqs from `request.messages` used by this result. */
|
|
72
72
|
readonly messageSeqs: readonly SessionSeq[];
|
|
73
73
|
/** Auxiliary LLM route, when generation used a model. */
|
|
74
|
-
readonly model?:
|
|
74
|
+
readonly model?: SessionTitleModelIdentity;
|
|
75
75
|
}
|
|
76
76
|
/** One optional asynchronous title implementation registered with the service. */
|
|
77
77
|
export interface SessionTitleProvider {
|
package/lib/types/index.js
CHANGED
|
@@ -236,6 +236,7 @@ export class SessionTitleService extends Service {
|
|
|
236
236
|
* @returns latest title snapshot, or `undefined` before eligible input.
|
|
237
237
|
*/
|
|
238
238
|
get(session) {
|
|
239
|
+
// oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
|
|
239
240
|
return foldSessionTitle(session.snapshotEvents());
|
|
240
241
|
}
|
|
241
242
|
/**
|
|
@@ -440,6 +441,7 @@ export class SessionTitleService extends Service {
|
|
|
440
441
|
this.assertCurrent(session, work);
|
|
441
442
|
await this.ensureFallback(session);
|
|
442
443
|
this.assertCurrent(session, work);
|
|
444
|
+
// oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
|
|
443
445
|
const messages = collectSessionTitleMessages(session.snapshotEvents(), work.throughSeq);
|
|
444
446
|
const result = await work.registration.provider.generate({
|
|
445
447
|
session,
|
package/lib/types/invariant.js
CHANGED
|
@@ -35,6 +35,7 @@ function validate(session, event, fail) {
|
|
|
35
35
|
fail(`session/title event ${String(event.seq)} repeats message seq ${checked}`);
|
|
36
36
|
}
|
|
37
37
|
seen.add(checked);
|
|
38
|
+
// oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
|
|
38
39
|
const cited = checked < event.seq ? session.eventAt(checked) : undefined;
|
|
39
40
|
if (cited?.type !== 'user/message' || cited.data.source.kind !== 'user') {
|
|
40
41
|
fail(`session/title event ${String(event.seq)} message seq ${checked} must name an earlier human user/message`);
|
|
@@ -43,6 +44,7 @@ function validate(session, event, fail) {
|
|
|
43
44
|
}
|
|
44
45
|
const install = Object.assign((ctx, fail) => {
|
|
45
46
|
const validateExisting = (session) => {
|
|
47
|
+
// oxlint-disable-next-line typescript/no-deprecated -- Existing Session history read; migration deferred.
|
|
46
48
|
for (const event of session.snapshotEvents()) {
|
|
47
49
|
if (event.type === 'session/title')
|
|
48
50
|
validate(session, event, fail);
|
package/lib/types/types.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ import type { OptionalSessionSeq, SessionSeq } from '@deepseek-ai/dsh-session/ty
|
|
|
13
13
|
/** Identifies one session-title provider registration. */
|
|
14
14
|
export type SessionTitleProviderId = Branded<'SessionTitleProviderId'>;
|
|
15
15
|
/** Exact auxiliary model route that produced a title. */
|
|
16
|
-
export interface
|
|
16
|
+
export interface SessionTitleModelIdentity {
|
|
17
17
|
/** Registered LLM provider route. */
|
|
18
18
|
readonly provider: string;
|
|
19
19
|
/** Provider model id. */
|
|
@@ -25,7 +25,7 @@ export type SessionTitleSource = {
|
|
|
25
25
|
} | {
|
|
26
26
|
readonly kind: 'provider';
|
|
27
27
|
readonly provider: SessionTitleProviderId;
|
|
28
|
-
readonly model?:
|
|
28
|
+
readonly model?: SessionTitleModelIdentity;
|
|
29
29
|
} | {
|
|
30
30
|
/** Explicit user rename: pins the title — automatic generation stops scheduling. */
|
|
31
31
|
readonly kind: 'user';
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-session-title",
|
|
3
3
|
"description": "Log-backed session title service and provider registry for the DeepSeek Harness",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -42,27 +42,27 @@
|
|
|
42
42
|
"license": "MIT",
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
45
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
46
|
-
"@deepseek-ai/dsh-brand": "^0.1.
|
|
47
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
48
|
-
"@deepseek-ai/dsh-llm": "^0.1.
|
|
49
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
50
|
-
"@deepseek-ai/dsh-session-projection": "^0.1.
|
|
45
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
|
|
46
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
|
|
47
|
+
"@deepseek-ai/dsh-invariants": "^0.1.6-alpha.2",
|
|
48
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.2",
|
|
49
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
|
|
50
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
53
|
"zod": "^4.4.3",
|
|
54
|
-
"@deepseek-ai/
|
|
55
|
-
"@deepseek-ai/
|
|
54
|
+
"@deepseek-ai/dsh-util-values": "^0.1.6-alpha.2",
|
|
55
|
+
"@deepseek-ai/schemastery": "^3.18.2"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
59
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
60
|
-
"@deepseek-ai/dsh-agent-loop": "^0.1.
|
|
61
|
-
"@deepseek-ai/dsh-brand": "^0.1.
|
|
62
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
63
|
-
"@deepseek-ai/dsh-
|
|
64
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
65
|
-
"@deepseek-ai/dsh-session-
|
|
66
|
-
"@deepseek-ai/dsh-
|
|
59
|
+
"@deepseek-ai/dsh-agent": "^0.1.6-alpha.2",
|
|
60
|
+
"@deepseek-ai/dsh-agent-loop": "^0.1.6-alpha.2",
|
|
61
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
|
|
62
|
+
"@deepseek-ai/dsh-invariants": "^0.1.6-alpha.2",
|
|
63
|
+
"@deepseek-ai/dsh-session": "^0.1.6-alpha.2",
|
|
64
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "^0.1.6-alpha.2",
|
|
65
|
+
"@deepseek-ai/dsh-session-projection": "^0.1.6-alpha.2",
|
|
66
|
+
"@deepseek-ai/dsh-llm": "^0.1.6-alpha.2"
|
|
67
67
|
}
|
|
68
68
|
}
|