import { randomUUID as a } from "crypto";
import i from "dedent";
import { K as n } from "./shared-types-CIxCt9tj.js";
class l extends n {
  /**
   * Creates a new AbortedException instance
   * @param message - Custom error message describing why the operation was aborted
   */
  constructor(r = "Operation was aborted by user or system") {
    super(r);
  }
  /**
   * Required for error translation of session errors.
   * This is the string that will be shown the user if this error fails an execution.
   */
  get userFacingSessionErrorMessage() {
    return "Execution Aborted";
  }
}
class g extends n {
  /**
   * Creates a new RunCommandNoWorkingDirectoryError instance
   */
  constructor() {
    super("No workspace directory available for command execution");
  }
  /**
   * Required for error translation of session errors.
   * This is the string that will be shown the user if this error fails an execution.
   */
  get userFacingSessionErrorMessage() {
    return "No workspace directory is available for command execution. Please open a workspace folder.";
  }
}
class c extends n {
  /**
   * Creates a new PromptTemplateKeyError instance
   */
  constructor(r) {
    super(`Invalid values provided for the prompt template: ${r}`);
  }
  /**
   * Required for error translation of session errors.
   * This is the string that will be shown the user if this error fails an execution.
   */
  get userFacingSessionErrorMessage() {
    return "Invalid Prompt Submitted - Please report a bug";
  }
}
class f extends n {
  /**
   * Creates a new MissingRequiredKeysError instance
   * @param expectedKeys - Array of key names that were expected but not found
   * @param receivedObject - The actual object that was received and is missing keys
   */
  constructor(r, o) {
    super(`Missing required keys: [${r.join(", ")}] in received object: ${JSON.stringify(o)}`);
  }
  /**
   * Required for error translation of session errors.
   * This is the string that will be shown the user if this error fails an execution.
   */
  get userFacingSessionErrorMessage() {
    return "Missing required data";
  }
}
function b({ prompt: e, keys: r }) {
  const o = i(e).trim();
  return {
    format(t = {}) {
      if (Object.keys(t).length !== r.length || Object.keys(t).some((s) => !r.includes(s)))
        throw new c(`Saw ${Object.keys(t).join(", ")}, expected ${r.join(", ")}`);
      return u(o, t);
    }
  };
}
function y(e) {
  const r = i(e).trim();
  return {
    format() {
      return r;
    }
  };
}
function j(e) {
  return e.map((r) => r.trim()).join(`

`);
}
function u(e, r) {
  const o = {};
  for (const t of Object.keys(r)) {
    const s = a();
    o[t] = s, e = e.replaceAll(`{{${t}}}`, s);
  }
  for (const [t, s] of Object.entries(r))
    e = e.replaceAll(o[t], s.toString());
  return e;
}
export {
  l as A,
  f as M,
  c as P,
  g as R,
  j,
  b as p,
  y as r
};
//# sourceMappingURL=prompt-template-C_Mn10zi.js.map
