inkless 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.
- package/LICENSE +21 -0
- package/README.md +65 -2
- package/bin/inkless.js +10 -0
- package/console-dist/assets/BlueprintTool-CLWuM21a.js +4226 -0
- package/console-dist/assets/index-CIqLZU6s.js +33 -0
- package/console-dist/assets/index-Dv7Gg9qm.css +1 -0
- package/console-dist/favicon.svg +11 -0
- package/console-dist/index.html +18 -0
- package/native/linux/rfcomm.py +84 -0
- package/native/macos/build/InklessBluetooth.app/Contents/Info.plist +26 -0
- package/native/macos/build/InklessBluetooth.app/Contents/MacOS/InklessBluetooth +0 -0
- package/native/macos/build/InklessBluetooth.app/Contents/_CodeSignature/CodeResources +115 -0
- package/package.json +60 -4
- package/skills/inkless/SKILL.md +213 -0
- package/src/core/bits.js +143 -0
- package/src/core/blueprint/demos.js +119 -0
- package/src/core/blueprint/geometry.js +232 -0
- package/src/core/blueprint/index.js +100 -0
- package/src/core/blueprint/layout.js +210 -0
- package/src/core/blueprint/mesh.js +101 -0
- package/src/core/blueprint/methods.js +95 -0
- package/src/core/blueprint/remesh.js +250 -0
- package/src/core/blueprint/slice.js +134 -0
- package/src/core/blueprint/unfold.js +185 -0
- package/src/core/design/codes.js +39 -0
- package/src/core/design/filters.js +109 -0
- package/src/core/design/render.js +317 -0
- package/src/core/design/schema.js +132 -0
- package/src/core/formats/fit.js +46 -0
- package/src/core/formats/index.js +210 -0
- package/src/core/formats/library.js +341 -0
- package/src/core/formats/share.js +65 -0
- package/src/core/index.js +15 -0
- package/src/core/printers/hp6.js +160 -0
- package/src/core/printers/index.js +14 -0
- package/src/core/printers/pm290.js +115 -0
- package/src/core/session.js +56 -0
- package/src/node/artwork.js +33 -0
- package/src/node/cli.js +430 -0
- package/src/node/console/actions.js +30 -0
- package/src/node/console/client.js +68 -0
- package/src/node/console/paths.js +8 -0
- package/src/node/console/server.js +286 -0
- package/src/node/design.js +99 -0
- package/src/node/formats.js +39 -0
- package/src/node/frames.js +93 -0
- package/src/node/index.js +6 -0
- package/src/node/kit.js +12 -0
- package/src/node/skill.js +44 -0
- package/src/node/transports/index.js +21 -0
- package/src/node/transports/linux.js +52 -0
- package/src/node/transports/macos.js +81 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.inkless-console,.inkless-gallery{--mat:#163629;--mat-line:#ffffff0d;--mat-line-major:#ffffff1f;--panel:#111214;--panel-2:#1b1d21;--field:#1a1c20;--ink:#eceae4;--on-ink:#111214;--muted:#8c8880;--line:#26282d;--accent:#ff5a1f;--accent-soft:#ff5a1f2e;--ok:#1f9d55;--you:#2b59ff;--paper:#fffefa;--sans:"Instrument Sans", -apple-system, system-ui, sans-serif;--mono:"IBM Plex Mono", "SF Mono", Menlo, monospace}.inkless-console{background:var(--panel);height:100%;min-height:620px;color:var(--ink);font:400 13px/1.4 var(--sans);--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;-webkit-font-smoothing:antialiased;grid-template-rows:56px minmax(0,1fr);display:grid;position:relative;overflow:hidden}.inkless-console *,.inkless-console :before,.inkless-console :after{box-sizing:border-box;margin:0;padding:0}.inkless-console button,.inkless-console input,.inkless-console select,.inkless-console textarea{font:inherit;color:inherit;background:0 0;border:0}.inkless-console button{cursor:pointer}.inkless-console button:disabled{cursor:default;opacity:.45}.inkless-console :focus-visible{outline:2px solid var(--accent);outline-offset:1px}.inkless-console [hidden]{display:none!important}.inkless-console h4{font:600 11px var(--mono);letter-spacing:1.2px;text-transform:uppercase;color:var(--muted);margin-bottom:8px}.inkless-console .hint{color:var(--muted);font-size:12px;line-height:1.45}.inkless-console .warn{color:#ffb08f}.inkless-console .topbar{border-bottom:1px solid var(--line);align-items:center;gap:14px;min-width:0;padding:0 18px;display:flex}.inkless-console .logo{font:700 20px var(--sans);letter-spacing:-.5px;flex:none;align-items:center;gap:8px;display:flex}.inkless-console .logo .wm{position:relative}.inkless-console .logo .wm em{background:var(--accent);border-radius:50%/60% 60% 40% 40%;width:6px;height:8px;position:absolute;top:-1px;left:33px;transform:rotate(14deg)}.inkless-console .tabs{gap:4px;margin-left:10px;display:flex}.inkless-console .tab{font:500 13px var(--sans);color:var(--muted);border-radius:8px;padding:7px 12px}.inkless-console .tab:hover{color:var(--ink)}.inkless-console .tab.on{background:var(--ink);color:var(--on-ink)}.inkless-console .spacer{flex:1}.inkless-console .live{font:500 12px var(--mono);color:#6fdca0;white-space:nowrap;background:#1f9d5524;border-radius:999px;align-items:center;gap:8px;padding:6px 11px;display:flex}.inkless-console .live b{background:var(--ok);border-radius:50%;width:8px;height:8px;box-shadow:0 0 0 3px #1f9d5533}.inkless-console .live.off{background:var(--panel-2);color:var(--muted)}.inkless-console .live.off b{background:var(--muted);box-shadow:none}.inkless-console .printer select{font:500 12px var(--mono);border:1px solid var(--line);background:var(--field);appearance:none;cursor:pointer;background-image:linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);background-position:right 13px center,right 9px center;background-repeat:no-repeat;background-size:4px 4px;border-radius:8px;max-width:300px;padding:6px 28px 6px 11px}.inkless-console .printer option{background:var(--panel)}.inkless-console .link-status{font:500 12px var(--mono);border:1px solid var(--line);white-space:nowrap;border-radius:8px;align-items:center;gap:7px;padding:6px 11px;display:flex}.inkless-console .link-status b{background:var(--muted);border-radius:50%;width:7px;height:7px}.inkless-console .link-status.connected b{background:var(--ok)}.inkless-console .link-status.printing b,.inkless-console .link-status.connecting b{background:var(--accent);animation:1s infinite alternate inkless-pulse}.inkless-console .link-status.error{color:#ffb08f;border-color:#ff5a1f66}.inkless-console .link-status.error b{background:var(--accent)}@keyframes inkless-pulse{to{opacity:.3}}.inkless-console .tool-pane{min-height:0;display:grid}.inkless-console .main{outline:none;min-width:0;min-height:0;display:grid}.inkless-console .label-main{grid-template-columns:220px minmax(0,1fr) 330px}.inkless-console .bp-main{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 300px}.inkless-console .side{border-right:1px solid var(--line);flex-direction:column;gap:18px;min-height:0;padding:16px;display:flex;overflow-y:auto}.inkless-console .side.right{border-right:0;border-left:1px solid var(--line);overflow:hidden}.inkless-console .side-scroll{flex-direction:column;flex:0 auto;gap:18px;min-height:0;margin:-4px -6px;padding:4px 6px;display:flex;overflow-y:auto}.inkless-console .side section{flex-direction:column;gap:6px;display:flex}.inkless-console .side section>h4{margin-bottom:2px}.inkless-console .tools{grid-template-columns:repeat(3,1fr);gap:6px;display:grid}.inkless-console .tool{border:1px solid var(--line);background:var(--field);height:54px;font:500 11px var(--sans);color:var(--muted);border-radius:10px;place-items:center;padding-top:6px;display:grid}.inkless-console .tool:hover{border-color:var(--ink);color:var(--ink)}.inkless-console .tool svg,.inkless-console .icon-btn svg,.inkless-console .layer-actions svg{width:18px;height:18px;stroke:var(--ink);fill:none;stroke-width:1.6px;stroke-linecap:round;stroke-linejoin:round}.inkless-console .layers-section{min-height:0}.inkless-console .layers{flex-direction:column;gap:2px;display:flex}.inkless-console .layer{cursor:pointer;border-radius:8px;align-items:center;gap:8px;min-width:0;padding:7px 8px;font-size:13px;display:flex}.inkless-console .layer:hover{background:var(--panel-2)}.inkless-console .layer.sel{background:var(--accent-soft)}.inkless-console .layer .name{text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0;overflow:hidden}.inkless-console .layer small{font:11px var(--mono);color:var(--muted);white-space:nowrap}.inkless-console .layer .ic{background:var(--panel-2);width:16px;height:16px;font:600 9px var(--mono);border-radius:4px;flex:none;place-items:center;display:grid}.inkless-console .layer-actions{gap:0;display:flex}.inkless-console .layer-actions button{border-radius:5px;place-items:center;width:20px;height:20px;display:grid}.inkless-console .layer-actions button:hover{background:#ffffff14}.inkless-console .layer-actions svg{width:14px;height:14px}.inkless-console .seg{background:var(--panel-2);border-radius:9px;gap:2px;padding:3px;display:flex}.inkless-console .seg button{text-align:center;font:500 12px var(--sans);color:var(--muted);white-space:nowrap;border-radius:7px;flex:1;padding:6px 4px}.inkless-console .seg button:hover{color:var(--ink)}.inkless-console .seg button.on{background:var(--field);color:var(--ink);box-shadow:0 1px 2px #0006, inset 0 0 0 1px var(--line)}.inkless-console .row{justify-content:space-between;align-items:center;gap:10px;min-height:30px;font-size:13px;display:flex}.inkless-console .v{font:500 12px var(--mono);background:var(--field);border:1px solid var(--line);border-radius:6px;align-items:center;gap:4px;padding:4px 8px;display:inline-flex}.inkless-console .v input{text-align:right;width:52px;font:inherit;-moz-appearance:textfield}.inkless-console .v input::-webkit-outer-spin-button{-webkit-appearance:none}.inkless-console .v input::-webkit-inner-spin-button{-webkit-appearance:none}.inkless-console .v em{color:var(--muted);font-style:normal}.inkless-console select.v{cursor:pointer}.inkless-console select.v option{background:var(--panel)}.inkless-console .v.pair button{color:var(--muted);border-radius:4px;padding:0 4px}.inkless-console .v.pair button.on{color:var(--accent)}.inkless-console .v.pair input{width:36px}.inkless-console .grid2{grid-template-columns:1fr 1fr;column-gap:14px;display:grid}.inkless-console .grid2 .row span:first-child{color:var(--muted)}.inkless-console .toggle input{appearance:none;background:var(--panel-2);border:1px solid var(--line);cursor:pointer;border-radius:9px;width:30px;height:18px;position:relative}.inkless-console .toggle input:after{content:"";background:var(--muted);border-radius:50%;width:12px;height:12px;transition:transform .15s;position:absolute;top:2px;left:2px}.inkless-console .toggle input:checked{background:var(--accent);border-color:var(--accent)}.inkless-console .toggle input:checked:after{background:#fff;transform:translate(12px)}.inkless-console .field{border:1px solid var(--line);background:var(--field);resize:vertical;border-radius:8px;width:100%;padding:8px 10px;font-size:13px}.inkless-console textarea.field{font-family:var(--mono);font-size:12px}.inkless-console .props{gap:8px}.inkless-console .filter-controls{flex-direction:column;gap:6px;display:flex}.inkless-console .slider-field .row{min-height:26px}.inkless-console .slider{appearance:none;cursor:pointer;background:linear-gradient(var(--ink), var(--ink)) 0 0 / var(--p) 100% no-repeat, var(--line);border-radius:2px;width:100%;height:4px;margin:6px 0 4px}.inkless-console .slider::-webkit-slider-thumb{-webkit-appearance:none;background:var(--panel);border:2px solid var(--ink);border-radius:50%;width:16px;height:16px}.inkless-console .slider::-moz-range-thumb{background:var(--panel);border:2px solid var(--ink);border-radius:50%;width:12px;height:12px}.inkless-console .actions{gap:8px;display:flex}.inkless-console .btn{text-align:center;font:600 14px var(--sans);border:1px solid var(--line);background:var(--field);white-space:nowrap;border-radius:10px;flex:1;padding:12px 8px}.inkless-console .btn:hover:not(:disabled){border-color:var(--muted)}.inkless-console .btn.primary{background:var(--ink);color:var(--on-ink);border-color:var(--ink);justify-content:center;align-items:center;gap:8px;display:flex}.inkless-console .btn.primary:before{content:"";background:var(--accent);border-radius:2px;width:9px;height:9px}.inkless-console .btn.small{border-radius:8px;flex:none;padding:7px 10px;font-size:12px}.inkless-console .actions.small{gap:6px}.inkless-console .btn.wide{flex:none;width:100%}.inkless-console .print-bar{flex-direction:column;gap:8px;margin-top:auto;display:flex}.inkless-console .status-line{font:500 11px var(--mono);color:var(--muted)}.inkless-console .status-line.error{color:#ffb08f}.inkless-console .status-line.connected{color:#6fdca0}.inkless-console .pages{flex-direction:column;gap:2px;max-height:180px;display:flex;overflow-y:auto}.inkless-console .pages button{text-align:left;font:500 12px var(--mono);color:var(--muted);border-radius:7px;padding:6px 8px}.inkless-console .pages button.on{background:var(--accent-soft);color:var(--ink)}.inkless-console .mat-wrap{background:var(--mat);min-width:0;min-height:0;position:relative;overflow:hidden}.inkless-console .mat{position:absolute;inset:0;overflow:auto}.inkless-console .grid{background-color:var(--mat);background-image:linear-gradient(var(--mat-line-major) 1px, transparent 1px), linear-gradient(90deg, var(--mat-line-major) 1px, transparent 1px), linear-gradient(var(--mat-line) 1px, transparent 1px), linear-gradient(90deg, var(--mat-line) 1px, transparent 1px);background-size:80px 80px,80px 80px,8px 8px,8px 8px}.inkless-console .stage{position:relative}.inkless-console .mat.centered{place-items:center;padding:60px;display:grid}.inkless-console .paper{background:var(--paper);color:#111;box-shadow:0 14px 28px #00000059}.inkless-console .label{border-radius:4px;position:absolute}.inkless-console .centered .label{position:relative}.inkless-console .bits{image-rendering:pixelated;border-radius:inherit;display:block}.inkless-console .dim{font:500 11px var(--mono);color:#ffffffbf;white-space:nowrap;pointer-events:none;position:absolute}.inkless-console .dim.above{text-align:center;top:-24px;left:0;right:0}.inkless-console .dim.beside{top:50%;right:calc(100% + 10px);transform:translateY(-50%)}.inkless-console .mat-hud{font:500 11px var(--mono);color:#fff9;pointer-events:none;align-items:center;gap:8px;display:flex;position:absolute;top:12px;left:16px;right:16px}.inkless-console .mat-hud>*{pointer-events:auto}.inkless-console .mat-hud.spread{color:#fff;background:linear-gradient(var(--mat) 55%, transparent);justify-content:space-between;padding:12px 16px 14px;top:0;left:0;right:0}.inkless-console .icon-btn{background:#00000059;border-radius:8px;place-items:center;width:28px;height:28px;display:grid}.inkless-console .icon-btn svg{stroke:#fff;width:15px;height:15px}.inkless-console .zoom{gap:6px;display:flex;position:absolute;bottom:14px;right:14px}.inkless-console .zoom button{font:500 12px var(--mono);color:#fff;background:#00000059;border-radius:8px;padding:6px 10px}.inkless-console .zoom button.on{background:#0009;box-shadow:inset 0 0 0 1px #ffffff40}.inkless-console .overlay{position:absolute;inset:0}.inkless-console .box{cursor:move;touch-action:none;position:absolute}.inkless-console .box:hover{outline:1px dashed #ff5a1f99}.inkless-console .box.sel{outline:1.5px solid var(--accent)}.inkless-console .handle{border:1.5px solid var(--accent);touch-action:none;background:#fff;width:9px;height:9px;position:absolute}.inkless-console .handle.nw{cursor:nwse-resize;top:-5px;left:-5px}.inkless-console .handle.ne{cursor:nesw-resize;top:-5px;right:-5px}.inkless-console .handle.sw{cursor:nesw-resize;bottom:-5px;left:-5px}.inkless-console .handle.se{cursor:nwse-resize;bottom:-5px;right:-5px}.inkless-console .handle.rotate{cursor:grab;border-radius:50%;margin-left:-5px;top:-22px;left:50%}.inkless-console .handle.rotate:after{content:"";background:var(--accent);width:1.5px;height:10px;position:absolute;top:8px;left:2px}.inkless-console .tag-note{font:600 11px var(--sans);background:var(--accent);color:#fff;white-space:nowrap;pointer-events:none;border-radius:6px;padding:3px 8px;position:absolute;bottom:calc(100% + 26px);left:50%;transform:translate(-50%)}.inkless-console .tag-note.you{background:var(--you)}.inkless-console .tag-note.agent{top:calc(100% + 6px);bottom:auto}.inkless-console .fits{align-items:flex-end;gap:14px;display:flex;position:absolute;bottom:18px;left:20px}.inkless-console .fit{color:#fff;font:500 11px var(--mono);text-align:left;background:#00000047;border-radius:10px;flex-direction:column;align-items:flex-start;gap:6px;padding:10px;display:flex}.inkless-console .fit .mini{border-radius:3px}.inkless-console .fit .switch{color:var(--accent);display:none}.inkless-console button.fit:hover{background:#00000073}.inkless-console button.fit:hover .switch{display:block}.inkless-console .drop{aspect-ratio:4/3;border:1px dashed var(--line);background:var(--field);width:100%;color:var(--muted);border-radius:10px;place-items:center;padding:10px;font-size:12px;display:grid;overflow:hidden}.inkless-console .drop:hover{border-color:var(--muted)}.inkless-console .drop img{object-fit:contain;border-radius:4px;max-width:100%;max-height:100%}.inkless-console .file-name{font:500 12px var(--mono);color:var(--muted);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.inkless-console .empty-card{color:#fff;text-align:center;background:#00000040;border:1px dashed #ffffff4d;border-radius:12px;flex-direction:column;gap:6px;max-width:320px;padding:22px 26px;display:flex}.inkless-console .empty-card strong{font-size:15px}.inkless-console .empty-card span{color:#ffffffb3;font-size:12px}.inkless-console .view3d{border-right:1px solid var(--line);background-color:#15171a;background-image:radial-gradient(#2a2d32 1px,#0000 1px);background-size:16px 16px;min-width:0;min-height:0;position:relative}.inkless-console .three-host{place-items:center;display:grid;position:absolute;inset:0}.inkless-console .three-host canvas{display:block;position:absolute;inset:0}.inkless-console .view3d .hud{pointer-events:none;gap:6px;display:flex;position:absolute;top:14px;left:16px}.inkless-console .view3d .legend{pointer-events:none;flex-wrap:wrap;gap:10px;display:flex;position:absolute;bottom:16px;left:16px;right:16px}.inkless-console .chip{font:500 11px var(--mono);background:var(--field);border:1px solid var(--line);border-radius:7px;padding:5px 9px}.inkless-console .chip.dark{background:var(--ink);color:var(--on-ink);border-color:var(--ink)}.inkless-console .chip.on{border-color:var(--accent);color:#ffb08f}.inkless-console .sheets{flex-wrap:wrap;place-content:flex-start center;gap:20px;padding:52px 20px 24px;display:flex}.inkless-console .strip{border-radius:4px;padding:0;transition:box-shadow .15s;position:relative;overflow:hidden}.inkless-console .strip:hover{box-shadow:0 14px 28px #00000059,0 0 0 2px #ff5a1f80}.inkless-console .strip.sel{box-shadow:0 14px 28px #00000059, 0 0 0 3px var(--accent)}.inkless-console .steps{flex-direction:column;gap:8px;list-style:none;display:flex}.inkless-console .step{grid-template-columns:22px 1fr;gap:8px;font-size:13px;line-height:1.4;display:grid}.inkless-console .step b{background:var(--ink);width:22px;height:22px;color:var(--on-ink);font:600 11px var(--mono);border-radius:50%;place-items:center;display:grid}.inkless-console .step code{font:600 12px var(--mono);background:var(--accent-soft);color:#ffb08f;cursor:pointer;border-radius:4px;padding:0 4px}.inkless-console .agent-panel{flex-direction:column;flex:1 1 0;gap:10px;min-height:min(360px,55%);margin-top:4px;display:flex}.inkless-console .agent-panel h4{margin-bottom:0}.inkless-console .thread{flex-direction:column;flex:1;gap:10px;min-height:0;display:flex;overflow-y:auto}.inkless-console .msg{background:var(--field);border:1px solid var(--line);white-space:pre-wrap;overflow-wrap:anywhere;border-radius:12px;padding:10px 12px;font-size:13px;line-height:1.45}.inkless-console .msg .who{font:600 11px var(--mono);color:var(--muted);align-items:center;gap:6px;margin-bottom:4px;display:flex}.inkless-console .msg .who:before{content:"";background:var(--accent);border-radius:50%;width:8px;height:8px}.inkless-console .msg.you{background:#2b59ff24;border-color:#2b59ff61}.inkless-console .msg.you .who:before{background:var(--you)}.inkless-console .event{font:500 11px var(--mono);color:var(--muted);align-items:center;gap:8px;display:flex}.inkless-console .event:before{content:"";background:var(--line);flex:0 0 14px;height:1px}.inkless-console .input{border:1px solid var(--line);background:var(--field);border-radius:10px;width:100%;padding:10px 12px;font-size:13px}.inkless-console .input::placeholder{color:var(--muted)}.inkless-console .toast{color:#ffd3c2;cursor:pointer;z-index:5;background:#2a1a14;border:1px solid #ff5a1f80;border-radius:10px;max-width:min(560px,90%);padding:10px 14px;font-size:13px;position:absolute;bottom:20px;left:50%;transform:translate(-50%);box-shadow:0 12px 30px #00000080}@media (width<=1180px){.inkless-console .label-main{grid-template-columns:196px minmax(0,1fr) 290px}.inkless-console .bp-main{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 270px}.inkless-console .fits{display:none}}@media (width<=900px){.inkless-console{grid-template-rows:auto auto;height:auto;overflow:visible}.inkless-console .topbar{flex-wrap:wrap;row-gap:8px;padding:10px 16px}.inkless-console .tabs{margin-left:0}.inkless-console .label-main,.inkless-console .bp-main{grid-template-columns:1fr}.inkless-console .mat-wrap,.inkless-console .view3d{order:-1;height:60vh;min-height:340px}.inkless-console .side,.inkless-console .side.right{border:0;border-top:1px solid var(--line);overflow:visible}.inkless-console .side-scroll{overflow:visible}}.inkless-console .tool.on{border-color:var(--accent);color:var(--ink);box-shadow:inset 0 0 0 1px var(--accent)}.inkless-console .overlay.drawing{cursor:crosshair;touch-action:none}.inkless-console .overlay .stroke{pointer-events:none;position:absolute;inset:0;overflow:visible}.inkless-console .overlay .stroke polyline{fill:none;stroke:#111;stroke-linecap:round;stroke-linejoin:round}.inkless-console .overlay .marquee{border:1px dashed var(--accent);pointer-events:none;background:#ff5a1f14;position:absolute}.inkless-console .label-grid{pointer-events:none;border-radius:inherit;background-image:linear-gradient(#2b59ff47 1px,#0000 1px),linear-gradient(90deg,#2b59ff47 1px,#0000 1px);position:absolute;inset:0}.inkless-console .margin-box{pointer-events:none;border:1px dashed #ff5a1fcc;position:absolute}.inkless-console .hud-btn,.inkless-console .hud-select,.inkless-console .hud-field{font:500 11px var(--mono);color:#fff;background:#00000059;border:1px solid #0000;border-radius:7px;padding:4px 8px}.inkless-console .hud-btn.on{border-color:var(--accent);color:#fff}.inkless-console .hud-field{align-items:center;gap:6px;display:inline-flex}.inkless-console .hud-field input{width:42px;font:inherit;color:#fff;background:0 0;border:0;border-bottom:1px solid #ffffff4d}.inkless-console .align{grid-template-columns:repeat(3,1fr);gap:6px;display:grid}.inkless-gallery{color:var(--ink);font:400 13px/1.4 var(--sans);flex-direction:column;gap:16px;display:flex}.inkless-gallery button{font:inherit;color:inherit;cursor:pointer;background:0 0;border:0;margin:0}.inkless-gallery h2{font:600 20px var(--sans);letter-spacing:-.2px;margin:0 0 4px}.inkless-gallery h3{font:600 11px var(--mono);letter-spacing:1.2px;text-transform:uppercase;color:var(--muted);margin:8px 0 -4px}.inkless-gallery .hint{margin:0}.inkless-gallery .gallery-bar{flex-direction:column;gap:10px;display:flex}.inkless-gallery .gallery-head{justify-content:space-between;align-items:flex-start;gap:16px;display:flex}.inkless-gallery .chips{flex-wrap:wrap;gap:6px;display:flex}.inkless-gallery .chips button{font:500 12px var(--mono);border:1px solid var(--line);background:var(--field);color:var(--muted);border-radius:999px;padding:6px 11px}.inkless-gallery .chips button:hover{color:var(--ink);border-color:var(--muted)}.inkless-gallery .chips button.on{background:var(--ink);color:var(--on-ink);border-color:var(--ink)}.inkless-gallery .format-grid{grid-template-columns:repeat(auto-fill,minmax(236px,1fr));gap:14px;display:grid}.inkless-gallery .format-card{text-align:left;border:1px solid var(--line);background:var(--panel-2);border-radius:12px;flex-direction:column;transition:border-color .15s,transform .15s;display:flex;overflow:hidden}.inkless-gallery .format-card:hover{border-color:var(--accent);transform:translateY(-1px)}.inkless-gallery .format-thumb{background-color:var(--mat);background-image:linear-gradient(var(--mat-line-major) 1px, transparent 1px), linear-gradient(90deg, var(--mat-line-major) 1px, transparent 1px);background-size:20px 20px;place-items:center;height:178px;display:grid}.inkless-gallery .format-thumb .paper{background:var(--paper);image-rendering:pixelated;border-radius:3px;display:block;box-shadow:0 8px 18px #00000059}.inkless-gallery .format-meta{flex-direction:column;gap:3px;padding:12px 14px 4px;display:flex}.inkless-gallery .format-meta b{font:600 14px var(--sans);align-items:center;gap:8px;display:flex}.inkless-gallery .format-meta em{font:600 10px var(--mono);text-transform:uppercase;letter-spacing:.8px;color:#ffb08f;background:var(--accent-soft);border-radius:5px;padding:2px 6px;font-style:normal}.inkless-gallery .format-meta small{font:500 11px var(--mono);color:var(--muted)}.inkless-gallery .format-meta span{color:var(--muted);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12.5px;line-height:1.45;display:-webkit-box;overflow:hidden}.inkless-gallery .format-use{font:600 12px var(--sans);color:var(--accent);align-self:flex-start;margin:8px 14px 14px}.inkless-gallery .gallery-empty{color:var(--muted);text-align:center;padding:30px 0}.inkless-console .gallery-overlay{z-index:4;background:var(--panel);padding:22px 26px 40px;position:absolute;inset:56px 0 0;overflow-y:auto}.inkless-console .format-fields{flex-direction:column;gap:8px;display:flex}.inkless-console .format-field{flex-direction:column;gap:4px;display:flex}.inkless-console .format-field>span{color:var(--muted);font-size:12px}.inkless-console .format-field textarea.field{font-family:var(--sans);font-size:13px}.inkless-console .format-save{flex-direction:column;gap:6px;display:flex}.inkless-console .format-panel .actions.small{flex-wrap:wrap}.inkless-console .format-panel .actions.small .btn{flex:auto}.inkless-console .side:not(.right)>*{flex-shrink:0}.inkless-console .btn.small.primary{padding:7px 12px}.inkless-console .handoff .btn{flex:1}.inkless-console .say{gap:6px;display:flex}.inkless-console .say .input{flex:1;min-width:0}.inkless-console .toast.ok{color:#bdf0d2;background:#13251b;border-color:#1f9d5580}@media (width<=900px){.inkless-console .gallery-overlay{z-index:20;padding:16px;position:fixed;inset:0}}.inkless-console .logo-btn{all:unset;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:8px;align-items:center;display:flex}.inkless-console .logo-btn:focus-visible{outline:2px solid var(--accent);outline-offset:4px}.inkless-console .topbar{-webkit-user-select:none;user-select:none}.inkless-console .agent-btn{white-space:nowrap}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32" fill="none">
|
|
2
|
+
<rect x="3" y="4" width="26" height="8" rx="2" fill="#f4f4f5"/>
|
|
3
|
+
<rect x="6" y="8" width="20" height="2.5" rx="1" fill="#111214"/>
|
|
4
|
+
<path d="M8.5 10.5h15v17l-2.5-2-2.5 2-2.5-2-2.5 2-2.5-2-2.5 2v-17z" fill="#ffffff"/>
|
|
5
|
+
<rect x="11" y="13" width="2" height="2" fill="#111214"/>
|
|
6
|
+
<rect x="15" y="13" width="2" height="2" fill="#111214"/>
|
|
7
|
+
<rect x="19" y="13" width="2" height="2" fill="#111214"/>
|
|
8
|
+
<rect x="13" y="15" width="2" height="2" fill="#ff5a1f"/>
|
|
9
|
+
<rect x="17" y="15" width="2" height="2" fill="#ff5a1f"/>
|
|
10
|
+
<rect x="11" y="18" width="10" height="2" fill="#111214"/>
|
|
11
|
+
</svg>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>inkless console</title>
|
|
7
|
+
<link rel="icon" href="./favicon.svg" type="image/svg+xml">
|
|
8
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
10
|
+
<link href="https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">
|
|
11
|
+
<style>html,body,#root{background:#08090a;height:100%;margin:0}</style>
|
|
12
|
+
<script type="module" crossorigin src="./assets/index-CIqLZU6s.js"></script>
|
|
13
|
+
<link rel="stylesheet" crossorigin href="./assets/index-Dv7Gg9qm.css">
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div id="root"></div>
|
|
17
|
+
</body>
|
|
18
|
+
</html>
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""inkless Bluetooth helper for Linux.
|
|
3
|
+
|
|
4
|
+
Opens an RFCOMM channel with Python's standard socket module (BlueZ) and pipes
|
|
5
|
+
bytes between it and the inkless CLI over stdio, using the same frames as the
|
|
6
|
+
macOS helper: [type][uint32 big-endian length][payload].
|
|
7
|
+
from CLI: W bytes to write, Q quit
|
|
8
|
+
to CLI: O opened {mtu,name,address}, A write done, D printer bytes, E error
|
|
9
|
+
"""
|
|
10
|
+
import argparse
|
|
11
|
+
import json
|
|
12
|
+
import os
|
|
13
|
+
import select
|
|
14
|
+
import socket
|
|
15
|
+
import struct
|
|
16
|
+
import sys
|
|
17
|
+
|
|
18
|
+
MTU = 512
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def send(kind, payload=b""):
|
|
22
|
+
if isinstance(payload, str):
|
|
23
|
+
payload = payload.encode()
|
|
24
|
+
os.write(1, kind.encode() + struct.pack(">I", len(payload)) + payload)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def fail(message):
|
|
28
|
+
send("E", message)
|
|
29
|
+
sys.exit(1)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def main():
|
|
33
|
+
parser = argparse.ArgumentParser()
|
|
34
|
+
parser.add_argument("--address", required=True)
|
|
35
|
+
parser.add_argument("--channel", type=int, default=1)
|
|
36
|
+
args = parser.parse_args()
|
|
37
|
+
if not hasattr(socket, "AF_BLUETOOTH"):
|
|
38
|
+
fail("this Python has no Bluetooth socket support (BlueZ headers missing)")
|
|
39
|
+
try:
|
|
40
|
+
sock = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_STREAM, socket.BTPROTO_RFCOMM)
|
|
41
|
+
sock.settimeout(15)
|
|
42
|
+
sock.connect((args.address, args.channel))
|
|
43
|
+
sock.settimeout(None)
|
|
44
|
+
except OSError as error:
|
|
45
|
+
fail(f"could not open RFCOMM channel {args.channel} on {args.address}: {error}")
|
|
46
|
+
send("O", json.dumps({"mtu": MTU, "name": "", "address": args.address}))
|
|
47
|
+
|
|
48
|
+
pending = b""
|
|
49
|
+
stdin = sys.stdin.fileno()
|
|
50
|
+
while True:
|
|
51
|
+
ready, _, _ = select.select([sock, stdin], [], [])
|
|
52
|
+
if sock in ready:
|
|
53
|
+
try:
|
|
54
|
+
data = sock.recv(4096)
|
|
55
|
+
except OSError as error:
|
|
56
|
+
fail(f"the printer connection failed: {error}")
|
|
57
|
+
if not data:
|
|
58
|
+
fail("the printer closed the connection")
|
|
59
|
+
send("D", data)
|
|
60
|
+
if stdin in ready:
|
|
61
|
+
chunk = os.read(stdin, 65536)
|
|
62
|
+
if not chunk:
|
|
63
|
+
break
|
|
64
|
+
pending += chunk
|
|
65
|
+
while len(pending) >= 5:
|
|
66
|
+
kind = pending[:1].decode()
|
|
67
|
+
(length,) = struct.unpack(">I", pending[1:5])
|
|
68
|
+
if len(pending) < 5 + length:
|
|
69
|
+
break
|
|
70
|
+
payload, pending = pending[5:5 + length], pending[5 + length:]
|
|
71
|
+
if kind == "Q":
|
|
72
|
+
sock.close()
|
|
73
|
+
return
|
|
74
|
+
if kind == "W":
|
|
75
|
+
try:
|
|
76
|
+
sock.sendall(payload)
|
|
77
|
+
except OSError as error:
|
|
78
|
+
fail(f"write failed: {error}")
|
|
79
|
+
send("A")
|
|
80
|
+
sock.close()
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
if __name__ == "__main__":
|
|
84
|
+
main()
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>CFBundleExecutable</key>
|
|
6
|
+
<string>InklessBluetooth</string>
|
|
7
|
+
<key>CFBundleIdentifier</key>
|
|
8
|
+
<string>dev.inkless.bluetooth</string>
|
|
9
|
+
<key>CFBundleName</key>
|
|
10
|
+
<string>InklessBluetooth</string>
|
|
11
|
+
<key>CFBundlePackageType</key>
|
|
12
|
+
<string>APPL</string>
|
|
13
|
+
<key>CFBundleVersion</key>
|
|
14
|
+
<string>1</string>
|
|
15
|
+
<key>LSBackgroundOnly</key>
|
|
16
|
+
<true/>
|
|
17
|
+
<key>LSMinimumSystemVersion</key>
|
|
18
|
+
<string>13.0</string>
|
|
19
|
+
<key>LSUIElement</key>
|
|
20
|
+
<true/>
|
|
21
|
+
<key>NSBluetoothAlwaysUsageDescription</key>
|
|
22
|
+
<string>inkless sends labels to a paired thermal printer over Bluetooth.</string>
|
|
23
|
+
<key>NSBluetoothPeripheralUsageDescription</key>
|
|
24
|
+
<string>inkless sends labels to a paired thermal printer over Bluetooth.</string>
|
|
25
|
+
</dict>
|
|
26
|
+
</plist>
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
3
|
+
<plist version="1.0">
|
|
4
|
+
<dict>
|
|
5
|
+
<key>files</key>
|
|
6
|
+
<dict/>
|
|
7
|
+
<key>files2</key>
|
|
8
|
+
<dict/>
|
|
9
|
+
<key>rules</key>
|
|
10
|
+
<dict>
|
|
11
|
+
<key>^Resources/</key>
|
|
12
|
+
<true/>
|
|
13
|
+
<key>^Resources/.*\.lproj/</key>
|
|
14
|
+
<dict>
|
|
15
|
+
<key>optional</key>
|
|
16
|
+
<true/>
|
|
17
|
+
<key>weight</key>
|
|
18
|
+
<real>1000</real>
|
|
19
|
+
</dict>
|
|
20
|
+
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
21
|
+
<dict>
|
|
22
|
+
<key>omit</key>
|
|
23
|
+
<true/>
|
|
24
|
+
<key>weight</key>
|
|
25
|
+
<real>1100</real>
|
|
26
|
+
</dict>
|
|
27
|
+
<key>^Resources/Base\.lproj/</key>
|
|
28
|
+
<dict>
|
|
29
|
+
<key>weight</key>
|
|
30
|
+
<real>1010</real>
|
|
31
|
+
</dict>
|
|
32
|
+
<key>^version.plist$</key>
|
|
33
|
+
<true/>
|
|
34
|
+
</dict>
|
|
35
|
+
<key>rules2</key>
|
|
36
|
+
<dict>
|
|
37
|
+
<key>.*\.dSYM($|/)</key>
|
|
38
|
+
<dict>
|
|
39
|
+
<key>weight</key>
|
|
40
|
+
<real>11</real>
|
|
41
|
+
</dict>
|
|
42
|
+
<key>^(.*/)?\.DS_Store$</key>
|
|
43
|
+
<dict>
|
|
44
|
+
<key>omit</key>
|
|
45
|
+
<true/>
|
|
46
|
+
<key>weight</key>
|
|
47
|
+
<real>2000</real>
|
|
48
|
+
</dict>
|
|
49
|
+
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
|
50
|
+
<dict>
|
|
51
|
+
<key>nested</key>
|
|
52
|
+
<true/>
|
|
53
|
+
<key>weight</key>
|
|
54
|
+
<real>10</real>
|
|
55
|
+
</dict>
|
|
56
|
+
<key>^.*</key>
|
|
57
|
+
<true/>
|
|
58
|
+
<key>^Info\.plist$</key>
|
|
59
|
+
<dict>
|
|
60
|
+
<key>omit</key>
|
|
61
|
+
<true/>
|
|
62
|
+
<key>weight</key>
|
|
63
|
+
<real>20</real>
|
|
64
|
+
</dict>
|
|
65
|
+
<key>^PkgInfo$</key>
|
|
66
|
+
<dict>
|
|
67
|
+
<key>omit</key>
|
|
68
|
+
<true/>
|
|
69
|
+
<key>weight</key>
|
|
70
|
+
<real>20</real>
|
|
71
|
+
</dict>
|
|
72
|
+
<key>^Resources/</key>
|
|
73
|
+
<dict>
|
|
74
|
+
<key>weight</key>
|
|
75
|
+
<real>20</real>
|
|
76
|
+
</dict>
|
|
77
|
+
<key>^Resources/.*\.lproj/</key>
|
|
78
|
+
<dict>
|
|
79
|
+
<key>optional</key>
|
|
80
|
+
<true/>
|
|
81
|
+
<key>weight</key>
|
|
82
|
+
<real>1000</real>
|
|
83
|
+
</dict>
|
|
84
|
+
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
|
85
|
+
<dict>
|
|
86
|
+
<key>omit</key>
|
|
87
|
+
<true/>
|
|
88
|
+
<key>weight</key>
|
|
89
|
+
<real>1100</real>
|
|
90
|
+
</dict>
|
|
91
|
+
<key>^Resources/Base\.lproj/</key>
|
|
92
|
+
<dict>
|
|
93
|
+
<key>weight</key>
|
|
94
|
+
<real>1010</real>
|
|
95
|
+
</dict>
|
|
96
|
+
<key>^[^/]+$</key>
|
|
97
|
+
<dict>
|
|
98
|
+
<key>nested</key>
|
|
99
|
+
<true/>
|
|
100
|
+
<key>weight</key>
|
|
101
|
+
<real>10</real>
|
|
102
|
+
</dict>
|
|
103
|
+
<key>^embedded\.provisionprofile$</key>
|
|
104
|
+
<dict>
|
|
105
|
+
<key>weight</key>
|
|
106
|
+
<real>20</real>
|
|
107
|
+
</dict>
|
|
108
|
+
<key>^version\.plist$</key>
|
|
109
|
+
<dict>
|
|
110
|
+
<key>weight</key>
|
|
111
|
+
<real>20</real>
|
|
112
|
+
</dict>
|
|
113
|
+
</dict>
|
|
114
|
+
</dict>
|
|
115
|
+
</plist>
|
package/package.json
CHANGED
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "inkless",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Print stickers and labels on cheap Bluetooth thermal printers (PM290, HP6-C) from your terminal or coding agent. Label designer console, ready-made formats and 3D pen blueprints.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"thermal printer",
|
|
7
|
+
"label printer",
|
|
8
|
+
"sticker printer",
|
|
9
|
+
"label maker",
|
|
10
|
+
"bluetooth",
|
|
11
|
+
"pm290",
|
|
12
|
+
"hp6-c",
|
|
13
|
+
"tspl",
|
|
14
|
+
"label designer",
|
|
15
|
+
"3d pen",
|
|
16
|
+
"cli",
|
|
17
|
+
"ai agents"
|
|
18
|
+
],
|
|
19
|
+
"homepage": "https://inkless.sh",
|
|
20
|
+
"bugs": {
|
|
21
|
+
"url": "https://github.com/apresmoi/inkless/issues"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/apresmoi/inkless.git",
|
|
26
|
+
"directory": "packages/inkless"
|
|
27
|
+
},
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"author": "Juan Cruz Fortunatti",
|
|
30
|
+
"type": "module",
|
|
31
|
+
"bin": {
|
|
32
|
+
"inkless": "bin/inkless.js"
|
|
33
|
+
},
|
|
34
|
+
"exports": {
|
|
35
|
+
".": "./src/core/index.js",
|
|
36
|
+
"./blueprint": "./src/core/blueprint/index.js",
|
|
37
|
+
"./node": "./src/node/index.js"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"bin",
|
|
41
|
+
"src",
|
|
42
|
+
"console-dist",
|
|
43
|
+
"skills",
|
|
44
|
+
"native/linux",
|
|
45
|
+
"native/macos/build/InklessBluetooth.app",
|
|
46
|
+
"LICENSE"
|
|
47
|
+
],
|
|
48
|
+
"scripts": {
|
|
49
|
+
"test": "node --test test/*.test.js",
|
|
50
|
+
"build:macos": "sh native/macos/build.sh",
|
|
51
|
+
"prepack": "npm run build -w @inkless/console --prefix ../.. && sh native/macos/build.sh && rm -rf skills console-dist && cp -R ../../skills skills && cp -R ../console/dist console-dist && cp ../../LICENSE LICENSE",
|
|
52
|
+
"postpack": "rm -rf skills console-dist LICENSE"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@glyphcss/core": "0.3.4",
|
|
56
|
+
"@napi-rs/canvas": "1.1.1",
|
|
57
|
+
"qrcode-generator": "2.0.4"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=22"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: inkless
|
|
3
|
+
description: Design, preview and print stickers and labels on Bluetooth thermal printers (PM290 / Labelnize / TYPONOS, HP6-C) with the inkless CLI. Use when the user wants a physical sticker or label, wants to design one together in a browser console, or wants a 3D model cut into flat pieces for a 3D pen.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# inkless: stickers and labels
|
|
7
|
+
|
|
8
|
+
inkless prints black-and-white stickers on cheap Bluetooth thermal printers. You
|
|
9
|
+
write a **design** (a small JSON file, or just an image or some text), look at a
|
|
10
|
+
**preview**, optionally review it live with the user in a **console** in their
|
|
11
|
+
browser, and only then **print**.
|
|
12
|
+
|
|
13
|
+
Run it as `npx inkless ...` (or `inkless ...` if installed). Needs Node 22+.
|
|
14
|
+
|
|
15
|
+
## The one rule
|
|
16
|
+
|
|
17
|
+
Printing uses real paper. **Never print unless the user asked for it**, and never
|
|
18
|
+
retry a failed print on your own. Always preview first and show the user.
|
|
19
|
+
|
|
20
|
+
## Printers
|
|
21
|
+
|
|
22
|
+
| Printer | Flag | Paper | Label |
|
|
23
|
+
| --- | --- | --- | --- |
|
|
24
|
+
| PM290 (Labelnize, TYPONOS) | default | 48 mm wide roll | 48 mm wide, 5 to 500 mm long (30 is a good default) |
|
|
25
|
+
| HP6-C | `--printer hp6` or `"printer": "hp6"` | 12 mm tape | fixed 36 x 12 mm |
|
|
26
|
+
|
|
27
|
+
Everything is 8 dots per millimetre, black or white only. Thin gray lines vanish;
|
|
28
|
+
bold, high-contrast art prints best. Text under about 6 pt gets hard to read.
|
|
29
|
+
`npx inkless printers` lists what is paired. For the HP6-C add `--address <MAC>`.
|
|
30
|
+
|
|
31
|
+
## Quick paths
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
npx inkless preview art.png --out /tmp/inkless/preview.png # look at it first
|
|
35
|
+
npx inkless print art.png # then print (only when asked)
|
|
36
|
+
npx inkless print "line one\nline two" # plain text
|
|
37
|
+
npx inkless preview label.json # a design file
|
|
38
|
+
npx inkless check # is the printer there? prints nothing
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
The preview PNG is exactly what the printer burns, one pixel per dot. A design
|
|
42
|
+
with several pages makes `preview-1.png`, `preview-2.png`, ... and prints one
|
|
43
|
+
label per page. Plain images take `--style floyd|atkinson|ordered|threshold`
|
|
44
|
+
(photos default to floyd), `--level 0-255`, `--invert`, `--size 48x30`, and
|
|
45
|
+
`--dark` / `--light` to burn harder or softer.
|
|
46
|
+
|
|
47
|
+
## The console loop (best for anything the user wants to tweak)
|
|
48
|
+
|
|
49
|
+
The console is a web page where the user edits the label by hand while you chat
|
|
50
|
+
with them. You push a design, they edit it, you read their edits, they approve.
|
|
51
|
+
|
|
52
|
+
1. Push the design (starts a console and opens the browser the first time):
|
|
53
|
+
`npx inkless console show label.json`
|
|
54
|
+
2. Tell the user what you made: `npx inkless console say "Made a 48x30 parts bin label. Change anything you like, then press Approve."`
|
|
55
|
+
3. Wait for them: `npx inkless console wait --timeout 600`
|
|
56
|
+
It prints one JSON line: `{ "event", "rev", "status", "design", "messages" }`
|
|
57
|
+
and exits 0 when the user approves, 2 on timeout (just wait again or ask).
|
|
58
|
+
Use `--until any` to wake on every change, such as a chat message.
|
|
59
|
+
4. Read the result. `design` holds the user's edits; `messages` holds their chat.
|
|
60
|
+
If they asked for changes, edit the design, `console show` it again, `say` what
|
|
61
|
+
changed, and `wait` again. Each `show` resets the status to editing.
|
|
62
|
+
5. Print only when the user pressed "Approve and print" in the console, or told you
|
|
63
|
+
in chat to print. The console prints it itself and posts "Printed 2 labels" or the
|
|
64
|
+
error into the chat. Run `console wait --until any` to see that message.
|
|
65
|
+
|
|
66
|
+
Other commands: `console get [--out file.json]` (the current design),
|
|
67
|
+
`console stop`. Plain images or text also work: `console show photo.png`.
|
|
68
|
+
The server lives on `127.0.0.1` only; its state is kept in `~/.inkless/`.
|
|
69
|
+
|
|
70
|
+
## Label formats (start here for common labels)
|
|
71
|
+
|
|
72
|
+
inkless ships ready-made layouts with a few fields each: `parts-bin`, `cable-flag`
|
|
73
|
+
and `drawer-tape` (HP6-C tape), `file-folder`, `name-badge`, `asset-tag`, `wifi-qr`,
|
|
74
|
+
`manual-qr`, `freezer-date`, `price-tag`, `plant-marker`, `book-spine`,
|
|
75
|
+
`storage-box`, `shipping-address`, `thank-you-seal`, plus any the user saved.
|
|
76
|
+
Reuse one instead of drawing a label from scratch whenever it fits the job.
|
|
77
|
+
|
|
78
|
+
1. Pick: `npx inkless formats` lists id, size, shape, printers and fields
|
|
79
|
+
(`--printer hp6` for the tape ones). `npx inkless formats show <id>` gives
|
|
80
|
+
each field with its example; `--json` prints the whole format.
|
|
81
|
+
2. Fill: anywhere a design goes, use `--format <id> --set key=value` (repeat
|
|
82
|
+
`--set`; `\n` is a new line; left-out fields keep their example, so set
|
|
83
|
+
every field that matters; an unknown key is an error):
|
|
84
|
+
`npx inkless preview --format parts-bin --set name="M4 NUTS" --set detail="8 mm · nyloc" --set bin=12 --set shelf=C --set link=https://example.com/m4`
|
|
85
|
+
`--printer hp6` moves a format to another printer it lists.
|
|
86
|
+
3. Hand off: `npx inkless console show --format <id> --set ...` opens it in the
|
|
87
|
+
console with the fields already filled. The user fills or changes fields at the
|
|
88
|
+
top left, moves things, and may press **Save as format** (saved to
|
|
89
|
+
`~/.inkless/formats/`, then usable as `--format <their-id>`) or **Send to
|
|
90
|
+
agent**. Both wake `npx inkless console wait --until any`; read `design`
|
|
91
|
+
from its JSON (it keeps `"format": { id, values }`) and any message.
|
|
92
|
+
4. Without a running console (the user on the website): `npx inkless console
|
|
93
|
+
link --format <id> --set ...` (or `console link label.json`) prints a link
|
|
94
|
+
to the website's designer with the label inside. The website has **Copy for
|
|
95
|
+
agent**, which gives you the design JSON to save as a file.
|
|
96
|
+
5. Save a design you made as a format: `npx inkless formats save label.json
|
|
97
|
+
--name "Lab kit"`. Any `{{key}}` you put in a text, QR or barcode value
|
|
98
|
+
becomes a field.
|
|
99
|
+
|
|
100
|
+
## Design JSON
|
|
101
|
+
|
|
102
|
+
Units are millimetres, origin top-left. `"version": 1` is required.
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"version": 1,
|
|
107
|
+
"title": "Parts bin",
|
|
108
|
+
"printer": "pm290",
|
|
109
|
+
"size": { "widthMm": 48, "heightMm": 30 },
|
|
110
|
+
"pages": [ { "id": "page-1", "elements": [ ... ] } ]
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
HP6-C is always `{ "widthMm": 36, "heightMm": 12 }`. A page may set its own
|
|
115
|
+
`heightMm` (PM290 only). Every element has `type`, `x`, `y`, `w`, `h`, and
|
|
116
|
+
optionally `id`, `rotation` (degrees clockwise) and `invert` (white on black).
|
|
117
|
+
|
|
118
|
+
| type | extra fields |
|
|
119
|
+
| --- | --- |
|
|
120
|
+
| `text` | `text` (`\n` for new lines; it never wraps by itself), `font` sans, serif, mono or display, `sizePt` (omit to fit the box), `weight` 400 or 700, `align` left, center or right, `lineHeight` |
|
|
121
|
+
| `image` | `src` (a file path next to the design, an http(s) URL or a data URL), `fit` contain, cover or stretch, `filter` |
|
|
122
|
+
| `shape` | `shape` rect, ellipse or line, `strokeMm`, `fill`, `radiusMm` |
|
|
123
|
+
| `qr` | `value` (keep it short; 10 mm square is the smallest that scans) |
|
|
124
|
+
| `barcode` | `value` (Code 128) |
|
|
125
|
+
| `path` | `d` (SVG path data in mm relative to x, y), `strokeMm`, `fill`, `viewW`/`viewH` (stretch d to the box) |
|
|
126
|
+
|
|
127
|
+
A design filled from a format also has `"format"` (id, name, fields, values) and
|
|
128
|
+
its filled elements a `"template"` with the original `{{key}}` text. Leave them in
|
|
129
|
+
when you edit the design so the console's fields keep working.
|
|
130
|
+
|
|
131
|
+
### Image filters
|
|
132
|
+
|
|
133
|
+
An image becomes black and white through `filter: { mode, ... }`:
|
|
134
|
+
|
|
135
|
+
- `dither` (photos): `style` floyd, atkinson (crisper, lighter) or ordered (patterned)
|
|
136
|
+
- `threshold`: one cut-off, for line art and scans
|
|
137
|
+
- `edges`: edge detection lines; `outline`: traced shapes drawn as strokes
|
|
138
|
+
- `halftone`: round dots of varying size; `cellMm` sets the dot pitch (default 1)
|
|
139
|
+
- Any mode: `level` 0 to 255, `brightness`, `contrast` (-255 to 255), `gamma`,
|
|
140
|
+
`invert`, and `lineMm` (stroke width for edges and outline, default 0.25).
|
|
141
|
+
|
|
142
|
+
### Example: parts bin label
|
|
143
|
+
|
|
144
|
+
```json
|
|
145
|
+
{
|
|
146
|
+
"version": 1, "title": "Parts bin", "printer": "pm290",
|
|
147
|
+
"size": { "widthMm": 48, "heightMm": 30 },
|
|
148
|
+
"pages": [{ "id": "p1", "elements": [
|
|
149
|
+
{ "type": "text", "x": 3, "y": 3, "w": 42, "h": 10, "text": "M3 SCREWS\n12 MM", "font": "sans", "weight": 700 },
|
|
150
|
+
{ "type": "text", "x": 3, "y": 14, "w": 42, "h": 3, "text": "socket head, stainless", "font": "mono", "sizePt": 7 },
|
|
151
|
+
{ "type": "shape", "shape": "line", "x": 3, "y": 18, "w": 42, "h": 0, "strokeMm": 0.3 },
|
|
152
|
+
{ "type": "text", "x": 3, "y": 20, "w": 28, "h": 7, "text": "BIN 07 SHELF B", "font": "mono", "weight": 700 }
|
|
153
|
+
]}]
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Example: address label with a QR code
|
|
158
|
+
|
|
159
|
+
```json
|
|
160
|
+
{
|
|
161
|
+
"version": 1, "title": "Return address", "printer": "pm290",
|
|
162
|
+
"size": { "widthMm": 48, "heightMm": 25 },
|
|
163
|
+
"pages": [{ "id": "p1", "elements": [
|
|
164
|
+
{ "type": "text", "x": 3, "y": 3, "w": 30, "h": 19, "text": "Lucia Rabbit\n12 Example Street\n10115 City\nCountry", "font": "sans", "sizePt": 9, "align": "left" },
|
|
165
|
+
{ "type": "qr", "x": 35, "y": 6, "w": 10, "h": 10, "value": "https://example.com/ana" }
|
|
166
|
+
]}]
|
|
167
|
+
}
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Example: photo sticker
|
|
171
|
+
|
|
172
|
+
```json
|
|
173
|
+
{
|
|
174
|
+
"version": 1, "title": "Cat", "printer": "pm290",
|
|
175
|
+
"size": { "widthMm": 48, "heightMm": 36 },
|
|
176
|
+
"pages": [{ "id": "p1", "elements": [
|
|
177
|
+
{ "type": "image", "src": "cat.jpg", "x": 0, "y": 0, "w": 48, "h": 36, "fit": "cover",
|
|
178
|
+
"filter": { "mode": "dither", "style": "atkinson", "contrast": 30 } }
|
|
179
|
+
]}]
|
|
180
|
+
}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
Check any design with `npx inkless preview file.json` and look at the PNG before
|
|
184
|
+
showing it to the user. For several labels, add more entries to `pages`.
|
|
185
|
+
|
|
186
|
+
## Blueprints (3D model to flat pieces for a 3D pen)
|
|
187
|
+
|
|
188
|
+
```
|
|
189
|
+
npx inkless blueprint model.glb --method radial --size 150 --label 48x48 --out duck.json --preview /tmp/inkless/bp
|
|
190
|
+
npx inkless blueprint --demo duck --method unfold --console
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
It cuts the model into numbered flat pieces and prints the assembly steps:
|
|
194
|
+
`slotted` (front-back and side-to-side sections that slot together),
|
|
195
|
+
`stacked` (level layers), `radial` (fins around the centre slotted into level
|
|
196
|
+
rings) or `unfold` (a simpler model unfolded into papercraft nets; edges with
|
|
197
|
+
the same number are welded together). `--size` is the real largest side in mm,
|
|
198
|
+
`--height` the real height instead. `--label` picks the labels: `roll` (one
|
|
199
|
+
label per piece, as long as needed), `48x48`, `48x30`, or `hp6` (36x12). Pieces
|
|
200
|
+
bigger than a label are split over several with alignment marks, so a bigger
|
|
201
|
+
model on small labels needs more labels; check the count in the output. Fill is
|
|
202
|
+
`outline`, `solid` or `ribs`. Output is an ordinary design, so preview,
|
|
203
|
+
`console show` and print work on it. Demos: duck, rocket, chair, dino, vase.
|
|
204
|
+
Models are `.stl`, `.obj`, `.glb`, `.gltf` (data inside the file) or `.vox`.
|
|
205
|
+
|
|
206
|
+
## When it fails
|
|
207
|
+
|
|
208
|
+
- "no paired Bluetooth device matches": pair the printer in system settings, or pass `--address`.
|
|
209
|
+
- A timeout on the hello: the printer is off, asleep, or held by its phone app. Ask the user to close the app.
|
|
210
|
+
- "almost empty": the design has no ink; check colors, sizes and positions in the preview.
|
|
211
|
+
- "no console is running": start one with `console show`.
|
|
212
|
+
- A failed print may still have used paper. Tell the user and let them decide.
|
|
213
|
+
- macOS: the Bluetooth helper may ask for permission the first time. The user must allow it.
|