@deepseek-ai/dsh-session-telemetry 0.1.1-rc.2 → 0.1.2-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 +2 -2
- package/README.md +98 -20
- package/README.zh.md +96 -22
- package/lib/index.js +2 -2
- package/lib/types/coordinator.d.ts +2 -2
- package/lib/types/index.d.ts +2 -3
- package/package.json +9 -9
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-telemetry/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 2970106b7b5f27ff2c88deb6c4327b5b8dc12466
|
|
6
|
+
README.zh.md: 47f954e5d1f32d9db7a84bbd0fc38414e7af31c5
|
package/README.md
CHANGED
|
@@ -1,49 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Session-telemetry capture seam for deployments and backend authors choosing a reporting backend, mounting redaction rules, or implementing the backend contract."
|
|
3
|
+
kind: "package-library"
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# @deepseek-ai/dsh-session-telemetry
|
|
2
7
|
|
|
3
8
|
English | [中文](README.zh.md)
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
`dsh-session-telemetry` captures session activity for outbound reporting: it projects session events into telemetry records, lets a deployment redact them, and hands them to a reporting backend that implements its contract. Deployments do not load this package directly — they load exactly one backend (the shipped OpenTelemetry backend is `dsh-session-telemetry-otel`), which registers `ctx.sessionTelemetry` and composes the capture coordinator. The seam owns capture, redaction, and the sharing disclosure; batching, retry, queueing, and loss policy belong to the backend's SDK and stop at `emit()`. Every mounted backend discloses its deployment-selected sharing policy so acknowledgement surfaces can report whether and how a session is shared. The contract and capture behavior come first; the implementation internals live in a collapsible developer section below.
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
|
|
16
|
+
- [Use this package](#use-this-package)
|
|
17
|
+
- [Understand the implementation](#understand-the-implementation)
|
|
18
|
+
- [Further Exploration](#further-exploration)
|
|
19
|
+
- [Model Experience](#model-experience)
|
|
20
|
+
- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
|
|
21
|
+
- [Dev Note](#dev-note)
|
|
22
|
+
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## Use this package
|
|
27
|
+
|
|
28
|
+
As a deployment, choose a backend, mount it, and add redaction rules when records must not leave the process as captured. As a backend author, implement the three-member contract and compose the coordinator with a capture mode.
|
|
29
|
+
|
|
30
|
+
### Choosing and mounting a backend
|
|
31
|
+
|
|
32
|
+
Load exactly one backend plugin; it registers `ctx.sessionTelemetry` with the capture coordinator and its own delivery pipeline, and a duplicate load throws. The mounted backend discloses its sharing policy through the required [`sharing` member](#the-sharing-disclosure), which the `/feedback` acknowledgement renders; a consumer renders "not configured" only when no telemetry service is mounted.
|
|
33
|
+
|
|
34
|
+
### The backend contract
|
|
35
|
+
|
|
36
|
+
A backend implements three members: `emit(record)` must be a non-blocking enqueue because it runs synchronously on the session-event path; optional `flush()` is a fire-and-forget hint after a turn ends, which most backends omit in favor of their SDK's own batching schedule; `shutdown()` drains queued records and resolves when the SDK stops, and disposal awaits it. A backend that implements `flush()` must order concurrent flushes with the final `shutdown()` drain.
|
|
37
|
+
|
|
38
|
+
### What gets captured
|
|
39
|
+
|
|
40
|
+
Capture runs in one of two modes. `live` capture follows session events as they are appended, replays already-live sessions at mount time, and records lifecycle markers; `on-demand` capture reads the canonical session log only when the backend requests a prefix through `captureSession(session, throughSeq?)`. Ledger records mirror session events one to one except for one projection: only the first `assistant/chunk` of each `(turn, step)` ships, so `seq` gaps on the wire are routine and never a loss signal. Each record carries the event's complete data, minimal identity attributes, and a pre-mapped severity (`error` for `tool/result.isError`, `turn/end` error reasons, and `agent-error`; `info` otherwise).
|
|
41
|
+
|
|
42
|
+
### The sharing disclosure
|
|
43
|
+
|
|
44
|
+
<a id="the-sharing-disclosure"></a>
|
|
6
45
|
|
|
7
|
-
|
|
46
|
+
Every backend discloses its deployment-selected sharing policy through the seam's `sharing` vocabulary: `full` (every event is handed over as it happens), `feedback-only` (nothing is handed over until a `feedback/record` event releases the unreleased prefix), or `disabled` (nothing is handed over at all). The acknowledgement of a recorded feedback entry reports this status; the disclosure never claims delivery — handoff is the non-blocking enqueue, and batching, retry, and loss policy stay the backend SDK's.
|
|
8
47
|
|
|
9
|
-
|
|
48
|
+
### Redacting records
|
|
10
49
|
|
|
11
|
-
|
|
50
|
+
<a id="the-redact-waterfall"></a>
|
|
12
51
|
|
|
13
|
-
|
|
52
|
+
Every outbound record passes the `sessionTelemetry/record` waterfall immediately after projection. This package ships no rules: with no listener mounted, records reach the backend exactly as captured, so exported data is as clean as the rules a deployment mounts. Listeners stack by transforming `next()`'s return value; a throwing listener withholds that one record fail-closed. Redaction applies to the outbound copy only — the canonical session log is never rewritten.
|
|
14
53
|
|
|
15
|
-
|
|
54
|
+
-----
|
|
16
55
|
|
|
17
|
-
|
|
56
|
+
<a id="understand-the-implementation"></a>
|
|
57
|
+
## Understand the implementation
|
|
18
58
|
|
|
19
|
-
|
|
59
|
+
<details>
|
|
60
|
+
<summary>Implementation internals — click to expand</summary>
|
|
20
61
|
|
|
21
|
-
|
|
62
|
+
This section explains the capture design; the observable behavior is fully covered in [Use this package](#use-this-package).
|
|
22
63
|
|
|
23
|
-
|
|
64
|
+
### Design concept
|
|
24
65
|
|
|
25
|
-
|
|
66
|
+
The seam is built on one boundary: the harness's aspect ends at `emit()`. Capture, projection, redaction, and the handoff cursor live here; batching, retry, queueing, and loss policy are the reporting SDK's, deliberately not modelled or wrapped. The design and rejected alternatives are pinned in the [revival Agent Note](../../../.agents/notes/implemented/feature/2026-07-23-session-telemetry-otel-revival.md).
|
|
26
67
|
|
|
27
|
-
|
|
68
|
+
### Source map
|
|
28
69
|
|
|
29
|
-
|
|
70
|
+
| File | Role |
|
|
71
|
+
|---|---|
|
|
72
|
+
| [`src/index.ts`](src/index.ts) | Service Definition: `SessionTelemetryBackend`/`SessionTelemetrySink` contract, record vocabulary, `session-telemetry/record` waterfall declaration |
|
|
73
|
+
| [`src/coordinator.ts`](src/coordinator.ts) | Capture: live listeners, on-demand replay, chunk projection, redaction, handoff cursor, containment |
|
|
30
74
|
|
|
31
|
-
|
|
75
|
+
### Capture flow
|
|
32
76
|
|
|
33
|
-
|
|
77
|
+
Live capture registers, through the composing fiber's effects: `session/created` adopts the session and replays its log from the handoff cursor; `session/event` projects, deep-copies, redacts, and hands off with zero I/O; `session/flush` forwards the optional hint and returns void so the loop's awaited parallel never waits on telemetry; `session/disposed` captures the session's `shutdown` marker and retires it; `agent/error` is the one live-bus relay, because the session-event vocabulary intentionally has no operational-error record. Disposal captures shutdown markers for still-live sessions, then awaits the backend's `shutdown()`. On-demand capture registers only the disposal effect and reads the canonical log on request. Every synchronous handler runs inside containment so a failing backend or rule can never starve other listeners or reach the agent loop.
|
|
34
78
|
|
|
35
|
-
|
|
79
|
+
### The handoff cursor
|
|
36
80
|
|
|
81
|
+
A module-scope `WeakMap<Session, seq>` records, per session, the highest seq handed off (not delivered). Live capture advances it at append time; on-demand capture advances it only while handing a requested prefix. An uncaptured prefix remains solely in the canonical log, so a coordinator reload adds no telemetry-owned recovery state; a missing cursor safely degrades to re-handing from the session's construction boundary, absorbed by receiver-side dedupe on `(session.id, event.seq)`. This is a narrow, documented exception to the registrations-are-effects discipline: entries die with their sessions, the value is a monotonic watermark, and losing it is never an error. The accepted cost matches at-most-once delivery: a resumed session does not backfill records a previous process failed to deliver.
|
|
82
|
+
|
|
83
|
+
</details>
|
|
84
|
+
|
|
85
|
+
-----
|
|
86
|
+
|
|
87
|
+
<a id="further-exploration"></a>
|
|
88
|
+
## Further Exploration
|
|
89
|
+
|
|
90
|
+
Read these pages when the seam contract is not enough. They move from the shipped backend to the subsystem reference and the decision evidence.
|
|
91
|
+
|
|
92
|
+
- [OpenTelemetry telemetry backend](../session-telemetry-otel/README.md) — the shipped backend deployments load, with mode and exporter configuration.
|
|
93
|
+
- [Session telemetry subsystem](../../../docs/subsystems/session-telemetry.md) — the capability split and type declarations.
|
|
94
|
+
- [Session telemetry revival decision](../../../.agents/notes/implemented/feature/2026-07-23-session-telemetry-otel-revival.md) — rationale, trade-offs, and rejected alternatives.
|
|
95
|
+
- [Session package map](../README.md) — adjacent persistence, projection, title, and telemetry packages.
|
|
96
|
+
|
|
97
|
+
-----
|
|
98
|
+
|
|
99
|
+
<a id="model-experience"></a>
|
|
37
100
|
## Model Experience
|
|
38
101
|
|
|
39
|
-
None, as
|
|
102
|
+
None, as the seam observes the session stream and hands redacted copies outward; it registers nothing model-facing.
|
|
40
103
|
|
|
41
104
|
#### KV Cache effect
|
|
42
105
|
|
|
43
|
-
None;
|
|
106
|
+
None; the package neither assembles nor sends a provider request.
|
|
44
107
|
|
|
45
108
|
## Known Limitations and Deferred Work
|
|
46
109
|
|
|
47
|
-
|
|
110
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
These limits define the delivery and data-protection guarantees a deployment gets. They are current package constraints.
|
|
114
|
+
|
|
115
|
+
- **Best-effort delivery** — the cursor marks handed-off, not delivered; a session torn down inside a reload window cannot be re-adopted, and whatever sits in a backend queue at crash time is lost. A durable outbox (spool, per-sink cursors, at-least-once) is deferred until a deployment states a crash-loss requirement.
|
|
48
116
|
- **No built-in redaction rules** — with no `sessionTelemetry/record` listener mounted, records leave the process exactly as captured, including any credentials embedded in file contents or command output; a deployment exporting to a shared collector owns its rule set.
|
|
49
|
-
- **On-demand redaction uses current state** — uncaptured events exist only in the canonical session log
|
|
117
|
+
- **On-demand redaction uses current state** — uncaptured events exist only in the canonical session log; a later `captureSession()` deep-copies and redacts their current values with the policy mounted at that time, and there is no capture-time telemetry snapshot or durable pre-capture spool.
|
|
118
|
+
|
|
119
|
+
<a id="dev-note"></a>
|
|
120
|
+
### Dev Note
|
|
121
|
+
|
|
122
|
+
<details>
|
|
123
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
124
|
+
|
|
125
|
+
None.
|
|
126
|
+
|
|
127
|
+
</details>
|
package/README.zh.md
CHANGED
|
@@ -1,53 +1,127 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "面向部署方与后端作者的会话遥测捕获 seam 说明,用于选择上报后端、挂载脱敏规则或实现后端约定。"
|
|
3
|
+
kind: "package-library"
|
|
4
|
+
---
|
|
5
|
+
|
|
1
6
|
# @deepseek-ai/dsh-session-telemetry
|
|
2
7
|
|
|
3
8
|
[English](README.md) | 中文
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
## 概述
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
`dsh-session-telemetry` 捕获会话活动用于对外上报:它把会话事件投影为遥测记录,允许部署方脱敏,再交给实现其约定的上报后端。部署方不直接加载本包——它们只加载一个后端(随附的 OpenTelemetry 后端是 `dsh-session-telemetry-otel`),由它注册 `ctx.sessionTelemetry` 并组装捕获协调器。seam 拥有捕获、脱敏与共享披露;批处理、重试、排队与丢失策略属于后端自身的 SDK,止于 `emit()`。每个已挂载后端都披露其部署级共享策略,使确认 surface 能够报告会话是否以及如何被共享。约定与捕获行为在前;实现内部细节放在下方可折叠的开发者章节中。
|
|
8
13
|
|
|
9
|
-
|
|
14
|
+
## 目录
|
|
10
15
|
|
|
11
|
-
|
|
16
|
+
- [使用本包](#use-this-package)
|
|
17
|
+
- [理解实现](#understand-the-implementation)
|
|
18
|
+
- [进一步探索](#further-exploration)
|
|
19
|
+
- [模型体验](#model-experience)
|
|
20
|
+
- [已知限制与延期工作](#known-limitations-and-deferred-work)
|
|
21
|
+
- [开发备注](#dev-note)
|
|
12
22
|
|
|
13
|
-
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## 使用本包
|
|
27
|
+
|
|
28
|
+
作为部署方,选择一个后端并挂载它,当记录不能以捕获原样离开进程时添加脱敏规则。作为后端作者,实现三成员约定,并以一种捕获模式组装协调器。
|
|
14
29
|
|
|
15
|
-
|
|
30
|
+
### 选择并挂载后端
|
|
16
31
|
|
|
17
|
-
|
|
32
|
+
只加载一个后端插件;它把捕获协调器与自己的投递流水线注册为 `ctx.sessionTelemetry`,重复加载会抛出异常。已挂载后端通过必需的 [`sharing` 成员](#the-sharing-disclosure) 披露共享策略,`/feedback` 的确认文本会渲染它;只有在未挂载任何遥测服务时,消费方才渲染「未配置」。
|
|
18
33
|
|
|
19
|
-
|
|
34
|
+
### 后端约定
|
|
20
35
|
|
|
21
|
-
|
|
36
|
+
后端实现三个成员:`emit(record)` 必须是非阻塞入队,因为它会在会话事件路径上同步执行;可选的 `flush()` 是轮次结束后的即发即忘提示,多数后端为了遵循 SDK 自身的批处理计划而省略它;`shutdown()` 排空已入队记录,并在 SDK 停止后结束,dispose(资源释放)会等待它。实现 `flush()` 的后端必须安排并发 flush 与最终 `shutdown()` 排空的先后顺序。
|
|
37
|
+
|
|
38
|
+
### 捕获内容
|
|
39
|
+
|
|
40
|
+
捕获以两种模式之一运行。`live` 捕获在追加时跟随会话事件、在挂载时回放已存活会话并记录生命周期标记;`on-demand` 捕获只在后端通过 `captureSession(session, throughSeq?)` 请求前缀时读取权威会话日志。ledger 记录与会话事件一一对应,唯有一个投影例外:每个 `(turn, step)` 只发出第一条 `assistant/chunk`,因此导出流中的 `seq` 缺口是常态,绝不是丢失信号。每条记录携带事件的完整数据、最小身份属性与预先映射的严重级别(`tool/result.isError`、`turn/end` 的错误原因与 `agent-error` 映射为 `error`;其余为 `info`)。
|
|
41
|
+
|
|
42
|
+
### 共享披露
|
|
43
|
+
|
|
44
|
+
<a id="the-sharing-disclosure"></a>
|
|
45
|
+
|
|
46
|
+
每个后端都通过 seam 的 `sharing` 词汇披露其部署级共享策略:`full`(每个事件在发生时立即交接)、`feedback-only`(在 `feedback/record` 事件释放其之前的未释放前缀之前,不交接任何内容)或 `disabled`(完全不交接任何内容)。已记录反馈条目的确认文本会报告该状态;披露从不声称投递——交接是非阻塞入队,批处理、重试与丢失策略仍归后端 SDK。
|
|
47
|
+
|
|
48
|
+
### 脱敏记录
|
|
22
49
|
|
|
23
50
|
<a id="the-redact-waterfall"></a>
|
|
24
51
|
|
|
25
|
-
|
|
52
|
+
每条外发记录在投影后立即经过 `sessionTelemetry/record` waterfall(瀑布式事件)。本包不带任何规则:未挂载监听器时,记录以捕获时的原样到达后端,因此导出数据能干净到什么程度,恰恰取决于部署方挂载了什么规则。监听器通过变换 `next()` 的返回值来堆叠;抛出异常的监听器以 fail-closed 方式拦下这一条记录。脱敏只作用于外发副本——权威会话日志永不改写。
|
|
53
|
+
|
|
54
|
+
-----
|
|
55
|
+
|
|
56
|
+
<a id="understand-the-implementation"></a>
|
|
57
|
+
## 理解实现
|
|
58
|
+
|
|
59
|
+
<details>
|
|
60
|
+
<summary>实现细节——点击展开</summary>
|
|
61
|
+
|
|
62
|
+
本节解释捕获设计;可观察行为已在[使用本包](#use-this-package)中完整说明。
|
|
26
63
|
|
|
27
|
-
|
|
64
|
+
### 设计理念
|
|
28
65
|
|
|
29
|
-
|
|
66
|
+
seam 建立在一个边界之上:harness 的职责止于 `emit()`。捕获、投影、脱敏与 handoff 游标都在这里;批处理、重试、排队与丢失策略属于上报 SDK,本包有意不建模也不包装。设计与被否决的替代方案见[复活 Agent Note](../../../.agents/notes/implemented/feature/2026-07-23-session-telemetry-otel-revival.zh.md)。
|
|
30
67
|
|
|
31
|
-
|
|
68
|
+
### 源码地图
|
|
32
69
|
|
|
33
|
-
|
|
70
|
+
| 文件 | 职责 |
|
|
71
|
+
|---|---|
|
|
72
|
+
| [`src/index.ts`](src/index.ts) | Service Definition:`SessionTelemetryBackend`/`SessionTelemetrySink` 约定、记录词汇、`session-telemetry/record` waterfall 声明 |
|
|
73
|
+
| [`src/coordinator.ts`](src/coordinator.ts) | 捕获:live 监听器、on-demand 回放、分片投影、脱敏、handoff 游标、异常隔离 |
|
|
34
74
|
|
|
35
|
-
|
|
75
|
+
### 捕获流程
|
|
36
76
|
|
|
37
|
-
|
|
77
|
+
live 捕获通过组合方 fiber 的 effect 注册:`session/created` 收养会话并从 handoff 游标起回放其日志;`session/event` 投影、深拷贝、脱敏并交接,零 I/O;`session/flush` 转发可选的提示并返回 void,使循环所等待的并行任务绝不等待遥测;`session/disposed` 捕获会话的 `shutdown` 标记并退役它;`agent/error` 是唯一的实时总线转发,因为会话事件词汇有意不包含运维错误记录。dispose 会为仍存活的会话捕获 shutdown 标记,然后等待后端的 `shutdown()`。on-demand 捕获只注册 dispose effect,并在请求时读取权威日志。每个同步处理器都运行在异常隔离之内,使失败的后端或规则永远不会饿死其他监听器,也永远不会触及 agent loop。
|
|
38
78
|
|
|
39
|
-
|
|
79
|
+
### handoff 游标
|
|
40
80
|
|
|
81
|
+
一个模块作用域的 `WeakMap<Session, seq>` 按会话记录已交接(而非已投递)的最高 seq。live 捕获在追加时推进它;on-demand 捕获只在交接所请求的前缀时推进它。未捕获的前缀只留在权威日志中,因此协调器重载不会增加遥测自有的恢复状态;游标缺失时安全退化为从会话构造边界起重新交接,由接收端基于 `(session.id, event.seq)` 的去重吸收。这是对「注册即 effect」纪律的一次有意的、有文档说明的窄例外:条目随其会话消亡,值是单调水位线,丢失它绝不是错误。由此接受的代价与至多一次(at-most-once)投递一致:恢复的会话不会回填上一个进程未能投递的记录。
|
|
82
|
+
|
|
83
|
+
</details>
|
|
84
|
+
|
|
85
|
+
-----
|
|
86
|
+
|
|
87
|
+
<a id="further-exploration"></a>
|
|
88
|
+
## 进一步探索
|
|
89
|
+
|
|
90
|
+
当 seam 约定不够用时阅读以下页面。它们从随附后端逐步进入子系统参考与决策证据。
|
|
91
|
+
|
|
92
|
+
- [OpenTelemetry 遥测后端](../session-telemetry-otel/README.zh.md)——部署方加载的随附后端,含模式与导出器配置。
|
|
93
|
+
- [会话遥测子系统](../../../docs/subsystems/session-telemetry.zh.md)——能力拆分与类型声明。
|
|
94
|
+
- [会话遥测复活决策](../../../.agents/notes/implemented/feature/2026-07-23-session-telemetry-otel-revival.zh.md)——理由、权衡与被否决的替代方案。
|
|
95
|
+
- [会话包映射](../README.zh.md)——相邻的持久化、投影、标题与遥测包。
|
|
96
|
+
|
|
97
|
+
-----
|
|
98
|
+
|
|
99
|
+
<a id="model-experience"></a>
|
|
41
100
|
## 模型体验
|
|
42
101
|
|
|
43
|
-
|
|
102
|
+
无,因为该 seam 观察会话流并把脱敏后的副本交给外部;它不注册任何面向模型的内容。
|
|
44
103
|
|
|
45
104
|
#### KV Cache 影响
|
|
46
105
|
|
|
47
106
|
无;本包既不组装也不发送提供方请求。
|
|
48
107
|
|
|
49
|
-
##
|
|
108
|
+
## 已知限制与延期工作
|
|
109
|
+
|
|
110
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
这些限制定义部署方能得到的投递与数据保护保证。它们是当前包约束。
|
|
114
|
+
|
|
115
|
+
- **尽力而为的投递**——游标标记的是已交接而非已投递;在重载窗口内被拆除的会话无法重新收养,崩溃时留在后端队列中的内容会丢失。持久化 outbox(spool、每 sink 游标、at-least-once)推迟到有部署方提出明确的崩溃丢失要求时再实现。
|
|
116
|
+
- **不内置脱敏规则**——未挂载 `sessionTelemetry/record` 监听器时,记录以捕获时的原样离开进程,包括文件内容或命令输出中内嵌的任何凭据;向共享 collector 导出的部署方自行负责其规则集。
|
|
117
|
+
- **按需脱敏使用当前状态**——未捕获的事件只存在于权威会话日志中;后续的 `captureSession()` 会使用当时挂载的策略,深拷贝并脱敏其当前值,且不存在捕获时的遥测快照或持久化的捕获前 spool。
|
|
118
|
+
|
|
119
|
+
<a id="dev-note"></a>
|
|
120
|
+
### 开发备注
|
|
121
|
+
|
|
122
|
+
<details>
|
|
123
|
+
<summary>维护者的工作上下文——点击展开</summary>
|
|
124
|
+
|
|
125
|
+
无。
|
|
50
126
|
|
|
51
|
-
|
|
52
|
-
- **不内置脱敏规则**:未挂载 `sessionTelemetry/record` 监听器时,记录以捕获时的原样离开进程,包括文件内容或命令输出中内嵌的任何凭据;向共享 collector 导出的部署方自行负责其规则集。
|
|
53
|
-
- **按需脱敏使用当前状态**:未捕获的事件只存在于权威会话日志中。后续的 `captureSession()` 会使用当时挂载的策略,深拷贝并脱敏其当前值;不存在捕获时的遥测快照或持久化的捕获前 spool。
|
|
127
|
+
</details>
|
package/lib/index.js
CHANGED
|
@@ -130,8 +130,8 @@ var SessionTelemetryCoordinator = class {
|
|
|
130
130
|
* at or below the start still feed the projection state (first-chunk
|
|
131
131
|
* tracking) without being re-handed, so a resumed fiber drops mid-step
|
|
132
132
|
* chunk continuations exactly like the fiber that saw the step begin. The
|
|
133
|
-
* cost, accepted with the capture contract's at-most-once stance: a resume
|
|
134
|
-
*
|
|
133
|
+
* cost, accepted with the capture contract's at-most-once stance: a resume
|
|
134
|
+
* does not backfill records a previous process failed to deliver.
|
|
135
135
|
* @param session - the live session to adopt; a second adoption is a no-op.
|
|
136
136
|
*/
|
|
137
137
|
adopt(session) {
|
|
@@ -72,8 +72,8 @@ export declare class SessionTelemetryCoordinator {
|
|
|
72
72
|
* at or below the start still feed the projection state (first-chunk
|
|
73
73
|
* tracking) without being re-handed, so a resumed fiber drops mid-step
|
|
74
74
|
* chunk continuations exactly like the fiber that saw the step begin. The
|
|
75
|
-
* cost, accepted with the capture contract's at-most-once stance: a resume
|
|
76
|
-
*
|
|
75
|
+
* cost, accepted with the capture contract's at-most-once stance: a resume
|
|
76
|
+
* does not backfill records a previous process failed to deliver.
|
|
77
77
|
* @param session - the live session to adopt; a second adoption is a no-op.
|
|
78
78
|
*/
|
|
79
79
|
private adopt;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -126,9 +126,8 @@ export interface SessionTelemetrySink {
|
|
|
126
126
|
/**
|
|
127
127
|
* Deployment-selected session-sharing policy disclosed by a mounted
|
|
128
128
|
* {@link SessionTelemetryBackend} backend to human-facing acknowledgement surfaces (the
|
|
129
|
-
* `/feedback` command's confirmation text). The
|
|
130
|
-
*
|
|
131
|
-
* the values mirror the OTel backend's serialized `SessionTelemetryMode` choices.
|
|
129
|
+
* `/feedback` command's confirmation text). The Service Definition owns the
|
|
130
|
+
* vocabulary so consumers and backends do not depend on a specific provider.
|
|
132
131
|
*/
|
|
133
132
|
export type SessionTelemetrySharingStatus = 'full' | 'feedback-only' | 'disabled';
|
|
134
133
|
/**
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-session-telemetry",
|
|
3
3
|
"description": "SessionTelemetryBackend seam for the DeepSeek Harness: session-event capture, projection, redaction, and handoff to a reporting backend",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.2-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "MIT",
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
36
|
-
"@deepseek-ai/dsh-
|
|
37
|
-
"@deepseek-ai/
|
|
38
|
-
"@deepseek-ai/
|
|
35
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
|
|
36
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.2",
|
|
37
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
38
|
+
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@deepseek-ai/dsh-agent": "^0.1.
|
|
42
|
-
"@deepseek-ai/dsh-invariants": "^0.1.
|
|
43
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
44
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
41
|
+
"@deepseek-ai/dsh-agent": "^0.1.2-alpha.2",
|
|
42
|
+
"@deepseek-ai/dsh-invariants": "^0.1.2-alpha.2",
|
|
43
|
+
"@deepseek-ai/dsh-session": "^0.1.2-alpha.2",
|
|
44
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
45
45
|
}
|
|
46
46
|
}
|