import { createRequire } from "node:module";
var __defProp = Object.defineProperty;
var __returnValue = (v) => v;
function __exportSetter(name, newValue) {
  this[name] = __returnValue.bind(null, newValue);
}
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, {
      get: all[name],
      enumerable: true,
      configurable: true,
      set: __exportSetter.bind(all, name)
    });
};
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
var __require = /* @__PURE__ */ createRequire(import.meta.url);

// src/tools/memory-tools.ts
import { anthropic } from "@ai-sdk/anthropic";
function createAnthropicMemoryTool(store) {
  const memory = anthropic.tools.memory_20250818({
    execute: async (action) => {
      switch (action.command) {
        case "view":
          return store.view(action.path ?? "/memories", action.view_range);
        case "create":
          return store.create(action.path ?? "/memories/untitled", action.file_text ?? "");
        case "str_replace":
          return store.strReplace(action.path ?? "/memories", action.old_str ?? "", action.new_str ?? "");
        case "insert":
          return store.insert(action.path ?? "/memories", action.insert_line ?? 0, action.insert_text ?? "");
        case "delete":
          return store.delete(action.path ?? "/memories");
        case "rename":
          return store.rename(action.old_path ?? "/memories", action.new_path ?? "/memories");
        default:
          return `Unknown command: ${action.command}`;
      }
    }
  });
  return memory;
}
var init_memory_tools = () => {};
init_memory_tools();

export {
  createAnthropicMemoryTool
};
