//#region src/domains/run/stream/stream-registry.ts
const REGISTRY_KEY = "__inkeep_streamHelperRegistry";
/**
* Global registry for StreamHelper instances backed by globalThis so it is
* shared across module boundaries (e.g. the WDK workflow bundle and the main
* Hono app bundle both resolve to the same Map).
*/
function getRegistry() {
	const g = globalThis;
	if (!g[REGISTRY_KEY]) g[REGISTRY_KEY] = /* @__PURE__ */ new Map();
	return g[REGISTRY_KEY];
}
/**
* Register a StreamHelper for a specific request ID
*/
function registerStreamHelper(requestId, streamHelper) {
	getRegistry().set(requestId, streamHelper);
}
/**
* Get a StreamHelper by request ID
*/
function getStreamHelper(requestId) {
	return getRegistry().get(requestId);
}
/**
* Unregister a StreamHelper for a specific request ID
*/
function unregisterStreamHelper(requestId) {
	getRegistry().delete(requestId);
}
/**
* Get registry size (for debugging)
*/
function getRegistrySize() {
	return getRegistry().size;
}

//#endregion
export { getRegistrySize, getStreamHelper, registerStreamHelper, unregisterStreamHelper };