getagenthook 0.2.0 → 1.0.0

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/README.md CHANGED
@@ -10,7 +10,7 @@ agenthook login --key <your-api-key>
10
10
  agenthook tools
11
11
  agenthook run make_video --prompt "A barista holds a latte and says: try our new oat flat white" --quality pro --aspect-ratio 9:16 --captions
12
12
  agenthook run make_image --prompt "studio shot of a ceramic mug" --count 2
13
- agenthook run caption_video --video-url https://…/video.mp4 --style tiktok
13
+ agenthook run caption_video --video-url https://…/video.mp4 --style chunk
14
14
  agenthook list --search "flat white"
15
15
  agenthook balance
16
16
  agenthook history
package/dist/cli.js CHANGED
@@ -12,6 +12,7 @@ const run_1 = require("./commands/run");
12
12
  const tools_1 = require("./commands/tools");
13
13
  const exit_1 = require("./exit");
14
14
  const http_1 = require("./http");
15
+ const version_1 = require("./version");
15
16
  const USAGE = `agenthook — hosted media generation for agents
16
17
 
17
18
  Usage: agenthook <command> [flags]
@@ -27,12 +28,15 @@ Commands:
27
28
  balance credit balance
28
29
  history credit ledger
29
30
  jobs local run ledger (~/.agenthook/jobs.jsonl)
31
+ version print the CLI version (also --version / -v)
30
32
 
31
33
  Run flags:
32
34
  --prompt <text> --ref <url> (repeatable) --owns-references --model <m>
33
35
  --quality <standard|pro> --duration <s> --aspect-ratio <r> --no-audio
34
- --captions --caption-style <movie|tiktok> --enhance-prompt
35
- --video-url <url> --style <movie|tiktok> --count <n> --resolution <1k|2k|4k>
36
+ --captions --caption-style <chunk|highlight|subtitle> --caption-size <small|medium|large>
37
+ --caption-placement <top|center|bottom> --enhance-prompt
38
+ --video-url <url> --style <chunk|highlight|subtitle> --size <small|medium|large>
39
+ --placement <top|center|bottom> --count <n> --resolution <1k|2k|4k>
36
40
  --dry-run price + validate against the server without spending credits
37
41
 
38
42
  Auth: pass --key, set AGENTHOOK_API_KEY, or run auth:login (precedence: flag > env > file).
@@ -64,6 +68,13 @@ async function runCli(argv) {
64
68
  return await (0, history_1.history)(rest);
65
69
  case "jobs":
66
70
  return await (0, jobs_1.jobs)(rest);
71
+ case "version":
72
+ case "--version":
73
+ case "-v":
74
+ // Agents probe this to detect a stale install — must exit 0 with the
75
+ // package version, never fall through to "Unknown command" (exit 1).
76
+ console.log(version_1.VERSION);
77
+ return 0;
67
78
  case undefined:
68
79
  case "help":
69
80
  case "--help":
@@ -58,9 +58,13 @@ const RUN_FLAGS = {
58
58
  "no-audio": "boolean",
59
59
  captions: "boolean",
60
60
  "caption-style": "string",
61
+ "caption-size": "string",
62
+ "caption-placement": "string",
61
63
  "enhance-prompt": "boolean",
62
64
  "video-url": "string",
63
65
  style: "string",
66
+ size: "string",
67
+ placement: "string",
64
68
  count: "number",
65
69
  resolution: "string",
66
70
  language: "string",
@@ -124,7 +128,7 @@ async function run(argv) {
124
128
  if (e instanceof http_1.ApiError) {
125
129
  const code = (0, exit_1.exitCodeForApiError)(e);
126
130
  if (asJson)
127
- emitError(true, e.message, code, e.status === 402 ? topUpUrl(apiUrl) : undefined);
131
+ emitError(true, e.message, code, e.status === 402 ? topUpUrl(apiUrl) : undefined, e.details);
128
132
  else
129
133
  console.error((0, http_1.describeApiError)(e));
130
134
  return code;
@@ -148,7 +152,7 @@ async function run(argv) {
148
152
  if (e instanceof http_1.ApiError) {
149
153
  const code = (0, exit_1.exitCodeForApiError)(e);
150
154
  if (asJson)
151
- emitError(true, e.message, code, e.status === 402 ? topUpUrl(apiUrl) : undefined);
155
+ emitError(true, e.message, code, e.status === 402 ? topUpUrl(apiUrl) : undefined, e.details);
152
156
  else
153
157
  console.error((0, http_1.describeApiError)(e));
154
158
  return code;
@@ -236,10 +240,17 @@ const topUpUrl = (apiUrl) => `${apiUrl}/credits`;
236
240
  function emit(obj) {
237
241
  console.log(JSON.stringify(obj));
238
242
  }
239
- /** Human message to stderr, or a JSON error object to stdout under --json. */
240
- function emitError(asJson, message, code, top_up_url) {
243
+ /** Human message to stderr, or a JSON error object to stdout under --json.
244
+ * A server 400 carries a `details: [{path,message}]` array naming the offending
245
+ * params — surfaced in the JSON so an agent needn't re-run without --json. */
246
+ function emitError(asJson, message, code, top_up_url, details) {
241
247
  if (asJson)
242
- console.log(JSON.stringify({ error: message, exit_code: code, ...(top_up_url ? { top_up_url } : {}) }));
248
+ console.log(JSON.stringify({
249
+ error: message,
250
+ exit_code: code,
251
+ ...(details && details.length ? { details } : {}),
252
+ ...(top_up_url ? { top_up_url } : {}),
253
+ }));
243
254
  else
244
255
  console.error(message);
245
256
  }
@@ -14,15 +14,35 @@ exports.TOOLS_SNAPSHOT = [
14
14
  },
15
15
  model: { type: "string", enum: ["seedance-2", "kling-3"], default: "seedance-2" },
16
16
  quality: { type: "string", enum: ["standard", "pro"], default: "standard" },
17
- duration: { type: "number", default: 5, min: 1 },
17
+ duration: {
18
+ type: "number",
19
+ default: 5,
20
+ min: 1,
21
+ description: "Video length in seconds. Allowed values depend on model — seedance-2: 4, 5, 6, 8, 10, 12, 15; kling-3: 3, 5, 8, 10, 15.",
22
+ },
18
23
  aspect_ratio: {
19
24
  type: "string",
20
25
  enum: ["16:9", "9:16", "1:1", "4:3", "3:4", "21:9"],
21
26
  default: "9:16",
22
27
  },
23
28
  audio: { type: "boolean", default: true },
24
- captions: { type: "boolean", default: false },
25
- caption_style: { type: "string", enum: ["movie", "tiktok"], default: "tiktok" },
29
+ captions: {
30
+ type: "boolean",
31
+ default: false,
32
+ description: "Burn spoken-word captions into the video. When true the run returns two files: output[0] is captioned, output[1] is the original uncaptioned video.",
33
+ },
34
+ caption_style: {
35
+ type: "string",
36
+ enum: ["chunk", "highlight", "subtitle"],
37
+ default: "chunk",
38
+ description: "Caption look. chunk = 2–4 words per line, centered, bold with a heavy outline (the standard TikTok/Reels style). highlight = the same block with the active word lit in colour (the Hormozi/retention style). subtitle = one clean line at the bottom (cinematic / YouTube).",
39
+ },
40
+ caption_size: { type: "string", enum: ["small", "medium", "large"], default: "medium", description: "Caption text size." },
41
+ caption_placement: {
42
+ type: "string",
43
+ enum: ["top", "center", "bottom"],
44
+ description: "Where captions sit. Defaults per style: chunk/highlight → center, subtitle → bottom.",
45
+ },
26
46
  enhance_prompt: { type: "boolean", default: false },
27
47
  influencer: {
28
48
  type: "string",
@@ -57,10 +77,21 @@ exports.TOOLS_SNAPSHOT = [
57
77
  },
58
78
  {
59
79
  name: "caption_video",
60
- description: "Burn styled subtitles into an existing video.",
80
+ description: "Burn styled captions into an existing video. Returns two files: output[0] is the captioned video, output[1] is the original uncaptioned video — so you can re-caption with a different style without regenerating. (A speechless video returns just the original.)",
61
81
  params: {
62
82
  video_url: { type: "string", required: true },
63
- style: { type: "string", enum: ["movie", "tiktok"], default: "movie" },
83
+ style: {
84
+ type: "string",
85
+ enum: ["chunk", "highlight", "subtitle"],
86
+ default: "chunk",
87
+ description: "Caption look. chunk = bold centered word blocks (standard TikTok/Reels). highlight = active word lit in colour (Hormozi/retention). subtitle = clean bottom line (cinematic / YouTube).",
88
+ },
89
+ size: { type: "string", enum: ["small", "medium", "large"], default: "medium", description: "Caption text size." },
90
+ placement: {
91
+ type: "string",
92
+ enum: ["top", "center", "bottom"],
93
+ description: "Where captions sit. Defaults per style: chunk/highlight → center, subtitle → bottom.",
94
+ },
64
95
  language: { type: "string", default: "auto" },
65
96
  },
66
97
  },
package/dist/validate.js CHANGED
@@ -26,9 +26,13 @@ exports.FLAG_FOR = {
26
26
  audio: "--no-audio",
27
27
  captions: "--captions",
28
28
  caption_style: "--caption-style",
29
+ caption_size: "--caption-size",
30
+ caption_placement: "--caption-placement",
29
31
  enhance_prompt: "--enhance-prompt",
30
32
  video_url: "--video-url",
31
33
  style: "--style",
34
+ size: "--size",
35
+ placement: "--placement",
32
36
  count: "--count",
33
37
  resolution: "--resolution",
34
38
  language: "--language",
@@ -47,8 +51,12 @@ function buildToolInput(flags) {
47
51
  ["duration", "duration"],
48
52
  ["aspect-ratio", "aspect_ratio"],
49
53
  ["caption-style", "caption_style"],
54
+ ["caption-size", "caption_size"],
55
+ ["caption-placement", "caption_placement"],
50
56
  ["video-url", "video_url"],
51
57
  ["style", "style"],
58
+ ["size", "size"],
59
+ ["placement", "placement"],
52
60
  ["count", "count"],
53
61
  ["resolution", "resolution"],
54
62
  ["language", "language"],
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VERSION = void 0;
4
+ // Package version, read from package.json at runtime. dist/*.js sits one level
5
+ // under the package root (rootDir src → outDir dist), so ../package.json
6
+ // resolves both from the installed npm package and from the repo's built dist.
7
+ // require() (CommonJS build) reads it synchronously with no bundler step.
8
+ exports.VERSION = require("../package.json").version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "getagenthook",
3
- "version": "0.2.0",
3
+ "version": "1.0.0",
4
4
  "description": "CLI for the AgentHook hosted media-generation API — generate video, images, and captions from your terminal or agent.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://getagenthook.com",