@agentunion/fastaun 0.2.20 → 0.3.1
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/CHANGELOG.md +63 -23
- package/_packed_docs/CHANGELOG.md +63 -23
- package/_packed_docs/design/2026-05-22-aun-rpc-trace-enhancement.md +542 -0
- package/_packed_docs/protocol/06-/346/234/215/345/212/241/345/215/217/350/256/256.md +1 -24
- package/_packed_docs/protocol/15-/347/246/273/347/272/277/346/216/250/351/200/201/351/200/232/347/237/245/345/215/217/350/256/256.md +419 -0
- package/_packed_docs/protocol/index.md +13 -3
- package/_packed_docs/python-sdk-v2-only-changelog.md +189 -0
- package/_packed_docs/sdk/04-/350/277/236/346/216/245/344/270/216/350/256/244/350/257/201.md +39 -16
- package/_packed_docs/sdk/06-API/346/211/213/345/206/214.md +131 -39
- package/_packed_docs/sdk/09-message-rpc-manual.md +30 -67
- package/dist/auth.js +26 -7
- package/dist/auth.js.map +1 -1
- package/dist/client.d.ts +117 -166
- package/dist/client.js +2130 -3419
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +0 -4
- package/dist/config.js +0 -4
- package/dist/config.js.map +1 -1
- package/dist/e2ee.d.ts +5 -139
- package/dist/e2ee.js +4 -1151
- package/dist/e2ee.js.map +1 -1
- package/dist/errors.d.ts +0 -8
- package/dist/errors.js +0 -14
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/keystore/aid-db.d.ts +12 -61
- package/dist/keystore/aid-db.js +41 -539
- package/dist/keystore/aid-db.js.map +1 -1
- package/dist/keystore/file.d.ts +5 -41
- package/dist/keystore/file.js +8 -64
- package/dist/keystore/file.js.map +1 -1
- package/dist/keystore/index.d.ts +1 -49
- package/dist/namespaces/auth.d.ts +8 -0
- package/dist/namespaces/auth.js +169 -2
- package/dist/namespaces/auth.js.map +1 -1
- package/dist/protected-headers.d.ts +13 -0
- package/dist/protected-headers.js +47 -0
- package/dist/protected-headers.js.map +1 -0
- package/dist/seq-tracker.d.ts +7 -2
- package/dist/seq-tracker.js +33 -13
- package/dist/seq-tracker.js.map +1 -1
- package/dist/transport.d.ts +11 -1
- package/dist/transport.js +255 -6
- package/dist/transport.js.map +1 -1
- package/dist/types.d.ts +0 -56
- package/dist/v2/crypto/aead.d.ts +20 -0
- package/dist/v2/crypto/aead.js +59 -0
- package/dist/v2/crypto/aead.js.map +1 -0
- package/dist/v2/crypto/canonical.d.ts +20 -0
- package/dist/v2/crypto/canonical.js +119 -0
- package/dist/v2/crypto/canonical.js.map +1 -0
- package/dist/v2/crypto/dh-path.d.ts +39 -0
- package/dist/v2/crypto/dh-path.js +55 -0
- package/dist/v2/crypto/dh-path.js.map +1 -0
- package/dist/v2/crypto/ecdh.d.ts +29 -0
- package/dist/v2/crypto/ecdh.js +122 -0
- package/dist/v2/crypto/ecdh.js.map +1 -0
- package/dist/v2/crypto/ecdsa.d.ts +29 -0
- package/dist/v2/crypto/ecdsa.js +120 -0
- package/dist/v2/crypto/ecdsa.js.map +1 -0
- package/dist/v2/crypto/hkdf.d.ts +19 -0
- package/dist/v2/crypto/hkdf.js +47 -0
- package/dist/v2/crypto/hkdf.js.map +1 -0
- package/dist/v2/crypto/index.d.ts +8 -0
- package/dist/v2/crypto/index.js +8 -0
- package/dist/v2/crypto/index.js.map +1 -0
- package/dist/v2/crypto/recipients.d.ts +32 -0
- package/dist/v2/crypto/recipients.js +183 -0
- package/dist/v2/crypto/recipients.js.map +1 -0
- package/dist/v2/e2ee/decrypt.d.ts +29 -0
- package/dist/v2/e2ee/decrypt.js +159 -0
- package/dist/v2/e2ee/decrypt.js.map +1 -0
- package/dist/v2/e2ee/encrypt-group.d.ts +17 -0
- package/dist/v2/e2ee/encrypt-group.js +143 -0
- package/dist/v2/e2ee/encrypt-group.js.map +1 -0
- package/dist/v2/e2ee/encrypt-p2p.d.ts +31 -0
- package/dist/v2/e2ee/encrypt-p2p.js +190 -0
- package/dist/v2/e2ee/encrypt-p2p.js.map +1 -0
- package/dist/v2/e2ee/index.d.ts +9 -0
- package/dist/v2/e2ee/index.js +9 -0
- package/dist/v2/e2ee/index.js.map +1 -0
- package/dist/v2/e2ee/metadata-auth.d.ts +15 -0
- package/dist/v2/e2ee/metadata-auth.js +50 -0
- package/dist/v2/e2ee/metadata-auth.js.map +1 -0
- package/dist/v2/e2ee/types.d.ts +57 -0
- package/dist/v2/e2ee/types.js +7 -0
- package/dist/v2/e2ee/types.js.map +1 -0
- package/dist/v2/session/index.d.ts +4 -0
- package/dist/v2/session/index.js +3 -0
- package/dist/v2/session/index.js.map +1 -0
- package/dist/v2/session/keystore.d.ts +50 -0
- package/dist/v2/session/keystore.js +138 -0
- package/dist/v2/session/keystore.js.map +1 -0
- package/dist/v2/session/session.d.ts +124 -0
- package/dist/v2/session/session.js +318 -0
- package/dist/v2/session/session.js.map +1 -0
- package/dist/v2/state/commitment.d.ts +58 -0
- package/dist/v2/state/commitment.js +85 -0
- package/dist/v2/state/commitment.js.map +1 -0
- package/dist/v2/state/index.d.ts +2 -0
- package/dist/v2/state/index.js +2 -0
- package/dist/v2/state/index.js.map +1 -0
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,63 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
本文件记录 `@agentunion/fastaun` (Node.js) SDK 的版本变更。最新版本在最前面。
|
|
4
|
-
|
|
5
|
-
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 0.
|
|
10
|
-
|
|
11
|
-
### Added
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- **
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
###
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
本文件记录 `@agentunion/fastaun` (Node.js) SDK 的版本变更。最新版本在最前面。
|
|
4
|
+
|
|
5
|
+
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 0.3.1 — 2026-05-22
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- **`auth.checkAid` handler**:本地证书自检(解析有效期、公钥)+ 远端注册状态查询;新增 `parseCertValidity` / `parseAsn1Time` ASN.1 时间解析
|
|
13
|
+
- **RPC trace 增强**:`RPCTransport` 增加 `setTraceMode()` / `setTraceObserver()`;`sortTraceSpansForDisplay` / `formatTraceTree` / `traceDisplay` 树状展示按 ts 排序 + 嵌套缩进;`TraceObserver` 类型导出
|
|
14
|
+
- **V2 群组 SPK 生命周期**:`V2KeyStore.saveGroupSPK` / `loadGroupSPK` / `loadCurrentGroupSPK`;`V2Session.ensureGroupRegistered` / `rotateGroupSPK` / `_publishGroupSPK`;`DESTROY_DELAY_MS = 7d`
|
|
15
|
+
- **V2 P2P push 解密**:`AUNClient._onV2PushNotification` / `_decryptV2PushMessage` 实现带 payload 的就地解密 + 失败回退到 pull
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- **`SeqTracker.forceContiguousSeq`**:原 `contiguousSeq = minSeq` 跳过空洞(会丢消息),改为 `contiguousSeq = minSeq - 1` 由连续前缀自然推进,避免误丢
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- **`client.ts:4026` 类型错误**:`_publishOrderedMessage` 的 `decrypted` 实参补 `as EventPayload` 断言(`Record<string, unknown>` 与 `JsonValue | Error` 不兼容)
|
|
22
|
+
- short RPC 请求增加 `debug` 完整报文日志,便于跨语言诊断
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 0.3.0 — 2026-05-21 ⚠️ BREAKING CHANGE
|
|
27
|
+
|
|
28
|
+
> **V2-only 版本**:移除全部 V1 E2EE(含群组加密),新增 V2 加密原语,API 不向后兼容。
|
|
29
|
+
|
|
30
|
+
### BREAKING
|
|
31
|
+
- **移除 V1 E2EE 全部实现**:`GroupE2EEManager`、V1 epoch key 逻辑全部删除
|
|
32
|
+
- **移除 V1 群组加密测试**:`e2ee.test.ts`、`e2ee-group.test.ts`、`epoch-key-server.spec.ts` 等
|
|
33
|
+
- **E2EE 接口简化**:`e2ee.ts` 仅保留 V2 路径,V1 加解密方法不再可用
|
|
34
|
+
- **配置变更**:`AUNConfig` 移除 V1 相关配置项
|
|
35
|
+
- **KeyStore 重构**:`keystore/` 目录结构调整,`aid-db.ts` / `file.ts` 接口变更
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- **agent.md 主 API**:`AUNClient.publishAgentMd(path)` / `AUNClient.fetchAgentMd(aid?, savePath?)`
|
|
39
|
+
- **V2 加密原语**(跨语言 golden vector 一致性):ECDH P-256、HKDF-SHA256、AES-256-GCM、ECDSA-SHA256 RAW (RFC 6979)、1DH/3DH wrap_key、Recipients Sort + Merkle Digest、State Commitment
|
|
40
|
+
|
|
41
|
+
### Removed
|
|
42
|
+
- `AUNClient.setLocalAgentMdPath()` / `getLocalAgentMdEtag()` / `getRemoteAgentMdEtag()` — 由主 API 自动维护
|
|
43
|
+
|
|
44
|
+
### Deprecated
|
|
45
|
+
- `client.auth.signAgentMd` / `verifyAgentMd` / `uploadAgentMd` / `downloadAgentMd` — 建议迁移到 `client.publishAgentMd` / `client.fetchAgentMd`
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 0.2.20 — 2026-05-18
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
- **agent.md 版本一致性 API**:`AUNClient.setLocalAgentMdPath(path)` / `getLocalAgentMdEtag()` / `getRemoteAgentMdEtag()`。Node 用 `fs.readFileSync` + `crypto.createHash` 计算 etag,浏览器场景返回空串并 warn。SDK 自动从 RPC envelope `_meta.agent_md_etag` 提取服务端 etag,应用层订阅 `message.received` / `group.message_created` 等事件时 payload 多 `_agent_md.{local_etag, remote_etag}` 字段供版本比对。
|
|
53
|
+
- **`downloadAgentMd` 条件请求缓存**:内部维护 ETag/Last-Modified,未变化时返回上次缓存内容;外部 API 形态不变。
|
|
54
|
+
- **transport meta observer**:`RPCTransport.setMetaObserver(fn)` 透传 envelope `_meta`,observer 抛错被吞,不影响 RPC result。
|
|
55
|
+
|
|
56
|
+
### Changed
|
|
57
|
+
- **RPC call 默认超时 10s → 35s**:与服务端 30s handler timeout 对齐,留 5s buffer。
|
|
58
|
+
- **multi-device 架构**:对端无 prekey 时 `_sendEncrypted` 直接抛错(`no registered device prekeys for ...`),不再降级到 `long_term_key`。
|
|
59
|
+
|
|
60
|
+
### Docs
|
|
61
|
+
- 仓库根 `docs/`(agent.md 规范、protocol、SDK 手册)随 npm tarball 打包到 `_packed_docs/`,安装后可读。`.gitignore` 排除项(如内部测试指南)不进包。
|
|
62
|
+
|
|
63
|
+
---
|
|
@@ -1,23 +1,63 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
本文件记录 `@agentunion/fastaun` (Node.js) SDK 的版本变更。最新版本在最前面。
|
|
4
|
-
|
|
5
|
-
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## 0.
|
|
10
|
-
|
|
11
|
-
### Added
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- **
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
|
|
20
|
-
###
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
本文件记录 `@agentunion/fastaun` (Node.js) SDK 的版本变更。最新版本在最前面。
|
|
4
|
+
|
|
5
|
+
格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/);版本号遵循 [SemVer](https://semver.org/lang/zh-CN/)。
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## 0.3.1 — 2026-05-22
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- **`auth.checkAid` handler**:本地证书自检(解析有效期、公钥)+ 远端注册状态查询;新增 `parseCertValidity` / `parseAsn1Time` ASN.1 时间解析
|
|
13
|
+
- **RPC trace 增强**:`RPCTransport` 增加 `setTraceMode()` / `setTraceObserver()`;`sortTraceSpansForDisplay` / `formatTraceTree` / `traceDisplay` 树状展示按 ts 排序 + 嵌套缩进;`TraceObserver` 类型导出
|
|
14
|
+
- **V2 群组 SPK 生命周期**:`V2KeyStore.saveGroupSPK` / `loadGroupSPK` / `loadCurrentGroupSPK`;`V2Session.ensureGroupRegistered` / `rotateGroupSPK` / `_publishGroupSPK`;`DESTROY_DELAY_MS = 7d`
|
|
15
|
+
- **V2 P2P push 解密**:`AUNClient._onV2PushNotification` / `_decryptV2PushMessage` 实现带 payload 的就地解密 + 失败回退到 pull
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- **`SeqTracker.forceContiguousSeq`**:原 `contiguousSeq = minSeq` 跳过空洞(会丢消息),改为 `contiguousSeq = minSeq - 1` 由连续前缀自然推进,避免误丢
|
|
19
|
+
|
|
20
|
+
### Fixed
|
|
21
|
+
- **`client.ts:4026` 类型错误**:`_publishOrderedMessage` 的 `decrypted` 实参补 `as EventPayload` 断言(`Record<string, unknown>` 与 `JsonValue | Error` 不兼容)
|
|
22
|
+
- short RPC 请求增加 `debug` 完整报文日志,便于跨语言诊断
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 0.3.0 — 2026-05-21 ⚠️ BREAKING CHANGE
|
|
27
|
+
|
|
28
|
+
> **V2-only 版本**:移除全部 V1 E2EE(含群组加密),新增 V2 加密原语,API 不向后兼容。
|
|
29
|
+
|
|
30
|
+
### BREAKING
|
|
31
|
+
- **移除 V1 E2EE 全部实现**:`GroupE2EEManager`、V1 epoch key 逻辑全部删除
|
|
32
|
+
- **移除 V1 群组加密测试**:`e2ee.test.ts`、`e2ee-group.test.ts`、`epoch-key-server.spec.ts` 等
|
|
33
|
+
- **E2EE 接口简化**:`e2ee.ts` 仅保留 V2 路径,V1 加解密方法不再可用
|
|
34
|
+
- **配置变更**:`AUNConfig` 移除 V1 相关配置项
|
|
35
|
+
- **KeyStore 重构**:`keystore/` 目录结构调整,`aid-db.ts` / `file.ts` 接口变更
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
- **agent.md 主 API**:`AUNClient.publishAgentMd(path)` / `AUNClient.fetchAgentMd(aid?, savePath?)`
|
|
39
|
+
- **V2 加密原语**(跨语言 golden vector 一致性):ECDH P-256、HKDF-SHA256、AES-256-GCM、ECDSA-SHA256 RAW (RFC 6979)、1DH/3DH wrap_key、Recipients Sort + Merkle Digest、State Commitment
|
|
40
|
+
|
|
41
|
+
### Removed
|
|
42
|
+
- `AUNClient.setLocalAgentMdPath()` / `getLocalAgentMdEtag()` / `getRemoteAgentMdEtag()` — 由主 API 自动维护
|
|
43
|
+
|
|
44
|
+
### Deprecated
|
|
45
|
+
- `client.auth.signAgentMd` / `verifyAgentMd` / `uploadAgentMd` / `downloadAgentMd` — 建议迁移到 `client.publishAgentMd` / `client.fetchAgentMd`
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## 0.2.20 — 2026-05-18
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
- **agent.md 版本一致性 API**:`AUNClient.setLocalAgentMdPath(path)` / `getLocalAgentMdEtag()` / `getRemoteAgentMdEtag()`。Node 用 `fs.readFileSync` + `crypto.createHash` 计算 etag,浏览器场景返回空串并 warn。SDK 自动从 RPC envelope `_meta.agent_md_etag` 提取服务端 etag,应用层订阅 `message.received` / `group.message_created` 等事件时 payload 多 `_agent_md.{local_etag, remote_etag}` 字段供版本比对。
|
|
53
|
+
- **`downloadAgentMd` 条件请求缓存**:内部维护 ETag/Last-Modified,未变化时返回上次缓存内容;外部 API 形态不变。
|
|
54
|
+
- **transport meta observer**:`RPCTransport.setMetaObserver(fn)` 透传 envelope `_meta`,observer 抛错被吞,不影响 RPC result。
|
|
55
|
+
|
|
56
|
+
### Changed
|
|
57
|
+
- **RPC call 默认超时 10s → 35s**:与服务端 30s handler timeout 对齐,留 5s buffer。
|
|
58
|
+
- **multi-device 架构**:对端无 prekey 时 `_sendEncrypted` 直接抛错(`no registered device prekeys for ...`),不再降级到 `long_term_key`。
|
|
59
|
+
|
|
60
|
+
### Docs
|
|
61
|
+
- 仓库根 `docs/`(agent.md 规范、protocol、SDK 手册)随 npm tarball 打包到 `_packed_docs/`,安装后可读。`.gitignore` 排除项(如内部测试指南)不进包。
|
|
62
|
+
|
|
63
|
+
---
|