@deepseek-ai/dsh-anonymous-user-id 0.1.5-rc.2 → 0.1.6-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 +3 -3
- package/README.zh.md +10 -10
- package/package.json +6 -6
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/identity/anonymous-user-id/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: c1c6950e7e51dd9cc52847dd9a3d59d6a3d0a7ee
|
|
6
|
+
README.zh.md: d533c1d1de5c68ff8f8c143fa678a83d26a36d12
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ English | [中文](README.zh.md)
|
|
|
9
9
|
|
|
10
10
|
## Summary
|
|
11
11
|
|
|
12
|
-
DeepSeek Harness uses one anonymous identifier per harness home to correlate telemetry, feedback, and DeepSeek requests from the same installation without identifying the user. The random UUID is stored in `$DSH_HOME/.anonymous-user-id` (`~/.dsh`
|
|
12
|
+
DeepSeek Harness uses one anonymous identifier per harness home to correlate telemetry, feedback, and DeepSeek requests from the same installation without identifying the user. The random UUID is stored in `$DSH_HOME/.anonymous-user-id` (`$DSH_HOME` defaults to `~/.dsh`), persists across restarts, and is regenerated after you delete the file. Different harness homes use different identifiers, and the value contains no machine or account data. Built-in features create and attach it automatically; package consumers can reuse the same value for installation-scoped correlation, but cannot join records across homes.
|
|
13
13
|
|
|
14
14
|
## Table of Contents
|
|
15
15
|
|
|
@@ -37,7 +37,7 @@ Three things your installation sends out carry the same id, so records line up a
|
|
|
37
37
|
|
|
38
38
|
### Observing and resetting the id
|
|
39
39
|
|
|
40
|
-
The id lives in `$DSH_HOME/.anonymous-user-id` (`~/.dsh`
|
|
40
|
+
The id lives in `$DSH_HOME/.anonymous-user-id` (`$DSH_HOME` defaults to `~/.dsh`) as a plain UUID text file. Delete that file to get a fresh id at the next launch; the running process keeps its current id until it exits. Separate harness homes keep separate ids, and no machine or account detail ever goes into the value.
|
|
41
41
|
|
|
42
42
|
### Using it in your own package
|
|
43
43
|
|
|
@@ -64,7 +64,7 @@ This section explains the design decisions behind the package and points at the
|
|
|
64
64
|
### Design philosophy
|
|
65
65
|
|
|
66
66
|
- **Random, never derived.** The id comes from `crypto.randomUUID()`; it is never derived from the hostname, network address, git remote, or any other identifying source, so anonymity is a property of the mint.
|
|
67
|
-
- **Synchronous and memoized.** One process touches
|
|
67
|
+
- **Synchronous and memoized.** One process touches each resolved file path once: reads and writes are synchronous, and the result is memoized per resolved file path.
|
|
68
68
|
- **Best-effort persistence.** A write failure still returns a usable id for the run, so telemetry and feedback never block on an unwritable home.
|
|
69
69
|
- **Library, not plugin.** There is no Cordis plugin entry or config. No invariant companion is published because the package owns no event stream or public mutable relation to compare without creating the id as a side effect.
|
|
70
70
|
|
package/README.zh.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: "
|
|
2
|
+
description: "面向用户与维护者的按 harness home 划分的匿名身份说明,用于追踪遥测、反馈确认与 DeepSeek 提供方请求如何关联记录。"
|
|
3
3
|
kind: "package-library"
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -9,7 +9,7 @@ kind: "package-library"
|
|
|
9
9
|
|
|
10
10
|
## 概述
|
|
11
11
|
|
|
12
|
-
DeepSeek Harness 为每个 harness home 使用一个匿名标识符,以关联同一套安装产生的遥测、反馈与 DeepSeek 请求,同时不识别用户身份。该随机 UUID 存储在 `$DSH_HOME/.anonymous-user-id
|
|
12
|
+
DeepSeek Harness 为每个 harness home 使用一个匿名标识符,以关联同一套安装产生的遥测、反馈与 DeepSeek 请求,同时不识别用户身份。该随机 UUID 存储在 `$DSH_HOME/.anonymous-user-id`(`$DSH_HOME` 默认为 `~/.dsh`)中,可跨重启保留,并在你删除文件后重新生成。不同 harness home 使用不同的标识符,且该值不包含机器或账户数据。内置功能会自动创建并附加该值;包消费方可以复用同一个值进行安装范围的关联,但无法跨 home 关联记录。
|
|
13
13
|
|
|
14
14
|
## 目录
|
|
15
15
|
|
|
@@ -32,16 +32,16 @@ DeepSeek Harness 为每个 harness home 使用一个匿名标识符,以关联
|
|
|
32
32
|
你的安装外发的三类内容携带同一个 id,因此记录在它们之间可以相互对应:
|
|
33
33
|
|
|
34
34
|
- **会话遥测**——你的遥测导出会以 `user.id` Resource 属性携带该 id,采集器因此可以按安装分组记录。
|
|
35
|
-
-
|
|
35
|
+
- **反馈**——每条反馈确认都会标明记录该反馈的匿名安装。
|
|
36
36
|
- **DeepSeek 请求**——每次提供方请求都会携带 `x-deepseek-harness-user-id` 标头,因此可以按安装归因用量。
|
|
37
37
|
|
|
38
38
|
### 查看与重置 id
|
|
39
39
|
|
|
40
|
-
该 id 存放在 `$DSH_HOME/.anonymous-user-id
|
|
40
|
+
该 id 存放在 `$DSH_HOME/.anonymous-user-id`(`$DSH_HOME` 默认为 `~/.dsh`)中,是一个纯 UUID 文本文件。删除该文件即可在下次启动时获得全新 id;正在运行的进程在退出前会一直保留当前 id。不同 harness home 各自保留独立 id,值中永远不会包含任何机器或账户信息。
|
|
41
41
|
|
|
42
42
|
### 在自己的包中使用
|
|
43
43
|
|
|
44
|
-
当你构建的功能需要共享该安装的匿名 id
|
|
44
|
+
当你构建的功能需要共享该安装的匿名 id 时,导入一次并复用该值即可——遥测、反馈与 DeepSeek 已经在使用同一个 id,因此你的记录能与它们相互对应:
|
|
45
45
|
|
|
46
46
|
```ts
|
|
47
47
|
import { getOrCreateAnonymousUserId } from '@deepseek-ai/dsh-anonymous-user-id'
|
|
@@ -64,7 +64,7 @@ const userId = getOrCreateAnonymousUserId() // stable for the process lifetime
|
|
|
64
64
|
### 设计理念
|
|
65
65
|
|
|
66
66
|
- **随机生成,绝不派生。** id 来自 `crypto.randomUUID()`;绝不从 hostname、网络地址、git remote 或任何其他可识别来源派生,因此匿名性是生成过程的属性。
|
|
67
|
-
- **同步且记忆化。**
|
|
67
|
+
- **同步且记忆化。** 一个进程对每个解析后的文件路径只触碰一次磁盘:读写都是同步的,结果按解析后的文件路径记忆化。
|
|
68
68
|
- **Best-effort 持久化。** 写入失败仍会为本次运行返回可用 id,遥测与反馈因此不会因 home 不可写而阻塞。
|
|
69
69
|
- **库而非插件。** 没有 Cordis 插件入口或配置。不发布不变式伴生入口,因为本包不拥有任何事件流或公开可变关系,无法在不产生创建 id 这一副作用的情况下比较。
|
|
70
70
|
|
|
@@ -73,8 +73,8 @@ const userId = getOrCreateAnonymousUserId() // stable for the process lifetime
|
|
|
73
73
|
| 文件 | 职责 |
|
|
74
74
|
|---|---|
|
|
75
75
|
| [`src/index.ts`](src/index.ts) | 库入口:`getOrCreateAnonymousUserId`、文件持久化、按路径记忆化 |
|
|
76
|
-
| — |
|
|
77
|
-
| [`tests/anonymous-user-id.spec.ts`](tests/anonymous-user-id.spec.ts) |
|
|
76
|
+
| — | 不发布运行时不变式伴生入口;该 API 仅拥有一个私有记忆化值和一个 best-effort 文件,不存在独立事件流或公开可变关系可供伴生入口在不产生创建身份这一副作用的情况下比较。 |
|
|
77
|
+
| [`tests/anonymous-user-id.spec.ts`](tests/anonymous-user-id.spec.ts) | 测试覆盖的行为:生成、持久化、损坏、并发、记忆化 |
|
|
78
78
|
|
|
79
79
|
### API
|
|
80
80
|
|
|
@@ -82,7 +82,7 @@ const userId = getOrCreateAnonymousUserId() // stable for the process lifetime
|
|
|
82
82
|
|
|
83
83
|
### 存储约定
|
|
84
84
|
|
|
85
|
-
文件是名为 `ANONYMOUS_USER_ID_FILE_NAME` 的裸 UUID 行,读取时按 UUID 模式校验。首个写入方使用独占创建(`wx
|
|
85
|
+
文件是名为 `ANONYMOUS_USER_ID_FILE_NAME` 的裸 UUID 行,读取时按 UUID 模式校验。首个写入方使用独占创建(`wx`);并发落败方重新读取并采用胜出方的值。遇到损坏或不可读的文件时,系统会转而生成新值并覆盖该文件。记忆化按解析后的文件路径为键,因此不同 home 永远不会共享 id。
|
|
86
86
|
|
|
87
87
|
</details>
|
|
88
88
|
|
|
@@ -121,7 +121,7 @@ const userId = getOrCreateAnonymousUserId() // stable for the process lifetime
|
|
|
121
121
|
- **删除后无法恢复**——文件丢失后会按设计生成新的匿名身份;恢复需要稳定的派生材料,这会削弱匿名性。
|
|
122
122
|
- **Best-effort 并发**——如果读取方恰好落在并发进程完成独占创建但尚未写完的狭窄时间窗内,本次运行可能使用不同的内存 UUID;后续启动会收敛到已持久化的值。
|
|
123
123
|
- **没有跨 home 身份**——不同 `$DSH_HOME` 值之间无法关联。
|
|
124
|
-
- **已配置的 DeepSeek
|
|
124
|
+
- **已配置的 DeepSeek 网关会收到该 id**——`dsh-llm-deepseek` 会把稳定标头发送至解析后的 `baseURL`(包括部署覆盖),且不受遥测共享模式影响。
|
|
125
125
|
- **删除文件不会重置当前进程**——记忆化会让本次运行的 id 一直保留到下次启动。
|
|
126
126
|
|
|
127
127
|
<a id="dev-note"></a>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-anonymous-user-id",
|
|
3
3
|
"description": "Shared anonymous user identity for DeepSeek Harness telemetry and feedback correlation",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6-alpha.2",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "MIT",
|
|
29
29
|
"peerDependencies": {
|
|
30
|
-
"@deepseek-ai/dsh-brand": "^0.1.
|
|
30
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2",
|
|
31
31
|
"@deepseek-ai/cordis": "^4.0.2",
|
|
32
|
-
"@deepseek-ai/dsh-home-paths": "^0.1.
|
|
32
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.6-alpha.2"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@deepseek-ai/dsh-
|
|
36
|
-
"@deepseek-ai/
|
|
37
|
-
"@deepseek-ai/
|
|
35
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.6-alpha.2",
|
|
36
|
+
"@deepseek-ai/cordis": "^4.0.2",
|
|
37
|
+
"@deepseek-ai/dsh-brand": "^0.1.6-alpha.2"
|
|
38
38
|
}
|
|
39
39
|
}
|