@x1a0f3n9/dsh-session-query 0.1.5-alpha.2 → 0.1.5-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 +2 -2
- package/README.md +1 -1
- package/README.zh.md +8 -8
- package/package.json +18 -18
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-query/session-query/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 5971903ef06035e73e6db57d3f437eec7a2aa8d9
|
|
6
|
+
README.zh.md: e389975f436501093785e931c246d75279e2a0b6
|
package/README.md
CHANGED
|
@@ -108,7 +108,7 @@ The decision history lives in the [unified service decision](../../../.agents/no
|
|
|
108
108
|
|
|
109
109
|
### Observation cache
|
|
110
110
|
|
|
111
|
-
`observeSession` builds point observations without a listing preflight. A live observation fixes its cut as the current log length and materializes `events` on first read, so header-, cursor-, or projection-only consumers never copy the log; the log only appends, so a late first read still yields exactly that prefix. The cold path stats the stored session first and consults
|
|
111
|
+
`observeSession` builds point observations without a listing preflight. A live observation fixes its cut as the current log length and materializes `events` on first read, so header-, cursor-, or projection-only consumers never copy the log; the log only appends, so a late first read still yields exactly that prefix. The cold path stats the stored session first and consults its own bounded cache keyed by the persistence instance and the `stat` revision: an unchanged revision reuses the restored unpublished Session without re-reading the log; a changed revision, or a replaced persistence instance, reloads through the handle seam and replaces the entry. The cache holds `preparedSessionCacheSize` entries with least-recently-used eviction, entries pinned by active observation leases are never evicted, and a session that goes live mid-read retries the live path.
|
|
112
112
|
|
|
113
113
|
### Reads and traces
|
|
114
114
|
|
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-query`
|
|
12
|
+
`dsh-session-query` 让应用代码可以列出、过滤、读取和搜索会话历史,检查带边界的事件上下文,并追踪会话或事件关系。读取优先使用实时会话而非持久化副本,并返回来自同一次一致观察的脱离存储克隆。精确读取、过滤与追踪可用于任何受支持的存储设置;带排名的全文搜索需要 `dsh-session-query-sqlite` 等后端。当应用代码需要以编程方式访问呈现给模型的历史时,请使用本包。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -48,7 +48,7 @@ kind: "package-reference"
|
|
|
48
48
|
|
|
49
49
|
`SessionResultFilter` 按 id、可空 cwd、创建时间范围、可空父级或来源可用性缩小会话范围;`SessionEventResultFilter` 按 seq/时间范围、事件类型、表层或字面文本缩小事件范围。过滤器数组使用 AND 连接,同一子句内的列表值使用 OR;空列表值不匹配任何内容,范围包含端点,格式错误的范围或未知的封闭联合值以 `SESSION_QUERY_INVALID_FILTER` 失败。
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
文本子句是对所提取语义文本的字面、不区分大小写、空白灵活的扫描——而非全文查询。需要任意子字符串召回时使用它;需要带排名的全文结果时使用挂载后端的搜索方法。
|
|
52
52
|
|
|
53
53
|
### 配置
|
|
54
54
|
|
|
@@ -92,7 +92,7 @@ kind: "package-reference"
|
|
|
92
92
|
| [`src/index.ts`](src/index.ts) | 服务定义:抽象 `SessionQueryEngine`、具体读取、配置校验 |
|
|
93
93
|
| [`src/corpus.ts`](src/corpus.ts) | 实时优先的语料库解析、可选持久化绑定、批量投影 |
|
|
94
94
|
| [`src/observation.ts`](src/observation.ts) | 实时优先的定点观察,带按修订键控的有界 prepared-Session 缓存 |
|
|
95
|
-
| [`src/cold-read.ts`](src/cold-read.ts) |
|
|
95
|
+
| [`src/cold-read.ts`](src/cold-read.ts) | 基于句柄的冷日志读取,附内存中的中断轮次闭合事件 |
|
|
96
96
|
| [`src/types.ts`](src/types.ts) | 公共记录、过滤器、请求与分页类型 |
|
|
97
97
|
| [`src/config.ts`](src/config.ts) | 继承配置与封闭的 `SessionQueryError` 分类体系 |
|
|
98
98
|
| [`src/filters.ts`](src/filters.ts) | 提供方无关谓词与字面文本扫描 |
|
|
@@ -100,15 +100,15 @@ kind: "package-reference"
|
|
|
100
100
|
| [`src/documents.ts`](src/documents.ts) | 表层感知的语义文档投影 |
|
|
101
101
|
| [`src/tracing.ts`](src/tracing.ts) | 一次性会话血缘与事件关系追踪 |
|
|
102
102
|
| [`src/sources.ts`](src/sources.ts) | 不可变 header 兼容性检查 |
|
|
103
|
-
| — |
|
|
103
|
+
| — | 不发布运行时不变式伴生入口;查询结果是每次调用产生的不可变投影,其血缘与事件关系会在构建时完成校验;服务不保留可观察的结果状态。 |
|
|
104
104
|
|
|
105
105
|
### 语料库解析
|
|
106
106
|
|
|
107
|
-
`SessionCorpus` 通过 fiber 绑定可选的 `ctx.sessionPersistence
|
|
107
|
+
`SessionCorpus` 通过 fiber 绑定可选的 `ctx.sessionPersistence`,并实时优先解析每次读取:已知实时目标直接快照,不查询持久化;否则先列出会话,再通过短生命周期的读取句柄完整读出日志,并在克隆前重新检查是否出现实时挂载。写入者在轮次中途崩溃的冷日志用 `interruptedTurnClosers` 在内存中补齐——读取从不修改持久化。列表与加载观察之间会断言 header 兼容性。批量标题读取执行一次元数据列表与有界并发读取,把逐会话失败隔离,而取消会拒绝整个批次。
|
|
108
108
|
|
|
109
109
|
### 观察缓存
|
|
110
110
|
|
|
111
|
-
`observeSession` 不经过列表预检直接构建定点观察。实时观察以当前日志长度固定 cut,并在首次读取时才物化 `events`,因此只需要 header、cursor 或 projection 的消费者永远不会复制日志;日志只会追加,所以延后的首次读取得到的仍然正好是该前缀。冷路径先对存储会话执行 `stat`,再查询自有的有界缓存,缓存键为持久化实例加 `stat` 修订:修订未变则复用已恢复的未发布 Session
|
|
111
|
+
`observeSession` 不经过列表预检直接构建定点观察。实时观察以当前日志长度固定 cut,并在首次读取时才物化 `events`,因此只需要 header、cursor 或 projection 的消费者永远不会复制日志;日志只会追加,所以延后的首次读取得到的仍然正好是该前缀。冷路径先对存储会话执行 `stat`,再查询自有的有界缓存,缓存键为持久化实例加 `stat` 修订:修订未变则复用已恢复的未发布 Session,不再重读日志;修订变化或持久化实例被替换则经句柄 seam 重新加载并替换条目。缓存保留 `preparedSessionCacheSize` 个条目并按最久未用淘汰,被活跃观察租约钉住的条目从不被淘汰;读取中途转为实时的会话会重试实时路径。
|
|
112
112
|
|
|
113
113
|
### 读取与追踪
|
|
114
114
|
|
|
@@ -150,7 +150,7 @@ kind: "package-reference"
|
|
|
150
150
|
- **无调用方授权**——这是上下文范围内的可信基础设施;模型工具或 UI 必须限制调用方可检查的会话。
|
|
151
151
|
- **无提供方协调器或回退**——服务在搜索上是抽象的,组合必须挂载具体后端;没有搜索提供方注册表或回退实现。
|
|
152
152
|
- **精确读取回放整个日志**——`readSession`、`readSurface`、`filterEvents` 与事件追踪会加载并校验完整逻辑日志,因此非常大的历史每次调用都要付出完整检查;`listSessions` 保持轻量。
|
|
153
|
-
- **字面文本扫描,而非全文搜索**——`text`
|
|
153
|
+
- **字面文本扫描,而非全文搜索**——`text` 过滤器用正则表达式扫描提取出的文档且不提供排名;带排名的搜索需要挂载后端。
|
|
154
154
|
|
|
155
155
|
<a id="dev-note"></a>
|
|
156
156
|
### 开发备注
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x1a0f3n9/dsh-session-query",
|
|
3
3
|
"description": "Combined session query service contract with concrete reads, traces, and filters",
|
|
4
|
-
"version": "0.1.5-
|
|
4
|
+
"version": "0.1.5-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@x1a0f3n9/dsh-brand": "^0.1.5-
|
|
31
|
-
"@x1a0f3n9/dsh-
|
|
32
|
-
"@x1a0f3n9/dsh-
|
|
33
|
-
"@x1a0f3n9/dsh-
|
|
34
|
-
"@x1a0f3n9/dsh-
|
|
35
|
-
"@x1a0f3n9/dsh-session-
|
|
36
|
-
"@x1a0f3n9/dsh-session-
|
|
37
|
-
"@
|
|
38
|
-
"@
|
|
30
|
+
"@x1a0f3n9/dsh-brand": "^0.1.5-rc.2",
|
|
31
|
+
"@x1a0f3n9/dsh-session": "^0.1.5-rc.2",
|
|
32
|
+
"@x1a0f3n9/dsh-llm": "^0.1.5-rc.2",
|
|
33
|
+
"@x1a0f3n9/dsh-tool-todo": "^0.1.5-rc.2",
|
|
34
|
+
"@x1a0f3n9/dsh-session-persistence": "^0.1.5-rc.2",
|
|
35
|
+
"@x1a0f3n9/dsh-session-projection": "^0.1.5-rc.2",
|
|
36
|
+
"@x1a0f3n9/dsh-session-title": "^0.1.5-rc.2",
|
|
37
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
38
|
+
"@x1a0f3n9/dsh-session-projection-cache": "^0.1.5-rc.2"
|
|
39
39
|
},
|
|
40
40
|
"peerDependenciesMeta": {
|
|
41
41
|
"@x1a0f3n9/dsh-session-persistence": {
|
|
@@ -49,14 +49,14 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@x1a0f3n9/dsh-
|
|
53
|
-
"@x1a0f3n9/dsh-
|
|
54
|
-
"@x1a0f3n9/dsh-session": "^0.1.5-
|
|
55
|
-
"@x1a0f3n9/dsh-session-title": "^0.1.5-
|
|
56
|
-
"@x1a0f3n9/dsh-tool-todo": "^0.1.5-
|
|
57
|
-
"@x1a0f3n9/dsh-session-
|
|
58
|
-
"@x1a0f3n9/dsh-session-projection": "^0.1.5-
|
|
59
|
-
"@x1a0f3n9/dsh-session-
|
|
52
|
+
"@x1a0f3n9/dsh-llm": "^0.1.5-rc.2",
|
|
53
|
+
"@x1a0f3n9/dsh-brand": "^0.1.5-rc.2",
|
|
54
|
+
"@x1a0f3n9/dsh-session": "^0.1.5-rc.2",
|
|
55
|
+
"@x1a0f3n9/dsh-session-title": "^0.1.5-rc.2",
|
|
56
|
+
"@x1a0f3n9/dsh-tool-todo": "^0.1.5-rc.2",
|
|
57
|
+
"@x1a0f3n9/dsh-session-projection": "^0.1.5-rc.2",
|
|
58
|
+
"@x1a0f3n9/dsh-session-projection-cache": "^0.1.5-rc.2",
|
|
59
|
+
"@x1a0f3n9/dsh-session-persistence": "^0.1.5-rc.2",
|
|
60
60
|
"@deepseek-ai/cordis": "^4.0.2"
|
|
61
61
|
}
|
|
62
62
|
}
|