@agentunion/fastaun-browser 0.3.0 → 0.3.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.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkD,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAsC,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAEvG,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIlD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAiCrD,OAAO,EAML,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,YAAY,CAAC;AA0ZpB;;;;;;;;;;;GAWG;AACH,qBAAa,SAAS;IACpB,eAAe;IACf,QAAQ,CAAC,WAAW,EAAE,SAAS,CAAC;IAChC,aAAa;IACb,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAE3B,OAAO,CAAC,IAAI,CAAuB;IACnC,OAAO,CAAC,SAAS,CAA+B;IAChD,OAAO,CAAC,MAAM,CAAmI;IACjJ,OAAO,CAAC,WAAW,CAAuB;IAC1C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,YAAY,CAAa;IACjC,OAAO,CAAC,oBAAoB,CAAa;IACzC,OAAO,CAAC,2BAA2B,CAAa;IAChD,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,eAAe,CAAkD;IAEzE,OAAO,CAAC,WAAW,CAAkB;IACrC,OAAO,CAAC,UAAU,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CAAC;IAkGhG;;;;;OAKG;IACG,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAWrE;;;;OAIG;YACW,mBAAmB;IAqHjC;;;;OAIG;YACW,6BAA6B;IAiD3C;;;OAGG;YACW,qBAAqB;YA+GrB,4BAA4B;IAa1C;;;OAGG;YACW,2BAA2B;IAgDzC;;;;OAIG;YACW,4BAA4B;IA8E1C;;;OAGG;YACW,uBAAuB;IAgHrC;;OAEG;YACW,YAAY;IAyC1B,OAAO,CAAC,0BAA0B;IAQlC;;OAEG;YACW,mBAAmB;YA+CnB,gBAAgB;YAShB,yBAAyB;YAkDzB,2BAA2B;YA2B3B,qBAAqB;YAiJrB,mCAAmC;YA2BnC,yBAAyB;IAqBvC;;OAEG;YACW,8BAA8B;YAyB9B,kBAAkB;YAYlB,qBAAqB;YAYrB,mBAAmB;IAUjC;;OAEG;IACH,OAAO,CAAC,eAAe,CAAS;IAChC,OAAO,CAAC,cAAc,CAAS;YAEjB,qBAAqB;IAgGnC;;OAEG;YACW,iBAAiB;IAsB/B,wCAAwC;IACxC,OAAO,CAAC,UAAU;IAMlB,iBAAiB;IACjB,OAAO,CAAC,MAAM;CAKf"}
package/dist/client.js CHANGED
@@ -932,6 +932,13 @@ export class AUNClient {
932
932
  catch (exc) {
933
933
  this._clientLog.debug(`V2 post-membership propose failed (non-fatal): group=${groupId} err=${formatCaughtError(exc)}`);
934
934
  }
935
+ // group.create / group.use_invite_code 成功后注册 group SPK
936
+ if (method === 'group.create' || method === 'group.use_invite_code') {
937
+ const callFn = async (m, ps) => this.call(m, ps);
938
+ this._v2Session.ensureGroupRegistered?.(groupId, callFn)?.catch(exc => {
939
+ this._clientLog.debug(`group SPK registration after ${method} failed (non-fatal): group=${groupId} err=${exc}`);
940
+ });
941
+ }
935
942
  }
936
943
  }
937
944
  // message.pull 返回后的 seq 跟踪(V2 路径已在 call() 开头路由,此处为 plaintext pull 的 seq 跟踪)
@@ -1669,6 +1676,26 @@ export class AUNClient {
1669
1676
  if (groupId) {
1670
1677
  this._v2BootstrapCache.delete(`group:${groupId}`);
1671
1678
  }
1679
+ // Group SPK 编排:成员变更触发注册/轮换
1680
+ if (this._v2Session && groupId) {
1681
+ const membershipActions = new Set([
1682
+ 'member_added', 'member_left', 'member_removed', 'role_changed',
1683
+ 'owner_transferred', 'joined', 'join_approved',
1684
+ ]);
1685
+ if (membershipActions.has(action)) {
1686
+ const callFn = async (method, params) => this.call(method, params);
1687
+ if (action === 'joined' || action === 'join_approved') {
1688
+ this._v2Session.ensureGroupRegistered?.(groupId, callFn)?.catch(exc => {
1689
+ this._clientLog.debug(`group SPK registration failed (non-fatal): group=${groupId} action=${action} err=${exc}`);
1690
+ });
1691
+ }
1692
+ else {
1693
+ this._v2Session.rotateGroupSPK?.(groupId, callFn)?.catch(exc => {
1694
+ this._clientLog.debug(`group SPK rotation failed (non-fatal): group=${groupId} action=${action} err=${exc}`);
1695
+ });
1696
+ }
1697
+ }
1698
+ }
1672
1699
  if (groupId && action === 'upsert' && this._v2Session) {
1673
1700
  this._safeAsync(this._v2AutoProposeState(groupId, { leaderDelay: true }));
1674
1701
  }
@@ -3581,13 +3608,22 @@ export class AUNClient {
3581
3608
  const result = isJsonObject(raw)
3582
3609
  ? { ...raw }
3583
3610
  : { result: raw };
3584
- result.ack_seq = seq;
3611
+ let actualAckSeq = seq;
3612
+ if ('effective_ack_seq' in result)
3613
+ actualAckSeq = Number(result.effective_ack_seq ?? 0);
3614
+ else if ('ack_seq' in result)
3615
+ actualAckSeq = Number(result.ack_seq ?? 0);
3616
+ else if ('cursor' in result)
3617
+ actualAckSeq = Number(result.cursor ?? 0);
3618
+ if (!Number.isFinite(actualAckSeq))
3619
+ actualAckSeq = seq;
3620
+ result.ack_seq = actualAckSeq;
3585
3621
  result.success = true;
3586
3622
  if (Number(result.acked ?? 0) === 0)
3587
- result.acked = seq;
3623
+ result.acked = actualAckSeq;
3588
3624
  if (this._v2Session) {
3589
3625
  try {
3590
- const destroyed = await this._v2Session.maybeDestroyOldSPKs(seq);
3626
+ const destroyed = await this._v2Session.maybeDestroyOldSPKs(actualAckSeq);
3591
3627
  if (destroyed.length > 0) {
3592
3628
  this._clientLog.info(`V2 destroyed old SPKs after ack: ${destroyed.slice(0, 3)} (PFS)`);
3593
3629
  }
@@ -3614,18 +3650,51 @@ export class AUNClient {
3614
3650
  this._clientLog.warn(`V2 decrypt: invalid envelope_json for msg seq=${String(msg.seq)}`);
3615
3651
  return null;
3616
3652
  }
3617
- // 确定 spk_id:单 recipient 时取 envelope.recipient.spk_id;多 recipients 时取 msg.spk_id
3653
+ // 确定 spk_id recipient_key_source
3618
3654
  let spkId = '';
3655
+ let recipientKeySource = '';
3619
3656
  const recipientObj = envelope.recipient;
3620
3657
  if (recipientObj && typeof recipientObj === 'object') {
3621
3658
  spkId = String(recipientObj.spk_id ?? '');
3659
+ recipientKeySource = String(recipientObj.key_source ?? '');
3622
3660
  }
3623
3661
  else if (Array.isArray(envelope.recipients)) {
3624
3662
  spkId = String(msg.spk_id ?? '');
3663
+ // 从 recipients 数组中查找本设备的 row 以获取 key_source
3664
+ if (!spkId) {
3665
+ for (const row of envelope.recipients) {
3666
+ if (Array.isArray(row) && row.length >= 6 && row[0] === this._aid && row[1] === this._deviceId) {
3667
+ spkId = String(row[5] ?? '');
3668
+ recipientKeySource = row.length > 3 ? String(row[3] ?? '') : '';
3669
+ break;
3670
+ }
3671
+ }
3672
+ }
3673
+ else {
3674
+ for (const row of envelope.recipients) {
3675
+ if (Array.isArray(row) && row.length >= 6 && row[0] === this._aid && row[1] === this._deviceId) {
3676
+ recipientKeySource = row.length > 3 ? String(row[3] ?? '') : '';
3677
+ break;
3678
+ }
3679
+ }
3680
+ }
3681
+ }
3682
+ // 根据 aad.group_id 判断使用 group SPK 还是 P2P SPK
3683
+ const aad = isJsonObject(envelope.aad) ? envelope.aad : {};
3684
+ const groupIdForKeys = String(msg.group_id ?? aad.group_id ?? envelope.group_id ?? '').trim();
3685
+ let ikPriv;
3686
+ let spkPriv;
3687
+ if (groupIdForKeys) {
3688
+ const keys = await session.getGroupDecryptKeys(groupIdForKeys, spkId);
3689
+ ikPriv = keys.ikPriv;
3690
+ spkPriv = keys.spkPriv;
3691
+ }
3692
+ else {
3693
+ const keys = await session.getDecryptKeys(spkId);
3694
+ ikPriv = keys.ikPriv;
3695
+ spkPriv = keys.spkPriv;
3625
3696
  }
3626
- const { ikPriv, spkPriv } = await session.getDecryptKeys(spkId);
3627
3697
  const fromAid = String(msg.from_aid ?? '');
3628
- const aad = envelope.aad ?? {};
3629
3698
  const senderDeviceId = String(aad.from_device ?? '');
3630
3699
  const senderPubDer = await this._getV2SenderPubDer(fromAid, senderDeviceId);
3631
3700
  if (!senderPubDer) {
@@ -3660,15 +3729,23 @@ export class AUNClient {
3660
3729
  }
3661
3730
  if (plaintext == null)
3662
3731
  return null;
3663
- // SPK 轮换:当前活跃 SPK 被消费后立即轮换(fire-and-forget,不阻塞消息处理)
3664
- if (session.isCurrentSPK(spkId)) {
3665
- queueMicrotask(() => {
3666
- const callFn = async (method, params) => {
3667
- return this.call(method, params);
3668
- };
3669
- session.rotateSPK(callFn).catch((exc) => {
3670
- this._clientLog.warn(`V2 SPK rotation failed (non-fatal): ${String(exc)}`);
3671
- });
3732
+ // 消费触发 SPK 轮换(fire-and-forget,不阻塞消息处理)
3733
+ if (groupIdForKeys && recipientKeySource === 'group_device_prekey' && session.isLastUploadedGroupSPK(groupIdForKeys, spkId)) {
3734
+ const callFn = async (method, params) => this.call(method, params);
3735
+ session.rotateGroupSPK(groupIdForKeys, callFn).catch(exc => {
3736
+ this._clientLog.debug(`V2 group SPK rotation failed (non-fatal): group=${groupIdForKeys} err=${exc}`);
3737
+ });
3738
+ }
3739
+ else if (groupIdForKeys && recipientKeySource === 'peer_device_prekey') {
3740
+ const callFn = async (method, params) => this.call(method, params);
3741
+ session.ensureGroupRegistered(groupIdForKeys, callFn).catch(exc => {
3742
+ this._clientLog.debug(`V2 group SPK registration after peer fallback failed (non-fatal): group=${groupIdForKeys} err=${exc}`);
3743
+ });
3744
+ }
3745
+ else if (!groupIdForKeys && session.isLastUploadedSPK(spkId)) {
3746
+ const callFn = async (method, params) => this.call(method, params);
3747
+ session.rotateSPK(callFn).catch(exc => {
3748
+ this._clientLog.debug(`V2 SPK rotation failed (non-fatal): ${exc}`);
3672
3749
  });
3673
3750
  }
3674
3751
  return {
@@ -4202,21 +4279,36 @@ export class AUNClient {
4202
4279
  const session = this._v2Session;
4203
4280
  if (!session || !opts.envelope)
4204
4281
  return null;
4205
- // 找到本设备所引用的 spk_id:根据 envelope.recipients 中 [aid, device_id, ..., spk_id]
4282
+ // 找到本设备所引用的 spk_id 和 key_source:根据 envelope.recipients 中 [aid, device_id, ..., spk_id]
4206
4283
  let spkId = '';
4284
+ let recipientKeySource = '';
4207
4285
  const recipients = opts.envelope.recipients;
4208
4286
  if (Array.isArray(recipients)) {
4209
4287
  for (const row of recipients) {
4210
4288
  if (Array.isArray(row) && row.length >= 6) {
4211
4289
  if (row[0] === this._aid && row[1] === this._deviceId) {
4212
4290
  spkId = String(row[5] ?? '');
4291
+ recipientKeySource = row.length > 3 ? String(row[3] ?? '') : '';
4213
4292
  break;
4214
4293
  }
4215
4294
  }
4216
4295
  }
4217
4296
  }
4218
- const { ikPriv, spkPriv } = await session.getDecryptKeys(spkId);
4297
+ // 根据 aad.group_id 判断使用 group SPK 还是 P2P SPK
4219
4298
  const aad = opts.envelope.aad ?? {};
4299
+ const groupIdForKeys = String(aad.group_id ?? opts.envelope.group_id ?? '').trim();
4300
+ let ikPriv;
4301
+ let spkPriv;
4302
+ if (groupIdForKeys) {
4303
+ const keys = await session.getGroupDecryptKeys(groupIdForKeys, spkId);
4304
+ ikPriv = keys.ikPriv;
4305
+ spkPriv = keys.spkPriv;
4306
+ }
4307
+ else {
4308
+ const keys = await session.getDecryptKeys(spkId);
4309
+ ikPriv = keys.ikPriv;
4310
+ spkPriv = keys.spkPriv;
4311
+ }
4220
4312
  const fromAid = String(opts.fromAid || aad.from || '').trim();
4221
4313
  const senderDeviceId = String(aad.from_device ?? '');
4222
4314
  const senderPubDer = await this._getV2SenderPubDer(fromAid, senderDeviceId);
@@ -4225,7 +4317,23 @@ export class AUNClient {
4225
4317
  return null;
4226
4318
  }
4227
4319
  try {
4228
- return await decryptMessage(opts.envelope, this._aid ?? '', this._deviceId, ikPriv, spkPriv, senderPubDer);
4320
+ const plaintext = await decryptMessage(opts.envelope, this._aid ?? '', this._deviceId, ikPriv, spkPriv, senderPubDer);
4321
+ // 消费触发 SPK 轮换(与 _decryptV2Message 对齐)
4322
+ if (plaintext != null) {
4323
+ if (groupIdForKeys && recipientKeySource === 'group_device_prekey' && session.isLastUploadedGroupSPK(groupIdForKeys, spkId)) {
4324
+ const callFn = async (method, params) => this.call(method, params);
4325
+ session.rotateGroupSPK(groupIdForKeys, callFn).catch(exc => {
4326
+ this._clientLog.debug(`V2 thought group SPK rotation failed (non-fatal): group=${groupIdForKeys} err=${exc}`);
4327
+ });
4328
+ }
4329
+ else if (groupIdForKeys && recipientKeySource === 'peer_device_prekey') {
4330
+ const callFn = async (method, params) => this.call(method, params);
4331
+ session.ensureGroupRegistered(groupIdForKeys, callFn).catch(exc => {
4332
+ this._clientLog.debug(`V2 thought group SPK registration after peer fallback failed (non-fatal): group=${groupIdForKeys} err=${exc}`);
4333
+ });
4334
+ }
4335
+ }
4336
+ return plaintext;
4229
4337
  }
4230
4338
  catch (exc) {
4231
4339
  this._clientLog.warn(`V2 thought decrypt failed from=${fromAid}: ${String(exc)}`);
@@ -4816,27 +4924,78 @@ export class AUNClient {
4816
4924
  async _onV2PushNotification(data) {
4817
4925
  if (!this._v2Session)
4818
4926
  return;
4819
- // only one in flight + drain pending:
4820
- // 如果已有 pull 在执行,标记 pending,pull 完成后会再拉一次
4927
+ // 提取 push 通知中的元数据
4928
+ const pushSeq = isJsonObject(data) ? Number(data.seq ?? 0) || 0 : 0;
4929
+ const pushFrom = isJsonObject(data) ? String(data.from_aid ?? '') : '';
4930
+ const pushMsgId = isJsonObject(data) ? String(data.message_id ?? '') : '';
4931
+ const envelopeJson = isJsonObject(data) ? data.envelope_json : undefined;
4932
+ const ns = this._aid ? `p2p:${this._aid}` : '';
4933
+ let contigBefore = ns ? this._seqTracker.getContiguousSeq(ns) : 0;
4934
+ this._clientLog.debug(`_onV2PushNotification: push_seq=${pushSeq || 'null'} push_from=${pushFrom} push_msg_id=${pushMsgId} has_payload=${!!envelopeJson} contiguous_seq=${contigBefore}`);
4935
+ // ── 带 payload 的 push:尝试就地解密 ──
4936
+ if (envelopeJson && pushSeq > 0 && ns) {
4937
+ try {
4938
+ const decrypted = await this._decryptV2Message(data);
4939
+ if (decrypted) {
4940
+ // 解密成功:contiguous_seq 上界 = push_seq
4941
+ this._seqTracker.onMessageSeq(ns, pushSeq);
4942
+ if (pushSeq === contigBefore + 1) {
4943
+ this._seqTracker.forceContiguousSeq(ns, pushSeq);
4944
+ }
4945
+ await this._publishOrderedMessage('message.received', ns, pushSeq, decrypted);
4946
+ const newContig = this._seqTracker.getContiguousSeq(ns);
4947
+ if (newContig !== contigBefore) {
4948
+ this._saveSeqTrackerState();
4949
+ }
4950
+ if (newContig > 0 && newContig !== contigBefore) {
4951
+ this._transport.call('message.v2.ack', { up_to_seq: newContig })
4952
+ .catch(e => this._clientLog.debug(`V2 P2P push-ack failed: ${e}`));
4953
+ }
4954
+ this._clientLog.debug(`_onV2PushNotification: push 带 payload 解密成功, contiguous_seq=${contigBefore}->${newContig} push_seq=${pushSeq}`);
4955
+ return;
4956
+ }
4957
+ }
4958
+ catch (exc) {
4959
+ this._clientLog.debug(`_onV2PushNotification: push payload 解密失败, fallback to pull: ${exc}`);
4960
+ }
4961
+ }
4962
+ // ── 不带 payload 或解密失败:触发 pull ──
4963
+ // 关键:push 通知只表示"服务端有 seq=pushSeq 的新消息",
4964
+ // 此时消息内容尚未到达本地,绝不能调用 onMessageSeq() 推进 contiguousSeq
4965
+ // (那会让随后的 pull 用 after_seq=pushSeq,跳过这条消息本身导致拉空)。
4966
+ // 正确做法:保持 contiguousSeq 不变,用它作为 pull 的 after_seq;
4967
+ // pull 成功 + 解密成功后再由 pull 路径推进 contiguousSeq。
4968
+ if (pushSeq > 0 && ns) {
4969
+ // 越界修复:如果 contiguousSeq >= pushSeq(被之前的异常 push 污染,或恰好等于),
4970
+ // 强制拉回到 pushSeq - 1,确保能拉到 pushSeq 这条消息
4971
+ if (contigBefore >= pushSeq) {
4972
+ this._clientLog.warn(`_onV2PushNotification: contiguous_seq=${contigBefore} 越界(>= push_seq=${pushSeq}),强制修复为 ${pushSeq - 1}`);
4973
+ this._seqTracker.forceContiguousSeq(ns, pushSeq - 1);
4974
+ this._saveSeqTrackerState(); // 持久化修复后的状态
4975
+ contigBefore = pushSeq - 1;
4976
+ }
4977
+ // 纯通知:不更新 contiguousSeq,由 pull 结果驱动推进
4978
+ this._clientLog.debug(`_onV2PushNotification: 纯通知 push_seq=${pushSeq} > contiguous_seq=${contigBefore}, 触发 pull(after_seq=${contigBefore})`);
4979
+ }
4980
+ // only one in flight + drain pending
4821
4981
  if (this._v2PullInflight) {
4822
4982
  this._v2PullPending = true;
4823
4983
  return;
4824
4984
  }
4825
4985
  this._v2PullInflight = true;
4826
- // 同时标记 gapFillDone,阻止 _fillP2pGap 并发
4827
- const ns = this._aid ? `p2p:${this._aid}` : '';
4828
4986
  const dedupKey = `p2p_pull:${ns}`;
4829
4987
  this._gapFillDone.add(dedupKey);
4830
4988
  try {
4831
4989
  do {
4832
4990
  this._v2PullPending = false;
4833
- // pullV2 内部已经走 _publishOrderedMessage 发布去重
4834
- // 这里不需再次 publish,否则会双重派发
4835
4991
  await this.pullV2();
4992
+ const newContig = ns ? this._seqTracker.getContiguousSeq(ns) : -1;
4993
+ this._clientLog.debug(`_onV2PushNotification pull done: contiguous_seq=${contigBefore}->${newContig} (push_seq=${pushSeq || 'null'})`);
4836
4994
  } while (this._v2PullPending);
4837
4995
  }
4838
4996
  catch (exc) {
4839
- this._clientLog.warn(`V2 push auto-pull failed: ${exc}`);
4997
+ const newContig = ns ? this._seqTracker.getContiguousSeq(ns) : -1;
4998
+ this._clientLog.warn(`V2 push auto-pull failed: contiguous_seq=${contigBefore}->${newContig} err=${exc}`);
4840
4999
  }
4841
5000
  finally {
4842
5001
  this._v2PullInflight = false;