agent-embassy 1.7.0 → 1.7.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 +13 -0
- package/dist/src/gateway/cli-copy.d.ts +1 -1
- package/dist/src/gateway/cli-copy.en.d.ts +3 -1
- package/dist/src/gateway/cli-copy.en.js +3 -0
- package/dist/src/gateway/cli-copy.en.js.map +1 -1
- package/dist/src/gateway/cli-copy.js +2 -0
- package/dist/src/gateway/cli-copy.js.map +1 -1
- package/dist/src/gateway/cli-copy.zh-CN.d.ts +3 -1
- package/dist/src/gateway/cli-copy.zh-CN.js +3 -0
- package/dist/src/gateway/cli-copy.zh-CN.js.map +1 -1
- package/dist/src/gateway/cli.d.ts +2 -2
- package/dist/src/gateway/cli.js +48 -2
- package/dist/src/gateway/cli.js.map +1 -1
- package/dist/src/gateway/codex-app-server.js +1 -1
- package/dist/src/gateway/codex-doctor.d.ts +33 -0
- package/dist/src/gateway/codex-doctor.js +148 -0
- package/dist/src/gateway/codex-doctor.js.map +1 -0
- package/dist/src/gateway/codex-local-transport.d.ts +5 -0
- package/dist/src/gateway/codex-local-transport.js +5 -0
- package/dist/src/gateway/codex-local-transport.js.map +1 -1
- package/dist/src/gateway/control.js +40 -3
- package/dist/src/gateway/control.js.map +1 -1
- package/dist/src/gateway/dashboard-copy.d.ts +1 -1
- package/dist/src/gateway/dashboard-copy.en.d.ts +5 -0
- package/dist/src/gateway/dashboard-copy.en.js +5 -0
- package/dist/src/gateway/dashboard-copy.en.js.map +1 -1
- package/dist/src/gateway/dashboard-copy.js +5 -0
- package/dist/src/gateway/dashboard-copy.js.map +1 -1
- package/dist/src/gateway/dashboard-copy.zh-CN.d.ts +5 -0
- package/dist/src/gateway/dashboard-copy.zh-CN.js +5 -0
- package/dist/src/gateway/dashboard-copy.zh-CN.js.map +1 -1
- package/dist/src/gateway/dashboard-model.d.ts +3 -0
- package/dist/src/gateway/dashboard-model.js +9 -1
- package/dist/src/gateway/dashboard-model.js.map +1 -1
- package/dist/src/gateway/dashboard.js +3 -1
- package/dist/src/gateway/dashboard.js.map +1 -1
- package/dist/src/gateway/live-dashboard-app/app.js +11 -2
- package/dist/src/gateway/providers.d.ts +7 -0
- package/dist/src/gateway/providers.js +60 -0
- package/dist/src/gateway/providers.js.map +1 -1
- package/dist/src/gateway/server.js +12 -0
- package/dist/src/gateway/server.js.map +1 -1
- package/dist/src/gateway/service.d.ts +26 -2
- package/dist/src/gateway/service.js +553 -104
- package/dist/src/gateway/service.js.map +1 -1
- package/dist/src/gateway/store.js +26 -12
- package/dist/src/gateway/store.js.map +1 -1
- package/dist/src/gateway/types.d.ts +9 -0
- package/dist/src/gateway/types.js +2 -0
- package/dist/src/gateway/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import { BridgeError } from "../errors.js";
|
|
|
7
7
|
import { KeyedMutex } from "../mutex.js";
|
|
8
8
|
import { isCodexRegistrationGeneration } from "./codex-registration-generation.js";
|
|
9
9
|
import { PROGRESS_WATCH_DEFAULT_CAPACITY, PROGRESS_WATCH_HARD_CAPACITY, PROGRESS_WATCH_MAX_IDLE_MS, PROGRESS_WATCH_MIN_IDLE_MS, commitProgressWatchNudge, createProgressWatch, deferProgressWatchNudge, inspectProgressWatchDue, progressWatchJournalKinds, recordProgressWatchActivity, } from "./progress-watch-machine.js";
|
|
10
|
-
import { CODEX_ENDPOINT_REFRESH_JOURNAL_CAPACITY, CODEX_ORPHAN_REMOVAL_JOURNAL_CAPACITY, connectorHealthStates, directionId, deliveryStates, gatewayPublicSnapshotLimits, gatewayProviders, gatewayRegistrationIngressPrefixes, messageDirections, parseDirection, projectGatewayPublicSnapshot, routeRegistrationModes, routeStates, } from "./types.js";
|
|
10
|
+
import { CODEX_ENDPOINT_REFRESH_JOURNAL_CAPACITY, CODEX_ORPHAN_REMOVAL_JOURNAL_CAPACITY, CONNECTOR_OBSERVATION_STALE_AFTER_MS, connectorHealthStates, directionId, deliveryStates, gatewayPublicSnapshotLimits, gatewayProviders, gatewayRegistrationIngressPrefixes, messageDirections, parseDirection, projectGatewayPublicSnapshot, routeRegistrationModes, routeStates, } from "./types.js";
|
|
11
11
|
const STATE_MARKER = ".agent-embassy-state";
|
|
12
12
|
const STATE_MARKER_CONTENT = "agent-embassy-state-v1\n";
|
|
13
13
|
const STATE_FILE = "gateway-state.json";
|
|
@@ -2708,17 +2708,31 @@ export class GatewayStore {
|
|
|
2708
2708
|
async publicSnapshot() {
|
|
2709
2709
|
return this.mutate(async (state, now) => {
|
|
2710
2710
|
const connectors = state.connectors
|
|
2711
|
-
.map((connector) =>
|
|
2712
|
-
|
|
2713
|
-
|
|
2714
|
-
|
|
2715
|
-
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2711
|
+
.map((connector) => {
|
|
2712
|
+
const observedAt = connector.lastSeenAt === undefined
|
|
2713
|
+
? undefined
|
|
2714
|
+
: Date.parse(connector.lastSeenAt);
|
|
2715
|
+
const observationAgeMs = observedAt === undefined || !Number.isFinite(observedAt)
|
|
2716
|
+
? undefined
|
|
2717
|
+
: Math.min(Number.MAX_SAFE_INTEGER, Math.max(0, now.getTime() - observedAt));
|
|
2718
|
+
const health = connector.health === "healthy" &&
|
|
2719
|
+
(observationAgeMs === undefined ||
|
|
2720
|
+
observationAgeMs > CONNECTOR_OBSERVATION_STALE_AFTER_MS)
|
|
2721
|
+
? "degraded"
|
|
2722
|
+
: connector.health;
|
|
2723
|
+
return {
|
|
2724
|
+
provider: connector.provider,
|
|
2725
|
+
host: connector.hostId,
|
|
2726
|
+
health,
|
|
2727
|
+
protocol: connector.protocol,
|
|
2728
|
+
protocolVersion: connector.protocolVersion,
|
|
2729
|
+
...(connector.lastSeenAt ? { lastSeenAt: connector.lastSeenAt } : {}),
|
|
2730
|
+
...(observationAgeMs === undefined ? {} : { observationAgeMs }),
|
|
2731
|
+
...(connector.safeErrorCode
|
|
2732
|
+
? { safeErrorCode: connector.safeErrorCode }
|
|
2733
|
+
: {}),
|
|
2734
|
+
};
|
|
2735
|
+
})
|
|
2722
2736
|
.sort((left, right) => `${left.provider}:${left.host}`.localeCompare(`${right.provider}:${right.host}`));
|
|
2723
2737
|
const oldestQueuedAtByTarget = new Map();
|
|
2724
2738
|
for (const item of state.queue) {
|