gridity 0.1.0 → 0.1.2

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
@@ -12,6 +12,8 @@ gridity render report.pdf --pages 3-8 --json # manifest with cell coordinat
12
12
  gridity render report.pdf --pages 7 --crop 0,0.5,1,0.5 # close-up of the bottom half
13
13
  gridity render talk.mp4 --start 1:00 --end 2:30 --every 10s
14
14
  gridity render screenshots/ --cols 3
15
+ gridity render report.pdf --pages 7 --ruler # read --crop values off the sheet
16
+ gridity export report.pdf --pages 7 --crop 0.1,0.55,0.8,0.3 -o fig.png # one file per item
15
17
  gridity guide # documentation for agents
16
18
  ```
17
19
 
@@ -23,6 +25,7 @@ evenly across sheets when they do not fit on one.
23
25
 
24
26
  ```sh
25
27
  npx gridity --help # prebuilt: macOS and Linux (x64, arm64), Windows (x64)
28
+ cargo binstall gridity # same prebuilt binaries, installed like cargo install
26
29
  cargo install gridity # build from crates.io with Rust
27
30
  cargo install --path . # build this checkout
28
31
  ```
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ import { existsSync } from "node:fs";
4
+ import { fileURLToPath } from "node:url";
5
+ // src/gridity.ts
6
+ const platform = `${process.platform}-${process.arch}`;
7
+ const name = process.platform === "win32" ? "gridity.exe" : "gridity";
8
+ const binary = fileURLToPath(new URL(`../vendor/${platform}/${name}`, import.meta.url));
9
+ if (!existsSync(binary)) {
10
+ console.error(`error: gridity has no prebuilt binary for ${platform}\nhint: install it with \`cargo install gridity\``);
11
+ process.exit(4);
12
+ }
13
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
14
+ if (result.error) {
15
+ console.error(`error: cannot run ${binary}: ${result.error.message}`);
16
+ process.exit(1);
17
+ }
18
+ if (result.signal) process.kill(process.pid, result.signal);
19
+ process.exit(result.status ?? 1);
20
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gridity",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Arrange PDF pages, video frames and images into labeled grid sheets for LLM vision",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "repository": {
@@ -16,8 +16,9 @@
16
16
  "contact-sheet",
17
17
  "mcp"
18
18
  ],
19
+ "type": "module",
19
20
  "bin": {
20
- "gridity": "bin/gridity.js"
21
+ "gridity": "bin/gridity.mjs"
21
22
  },
22
23
  "files": [
23
24
  "bin",
Binary file
Binary file
Binary file
Binary file
Binary file
package/bin/gridity.js DELETED
@@ -1,30 +0,0 @@
1
- #!/usr/bin/env node
2
- // Runs the prebuilt gridity binary for this platform with the same arguments, stdio and
3
- // exit code, so `npx gridity mcp` works as an MCP server.
4
- "use strict";
5
-
6
- const { spawnSync } = require("node:child_process");
7
- const fs = require("node:fs");
8
- const path = require("node:path");
9
-
10
- const platform = `${process.platform}-${process.arch}`;
11
- const name = process.platform === "win32" ? "gridity.exe" : "gridity";
12
- const binary = path.join(__dirname, "..", "vendor", platform, name);
13
-
14
- if (!fs.existsSync(binary)) {
15
- console.error(
16
- `error: gridity has no prebuilt binary for ${platform}\n` +
17
- "hint: install it with `cargo install gridity`",
18
- );
19
- process.exit(4);
20
- }
21
-
22
- const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
23
- if (result.error) {
24
- console.error(`error: cannot run ${binary}: ${result.error.message}`);
25
- process.exit(1);
26
- }
27
- if (result.signal) {
28
- process.kill(process.pid, result.signal);
29
- }
30
- process.exit(result.status ?? 1);