"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isMessageOutputItemDoneEvent = isMessageOutputItemDoneEvent;
const isOutputItemDoneEvent_1 = require("./isOutputItemDoneEvent.js");
/** output_item.done for item.type === 'message' only; other types (MCP, tool, reasoning) return false. */
function isMessageOutputItemDoneEvent(event) {
    var _a, _b, _c;
    if (!(0, isOutputItemDoneEvent_1.isOutputItemDoneEvent)(event)) {
        return false;
    }
    const e = event;
    const item = (_a = e.item) !== null && _a !== void 0 ? _a : (_b = e.data) === null || _b === void 0 ? void 0 : _b.item;
    if (item === undefined) {
        if (typeof process !== 'undefined' && ((_c = process.env) === null || _c === void 0 ? void 0 : _c.NODE_ENV) !== 'production') {
            /* eslint-disable-next-line no-console */
            console.warn('[useOpenAIStreamAdapter] output_item.done event has no item; treating as message done.', event);
        }
        return true;
    }
    return item.type === 'message';
}
//# sourceMappingURL=isMessageOutputItemDoneEvent.js.map
