@agentunion/fastaun-browser 0.5.19 → 0.5.20
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 +129 -78
- package/_packed_docs/CHANGELOG.md +129 -78
- package/_packed_docs/INDEX.md +201 -195
- package/_packed_docs/KITE_DOCS_GUIDE.md +93 -90
- package/_packed_docs/agent.md/SCHEMA.md +7 -7
- package/_packed_docs/agent.md//350/277/234/347/250/213agent.md/347/274/223/345/255/230/344/270/216etag/351/200/217/344/274/240/346/226/271/346/241/210.md +11 -11
- package/_packed_docs/protocol/06-/346/234/215/345/212/241/345/215/217/350/256/256.md +1072 -1072
- package/_packed_docs/protocol/10-Group-/345/255/220/345/215/217/350/256/256.md +676 -676
- package/_packed_docs/protocol/11-Storage-/345/255/220/345/215/217/350/256/256.md +8 -12
- package/_packed_docs/protocol/Ownership/345/215/217/350/256/256/345/256/232/344/271/211.md +443 -0
- package/_packed_docs/protocol/Ownership/345/215/217/350/256/256/345/256/232/344/271/2112.0.md +161 -0
- package/_packed_docs/protocol/Ownership/345/215/217/350/256/256/345/256/232/344/271/2112.1.md +658 -0
- package/_packed_docs/protocol/Ownership/345/215/217/350/256/256/345/256/232/344/271/2113.0.md +233 -0
- package/_packed_docs/protocol/agent.md/SCHEMA.md +1 -1
- package/_packed_docs/sdk/03-/346/240/270/345/277/203/346/246/202/345/277/265.md +1 -1
- package/_packed_docs/sdk/04-/350/277/236/346/216/245/344/270/216/350/256/244/350/257/201.md +67 -63
- package/_packed_docs/sdk/05-E2EE/345/212/240/345/257/206/351/200/232/344/277/241.md +1 -1
- package/_packed_docs/sdk/06-API/346/211/213/345/206/214.md +35 -8
- package/_packed_docs/sdk/08-/346/234/200/344/275/263/345/256/236/350/267/265.md +3 -3
- package/_packed_docs/sdk/09-group-rpc-manual.md +258 -254
- package/_packed_docs/sdk/09-message-rpc-manual.md +7 -4
- package/_packed_docs/sdk/09-storage-rpc-manual.md +18 -26
- package/_packed_docs/sdk/AUN_DOCS_GUIDE.md +61 -52
- package/_packed_docs/sdk/INDEX.md +92 -80
- package/_packed_docs/sdk/Ownership-SDK/345/256/236/347/216/260/346/214/207/345/215/227.md +169 -0
- package/_packed_docs/sdk/Ownership-SDK/347/274/226/346/216/222/346/214/207/345/215/227.md +349 -0
- package/_packed_docs/sdk/Ownership-SDK/347/274/226/346/216/222/346/214/207/345/215/2272.1.md +922 -0
- package/_packed_docs/sdk/Ownership-SDK/351/233/206/346/210/220/346/214/207/345/215/227.md +270 -0
- package/_packed_docs/sdk/Ownership2.1-SDK/345/272/224/347/224/250/351/233/206/346/210/220/346/214/207/345/215/227.md +300 -0
- package/_packed_docs/sdk/Ownership2.1-SDK/345/274/200/345/217/221/344/270/216/347/247/273/346/244/215/346/214/207/345/215/227.md +382 -0
- package/_packed_docs/sdk/Ownership2.1-TDD/345/210/206/351/230/266/346/256/265/345/256/236/346/226/275/350/256/241/345/210/222.md +708 -0
- package/_packed_docs/sdk/Ownership2.1/350/257/246/347/273/206/350/256/276/350/256/241.md +476 -0
- package/_packed_docs/sdk/Ownership/347/256/241/347/220/206/344/270/223/351/242/230.md +559 -0
- package/_packed_docs/sdk/ProtectedHeaders/347/224/250/346/263/225/344/270/223/351/242/230.md +299 -0
- package/_packed_docs/sdk//345/207/255/350/257/201/344/270/216/347/273/204/347/273/207/346/234/215/345/212/241SDK/345/272/224/347/224/250/351/233/206/346/210/220/346/214/207/345/215/227.md +173 -0
- package/_packed_docs/sdk//345/207/255/350/257/201/344/270/216/347/273/204/347/273/207/346/234/215/345/212/241SDK/345/274/200/345/217/221/344/270/216/347/247/273/346/244/215/346/214/207/345/215/227.md +211 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273SDK/345/256/236/347/216/260/347/247/273/346/244/215/346/214/207/345/215/227.md +331 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273SDK/351/233/206/346/210/220/346/214/207/345/215/227.md +207 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273/344/273/243/347/240/201/345/256/241/346/237/245/346/212/245/345/221/212.md +252 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273/345/256/236/346/226/275/350/256/241/345/210/222.md +156 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273/346/226/271/346/241/210.md +273 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273/350/257/246/347/273/206/350/256/276/350/256/241.md +211 -0
- package/dist/agent-md-schema.d.ts +15 -4
- package/dist/agent-md-schema.d.ts.map +1 -1
- package/dist/agent-md-schema.js +64 -30
- package/dist/agent-md-schema.js.map +1 -1
- package/dist/agent-md.d.ts +10 -2
- package/dist/agent-md.d.ts.map +1 -1
- package/dist/agent-md.js +278 -121
- package/dist/agent-md.js.map +1 -1
- package/dist/aid-store.d.ts +46 -0
- package/dist/aid-store.d.ts.map +1 -1
- package/dist/aid-store.js +149 -10
- package/dist/aid-store.js.map +1 -1
- package/dist/aid.d.ts +4 -1
- package/dist/aid.d.ts.map +1 -1
- package/dist/aid.js +23 -42
- package/dist/aid.js.map +1 -1
- package/dist/auth.d.ts +1 -1
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +85 -18
- package/dist/auth.js.map +1 -1
- package/dist/bundle.js +1581 -781
- package/dist/cert-utils.d.ts +49 -1
- package/dist/cert-utils.d.ts.map +1 -1
- package/dist/cert-utils.js +102 -56
- package/dist/cert-utils.js.map +1 -1
- package/dist/client/delivery.d.ts +7 -0
- package/dist/client/delivery.d.ts.map +1 -1
- package/dist/client/delivery.js +243 -28
- package/dist/client/delivery.js.map +1 -1
- package/dist/client/rpc-pipeline.d.ts.map +1 -1
- package/dist/client/rpc-pipeline.js +89 -77
- package/dist/client/rpc-pipeline.js.map +1 -1
- package/dist/client/v2-e2ee.d.ts.map +1 -1
- package/dist/client/v2-e2ee.js +99 -80
- package/dist/client/v2-e2ee.js.map +1 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +31 -17
- package/dist/client.js.map +1 -1
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +8 -6
- package/dist/crypto.js.map +1 -1
- package/dist/events.d.ts +5 -2
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js +33 -14
- package/dist/events.js.map +1 -1
- package/dist/facades.js +5 -5
- package/dist/facades.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/org-protocol.d.ts.map +1 -1
- package/dist/org-protocol.js +72 -12
- package/dist/org-protocol.js.map +1 -1
- package/dist/ownership-v21.d.ts +25 -8
- package/dist/ownership-v21.d.ts.map +1 -1
- package/dist/ownership-v21.js +142 -73
- package/dist/ownership-v21.js.map +1 -1
- package/dist/ownership-workflow.d.ts +6 -1
- package/dist/ownership-workflow.d.ts.map +1 -1
- package/dist/ownership-workflow.js +221 -58
- package/dist/ownership-workflow.js.map +1 -1
- package/dist/tools/cross-sdk-agent.d.ts +2 -1
- package/dist/tools/cross-sdk-agent.d.ts.map +1 -1
- package/dist/tools/cross-sdk-agent.js +91 -8
- package/dist/tools/cross-sdk-agent.js.map +1 -1
- package/dist/transport.d.ts +1 -0
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +2 -0
- package/dist/transport.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"v2-e2ee.d.ts","sourceRoot":"","sources":["../../src/client/v2-e2ee.ts"],"names":[],"mappings":"AAUA,OAAO,EAAiC,KAAK,UAAU,EAAkB,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAG7H,OAAO,KAAK,EAA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,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IA0J9B,oBAAoB,CAAC,IAAI,EAAE;QAC/B,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACjC,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC3C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACnC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAqIpC,qBAAqB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI;CAgBxF"}
|
package/dist/client/v2-e2ee.js
CHANGED
|
@@ -113,12 +113,10 @@ function deduplicateForwardPageMessages(value, afterSeq) {
|
|
|
113
113
|
}
|
|
114
114
|
return [...bySeq.entries()].sort(([a], [b]) => a - b).map(([, row]) => row);
|
|
115
115
|
}
|
|
116
|
-
function contiguousPullSeq(afterSeq, seqs,
|
|
116
|
+
function contiguousPullSeq(afterSeq, seqs, _proof) {
|
|
117
117
|
// Forward 原始页中的缺号视为服务端永久空号;页完成后按页内最大
|
|
118
118
|
// seq 推进 A,避免单页空洞阻塞后续 pull/ACK。
|
|
119
|
-
|
|
120
|
-
const serverProof = safeNonNegativeSeq(proof);
|
|
121
|
-
return serverProof !== null ? Math.max(contiguous, serverProof) : contiguous;
|
|
119
|
+
return seqs.length > 0 ? Math.max(afterSeq, ...seqs) : afterSeq;
|
|
122
120
|
}
|
|
123
121
|
function deduplicatePulledResults(messages) {
|
|
124
122
|
const seen = new Set();
|
|
@@ -138,7 +136,7 @@ function shouldContinueForwardPage({ rawCount, nextAfterSeq, nextAfter, limit, h
|
|
|
138
136
|
// 无新 seq 或游标未前进时必须停止,避免错误元数据造成循环。
|
|
139
137
|
if (rawCount <= 0 || nextAfter <= nextAfterSeq)
|
|
140
138
|
return false;
|
|
141
|
-
if (hasMore || serverHead > nextAfter ||
|
|
139
|
+
if (hasMore || serverHead > nextAfter || observedUpper > nextAfter)
|
|
142
140
|
return true;
|
|
143
141
|
// 仅旧服务缺失 has_more 时,以满页保留兼容续拉。
|
|
144
142
|
return !hasMoreField && limit > 0 && rawCount >= limit;
|
|
@@ -1379,13 +1377,13 @@ export class V2E2EECoordinator {
|
|
|
1379
1377
|
let pageCount = 0;
|
|
1380
1378
|
let lastAutoAckSeq = 0;
|
|
1381
1379
|
let pendingAckSeq = deferredForwardAck;
|
|
1380
|
+
let committedAckSeq = ns ? client._seqTracker.getContiguousSeq(ns) : 0;
|
|
1382
1381
|
const maxPages = Math.max(1, Math.min(100, Math.trunc(Number(opts?.maxPages ?? 100) || 100)));
|
|
1383
1382
|
let pipelineRunning = false;
|
|
1384
1383
|
let pipelineError = null;
|
|
1385
|
-
|
|
1384
|
+
let pipelineQueue = new V2PullPageQueue(V2_PULL_PIPELINE_QUEUE_CAPACITY);
|
|
1386
1385
|
let pipelineProducer = null;
|
|
1387
1386
|
let pipelineStopped = false;
|
|
1388
|
-
let pipelineResume = null;
|
|
1389
1387
|
const startPipeline = (startAfterSeq, startVolatileCursor) => {
|
|
1390
1388
|
if (pipelineRunning || pageCount >= maxPages || limit < V2_PULL_MAX_PAGE_LIMIT)
|
|
1391
1389
|
return;
|
|
@@ -1396,30 +1394,32 @@ export class V2E2EECoordinator {
|
|
|
1396
1394
|
for (let produced = pageCount; produced < maxPages; produced += 1) {
|
|
1397
1395
|
if (pipelineStopped)
|
|
1398
1396
|
break;
|
|
1397
|
+
this.ensureDeliveryCurrent(ns, generation, inlineGeneration);
|
|
1399
1398
|
const requestedVolatileCursor = producerVolatileCursor;
|
|
1399
|
+
const ackUpToSeq = Math.min(pendingAckSeq, committedAckSeq);
|
|
1400
|
+
const inlineAckGeneration = ackUpToSeq > 0
|
|
1401
|
+
? client._delivery?.pendingP2PInlineAckGeneration?.(ns) ?? null : null;
|
|
1400
1402
|
const result = await client._callRawV2Rpc('message.v2.pull', {
|
|
1401
1403
|
after_seq: producerAfterSeq,
|
|
1402
1404
|
limit,
|
|
1403
1405
|
...(producerVolatileCursor ? { after_volatile_cursor: producerVolatileCursor } : {}),
|
|
1404
1406
|
...(opts?.force ? { force: true } : {}),
|
|
1407
|
+
...(ackUpToSeq > 0 ? { ack_up_to_seq: ackUpToSeq } : {}),
|
|
1405
1408
|
}, pullGateKey);
|
|
1406
1409
|
if (pipelineStopped)
|
|
1407
1410
|
break;
|
|
1411
|
+
this.ensureDeliveryCurrent(ns, generation, inlineGeneration);
|
|
1408
1412
|
const rawPageMessages = (Array.isArray(result?.messages) ? result.messages : []);
|
|
1409
|
-
const completed = new Promise((resolve) => { pipelineResume = resolve; });
|
|
1410
1413
|
const enqueued = await pipelineQueue.put({
|
|
1411
1414
|
result,
|
|
1412
1415
|
afterSeq: producerAfterSeq,
|
|
1413
|
-
ackUpToSeq
|
|
1414
|
-
inlineAckGeneration
|
|
1416
|
+
ackUpToSeq,
|
|
1417
|
+
inlineAckGeneration,
|
|
1415
1418
|
requestedVolatileCursor,
|
|
1416
1419
|
weight: rawPageMessages.length,
|
|
1417
1420
|
}, rawPageMessages.length);
|
|
1418
1421
|
if (!enqueued || pipelineStopped)
|
|
1419
1422
|
break;
|
|
1420
|
-
await completed;
|
|
1421
|
-
if (pipelineStopped)
|
|
1422
|
-
break;
|
|
1423
1423
|
const volatileMessages = client._delivery.volatileMessages(rawPageMessages);
|
|
1424
1424
|
if (volatileMessages.length > 0)
|
|
1425
1425
|
break;
|
|
@@ -1454,8 +1454,6 @@ export class V2E2EECoordinator {
|
|
|
1454
1454
|
};
|
|
1455
1455
|
const stopPipeline = async () => {
|
|
1456
1456
|
pipelineStopped = true;
|
|
1457
|
-
pipelineResume?.();
|
|
1458
|
-
pipelineResume = null;
|
|
1459
1457
|
pipelineQueue.close();
|
|
1460
1458
|
if (pipelineProducer) {
|
|
1461
1459
|
const producer = pipelineProducer;
|
|
@@ -1507,21 +1505,24 @@ export class V2E2EECoordinator {
|
|
|
1507
1505
|
continue;
|
|
1508
1506
|
}
|
|
1509
1507
|
}
|
|
1508
|
+
this.ensureDeliveryCurrent(ns, generation, inlineGeneration);
|
|
1509
|
+
if (!opts?.force)
|
|
1510
|
+
client._delivery.observeBackgroundPullResponse?.(ns, nextAfterSeq, result, limit);
|
|
1510
1511
|
if (ackUpToSeq > 0) {
|
|
1511
1512
|
const actualAckSeq = client._delivery?.resolveP2PPullAckSeq?.(result, ackUpToSeq) ?? 0;
|
|
1512
1513
|
if (actualAckSeq >= ackUpToSeq) {
|
|
1513
1514
|
if (pendingInlineGeneration !== null) {
|
|
1514
1515
|
client._delivery?.completePendingP2PInlineAckUpTo?.(ns, actualAckSeq, pendingInlineGeneration);
|
|
1515
1516
|
}
|
|
1516
|
-
pendingAckSeq
|
|
1517
|
+
if (pendingAckSeq <= ackUpToSeq)
|
|
1518
|
+
pendingAckSeq = 0;
|
|
1517
1519
|
lastAutoAckSeq = Math.max(lastAutoAckSeq, ackUpToSeq);
|
|
1518
1520
|
this.clearForwardAck(ns, ackUpToSeq);
|
|
1519
1521
|
}
|
|
1520
1522
|
else {
|
|
1521
1523
|
client._clientLog.warn(`message.v2.pull piggyback ACK below target: requested=${ackUpToSeq}, actual=${actualAckSeq}; fallback terminal ACK`);
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
lastAutoAckSeq = Math.max(lastAutoAckSeq, ackUpToSeq);
|
|
1524
|
+
pendingAckSeq = Math.max(pendingAckSeq, ackUpToSeq);
|
|
1525
|
+
this.recordForwardAck(ns, ackUpToSeq);
|
|
1525
1526
|
}
|
|
1526
1527
|
}
|
|
1527
1528
|
const pageMessages = (Array.isArray(result?.messages) ? result.messages : []);
|
|
@@ -1544,6 +1545,13 @@ export class V2E2EECoordinator {
|
|
|
1544
1545
|
let pageTrackerSnapshot;
|
|
1545
1546
|
const pageMaxSeq = seqs.length > 0 ? Math.max(...seqs) : nextAfterSeq;
|
|
1546
1547
|
const pageContiguousSeq = contiguousPullSeq(pageContigBefore, seqs, result.contiguous_seq);
|
|
1548
|
+
if (!pipelineRunning && volatileMessages.length === 0 && shouldContinueForwardPage({
|
|
1549
|
+
rawCount: messages.length, nextAfterSeq, nextAfter: pageMaxSeq, limit,
|
|
1550
|
+
hasMoreField, hasMore, serverHead, pendingAckSeq: 0,
|
|
1551
|
+
observedUpper: typeof client._seqTracker.getMaxSeenSeq === 'function'
|
|
1552
|
+
? client._seqTracker.getMaxSeenSeq(ns) : pageMaxSeq,
|
|
1553
|
+
}))
|
|
1554
|
+
startPipeline(pageMaxSeq, volatileCursor);
|
|
1547
1555
|
const deferredKeyFetches = new Map();
|
|
1548
1556
|
let blockedSeq = 0;
|
|
1549
1557
|
const pageDecryptedBefore = decrypted.length;
|
|
@@ -1680,6 +1688,7 @@ export class V2E2EECoordinator {
|
|
|
1680
1688
|
this.clearForwardCursor(ns, ackSeq);
|
|
1681
1689
|
}
|
|
1682
1690
|
client._delivery.completePendingTailWindow?.(ns);
|
|
1691
|
+
committedAckSeq = ackSeq;
|
|
1683
1692
|
}
|
|
1684
1693
|
catch (exc) {
|
|
1685
1694
|
if (Number(client._v2RuntimeGeneration ?? 0) === generation
|
|
@@ -1709,16 +1718,7 @@ export class V2E2EECoordinator {
|
|
|
1709
1718
|
|| (contigAdvanced && ackSeq > knownServerAckSeq));
|
|
1710
1719
|
if (ackNeeded) {
|
|
1711
1720
|
this.recordForwardAck(ns, ackSeq);
|
|
1712
|
-
|
|
1713
|
-
const canContinuePage = blockedSeq <= 0 && messages.length > 0 && nextAfter > nextAfterSeq;
|
|
1714
|
-
if (canContinuePage && !pipelineRunning) {
|
|
1715
|
-
pendingAckSeq = Math.max(pendingAckSeq, ackSeq);
|
|
1716
|
-
lastAutoAckSeq = Math.max(lastAutoAckSeq, ackSeq);
|
|
1717
|
-
}
|
|
1718
|
-
else {
|
|
1719
|
-
await this.confirmForwardP2PAck(ackSeq);
|
|
1720
|
-
lastAutoAckSeq = Math.max(lastAutoAckSeq, ackSeq);
|
|
1721
|
-
}
|
|
1721
|
+
pendingAckSeq = Math.max(pendingAckSeq, ackSeq);
|
|
1722
1722
|
}
|
|
1723
1723
|
}
|
|
1724
1724
|
if (ns)
|
|
@@ -1758,15 +1758,14 @@ export class V2E2EECoordinator {
|
|
|
1758
1758
|
});
|
|
1759
1759
|
if (!shouldContinue)
|
|
1760
1760
|
break;
|
|
1761
|
-
if (pipelinePage) {
|
|
1762
|
-
|
|
1763
|
-
|
|
1761
|
+
if (pipelinePage && volatileMessages.length > 0) {
|
|
1762
|
+
await stopPipeline();
|
|
1763
|
+
this.ensureDeliveryCurrent(ns, generation, inlineGeneration);
|
|
1764
|
+
pipelineQueue = new V2PullPageQueue(V2_PULL_PIPELINE_QUEUE_CAPACITY);
|
|
1765
|
+
pipelineStopped = false;
|
|
1766
|
+
pipelineError = null;
|
|
1764
1767
|
}
|
|
1765
1768
|
if (shouldContinueForPipeline && !volatileAdvanced && !pipelineRunning && limit >= V2_PULL_MAX_PAGE_LIMIT) {
|
|
1766
|
-
if (pendingAckSeq > 0) {
|
|
1767
|
-
await this.confirmForwardP2PAck(pendingAckSeq);
|
|
1768
|
-
pendingAckSeq = 0;
|
|
1769
|
-
}
|
|
1770
1769
|
startPipeline(nextAfter, volatileCursor);
|
|
1771
1770
|
}
|
|
1772
1771
|
if (!pipelineRunning && pullGateKey && opts?.gateLocked && client._rpcPipeline?.yieldPullGate) {
|
|
@@ -1777,7 +1776,7 @@ export class V2E2EECoordinator {
|
|
|
1777
1776
|
pullGateKey = nextKey;
|
|
1778
1777
|
}
|
|
1779
1778
|
const tailDelayMs = v2PullTailDelayMs(rawCount, limit);
|
|
1780
|
-
if (tailDelayMs > 0)
|
|
1779
|
+
if (!pipelineRunning && tailDelayMs > 0)
|
|
1781
1780
|
await v2Sleep(tailDelayMs);
|
|
1782
1781
|
nextAfterSeq = nextAfter;
|
|
1783
1782
|
}
|
|
@@ -1787,10 +1786,11 @@ export class V2E2EECoordinator {
|
|
|
1787
1786
|
}
|
|
1788
1787
|
if (pageCount >= maxPages) {
|
|
1789
1788
|
client._clientLog.warn(`message.v2.pull reached max_pages=${maxPages} after_seq=${nextAfterSeq}`);
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1789
|
+
}
|
|
1790
|
+
if (pendingAckSeq > 0) {
|
|
1791
|
+
this.ensureDeliveryCurrent(ns, generation, inlineGeneration);
|
|
1792
|
+
await this.confirmForwardP2PAck(pendingAckSeq);
|
|
1793
|
+
pendingAckSeq = 0;
|
|
1794
1794
|
}
|
|
1795
1795
|
client._delivery.onPullWorkSettled?.();
|
|
1796
1796
|
return deduplicatePulledResults(decrypted);
|
|
@@ -1864,8 +1864,11 @@ export class V2E2EECoordinator {
|
|
|
1864
1864
|
}
|
|
1865
1865
|
async confirmForwardP2PAck(upToSeq, inlineGeneration) {
|
|
1866
1866
|
const ns = this.client._aid ? `p2p:${this.client._aid}` : '';
|
|
1867
|
+
const generation = Number(this.client._v2RuntimeGeneration ?? 0);
|
|
1868
|
+
const deliveryGeneration = this.client._delivery.captureInlineGeneration?.();
|
|
1867
1869
|
try {
|
|
1868
1870
|
const result = await this.ackV2ForForward(upToSeq, inlineGeneration);
|
|
1871
|
+
this.ensureDeliveryCurrent(ns, generation, deliveryGeneration);
|
|
1869
1872
|
const actualAckSeq = this.client._delivery?.resolveForwardAckSeq?.(result, upToSeq) ?? 0;
|
|
1870
1873
|
if (actualAckSeq < upToSeq) {
|
|
1871
1874
|
throw new E2EEError(`message.v2.ack server ACK watermark ${actualAckSeq} is below requested ${upToSeq}`);
|
|
@@ -1873,7 +1876,10 @@ export class V2E2EECoordinator {
|
|
|
1873
1876
|
this.clearForwardAck(ns, upToSeq);
|
|
1874
1877
|
}
|
|
1875
1878
|
catch (exc) {
|
|
1876
|
-
this.
|
|
1879
|
+
if (Number(this.client._v2RuntimeGeneration ?? 0) === generation
|
|
1880
|
+
&& (deliveryGeneration === undefined || this.client._delivery.isInlineGenerationCurrent(deliveryGeneration))
|
|
1881
|
+
&& this.client._rpcPipeline?.isPullNamespaceCurrent?.(ns) !== false)
|
|
1882
|
+
this.recordForwardAck(ns, upToSeq);
|
|
1877
1883
|
throw exc;
|
|
1878
1884
|
}
|
|
1879
1885
|
}
|
|
@@ -2164,13 +2170,13 @@ export class V2E2EECoordinator {
|
|
|
2164
2170
|
let pageCount = 0;
|
|
2165
2171
|
let lastAutoAckSeq = 0;
|
|
2166
2172
|
let pendingAckSeq = deferredForwardAck;
|
|
2173
|
+
let committedAckSeq = ownsCursor ? client._seqTracker.getContiguousSeq(ns) : 0;
|
|
2167
2174
|
const maxPages = Math.max(1, Math.min(100, Math.trunc(Number(opts?.maxPages ?? 100) || 100)));
|
|
2168
2175
|
let pipelineRunning = false;
|
|
2169
2176
|
let pipelineError = null;
|
|
2170
2177
|
const pipelineQueue = new V2PullPageQueue(V2_PULL_PIPELINE_QUEUE_CAPACITY);
|
|
2171
2178
|
let pipelineProducer = null;
|
|
2172
2179
|
let pipelineStopped = false;
|
|
2173
|
-
let pipelineResume = null;
|
|
2174
2180
|
const startPipeline = (startAfterSeq) => {
|
|
2175
2181
|
if (pipelineRunning || pageCount >= maxPages || limit < V2_PULL_MAX_PAGE_LIMIT || !ownsCursor)
|
|
2176
2182
|
return;
|
|
@@ -2180,30 +2186,32 @@ export class V2E2EECoordinator {
|
|
|
2180
2186
|
for (let produced = pageCount; produced < maxPages; produced += 1) {
|
|
2181
2187
|
if (pipelineStopped)
|
|
2182
2188
|
break;
|
|
2189
|
+
this.ensureDeliveryCurrent(ns, generation, inlineGeneration);
|
|
2190
|
+
const ackUpToSeq = Math.min(pendingAckSeq, committedAckSeq);
|
|
2191
|
+
const inlineAckGeneration = ackUpToSeq > 0
|
|
2192
|
+
? client._delivery?.pendingGroupInlineAckGeneration?.(ns) ?? null : null;
|
|
2183
2193
|
const result = await client._callRawV2Rpc('group.v2.pull', withExplicitGroupAid({
|
|
2184
2194
|
group_id: wireGroupId,
|
|
2185
2195
|
after_seq: producerAfterSeq,
|
|
2186
2196
|
limit,
|
|
2187
2197
|
...cursorParams,
|
|
2188
2198
|
...(opts?.force ? { force: true } : {}),
|
|
2199
|
+
...(ackUpToSeq > 0 ? { ack_up_to_seq: ackUpToSeq } : {}),
|
|
2189
2200
|
}, groupAid), pullGateKey);
|
|
2190
2201
|
if (pipelineStopped)
|
|
2191
2202
|
break;
|
|
2203
|
+
this.ensureDeliveryCurrent(ns, generation, inlineGeneration);
|
|
2192
2204
|
const pageMessages = (Array.isArray(result?.messages) ? result.messages : []);
|
|
2193
|
-
const completed = new Promise((resolve) => { pipelineResume = resolve; });
|
|
2194
2205
|
const enqueued = await pipelineQueue.put({
|
|
2195
2206
|
result,
|
|
2196
2207
|
afterSeq: producerAfterSeq,
|
|
2197
|
-
ackUpToSeq
|
|
2198
|
-
inlineAckGeneration
|
|
2208
|
+
ackUpToSeq,
|
|
2209
|
+
inlineAckGeneration,
|
|
2199
2210
|
requestedVolatileCursor: '',
|
|
2200
2211
|
weight: pageMessages.length,
|
|
2201
2212
|
}, pageMessages.length);
|
|
2202
2213
|
if (!enqueued || pipelineStopped)
|
|
2203
2214
|
break;
|
|
2204
|
-
await completed;
|
|
2205
|
-
if (pipelineStopped)
|
|
2206
|
-
break;
|
|
2207
2215
|
const messages = deduplicateForwardPageMessages(pageMessages, producerAfterSeq);
|
|
2208
2216
|
const seqs = messages.map((msg) => Number(msg.seq ?? 0)).filter((seq) => Number.isFinite(seq) && seq > 0);
|
|
2209
2217
|
const nextAfter = Math.max(contiguousPullSeq(producerAfterSeq, seqs, result.contiguous_seq), producerAfterSeq);
|
|
@@ -2232,8 +2240,6 @@ export class V2E2EECoordinator {
|
|
|
2232
2240
|
};
|
|
2233
2241
|
const stopPipeline = async () => {
|
|
2234
2242
|
pipelineStopped = true;
|
|
2235
|
-
pipelineResume?.();
|
|
2236
|
-
pipelineResume = null;
|
|
2237
2243
|
pipelineQueue.close();
|
|
2238
2244
|
if (pipelineProducer) {
|
|
2239
2245
|
const producer = pipelineProducer;
|
|
@@ -2274,21 +2280,24 @@ export class V2E2EECoordinator {
|
|
|
2274
2280
|
...(ackUpToSeq > 0 ? { ack_up_to_seq: ackUpToSeq } : {}),
|
|
2275
2281
|
}, groupAid), pullGateKey);
|
|
2276
2282
|
}
|
|
2283
|
+
this.ensureDeliveryCurrent(ns, generation, inlineGeneration);
|
|
2284
|
+
if (ownsCursor && !opts?.force)
|
|
2285
|
+
client._delivery.observeBackgroundPullResponse?.(ns, nextAfterSeq, result, limit);
|
|
2277
2286
|
if (ackUpToSeq > 0) {
|
|
2278
2287
|
const actualAckSeq = client._delivery?.resolveGroupPullAckSeq?.(result, ackUpToSeq) ?? 0;
|
|
2279
2288
|
if (actualAckSeq >= ackUpToSeq) {
|
|
2280
2289
|
if (pendingInlineGeneration !== null) {
|
|
2281
2290
|
client._delivery?.completePendingGroupInlineAckUpTo?.(ns, actualAckSeq, pendingInlineGeneration);
|
|
2282
2291
|
}
|
|
2283
|
-
pendingAckSeq
|
|
2292
|
+
if (pendingAckSeq <= ackUpToSeq)
|
|
2293
|
+
pendingAckSeq = 0;
|
|
2284
2294
|
lastAutoAckSeq = Math.max(lastAutoAckSeq, ackUpToSeq);
|
|
2285
2295
|
this.clearForwardAck(ns, ackUpToSeq);
|
|
2286
2296
|
}
|
|
2287
2297
|
else {
|
|
2288
2298
|
client._clientLog.warn(`group.v2.pull piggyback ACK below target: group=${gid}, requested=${ackUpToSeq}, actual=${actualAckSeq}; fallback terminal ACK`);
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
lastAutoAckSeq = Math.max(lastAutoAckSeq, ackUpToSeq);
|
|
2299
|
+
pendingAckSeq = Math.max(pendingAckSeq, ackUpToSeq);
|
|
2300
|
+
this.recordForwardAck(ns, ackUpToSeq);
|
|
2292
2301
|
}
|
|
2293
2302
|
}
|
|
2294
2303
|
const resultGroupAid = String(result.group_aid ?? result.groupAid ?? '').trim();
|
|
@@ -2308,6 +2317,13 @@ export class V2E2EECoordinator {
|
|
|
2308
2317
|
let pageTrackerSnapshot;
|
|
2309
2318
|
const pageMaxSeq = seqs.length > 0 ? Math.max(...seqs) : nextAfterSeq;
|
|
2310
2319
|
const pageContiguousSeq = contiguousPullSeq(pageContigBefore, seqs, result.contiguous_seq);
|
|
2320
|
+
if (!pipelineRunning && shouldContinueForwardPage({
|
|
2321
|
+
rawCount: messages.length, nextAfterSeq, nextAfter: pageMaxSeq, limit,
|
|
2322
|
+
hasMoreField, hasMore, serverHead, pendingAckSeq: 0,
|
|
2323
|
+
observedUpper: typeof client._seqTracker.getMaxSeenSeq === 'function'
|
|
2324
|
+
? client._seqTracker.getMaxSeenSeq(ns) : pageMaxSeq,
|
|
2325
|
+
}))
|
|
2326
|
+
startPipeline(pageMaxSeq);
|
|
2311
2327
|
const deferredKeyFetches = new Map();
|
|
2312
2328
|
let blockedSeq = 0;
|
|
2313
2329
|
const pageDecryptedBefore = decrypted.length;
|
|
@@ -2475,6 +2491,7 @@ export class V2E2EECoordinator {
|
|
|
2475
2491
|
this.clearForwardCursor(ns, ackSeq);
|
|
2476
2492
|
}
|
|
2477
2493
|
client._delivery.completePendingTailWindow?.(ns);
|
|
2494
|
+
committedAckSeq = ackSeq;
|
|
2478
2495
|
}
|
|
2479
2496
|
catch (exc) {
|
|
2480
2497
|
if (Number(client._v2RuntimeGeneration ?? 0) === generation
|
|
@@ -2507,16 +2524,7 @@ export class V2E2EECoordinator {
|
|
|
2507
2524
|
|| (contigAdvanced && ackSeq > knownServerCursorSeq));
|
|
2508
2525
|
if (ackNeeded) {
|
|
2509
2526
|
this.recordForwardAck(ns, ackSeq);
|
|
2510
|
-
|
|
2511
|
-
const canContinuePage = blockedSeq <= 0 && messages.length > 0 && nextAfter > nextAfterSeq && ownsCursor;
|
|
2512
|
-
if (canContinuePage && !pipelineRunning) {
|
|
2513
|
-
pendingAckSeq = Math.max(pendingAckSeq, ackSeq);
|
|
2514
|
-
lastAutoAckSeq = Math.max(lastAutoAckSeq, ackSeq);
|
|
2515
|
-
}
|
|
2516
|
-
else {
|
|
2517
|
-
await this.confirmForwardGroupAck(gid, ackSeq, groupAid);
|
|
2518
|
-
lastAutoAckSeq = Math.max(lastAutoAckSeq, ackSeq);
|
|
2519
|
-
}
|
|
2527
|
+
pendingAckSeq = Math.max(pendingAckSeq, ackSeq);
|
|
2520
2528
|
}
|
|
2521
2529
|
const nextAfter = Math.max(pageContiguousSeq, nextAfterSeq);
|
|
2522
2530
|
if (!ownsCursor)
|
|
@@ -2550,15 +2558,7 @@ export class V2E2EECoordinator {
|
|
|
2550
2558
|
});
|
|
2551
2559
|
if (!shouldContinue)
|
|
2552
2560
|
break;
|
|
2553
|
-
if (pipelinePage) {
|
|
2554
|
-
pipelineResume?.();
|
|
2555
|
-
pipelineResume = null;
|
|
2556
|
-
}
|
|
2557
2561
|
if (shouldContinueForPipeline && !pipelineRunning && limit >= V2_PULL_MAX_PAGE_LIMIT) {
|
|
2558
|
-
if (pendingAckSeq > 0) {
|
|
2559
|
-
await this.confirmForwardGroupAck(gid, pendingAckSeq, groupAid);
|
|
2560
|
-
pendingAckSeq = 0;
|
|
2561
|
-
}
|
|
2562
2562
|
startPipeline(nextAfter);
|
|
2563
2563
|
}
|
|
2564
2564
|
if (!pipelineRunning && pullGateKey && opts?.gateLocked && client._rpcPipeline?.yieldPullGate) {
|
|
@@ -2570,7 +2570,7 @@ export class V2E2EECoordinator {
|
|
|
2570
2570
|
pullGateKey = nextKey;
|
|
2571
2571
|
}
|
|
2572
2572
|
const tailDelayMs = v2PullTailDelayMs(rawCount, limit);
|
|
2573
|
-
if (tailDelayMs > 0)
|
|
2573
|
+
if (!pipelineRunning && tailDelayMs > 0)
|
|
2574
2574
|
await v2Sleep(tailDelayMs);
|
|
2575
2575
|
nextAfterSeq = nextAfter;
|
|
2576
2576
|
}
|
|
@@ -2580,18 +2580,22 @@ export class V2E2EECoordinator {
|
|
|
2580
2580
|
}
|
|
2581
2581
|
if (pageCount >= maxPages) {
|
|
2582
2582
|
client._clientLog.warn(`group.v2.pull reached max_pages=${maxPages} group=${gid} after_seq=${nextAfterSeq}`);
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2583
|
+
}
|
|
2584
|
+
if (pendingAckSeq > 0) {
|
|
2585
|
+
this.ensureDeliveryCurrent(ns, generation, inlineGeneration);
|
|
2586
|
+
await this.confirmForwardGroupAck(gid, pendingAckSeq, groupAid);
|
|
2587
|
+
pendingAckSeq = 0;
|
|
2587
2588
|
}
|
|
2588
2589
|
client._delivery.onPullWorkSettled?.();
|
|
2589
2590
|
return deduplicatePulledResults(decrypted);
|
|
2590
2591
|
}
|
|
2591
2592
|
async confirmForwardGroupAck(groupId, upToSeq, groupAid) {
|
|
2592
2593
|
const ns = `group:${String(groupId ?? '').trim()}`;
|
|
2594
|
+
const generation = Number(this.client._v2RuntimeGeneration ?? 0);
|
|
2595
|
+
const deliveryGeneration = this.client._delivery.captureInlineGeneration?.();
|
|
2593
2596
|
try {
|
|
2594
2597
|
const result = await this.ackGroupV2ForForward(groupId, upToSeq, groupAid);
|
|
2598
|
+
this.ensureDeliveryCurrent(ns, generation, deliveryGeneration);
|
|
2595
2599
|
const actualAckSeq = this.client._delivery?.resolveForwardAckSeq?.(result, upToSeq) ?? 0;
|
|
2596
2600
|
if (actualAckSeq < upToSeq) {
|
|
2597
2601
|
throw new E2EEError(`group.v2.ack server ACK watermark ${actualAckSeq} is below requested ${upToSeq}`);
|
|
@@ -2599,7 +2603,10 @@ export class V2E2EECoordinator {
|
|
|
2599
2603
|
this.clearForwardAck(ns, upToSeq);
|
|
2600
2604
|
}
|
|
2601
2605
|
catch (exc) {
|
|
2602
|
-
this.
|
|
2606
|
+
if (Number(this.client._v2RuntimeGeneration ?? 0) === generation
|
|
2607
|
+
&& (deliveryGeneration === undefined || this.client._delivery.isInlineGenerationCurrent(deliveryGeneration))
|
|
2608
|
+
&& this.client._rpcPipeline?.isPullNamespaceCurrent?.(ns) !== false)
|
|
2609
|
+
this.recordForwardAck(ns, upToSeq);
|
|
2603
2610
|
throw exc;
|
|
2604
2611
|
}
|
|
2605
2612
|
}
|
|
@@ -3182,11 +3189,19 @@ export class V2E2EECoordinator {
|
|
|
3182
3189
|
});
|
|
3183
3190
|
}
|
|
3184
3191
|
}
|
|
3192
|
+
const targetDeviceId = String(opts.deviceId ?? '').trim();
|
|
3185
3193
|
if (peerDevices.length === 0) {
|
|
3194
|
+
if (targetDeviceId && useCache) {
|
|
3195
|
+
this.deleteBootstrapCacheEntry(to);
|
|
3196
|
+
return this.buildV2P2PEnvelope({ ...opts, useCache: false });
|
|
3197
|
+
}
|
|
3186
3198
|
throw new E2EEError(`V2 bootstrap: no devices found for ${to}`);
|
|
3187
3199
|
}
|
|
3188
|
-
const targetDeviceId = String(opts.deviceId ?? '').trim();
|
|
3189
3200
|
if (targetDeviceId && !peerDevices.some((dev) => String(dev.device_id ?? '').trim() === targetDeviceId)) {
|
|
3201
|
+
if (useCache) {
|
|
3202
|
+
this.deleteBootstrapCacheEntry(to);
|
|
3203
|
+
return this.buildV2P2PEnvelope({ ...opts, useCache: false });
|
|
3204
|
+
}
|
|
3190
3205
|
throw new E2EEError(`V2 bootstrap: target device ${targetDeviceId} not found for ${to}`);
|
|
3191
3206
|
}
|
|
3192
3207
|
let targetSet = useCache ? this.getTargetSetCache(to) : undefined;
|
|
@@ -3277,6 +3292,10 @@ export class V2E2EECoordinator {
|
|
|
3277
3292
|
return isPeerTarget || target.role === 'self_sync';
|
|
3278
3293
|
});
|
|
3279
3294
|
if (!peerTargetFound) {
|
|
3295
|
+
if (useCache) {
|
|
3296
|
+
this.deleteBootstrapCacheEntry(to);
|
|
3297
|
+
return this.buildV2P2PEnvelope({ ...opts, useCache: false });
|
|
3298
|
+
}
|
|
3280
3299
|
throw new E2EEError(`V2 bootstrap: target device ${targetDeviceId} not found for ${to}`);
|
|
3281
3300
|
}
|
|
3282
3301
|
}
|