@agent-video/cli 0.0.0-stage → 0.1.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.
Files changed (3) hide show
  1. package/cli.mjs +57 -0
  2. package/package.json +25 -4
  3. package/README.md +0 -3
package/cli.mjs ADDED
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * npm distribution shell for the agent-video binary (esbuild pattern).
4
+ *
5
+ * All logic — CLI, MCP server (`mcp` / `--mcp`), whisper — lives in the Rust
6
+ * binary shipped by the exact-pinned `@agent-video/<platform>` optional
7
+ * dependency. This stub only resolves that binary and hands over: args pass
8
+ * through verbatim, stdio is inherited, signals are forwarded.
9
+ *
10
+ * Resolution order: `AGENT_VIDEO_BIN` env override, then the platform
11
+ * package; no PATH fallback by design.
12
+ */
13
+
14
+ import { spawn } from "node:child_process";
15
+ import { createRequire } from "node:module";
16
+
17
+ const require = createRequire(import.meta.url);
18
+
19
+ const RELEASES_URL = "https://github.com/doggo-devs/agent-video/releases";
20
+ const PLATFORM_KEY = `${process.platform}-${process.arch}`;
21
+
22
+ function resolveBinary() {
23
+ const override = process.env.AGENT_VIDEO_BIN;
24
+ if (override) return override;
25
+
26
+ const pkg = `@agent-video/${PLATFORM_KEY}`;
27
+ const bin = process.platform === "win32" ? "agent-video.exe" : "agent-video";
28
+ try {
29
+ return require.resolve(`${pkg}/bin/${bin}`);
30
+ } catch {
31
+ process.stderr.write(
32
+ `agent-video: core binary not found: ${pkg} is not installed.\n` +
33
+ `Your platform (${PLATFORM_KEY}) may be unsupported by the npm ` +
34
+ `distribution, or optional dependencies were skipped at install ` +
35
+ `time (--no-optional / --omit=optional).\n` +
36
+ `Prebuilt binaries for all supported platforms: ${RELEASES_URL}\n`,
37
+ );
38
+ process.exit(1);
39
+ }
40
+ }
41
+
42
+ const child = spawn(resolveBinary(), process.argv.slice(2), {
43
+ stdio: "inherit",
44
+ });
45
+
46
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
47
+ process.on(signal, () => child.kill(signal));
48
+ }
49
+
50
+ child.on("error", (err) => {
51
+ process.stderr.write(`agent-video: ${err.message}\n`);
52
+ process.exit(1);
53
+ });
54
+
55
+ child.on("close", (code, signal) => {
56
+ process.exit(code ?? (signal ? 1 : 0));
57
+ });
package/package.json CHANGED
@@ -1,6 +1,27 @@
1
1
  {
2
2
  "name": "@agent-video/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Turn a video into VLM-readable grid images — CLI and MCP server",
5
+ "type": "module",
6
+ "bin": {
7
+ "agent-video": "./cli.mjs"
8
+ },
9
+ "files": [
10
+ "cli.mjs"
11
+ ],
12
+ "engines": {
13
+ "node": ">=18"
14
+ },
15
+ "license": "Apache-2.0",
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/doggo-devs/agent-video.git",
19
+ "directory": "packages/harness"
20
+ },
21
+ "optionalDependencies": {
22
+ "@agent-video/darwin-arm64": "0.1.0",
23
+ "@agent-video/linux-arm64": "0.1.0",
24
+ "@agent-video/linux-x64": "0.1.0",
25
+ "@agent-video/win32-x64": "0.1.0"
26
+ }
27
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.