@astrasyncai/verification-gateway 5.13.0 → 5.14.0
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/dist/adapters/express.js +28 -10
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +28 -10
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.js +1 -1
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +1 -1
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.js +28 -10
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +28 -10
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.js +1 -1
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +1 -1
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +28 -10
- package/dist/bin/astrasync-codex-hook.js +28 -10
- package/dist/bin/astrasync-guard.js +28 -10
- package/dist/bin/astrasync.js +29 -11
- package/dist/browser/background.js +28 -10
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +28 -10
- package/dist/browser/background.mjs.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/codex/index.js +28 -10
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +28 -10
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +28 -10
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +28 -10
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.js +1 -1
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +1 -1
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +32 -4
- package/dist/edge-core/index.d.ts +32 -4
- package/dist/edge-core/index.js +28 -10
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +28 -10
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +28 -10
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +28 -10
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +28 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -10
- package/dist/index.mjs.map +1 -1
- package/dist/registration/index.js +1 -1
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +1 -1
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +1 -1
- package/dist/transport/index.mjs.map +1 -1
- package/dist/verify.js +1 -1
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +1 -1
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -3752,7 +3752,7 @@ function getTrustLevel(score) {
|
|
|
3752
3752
|
}
|
|
3753
3753
|
|
|
3754
3754
|
// src/version.ts
|
|
3755
|
-
var SDK_VERSION = "5.
|
|
3755
|
+
var SDK_VERSION = "5.14.0";
|
|
3756
3756
|
|
|
3757
3757
|
// src/http.ts
|
|
3758
3758
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -4422,6 +4422,11 @@ async function withBudget(promise, ms) {
|
|
|
4422
4422
|
if (timer) clearTimeout(timer);
|
|
4423
4423
|
}
|
|
4424
4424
|
}
|
|
4425
|
+
var CONTAINER_ID = (() => {
|
|
4426
|
+
const c = globalThis.crypto;
|
|
4427
|
+
if (c?.randomUUID) return c.randomUUID();
|
|
4428
|
+
return `c-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
|
|
4429
|
+
})();
|
|
4425
4430
|
var destKeyOf = (d) => `${d.apiBaseUrl}\0${d.apiKey ?? ""}\0${d.counterparty}\0${d.adapter ?? ""}`;
|
|
4426
4431
|
var BeaconBuffer = class {
|
|
4427
4432
|
constructor(options = {}) {
|
|
@@ -4429,6 +4434,7 @@ var BeaconBuffer = class {
|
|
|
4429
4434
|
this.droppedSinceLast = 0;
|
|
4430
4435
|
this.droppedTotal = 0;
|
|
4431
4436
|
this.deliveredTotal = 0;
|
|
4437
|
+
this.enqueuedTotal = 0;
|
|
4432
4438
|
this.backoffUntil = 0;
|
|
4433
4439
|
this.collapse = /* @__PURE__ */ new Map();
|
|
4434
4440
|
/** Keys the backend answered 401 for — later batches go unauthenticated. */
|
|
@@ -4441,13 +4447,16 @@ var BeaconBuffer = class {
|
|
|
4441
4447
|
collapseMaxKeys: options.collapseMaxKeys ?? 1e3,
|
|
4442
4448
|
requestTimeoutMs: options.requestTimeoutMs ?? 1e4,
|
|
4443
4449
|
retryBackoffMs: options.retryBackoffMs ?? 1e3,
|
|
4450
|
+
holdRepeats: options.holdRepeats ?? false,
|
|
4451
|
+
containerId: options.containerId ?? CONTAINER_ID,
|
|
4444
4452
|
now: options.now ?? Date.now
|
|
4445
4453
|
};
|
|
4446
4454
|
}
|
|
4447
4455
|
/**
|
|
4448
4456
|
* Queue one beacon. With a `collapseKey`, a repeat inside the window is
|
|
4449
|
-
* merged into
|
|
4450
|
-
*
|
|
4457
|
+
* merged into this key's item while that item is still queued (not yet in
|
|
4458
|
+
* flight). Once it has left, the repeat becomes a new item, sendable on
|
|
4459
|
+
* this flush — nothing waits for a later invocation (round 27.6).
|
|
4451
4460
|
*/
|
|
4452
4461
|
enqueue(dest, item, collapseKey) {
|
|
4453
4462
|
const now = this.opts.now();
|
|
@@ -4460,12 +4469,15 @@ var BeaconBuffer = class {
|
|
|
4460
4469
|
return;
|
|
4461
4470
|
}
|
|
4462
4471
|
}
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4468
|
-
|
|
4472
|
+
if (this.opts.holdRepeats) {
|
|
4473
|
+
entry.held = this.push(
|
|
4474
|
+
dest,
|
|
4475
|
+
{ ...item, repeatCount: 1 },
|
|
4476
|
+
entry.firstSeenAt + this.opts.collapseWindowMs
|
|
4477
|
+
);
|
|
4478
|
+
return;
|
|
4479
|
+
}
|
|
4480
|
+
entry.first = this.push(dest, { ...item, repeatCount: 1 }, now);
|
|
4469
4481
|
return;
|
|
4470
4482
|
}
|
|
4471
4483
|
this.collapse.delete(collapseKey);
|
|
@@ -4501,6 +4513,7 @@ var BeaconBuffer = class {
|
|
|
4501
4513
|
droppedSinceLast: this.droppedSinceLast,
|
|
4502
4514
|
droppedTotal: this.droppedTotal,
|
|
4503
4515
|
deliveredTotal: this.deliveredTotal,
|
|
4516
|
+
enqueuedTotal: this.enqueuedTotal,
|
|
4504
4517
|
flushing: this.inFlight !== void 0
|
|
4505
4518
|
};
|
|
4506
4519
|
}
|
|
@@ -4515,6 +4528,7 @@ var BeaconBuffer = class {
|
|
|
4515
4528
|
inFlight: false
|
|
4516
4529
|
};
|
|
4517
4530
|
this.queue.push(entry);
|
|
4531
|
+
this.enqueuedTotal += 1;
|
|
4518
4532
|
return entry;
|
|
4519
4533
|
}
|
|
4520
4534
|
dropOldest() {
|
|
@@ -4560,7 +4574,11 @@ var BeaconBuffer = class {
|
|
|
4560
4574
|
droppedSinceLast: reportedDropped,
|
|
4561
4575
|
queueDepth: this.queue.length,
|
|
4562
4576
|
adapter: dest.adapter ?? "edge-core",
|
|
4563
|
-
version: SDK_VERSION
|
|
4577
|
+
version: SDK_VERSION,
|
|
4578
|
+
containerId: this.opts.containerId,
|
|
4579
|
+
enqueuedTotal: this.enqueuedTotal,
|
|
4580
|
+
deliveredTotal: this.deliveredTotal,
|
|
4581
|
+
droppedTotal: this.droppedTotal
|
|
4564
4582
|
};
|
|
4565
4583
|
const controller = typeof AbortController !== "undefined" ? new AbortController() : void 0;
|
|
4566
4584
|
const response = await withBudget(
|
|
@@ -3751,7 +3751,7 @@ function getTrustLevel(score) {
|
|
|
3751
3751
|
}
|
|
3752
3752
|
|
|
3753
3753
|
// src/version.ts
|
|
3754
|
-
var SDK_VERSION = "5.
|
|
3754
|
+
var SDK_VERSION = "5.14.0";
|
|
3755
3755
|
|
|
3756
3756
|
// src/http.ts
|
|
3757
3757
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -4421,6 +4421,11 @@ async function withBudget(promise, ms) {
|
|
|
4421
4421
|
if (timer) clearTimeout(timer);
|
|
4422
4422
|
}
|
|
4423
4423
|
}
|
|
4424
|
+
var CONTAINER_ID = (() => {
|
|
4425
|
+
const c = globalThis.crypto;
|
|
4426
|
+
if (c?.randomUUID) return c.randomUUID();
|
|
4427
|
+
return `c-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
|
|
4428
|
+
})();
|
|
4424
4429
|
var destKeyOf = (d) => `${d.apiBaseUrl}\0${d.apiKey ?? ""}\0${d.counterparty}\0${d.adapter ?? ""}`;
|
|
4425
4430
|
var BeaconBuffer = class {
|
|
4426
4431
|
constructor(options = {}) {
|
|
@@ -4428,6 +4433,7 @@ var BeaconBuffer = class {
|
|
|
4428
4433
|
this.droppedSinceLast = 0;
|
|
4429
4434
|
this.droppedTotal = 0;
|
|
4430
4435
|
this.deliveredTotal = 0;
|
|
4436
|
+
this.enqueuedTotal = 0;
|
|
4431
4437
|
this.backoffUntil = 0;
|
|
4432
4438
|
this.collapse = /* @__PURE__ */ new Map();
|
|
4433
4439
|
/** Keys the backend answered 401 for — later batches go unauthenticated. */
|
|
@@ -4440,13 +4446,16 @@ var BeaconBuffer = class {
|
|
|
4440
4446
|
collapseMaxKeys: options.collapseMaxKeys ?? 1e3,
|
|
4441
4447
|
requestTimeoutMs: options.requestTimeoutMs ?? 1e4,
|
|
4442
4448
|
retryBackoffMs: options.retryBackoffMs ?? 1e3,
|
|
4449
|
+
holdRepeats: options.holdRepeats ?? false,
|
|
4450
|
+
containerId: options.containerId ?? CONTAINER_ID,
|
|
4443
4451
|
now: options.now ?? Date.now
|
|
4444
4452
|
};
|
|
4445
4453
|
}
|
|
4446
4454
|
/**
|
|
4447
4455
|
* Queue one beacon. With a `collapseKey`, a repeat inside the window is
|
|
4448
|
-
* merged into
|
|
4449
|
-
*
|
|
4456
|
+
* merged into this key's item while that item is still queued (not yet in
|
|
4457
|
+
* flight). Once it has left, the repeat becomes a new item, sendable on
|
|
4458
|
+
* this flush — nothing waits for a later invocation (round 27.6).
|
|
4450
4459
|
*/
|
|
4451
4460
|
enqueue(dest, item, collapseKey) {
|
|
4452
4461
|
const now = this.opts.now();
|
|
@@ -4459,12 +4468,15 @@ var BeaconBuffer = class {
|
|
|
4459
4468
|
return;
|
|
4460
4469
|
}
|
|
4461
4470
|
}
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4467
|
-
|
|
4471
|
+
if (this.opts.holdRepeats) {
|
|
4472
|
+
entry.held = this.push(
|
|
4473
|
+
dest,
|
|
4474
|
+
{ ...item, repeatCount: 1 },
|
|
4475
|
+
entry.firstSeenAt + this.opts.collapseWindowMs
|
|
4476
|
+
);
|
|
4477
|
+
return;
|
|
4478
|
+
}
|
|
4479
|
+
entry.first = this.push(dest, { ...item, repeatCount: 1 }, now);
|
|
4468
4480
|
return;
|
|
4469
4481
|
}
|
|
4470
4482
|
this.collapse.delete(collapseKey);
|
|
@@ -4500,6 +4512,7 @@ var BeaconBuffer = class {
|
|
|
4500
4512
|
droppedSinceLast: this.droppedSinceLast,
|
|
4501
4513
|
droppedTotal: this.droppedTotal,
|
|
4502
4514
|
deliveredTotal: this.deliveredTotal,
|
|
4515
|
+
enqueuedTotal: this.enqueuedTotal,
|
|
4503
4516
|
flushing: this.inFlight !== void 0
|
|
4504
4517
|
};
|
|
4505
4518
|
}
|
|
@@ -4514,6 +4527,7 @@ var BeaconBuffer = class {
|
|
|
4514
4527
|
inFlight: false
|
|
4515
4528
|
};
|
|
4516
4529
|
this.queue.push(entry);
|
|
4530
|
+
this.enqueuedTotal += 1;
|
|
4517
4531
|
return entry;
|
|
4518
4532
|
}
|
|
4519
4533
|
dropOldest() {
|
|
@@ -4559,7 +4573,11 @@ var BeaconBuffer = class {
|
|
|
4559
4573
|
droppedSinceLast: reportedDropped,
|
|
4560
4574
|
queueDepth: this.queue.length,
|
|
4561
4575
|
adapter: dest.adapter ?? "edge-core",
|
|
4562
|
-
version: SDK_VERSION
|
|
4576
|
+
version: SDK_VERSION,
|
|
4577
|
+
containerId: this.opts.containerId,
|
|
4578
|
+
enqueuedTotal: this.enqueuedTotal,
|
|
4579
|
+
deliveredTotal: this.deliveredTotal,
|
|
4580
|
+
droppedTotal: this.droppedTotal
|
|
4563
4581
|
};
|
|
4564
4582
|
const controller = typeof AbortController !== "undefined" ? new AbortController() : void 0;
|
|
4565
4583
|
const response = await withBudget(
|
|
@@ -3713,7 +3713,7 @@ Policy saved to ${outputPath}`);
|
|
|
3713
3713
|
};
|
|
3714
3714
|
|
|
3715
3715
|
// src/version.ts
|
|
3716
|
-
var SDK_VERSION = "5.
|
|
3716
|
+
var SDK_VERSION = "5.14.0";
|
|
3717
3717
|
|
|
3718
3718
|
// src/http.ts
|
|
3719
3719
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -5287,6 +5287,11 @@ async function withBudget(promise, ms) {
|
|
|
5287
5287
|
if (timer) clearTimeout(timer);
|
|
5288
5288
|
}
|
|
5289
5289
|
}
|
|
5290
|
+
var CONTAINER_ID = (() => {
|
|
5291
|
+
const c = globalThis.crypto;
|
|
5292
|
+
if (c?.randomUUID) return c.randomUUID();
|
|
5293
|
+
return `c-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
|
|
5294
|
+
})();
|
|
5290
5295
|
var destKeyOf = (d) => `${d.apiBaseUrl}\0${d.apiKey ?? ""}\0${d.counterparty}\0${d.adapter ?? ""}`;
|
|
5291
5296
|
var BeaconBuffer = class {
|
|
5292
5297
|
constructor(options = {}) {
|
|
@@ -5294,6 +5299,7 @@ var BeaconBuffer = class {
|
|
|
5294
5299
|
this.droppedSinceLast = 0;
|
|
5295
5300
|
this.droppedTotal = 0;
|
|
5296
5301
|
this.deliveredTotal = 0;
|
|
5302
|
+
this.enqueuedTotal = 0;
|
|
5297
5303
|
this.backoffUntil = 0;
|
|
5298
5304
|
this.collapse = /* @__PURE__ */ new Map();
|
|
5299
5305
|
/** Keys the backend answered 401 for — later batches go unauthenticated. */
|
|
@@ -5306,13 +5312,16 @@ var BeaconBuffer = class {
|
|
|
5306
5312
|
collapseMaxKeys: options.collapseMaxKeys ?? 1e3,
|
|
5307
5313
|
requestTimeoutMs: options.requestTimeoutMs ?? 1e4,
|
|
5308
5314
|
retryBackoffMs: options.retryBackoffMs ?? 1e3,
|
|
5315
|
+
holdRepeats: options.holdRepeats ?? false,
|
|
5316
|
+
containerId: options.containerId ?? CONTAINER_ID,
|
|
5309
5317
|
now: options.now ?? Date.now
|
|
5310
5318
|
};
|
|
5311
5319
|
}
|
|
5312
5320
|
/**
|
|
5313
5321
|
* Queue one beacon. With a `collapseKey`, a repeat inside the window is
|
|
5314
|
-
* merged into
|
|
5315
|
-
*
|
|
5322
|
+
* merged into this key's item while that item is still queued (not yet in
|
|
5323
|
+
* flight). Once it has left, the repeat becomes a new item, sendable on
|
|
5324
|
+
* this flush — nothing waits for a later invocation (round 27.6).
|
|
5316
5325
|
*/
|
|
5317
5326
|
enqueue(dest, item, collapseKey) {
|
|
5318
5327
|
const now = this.opts.now();
|
|
@@ -5325,12 +5334,15 @@ var BeaconBuffer = class {
|
|
|
5325
5334
|
return;
|
|
5326
5335
|
}
|
|
5327
5336
|
}
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5337
|
+
if (this.opts.holdRepeats) {
|
|
5338
|
+
entry.held = this.push(
|
|
5339
|
+
dest,
|
|
5340
|
+
{ ...item, repeatCount: 1 },
|
|
5341
|
+
entry.firstSeenAt + this.opts.collapseWindowMs
|
|
5342
|
+
);
|
|
5343
|
+
return;
|
|
5344
|
+
}
|
|
5345
|
+
entry.first = this.push(dest, { ...item, repeatCount: 1 }, now);
|
|
5334
5346
|
return;
|
|
5335
5347
|
}
|
|
5336
5348
|
this.collapse.delete(collapseKey);
|
|
@@ -5366,6 +5378,7 @@ var BeaconBuffer = class {
|
|
|
5366
5378
|
droppedSinceLast: this.droppedSinceLast,
|
|
5367
5379
|
droppedTotal: this.droppedTotal,
|
|
5368
5380
|
deliveredTotal: this.deliveredTotal,
|
|
5381
|
+
enqueuedTotal: this.enqueuedTotal,
|
|
5369
5382
|
flushing: this.inFlight !== void 0
|
|
5370
5383
|
};
|
|
5371
5384
|
}
|
|
@@ -5380,6 +5393,7 @@ var BeaconBuffer = class {
|
|
|
5380
5393
|
inFlight: false
|
|
5381
5394
|
};
|
|
5382
5395
|
this.queue.push(entry);
|
|
5396
|
+
this.enqueuedTotal += 1;
|
|
5383
5397
|
return entry;
|
|
5384
5398
|
}
|
|
5385
5399
|
dropOldest() {
|
|
@@ -5425,7 +5439,11 @@ var BeaconBuffer = class {
|
|
|
5425
5439
|
droppedSinceLast: reportedDropped,
|
|
5426
5440
|
queueDepth: this.queue.length,
|
|
5427
5441
|
adapter: dest.adapter ?? "edge-core",
|
|
5428
|
-
version: SDK_VERSION
|
|
5442
|
+
version: SDK_VERSION,
|
|
5443
|
+
containerId: this.opts.containerId,
|
|
5444
|
+
enqueuedTotal: this.enqueuedTotal,
|
|
5445
|
+
deliveredTotal: this.deliveredTotal,
|
|
5446
|
+
droppedTotal: this.droppedTotal
|
|
5429
5447
|
};
|
|
5430
5448
|
const controller = typeof AbortController !== "undefined" ? new AbortController() : void 0;
|
|
5431
5449
|
const response = await withBudget(
|
package/dist/bin/astrasync.js
CHANGED
|
@@ -36,7 +36,7 @@ var SDK_VERSION;
|
|
|
36
36
|
var init_version = __esm({
|
|
37
37
|
"src/version.ts"() {
|
|
38
38
|
"use strict";
|
|
39
|
-
SDK_VERSION = "5.
|
|
39
|
+
SDK_VERSION = "5.14.0";
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
@@ -5817,7 +5817,7 @@ async function withBudget(promise, ms) {
|
|
|
5817
5817
|
if (timer) clearTimeout(timer);
|
|
5818
5818
|
}
|
|
5819
5819
|
}
|
|
5820
|
-
var destKeyOf, BeaconBuffer, beaconBuffer;
|
|
5820
|
+
var CONTAINER_ID, destKeyOf, BeaconBuffer, beaconBuffer;
|
|
5821
5821
|
var init_events = __esm({
|
|
5822
5822
|
"src/edge-core/events.ts"() {
|
|
5823
5823
|
"use strict";
|
|
@@ -5825,6 +5825,11 @@ var init_events = __esm({
|
|
|
5825
5825
|
init_metadata_capture();
|
|
5826
5826
|
init_version();
|
|
5827
5827
|
init_request();
|
|
5828
|
+
CONTAINER_ID = (() => {
|
|
5829
|
+
const c = globalThis.crypto;
|
|
5830
|
+
if (c?.randomUUID) return c.randomUUID();
|
|
5831
|
+
return `c-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
|
|
5832
|
+
})();
|
|
5828
5833
|
destKeyOf = (d) => `${d.apiBaseUrl}\0${d.apiKey ?? ""}\0${d.counterparty}\0${d.adapter ?? ""}`;
|
|
5829
5834
|
BeaconBuffer = class {
|
|
5830
5835
|
constructor(options = {}) {
|
|
@@ -5832,6 +5837,7 @@ var init_events = __esm({
|
|
|
5832
5837
|
this.droppedSinceLast = 0;
|
|
5833
5838
|
this.droppedTotal = 0;
|
|
5834
5839
|
this.deliveredTotal = 0;
|
|
5840
|
+
this.enqueuedTotal = 0;
|
|
5835
5841
|
this.backoffUntil = 0;
|
|
5836
5842
|
this.collapse = /* @__PURE__ */ new Map();
|
|
5837
5843
|
/** Keys the backend answered 401 for — later batches go unauthenticated. */
|
|
@@ -5844,13 +5850,16 @@ var init_events = __esm({
|
|
|
5844
5850
|
collapseMaxKeys: options.collapseMaxKeys ?? 1e3,
|
|
5845
5851
|
requestTimeoutMs: options.requestTimeoutMs ?? 1e4,
|
|
5846
5852
|
retryBackoffMs: options.retryBackoffMs ?? 1e3,
|
|
5853
|
+
holdRepeats: options.holdRepeats ?? false,
|
|
5854
|
+
containerId: options.containerId ?? CONTAINER_ID,
|
|
5847
5855
|
now: options.now ?? Date.now
|
|
5848
5856
|
};
|
|
5849
5857
|
}
|
|
5850
5858
|
/**
|
|
5851
5859
|
* Queue one beacon. With a `collapseKey`, a repeat inside the window is
|
|
5852
|
-
* merged into
|
|
5853
|
-
*
|
|
5860
|
+
* merged into this key's item while that item is still queued (not yet in
|
|
5861
|
+
* flight). Once it has left, the repeat becomes a new item, sendable on
|
|
5862
|
+
* this flush — nothing waits for a later invocation (round 27.6).
|
|
5854
5863
|
*/
|
|
5855
5864
|
enqueue(dest, item, collapseKey) {
|
|
5856
5865
|
const now = this.opts.now();
|
|
@@ -5863,12 +5872,15 @@ var init_events = __esm({
|
|
|
5863
5872
|
return;
|
|
5864
5873
|
}
|
|
5865
5874
|
}
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
|
|
5871
|
-
|
|
5875
|
+
if (this.opts.holdRepeats) {
|
|
5876
|
+
entry.held = this.push(
|
|
5877
|
+
dest,
|
|
5878
|
+
{ ...item, repeatCount: 1 },
|
|
5879
|
+
entry.firstSeenAt + this.opts.collapseWindowMs
|
|
5880
|
+
);
|
|
5881
|
+
return;
|
|
5882
|
+
}
|
|
5883
|
+
entry.first = this.push(dest, { ...item, repeatCount: 1 }, now);
|
|
5872
5884
|
return;
|
|
5873
5885
|
}
|
|
5874
5886
|
this.collapse.delete(collapseKey);
|
|
@@ -5904,6 +5916,7 @@ var init_events = __esm({
|
|
|
5904
5916
|
droppedSinceLast: this.droppedSinceLast,
|
|
5905
5917
|
droppedTotal: this.droppedTotal,
|
|
5906
5918
|
deliveredTotal: this.deliveredTotal,
|
|
5919
|
+
enqueuedTotal: this.enqueuedTotal,
|
|
5907
5920
|
flushing: this.inFlight !== void 0
|
|
5908
5921
|
};
|
|
5909
5922
|
}
|
|
@@ -5918,6 +5931,7 @@ var init_events = __esm({
|
|
|
5918
5931
|
inFlight: false
|
|
5919
5932
|
};
|
|
5920
5933
|
this.queue.push(entry);
|
|
5934
|
+
this.enqueuedTotal += 1;
|
|
5921
5935
|
return entry;
|
|
5922
5936
|
}
|
|
5923
5937
|
dropOldest() {
|
|
@@ -5963,7 +5977,11 @@ var init_events = __esm({
|
|
|
5963
5977
|
droppedSinceLast: reportedDropped,
|
|
5964
5978
|
queueDepth: this.queue.length,
|
|
5965
5979
|
adapter: dest.adapter ?? "edge-core",
|
|
5966
|
-
version: SDK_VERSION
|
|
5980
|
+
version: SDK_VERSION,
|
|
5981
|
+
containerId: this.opts.containerId,
|
|
5982
|
+
enqueuedTotal: this.enqueuedTotal,
|
|
5983
|
+
deliveredTotal: this.deliveredTotal,
|
|
5984
|
+
droppedTotal: this.droppedTotal
|
|
5967
5985
|
};
|
|
5968
5986
|
const controller = typeof AbortController !== "undefined" ? new AbortController() : void 0;
|
|
5969
5987
|
const response = await withBudget(
|
|
@@ -3988,7 +3988,7 @@ function getTrustLevel(score) {
|
|
|
3988
3988
|
}
|
|
3989
3989
|
|
|
3990
3990
|
// src/version.ts
|
|
3991
|
-
var SDK_VERSION = "5.
|
|
3991
|
+
var SDK_VERSION = "5.14.0";
|
|
3992
3992
|
|
|
3993
3993
|
// src/http.ts
|
|
3994
3994
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -4658,6 +4658,11 @@ async function withBudget(promise, ms) {
|
|
|
4658
4658
|
if (timer) clearTimeout(timer);
|
|
4659
4659
|
}
|
|
4660
4660
|
}
|
|
4661
|
+
var CONTAINER_ID = (() => {
|
|
4662
|
+
const c = globalThis.crypto;
|
|
4663
|
+
if (c?.randomUUID) return c.randomUUID();
|
|
4664
|
+
return `c-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 12)}`;
|
|
4665
|
+
})();
|
|
4661
4666
|
var destKeyOf = (d) => `${d.apiBaseUrl}\0${d.apiKey ?? ""}\0${d.counterparty}\0${d.adapter ?? ""}`;
|
|
4662
4667
|
var BeaconBuffer = class {
|
|
4663
4668
|
constructor(options = {}) {
|
|
@@ -4665,6 +4670,7 @@ var BeaconBuffer = class {
|
|
|
4665
4670
|
this.droppedSinceLast = 0;
|
|
4666
4671
|
this.droppedTotal = 0;
|
|
4667
4672
|
this.deliveredTotal = 0;
|
|
4673
|
+
this.enqueuedTotal = 0;
|
|
4668
4674
|
this.backoffUntil = 0;
|
|
4669
4675
|
this.collapse = /* @__PURE__ */ new Map();
|
|
4670
4676
|
/** Keys the backend answered 401 for — later batches go unauthenticated. */
|
|
@@ -4677,13 +4683,16 @@ var BeaconBuffer = class {
|
|
|
4677
4683
|
collapseMaxKeys: options.collapseMaxKeys ?? 1e3,
|
|
4678
4684
|
requestTimeoutMs: options.requestTimeoutMs ?? 1e4,
|
|
4679
4685
|
retryBackoffMs: options.retryBackoffMs ?? 1e3,
|
|
4686
|
+
holdRepeats: options.holdRepeats ?? false,
|
|
4687
|
+
containerId: options.containerId ?? CONTAINER_ID,
|
|
4680
4688
|
now: options.now ?? Date.now
|
|
4681
4689
|
};
|
|
4682
4690
|
}
|
|
4683
4691
|
/**
|
|
4684
4692
|
* Queue one beacon. With a `collapseKey`, a repeat inside the window is
|
|
4685
|
-
* merged into
|
|
4686
|
-
*
|
|
4693
|
+
* merged into this key's item while that item is still queued (not yet in
|
|
4694
|
+
* flight). Once it has left, the repeat becomes a new item, sendable on
|
|
4695
|
+
* this flush — nothing waits for a later invocation (round 27.6).
|
|
4687
4696
|
*/
|
|
4688
4697
|
enqueue(dest, item, collapseKey) {
|
|
4689
4698
|
const now = this.opts.now();
|
|
@@ -4696,12 +4705,15 @@ var BeaconBuffer = class {
|
|
|
4696
4705
|
return;
|
|
4697
4706
|
}
|
|
4698
4707
|
}
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
|
|
4703
|
-
|
|
4704
|
-
|
|
4708
|
+
if (this.opts.holdRepeats) {
|
|
4709
|
+
entry.held = this.push(
|
|
4710
|
+
dest,
|
|
4711
|
+
{ ...item, repeatCount: 1 },
|
|
4712
|
+
entry.firstSeenAt + this.opts.collapseWindowMs
|
|
4713
|
+
);
|
|
4714
|
+
return;
|
|
4715
|
+
}
|
|
4716
|
+
entry.first = this.push(dest, { ...item, repeatCount: 1 }, now);
|
|
4705
4717
|
return;
|
|
4706
4718
|
}
|
|
4707
4719
|
this.collapse.delete(collapseKey);
|
|
@@ -4737,6 +4749,7 @@ var BeaconBuffer = class {
|
|
|
4737
4749
|
droppedSinceLast: this.droppedSinceLast,
|
|
4738
4750
|
droppedTotal: this.droppedTotal,
|
|
4739
4751
|
deliveredTotal: this.deliveredTotal,
|
|
4752
|
+
enqueuedTotal: this.enqueuedTotal,
|
|
4740
4753
|
flushing: this.inFlight !== void 0
|
|
4741
4754
|
};
|
|
4742
4755
|
}
|
|
@@ -4751,6 +4764,7 @@ var BeaconBuffer = class {
|
|
|
4751
4764
|
inFlight: false
|
|
4752
4765
|
};
|
|
4753
4766
|
this.queue.push(entry);
|
|
4767
|
+
this.enqueuedTotal += 1;
|
|
4754
4768
|
return entry;
|
|
4755
4769
|
}
|
|
4756
4770
|
dropOldest() {
|
|
@@ -4796,7 +4810,11 @@ var BeaconBuffer = class {
|
|
|
4796
4810
|
droppedSinceLast: reportedDropped,
|
|
4797
4811
|
queueDepth: this.queue.length,
|
|
4798
4812
|
adapter: dest.adapter ?? "edge-core",
|
|
4799
|
-
version: SDK_VERSION
|
|
4813
|
+
version: SDK_VERSION,
|
|
4814
|
+
containerId: this.opts.containerId,
|
|
4815
|
+
enqueuedTotal: this.enqueuedTotal,
|
|
4816
|
+
deliveredTotal: this.deliveredTotal,
|
|
4817
|
+
droppedTotal: this.droppedTotal
|
|
4800
4818
|
};
|
|
4801
4819
|
const controller = typeof AbortController !== "undefined" ? new AbortController() : void 0;
|
|
4802
4820
|
const response = await withBudget(
|