import { resolveGlobalSingleton } from "../../shared/global-singleton.js"; import { normalizeOptionalLowercaseString } from "../../shared/string-coerce.js"; import { AcpRuntimeError } from "./errors.js"; import type { AcpRuntime } from "./types.js";
function resolveAcpRuntimeRegistryGlobalState(): AcpRuntimeRegistryGlobalState { const processStore = process as NodeJS.Process & Record<PropertyKey, unknown>; const existing = processStore[ACP_RUNTIME_REGISTRY_STATE_KEY]; if (existing) { return existing as AcpRuntimeRegistryGlobalState;
} const created = resolveGlobalSingleton<AcpRuntimeRegistryGlobalState>(
ACP_RUNTIME_REGISTRY_STATE_KEY,
() => ({
backendsById: new Map<string, AcpRuntimeBackend>(),
}),
); // ACP runtime backends are registered from bundled plugin code and read from // core/test code. In Vitest and Jiti, those can run in different globalThis // contexts while still sharing one Node process.
processStore[ACP_RUNTIME_REGISTRY_STATE_KEY] = created; return created;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.