// dist/src/sdk/openai.js
var OPENAI_TOOL_RECALL = "honeycomb_recall";
var OPENAI_TOOL_REMEMBER = "honeycomb_remember";
function createOpenAiTools() {
  return [
    {
      type: "function",
      function: {
        name: OPENAI_TOOL_RECALL,
        description: "Recall relevant memories from Honeycomb for a query.",
        parameters: {
          type: "object",
          properties: {
            query: { type: "string", description: "The text to recall memories for." },
            limit: { type: "number", description: "Max results to return." }
          },
          required: ["query"],
          additionalProperties: false
        }
      }
    },
    {
      type: "function",
      function: {
        name: OPENAI_TOOL_REMEMBER,
        description: "Store a memory in Honeycomb.",
        parameters: {
          type: "object",
          properties: {
            text: { type: "string", description: "The memory text to store." },
            path: { type: "string", description: "Optional memory path to store under." }
          },
          required: ["text"],
          additionalProperties: false
        }
      }
    }
  ];
}
async function dispatchOpenAiToolCall(client, name, args) {
  const a = args !== null && typeof args === "object" ? args : {};
  switch (name) {
    case OPENAI_TOOL_RECALL: {
      const query = String(a.query ?? "");
      const limit = typeof a.limit === "number" ? a.limit : void 0;
      return await client.recall(query, limit !== void 0 ? { limit } : void 0);
    }
    case OPENAI_TOOL_REMEMBER: {
      const text = String(a.text ?? "");
      const path = typeof a.path === "string" ? a.path : void 0;
      await client.remember(text, path !== void 0 ? { path } : void 0);
      return { ok: true };
    }
    default:
      throw new Error(`dispatchOpenAiToolCall: unknown tool "${name}"`);
  }
}
export {
  OPENAI_TOOL_RECALL,
  OPENAI_TOOL_REMEMBER,
  createOpenAiTools,
  dispatchOpenAiToolCall
};
