@deepseek-ai/dsh-session-title-first-prompt-llm 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/LICENSE +28 -0
- package/README.i18n.yaml +6 -0
- package/README.md +28 -0
- package/README.zh.md +28 -0
- package/lib/index.js +34 -0
- package/lib/invariant.js +23 -0
- package/lib/types/index.d.ts +17 -0
- package/lib/types/invariant.d.ts +16 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, DeepSeek
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.i18n.yaml
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/session/session-title-first-prompt-llm/README.md
|
|
5
|
+
README.md: fef0651e1c4ba0032e6a1854590d5ac023bd71d8
|
|
6
|
+
README.zh.md: 377779467a091b2c68d91a8be1903702a0808d10
|
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @deepseek-ai/dsh-session-title-first-prompt-llm
|
|
2
|
+
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
Optional `ctx.sessionTitle` provider that summarizes the first eligible human message through `ctx.llm`. It registers the `first-prompt` cadence, runs automatically only when a fresh non-fork session first creates its fallback, and attributes the result to that message's exact seq. An automatic failure retains the fallback and is retried only through `ctx.sessionTitle.refresh()`.
|
|
6
|
+
|
|
7
|
+
The plugin uses the complete required [shared LLM configuration](../session-title-llm/README.md#configuration). Omit both `provider` and `model` to inherit the exact route from the current logged main request, or set both to route title generation independently.
|
|
8
|
+
|
|
9
|
+
## Model Experience
|
|
10
|
+
|
|
11
|
+
### First-message title request
|
|
12
|
+
|
|
13
|
+
#### What the model sees
|
|
14
|
+
|
|
15
|
+
The title model receives the shared title instruction and a JSON array containing only the first eligible human message. Later prompts and inherited fork history do not trigger another automatic call.
|
|
16
|
+
|
|
17
|
+
#### Token effect
|
|
18
|
+
|
|
19
|
+
At most one automatic auxiliary request is made for a fresh session, bounded by `maxInputBytes` and `maxOutputTokens`; explicit refreshes may make additional calls. The main agent request gains zero tokens.
|
|
20
|
+
|
|
21
|
+
#### KV Cache effect
|
|
22
|
+
|
|
23
|
+
No main-request invalidation. The auxiliary request uses the configured or logged route and has provider-specific cache behavior.
|
|
24
|
+
|
|
25
|
+
## Known Limitations and Deferred Work
|
|
26
|
+
|
|
27
|
+
- The first message alone may cease to represent a long-running session; use the all-messages provider when later prompts should retitle it.
|
|
28
|
+
- A fork keeps its inherited title and never runs this provider automatically, even when its seeded first message came from the parent.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @deepseek-ai/dsh-session-title-first-prompt-llm
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
可选的 `ctx.sessionTitle` 提供方,通过 `ctx.llm` 总结第一条符合条件的用户消息。它注册 `first-prompt` 节奏,只在全新非 fork 会话首次创建回退时自动运行,并将结果归因于该消息的确切 seq。自动失败会保留回退,之后只能通过 `ctx.sessionTitle.refresh()` 重试。
|
|
6
|
+
|
|
7
|
+
该插件使用完整且必填的[共享 LLM(大语言模型)配置](../session-title-llm/README.md#configuration)。同时省略 `provider` 与 `model` 时,会继承当前已记录主请求的确切路由;也可以同时设置二者,使标题生成使用独立路由。
|
|
8
|
+
|
|
9
|
+
## 模型体验
|
|
10
|
+
|
|
11
|
+
### 首消息标题请求
|
|
12
|
+
|
|
13
|
+
#### 模型看到的内容
|
|
14
|
+
|
|
15
|
+
标题模型会收到共享标题指令,以及一个只包含第一条符合条件用户消息的 JSON 数组。后续提示词与继承的 fork 历史不会触发再次自动调用。
|
|
16
|
+
|
|
17
|
+
#### Token 影响
|
|
18
|
+
|
|
19
|
+
全新会话最多自动发出一次辅助请求,并受 `maxInputBytes` 和 `maxOutputTokens` 约束;显式刷新可能发出额外调用。主 agent(智能体)请求不会增加 token。
|
|
20
|
+
|
|
21
|
+
#### KV Cache 影响
|
|
22
|
+
|
|
23
|
+
不会使主请求的 KV Cache 失效。辅助请求使用已配置或已记录路由,其缓存行为由提供方决定。
|
|
24
|
+
|
|
25
|
+
## 已知限制与暂缓事项
|
|
26
|
+
|
|
27
|
+
- 对于长期会话,第一条消息可能不再具有代表性;如果后续提示词应触发重新生成标题,请使用全消息提供方。
|
|
28
|
+
- fork 会保留继承的标题,绝不会自动运行此提供方,即使其预置的首消息来自父会话。
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import z from "@deepseek-ai/schemastery";
|
|
2
|
+
import { SessionTitleLlmConfigFields, registerSessionTitleLlmProvider } from "@deepseek-ai/dsh-session-title-llm";
|
|
3
|
+
//#region lib/types/index.js
|
|
4
|
+
/** First-human-message model provider for `ctx.sessionTitle`. */
|
|
5
|
+
const name = "session-title-first-prompt-llm";
|
|
6
|
+
const inject = [
|
|
7
|
+
"sessionTitle",
|
|
8
|
+
"llm",
|
|
9
|
+
"sessions"
|
|
10
|
+
];
|
|
11
|
+
/** Loader schema shared with the all-messages provider. */
|
|
12
|
+
const Config = z.object({
|
|
13
|
+
targetWords: SessionTitleLlmConfigFields.targetWords,
|
|
14
|
+
targetCjkCharacters: SessionTitleLlmConfigFields.targetCjkCharacters,
|
|
15
|
+
maxInputBytes: SessionTitleLlmConfigFields.maxInputBytes,
|
|
16
|
+
maxOutputTokens: SessionTitleLlmConfigFields.maxOutputTokens,
|
|
17
|
+
timeoutMs: SessionTitleLlmConfigFields.timeoutMs,
|
|
18
|
+
provider: SessionTitleLlmConfigFields.provider,
|
|
19
|
+
model: SessionTitleLlmConfigFields.model
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Register the first-prompt model provider.
|
|
23
|
+
* @param ctx - context exposing session-title, LLM, and session services.
|
|
24
|
+
* @param config - required route, target, byte, token, and timeout policy.
|
|
25
|
+
*/
|
|
26
|
+
function apply(ctx, config) {
|
|
27
|
+
registerSessionTitleLlmProvider(ctx, config, name, "first-prompt", (messages) => {
|
|
28
|
+
const first = messages[0];
|
|
29
|
+
if (first === void 0) throw new Error("first-prompt title provider requires one human message");
|
|
30
|
+
return [first];
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { Config, apply, inject, name };
|
package/lib/invariant.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region lib/types/invariant.js
|
|
2
|
+
/**
|
|
3
|
+
* Package-owned invariant companion for `@deepseek-ai/dsh-session-title-first-prompt-llm`.
|
|
4
|
+
* @module @deepseek-ai/dsh-session-title-first-prompt-llm/invariant
|
|
5
|
+
*/
|
|
6
|
+
const PACKAGE_NAME = "@deepseek-ai/dsh-session-title-first-prompt-llm";
|
|
7
|
+
/** Cordis companion plugin name. */
|
|
8
|
+
const name = "session-title-first-prompt-llm-invariant";
|
|
9
|
+
/** Service required before the companion can reserve package ownership. */
|
|
10
|
+
const inject = ["invariants"];
|
|
11
|
+
/**
|
|
12
|
+
* No runtime invariant: this thin provider delegates request and result validation to the shared
|
|
13
|
+
* title service and LLM helper and retains no independent mutable state.
|
|
14
|
+
*/
|
|
15
|
+
const install = () => {};
|
|
16
|
+
/**
|
|
17
|
+
* Register this package's invariant companion.
|
|
18
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
19
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
20
|
+
*/
|
|
21
|
+
const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
|
|
22
|
+
//#endregion
|
|
23
|
+
export { apply, inject, name };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** First-human-message model provider for `ctx.sessionTitle`. */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import z from '@deepseek-ai/schemastery';
|
|
4
|
+
import type { SessionTitleLlmConfig } from '@deepseek-ai/dsh-session-title-llm';
|
|
5
|
+
export declare const name = "session-title-first-prompt-llm";
|
|
6
|
+
export declare const inject: string[];
|
|
7
|
+
/** Required LLM policy; this plugin adds no defaults. */
|
|
8
|
+
export type Config = SessionTitleLlmConfig;
|
|
9
|
+
/** Loader schema shared with the all-messages provider. */
|
|
10
|
+
export declare const Config: z<Config>;
|
|
11
|
+
/**
|
|
12
|
+
* Register the first-prompt model provider.
|
|
13
|
+
* @param ctx - context exposing session-title, LLM, and session services.
|
|
14
|
+
* @param config - required route, target, byte, token, and timeout policy.
|
|
15
|
+
*/
|
|
16
|
+
export declare function apply(ctx: Context, config: Config): void;
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package-owned invariant companion for `@deepseek-ai/dsh-session-title-first-prompt-llm`.
|
|
3
|
+
* @module @deepseek-ai/dsh-session-title-first-prompt-llm/invariant
|
|
4
|
+
*/
|
|
5
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
6
|
+
/** Cordis companion plugin name. */
|
|
7
|
+
export declare const name = "session-title-first-prompt-llm-invariant";
|
|
8
|
+
/** Service required before the companion can reserve package ownership. */
|
|
9
|
+
export declare const inject: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Register this package's invariant companion.
|
|
12
|
+
* @param ctx - Cordis context carrying the invariant service.
|
|
13
|
+
* @returns the installed registration's disposer after setup succeeds.
|
|
14
|
+
*/
|
|
15
|
+
export declare const apply: (ctx: Context) => Promise<() => void>;
|
|
16
|
+
//# sourceMappingURL=invariant.d.ts.map
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deepseek-ai/dsh-session-title-first-prompt-llm",
|
|
3
|
+
"description": "First-message LLM provider plugin for DeepSeek Harness session titles",
|
|
4
|
+
"version": "0.0.1-rc.3",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "restricted"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/session/session-title-first-prompt-llm"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./lib/types/index.d.ts",
|
|
19
|
+
"default": "./lib/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./invariant": {
|
|
22
|
+
"types": "./lib/types/invariant.d.ts",
|
|
23
|
+
"default": "./lib/invariant.js"
|
|
24
|
+
},
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"lib/index.js",
|
|
29
|
+
"lib/invariant.js",
|
|
30
|
+
"lib/types/**/*.d.ts"
|
|
31
|
+
],
|
|
32
|
+
"license": "BSD-3-Clause",
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
35
|
+
"@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
|
|
36
|
+
"@deepseek-ai/dsh-session": "^0.0.1-rc.3",
|
|
37
|
+
"@deepseek-ai/dsh-session-title": "^0.0.1-rc.3",
|
|
38
|
+
"@deepseek-ai/cordis": "^4.0.1-rc.1",
|
|
39
|
+
"@deepseek-ai/dsh-session-title-llm": "^0.0.1-rc.3"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@deepseek-ai/schemastery": "^3.18.1-rc.1"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@deepseek-ai/cordis-plugin-include": "^1.0.5-rc.1",
|
|
46
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.3",
|
|
47
|
+
"@deepseek-ai/dsh-llm": "^0.0.1-rc.3",
|
|
48
|
+
"@deepseek-ai/dsh-llm-deepseek": "^0.0.1-rc.3",
|
|
49
|
+
"@deepseek-ai/cordis-plugin-loader": "^1.0.1-rc.1",
|
|
50
|
+
"@deepseek-ai/dsh-session": "^0.0.1-rc.3",
|
|
51
|
+
"@deepseek-ai/dsh-session-title": "^0.0.1-rc.3",
|
|
52
|
+
"@deepseek-ai/cordis": "^4.0.1-rc.1",
|
|
53
|
+
"@deepseek-ai/dsh-session-title-llm": "^0.0.1-rc.3"
|
|
54
|
+
}
|
|
55
|
+
}
|