"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.runWithOrchestratorContext = runWithOrchestratorContext;
exports.getOrchestratorContext = getOrchestratorContext;
const async_hooks_1 = require("async_hooks");
const store = new async_hooks_1.AsyncLocalStorage();
/**
 * Run a function with orchestrator context available via `getOrchestratorContext()`.
 * Called by the interceptor when wrapping a container/orchestrator workflow.
 */
function runWithOrchestratorContext(ctx, fn) {
    return store.run(ctx, fn);
}
/**
 * Retrieve the orchestrator context set by the interceptor.
 * Called by `executeLT` to inject parent routing into child envelopes.
 */
function getOrchestratorContext() {
    return store.getStore();
}
