"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var commandOverlays_exports = {};
__export(commandOverlays_exports, {
  getCommandOverlay: () => getCommandOverlay,
  isInteractiveCommand: () => isInteractiveCommand
});
module.exports = __toCommonJS(commandOverlays_exports);
var import_agent_backend = require("../agent-backend.js");
const ALWAYS_OVERLAY = {
  search: "search",
  find: "search",
  // alias
  login: "login",
  logout: "logout",
  connect: "connect",
  model: "model-selector",
  reasoning: "reasoning",
  resume: "session-selector",
  switch: "session-selector",
  stream: "stream-selector",
  sounds: "sounds-selector",
  tools: "tool-browser",
  mcp: "mcp-server-list",
  rename: "session-rename",
  context: "context-stats",
  ctx: "context-stats",
  // alias
  tokens: "context-stats",
  // alias
  export: "export-wizard",
  plugin: "plugin-manager"
};
const NO_ARGS_OVERLAY = {
  session: "session-subcommand-selector",
  log: "log-level-selector",
  prompts: "prompt-list"
};
function getCommandOverlay(command, args, agent) {
  if (!(0, import_agent_backend.isCommandSupported)(agent, command)) {
    return null;
  }
  const alwaysOverlay = ALWAYS_OVERLAY[command];
  if (alwaysOverlay) return alwaysOverlay;
  if (args.length === 0) {
    const noArgsOverlay = NO_ARGS_OVERLAY[command];
    if (noArgsOverlay) return noArgsOverlay;
  }
  return null;
}
function isInteractiveCommand(command) {
  return command in ALWAYS_OVERLAY || command in NO_ARGS_OVERLAY;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  getCommandOverlay,
  isInteractiveCommand
});
