makeables 0.4.0 → 0.4.1
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/dist/cli.js +12 -3
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
@@ -16726,7 +16726,7 @@ import sharp7 from "sharp";
|
|
|
16726
16726
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
16727
16727
|
|
|
16728
16728
|
// package.json
|
|
16729
|
-
var version = "0.4.
|
|
16729
|
+
var version = "0.4.1";
|
|
16730
16730
|
|
|
16731
16731
|
// src/badge.ts
|
|
16732
16732
|
import { existsSync as existsSync3 } from "fs";
|
|
@@ -17983,7 +17983,16 @@ function prepareSticker(art, material) {
|
|
|
17983
17983
|
ctx.drawImage(coating.canvas, 0, 0);
|
|
17984
17984
|
ctx.restore();
|
|
17985
17985
|
}
|
|
17986
|
-
return {
|
|
17986
|
+
return {
|
|
17987
|
+
draw,
|
|
17988
|
+
artwork: art,
|
|
17989
|
+
surface: surface.canvas,
|
|
17990
|
+
reverse: reverse.canvas,
|
|
17991
|
+
mask: mask.canvas,
|
|
17992
|
+
material: { ...material },
|
|
17993
|
+
width,
|
|
17994
|
+
height
|
|
17995
|
+
};
|
|
17987
17996
|
}
|
|
17988
17997
|
|
|
17989
17998
|
// ../renderer/src/node.ts
|
|
@@ -20722,7 +20731,7 @@ var design_default = '# Art direction, with room to invent\n\nThe catalog is a r
|
|
|
20722
20731
|
var images_default = '# Makeables images\n\nLocal reference tools need no generation service, account or repository checkout.\nUse these when `cards` needs measured geometry, preparation or selective tracing.\nParameters are a JSON object (or `@file`) passed through `--params`. Outputs use\nnew paths; originals are never overwritten. Read each generated preview.\n\n```sh\nmakeables image detect --file reference.png\nmakeables image prepare --file reference.png --out prepared --params \'{"crop":"20,30,1000,630","patch":["80,80,120,80,300,80,6,0"]}\'\nmakeables image trace --file prepared --out card.svg --params \'{"title":"My card","credit":"Source and author","tones":7}\'\nmakeables image sample --file reference.png --params \'{"points":["20,30","100,80"]}\'\nmakeables image measure --file reference.png --params \'{"rows":"100,200","cols":"80","dark":250}\'\nmakeables image map --file reference.png --params \'{"box":"10,20,100,80","colors":6}\'\nmakeables image glyphs --file reference.png --out glyph.svg --params \'{"box":"20,30,200,80","at":"100,200","fill":"#111111"}\'\nmakeables image rotate --file portrait.svg --out card.svg --params \'{"top":"left"}\'\nmakeables image compare --file card.svg --ref reference.png --out compare.png --params \'{"upright":"left","ref-box":"20,30,756,1200"}\'\nmakeables validate --file card.svg --out preview.png\n```\n\n`detect` suggests crop regions; inspect the image rather than trusting the\nheuristic. `prepare` uses source-pixel coordinates, crops near the 1200:756 ratio,\npatches from the untouched source and fills background at the crop border.\nA patch is `destinationX,destinationY,width,height,sourceX,sourceY,feather,flop`;\nonly remove details the user wants removed. Compare every patched area closely.\nOptional `edge-band` and `bg-tol` tune edge cleanup. A substantially different\ncrop ratio is rejected to avoid stretching; rotate portrait objects instead.\n\n`trace` uses 2\u201312 luminance bands and optional `ink` threshold (0\u20131). `raster:true`\nkeeps the prepared image under vector ink. Tracing and `glyphs` require the\noptional `potrace` executable; `makeables doctor` checks it. Install it only\nwithin the user\'s installation authorization (macOS: `brew install potrace`).\nOther operations do not need potrace. No automatic package install occurs.\n\n`sample` returns a local 3\xD73 color average and center pixel. `measure` returns\ndark runs in rows/columns; use these for borders, stroke slopes and barcodes.\n`map` produces a color legend and a small pixel map (at most 160 \xD7 200).\nFor flat reference objects, use measured shapes, shared geometry and original\ntext; trace unusual glyphs selectively. Keep counters with even-odd fill. Draw\nportrait objects upright, retain proportions, then rotate the entire card.\n\nWeb research is optional and uses tools available in the current agent session.\nPrefer official sources for assets and provenance, use community sources for\ncontext, and do not bypass bot checks or invent permission. Preserve attribution\nand distinguish an unofficial colorway from a documented variant. Respect no-web\nrequests; these CLI tools operate on local inputs.\n\n## Optional image generation\n\nUse this after the user chooses generation or requests a change that needs new image content. A style reference alone does not authorize transforming the portrait. Honor an original-photo or filters-only choice; editable monochrome, tint, thermal, crop and other native treatments do not require ai-cli.\n\nDistinguish transforming the person\'s photo from generating separate decorative artwork. A portrait transformation needs the actual portrait, not just the style reference. Keep the person\'s identity, framing, pose and proportions. For separate artwork, leave the portrait unchanged unless the user also requested its transformation.\n\nCheck `makeables doctor --json`. If ai-cli is missing, ask whether to install it for the requested transformation, then run:\n\n```sh\nnpm install --global ai-cli\nai image --help\nai models --type image --json\n```\n\nUse the installed CLI\'s setup instructions for the user\'s AI Gateway credentials. Never put keys in chat, files, prompts, page storage, WebMCP arguments or the session URL. Explain that generation sends the selected source images to an external provider and uses Gateway credits separately from the coding agent\'s subscription. Confirm that processing and spending if not already authorized. If declined, offer the original photo or editable filters and continue with the user\'s choice.\n\nUse the original local photo where available. To transform the current editor photo instead:\n\n```sh\nmakeables studio call badge_get_image --url "$MAKEABLES_URL" --params \'{"target":"portrait"}\' --json > portrait-response.json\nmakeables image extract --file portrait-response.json --out portrait.webp\n```\n\nThe extraction helper also accepts agent-browser\'s WebMCP JSON envelope and refuses to overwrite files. Keep image bytes out of the conversation.\n\nChoose a currently available model that accepts reference images. Verify the installed `ai image --help` flags, then use a prompt tailored to the design:\n\n```sh\nai image -m "$BADGE_IMAGE_MODEL" -i portrait.webp --output transformed.png --json \\\n "Transform only the supplied portrait into detailed pixel art. Preserve this person, head-and-shoulders framing, pose and proportions. No typography and no invented body."\n```\n\nFor a cutout, request background removal explicitly and inspect whether the output has real alpha. An opaque background is not transparency. Do not report an image as transformed if generation failed; keep the original and explain the failure.\n\nImport the result using a fresh state:\n\n```sh\nmakeables studio call badge_inspect --url "$MAKEABLES_URL" --params \'{"section":"state"}\' --json > state.json\nmakeables image params --file transformed.png --state state.json > image-params.json\nmakeables studio call badge_set_image --url "$MAKEABLES_URL" --params @image-params.json --json\n```\n\nFor artwork, add an image layer first, then pass `--target artwork` to `image params`. Inspect the resulting badge on both faces. Original and generated images stay separate so the user can return to the photograph.\n';
|
|
20723
20732
|
|
|
20724
20733
|
// skill-data/stickers.md
|
|
20725
|
-
var stickers_default = '# Makeables stickers\n\nStickers are the third profile of the shared design document: `product: "sticker"`,\na transparent 1024 \xD7 1024 canvas, and editable text, shapes, vectors and images.\nNo photo or personal information is required.\n\n```sh\nmakeables styles list --product sticker\nmakeables new sticker --style good-energy --out sticker.json\nmakeables layer set --file sticker.json --id headline --params \'{"text":"HELLO"}\'\nmakeables material set --file sticker.json --params \'{"finish":"glitter","border":18,"sparkle":0.72,"gloss":0.5}\'\nmakeables render --file sticker.json --out artwork.png\n```\n\n`render` produces the flat artwork. Open `/make/sticker` and import the JSON to\nsee the actual die-cut material. Use the shared Design Studio\'s PNG action\nfor a transparent PNG including the border, glitter and coating. PNG exports\nexclude the stage shadow, tilt and peel. Export JSON preserves editable layers,\nmaterial settings and embedded images. Save keeps the document in that browser.\n\nFinishes: `glitter`, `holographic`, `vinyl`. Border is 0\u201340 canvas pixels,\nsparkle and gloss are 0\u20131, and the integer seed fixes the crystal positions.\nThe preview
|
|
20734
|
+
var stickers_default = '# Makeables stickers\n\nStickers are the third profile of the shared design document: `product: "sticker"`,\na transparent 1024 \xD7 1024 canvas, and editable text, shapes, vectors and images.\nNo photo or personal information is required.\n\n```sh\nmakeables styles list --product sticker\nmakeables new sticker --style good-energy --out sticker.json\nmakeables layer set --file sticker.json --id headline --params \'{"text":"HELLO"}\'\nmakeables material set --file sticker.json --params \'{"finish":"glitter","border":18,"sparkle":0.72,"gloss":0.5}\'\nmakeables render --file sticker.json --out artwork.png\n```\n\n`render` produces the flat artwork. Open `/make/sticker` and import the JSON to\nsee the actual die-cut material. Use the shared Design Studio\'s PNG action\nfor a transparent PNG including the border, glitter and coating. PNG exports\nexclude the stage shadow, tilt and peel. Export JSON preserves editable layers,\nmaterial settings and embedded images. Save keeps the document in that browser.\n\nFinishes: `glitter`, `holographic`, `vinyl`. Border is 0\u201340 canvas pixels,\nsparkle and gloss are 0\u20131, and the integer seed fixes the crystal positions.\nThe interactive preview is a flexible mesh: pointer movement changes studio\nreflections, dragging the center bends the sheet, and dragging a corner rolls\nthe paper reverse into view. Click the sticker or use Peel sticker for a held\npeel. Glitter crystals keep their positions while their reflections change;\nholographic stock shifts with the light. Pause and reduced-motion preferences\nstop continuous motion. Devices without WebGL2 retain a static material preview.\n\nThe bottom dock selects the same editable styles as the sidebar. Each style\nremembers its edits during this studio session; selecting the active thumbnail\ndoes not reset it. Save retains a version in the shared local library. The dock\'s\nMaterial layers control separates six preview surfaces with a spring animation:\nlaminate, laminate adhesive, ink, stock, adhesive and liner. These describe the\nvisual material, not a manufacturing specification. Focus preview hides the\nside panels; Escape or the focus control brings them back. Save, PNG and Submit\nremain in the same studio. None of these view changes changes the document.\n\nThe sidebar gallery includes three original presets: `good-energy` (glitter), `tiny-victories` (vinyl), and\n`stay-curious` (holographic). Search or filter the collection by finish. For imported artwork, use a transparent PNG/WebP under 2 MB\nand 24 megapixels. Use the same Design Studio as Cards and Badges for layer edits, undo, material\nlocks and versioned local saving. Saved directions appear in the sidebar.\n\n```sh\nmakeables studio start --product sticker --no-open --json\n# Use the returned local session URL for badge_inspect, badge_edit and badge_library.\nmakeables studio save --url "$MAKEABLES_URL" --out sticker.makeables.json --json\nmakeables submit --file sticker.makeables.json --dry-run --json\n```\n\nThe shared studio tools retain their `badge_` names for compatibility. A material\npatch uses `edits.sticker`, for example `{"finish":"glitter","border":24}`.\nThe single editable face is `front`; the paper reverse is a preview interaction.\nDiscover `badge_view` for optional `sticker: {exploded, peeled, focused}` booleans,\nalongside the existing `moving` and `theme` controls. Supply the latest revision\nfrom `badge_inspect`. Exploded and peeled are mutually exclusive, and state reports\nthe active view under `view.sticker`. Exports and submissions always flatten the\nunchanged material document, even while its preview is peeled or separated.\n\nSubmit opens the same `/submit` preview, credit and consent flow as the other\nproducts. Portable packages include one transparent material PNG and editable\nlayers/assets, without participant data. `makeables submit --file sticker.json`\nalso prepares this package directly; `render` remains a flat artwork export.\nAfter the user approves the exact version, submit with `--yes`. A `pending`\nreceipt means admin review, not publication. Approved stickers appear in the\npublic gallery and the studio\'s Community collection and can be reopened for\nediting. Status recovery and author withdrawal use the shared submission service.\n';
|
|
20726
20735
|
|
|
20727
20736
|
// skill-data/wallet.md
|
|
20728
20737
|
var wallet_default = "# Makeables Wallet\n\nApply or switch the artwork of an existing iPhone Wallet card, or remove a\ncustom design by restoring its original issuer artwork. This changes artwork,\nnot payment credentials or enrollment. It uses experimental, unofficial device\nservices; compatibility depends on iOS. Artwork apply has been tested on a\nWallet card. Restoration of an actual Wallet card is still unverified; state\nthat limitation before the user's first requested device operation.\n\nLoad this guide when the user chooses installation after a card preview, asks\nto change an existing Wallet skin, or asks to restore it. Speak their language.\nCreating or approving a design alone does not authorize a phone write. A\nrequest to apply that exact design authorizes the write once its target is\nestablished; do not add a redundant confirmation.\n\n## Setup and complete artwork\n\nWallet work requires macOS and an iPhone connected over USB, unlocked and\ntrusted. Design/rendering still work on other platforms. Ask only for a missing\nimage or target; never request payment numbers, credentials or raw resource IDs.\n\n```sh\nmakeables wallet doctor\nmakeables wallet setup\n```\n\nSetup downloads a versioned, checksum-verified macOS companion from the public\nMakeables community releases. It includes its Python runtime, native bridges\nand image exporter; a source checkout, Python installation or Xcode is not\nneeded. Reuse the user's existing installation authorization.\n\nUse the saved card JSON, complete SVG, or a flat PNG. For a rendered preview of\nexactly what will be applied:\n\n```sh\nmakeables wallet prep --file card.json --out wallet-preview\n```\n\nOpen `wallet-preview/cardBackgroundCombined@3x.png` and inspect it. The command\nrenders the **entire composition** to opaque 1536 \xD7 969, then prepares the two\nPNGs and PDF. Never extract an SVG's embedded background and discard its vectors.\nKeep chip/logo/details the user requested, check Wallet's lower-left number\narea, and omit account numbers or cardholder names from the artwork. Use\n`--side back` only if that is the selected face. Wallet uses a static image;\nlive shader animation belongs to the studio.\n\n## Select the device and card\n\nTell the user to keep the phone connected, open Wallet, authenticate, and tap\nthe exact card during the scan:\n\n```sh\nmakeables wallet list\n```\n\nThe scan takes up to 45 seconds. Multiple phones produce device selection\nhandles; repeat with `--device d-...`. Cards receive local handles such as\n`c-...`, valid for ten minutes. These identify the cards observed during the\nscan, not an inferred bank or cardholder. If several cards appear, establish\nwhich tapped card the user intended. If redacted or ambiguous, repeat the\nread-only scan; never choose the first resource by default.\n\nReport observable milestones and elapsed time, not invented percentages.\nPreparation is usually 1\u20133 minutes and a device operation roughly 1\u20134 minutes;\nthe connection and iOS can vary. Keep the process alive while it works.\n\n## Apply or switch a design\n\nAfter inspecting the art and establishing the requested target:\n\n```sh\nmakeables wallet apply --file card.json --card c-SELECTION --yes\n```\n\n`--yes` records the user's request for this design on this card. It does not\nauthorize another card or a future design. The helper verifies the connected\ndevice, backs up the original artwork, checks hashes, saves a private visible\ncopy and only then applies the prepared artwork. A copy failure stops the write.\nFor an already customized card, it reuses its verified original instead of\nbacking up the custom skin as though it were the issuer artwork.\n\nTo switch the same card using an established original backup:\n\n```sh\nmakeables wallet backups\nmakeables wallet apply --file next-card.json --backup b-BACKUP --yes\n```\n\nChoose the matching backup explicitly when several exist. A reissued card needs\na fresh selection and original backup. An unresolved earlier operation must be\nrecovered before another apply. Device operations are serialized locally.\n\n## Restore and preserve backups\n\n```sh\nmakeables wallet backups\nmakeables wallet backups --backup \"/absolute/path/to/original-backup\"\nmakeables wallet restore --backup b-BACKUP --yes\n```\n\nRestore verifies the original files and the connected device before writing.\nIt restores issuer artwork, not an intermediate custom design. It does not\ndelete the bank card from Wallet.\n\nOriginal copies live in `~/Documents/Makeables/Wallet Backups/`, with private\noperational state under `~/Library/Application Support/Makeables/Wallet/`.\nThey survive CLI updates and companion reinstalls. Keep both locations private\nand retain originals until the user no longer needs restore. Do not attach\nbackups, IDs, device logs or their contents to chat, public issues or the repo.\n\nOld `makeables` or `drawr-helper` installations may have originals under their\nown `backups/cards/` directory. Use an explicit verified path with `--backup`;\ndo not assume that a new install owns the old backup. A missing original is not\npermission to invent one or treat the current custom skin as issuer artwork.\n\n## Check the result and stop on uncertainty\n\nOnly a receipt with `status: complete` or `status: restored` is success. Check\nthe returned backup path, then ask the user to force-close/reopen Wallet and\nconfirm the visible result. Keep the design document for future iterations.\n\nA timeout, disconnect or failed command may have changed the device. Preserve\nevery backup and inspect `wallet backups` plus the private diagnostic path in\nthe error receipt. Do not blindly retry a write. The installed companion\nincludes recovery notes. For a verified transaction snapshot from this version,\n`makeables wallet recover --backup \"/absolute/path/to/transaction\" --device d-SELECTION --yes`\nrestores recorded staging/Books state on the matching device. Inspect the private\nsnapshot and use this only for requested recovery, before another artwork write.\nLegacy transactions without device binding require their original helper. Report what completed and what remains uncertain.\n";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "makeables",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Create editable cards, badges and stickers with layered designs, live materials and your coding agent.",
|
|
5
5
|
"homepage": "https://makeables.dev",
|
|
6
6
|
"repository": {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"tsup": "^8.4.0",
|
|
51
51
|
"typescript": "^5.8.3",
|
|
52
52
|
"@makeables/design": "0.0.1",
|
|
53
|
-
"@makeables/
|
|
54
|
-
"@makeables/
|
|
53
|
+
"@makeables/testing": "0.0.0",
|
|
54
|
+
"@makeables/renderer": "0.0.1"
|
|
55
55
|
},
|
|
56
56
|
"engines": {
|
|
57
57
|
"node": ">=22"
|