@deepseek-ai/dsh-session-title 0.0.1-rc.2 → 0.0.1-rc.3

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 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/session/session-title/README.md
5
- README.md: e7004eb2e03757cb28b4b5756a876e1dee4b6229
6
- README.zh.md: 45c1aafdf214f63ae7a071d2558eaefec13ea70f
5
+ README.md: e923bd9700180214f235c4971d4b020565bfee43
6
+ README.zh.md: 8e84ac27d9f1509c8530b838eeb5eb2216d87199
package/README.md CHANGED
@@ -15,7 +15,7 @@ Only text blocks from human `user/message` events are eligible. The first eligib
15
15
 
16
16
  Automatic work never delays the main agent response. A provider starts only after a marked loop-built request's exact route matches the current logged `request/header`, including when the unchanged header needs no new snapshot. Its late completion appends a standalone log-only event directly through `Session` without opening a turn. Persistence observes that event eagerly and drains on ordinary lifecycle checkpoints; title publication itself does not force a flush. Automatic failures warn and retain the latest title. New all-message revisions, provider disposal, session disposal, and explicit refresh abort older work, and a stale completion cannot append. Concurrent explicit refreshes reserve their revision before provider work, while overlapping automatic and explicit fallback requests share one session-local in-flight append. The service and bundled model provider each append their own literal event type, so no generic title-write marker, cast, or settlement queue is needed. Service teardown cancels queued work and drains calls that ignore cancellation before unloading completes.
17
17
 
18
- Forks inherit title events in their seed unchanged. The first-message cadence does not automatically retitle a child; the all-messages cadence may append a new revision after the child receives a later human prompt.
18
+ Forks inherit title events in their seed unchanged. The first-prompt cadence does not automatically retitle a child; the all-messages cadence may append a new revision after the child receives a later human prompt.
19
19
 
20
20
  ## Configuration
21
21
 
@@ -29,7 +29,7 @@ All limits are required; the library supplies no defaults.
29
29
 
30
30
  ## Provider contract
31
31
 
32
- A provider supplies a branded stable id, automatic mode (`first-message` or `all-user-messages`), and `generate(request)`. The request carries the live session, all eligible messages through one fixed revision, the current logged main-request route when available, and cancellation. The result identifies a non-empty title, unique ordered source-message seqs from that request, and the optional provider/model route used to generate it. The service normalizes and validates the result before it becomes durable.
32
+ A provider supplies a branded stable id, automatic mode (`first-prompt` or `all-prompts`), and `generate(request)`. The request carries the live session, all eligible messages through one fixed revision, the current logged main-request route when available, and cancellation. The result identifies a non-empty title, unique ordered source-message seqs from that request, and the optional provider/model route used to generate it. The service normalizes and validates the result before it becomes durable.
33
33
 
34
34
  See the [session-title data structures](../../../docs/subsystems/session-title.md) and [implemented decision](../../../.agents/notes/implemented/feature/2026-07-21-log-backed-session-titles.md).
35
35
 
package/README.zh.md CHANGED
@@ -10,12 +10,12 @@
10
10
 
11
11
  - `get(session)` 从活跃或回放日志折叠最新已接受标题。
12
12
  - `refresh(session, signal?)` 在需要时物化回退,然后显式运行已注册提供方,处理当前符合条件的消息。提供方错误或调用方取消都会导致返回的 Promise 被拒绝;取消不会回滚已接受的回退事件。
13
- - `rename(session, title)` 同步接受用户显式标题:规范化文本、取代在途自动工作,并追加一条 `user` 来源的 `session/title` 事件。最新标题来源为 user 即钉住该会话——后续用户消息不再安排自动 revision;显式 `refresh` 仍是有意的解钉手段。
13
+ - `rename(session, title)` 同步接受用户显式标题:规范化文本、取代在途自动工作,并追加一条 `user` 来源的 `session/title` 事件。用户来源的最新标题会钉住该会话——后续用户消息不再安排自动修订;显式 `refresh` 仍是有意的解钉手段。
14
14
  - `register(provider)` 安装唯一可选提供方,并返回可等待的 Cordis effect disposer。第二次注册会立即抛出;对提供方执行 dispose(资源释放)会中止待处理和活跃调用,等待其结算,之后才允许注册另一个提供方。
15
15
 
16
16
  自动工作绝不会延迟主 agent(智能体)响应。只有当带标记、由循环构建的请求,其确切路由与当前已记录的 `request/header` 匹配时,提供方才会启动;即使请求头未变而无需新快照,也适用此规则。延迟完成会直接通过 `Session` 追加一个独立的纯日志事件,而不打开轮次。持久化会立即观察到该事件,并在常规生命周期检查点完成刷写;标题发布本身不会强制刷写。自动失败会发出警告并保留最新标题。新的全消息修订、提供方 dispose、会话 dispose 和显式刷新都会中止旧工作,陈旧的完成结果无法追加。并发显式刷新会在提供方工作之前预留修订号;重叠的自动/显式回退请求共享一个会话本地正在进行的追加操作。服务与内置模型提供方各自追加自己的字面事件类型,因此不需要通用标题写入标记、类型断言或结算队列。服务拆卸会取消排队工作,并在卸载完成前等待不响应取消的调用结算完成。
17
17
 
18
- Fork 出的会话会原样继承种子中的标题事件。首消息节奏不会自动为子会话重新生成标题;全消息节奏可以在子会话收到后续用户提示词后追加新修订。
18
+ fork 出的会话会原样继承种子中的标题事件。首消息节奏不会自动为子会话重新生成标题;全消息节奏可以在子会话收到后续用户提示词后追加新修订。
19
19
 
20
20
  ## 配置
21
21
 
@@ -29,7 +29,7 @@ Fork 出的会话会原样继承种子中的标题事件。首消息节奏不会
29
29
 
30
30
  ## 提供方约定
31
31
 
32
- 提供方会提供带品牌类型的稳定 id、自动模式(`first-message` 或 `all-user-messages`)和 `generate(request)`。请求携带活跃会话、截至一次固定修订的所有符合条件消息、可用时当前已记录的主请求路由,以及取消信号。结果包含非空标题、该请求中唯一且有序的来源消息 seq,以及生成该标题时使用的可选提供方/模型路由。服务会在结果持久保存前进行规范化和验证。
32
+ 提供方会提供带品牌类型的稳定 id、自动模式(`first-prompt` 或 `all-prompts`)和 `generate(request)`。请求携带活跃会话、截至一次固定修订的所有符合条件消息、可用时当前已记录的主请求路由,以及取消信号。结果包含非空标题、该请求中互不重复且有序的来源消息 seq,以及生成该标题时使用的可选提供方/模型路由。服务会在结果持久保存前进行规范化和验证。
33
33
 
34
34
  参见[会话标题数据结构](../../../docs/subsystems/session-title.md)与[已实现决策](../../../.agents/notes/implemented/feature/2026-07-21-log-backed-session-titles.md)。
35
35
 
package/lib/index.js CHANGED
@@ -51,7 +51,7 @@ function normalizeSessionTitle(input, maxBytes) {
51
51
  return truncateTitleUtf8(cleanTitleText(input), maxBytes).trimEnd();
52
52
  }
53
53
  /**
54
- * Derive the deterministic first-message fallback.
54
+ * Derive the deterministic first-prompt fallback.
55
55
  * @param input - text from the first eligible human message.
56
56
  * @param maxWords - positive whitespace-delimited word cap.
57
57
  * @param maxBytes - positive UTF-8 byte cap.
@@ -320,7 +320,7 @@ var SessionTitleService = class extends Service {
320
320
  const registration = this.registration;
321
321
  if (registration !== void 0 && !registration.closing) {
322
322
  const messages = collectSessionTitleMessages(session.events, event.seq);
323
- if (registration.provider.automatic === "all-user-messages" || session.header.parentSession === void 0 && messages.length === 1 && this.get(session) === void 0) {
323
+ if (registration.provider.automatic === "all-prompts" || session.header.parentSession === void 0 && messages.length === 1 && this.get(session) === void 0) {
324
324
  const state = this.stateFor(session);
325
325
  state.pending = {
326
326
  registration,
@@ -526,7 +526,7 @@ var SessionTitleService = class extends Service {
526
526
  if (provider === null || typeof provider !== "object") throw new Error("session-title provider must be an object");
527
527
  const candidate = provider;
528
528
  if (typeof candidate.id !== "string" || candidate.id.length === 0) throw new Error("session-title provider id must be a non-empty string");
529
- if (candidate.automatic !== "first-message" && candidate.automatic !== "all-user-messages") throw new Error("session-title provider automatic mode is invalid");
529
+ if (candidate.automatic !== "first-prompt" && candidate.automatic !== "all-prompts") throw new Error("session-title provider automatic mode is invalid");
530
530
  if (typeof candidate.generate !== "function") throw new Error(`session-title provider "${candidate.id}" requires generate()`);
531
531
  }
532
532
  /**
@@ -90,7 +90,7 @@ export interface SessionTitleUserMessage {
90
90
  readonly text: string;
91
91
  }
92
92
  /** Automatic generation cadence owned by a registered provider. */
93
- export type SessionTitleAutomaticMode = 'first-message' | 'all-user-messages';
93
+ export type SessionTitleAutomaticMode = 'first-prompt' | 'all-prompts';
94
94
  /** Immutable input supplied to one title-provider call. */
95
95
  export interface SessionTitleProviderRequest {
96
96
  /** Live session being titled. */
@@ -294,7 +294,7 @@ export class SessionTitleService extends Service {
294
294
  const registration = this.registration;
295
295
  if (registration !== undefined && !registration.closing) {
296
296
  const messages = collectSessionTitleMessages(session.events, event.seq);
297
- const shouldSchedule = registration.provider.automatic === 'all-user-messages'
297
+ const shouldSchedule = registration.provider.automatic === 'all-prompts'
298
298
  || (session.header.parentSession === undefined && messages.length === 1 && this.get(session) === undefined);
299
299
  if (shouldSchedule) {
300
300
  const state = this.stateFor(session);
@@ -534,7 +534,7 @@ export class SessionTitleService extends Service {
534
534
  if (typeof candidate.id !== 'string' || candidate.id.length === 0) {
535
535
  throw new Error('session-title provider id must be a non-empty string');
536
536
  }
537
- if (candidate.automatic !== 'first-message' && candidate.automatic !== 'all-user-messages') {
537
+ if (candidate.automatic !== 'first-prompt' && candidate.automatic !== 'all-prompts') {
538
538
  throw new Error('session-title provider automatic mode is invalid');
539
539
  }
540
540
  if (typeof candidate.generate !== 'function') {
@@ -14,7 +14,7 @@ export declare function truncateTitleUtf8(input: string, maxBytes: number): stri
14
14
  */
15
15
  export declare function normalizeSessionTitle(input: string, maxBytes: number): string;
16
16
  /**
17
- * Derive the deterministic first-message fallback.
17
+ * Derive the deterministic first-prompt fallback.
18
18
  * @param input - text from the first eligible human message.
19
19
  * @param maxWords - positive whitespace-delimited word cap.
20
20
  * @param maxBytes - positive UTF-8 byte cap.
@@ -57,7 +57,7 @@ export function normalizeSessionTitle(input, maxBytes) {
57
57
  return truncateTitleUtf8(cleanTitleText(input), maxBytes).trimEnd();
58
58
  }
59
59
  /**
60
- * Derive the deterministic first-message fallback.
60
+ * Derive the deterministic first-prompt fallback.
61
61
  * @param input - text from the first eligible human message.
62
62
  * @param maxWords - positive whitespace-delimited word cap.
63
63
  * @param maxBytes - positive UTF-8 byte cap.
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.0.1-rc.2",
4
+ "version": "0.0.1-rc.3",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },
@@ -41,25 +41,25 @@
41
41
  ],
42
42
  "license": "BSD-3-Clause",
43
43
  "peerDependencies": {
44
- "@deepseek-ai/dsh-brand": "^0.0.1-rc.2",
45
- "@deepseek-ai/dsh-llm": "^0.0.1-rc.2",
46
- "@deepseek-ai/dsh-session": "^0.0.1-rc.2",
47
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.2",
48
- "@deepseek-ai/cordis": "^4.0.1-rc.1",
49
- "@deepseek-ai/dsh-session-projection": "^0.0.1-rc.2"
44
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
45
+ "@deepseek-ai/dsh-brand": "^0.0.1-rc.3",
46
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
47
+ "@deepseek-ai/dsh-session": "^0.0.1-rc.3",
48
+ "@deepseek-ai/dsh-session-projection": "^0.0.1-rc.3",
49
+ "@deepseek-ai/cordis": "^4.0.1-rc.1"
50
50
  },
51
51
  "dependencies": {
52
52
  "zod": "^4.4.3",
53
53
  "@deepseek-ai/schemastery": "^3.18.1-rc.1"
54
54
  },
55
55
  "devDependencies": {
56
- "@deepseek-ai/dsh-llm": "^0.0.1-rc.2",
57
- "@deepseek-ai/dsh-session": "^0.0.1-rc.2",
58
- "@deepseek-ai/dsh-session-persistence-jsonl": "^0.0.1-rc.2",
59
- "@deepseek-ai/dsh-invariants": "^0.0.1-rc.2",
60
- "@deepseek-ai/dsh-brand": "^0.0.1-rc.2",
61
- "@deepseek-ai/dsh-session-persistence-sqlite": "^0.0.1-rc.2",
62
- "@deepseek-ai/dsh-session-projection": "^0.0.1-rc.2",
56
+ "@deepseek-ai/dsh-brand": "^0.0.1-rc.3",
57
+ "@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
58
+ "@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
59
+ "@deepseek-ai/dsh-session": "^0.0.1-rc.3",
60
+ "@deepseek-ai/dsh-session-persistence-jsonl": "^0.0.1-rc.3",
61
+ "@deepseek-ai/dsh-session-persistence-sqlite": "^0.0.1-rc.3",
62
+ "@deepseek-ai/dsh-session-projection": "^0.0.1-rc.3",
63
63
  "@deepseek-ai/cordis": "^4.0.1-rc.1"
64
64
  }
65
65
  }