@deepseek-ai/dsh-session-telemetry 0.0.1-rc.1 → 0.0.1-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 +6 -0
- package/README.zh.md +8 -0
- package/lib/types/index.d.ts +16 -0
- package/package.json +8 -8
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: 707dcfcdb0c8dfbd622630351928ac43562535ec
|
|
6
|
+
README.zh.md: bd080adceebf83cd9e53d72a7093db376cf6cbd1
|
package/README.md
CHANGED
|
@@ -8,6 +8,12 @@ The telemetry Service Definition declares the `TelemetryBackend` contract, and i
|
|
|
8
8
|
|
|
9
9
|
`TelemetryBackend` has three members: `emit(record)` MUST enqueue without blocking because it runs synchronously during `session/event` or explicit canonical-log replay; optional `flush()` is a fire-and-forget hint after a turn ends, and most backends omit it and use their SDK's normal batching schedule; `shutdown()` drains queued records and resolves when the SDK stops, and disposal awaits it. An implementation that provides `flush()` must order concurrent flushes with the final `shutdown()` drain. `Telemetry` registers this API under the `telemetry` context key; each context accepts one implementation, and a duplicate load throws. A backend constructs `TelemetryCoordinator` with `live` or `on-demand` capture and calls `captureSession(session, throughSeq?)` at its chosen trigger.
|
|
10
10
|
|
|
11
|
+
The service also carries the required [`TelemetrySharingStatus`](#the-sharing-disclosure) `sharing` member: the deployment-selected sharing policy every backend must disclose to human-facing acknowledgement surfaces (the `/feedback` command's confirmation). A consumer renders "not configured" only when no telemetry service is mounted. The seam owns the vocabulary (`full` | `feedback-only` | `disabled`) so any backend can disclose a policy without depending on the OTel package.
|
|
12
|
+
|
|
13
|
+
## The sharing disclosure
|
|
14
|
+
|
|
15
|
+
The acknowledgement of a recorded feedback entry reports whether and how the session is shared, read from the mounted backend's `sharing`. A backend sets the property from its deployment configuration: `full` (every event is handed over as it happens), `feedback-only` (nothing is handed over until a `feedback/record` event releases the unreleased prefix through it), or `disabled` (nothing is handed over at all). Consumers map the status onto user-facing copy; the disclosure never claims delivery — handoff is the non-blocking enqueue, and batching, retry, and loss policy stay the backend SDK's.
|
|
16
|
+
|
|
11
17
|
## Capture points
|
|
12
18
|
|
|
13
19
|
In `live` mode the coordinator registers, all through the composing fiber's effects: `session/created` (adopt: record the header, read the log back through the projection from the construction boundary — constructor seeds from fork/resume never re-emit on the firehose and never re-export), `session/event` (project, deep-copy, redact, then hand off; zero I/O), `session/flush` (forward the optional `flush()` hint and return void — the loop's awaited parallel must never wait on telemetry), `session/disposed` (capture the session's `shutdown` operational record at its termination edge, then retire it), `agent/error` (the one live-bus relay; the session event vocabulary intentionally has no operational-error record), a dispose effect (capture shutdown for each still-live session, then await the backend's `shutdown()`; failures warn instead of throwing), and an adoption sweep of `ctx.sessions.list()` (a hot reload does not replay `session/created`). In `on-demand` mode it registers only the dispose effect: `captureSession()` reads the canonical log through an optional inclusive sequence boundary, while flush hints and operational events remain local.
|
package/README.zh.md
CHANGED
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
`TelemetryBackend` 有三个成员:`emit(record)` 必须入队且不能阻塞,因为它会在 `session/event` 或显式权威日志回放期间同步执行;可选的 `flush()` 是轮次结束后的提示,调用方不等待结果,多数后端省略它并使用 SDK 的常规批处理计划;`shutdown()` 排空已入队记录,并在 SDK 停止后结束,dispose(资源释放)会等待它。提供 `flush()` 的实现必须安排并发 flush 与 `shutdown()` 最终排空的先后顺序。`Telemetry` 将此 API 注册在 `telemetry` 上下文键下:每个上下文只允许一个实现,重复加载会抛出异常。后端以 `live` 或 `on-demand` 捕获构造 `TelemetryCoordinator`,并在自己选择的触发器中调用 `captureSession(session, throughSeq?)`。
|
|
10
10
|
|
|
11
|
+
该服务还携带必需的 [`TelemetrySharingStatus`](#the-sharing-disclosure) `sharing` 成员:每个后端都必须向面向用户的确认 surface(`/feedback` 命令的确认文本)披露的部署级共享策略。消费方只有在未挂载任何遥测服务时才渲染「未配置」。seam 拥有该词汇(`full` | `feedback-only` | `disabled`),因此任何后端都可以披露策略,而无需依赖 OTel 包。
|
|
12
|
+
|
|
13
|
+
<a id="the-sharing-disclosure"></a>
|
|
14
|
+
|
|
15
|
+
## 共享披露
|
|
16
|
+
|
|
17
|
+
一条已记录的反馈条目的确认文本会报告该会话是否以及如何被共享,读取自已挂载后端的 `sharing`。后端根据其部署配置设置该属性:`full`(每个事件在发生时立即交接)、`feedback-only`(在 `feedback/record` 事件释放其之前的未释放前缀之前,不交接任何内容)或 `disabled`(完全不交接任何内容)。消费方把状态映射为面向用户的文案;披露从不声称投递——交接是非阻塞入队,批处理、重试与丢失策略仍归后端 SDK。
|
|
18
|
+
|
|
11
19
|
## 捕获点
|
|
12
20
|
|
|
13
21
|
在 `live` 模式中,协调器的全部注册都经由组合方 fiber 的 effect 完成:`session/created`(收养:记录 header,并经投影从构造边界起回读日志;来自 fork 或恢复的构造函数种子绝不会在 firehose 上再次发出,也绝不会再次导出)、`session/event`(投影、深拷贝、脱敏,再交接;零 I/O)、`session/flush`(转发可选的 `flush()` 提示并返回 void;循环所等待的并行任务绝不能等待遥测)、`session/disposed`(在会话自身的终止边缘捕获该会话的 `shutdown` 运维记录,然后将其退役)、`agent/error`(唯一的实时总线转发;会话事件词汇有意不包含运维错误记录)、一个 dispose effect(捕获每个仍存活会话的 shutdown,再等待后端的 `shutdown()`;失败只发出警告而不抛出),以及对 `ctx.sessions.list()` 的收养扫描(热重载不会重放 `session/created`)。在 `on-demand` 模式中,协调器只注册 dispose effect:`captureSession()` 读取权威日志,直至可选的序列号边界(含边界);flush 提示与运维事件留在本地。
|
package/lib/types/index.d.ts
CHANGED
|
@@ -123,6 +123,14 @@ export interface TelemetryBackend {
|
|
|
123
123
|
*/
|
|
124
124
|
shutdown(): Promise<void>;
|
|
125
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Deployment-selected session-sharing policy disclosed by a mounted
|
|
128
|
+
* {@link Telemetry} backend to human-facing acknowledgement surfaces (the
|
|
129
|
+
* `/feedback` command's confirmation text). The seam owns the vocabulary so
|
|
130
|
+
* any backend can disclose a policy without depending on the OTel package;
|
|
131
|
+
* the values mirror the OTel backend's serialized `TelemetryMode` choices.
|
|
132
|
+
*/
|
|
133
|
+
export type TelemetrySharingStatus = 'full' | 'feedback-only' | 'disabled';
|
|
126
134
|
/**
|
|
127
135
|
* Loadable form of the backend contract: one implementation per context —
|
|
128
136
|
* the cordis `Service` registration under the `telemetry` key throws on a
|
|
@@ -131,6 +139,14 @@ export interface TelemetryBackend {
|
|
|
131
139
|
*/
|
|
132
140
|
export declare abstract class Telemetry extends Service implements TelemetryBackend {
|
|
133
141
|
constructor(ctx: Context);
|
|
142
|
+
/**
|
|
143
|
+
* Deployment-selected session-sharing policy, disclosed for acknowledgement
|
|
144
|
+
* surfaces that report whether recorded feedback leaves the process. Every
|
|
145
|
+
* backend must disclose its policy; a consumer renders "not configured" only
|
|
146
|
+
* when no telemetry service is mounted. The seam owns this vocabulary so the
|
|
147
|
+
* disclosure is backend-independent.
|
|
148
|
+
*/
|
|
149
|
+
abstract readonly sharing: TelemetrySharingStatus;
|
|
134
150
|
/**
|
|
135
151
|
* See {@link TelemetryBackend.emit} — that declaration is the contract's one home.
|
|
136
152
|
* @param record - the logical record to report; owned by the backend after the call.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-session-telemetry",
|
|
3
3
|
"description": "Telemetry seam for the DeepSeek Harness: session-event capture, projection, redaction, and handoff to a reporting backend",
|
|
4
|
-
"version": "0.0.1-rc.
|
|
4
|
+
"version": "0.0.1-rc.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "restricted"
|
|
7
7
|
},
|
|
@@ -32,15 +32,15 @@
|
|
|
32
32
|
],
|
|
33
33
|
"license": "BSD-3-Clause",
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"@deepseek-ai/dsh-agent": "^0.0.1-rc.
|
|
36
|
-
"@deepseek-ai/dsh-
|
|
37
|
-
"@deepseek-ai/
|
|
38
|
-
"@deepseek-ai/
|
|
35
|
+
"@deepseek-ai/dsh-agent": "^0.0.1-rc.2",
|
|
36
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.2",
|
|
37
|
+
"@deepseek-ai/dsh-session": "^0.0.1-rc.2",
|
|
38
|
+
"@deepseek-ai/cordis": "^4.0.1-rc.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@deepseek-ai/dsh-
|
|
42
|
-
"@deepseek-ai/dsh-
|
|
43
|
-
"@deepseek-ai/dsh-
|
|
41
|
+
"@deepseek-ai/dsh-agent": "^0.0.1-rc.2",
|
|
42
|
+
"@deepseek-ai/dsh-invariants": "^0.0.1-rc.2",
|
|
43
|
+
"@deepseek-ai/dsh-session": "^0.0.1-rc.2",
|
|
44
44
|
"@deepseek-ai/cordis": "^4.0.1-rc.1"
|
|
45
45
|
}
|
|
46
46
|
}
|