@canvatopsd/magiclayers 0.0.0-stage → 2.6.7

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
@@ -1,3 +1,30 @@
1
- # Temporary Holding Version
1
+ # MagicLayers CLI
2
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.
3
+ Convert an image into editable PSD layers or automatic spot-color print separations from your AI agent or terminal. Submit an image, share hosted checkout, inspect progress and download verified delivery.
4
+
5
+ ```sh
6
+ npm install -g @canvatopsd/magiclayers
7
+ magiclayers --version
8
+ magiclayers skill install agents
9
+ ```
10
+
11
+ Node.js 22 or newer. Native executables are included for macOS Apple Silicon and Linux x64 (glibc 2.31+); no Rust, Photoshop, account registration or API key is required. Other platforms are not included in this npm release.
12
+
13
+ ```sh
14
+ magiclayers convert image.png
15
+ magiclayers checkout TASK_ID
16
+ # After the buyer completes checkout:
17
+ magiclayers verify-payment TASK_ID
18
+ magiclayers status TASK_ID
19
+ magiclayers download TASK_ID --output delivery.zip
20
+ ```
21
+
22
+ Use `--email` for optional delivery notifications. Add `--print` to `convert` for automatic spot-color separations. Business output is JSON. Use full option names, keep the same task ID when resuming, and back up the private access file. The CLI never automatically polls, retries, creates a replacement payment or overwrites a downloaded file.
23
+
24
+ For remote AI clients, use the [MagicLayers MCP endpoint](https://magiclayers.app/mcp) with Streamable HTTP. The same Agent Skill covers both access methods.
25
+
26
+ Install the bundled Skill for `codex`, `claude-code`, `cursor`, `copilot` or generic `agents`. Use `--dir` for a custom parent directory and start a new Agent session after installation.
27
+
28
+ [Usage and recovery](doc/usage.md) · [Agent Skill](skills/magiclayers/SKILL.md) · [Release guide](doc/npm-release.md) · [Website](https://magiclayers.app/ai-agent/)
29
+
30
+ The hosted service defaults to `https://magiclayers.app`. Local development selects `--base-url http://127.0.0.1:3000` explicitly. Buyers complete hosted checkout before processing starts. Use `magiclayers verify-payment TASK_ID` after the buyer completes Stripe checkout. Delivery size and SHA-256 are verified.
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from "node:child_process";
3
+ import { fileURLToPath } from "node:url";
4
+ import { existsSync } from "node:fs";
5
+ import metadata from "../package.json" with { type: "json" };
6
+
7
+ function fail(code, message) {
8
+ console.log(JSON.stringify({ ok: false, error: { code, message } }));
9
+ process.exit(1);
10
+ }
11
+ const target = `${process.platform}-${process.arch}`;
12
+ if (!metadata.magiclayers.targets.includes(target))
13
+ fail(
14
+ "unsupported_platform",
15
+ `Supported platforms: ${metadata.magiclayers.targets.join(", ")}; received ${target}`,
16
+ );
17
+ const executable = fileURLToPath(
18
+ new URL(`../runtime/${target}/magiclayers`, import.meta.url),
19
+ );
20
+ if (!existsSync(executable))
21
+ fail(
22
+ "native_binary_missing",
23
+ `The package is missing its ${target} executable; reinstall the official release`,
24
+ );
25
+ const result = spawnSync(executable, process.argv.slice(2), {
26
+ stdio: "inherit",
27
+ });
28
+ if (result.error) fail("native_launch_failed", result.error.message);
29
+ if (result.signal) process.kill(process.pid, result.signal);
30
+ else process.exit(result.status ?? 1);
@@ -0,0 +1,87 @@
1
+ {
2
+ "schemaVersion": 2,
3
+ "authentication": "task-scoped access key; no account",
4
+ "remoteMcp": {
5
+ "url": "https://magiclayers.app/mcp",
6
+ "transport": "streamable-http"
7
+ },
8
+ "commands": [
9
+ {
10
+ "method": "POST",
11
+ "path": "/api/v2/task/create",
12
+ "contentType": "multipart/form-data",
13
+ "description": "Create a guest task and freeze its one-time image quote"
14
+ },
15
+ {
16
+ "method": "POST",
17
+ "path": "/api/v2/task/read",
18
+ "contentType": "application/json",
19
+ "description": "Read a task with its private access key"
20
+ },
21
+ {
22
+ "method": "POST",
23
+ "path": "/api/v2/task/access",
24
+ "contentType": "application/json",
25
+ "description": "Restore a browser task access cookie"
26
+ },
27
+ {
28
+ "method": "POST",
29
+ "path": "/api/v2/task/config/read",
30
+ "contentType": "application/json",
31
+ "description": "Read one-image pricing and guest service configuration"
32
+ },
33
+ {
34
+ "method": "POST",
35
+ "path": "/api/v2/task/stripe/prepare",
36
+ "contentType": "application/json",
37
+ "description": "Open hosted Stripe checkout with Adaptive Pricing"
38
+ },
39
+ {
40
+ "method": "POST",
41
+ "path": "/api/v2/task/stripe/confirm",
42
+ "contentType": "application/json",
43
+ "description": "Verify the saved Stripe checkout and start paid work"
44
+ },
45
+ {
46
+ "method": "POST",
47
+ "path": "/api/v2/task/payment/read",
48
+ "contentType": "application/json",
49
+ "description": "Read the last verified payment state"
50
+ },
51
+ {
52
+ "method": "POST",
53
+ "path": "/api/v2/task/delivery/read",
54
+ "contentType": "application/json",
55
+ "description": "Verify payment and return short-lived artifact download URLs"
56
+ }
57
+ ],
58
+ "workflows": [
59
+ {
60
+ "id": "image-layering",
61
+ "processingMethod": "editable-text",
62
+ "settingsRequired": false,
63
+ "delivery": ["PSD", "preview", "fonts"]
64
+ },
65
+ {
66
+ "id": "spot-print",
67
+ "processingMethod": "spot-separation",
68
+ "settingsRequired": false,
69
+ "settings": {
70
+ "palette": "auto; extracted from image, up to 12 inks",
71
+ "process": "spot-screen",
72
+ "substrate": "white",
73
+ "dpi": 300
74
+ },
75
+ "delivery": [
76
+ "grayscale TIFF plates",
77
+ "transparent PNG plates",
78
+ "RGB layered PSD",
79
+ "proof",
80
+ "ZIP"
81
+ ],
82
+ "halftone": false,
83
+ "nativeSpotChannels": false,
84
+ "CMYK": false
85
+ }
86
+ ]
87
+ }
package/doc/usage.md ADDED
@@ -0,0 +1,63 @@
1
+ # MagicLayers Agent CLI
2
+
3
+ `magiclayers` submits an image, returns hosted checkout, reads task/payment status and downloads verified delivery. It uses private per-task access without registration or an account session. Check the installed version with `magiclayers --version`.
4
+
5
+ ## Install
6
+
7
+ Install Node.js 22 or newer, then run `npm install -g @canvatopsd/magiclayers`. The npm package contains native executables and the Agent Skill; it does not compile or download executables during installation. Supported: macOS Apple Silicon and Linux x64 with glibc 2.31 or newer. Rust is not required. macOS Intel, Linux ARM64 and Windows are not currently included.
8
+
9
+ ```sh
10
+ magiclayers --version
11
+ magiclayers doctor
12
+ magiclayers skill install agents
13
+ magiclayers skill status agents
14
+ ```
15
+
16
+ The Skill also supports `codex`, `claude-code`, `cursor` and `copilot`; `--dir` selects a custom parent skills directory. Codex respects `CODEX_HOME`. Installation accepts identical content and refuses to overwrite different instructions or symlinks. Review local edits before removing/replacing an existing Skill. Start a new agent session after installation. `skill show` returns the embedded instructions offline.
17
+
18
+ The default service is `https://magiclayers.app` (prod). Select local explicitly with `--base-url http://127.0.0.1:3000` or `MAGICLAYERS_BASE_URL`. Doctor reads configuration; it does not prove payment or delivery. The npm package is `@canvatopsd/magiclayers`; its command and Skill name are both `magiclayers`. The selected Web release is published at `/agent/release.json`.
19
+
20
+ For AI apps that support remote MCP, connect to `https://magiclayers.app/mcp` via Streamable HTTP. See the [AI agent integration page](https://magiclayers.app/ai-agent/).
21
+
22
+ ## Convert, pay, inspect, download
23
+
24
+ ```sh
25
+ magiclayers convert ./image.png --dry-run
26
+ magiclayers convert ./image.png
27
+ # Use the task ID returned by convert:
28
+ magiclayers checkout TASK_ID
29
+ # After the buyer completes checkout:
30
+ magiclayers verify-payment TASK_ID
31
+ magiclayers status TASK_ID
32
+ magiclayers download TASK_ID --output ./delivery.zip
33
+ ```
34
+
35
+ Input is PNG/JPEG/WebP, up to 30 MiB. Pass `--email` to receive optional delivery notifications. Add `--print` to both conversion commands for automatic spot separations; otherwise the result is editable design layers. `--locale` defaults to `en-US`. Downloads default to the delivery package; use `--kind psd` or `--kind preview` for a single file. Business options always use full names such as `--email` and `--output`.
36
+
37
+ Create freezes the server quote and saves private access before sending. It does not charge. Checkout returns a hosted Stripe link. Adaptive Pricing offers the buyer local currency where supported. Read verified financial facts with `magiclayers payment TASK_ID`. A redirect or browser success message alone is not proof of payment.
38
+
39
+ After the buyer completes the Stripe checkout, run `magiclayers verify-payment TASK_ID`.
40
+
41
+ ## Resume and protect access
42
+
43
+ Keep the returned UUIDv7 (compact or original form). After an uncertain submission, inspect that ID first. If resubmission is necessary, run `convert` with `--task-id TASK_ID` and the **same image, email, locale and workflow**. Never create a replacement task or payment merely because status is delayed. There is no automatic polling or retry.
44
+
45
+ Access files live under the OS local application-data directory in `magiclayers/tasks/<uuid>.json`, overridable by `MAGICLAYERS_ACCESS_DIRECTORY`. On macOS: `~/Library/Application Support/magiclayers/tasks/`. Unix directories/files use 0700/0600. Back them up privately; restore the original file on another machine and use the same service origin. Missing access is an explicit error. Do not share access keys, private task links or signed download URLs.
46
+
47
+ A tool runner can resume an MCP task by setting `MAGICLAYERS_TASK_REFERENCE` for that command to the private `task_ref` returned by MagicLayers and passing its matching task ID. Use the service origin that issued the reference. This works for checkout, payment, verification, status and downloads. Supply it through the runner's secret environment and keep it out of shell history and chat messages.
48
+
49
+ ## Print output
50
+
51
+ New `--print` tasks automatically extract up to twelve inks at 300 DPI on white, preserving source pixel dimensions. Transparent input is composited onto white. The ZIP contains continuous-tone TIFF/PNG plates, an RGB layered PSD and proof. Halftoning, trapping, underbase and native Photoshop spot channels remain downstream. No manual palette is needed. Only retries of existing explicitly configured tasks need their saved `--print-settings` file together with `--print`.
52
+
53
+ ## Output and discovery
54
+
55
+ Business commands return `{"ok":true,"data":...}` or `{"ok":false,"error":{"code":"...","message":"..."}}`. Argument errors exit 2; command failures exit 1. API failures retain HTTP status and code. Help/version are plain text. JSON is always used for business output; no `--json` flag is required or accepted.
56
+
57
+ `magiclayers discover` returns the offline API-owned [command inventory](https://magiclayers.app/agent/commands.json). Use the specific CLI commands for business actions; generic `request`, `read` aliases and the earlier `task` command layer are not exposed.
58
+
59
+ Downloads verify byte count and SHA-256 and never overwrite an existing output. The service checks current payment when download links are used; refunds/disputes revoke access. Transport errors do not print signed download URLs. Local payment uses test credentials; prod uses live payment. Local checks do not imply real payment acceptance.
60
+
61
+ ## Source installation
62
+
63
+ The optional source installer at `https://magiclayers.app/agent/install.sh` requires Rust/Cargo with edition 2024 support and a native linker. Inspect the downloaded script before running it. It verifies the fixed-version source archive, builds locked dependencies and installs into `~/.local/share/magiclayers/cli/<version>/`. Add `~/.local/bin` to PATH. Source installation and npm installation are alternatives; do not install both into the same command directory.
package/package.json CHANGED
@@ -1,6 +1,50 @@
1
1
  {
2
2
  "name": "@canvatopsd/magiclayers",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.6.7",
4
+ "description": "MagicLayers native CLI and Agent Skill for image-to-PSD layers, automatic spot-color separations, hosted checkout and verified downloads.",
5
+ "type": "module",
6
+ "bin": {
7
+ "magiclayers": "bin/magiclayers.mjs"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "runtime",
12
+ "skills",
13
+ "contracts",
14
+ "doc/usage.md",
15
+ "release.json"
16
+ ],
17
+ "engines": {
18
+ "node": ">=22"
19
+ },
20
+ "scripts": {},
21
+ "homepage": "https://magiclayers.app/ai-agent/",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/canvatopsd/magiclayers-cli.git"
25
+ },
26
+ "bugs": {
27
+ "url": "https://github.com/canvatopsd/magiclayers-cli/issues"
28
+ },
29
+ "author": "CanvaToPSD",
30
+ "license": "UNLICENSED",
31
+ "publishConfig": {
32
+ "access": "public",
33
+ "registry": "https://registry.npmjs.org/"
34
+ },
35
+ "keywords": [
36
+ "magiclayers",
37
+ "psd",
38
+ "image-layers",
39
+ "spot-color",
40
+ "cli",
41
+ "agent-skills"
42
+ ],
43
+ "magiclayers": {
44
+ "targets": [
45
+ "darwin-arm64",
46
+ "linux-x64"
47
+ ]
48
+ },
49
+ "gitHead": "532ecc6a6e24409f8afe9c59160a31176cfaf72d"
50
+ }
package/release.json ADDED
@@ -0,0 +1,17 @@
1
+ {
2
+ "version": "2.6.7",
3
+ "revision": "532ecc6a6e24409f8afe9c59160a31176cfaf72d",
4
+ "environment": "prod",
5
+ "targets": [
6
+ "darwin-arm64",
7
+ "linux-x64"
8
+ ],
9
+ "binaries": {
10
+ "darwin-arm64": {
11
+ "sha256": "300812d1550ae01d3b18bbb5ea1497205206a77ffa9001857b1b0cd074047336"
12
+ },
13
+ "linux-x64": {
14
+ "sha256": "3773bcf58bf4c8390ce32f13340c5e2e668e0c85b31969f967a0d0944aac463b"
15
+ }
16
+ }
17
+ }
Binary file
Binary file
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: magiclayers
3
+ description: Convert PNG, JPEG or WebP images into editable PSDs or automatic spot-color print separations through the MagicLayers remote MCP or CLI. Submit an image, share hosted checkout, verify payment, check progress and download the finished files.
4
+ ---
5
+
6
+ ## Choose an access method
7
+
8
+ If the current AI client supports remote MCP, connect to `https://magiclayers.app/mcp` using Streamable HTTP. Discover tools through the MCP client. If the agent can run terminal commands, use the `magiclayers` CLI. Each method supports the complete task workflow. The user pays on the hosted Stripe page. MagicLayers requires no account or API key.
9
+
10
+ Get the original PNG, JPEG or WebP, up to 30 MiB, and ask whether the user wants editable design layers or automatic spot-color print separations. Offer an email address only for optional delivery notifications. Use the same task for submission, checkout, status and delivery.
11
+
12
+ ## Remote MCP workflow
13
+
14
+ 1. If requested, preflight the original image with `convert` and `dry_run: true`. Use the client's file input. API integrations may supply the image bytes as `image_base64` from client code.
15
+ 2. Call `prepare_conversion`, keep the returned `task_id` and private `task_ref`, and pass `task_ref` to `convert` with the same image. Set `print: true` for spot-color separations. Submission freezes the quote without charging.
16
+ 3. Call `checkout` with the task ID and reference. Show the quote and hosted Stripe link so the user can pay. Once they finish, call `verify_payment` and `status`. Use `payment` to read the latest verified financial state.
17
+ 4. Once the task is ready, call `download`. The default kind is `package`. Choose `psd` or `preview` for a single file. The receipt includes a short-lived link, byte count and SHA-256.
18
+
19
+ After an uncertain submission, check `status` for the original task before retrying with the same image and options. Keep task references and signed download links private.
20
+
21
+ ## CLI workflow
22
+
23
+ Use the installed `magiclayers` command. Check `--version`, `discover` and `doctor`. For the commands below, use CLI 2.6.7 or later. Install Node.js 22 or newer and run `npm install -g @canvatopsd/magiclayers` if needed. The package includes native executables for macOS Apple Silicon and Linux x64/glibc 2.31+.
24
+
25
+ ```sh
26
+ magiclayers convert ./image.png --dry-run
27
+ magiclayers convert ./image.png
28
+ magiclayers checkout TASK_ID
29
+ # After the buyer completes Stripe checkout:
30
+ magiclayers verify-payment TASK_ID
31
+ magiclayers status TASK_ID
32
+ # After delivery is ready:
33
+ magiclayers download TASK_ID --output ./delivery.zip
34
+ ```
35
+
36
+ Use `--email` for delivery notifications and `--print` for spot separations. CLI dry-run validates local arguments. The CLI saves private access before submitting, returns JSON for business commands and exits nonzero on error. Use full option names. `--kind psd` and `--kind preview` select individual files. The download command verifies size and SHA-256 and preserves existing output files.
37
+
38
+ Prod defaults to `https://magiclayers.app`. Use `--base-url http://127.0.0.1:3000` for local. The bundled Skill can be installed with `magiclayers skill install agents` or a supported agent name. `--dir` selects a parent skills directory. Start a new agent session after installation.
39
+
40
+ ## Resume and print output
41
+
42
+ Keep the original task ID. For an uncertain CLI submission, inspect that task before retrying `convert --task-id TASK_ID` with identical image, email, locale and workflow. Restore the original private access file from `magiclayers/tasks/` in the OS application-data directory if needed. A terminal-capable agent may resume an MCP task with the same task ID and service origin by supplying `MAGICLAYERS_TASK_REFERENCE` through its private process environment. Keep credentials out of chat messages and logs. Check status explicitly when needed.
43
+
44
+ New print tasks automatically extract up to twelve inks at 300 DPI on white, retaining pixel dimensions. The ZIP contains continuous-tone TIFF/PNG plates, an RGB layered PSD and a proof. Use `--print-settings` or `print_settings` only when retrying a task with an existing explicit setup.
45
+
46
+ [Integration and installation](https://magiclayers.app/ai-agent/) · [CLI usage and recovery](https://magiclayers.app/agent/doc/usage.md)