agentreel 0.2.4 → 0.2.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentreel",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Turn your web apps and CLIs into viral clips",
5
5
  "bin": {
6
6
  "agentreel": "./bin/agentreel.mjs"
@@ -92,6 +92,12 @@ def extract_highlights(video_path, task):
92
92
  )
93
93
 
94
94
  text = result.stdout.strip()
95
+ if result.returncode != 0 or not text:
96
+ print(f"Claude returned no output (exit {result.returncode}), using default highlights", file=sys.stderr)
97
+ if result.stderr:
98
+ print(f" stderr: {result.stderr[:200]}", file=sys.stderr)
99
+ text = ""
100
+
95
101
  if "```" in text:
96
102
  parts = text.split("```")
97
103
  for part in parts:
@@ -102,9 +108,16 @@ def extract_highlights(video_path, task):
102
108
  text = part
103
109
  break
104
110
 
105
- highlights = json.loads(text)
111
+ try:
112
+ highlights = json.loads(text)
113
+ except (json.JSONDecodeError, ValueError):
114
+ print(f"Could not parse highlights, using defaults", file=sys.stderr)
115
+ highlights = [
116
+ {"label": "Overview", "overlay": "**Quick look**", "videoStartSec": 1, "videoEndSec": 7},
117
+ {"label": "Features", "overlay": "**Key features**", "videoStartSec": 7, "videoEndSec": 14},
118
+ {"label": "Result", "overlay": "**See it work**", "videoStartSec": 14, "videoEndSec": 20},
119
+ ]
106
120
 
107
- # Add videoSrc to each highlight (the Go/JS CLI will set the actual path)
108
121
  for h in highlights:
109
122
  h["videoSrc"] = "browser-demo.mp4"
110
123
 
@@ -227,7 +227,16 @@ Return ONLY a JSON array of highlights. No markdown fences."""
227
227
  text = part
228
228
  break
229
229
 
230
- return json.loads(text)
230
+ try:
231
+ return json.loads(text)
232
+ except (json.JSONDecodeError, ValueError):
233
+ print(f"Could not parse highlights, using defaults", file=sys.stderr)
234
+ return [
235
+ {"label": "Run", "lines": [
236
+ {"text": "Running...", "isPrompt": True},
237
+ {"text": " Done.", "color": "#50fa7b"},
238
+ ]},
239
+ ]
231
240
 
232
241
 
233
242
  if __name__ == "__main__":