@elizaos/autonomous 2.0.0-alpha.10
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/LICENSE +21 -0
- package/package.json +270 -0
- package/src/actions/emote.ts +101 -0
- package/src/actions/restart.ts +101 -0
- package/src/actions/send-message.ts +168 -0
- package/src/actions/stream-control.ts +439 -0
- package/src/actions/switch-stream-source.ts +126 -0
- package/src/actions/terminal.ts +186 -0
- package/src/api/agent-admin-routes.ts +178 -0
- package/src/api/agent-lifecycle-routes.ts +129 -0
- package/src/api/agent-model.ts +143 -0
- package/src/api/agent-transfer-routes.ts +211 -0
- package/src/api/apps-routes.ts +210 -0
- package/src/api/auth-routes.ts +90 -0
- package/src/api/bsc-trade.ts +736 -0
- package/src/api/bug-report-routes.ts +161 -0
- package/src/api/character-routes.ts +421 -0
- package/src/api/cloud-billing-routes.ts +598 -0
- package/src/api/cloud-compat-routes.ts +192 -0
- package/src/api/cloud-routes.ts +529 -0
- package/src/api/cloud-status-routes.ts +234 -0
- package/src/api/compat-utils.ts +154 -0
- package/src/api/connector-health.ts +135 -0
- package/src/api/coordinator-wiring.ts +179 -0
- package/src/api/credit-detection.ts +47 -0
- package/src/api/database.ts +1357 -0
- package/src/api/diagnostics-routes.ts +389 -0
- package/src/api/drop-service.ts +205 -0
- package/src/api/early-logs.ts +111 -0
- package/src/api/http-helpers.ts +252 -0
- package/src/api/index.ts +85 -0
- package/src/api/knowledge-routes.ts +1189 -0
- package/src/api/knowledge-service-loader.ts +92 -0
- package/src/api/memory-bounds.ts +121 -0
- package/src/api/memory-routes.ts +349 -0
- package/src/api/merkle-tree.ts +239 -0
- package/src/api/models-routes.ts +72 -0
- package/src/api/nfa-routes.ts +169 -0
- package/src/api/nft-verify.ts +188 -0
- package/src/api/og-tracker.ts +72 -0
- package/src/api/parse-action-block.ts +145 -0
- package/src/api/permissions-routes.ts +222 -0
- package/src/api/plugin-validation.ts +355 -0
- package/src/api/provider-switch-config.ts +455 -0
- package/src/api/registry-routes.ts +165 -0
- package/src/api/registry-service.ts +292 -0
- package/src/api/route-helpers.ts +21 -0
- package/src/api/sandbox-routes.ts +1480 -0
- package/src/api/server.ts +17674 -0
- package/src/api/signal-routes.ts +265 -0
- package/src/api/stream-persistence.ts +297 -0
- package/src/api/stream-route-state.ts +48 -0
- package/src/api/stream-routes.ts +1046 -0
- package/src/api/stream-voice-routes.ts +208 -0
- package/src/api/streaming-text.ts +129 -0
- package/src/api/streaming-types.ts +23 -0
- package/src/api/subscription-routes.ts +283 -0
- package/src/api/terminal-run-limits.ts +31 -0
- package/src/api/training-backend-check.ts +40 -0
- package/src/api/training-routes.ts +314 -0
- package/src/api/training-service-like.ts +46 -0
- package/src/api/trajectory-routes.ts +714 -0
- package/src/api/trigger-routes.ts +438 -0
- package/src/api/twitter-verify.ts +226 -0
- package/src/api/tx-service.ts +193 -0
- package/src/api/wallet-dex-prices.ts +206 -0
- package/src/api/wallet-evm-balance.ts +989 -0
- package/src/api/wallet-routes.ts +505 -0
- package/src/api/wallet-rpc.ts +523 -0
- package/src/api/wallet-trading-profile.ts +694 -0
- package/src/api/wallet.ts +745 -0
- package/src/api/whatsapp-routes.ts +282 -0
- package/src/api/zip-utils.ts +130 -0
- package/src/auth/anthropic.ts +63 -0
- package/src/auth/apply-stealth.ts +38 -0
- package/src/auth/claude-code-stealth.ts +141 -0
- package/src/auth/credentials.ts +226 -0
- package/src/auth/index.ts +18 -0
- package/src/auth/openai-codex.ts +94 -0
- package/src/auth/types.ts +24 -0
- package/src/awareness/registry.ts +220 -0
- package/src/bin.ts +10 -0
- package/src/cli/index.ts +36 -0
- package/src/cli/parse-duration.ts +43 -0
- package/src/cloud/auth.test.ts +370 -0
- package/src/cloud/auth.ts +176 -0
- package/src/cloud/backup.test.ts +150 -0
- package/src/cloud/backup.ts +50 -0
- package/src/cloud/base-url.ts +45 -0
- package/src/cloud/bridge-client.test.ts +481 -0
- package/src/cloud/bridge-client.ts +307 -0
- package/src/cloud/cloud-manager.test.ts +223 -0
- package/src/cloud/cloud-manager.ts +151 -0
- package/src/cloud/cloud-proxy.test.ts +122 -0
- package/src/cloud/cloud-proxy.ts +52 -0
- package/src/cloud/index.ts +23 -0
- package/src/cloud/reconnect.test.ts +178 -0
- package/src/cloud/reconnect.ts +108 -0
- package/src/cloud/validate-url.test.ts +147 -0
- package/src/cloud/validate-url.ts +176 -0
- package/src/config/character-schema.ts +44 -0
- package/src/config/config.ts +149 -0
- package/src/config/env-vars.ts +86 -0
- package/src/config/includes.ts +196 -0
- package/src/config/index.ts +15 -0
- package/src/config/object-utils.ts +10 -0
- package/src/config/paths.ts +92 -0
- package/src/config/plugin-auto-enable.ts +520 -0
- package/src/config/schema.ts +1342 -0
- package/src/config/telegram-custom-commands.ts +99 -0
- package/src/config/types.agent-defaults.ts +342 -0
- package/src/config/types.agents.ts +112 -0
- package/src/config/types.gateway.ts +243 -0
- package/src/config/types.hooks.ts +124 -0
- package/src/config/types.messages.ts +201 -0
- package/src/config/types.milady.ts +791 -0
- package/src/config/types.tools.ts +416 -0
- package/src/config/types.ts +7 -0
- package/src/config/zod-schema.agent-runtime.ts +777 -0
- package/src/config/zod-schema.core.ts +778 -0
- package/src/config/zod-schema.hooks.ts +139 -0
- package/src/config/zod-schema.providers-core.ts +1126 -0
- package/src/config/zod-schema.session.ts +98 -0
- package/src/config/zod-schema.ts +865 -0
- package/src/contracts/apps.ts +46 -0
- package/src/contracts/awareness.ts +56 -0
- package/src/contracts/config.ts +172 -0
- package/src/contracts/drop.ts +21 -0
- package/src/contracts/index.ts +8 -0
- package/src/contracts/onboarding.ts +592 -0
- package/src/contracts/permissions.ts +52 -0
- package/src/contracts/verification.ts +9 -0
- package/src/contracts/wallet.ts +503 -0
- package/src/diagnostics/integration-observability.ts +132 -0
- package/src/emotes/catalog.ts +655 -0
- package/src/external-modules.d.ts +7 -0
- package/src/hooks/discovery.test.ts +357 -0
- package/src/hooks/discovery.ts +231 -0
- package/src/hooks/eligibility.ts +146 -0
- package/src/hooks/hooks.test.ts +320 -0
- package/src/hooks/index.ts +8 -0
- package/src/hooks/loader.test.ts +418 -0
- package/src/hooks/loader.ts +256 -0
- package/src/hooks/registry.test.ts +168 -0
- package/src/hooks/registry.ts +74 -0
- package/src/hooks/types.ts +121 -0
- package/src/index.ts +19 -0
- package/src/onboarding-presets.ts +828 -0
- package/src/plugins/custom-rtmp/index.ts +40 -0
- package/src/providers/admin-trust.ts +76 -0
- package/src/providers/session-bridge.ts +143 -0
- package/src/providers/session-utils.ts +42 -0
- package/src/providers/simple-mode.ts +113 -0
- package/src/providers/ui-catalog.ts +135 -0
- package/src/providers/workspace-provider.ts +213 -0
- package/src/providers/workspace.ts +497 -0
- package/src/runtime/agent-event-service.ts +57 -0
- package/src/runtime/cloud-onboarding.test.ts +489 -0
- package/src/runtime/cloud-onboarding.ts +408 -0
- package/src/runtime/core-plugins.ts +53 -0
- package/src/runtime/custom-actions.ts +605 -0
- package/src/runtime/eliza.ts +4941 -0
- package/src/runtime/embedding-presets.ts +73 -0
- package/src/runtime/index.ts +8 -0
- package/src/runtime/milady-plugin.ts +180 -0
- package/src/runtime/onboarding-names.ts +76 -0
- package/src/runtime/release-plugin-policy.ts +119 -0
- package/src/runtime/restart.ts +59 -0
- package/src/runtime/trajectory-persistence.ts +2584 -0
- package/src/runtime/version.ts +6 -0
- package/src/security/audit-log.ts +222 -0
- package/src/security/network-policy.ts +91 -0
- package/src/server/index.ts +6 -0
- package/src/services/agent-export.ts +976 -0
- package/src/services/app-manager.ts +755 -0
- package/src/services/browser-capture.ts +215 -0
- package/src/services/coding-agent-context.ts +355 -0
- package/src/services/fallback-training-service.ts +196 -0
- package/src/services/index.ts +17 -0
- package/src/services/mcp-marketplace.ts +327 -0
- package/src/services/plugin-manager-types.ts +185 -0
- package/src/services/privy-wallets.ts +352 -0
- package/src/services/registry-client-app-meta.ts +201 -0
- package/src/services/registry-client-endpoints.ts +253 -0
- package/src/services/registry-client-local.ts +485 -0
- package/src/services/registry-client-network.ts +173 -0
- package/src/services/registry-client-queries.ts +176 -0
- package/src/services/registry-client-types.ts +104 -0
- package/src/services/registry-client.ts +366 -0
- package/src/services/remote-signing-service.ts +261 -0
- package/src/services/sandbox-engine.ts +753 -0
- package/src/services/sandbox-manager.ts +503 -0
- package/src/services/self-updater.ts +213 -0
- package/src/services/signal-pairing.ts +189 -0
- package/src/services/signing-policy.ts +230 -0
- package/src/services/skill-catalog-client.ts +195 -0
- package/src/services/skill-marketplace.ts +909 -0
- package/src/services/stream-manager.ts +707 -0
- package/src/services/tts-stream-bridge.ts +465 -0
- package/src/services/update-checker.ts +163 -0
- package/src/services/version-compat.ts +367 -0
- package/src/services/whatsapp-pairing.ts +279 -0
- package/src/shared/ui-catalog-prompt.ts +1158 -0
- package/src/test-support/process-helpers.ts +35 -0
- package/src/test-support/route-test-helpers.ts +113 -0
- package/src/test-support/test-helpers.ts +304 -0
- package/src/testing/index.ts +3 -0
- package/src/triggers/action.ts +342 -0
- package/src/triggers/runtime.ts +432 -0
- package/src/triggers/scheduling.ts +472 -0
- package/src/triggers/types.ts +133 -0
- package/src/types/app-hyperscape-routes-shim.d.ts +29 -0
- package/src/types/external-modules.d.ts +7 -0
- package/src/utils/exec-safety.ts +23 -0
- package/src/utils/number-parsing.ts +112 -0
- package/src/utils/spoken-text.ts +65 -0
- package/src/version-resolver.ts +60 -0
- package/test/api/agent-admin-routes.test.ts +160 -0
- package/test/api/agent-lifecycle-routes.test.ts +164 -0
- package/test/api/agent-transfer-routes.test.ts +136 -0
- package/test/api/apps-routes.test.ts +140 -0
- package/test/api/auth-routes.test.ts +160 -0
- package/test/api/bug-report-routes.test.ts +88 -0
- package/test/api/knowledge-routes.test.ts +73 -0
- package/test/api/lifecycle.test.ts +342 -0
- package/test/api/memory-routes.test.ts +74 -0
- package/test/api/models-routes.test.ts +112 -0
- package/test/api/nfa-routes.test.ts +78 -0
- package/test/api/permissions-routes.test.ts +185 -0
- package/test/api/registry-routes.test.ts +157 -0
- package/test/api/signal-routes.test.ts +113 -0
- package/test/api/subscription-routes.test.ts +90 -0
- package/test/api/trigger-routes.test.ts +87 -0
- package/test/api/wallet-routes.observability.test.ts +191 -0
- package/test/api/wallet-routes.test.ts +502 -0
- package/test/diagnostics/integration-observability.test.ts +135 -0
- package/test/security/audit-log.test.ts +229 -0
- package/test/security/network-policy.test.ts +143 -0
- package/test/services/version-compat.test.ts +127 -0
- package/tsconfig.build.json +21 -0
- package/tsconfig.json +19 -0
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
import { lookup as dnsLookup } from "node:dns/promises";
|
|
2
|
+
import net from "node:net";
|
|
3
|
+
import { logger } from "@elizaos/core";
|
|
4
|
+
import type { RegistryEndpoint } from "../config/types.milady.js";
|
|
5
|
+
import {
|
|
6
|
+
isBlockedPrivateOrLinkLocalIp,
|
|
7
|
+
normalizeHostLike,
|
|
8
|
+
} from "../security/network-policy.js";
|
|
9
|
+
import type { RegistryPluginInfo } from "./registry-client-types.js";
|
|
10
|
+
|
|
11
|
+
const BLOCKED_REGISTRY_HOST_LITERALS = new Set([
|
|
12
|
+
"localhost",
|
|
13
|
+
"127.0.0.1",
|
|
14
|
+
"::1",
|
|
15
|
+
"0.0.0.0",
|
|
16
|
+
"169.254.169.254",
|
|
17
|
+
]);
|
|
18
|
+
|
|
19
|
+
export function normaliseEndpointUrl(url: string): string {
|
|
20
|
+
return url.replace(/\/+$/, "");
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function isDefaultEndpoint(url: string, defaultUrl: string): boolean {
|
|
24
|
+
return normaliseEndpointUrl(url) === normaliseEndpointUrl(defaultUrl);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export function parseRegistryEndpointUrl(rawUrl: string): URL {
|
|
28
|
+
let parsed: URL;
|
|
29
|
+
try {
|
|
30
|
+
parsed = new URL(rawUrl);
|
|
31
|
+
} catch {
|
|
32
|
+
throw new Error("Endpoint URL must be a valid absolute URL");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (parsed.protocol !== "https:") {
|
|
36
|
+
throw new Error("Endpoint URL must use https://");
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const hostname = normalizeHostLike(parsed.hostname);
|
|
40
|
+
if (!hostname) throw new Error("Endpoint URL hostname is required");
|
|
41
|
+
|
|
42
|
+
if (
|
|
43
|
+
BLOCKED_REGISTRY_HOST_LITERALS.has(hostname) ||
|
|
44
|
+
hostname.endsWith(".localhost") ||
|
|
45
|
+
hostname.endsWith(".local")
|
|
46
|
+
) {
|
|
47
|
+
throw new Error(`Endpoint host "${hostname}" is blocked`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (net.isIP(hostname) && isBlockedPrivateOrLinkLocalIp(hostname)) {
|
|
51
|
+
throw new Error(`Endpoint host "${hostname}" is blocked`);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return parsed;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type ResolvedRegistryEndpoint = {
|
|
58
|
+
parsed: URL;
|
|
59
|
+
hostname: string;
|
|
60
|
+
pinnedAddress: string | null;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
async function resolveRegistryEndpointUrlRejection(rawUrl: string): Promise<{
|
|
64
|
+
rejection: string | null;
|
|
65
|
+
endpoint: ResolvedRegistryEndpoint | null;
|
|
66
|
+
}> {
|
|
67
|
+
let parsed: URL;
|
|
68
|
+
try {
|
|
69
|
+
parsed = parseRegistryEndpointUrl(rawUrl);
|
|
70
|
+
} catch (error) {
|
|
71
|
+
return {
|
|
72
|
+
rejection: error instanceof Error ? error.message : String(error),
|
|
73
|
+
endpoint: null,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
const hostname = normalizeHostLike(parsed.hostname);
|
|
78
|
+
if (!hostname) {
|
|
79
|
+
return {
|
|
80
|
+
rejection: "Endpoint URL hostname is required",
|
|
81
|
+
endpoint: null,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (net.isIP(hostname)) {
|
|
86
|
+
return {
|
|
87
|
+
rejection: null,
|
|
88
|
+
endpoint: { parsed, hostname, pinnedAddress: hostname },
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
let addresses: Array<{ address: string }>;
|
|
93
|
+
try {
|
|
94
|
+
const resolved = await dnsLookup(hostname, { all: true });
|
|
95
|
+
addresses = Array.isArray(resolved) ? resolved : [resolved];
|
|
96
|
+
} catch {
|
|
97
|
+
return {
|
|
98
|
+
rejection: `Could not resolve endpoint host "${hostname}"`,
|
|
99
|
+
endpoint: null,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (addresses.length === 0) {
|
|
104
|
+
return {
|
|
105
|
+
rejection: `Could not resolve endpoint host "${hostname}"`,
|
|
106
|
+
endpoint: null,
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
for (const entry of addresses) {
|
|
111
|
+
if (isBlockedPrivateOrLinkLocalIp(entry.address)) {
|
|
112
|
+
return {
|
|
113
|
+
rejection: `Endpoint host "${hostname}" resolves to blocked address ${entry.address}`,
|
|
114
|
+
endpoint: null,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return {
|
|
120
|
+
rejection: null,
|
|
121
|
+
endpoint: {
|
|
122
|
+
parsed,
|
|
123
|
+
hostname,
|
|
124
|
+
pinnedAddress: addresses[0]?.address ?? null,
|
|
125
|
+
},
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async function fetchSingleEndpoint(
|
|
130
|
+
url: string,
|
|
131
|
+
label: string,
|
|
132
|
+
): Promise<Map<string, RegistryPluginInfo> | null> {
|
|
133
|
+
const { rejection, endpoint } =
|
|
134
|
+
await resolveRegistryEndpointUrlRejection(url);
|
|
135
|
+
if (rejection || !endpoint) {
|
|
136
|
+
logger.warn(
|
|
137
|
+
`[registry-client] Endpoint "${label}" (${url}) blocked: ${rejection ?? "validation failed"}`,
|
|
138
|
+
);
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
try {
|
|
143
|
+
if (endpoint.pinnedAddress && !net.isIP(endpoint.hostname)) {
|
|
144
|
+
const refreshed = await dnsLookup(endpoint.hostname, { all: true });
|
|
145
|
+
const refreshedAddresses = new Set(
|
|
146
|
+
(Array.isArray(refreshed) ? refreshed : [refreshed]).map((entry) =>
|
|
147
|
+
normalizeHostLike(entry.address),
|
|
148
|
+
),
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
if (!refreshedAddresses.has(normalizeHostLike(endpoint.pinnedAddress))) {
|
|
152
|
+
logger.warn(
|
|
153
|
+
`[registry-client] Endpoint "${label}" (${url}) blocked: host resolution changed before fetch`,
|
|
154
|
+
);
|
|
155
|
+
return null;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
for (const address of refreshedAddresses) {
|
|
159
|
+
if (isBlockedPrivateOrLinkLocalIp(address)) {
|
|
160
|
+
logger.warn(
|
|
161
|
+
`[registry-client] Endpoint "${label}" (${url}) blocked: host resolves to blocked address ${address}`,
|
|
162
|
+
);
|
|
163
|
+
return null;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
const resp = await fetch(url, { redirect: "error" });
|
|
169
|
+
if (!resp.ok) {
|
|
170
|
+
logger.warn(
|
|
171
|
+
`[registry-client] Endpoint "${label}" (${url}): ${resp.status} ${resp.statusText}`,
|
|
172
|
+
);
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
const data = (await resp.json()) as {
|
|
176
|
+
registry?: Record<string, unknown>;
|
|
177
|
+
};
|
|
178
|
+
if (!data.registry || typeof data.registry !== "object") {
|
|
179
|
+
logger.warn(
|
|
180
|
+
`[registry-client] Endpoint "${label}" (${url}): missing registry field`,
|
|
181
|
+
);
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
const plugins = new Map<string, RegistryPluginInfo>();
|
|
185
|
+
for (const [name, raw] of Object.entries(data.registry)) {
|
|
186
|
+
const e = raw as Record<string, unknown>;
|
|
187
|
+
const git = (e.git ?? {}) as Record<string, unknown>;
|
|
188
|
+
const npm = (e.npm ?? {}) as Record<string, unknown>;
|
|
189
|
+
const supports = (e.supports ?? { v0: false, v1: false, v2: false }) as {
|
|
190
|
+
v0: boolean;
|
|
191
|
+
v1: boolean;
|
|
192
|
+
v2: boolean;
|
|
193
|
+
};
|
|
194
|
+
plugins.set(name, {
|
|
195
|
+
name,
|
|
196
|
+
gitRepo: (git.repo as string) ?? "unknown/unknown",
|
|
197
|
+
gitUrl: `https://github.com/${(git.repo as string) ?? "unknown/unknown"}.git`,
|
|
198
|
+
description: (e.description as string) ?? "",
|
|
199
|
+
homepage: (e.homepage as string) ?? null,
|
|
200
|
+
topics: (e.topics as string[]) ?? [],
|
|
201
|
+
stars: (e.stargazers_count as number) ?? 0,
|
|
202
|
+
language: (e.language as string) ?? "TypeScript",
|
|
203
|
+
npm: {
|
|
204
|
+
package: (npm.repo as string) ?? name,
|
|
205
|
+
v0Version: (npm.v0 as string) ?? null,
|
|
206
|
+
v1Version: (npm.v1 as string) ?? null,
|
|
207
|
+
v2Version: (npm.v2 as string) ?? null,
|
|
208
|
+
},
|
|
209
|
+
git: {
|
|
210
|
+
v0Branch:
|
|
211
|
+
((git.v0 as Record<string, unknown>)?.branch as string) ?? null,
|
|
212
|
+
v1Branch:
|
|
213
|
+
((git.v1 as Record<string, unknown>)?.branch as string) ?? null,
|
|
214
|
+
v2Branch:
|
|
215
|
+
((git.v2 as Record<string, unknown>)?.branch as string) ?? null,
|
|
216
|
+
},
|
|
217
|
+
supports,
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
return plugins;
|
|
221
|
+
} catch (err) {
|
|
222
|
+
logger.warn(
|
|
223
|
+
`[registry-client] Endpoint "${label}" (${url}) failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
224
|
+
);
|
|
225
|
+
return null;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export async function mergeCustomEndpoints(
|
|
230
|
+
plugins: Map<string, RegistryPluginInfo>,
|
|
231
|
+
endpoints: RegistryEndpoint[],
|
|
232
|
+
): Promise<void> {
|
|
233
|
+
const enabledEndpoints = endpoints.filter((ep) => ep.enabled !== false);
|
|
234
|
+
if (enabledEndpoints.length === 0) return;
|
|
235
|
+
|
|
236
|
+
const results = await Promise.allSettled(
|
|
237
|
+
enabledEndpoints.map((ep) => fetchSingleEndpoint(ep.url, ep.label)),
|
|
238
|
+
);
|
|
239
|
+
|
|
240
|
+
for (const result of results) {
|
|
241
|
+
if (result.status === "fulfilled" && result.value) {
|
|
242
|
+
for (const [name, info] of result.value) {
|
|
243
|
+
if (plugins.has(name)) {
|
|
244
|
+
logger.warn(
|
|
245
|
+
`[registry-client] Ignoring custom endpoint override for ${name}`,
|
|
246
|
+
);
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
plugins.set(name, info);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|