export async function emitProjectTrustEvent(extensionsResult, event, ctx) {
    const errors = [];
    for (const ext of extensionsResult.extensions) {
        const handlers = ext.handlers.get("project_trust");
        if (!handlers || handlers.length === 0)
            continue;
        for (const handler of handlers) {
            try {
                const handlerResult = (await handler(event, ctx));
                if (handlerResult.trusted === "undecided") {
                    continue;
                }
                return { result: handlerResult, errors };
            }
            catch (error) {
                errors.push({
                    extensionPath: ext.path,
                    event: event.type,
                    error: error instanceof Error ? error.message : String(error),
                    stack: error instanceof Error ? error.stack : undefined,
                });
            }
        }
    }
    return { errors };
}
//# sourceMappingURL=runner-project-trust.js.map