"use strict";
var import_vitest = require("vitest");
var import_agent_session = require("./agent_session.cjs");
var import_speech_handle = require("./speech_handle.cjs");
(0, import_vitest.describe)("AgentSession.run", () => {
  (0, import_vitest.it)("forwards inputModality to generateReply", async () => {
    const session = new import_agent_session.AgentSession();
    const generateReply = import_vitest.vi.spyOn(session, "generateReply").mockImplementation(() => import_speech_handle.SpeechHandle.create());
    session.run({ userInput: "hello", inputModality: "audio" });
    await import_vitest.vi.waitFor(() => {
      (0, import_vitest.expect)(generateReply).toHaveBeenCalledWith({
        userInput: "hello",
        inputModality: "audio"
      });
    });
  });
});
(0, import_vitest.describe)("resolveRecordingOptions", () => {
  (0, import_vitest.it)("treats a boolean as all-on or all-off", () => {
    (0, import_vitest.expect)((0, import_agent_session.resolveRecordingOptions)(true)).toEqual({
      audio: true,
      traces: true,
      logs: true,
      transcript: true
    });
    (0, import_vitest.expect)((0, import_agent_session.resolveRecordingOptions)(false)).toEqual({
      audio: false,
      traces: false,
      logs: false,
      transcript: false
    });
  });
  (0, import_vitest.it)("defaults omitted keys to true when given a partial object", () => {
    (0, import_vitest.expect)((0, import_agent_session.resolveRecordingOptions)({ audio: false })).toEqual({
      audio: false,
      traces: true,
      logs: true,
      transcript: true
    });
    (0, import_vitest.expect)(
      (0, import_agent_session.resolveRecordingOptions)({ audio: true, traces: false, logs: false, transcript: false })
    ).toEqual({
      audio: true,
      traces: false,
      logs: false,
      transcript: false
    });
  });
  (0, import_vitest.it)("returns a fresh object so callers cannot corrupt the shared defaults", () => {
    const opts = (0, import_agent_session.resolveRecordingOptions)(true);
    opts.audio = false;
    (0, import_vitest.expect)((0, import_agent_session.resolveRecordingOptions)(true).audio).toBe(true);
  });
});
(0, import_vitest.describe)("AgentSession recording state", () => {
  (0, import_vitest.it)("_enableRecording is true when any category is on and false when all are off", () => {
    const session = new import_agent_session.AgentSession();
    (0, import_vitest.expect)(session._enableRecording).toBe(false);
    session._recordingOptions = (0, import_agent_session.resolveRecordingOptions)({
      audio: false,
      traces: false,
      logs: true,
      transcript: false
    });
    (0, import_vitest.expect)(session._enableRecording).toBe(true);
    session._recordingOptions = (0, import_agent_session.resolveRecordingOptions)(false);
    (0, import_vitest.expect)(session._enableRecording).toBe(false);
  });
});
//# sourceMappingURL=agent_session.test.cjs.map