fix(obsidian-kb): fix SKILL.md YAML format and restore files

This commit is contained in:
OpenClaw Agent
2026-02-07 05:50:00 +08:00
parent a0e43a5136
commit 1f76a40d1f
108 changed files with 9321 additions and 2503 deletions
+29
View File
@@ -0,0 +1,29 @@
import OpenAI from "openai";
const openai = new OpenAI();
export async function generateWebhook(eventDescription: string, framework: string = "express"): Promise<string> {
const response = await openai.chat.completions.create({
model: "gpt-4o-mini",
messages: [
{
role: "system",
content: `You generate production-ready webhook handler code.
Rules:
- Include signature verification
- Add exponential backoff retry logic
- Handle idempotency (dedup by event ID)
- Proper error handling and logging
- Type-safe where possible
- Framework: ${framework}
- Include both the handler and a retry utility
- Return ONLY the code, no explanations`
},
{ role: "user", content: `Generate a webhook handler for: ${eventDescription}` }
],
temperature: 0.3,
});
const result = response.choices[0].message.content?.trim() || "";
return result.replace(/^```[\w]*\n?/, "").replace(/\n?```$/, "");
}