@pinkpixel/haku 0.0.0-stage → 0.2.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/README.md +151 -2
- package/dist/LICENSE +202 -0
- package/dist/cli.mjs +168 -0
- package/dist/fonts/Figtree-Regular.ttf +0 -0
- package/dist/fonts/Figtree-SemiBold.ttf +0 -0
- package/dist/fonts/OFL.txt +93 -0
- package/dist/mcp-DG9U-P0N.mjs +72 -0
- package/dist/node-CVxAljK8.mjs +24 -0
- package/dist/samples/ambience/rain_roof.ogg +0 -0
- package/dist/samples/ambience/rain_window.ogg +0 -0
- package/dist/samples/drums/brush_v0_r1.ogg +0 -0
- package/dist/samples/drums/brush_v0_r2.ogg +0 -0
- package/dist/samples/drums/brush_v1_r1.ogg +0 -0
- package/dist/samples/drums/brush_v1_r2.ogg +0 -0
- package/dist/samples/drums/brushhat_v0_r1.ogg +0 -0
- package/dist/samples/drums/brushhat_v0_r2.ogg +0 -0
- package/dist/samples/drums/brushhat_v1_r1.ogg +0 -0
- package/dist/samples/drums/brushhat_v1_r2.ogg +0 -0
- package/dist/samples/drums/hat_v0_r1.ogg +0 -0
- package/dist/samples/drums/hat_v0_r2.ogg +0 -0
- package/dist/samples/drums/hat_v1_r1.ogg +0 -0
- package/dist/samples/drums/hat_v1_r2.ogg +0 -0
- package/dist/samples/drums/kick_v0_r1.ogg +0 -0
- package/dist/samples/drums/kick_v0_r2.ogg +0 -0
- package/dist/samples/drums/kick_v1_r1.ogg +0 -0
- package/dist/samples/drums/kick_v1_r2.ogg +0 -0
- package/dist/samples/drums/openhat_v0_r1.ogg +0 -0
- package/dist/samples/drums/openhat_v0_r2.ogg +0 -0
- package/dist/samples/drums/openhat_v1_r1.ogg +0 -0
- package/dist/samples/drums/openhat_v1_r2.ogg +0 -0
- package/dist/samples/drums/ride_v0_r1.ogg +0 -0
- package/dist/samples/drums/ride_v0_r2.ogg +0 -0
- package/dist/samples/drums/ride_v1_r1.ogg +0 -0
- package/dist/samples/drums/ride_v1_r2.ogg +0 -0
- package/dist/samples/drums/rim_v0_r1.ogg +0 -0
- package/dist/samples/drums/rim_v0_r2.ogg +0 -0
- package/dist/samples/drums/rim_v1_r1.ogg +0 -0
- package/dist/samples/drums/rim_v1_r2.ogg +0 -0
- package/dist/samples/drums/snare_v0_r1.ogg +0 -0
- package/dist/samples/drums/snare_v0_r2.ogg +0 -0
- package/dist/samples/drums/snare_v1_r1.ogg +0 -0
- package/dist/samples/drums/snare_v1_r2.ogg +0 -0
- package/dist/samples/drums/tom_v0_r1.ogg +0 -0
- package/dist/samples/drums/tom_v0_r2.ogg +0 -0
- package/dist/samples/drums/tom_v1_r1.ogg +0 -0
- package/dist/samples/drums/tom_v1_r2.ogg +0 -0
- package/dist/samples/glock/v0_103.ogg +0 -0
- package/dist/samples/glock/v0_108.ogg +0 -0
- package/dist/samples/glock/v0_79.ogg +0 -0
- package/dist/samples/glock/v0_84.ogg +0 -0
- package/dist/samples/glock/v0_91.ogg +0 -0
- package/dist/samples/glock/v0_96.ogg +0 -0
- package/dist/samples/harp/v0_101.ogg +0 -0
- package/dist/samples/harp/v0_28.ogg +0 -0
- package/dist/samples/harp/v0_31.ogg +0 -0
- package/dist/samples/harp/v0_35.ogg +0 -0
- package/dist/samples/harp/v0_38.ogg +0 -0
- package/dist/samples/harp/v0_41.ogg +0 -0
- package/dist/samples/harp/v0_45.ogg +0 -0
- package/dist/samples/harp/v0_48.ogg +0 -0
- package/dist/samples/harp/v0_52.ogg +0 -0
- package/dist/samples/harp/v0_55.ogg +0 -0
- package/dist/samples/harp/v0_59.ogg +0 -0
- package/dist/samples/harp/v0_62.ogg +0 -0
- package/dist/samples/harp/v0_65.ogg +0 -0
- package/dist/samples/harp/v0_69.ogg +0 -0
- package/dist/samples/harp/v0_72.ogg +0 -0
- package/dist/samples/harp/v0_76.ogg +0 -0
- package/dist/samples/harp/v0_79.ogg +0 -0
- package/dist/samples/harp/v0_83.ogg +0 -0
- package/dist/samples/harp/v0_86.ogg +0 -0
- package/dist/samples/harp/v0_89.ogg +0 -0
- package/dist/samples/harp/v0_93.ogg +0 -0
- package/dist/samples/harp/v0_95.ogg +0 -0
- package/dist/samples/harp/v0_98.ogg +0 -0
- package/dist/samples/manifest.json +368 -0
- package/dist/samples/marimba/v0_41.ogg +0 -0
- package/dist/samples/marimba/v0_48.ogg +0 -0
- package/dist/samples/marimba/v0_55.ogg +0 -0
- package/dist/samples/marimba/v0_59.ogg +0 -0
- package/dist/samples/marimba/v0_65.ogg +0 -0
- package/dist/samples/marimba/v0_72.ogg +0 -0
- package/dist/samples/marimba/v0_79.ogg +0 -0
- package/dist/samples/marimba/v0_83.ogg +0 -0
- package/dist/samples/marimba/v0_89.ogg +0 -0
- package/dist/samples/marimba/v0_96.ogg +0 -0
- package/dist/samples/piano/v0_29.ogg +0 -0
- package/dist/samples/piano/v0_33.ogg +0 -0
- package/dist/samples/piano/v0_37.ogg +0 -0
- package/dist/samples/piano/v0_41.ogg +0 -0
- package/dist/samples/piano/v0_45.ogg +0 -0
- package/dist/samples/piano/v0_49.ogg +0 -0
- package/dist/samples/piano/v0_53.ogg +0 -0
- package/dist/samples/piano/v0_57.ogg +0 -0
- package/dist/samples/piano/v0_61.ogg +0 -0
- package/dist/samples/piano/v0_65.ogg +0 -0
- package/dist/samples/piano/v0_69.ogg +0 -0
- package/dist/samples/piano/v0_73.ogg +0 -0
- package/dist/samples/piano/v0_77.ogg +0 -0
- package/dist/samples/piano/v0_81.ogg +0 -0
- package/dist/samples/piano/v0_85.ogg +0 -0
- package/dist/samples/piano/v0_89.ogg +0 -0
- package/dist/samples/piano/v0_93.ogg +0 -0
- package/dist/samples/piano/v0_97.ogg +0 -0
- package/dist/samples/piano/v1_29.ogg +0 -0
- package/dist/samples/piano/v1_33.ogg +0 -0
- package/dist/samples/piano/v1_37.ogg +0 -0
- package/dist/samples/piano/v1_41.ogg +0 -0
- package/dist/samples/piano/v1_45.ogg +0 -0
- package/dist/samples/piano/v1_49.ogg +0 -0
- package/dist/samples/piano/v1_53.ogg +0 -0
- package/dist/samples/piano/v1_57.ogg +0 -0
- package/dist/samples/piano/v1_61.ogg +0 -0
- package/dist/samples/piano/v1_65.ogg +0 -0
- package/dist/samples/piano/v1_69.ogg +0 -0
- package/dist/samples/piano/v1_73.ogg +0 -0
- package/dist/samples/piano/v1_77.ogg +0 -0
- package/dist/samples/piano/v1_81.ogg +0 -0
- package/dist/samples/piano/v1_85.ogg +0 -0
- package/dist/samples/piano/v1_89.ogg +0 -0
- package/dist/samples/piano/v1_93.ogg +0 -0
- package/dist/samples/piano/v1_97.ogg +0 -0
- package/dist/samples/wurli/v0_33.ogg +0 -0
- package/dist/samples/wurli/v0_40.ogg +0 -0
- package/dist/samples/wurli/v0_45.ogg +0 -0
- package/dist/samples/wurli/v0_51.ogg +0 -0
- package/dist/samples/wurli/v0_56.ogg +0 -0
- package/dist/samples/wurli/v0_61.ogg +0 -0
- package/dist/samples/wurli/v0_66.ogg +0 -0
- package/dist/samples/wurli/v0_71.ogg +0 -0
- package/dist/samples/wurli/v0_73.ogg +0 -0
- package/dist/samples/wurli/v0_79.ogg +0 -0
- package/dist/samples/wurli/v0_85.ogg +0 -0
- package/dist/samples/wurli/v0_92.ogg +0 -0
- package/dist/samples/wurli/v1_33.ogg +0 -0
- package/dist/samples/wurli/v1_36.ogg +0 -0
- package/dist/samples/wurli/v1_41.ogg +0 -0
- package/dist/samples/wurli/v1_47.ogg +0 -0
- package/dist/samples/wurli/v1_52.ogg +0 -0
- package/dist/samples/wurli/v1_56.ogg +0 -0
- package/dist/samples/wurli/v1_61.ogg +0 -0
- package/dist/samples/wurli/v1_68.ogg +0 -0
- package/dist/samples/wurli/v1_73.ogg +0 -0
- package/dist/samples/wurli/v1_79.ogg +0 -0
- package/dist/samples/wurli/v1_85.ogg +0 -0
- package/dist/samples/wurli/v1_92.ogg +0 -0
- package/dist/src-CgZeiBJc.mjs +711 -0
- package/dist/src-dP0jXhPP.mjs +2322 -0
- package/dist/tools-_xkF2Yfv.mjs +1891 -0
- package/dist/web/assets/figtree-latin-ext-wght-normal-DCwSJGxG.woff2 +0 -0
- package/dist/web/assets/figtree-latin-wght-normal-D_ZTVpCC.woff2 +0 -0
- package/dist/web/assets/fraunces-latin-ext-wght-normal-Ca2vKHc0.woff2 +0 -0
- package/dist/web/assets/fraunces-latin-wght-normal-ukD16Tqj.woff2 +0 -0
- package/dist/web/assets/fraunces-vietnamese-wght-normal-CnvboYUG.woff2 +0 -0
- package/dist/web/assets/index-BmW6jd5Q.js +272 -0
- package/dist/web/assets/index-C7U7z4um.css +1 -0
- package/dist/web/icon-192.png +0 -0
- package/dist/web/icon-512.png +0 -0
- package/dist/web/index.html +18 -0
- package/dist/web/manifest.webmanifest +24 -0
- package/dist/web/sw.js +37 -0
- package/package.json +59 -3
package/README.md
CHANGED
|
@@ -1,3 +1,152 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @pinkpixel/haku
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Draw lofi music from your terminal, or let an AI agent do it.
|
|
4
|
+
|
|
5
|
+
This is the CLI and MCP server for [Haku](https://github.com/pinkpixel-dev/haku), a little app that turns lines on a canvas into cozy lofi tracks. Left to right is time, up and down is pitch, and every note gets nudged onto the chords, so whatever you draw fits. A backing band (warm keys, round bass, brushed drums) plays along underneath, with swing, vinyl crackle, tape wobble, and rain.
|
|
6
|
+
|
|
7
|
+
The `haku` command gives you (or your agent) a tool for every drawing command, plus snapshots, analysis, playback, and WAV or MIDI export. Projects are plain `.haku.json` files, and everything renders offline in Node with the same audio code the web app uses.
|
|
8
|
+
|
|
9
|
+
## Requirements
|
|
10
|
+
|
|
11
|
+
- Node 22.18 or newer
|
|
12
|
+
- For listening without the browser: one of `pw-play`, `paplay`, `aplay`, `afplay`, or `ffplay` (Windows uses PowerShell, so nothing extra there)
|
|
13
|
+
|
|
14
|
+
The package is about 9 MB, mostly because the instrument samples come with it. The web app is in there too.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
Run it without installing:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx @pinkpixel/haku --help
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or install it globally to get the `haku` command:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install -g @pinkpixel/haku
|
|
28
|
+
haku guide
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Using it with an AI agent
|
|
32
|
+
|
|
33
|
+
The MCP server runs over stdio. In Claude Code:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
claude mcp add haku -- npx -y @pinkpixel/haku mcp
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
For clients that use a JSON config:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"mcpServers": {
|
|
44
|
+
"haku": {
|
|
45
|
+
"command": "npx",
|
|
46
|
+
"args": ["-y", "@pinkpixel/haku", "mcp"]
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
The agent gets a short guide to the canvas and moods when it connects, and every tool has its own schema. Relative file paths resolve from wherever your client starts the server, so absolute paths are the safer bet.
|
|
53
|
+
|
|
54
|
+
## A quick session
|
|
55
|
+
|
|
56
|
+
Commands use kebab-case (`draw-shape`), and the snake_case names the MCP tools use work too. Objects and lists go in as JSON.
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
haku new-project -f lofi.haku.json --mood rainy-study --name "First try"
|
|
60
|
+
haku draw-shape -f lofi.haku.json --shape wave --x 0 --y 0.5 --width 1 --height 0.4 --cycles 2
|
|
61
|
+
haku add-layer -f lofi.haku.json --instrument glock --name Sparkle
|
|
62
|
+
haku draw-line -f lofi.haku.json --layer Sparkle --brush spray --from '{"x":0.5,"y":0.3}' --to '{"x":1,"y":0.6}'
|
|
63
|
+
haku describe -f lofi.haku.json
|
|
64
|
+
haku snapshot -f lofi.haku.json --out lofi.png
|
|
65
|
+
haku play -f lofi.haku.json
|
|
66
|
+
haku export -f lofi.haku.json --format wav
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Set `HAKU_PROJECT=lofi.haku.json` and you can skip the `-f` every time.
|
|
70
|
+
|
|
71
|
+
`haku exec` runs a file of commands (a JSON array, or one JSON object per line) as one step. If any of them fails, nothing changes. Leave out the file and it reads stdin:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
haku exec -f lofi.haku.json moves.jsonl
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## The canvas
|
|
78
|
+
|
|
79
|
+
- x is time. 0 is the start of the scene and 1 is the end. A scene is 1 to 16 bars of 4 beats.
|
|
80
|
+
- y is pitch. 0 is the top of the layer's range (the high notes) and 1 is the bottom. Drum layers split it into 7 rows instead: kick, tom, snare, side stick, hi-hat, open hat, and ride, from the bottom up.
|
|
81
|
+
- Brushes set the rhythm: pencil plays eighth notes, brush plays long soft quarters, chalk adds two-note harmonies, spray scatters sixteenths, and stamp hits every sixteenth (good for drums).
|
|
82
|
+
- Faster strokes play louder. `draw-melody` skips the snapping when you want exact notes.
|
|
83
|
+
- Moods set the tempo, key, chords, band, and mix in one go: `rainy-study`, `late-night-train`, `sunny-cafe`, `dusk-walk`, and `snowy-window`.
|
|
84
|
+
|
|
85
|
+
`haku guide` prints all of this plus the chord progression presets.
|
|
86
|
+
|
|
87
|
+
## Tools
|
|
88
|
+
|
|
89
|
+
Every drawing and editing command is its own tool (`draw_line`, `set_mood`, `add_scene`, and so on). `haku --help` lists them all. These are the extras:
|
|
90
|
+
|
|
91
|
+
| Tool | What it does |
|
|
92
|
+
|---|---|
|
|
93
|
+
| `new_project` | Makes a new `.haku.json` from a mood |
|
|
94
|
+
| `batch` | Runs a list of commands as one step. All or nothing |
|
|
95
|
+
| `describe` | Reads the project back as text, with a little piano roll per layer |
|
|
96
|
+
| `snapshot` | A PNG of a scene: chords, notes, strokes, and a legend. `--out` saves it as `.png` or `.svg` |
|
|
97
|
+
| `analyze` | Notes per layer, how many strong-beat notes are chord tones, notes outside the key, half-step clashes between layers, and loudness in LUFS |
|
|
98
|
+
| `play` / `stop` | Renders the scene (or the whole song) and plays it through your speakers |
|
|
99
|
+
| `export` | WAV, MIDI, or the project file, for one scene or the whole song |
|
|
100
|
+
| `open_project` / `save_project` | Sends a file to the Haku browser tab, or saves the tab's project to a file |
|
|
101
|
+
| `status` | Whether the bridge is running and what the tab is doing |
|
|
102
|
+
|
|
103
|
+
## Working live in the browser
|
|
104
|
+
|
|
105
|
+
Haku also has a web app with the actual drawing canvas, and it ships in this package. Open it with:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
haku web
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
That serves the app on http://127.0.0.1:5177, hosts the agent bridge, and opens your default browser. Leave out `-f` and the tools work on that tab instead of a file, so you see and hear every change, and Ctrl+Z still undoes it. The MCP server also hosts the bridge on `127.0.0.1:5179`, and the tab connects to whichever one is running on its own.
|
|
112
|
+
|
|
113
|
+
You don't have to open it first. When a tool needs the tab and none is connected, Haku starts `haku web` in the background (it quits after 30 minutes with no tab connected), opens the browser, and waits for the tab. Set `HAKU_NO_LAUNCH=1` if you'd rather get an error instead.
|
|
114
|
+
|
|
115
|
+
In Chrome or Edge you can install Haku as an app from the install icon in the address bar. It gets its own window, and since the app and samples are cached after the first visit, it opens fine even when `haku web` isn't running. Agents only reach it while a bridge is up, though, so start `haku web` or your MCP client first if you want that.
|
|
116
|
+
|
|
117
|
+
A few things to know:
|
|
118
|
+
|
|
119
|
+
- Browsers won't let a page make sound until you've clicked in it once. If `play` says so, click anywhere in the tab and try again.
|
|
120
|
+
- With more than one Haku tab open, tools drive the one you clicked into most recently.
|
|
121
|
+
- Your projects are saved in the browser for `127.0.0.1:5177`. Changing `HAKU_WEB_PORT` gives you a separate, empty project list, so use the folder button to export and import if you move.
|
|
122
|
+
- The bridge only accepts tabs from `localhost` pages and only accepts tools from outside the browser. `HAKU_ALLOW_ORIGINS` (comma separated) adds other page origins, and `HAKU_BRIDGE_PORT` changes the port.
|
|
123
|
+
|
|
124
|
+
## Environment variables
|
|
125
|
+
|
|
126
|
+
| Variable | What it does |
|
|
127
|
+
|---|---|
|
|
128
|
+
| `HAKU_PROJECT` | Default project file for commands that take `-f` |
|
|
129
|
+
| `HAKU_BRIDGE_PORT` | Bridge port. Default `5179` |
|
|
130
|
+
| `HAKU_WEB_PORT` | Port `haku web` serves the app on. Default `5177` |
|
|
131
|
+
| `HAKU_NO_LAUNCH` | Set it to stop tools from opening Haku when no tab is connected |
|
|
132
|
+
| `HAKU_ALLOW_ORIGINS` | Extra page origins allowed to connect as a Haku tab |
|
|
133
|
+
| `HAKU_SAMPLES` | Use a different sample folder (one with a `manifest.json`) |
|
|
134
|
+
|
|
135
|
+
## Credits
|
|
136
|
+
|
|
137
|
+
Haku's code is Apache 2.0 (see `dist/LICENSE`). The bundled samples are edited versions of the originals: trimmed, shortened, faded, level-adjusted, and re-encoded to Ogg Vorbis. The Wurlitzer also has its sfz mapping's tuning and level fixes baked in, and the rain recordings are cut into seamless loops.
|
|
138
|
+
|
|
139
|
+
| Sound | Source | Author | License |
|
|
140
|
+
|---|---|---|---|
|
|
141
|
+
| Upright piano | [VSCO 2 Community Edition](https://github.com/sgossner/VSCO-2-CE) | Simon Dalzell of Ivy Audio, distributed by Versilian Studios | CC0 1.0 |
|
|
142
|
+
| Glockenspiel, marimba, harp | [VSCO 2 Community Edition](https://github.com/sgossner/VSCO-2-CE) | Versilian Studios | CC0 1.0 |
|
|
143
|
+
| Wurlitzer EP200 | [Greg Sullivan's E-Pianos](https://github.com/sfzinstruments/GregSullivan.E-Pianos) | [Greg Sullivan](http://www.sullivang.net/), sfz mapping by kinwie | [CC-BY 3.0](https://creativecommons.org/licenses/by/3.0/) |
|
|
144
|
+
| Drums | [Big Rusty Drums](https://github.com/sfzinstruments/karoryfer.big-rusty-drums) | Karoryfer Samples | CC0 1.0 |
|
|
145
|
+
| Rain on the roof | [Soft rain on roof window](https://freesound.org/people/Metadex/sounds/235827/) | Metadex | CC0 1.0 |
|
|
146
|
+
| Rain on the window | [January rain on a window](https://freesound.org/people/mmorgaine/sounds/333510/) | mmorgaine | CC0 1.0 |
|
|
147
|
+
|
|
148
|
+
Snapshots use [Figtree](https://github.com/erikdkennedy/figtree) by Erik Kennedy, under the SIL Open Font License 1.1 (`dist/fonts/OFL.txt`).
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
Made with 💖 by [Pink Pixel](https://pinkpixel.dev)
|
package/dist/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 Pink Pixel
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { a as webRunning, c as Player, d as BridgeHost, f as SharedLink, i as webPort, l as GUIDE, n as openBrowser, o as webUrl, p as bridgePort, r as serveWeb, s as VERSION, t as TOOLS, u as BridgeClient } from "./tools-_xkF2Yfv.mjs";
|
|
3
|
+
import { readFile } from "node:fs/promises";
|
|
4
|
+
import { resolve } from "node:path";
|
|
5
|
+
import { Command, Option } from "commander";
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
// src/cli.ts
|
|
8
|
+
const kebab = (s) => s.replace(/_/g, "-");
|
|
9
|
+
let client = null;
|
|
10
|
+
const ctx = {
|
|
11
|
+
link: async () => await client ?? await (client = BridgeClient.connect()),
|
|
12
|
+
player: new Player(),
|
|
13
|
+
waitForPlayback: true,
|
|
14
|
+
cwd: process.env.INIT_CWD ?? process.cwd(),
|
|
15
|
+
autoLaunch: !process.env.HAKU_NO_LAUNCH
|
|
16
|
+
};
|
|
17
|
+
function fail(message) {
|
|
18
|
+
console.error(`haku: ${message}`);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
/** Turns one option's text into the value its schema wants. */
|
|
22
|
+
function parseValue(raw, schema, flag) {
|
|
23
|
+
const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;
|
|
24
|
+
if (type === "number" || type === "integer") {
|
|
25
|
+
const n = Number(raw);
|
|
26
|
+
if (!Number.isFinite(n)) fail(`--${flag} needs a number, got "${raw}"`);
|
|
27
|
+
return n;
|
|
28
|
+
}
|
|
29
|
+
if (type === "string" || schema.enum) return raw;
|
|
30
|
+
try {
|
|
31
|
+
return JSON.parse(raw);
|
|
32
|
+
} catch {
|
|
33
|
+
if ((schema.anyOf ?? schema.oneOf ?? []).some((v) => v.type === "string")) return raw;
|
|
34
|
+
fail(`--${flag} needs JSON, like '${type === "array" ? "[...]" : "{...}"}'`);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function addTool(program, tool) {
|
|
38
|
+
const schema = z.toJSONSchema(tool.input, { io: "input" });
|
|
39
|
+
const props = schema.properties ?? {};
|
|
40
|
+
const required = new Set(schema.required ?? []);
|
|
41
|
+
const cmd = program.command(kebab(tool.name)).description(tool.description);
|
|
42
|
+
for (const [name, prop] of Object.entries(props)) {
|
|
43
|
+
const flag = kebab(name);
|
|
44
|
+
const desc = `${prop.description ?? ""}${required.has(name) ? " (required)" : ""}`.trim();
|
|
45
|
+
if (prop.type === "boolean") {
|
|
46
|
+
cmd.addOption(new Option(`--${flag}`, desc));
|
|
47
|
+
cmd.addOption(new Option(`--no-${flag}`).hideHelp());
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const opt = new Option(`${name === "file" ? "-f, " : ""}--${flag} <value>`, desc);
|
|
51
|
+
if (prop.enum) opt.choices(prop.enum.map(String));
|
|
52
|
+
if (name === "file" && process.env.HAKU_PROJECT && !required.has(name)) opt.default(process.env.HAKU_PROJECT, "$HAKU_PROJECT");
|
|
53
|
+
cmd.addOption(opt);
|
|
54
|
+
}
|
|
55
|
+
cmd.action(async (opts) => {
|
|
56
|
+
const args = {};
|
|
57
|
+
for (const [name, prop] of Object.entries(props)) {
|
|
58
|
+
const v = opts[name.replace(/_([a-z])/g, (_, c) => c.toUpperCase())];
|
|
59
|
+
if (v === void 0) continue;
|
|
60
|
+
args[name] = typeof v === "string" ? parseValue(v, prop, kebab(name)) : v;
|
|
61
|
+
}
|
|
62
|
+
const parsed = tool.input.safeParse(args);
|
|
63
|
+
if (!parsed.success) {
|
|
64
|
+
const issue = parsed.error.issues[0];
|
|
65
|
+
fail(`${issue.path.length ? `--${kebab(issue.path.join("."))}: ` : ""}${issue.message}`);
|
|
66
|
+
}
|
|
67
|
+
await runTool(tool, parsed.data);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async function runTool(tool, args) {
|
|
71
|
+
try {
|
|
72
|
+
const result = await tool.run(args, ctx);
|
|
73
|
+
console.log(result.text);
|
|
74
|
+
} catch (err) {
|
|
75
|
+
fail(err instanceof Error ? err.message : String(err));
|
|
76
|
+
} finally {
|
|
77
|
+
await (await client)?.close();
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/** A file (or stdin) of commands: a JSON array, or one JSON object per line. */
|
|
81
|
+
async function readCommands(path) {
|
|
82
|
+
let text;
|
|
83
|
+
if (path && path !== "-") text = await readFile(resolve(ctx.cwd, path), "utf8");
|
|
84
|
+
else {
|
|
85
|
+
const chunks = [];
|
|
86
|
+
for await (const chunk of process.stdin) chunks.push(chunk);
|
|
87
|
+
text = Buffer.concat(chunks).toString("utf8");
|
|
88
|
+
}
|
|
89
|
+
const trimmed = text.trim();
|
|
90
|
+
if (!trimmed) fail("no commands given");
|
|
91
|
+
try {
|
|
92
|
+
if (trimmed.startsWith("[")) return JSON.parse(trimmed);
|
|
93
|
+
return trimmed.split("\n").map((l) => l.trim()).filter((l) => l && !l.startsWith("//")).map((l) => JSON.parse(l));
|
|
94
|
+
} catch (err) {
|
|
95
|
+
fail(`couldn't read the commands as JSON: ${err instanceof Error ? err.message : String(err)}`);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const program = new Command("haku").description("Draw lofi music from the terminal. Works on a .haku.json file, or live on the open Haku tab.").version(VERSION).showHelpAfterError();
|
|
99
|
+
program.command("guide").description("How the canvas, brushes, and commands work.").action(() => console.log(GUIDE));
|
|
100
|
+
for (const tool of TOOLS) addTool(program, tool);
|
|
101
|
+
program.command("exec").argument("[commands]", "JSON file of commands (an array, or one per line). Reads stdin when left out or \"-\".").description("Run a file of commands as one step. If any fails, nothing changes.").option("-f, --file <path>", "Project file. Leave out to work on the Haku tab.", process.env.HAKU_PROJECT).action(async (path, opts) => {
|
|
102
|
+
const commands = await readCommands(path);
|
|
103
|
+
const batch = TOOLS.find((t) => t.name === "batch");
|
|
104
|
+
const parsed = batch.input.safeParse({
|
|
105
|
+
file: opts.file,
|
|
106
|
+
commands
|
|
107
|
+
});
|
|
108
|
+
if (!parsed.success) {
|
|
109
|
+
const issue = parsed.error.issues[0];
|
|
110
|
+
fail(`${issue.path.join(".")}: ${issue.message}`);
|
|
111
|
+
}
|
|
112
|
+
await runTool(batch, parsed.data);
|
|
113
|
+
});
|
|
114
|
+
/** How long an auto-launched `haku web` keeps running with no tab connected. */
|
|
115
|
+
const IDLE_MS = 18e5;
|
|
116
|
+
program.command("web").description("Open Haku in your browser. Serves the app on localhost and hosts the bridge, so agents can drive it too.").option("--no-open", "Just serve, don't open a browser").addOption(new Option("--exit-when-idle").hideHelp()).action(async (opts) => {
|
|
117
|
+
const port = webPort();
|
|
118
|
+
const url = webUrl(port);
|
|
119
|
+
let server;
|
|
120
|
+
try {
|
|
121
|
+
server = await serveWeb(port);
|
|
122
|
+
} catch (err) {
|
|
123
|
+
if (err.code !== "EADDRINUSE") fail(err instanceof Error ? err.message : String(err));
|
|
124
|
+
if (!await webRunning(port)) fail(`port ${port} is taken by something else. Set HAKU_WEB_PORT to use another one.`);
|
|
125
|
+
console.log(`Haku is already running at ${url}`);
|
|
126
|
+
if (opts.open) await openBrowser(url);
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
const link = new SharedLink();
|
|
130
|
+
await link.ensure().catch(() => null);
|
|
131
|
+
console.log(`Haku is running at ${url}. Ctrl+C to stop.`);
|
|
132
|
+
if (opts.open && !await openBrowser(url)) console.log(`Couldn't open a browser. Open ${url} yourself.`);
|
|
133
|
+
const shutdown = () => {
|
|
134
|
+
server.close();
|
|
135
|
+
link.close().finally(() => process.exit(0));
|
|
136
|
+
};
|
|
137
|
+
process.once("SIGINT", shutdown);
|
|
138
|
+
process.once("SIGTERM", shutdown);
|
|
139
|
+
if (opts.exitWhenIdle) {
|
|
140
|
+
let lastTab = Date.now();
|
|
141
|
+
setInterval(async () => {
|
|
142
|
+
if ((await link.request({ op: "ping" }).catch(() => null))?.tab) lastTab = Date.now();
|
|
143
|
+
else if (Date.now() - lastTab > IDLE_MS) shutdown();
|
|
144
|
+
}, 6e4);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
program.command("bridge").description("Run the localhost bridge on its own, so the CLI can reach the open Haku tab.").action(async () => {
|
|
148
|
+
const port = bridgePort();
|
|
149
|
+
let host;
|
|
150
|
+
try {
|
|
151
|
+
host = await BridgeHost.listen(port);
|
|
152
|
+
} catch (err) {
|
|
153
|
+
if (err.code === "EADDRINUSE") fail(`port ${port} is taken. The MCP server or another bridge is probably already running, which is fine.`);
|
|
154
|
+
throw err;
|
|
155
|
+
}
|
|
156
|
+
host.onEvent = (line) => console.log(line);
|
|
157
|
+
console.log(`Haku bridge on ws://127.0.0.1:${port}. Open Haku in a browser and it connects on its own. Ctrl+C to stop.`);
|
|
158
|
+
process.once("SIGINT", () => void host.close().then(() => process.exit(0)));
|
|
159
|
+
});
|
|
160
|
+
program.command("mcp").description("Start the MCP server on stdio. It also hosts the bridge to the Haku tab.").action(async () => {
|
|
161
|
+
const { startMcp } = await import("./mcp-DG9U-P0N.mjs");
|
|
162
|
+
await startMcp();
|
|
163
|
+
});
|
|
164
|
+
const argv = [...process.argv];
|
|
165
|
+
const sub = argv.findIndex((a, i) => i >= 2 && !a.startsWith("-"));
|
|
166
|
+
if (sub >= 0 && /^[a-z]+(_[a-z]+)+$/.test(argv[sub])) argv[sub] = kebab(argv[sub]);
|
|
167
|
+
await program.parseAsync(argv);
|
|
168
|
+
export {};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2022 The Figtree Project Authors (https://github.com/erikdkennedy/figtree)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|