ccwrap 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/data/commentary.js +3 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -84,7 +84,7 @@ const banner = `
|
|
|
84
84
|
program
|
|
85
85
|
.name("ccwrap")
|
|
86
86
|
.description("ccwrap - Your AI coding stats, meme-ified into a shareable video")
|
|
87
|
-
.version("0.3.
|
|
87
|
+
.version("0.3.1")
|
|
88
88
|
.option("-o, --output <path>", "Output video file path", "ccwrap.mp4")
|
|
89
89
|
.option("-m, --mode <mode>", "Commentary mode: sassy or dark", "sassy")
|
|
90
90
|
.option("-p, --period <period>", "Time period: week, month, quarter, all (default: month)")
|
package/dist/data/commentary.js
CHANGED
|
@@ -81,7 +81,9 @@ export async function generateCommentary(stats, mode) {
|
|
|
81
81
|
max_tokens: 1024,
|
|
82
82
|
messages: [{ role: "user", content: buildPrompt(stats, mode) }],
|
|
83
83
|
});
|
|
84
|
-
const
|
|
84
|
+
const raw = message.content[0]?.type === "text" ? message.content[0].text : "";
|
|
85
|
+
// Strip markdown fences if the model wraps the JSON in ```json ... ```
|
|
86
|
+
const text = raw.replace(/^```(?:json)?\s*\n?/i, "").replace(/\n?```\s*$/i, "");
|
|
85
87
|
const parsed = JSON.parse(text);
|
|
86
88
|
// Validate all keys exist
|
|
87
89
|
const keys = [
|