@deepseek-ai/dsh-time-context 0.1.7-alpha.2 → 0.1.7-rc.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 +69 -5
- package/README.md +6 -6
- package/README.zh.md +6 -6
- package/lib/index.js +3 -3
- package/lib/types/index.d.ts +1 -1
- package/package.json +23 -23
package/README.i18n.yaml
CHANGED
|
@@ -1,6 +1,70 @@
|
|
|
1
|
-
# Bilingual-pair consistency record (docs/i18n/README.md):
|
|
2
|
-
#
|
|
3
|
-
#
|
|
1
|
+
# Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
|
|
2
|
+
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
|
3
|
+
# After editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/context/time-context/README.md
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
/:
|
|
6
|
+
en: aeab1f35e53d97e6
|
|
7
|
+
zh: 24cef3129256b53e
|
|
8
|
+
/deepseek-ai-dsh-time-context:
|
|
9
|
+
en: ec051915b3d81cda
|
|
10
|
+
zh: 3a0ef832e3a5e419
|
|
11
|
+
/deepseek-ai-dsh-time-context/summary:
|
|
12
|
+
en: e4e308b9fd3fcd56
|
|
13
|
+
zh: 9fb4d40ebe621d6a
|
|
14
|
+
/deepseek-ai-dsh-time-context/table-of-contents:
|
|
15
|
+
en: d152484eb41ac6b4
|
|
16
|
+
zh: 09388d293f9be9cb
|
|
17
|
+
/deepseek-ai-dsh-time-context/use-this-package:
|
|
18
|
+
en: dedd1cdaec7140f1
|
|
19
|
+
zh: 9399f5b677ff8f34
|
|
20
|
+
/deepseek-ai-dsh-time-context/use-this-package/what-the-model-gets:
|
|
21
|
+
en: 104b5d5609b00f33
|
|
22
|
+
zh: f6115b4eaa24bda7
|
|
23
|
+
/deepseek-ai-dsh-time-context/use-this-package/configuration:
|
|
24
|
+
en: e6ac1f330c18c69c
|
|
25
|
+
zh: 9e969a5b377ba62a
|
|
26
|
+
/deepseek-ai-dsh-time-context/use-this-package/choosing-the-zone:
|
|
27
|
+
en: 7eed0d784ad7381b
|
|
28
|
+
zh: 47a849df0ce80105
|
|
29
|
+
/deepseek-ai-dsh-time-context/understand-the-implementation:
|
|
30
|
+
en: 2d21fa2aad5a729d
|
|
31
|
+
zh: cfbfada0eb647435
|
|
32
|
+
/deepseek-ai-dsh-time-context/understand-the-implementation/design-concept:
|
|
33
|
+
en: f2c19187501f7027
|
|
34
|
+
zh: 48d31d0ea9bd8b16
|
|
35
|
+
/deepseek-ai-dsh-time-context/understand-the-implementation/source-map:
|
|
36
|
+
en: 05a0a4627013d3d2
|
|
37
|
+
zh: 281429e6ef7f26ec
|
|
38
|
+
/deepseek-ai-dsh-time-context/understand-the-implementation/main-flow:
|
|
39
|
+
en: ae9f13873dde5271
|
|
40
|
+
zh: 873f32e67f8b202b
|
|
41
|
+
/deepseek-ai-dsh-time-context/further-exploration:
|
|
42
|
+
en: e1cd55f40edbb7ed
|
|
43
|
+
zh: 8a2abf22ef859841
|
|
44
|
+
/deepseek-ai-dsh-time-context/model-experience:
|
|
45
|
+
en: 215e7ba838619b7b
|
|
46
|
+
zh: a311da3843709f90
|
|
47
|
+
/deepseek-ai-dsh-time-context/model-experience/preparation-time-temporal-context:
|
|
48
|
+
en: 2d7737ecbb6d396a
|
|
49
|
+
zh: d143ab388368b54e
|
|
50
|
+
/deepseek-ai-dsh-time-context/model-experience/preparation-time-temporal-context/what-the-model-sees:
|
|
51
|
+
en: 945a84da62e8ff62
|
|
52
|
+
zh: 935dc3f93f862f3f
|
|
53
|
+
/deepseek-ai-dsh-time-context/model-experience/preparation-time-temporal-context/what-the-model-sees/first-step:
|
|
54
|
+
en: 58d49c94906946dd
|
|
55
|
+
zh: e42ca0fe4ec2878d
|
|
56
|
+
/deepseek-ai-dsh-time-context/model-experience/preparation-time-temporal-context/what-the-model-sees/later-steps:
|
|
57
|
+
en: d583e2c01b797bef
|
|
58
|
+
zh: 74b908a4fd7972e7
|
|
59
|
+
/deepseek-ai-dsh-time-context/model-experience/preparation-time-temporal-context/token-effect:
|
|
60
|
+
en: fc72bbd239df14db
|
|
61
|
+
zh: 750a04f8d4f1b6db
|
|
62
|
+
/deepseek-ai-dsh-time-context/model-experience/preparation-time-temporal-context/kv-cache-effect:
|
|
63
|
+
en: 2fbf2175168e8244
|
|
64
|
+
zh: f681f89596f500f5
|
|
65
|
+
/deepseek-ai-dsh-time-context/known-limitations-and-deferred-work:
|
|
66
|
+
en: 8fcf131f1f00626b
|
|
67
|
+
zh: a99b928aca0b1fab
|
|
68
|
+
/deepseek-ai-dsh-time-context/known-limitations-and-deferred-work/dev-note:
|
|
69
|
+
en: e67f633dc6fe7773
|
|
70
|
+
zh: 3bb0c20c93f16f98
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "
|
|
2
|
+
description: "Per-step clock context with the current time, browser zone, and elapsed time, for users and maintainers tuning the plugin."
|
|
3
3
|
kind: "package-reference"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
`dsh-time-context` gives the model a clock: on eligible steps it appends a durable, source-attributed reading with the current time, the browser zone attached to the open request, and the elapsed time since the preceding model-visible message. It helps the model interpret otherwise-unqualified dates and times in the user's browser zone, and tells it to ask when current-turn browser zones are mixed or missing. The
|
|
12
|
+
`dsh-time-context` gives the model a clock: on eligible steps it appends a durable, source-attributed reading with the current time, the browser zone attached to the open request, and the elapsed time since the preceding model-visible message. It helps the model interpret otherwise-unqualified dates and times in the user's browser zone, and tells it to ask when current-turn browser zones are mixed or missing. The shipped Web bundle mounts it with Schedule. Readings default to a 10-minute minimum interval; `refreshIntervalMs: 0` injects at every eligible step.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -33,7 +33,7 @@ Each injected reading has three lines: an ISO-shaped timestamp with numeric offs
|
|
|
33
33
|
|
|
34
34
|
### Configuration
|
|
35
35
|
|
|
36
|
-
The minimal mount needs no configuration. A positive `refreshIntervalMs` suppresses injections that fall within that many milliseconds of the latest one; omission
|
|
36
|
+
The minimal mount needs no configuration. A positive `refreshIntervalMs` suppresses injections that fall within that many milliseconds of the latest one; omission uses 600000 ms (10 minutes), while `0` injects at every eligible entering pre-step whose signal is not already aborted.
|
|
37
37
|
|
|
38
38
|
```yaml
|
|
39
39
|
- name: '@deepseek-ai/dsh-time-context'
|
|
@@ -44,7 +44,7 @@ The minimal mount needs no configuration. A positive `refreshIntervalMs` suppres
|
|
|
44
44
|
| Field | Default | Meaning |
|
|
45
45
|
|---|---|---|
|
|
46
46
|
| `timeZone` | process zone | Fallback display zone when the open turn has no unique browser zone |
|
|
47
|
-
| `refreshIntervalMs` | `
|
|
47
|
+
| `refreshIntervalMs` | `600000` (10 minutes) | Minimum milliseconds between durable injections in one session |
|
|
48
48
|
|
|
49
49
|
The generated [configuration catalog](../../../docs/config-catalog.md#deepseek-aidsh-time-context) is the exhaustive source for every accepted field and its JSDoc.
|
|
50
50
|
|
|
@@ -121,7 +121,7 @@ Elapsed since the preceding step context: <duration-or-unavailable>.
|
|
|
121
121
|
|
|
122
122
|
#### Token effect
|
|
123
123
|
|
|
124
|
-
Each reading accumulates until compaction shadows it. A positive interval reduces additions;
|
|
124
|
+
Each reading accumulates until compaction shadows it. A positive interval reduces additions; `0` adds one at every eligible preparation attempt.
|
|
125
125
|
|
|
126
126
|
#### KV Cache effect
|
|
127
127
|
|
|
@@ -138,7 +138,7 @@ These limits define when clock context is a poor fit. They are current package c
|
|
|
138
138
|
- **Mixed turns ask** — if one open turn contains prompts from different browser zones, the model is told to clarify rather than guess which one owns an unqualified time.
|
|
139
139
|
- **Fallback is not user authority** — the configured or process zone formats the clock when current-turn browser zones are missing or mixed, but the model-facing policy still says to clarify.
|
|
140
140
|
- **Whole-second display** — timestamps and durations omit sub-second precision even though durable event times retain milliseconds.
|
|
141
|
-
- **History cost between compactions** —
|
|
141
|
+
- **History cost between compactions** — `0` retains one reading for every eligible attempt; a positive interval reduces but does not eliminate this cost and may leave a later request without fresh browser-zone guidance.
|
|
142
142
|
|
|
143
143
|
<a id="dev-note"></a>
|
|
144
144
|
### Dev Note
|
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-time-context`
|
|
12
|
+
`dsh-time-context` 给模型一只时钟:在符合条件的步骤上,它追加一条持久、带来源的读数,包含当前时间、附加到当前开放请求的浏览器时区,以及自前一条模型可见消息以来的经过时长。它帮助模型按用户的浏览器时区解释未明确限定时区的日期与时间;时区来源混杂或缺失时,它告诉模型去询问。发布的 Web bundle 会随 Schedule 一起挂载它。读数默认采用 10 分钟的最小间隔;`refreshIntervalMs: 0` 会在每个符合条件的步骤注入。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -33,7 +33,7 @@ kind: "package-reference"
|
|
|
33
33
|
|
|
34
34
|
### 配置
|
|
35
35
|
|
|
36
|
-
最小挂载无需任何配置。正的 `refreshIntervalMs`
|
|
36
|
+
最小挂载无需任何配置。正的 `refreshIntervalMs` 会抑制距最近一次注入不足该毫秒数的注入;省略时采用 600000 毫秒(10 分钟),设为 `0` 时,每个信号尚未中止且将进入步骤的合格 pre-step 都会注入。
|
|
37
37
|
|
|
38
38
|
```yaml
|
|
39
39
|
- name: '@deepseek-ai/dsh-time-context'
|
|
@@ -44,7 +44,7 @@ kind: "package-reference"
|
|
|
44
44
|
| 字段 | 默认值 | 含义 |
|
|
45
45
|
|---|---|---|
|
|
46
46
|
| `timeZone` | 进程时区 | 当前开放轮次没有唯一浏览器时区时的显示回退时区 |
|
|
47
|
-
| `refreshIntervalMs` | `
|
|
47
|
+
| `refreshIntervalMs` | `600000`(10 分钟) | 同一会话中两次持久注入之间的最小毫秒数 |
|
|
48
48
|
|
|
49
49
|
生成的[配置目录](../../../docs/config-catalog.zh.md#deepseek-aidsh-time-context)是每个受支持字段及其 JSDoc 的穷尽式真源。
|
|
50
50
|
|
|
@@ -121,7 +121,7 @@ Elapsed since the preceding step context: <duration-or-unavailable>.
|
|
|
121
121
|
|
|
122
122
|
#### Token 影响
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
每个读数都会累积,直到压缩将其遮蔽。正数间隔会减少新增读数;设为 `0` 时,每次合格的准备尝试都会添加一条。
|
|
125
125
|
|
|
126
126
|
#### KV Cache 影响
|
|
127
127
|
|
|
@@ -138,7 +138,7 @@ Elapsed since the preceding step context: <duration-or-unavailable>.
|
|
|
138
138
|
- **混合轮次会询问**:如果同一个开放轮次包含来自不同浏览器时区的提示词,模型会收到要求澄清的指令,而不会猜测哪个时区拥有未限定的时间。
|
|
139
139
|
- **回退值不代表用户权威**:浏览器来源信息缺失或混杂时,配置或进程时区用于格式化时钟,但面向模型的策略仍要求澄清。
|
|
140
140
|
- **整秒显示**:时间戳与持续时间省略亚秒精度,尽管持久事件时间保留毫秒。
|
|
141
|
-
-
|
|
141
|
+
- **压缩之间的历史成本**:设为 `0` 时,每次合格尝试都会保留一条读数;正数间隔可以降低但无法消除该成本,也可能使后续请求缺少新鲜的浏览器时区指导。
|
|
142
142
|
|
|
143
143
|
<a id="dev-note"></a>
|
|
144
144
|
### 开发备注
|
package/lib/index.js
CHANGED
|
@@ -149,7 +149,7 @@ function renderText(now, turn, step, previous, formatter, timeZone, browserConte
|
|
|
149
149
|
}
|
|
150
150
|
/** Reject refresh intervals that cannot represent an exact elapsed-millisecond threshold. */
|
|
151
151
|
function validateRefreshInterval(refreshIntervalMs) {
|
|
152
|
-
if (
|
|
152
|
+
if (!Number.isSafeInteger(refreshIntervalMs) || refreshIntervalMs < 0) throw new TypeError(`time-context: refreshIntervalMs must be a non-negative safe integer, got ${String(refreshIntervalMs)}`);
|
|
153
153
|
}
|
|
154
154
|
/**
|
|
155
155
|
* Register a prepended pre-step listener for the lifetime of `ctx`.
|
|
@@ -159,7 +159,7 @@ function validateRefreshInterval(refreshIntervalMs) {
|
|
|
159
159
|
*/
|
|
160
160
|
function apply(ctx, config) {
|
|
161
161
|
const timeZone = config.timeZone;
|
|
162
|
-
const refreshIntervalMs = config.refreshIntervalMs;
|
|
162
|
+
const refreshIntervalMs = config.refreshIntervalMs ?? 6e5;
|
|
163
163
|
validateRefreshInterval(refreshIntervalMs);
|
|
164
164
|
let fallbackFormatter;
|
|
165
165
|
try {
|
|
@@ -217,7 +217,7 @@ function apply(ctx, config) {
|
|
|
217
217
|
if (decision.kind === "reject" || signal.aborted) return decision;
|
|
218
218
|
const now = Date.now();
|
|
219
219
|
const state = ctx.sessionProjections.stateOf(agent.session, "timeContext");
|
|
220
|
-
if (refreshIntervalMs
|
|
220
|
+
if (refreshIntervalMs > 0) {
|
|
221
221
|
const lastInjection = state.lastInjectionTime;
|
|
222
222
|
if (lastInjection != null && now >= lastInjection && now - lastInjection < refreshIntervalMs) return decision;
|
|
223
223
|
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export declare const inject: string[];
|
|
|
36
36
|
export interface Config {
|
|
37
37
|
/** Fallback display zone when the open turn has no unique browser zone. Omit to use the process zone. */
|
|
38
38
|
timeZone?: string;
|
|
39
|
-
/** Minimum milliseconds between durable injections in one session.
|
|
39
|
+
/** Minimum milliseconds between durable injections in one session. Defaults to 600000 (10 minutes); 0 injects at every eligible step. */
|
|
40
40
|
refreshIntervalMs?: number;
|
|
41
41
|
}
|
|
42
42
|
/** Schemastery validation for {@link Config}. */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-time-context",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "0.1.7-
|
|
3
|
+
"description": "Durable per-step context with the current time and elapsed time",
|
|
4
|
+
"version": "0.1.7-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -33,33 +33,33 @@
|
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"zod": "^4.4.3",
|
|
36
|
-
"@deepseek-ai/dsh-util-values": "0.1.7-
|
|
36
|
+
"@deepseek-ai/dsh-util-values": "0.1.7-rc.2",
|
|
37
37
|
"@deepseek-ai/schemastery": "~3.18.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@deepseek-ai/dsh-
|
|
41
|
-
"@deepseek-ai/dsh-llm": "0.1.7-alpha.2",
|
|
42
|
-
"@deepseek-ai/dsh-session": "0.1.7-alpha.2",
|
|
43
|
-
"@deepseek-ai/dsh-session-projection": "0.1.7-alpha.2",
|
|
40
|
+
"@deepseek-ai/dsh-agent": "0.1.7-rc.2",
|
|
44
41
|
"@deepseek-ai/cordis": "~4.0.4",
|
|
45
|
-
"@deepseek-ai/dsh-
|
|
42
|
+
"@deepseek-ai/dsh-llm": "0.1.7-rc.2",
|
|
43
|
+
"@deepseek-ai/dsh-session": "0.1.7-rc.2",
|
|
44
|
+
"@deepseek-ai/dsh-session-projection": "0.1.7-rc.2",
|
|
45
|
+
"@deepseek-ai/dsh-invariants": "0.1.7-rc.2"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@deepseek-ai/cordis": "~4.0.4",
|
|
49
|
-
"@deepseek-ai/dsh-agent": "0.1.7-
|
|
50
|
-
"@deepseek-ai/dsh-agent-loop": "0.1.7-
|
|
51
|
-
"@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-
|
|
52
|
-
"@deepseek-ai/dsh-app-boot": "0.1.7-
|
|
53
|
-
"@deepseek-ai/dsh-bash-local": "0.1.7-
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/dsh-session": "0.1.7-
|
|
57
|
-
"@deepseek-ai/dsh-
|
|
58
|
-
"@deepseek-ai/dsh-
|
|
59
|
-
"@deepseek-ai/dsh-session-persistence-jsonl": "0.1.7-
|
|
60
|
-
"@deepseek-ai/dsh-session-projection": "0.1.7-
|
|
61
|
-
"@deepseek-ai/dsh-subprocess-local": "0.1.7-
|
|
62
|
-
"@deepseek-ai/dsh-system-prompt": "0.1.7-
|
|
63
|
-
"@deepseek-ai/dsh-tools": "0.1.7-
|
|
49
|
+
"@deepseek-ai/dsh-agent": "0.1.7-rc.2",
|
|
50
|
+
"@deepseek-ai/dsh-agent-loop": "0.1.7-rc.2",
|
|
51
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.1.7-rc.2",
|
|
52
|
+
"@deepseek-ai/dsh-app-boot": "0.1.7-rc.2",
|
|
53
|
+
"@deepseek-ai/dsh-bash-local": "0.1.7-rc.2",
|
|
54
|
+
"@deepseek-ai/dsh-llm": "0.1.7-rc.2",
|
|
55
|
+
"@deepseek-ai/dsh-loader-smoke": "0.1.7-rc.2",
|
|
56
|
+
"@deepseek-ai/dsh-session": "0.1.7-rc.2",
|
|
57
|
+
"@deepseek-ai/dsh-invariants": "0.1.7-rc.2",
|
|
58
|
+
"@deepseek-ai/dsh-session-checkpoint-policy": "0.1.7-rc.2",
|
|
59
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "0.1.7-rc.2",
|
|
60
|
+
"@deepseek-ai/dsh-session-projection": "0.1.7-rc.2",
|
|
61
|
+
"@deepseek-ai/dsh-subprocess-local": "0.1.7-rc.2",
|
|
62
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.7-rc.2",
|
|
63
|
+
"@deepseek-ai/dsh-tools": "0.1.7-rc.2"
|
|
64
64
|
}
|
|
65
65
|
}
|