@vibechain/os 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/AGENTS.md +15 -6
  2. package/README.md +35 -10
  3. package/SECURITY.md +3 -1
  4. package/dist/app-client.js +20 -4
  5. package/dist/app-host.d.ts +12 -2
  6. package/dist/app-host.js +12 -2
  7. package/dist/app-protocol.d.ts +21 -0
  8. package/dist/app-protocol.js +9 -0
  9. package/dist/audio.d.ts +65 -0
  10. package/dist/audio.js +162 -0
  11. package/dist/browser.d.ts +1 -0
  12. package/dist/browser.js +1 -0
  13. package/dist/bundle.d.ts +2 -0
  14. package/dist/bundle.js +2 -0
  15. package/dist/cli.js +3 -1
  16. package/dist/commands.d.ts +6 -0
  17. package/dist/commands.js +17 -0
  18. package/dist/index.d.ts +2 -2
  19. package/dist/links.d.ts +6 -0
  20. package/dist/links.js +2 -0
  21. package/dist/os.d.ts +20 -2
  22. package/dist/os.js +30 -5
  23. package/dist/preview-parent.js +15 -2
  24. package/dist/preview-ui.js +1 -1
  25. package/dist/preview.js +1 -1
  26. package/dist/templates/plain/game.js +3 -1
  27. package/dist/testing.d.ts +9 -1
  28. package/dist/testing.js +27 -6
  29. package/dist/vibemarket-os.js +1 -1
  30. package/examples/paw-beat/README.md +28 -9
  31. package/examples/paw-beat/game.ts +280 -123
  32. package/examples/paw-beat/index.html +18 -4
  33. package/examples/paw-beat/main.ts +101 -44
  34. package/examples/paw-beat/music.ts +72 -337
  35. package/examples/paw-beat/stage.ts +23 -9
  36. package/examples/paw-beat/store/screenshot-1.webp +0 -0
  37. package/examples/paw-beat/store/screenshot-2.webp +0 -0
  38. package/examples/paw-beat/synth.ts +477 -0
  39. package/examples/paw-beat/tracks.ts +286 -0
  40. package/examples/paw-beat/vibemarket.json +2 -2
  41. package/examples/vibexp-app/plain/game.ts +6 -2
  42. package/package.json +7 -1
  43. package/skill.md +399 -0
@@ -0,0 +1,286 @@
1
+ import type { PlayableTrack } from "./synth";
2
+
3
+ /**
4
+ * Paw Beat's tracks, as data. Every one is original and about a minute long. game.ts lays each
5
+ * out in time and writes its steps; synth.ts plays it with the shared instruments.
6
+ *
7
+ * To add a track: give it an id and a name, a tempo, meter and swing; list its sections (role,
8
+ * bars, chords, which phrases of the tune play, how the steps are written, and which drum,
9
+ * bass, pad and arpeggio patterns sound); write its phrases as note names with lengths in
10
+ * eighths; and pick its instruments, patterns and colours under `sound`. The tests check every
11
+ * track: the tune fits its sections, the chart is fair, the mix never clips.
12
+ *
13
+ * Phrases: "E5:2" is E5 for two eighths (a quarter note), "r:1" an eighth's rest. A list of
14
+ * strings is a set of alternatives; each round's seed picks one.
15
+ */
16
+
17
+ // ---- 1. Biscuit's Groove: the original song. A minor, a four-on-the-floor dance beat. ----
18
+ const biscuitsGroove: PlayableTrack = {
19
+ id: "biscuits-groove", name: "Biscuit's Groove", mood: "The original: a bright dance beat in A minor that builds, drops and comes home.",
20
+ bpm: 120, meter: 4, swing: 0, offbeats: 0.65, colours: ["#ff9f43", "#ff5c8a"],
21
+ sections: [
22
+ { role: "count-in", label: "Count-in", bars: 1, chords: "Am", steps: "none", drums: "none", bass: "none" },
23
+ { role: "intro", label: "Intro", bars: 2, chords: "Am F", steps: "half", drums: "intro", bass: "half", pad: "hold" },
24
+ { role: "intro", label: "Intro", bars: 2, chords: "Am F", steps: "beat", tune: ["callA"], voice: "pluck", drums: "four", bass: "half", pad: "hold" },
25
+ { role: "build", label: "Build", bars: 4, chords: "Am F C G", steps: "beat", drums: "build", bass: "eighths", arp: "climb", fx: "riser roll" },
26
+ { role: "drop", label: "Drop", bars: 8, chords: "Am F C G", steps: "tune", tune: ["callA", "callB", "callA", "answer"], drums: "drop", bass: "pump", pad: "hold", fx: "crash" },
27
+ { role: "break", label: "Breakdown", bars: 4, chords: "Am F C G", steps: "half", tune: ["bellA", "bellB"], voice: "bell", drums: "breakdown", bass: "whole", pad: "hold", fx: "riser roll" },
28
+ { role: "finale", label: "Finale", bars: 6, chords: "Am F C G", steps: "tune", tune: ["callA", "callB", "callA"], jumps: true, drums: "finale", bass: "pump", pad: "hold", fx: "crash" },
29
+ { role: "outro", label: "Outro", bars: 1, chords: "G", steps: "tune", tune: ["cadence"], drums: "drop", bass: "pump", pad: "hold" },
30
+ { role: "outro", label: "Home", bars: 1, chords: "Am", steps: "tune", tune: ["home"], drums: "hit", bass: "whole", pad: "hold", fx: "crash" },
31
+ ],
32
+ phrases: {
33
+ // The call, over A minor then F: a leap up to A, a fall back to E, then a settle on C.
34
+ callA: "E5:2 A5:1 G5:1 E5:2 D5:1 E5:1 C5:3 D5:1 C5:1 A4:1 C5:2",
35
+ // Over C then G it climbs to C6 and stops on D, a question.
36
+ callB: "G5:2 E5:1 G5:1 C6:3 B5:1 A5:3 G5:1 D5:4",
37
+ answer: ["G5:2 E5:1 G5:1 C6:2 B5:1 A5:1 B5:3 G5:1 D5:4", "E5:1 G5:1 C6:2 B5:2 A5:1 G5:1 B5:2 A5:2 G5:4", "C6:2 B5:1 G5:1 E5:2 G5:2 D5:2 E5:1 G5:1 B5:4"],
38
+ bellA: "E5:2 A5:2 E5:2 D5:2 C5:4 A4:2 C5:2",
39
+ bellB: "G5:2 E5:2 C6:4 A5:4 D5:4",
40
+ cadence: "G5:3 A5:1 B5:4",
41
+ home: "A5:8",
42
+ },
43
+ sound: {
44
+ kit: "punchy", bass: "saw", lead: "sawsquare", lead2: "sawsquare", pad: "warm", arp: "pluck",
45
+ drums: {
46
+ intro: { kick: "x.......x.......", hat: "..g...g...g...g." },
47
+ four: { kick: "x...x...x...x...", hat: "..x...x...x...x." },
48
+ build: { kick: "x...x...x...x...", clap: "....x.......x...", hat: "..x...x...x...x." },
49
+ drop: { kick: "x...x...x...x...", snare: "....x.......x...", clap: "....x.......x...", hat: "g...g...g...g...", open: "..x...x...x...x." },
50
+ breakdown: { kick: "x.......x.......", hat: "..g...g...g...g." },
51
+ finale: { kick: "x...x...x...x...", snare: "....x.......x...", clap: "....x.......x...", hat: "g.g.g.g.g.g.g.g.", open: "..x...x...x...x." },
52
+ hit: { kick: "x..............." },
53
+ },
54
+ bassLines: { half: "R-------R-------", eighths: "R-r-R-r-R-r-R-r-", pump: "R-O-R-O-R-O-R-O-", whole: "R---------------" },
55
+ comps: { hold: "S---------------" },
56
+ arps: { climb: "0123012345674567" },
57
+ delay: 0.35, reverb: 0.4, duck: 0.5, level: -1.7,
58
+ },
59
+ };
60
+
61
+ // ---- 2. Sunny Windowsill: F major, a lazy swung funk with electric piano and a whistled tune. ----
62
+ const sunnyWindowsill: PlayableTrack = {
63
+ id: "sunny-windowsill", name: "Sunny Windowsill", mood: "Swung, sunny funk in F major: electric piano, a slap of bass and a tune you could whistle.",
64
+ bpm: 100, meter: 4, swing: 0.28, offbeats: 0.9, colours: ["#ffd166", "#ff8fab"],
65
+ sections: [
66
+ { role: "count-in", label: "Count-in", bars: 1, chords: "Fmaj7", steps: "none", drums: "none", bass: "none" },
67
+ { role: "intro", label: "Intro", bars: 2, chords: "Fmaj7 Dm7", steps: "beat", drums: "intro", bass: "verse", pad: "comp" },
68
+ { role: "build", label: "Verse", bars: 6, chords: "Fmaj7 Dm7 Gm7 C7", steps: "groove", tune: ["verseA", "verseB", "verseC"], voice: "lead2", drums: "verse", bass: "verse", pad: "comp", fx: "swell" },
69
+ { role: "drop", label: "Chorus", bars: 6, chords: "Bbmaj7 C7 Am7 Dm7 Gm7 C7", steps: "groove", tune: ["chorusA", "chorusB", "chorusC"], drums: "chorus", bass: "chorus", pad: "busy", fx: "crash stop" },
70
+ { role: "break", label: "Break", bars: 2, chords: "Gm7 C7", steps: "beat", drums: "break", bass: "walk", pad: "hold" },
71
+ { role: "finale", label: "Last chorus", bars: 6, chords: "Bbmaj7 C7 Am7 Dm7 Gm7 C7", steps: "groove", tune: ["chorusA", "chorusB", "chorusC"], jumps: true, drums: "finale", bass: "chorus", pad: "busy", arp: "sparkle", fx: "crash" },
72
+ { role: "outro", label: "Tag", bars: 1, chords: "Gm7,C7", steps: "tune", tune: ["tag"], drums: "chorus", bass: "chorus", pad: "busy" },
73
+ { role: "outro", label: "Home", bars: 1, chords: "Fmaj7", steps: "tune", tune: ["home"], drums: "hit", bass: "whole", pad: "hold", fx: "crash" },
74
+ ],
75
+ phrases: {
76
+ // Laid back: the tune starts just after the beat and leans on the chords' sevenths and ninths.
77
+ verseA: "r:1 C5:1 A5:2 G5:1 F5:2 D5:1 F5:2 A5:1 C6:3 A5:2",
78
+ verseB: "Bb5:2 A5:1 G5:3 F5:1 G5:1 E5:2 G5:2 C6:4",
79
+ verseC: ["r:1 C5:1 A5:2 G5:1 F5:2 D5:1 F5:3 E5:1 D5:4", "r:1 F5:1 A5:2 C6:1 A5:2 G5:1 F5:2 D5:2 C5:4"],
80
+ // The hook is one rhythm walked down the progression: D-C-D-F, then C-A-C-E, then Bb-A-Bb-D.
81
+ chorusA: "D6:2 C6:1 D6:1 F6:3 D6:1 C6:2 Bb5:1 G5:1 G5:2 C6:2",
82
+ chorusB: "C6:2 A5:1 C6:1 E6:3 C6:1 D6:2 C6:2 A5:4",
83
+ chorusC: "Bb5:2 A5:1 Bb5:1 D6:3 C6:1 Bb5:2 G5:2 E5:2 G5:2",
84
+ tag: "Bb5:2 A5:2 G5:2 E5:2",
85
+ home: "F5:8",
86
+ },
87
+ sound: {
88
+ kit: "tight", bass: "pluck", lead: "whistle", lead2: "flute", pad: "ep", arp: "glock",
89
+ drums: {
90
+ intro: { shaker: "x.g.x.g.x.g.x.g.", rim: "....x.......x..." },
91
+ verse: { kick: "x.....x...x.....", rim: "....x.......x...", hat: "x.x.x.x.x.x.x.x.", shaker: "g.g.g.g.g.g.g.g." },
92
+ chorus: { kick: "x.....x.x.....x.", snare: "....x.......x...", clap: "....x.......x...", hat: "x.x.x.x.x.x.x.x.", open: "..............x." },
93
+ break: { rim: "x.......x.......", shaker: "x.g.x.g.x.g.x.g." },
94
+ finale: { kick: "x.....x.x.....x.", snare: "....x.......x..g", clap: "....x.......x...", hat: "x.x.x.x.x.x.x.x.", shaker: "g.g.g.g.g.g.g.g.", open: "..............x." },
95
+ hit: { kick: "x..............." },
96
+ },
97
+ bassLines: { verse: "R-.R..O-.R..F-T.", chorus: "R-.R.OR.F-.R.OT.", walk: "R---T---F---S---", whole: "R---------------" },
98
+ comps: { comp: "x.....x...x.....", busy: "x..x..x...x..x..", hold: "S---------------" },
99
+ arps: { sparkle: "....2.......4..." },
100
+ delay: 0.4, reverb: 0.5, duck: 0.2, level: 0.3,
101
+ },
102
+ };
103
+
104
+ // ---- 3. Midnight Zoomies: E minor at 140, a breakbeat with a growling bass and a bright hook. ----
105
+ const midnightZoomies: PlayableTrack = {
106
+ id: "midnight-zoomies", name: "Midnight Zoomies", mood: "Fast and dark in E minor: a broken beat, a growling bass and a hook that will not sit still.",
107
+ bpm: 140, meter: 4, swing: 0, offbeats: 0.2, colours: ["#3fc6e8", "#8f6bff"],
108
+ sections: [
109
+ { role: "count-in", label: "Count-in", bars: 1, chords: "Em", steps: "none", drums: "none", bass: "none" },
110
+ { role: "intro", label: "Intro", bars: 4, chords: "Em C D Bm", steps: "half", drums: "intro", bass: "whole", arp: "racing", pad: "hold" },
111
+ { role: "build", label: "Build", bars: 4, chords: "Em C D Bm", steps: "beat", drums: "build", bass: "eighths", arp: "racing", fx: "riser roll" },
112
+ { role: "drop", label: "Drop", bars: 8, chords: "Em C G D", steps: "tune", tune: ["hookA", "hookB", "hookA2", "hookB2"], drums: "breaks", bass: "growl", pad: "stab", arp: "skip", fx: "crash" },
113
+ { role: "break", label: "Break", bars: 4, chords: "C D Em Em", steps: "half", tune: ["drift", "settle"], voice: "bell", drums: "breakdown", bass: "whole", pad: "hold" },
114
+ { role: "build", label: "Lift", bars: 2, chords: "C B", steps: "beat", drums: "build", bass: "eighths", arp: "racing", fx: "roll swell" },
115
+ { role: "finale", label: "Finale", bars: 8, chords: "Em C G D", steps: "tune", tune: ["hookA2", "hookB", "hookA", "hookEnd"], jumps: true, drums: "finale", bass: "growl", pad: "stab", arp: "skip", fx: "crash" },
116
+ { role: "outro", label: "Outro", bars: 2, chords: "C D", steps: "tune", tune: ["outro"], drums: "breaks", bass: "growl", pad: "hold" },
117
+ { role: "outro", label: "Home", bars: 2, chords: "Em", steps: "tune", tune: ["home"], drums: "hit", bass: "whole", pad: "hold", fx: "crash" },
118
+ ],
119
+ phrases: {
120
+ // One rhythm, two shapes: a falling E-minor figure, then the same figure on G and D.
121
+ hookA: "E6:1 E6:1 D6:1 B5:2 G5:1 A5:1 B5:1 C6:2 B5:1 G5:3 E5:2",
122
+ hookA2: "E6:1 E6:1 D6:1 B5:2 G5:1 A5:1 B5:1 C6:2 D6:1 E6:3 B5:2",
123
+ hookB: "D6:1 D6:1 B5:1 G5:2 D5:1 G5:1 B5:1 A5:2 F#5:1 D5:3 F#5:2",
124
+ hookB2: ["D6:1 D6:1 B5:1 G5:2 D5:1 G5:1 B5:1 A5:2 B5:1 C6:3 D6:2", "D6:1 D6:1 B5:1 G5:2 D5:1 G5:1 B5:1 F#5:2 A5:1 D6:3 C6:2"],
125
+ hookEnd: "D6:1 D6:1 B5:1 G5:2 D5:1 G5:1 B5:1 A5:2 F#5:2 D5:2 F#5:2",
126
+ drift: "G5:4 E5:4 F#5:4 A5:4",
127
+ settle: "B5:8 G5:4 E5:4",
128
+ outro: "E5:2 G5:2 C6:4 A5:2 D6:2 F#6:4",
129
+ home: "E6:16",
130
+ },
131
+ sound: {
132
+ kit: "tight", bass: "reese", lead: "supersaw", lead2: "pulse", pad: "warm", arp: "pluck",
133
+ drums: {
134
+ intro: { kick: "x.........x.....", hat: "..g...g...g...g." },
135
+ build: { kick: "x...x...x...x...", hat: "g.g.g.g.g.g.g.g." },
136
+ breaks: { kick: "x.........x.....", snare: "....x.g.....x..g", hat: "x.xxx.x.x.xxx.x.", open: "..............x." },
137
+ breakdown: { kick: "x...............", rim: "....x.......x...", hat: "..g...g...g...g." },
138
+ finale: { kick: "x.........x.x...", snare: "....x.g.....x..g", clap: "....x.......x...", hat: "x.xxx.x.x.xxx.x.", open: "..............x." },
139
+ hit: { kick: "x..............." },
140
+ },
141
+ bassLines: { whole: "R---------------", eighths: "r-r-r-r-r-r-r-r-", growl: "R-------R--R-O-R" },
142
+ comps: { hold: "S---------------", stab: "x.......x..x...." },
143
+ arps: { racing: "0242024202420242", skip: "0.2.4.2.0.2.4.2." },
144
+ delay: 0.3, reverb: 0.35, duck: 0.55, level: -2,
145
+ },
146
+ };
147
+
148
+ // ---- 4. Yarn Ball Waltz: D major in 3/4, a music box, a strummed guitar and a borrowed minor chord. ----
149
+ const yarnBallWaltz: PlayableTrack = {
150
+ id: "yarn-ball-waltz", name: "Yarn Ball Waltz", mood: "A music-box waltz in D major, one-two-three, with a wistful turn in the middle.",
151
+ bpm: 150, meter: 3, swing: 0, offbeats: 0.5, colours: ["#b28dff", "#7bd88f"],
152
+ sections: [
153
+ { role: "count-in", label: "Count-in", bars: 1, chords: "D", steps: "none", drums: "none", bass: "none" },
154
+ { role: "intro", label: "Intro", bars: 4, chords: "D G A D", steps: "half", drums: "intro", bass: "oom", arp: "twinkle" },
155
+ { role: "build", label: "Waltz", bars: 12, chords: "D D Bm Bm G A D F#m G Em A A7", steps: "tune", tune: ["a1", "a2", "a3", "a4", "a5", "a6"], drums: "waltz", bass: "oom", pad: "pahpah" },
156
+ { role: "drop", label: "Turn", bars: 12, chords: "G A F#m Bm Em A D D G Gm D A7", steps: "tune", tune: ["b1", "b2", "b3", "b4", "b5", "b6"], voice: "lead2", drums: "turn", bass: "oomfa", pad: "pahpah", fx: "crash" },
157
+ { role: "break", label: "Hush", bars: 4, chords: "Bm G A D", steps: "half", tune: ["hush"], drums: "hush", bass: "none", pad: "hold", fx: "swell" },
158
+ { role: "finale", label: "Last waltz", bars: 12, chords: "D D Bm Bm G A D F#m G Em A A7", steps: "tune", tune: ["a1x", "a2", "a3x", "a4", "a5x", "a6"], jumps: true, drums: "turn", bass: "oomfa", pad: "pahpah", arp: "twinkle", fx: "crash" },
159
+ { role: "outro", label: "Coda", bars: 3, chords: "G Em A7", steps: "tune", tune: ["coda"], drums: "waltz", bass: "oom", pad: "pahpah" },
160
+ { role: "outro", label: "Home", bars: 1, chords: "D", steps: "tune", tune: ["home"], drums: "hit", bass: "whole", pad: "hold", fx: "crash" },
161
+ ],
162
+ phrases: {
163
+ // Two bars of 3/4 are twelve eighths. The opening figure (F#, A, D up the chord) comes back to tie the tune together.
164
+ a1: "F#5:2 A5:2 D6:2 A5:4 F#5:2",
165
+ a1x: ["F#5:2 A5:2 D6:2 A5:2 G5:1 F#5:1 E5:2", "F#5:1 G5:1 A5:2 D6:2 A5:4 F#5:2"],
166
+ a2: "D6:4 B5:2 F#5:6",
167
+ a3: "G5:2 B5:2 D6:2 C#6:4 A5:2",
168
+ a3x: ["G5:2 B5:2 D6:2 C#6:2 B5:1 C#6:1 A5:2", "G5:1 A5:1 B5:2 D6:2 C#6:4 A5:2"],
169
+ a4: "F#5:2 A5:2 D6:2 C#6:6",
170
+ a5: "B5:2 D6:2 B5:2 G5:4 E5:2",
171
+ a5x: ["B5:2 D6:2 B5:2 G5:2 F#5:1 G5:1 E5:2", "B5:1 C#6:1 D6:2 B5:2 G5:4 E5:2"],
172
+ a6: "A5:2 C#6:2 E6:2 C#6:4 A5:2",
173
+ b1: "D6:2 B5:2 G5:2 A5:2 C#6:2 E6:2",
174
+ b2: "C#6:4 A5:2 B5:6",
175
+ b3: "G5:2 B5:2 E6:2 C#6:4 A5:2",
176
+ b4: "D6:4 F#5:2 A5:6",
177
+ // The wistful turn: G major to G minor, B to B flat.
178
+ b5: "B5:2 G5:2 B5:2 Bb5:4 G5:2",
179
+ b6: "A5:2 F#5:2 D5:2 E5:4 G5:2",
180
+ hush: "F#5:6 D5:6 E5:6 F#5:6",
181
+ coda: "B5:2 A5:2 G5:2 G5:2 E5:2 B5:2 C#6:4 E6:2",
182
+ home: "D6:6",
183
+ },
184
+ sound: {
185
+ kit: "soft", bass: "upright", lead: "musicbox", lead2: "flute", pad: "nylon", arp: "glock",
186
+ drums: {
187
+ intro: { rim: "....g...g..." },
188
+ waltz: { kick: "x...........", rim: "....x...x...", hat: "g.g.g.g.g.g." },
189
+ turn: { kick: "x...........", snare: "....x...x...", hat: "g.g.g.g.g.g.", shaker: "..g...g...g." },
190
+ hush: { shaker: "x...g...g..." },
191
+ hit: { kick: "x..........." },
192
+ },
193
+ bassLines: { oom: "R-----------", oomfa: "R-------F---", whole: "R-----------" },
194
+ comps: { pahpah: "....x...x...", hold: "S-----------" },
195
+ arps: { twinkle: "0.1.2.4.2.1." },
196
+ delay: 0.25, reverb: 0.7, duck: 0, level: 2.6,
197
+ },
198
+ };
199
+
200
+ // ---- 5. Rooftop Bossa: G minor at 112, a bossa nova on nylon strings with a flute. ----
201
+ const rooftopBossa: PlayableTrack = {
202
+ id: "rooftop-bossa", name: "Rooftop Bossa", mood: "An evening bossa in G minor: nylon strings, a soft flute and a classic turn through B-flat.",
203
+ bpm: 112, meter: 4, swing: 0, offbeats: 0.9, colours: ["#ff9f43", "#3fc6e8"],
204
+ sections: [
205
+ { role: "count-in", label: "Count-in", bars: 1, chords: "Gm7", steps: "none", drums: "none", bass: "none" },
206
+ { role: "intro", label: "Intro", bars: 3, chords: "Gm7 C9 Gm7", steps: "half", drums: "intro", bass: "bossa", pad: "strum" },
207
+ { role: "build", label: "Verse", bars: 8, chords: "Gm7 C9 Gm7 C9 Ebmaj7 D7 Gm7 Gm7", steps: "groove", tune: ["a1", "a2", "a3", "a4"], voice: "lead2", drums: "bossa", bass: "bossa", pad: "strum" },
208
+ { role: "drop", label: "Bridge", bars: 6, chords: "Cm7 F7 Bbmaj7 Ebmaj7 Am7b5 D7", steps: "groove", tune: ["b1", "b2", "b3"], drums: "bridge", bass: "lift", pad: "busy", fx: "crash" },
209
+ { role: "break", label: "Solo", bars: 2, chords: "Gm7 C9", steps: "half", tune: ["solo"], drums: "solo", bass: "whole", pad: "hold" },
210
+ { role: "finale", label: "Last verse", bars: 6, chords: "Gm7 C9 Gm7 C9 Ebmaj7 D7", steps: "groove", tune: ["a1", "a2", "a3"], jumps: true, drums: "bridge", bass: "bossa", pad: "strum", fx: "crash" },
211
+ { role: "outro", label: "Turnaround", bars: 1, chords: "Am7b5,D7", steps: "tune", tune: ["turn"], drums: "bossa", bass: "bossa", pad: "strum" },
212
+ { role: "outro", label: "Home", bars: 1, chords: "Gm9", steps: "tune", tune: ["home"], drums: "hit", bass: "whole", pad: "hold" },
213
+ ],
214
+ phrases: {
215
+ a1: "r:2 D5:1 E5:1 F5:3 D5:1 E5:3 D5:1 C5:2 Bb4:2",
216
+ a2: "r:2 D5:1 E5:1 F5:2 A5:2 G5:3 E5:1 D5:4",
217
+ a3: ["r:1 G5:1 G5:1 F5:1 Eb5:2 D5:2 C5:2 A4:1 C5:1 F#5:4", "r:1 G5:1 Bb5:1 G5:1 Eb5:2 D5:2 C5:2 D5:1 C5:1 F#5:4"],
218
+ a4: "G5:3 F5:1 D5:2 Bb4:2 G4:8",
219
+ b1: "Eb5:2 G5:2 Bb5:3 A5:1 A5:4 F5:2 Eb5:2",
220
+ b2: "D5:2 F5:2 A5:3 G5:1 G5:4 Bb5:2 G5:2",
221
+ b3: "C6:3 A5:1 Eb5:2 C5:2 F#5:3 A5:1 C6:2 A5:2",
222
+ solo: "Bb4:1 D5:1 F5:1 A5:1 G5:4 E5:3 G5:1 D5:4",
223
+ turn: "C5:2 Eb5:2 F#5:2 A5:2",
224
+ home: "G5:8",
225
+ },
226
+ sound: {
227
+ kit: "soft", bass: "upright", lead: "flute", lead2: "musicbox", pad: "nylon", arp: "glock",
228
+ drums: {
229
+ intro: { rim: "x..x..x...x..x..x..x...x..x.....", shaker: "x.g.x.g.x.g.x.g." },
230
+ bossa: { kick: "x.....x.x.....x.", rim: "x..x..x...x..x..x..x...x..x.....", shaker: "xgxgxgxgxgxgxgxg", hat: "....x.......x..." },
231
+ bridge: { kick: "x.....x.x.....x.", rim: "x..x..x...x..x..x..x...x..x.....", shaker: "xgxgxgxgxgxgxgxg", hat: "..x.x.x...x.x.x.", open: "..............x." },
232
+ solo: { shaker: "xgxgxgxgxgxgxgxg" },
233
+ hit: { kick: "x..............." },
234
+ },
235
+ bassLines: { bossa: "R.....F.R.....F.", lift: "R.....F.R..R..F.", whole: "R---------------" },
236
+ comps: { strum: "x..x..x...x..x..", busy: "x..x..x.x..x..x.", hold: "S---------------" },
237
+ arps: {},
238
+ delay: 0.2, reverb: 0.6, duck: 0, level: 0.8,
239
+ },
240
+ };
241
+
242
+ // ---- 6. Laser Pointer: C major at 132, chiptune square waves, up a tone for the finale. ----
243
+ const laserPointer: PlayableTrack = {
244
+ id: "laser-pointer", name: "Laser Pointer", mood: "Chiptune in C major: square waves, racing arpeggios and a key change for the last chase.",
245
+ bpm: 132, meter: 4, swing: 0, offbeats: 0.05, colours: ["#ff5c8a", "#7bd88f"],
246
+ sections: [
247
+ { role: "count-in", label: "Count-in", bars: 1, chords: "C", steps: "none", drums: "none", bass: "none" },
248
+ { role: "intro", label: "Intro", bars: 4, chords: "C Am F G", steps: "half", drums: "intro", bass: "walk", arp: "rise" },
249
+ { role: "build", label: "Level 1", bars: 8, chords: "C Am F G C Am F,G C", steps: "tune", tune: ["a1", "a2", "a3", "a4"], drums: "level", bass: "bounce", arp: "eighths" },
250
+ { role: "drop", label: "Level 2", bars: 8, chords: "F G Em Am F G E Am", steps: "tune", tune: ["b1", "b2", "b3", "b4"], voice: "lead2", drums: "boss", bass: "octaves", arp: "rise", fx: "crash" },
251
+ { role: "break", label: "Power-up", bars: 2, chords: "F G", steps: "beat", drums: "none", bass: "walk", arp: "rise", fx: "roll riser" },
252
+ { role: "finale", label: "Final level", bars: 8, chords: "C Am F G C Am F,G C", transpose: 2, steps: "tune", tune: ["a1", "a2", "a3", "a4"], jumps: true, drums: "final", bass: "bounce", arp: "racing", fx: "crash" },
253
+ { role: "outro", label: "Outro", bars: 1, chords: "F,G", transpose: 2, steps: "tune", tune: ["outro"], drums: "level", bass: "bounce", arp: "eighths" },
254
+ { role: "outro", label: "Home", bars: 1, chords: "C", transpose: 2, steps: "tune", tune: ["home"], drums: "hit", bass: "whole", pad: "hold", fx: "crash" },
255
+ ],
256
+ phrases: {
257
+ // Chiptune tunes like to outline their chords: each bar here leans on the chord's own notes.
258
+ a1: "G5:1 C6:1 E6:1 C6:1 G5:2 E5:2 A5:1 C6:1 E6:1 D6:1 C6:2 A5:2",
259
+ a2: "F5:1 A5:1 C6:1 A5:1 F6:2 C6:2 D6:1 B5:1 G5:1 B5:1 D6:3 r:1",
260
+ a3: ["E6:2 D6:1 C6:1 G5:2 C6:2 C6:1 B5:1 A5:2 E5:2 A5:2", "E6:1 D6:1 C6:2 G5:2 E6:2 C6:1 B5:1 A5:2 C6:2 A5:2"],
261
+ a4: "F5:1 A5:1 C6:1 F6:1 G5:1 B5:1 D6:1 G6:1 C6:2 G5:1 E5:1 C5:4",
262
+ b1: "A5:3 G5:1 F5:2 A5:2 B5:3 A5:1 G5:2 D6:2",
263
+ b2: "G5:2 B5:2 E6:3 D6:1 C6:2 A5:2 E5:4",
264
+ b3: "F5:1 G5:1 A5:2 C6:2 F6:2 D6:2 B5:2 G5:2 B5:2",
265
+ b4: "G#5:2 B5:2 E6:2 D6:2 C6:6 r:2",
266
+ outro: "F5:1 A5:1 C6:2 G5:1 B5:1 D6:2",
267
+ home: "C6:8",
268
+ },
269
+ sound: {
270
+ kit: "chip", bass: "chip", lead: "pulse", lead2: "sawsquare", pad: "chip", arp: "chip",
271
+ drums: {
272
+ intro: { kick: "x.......x.......", hat: "..x...x...x...x." },
273
+ level: { kick: "x.......x.x.....", snare: "....x.......x...", hat: "x.x.x.x.x.x.x.x." },
274
+ boss: { kick: "x.......x.x.....", snare: "....x.......x...", hat: "x.x.x.x.x.x.x.x.", open: "..x...x...x...x." },
275
+ final: { kick: "x...x...x.x.x...", snare: "....x.......x...", hat: "xgxgxgxgxgxgxgxg", open: "..x...x...x...x." },
276
+ hit: { kick: "x..............." },
277
+ },
278
+ bassLines: { walk: "R---R---R---R---", bounce: "R.R.O.R.R.R.O.R.", octaves: "R-O-R-O-F-O-R-O-", whole: "R---------------" },
279
+ comps: { hold: "S---------------" },
280
+ arps: { rise: "0120012001200120", eighths: "0.1.2.1.0.1.2.1.", racing: "0124012401240124" },
281
+ delay: 0.25, reverb: 0.15, duck: 0.3, level: -0.3,
282
+ },
283
+ };
284
+
285
+ /** The original song first: a 1.1 checkpoint's personal best belongs to it. */
286
+ export const TRACKS: readonly PlayableTrack[] = [biscuitsGroove, sunnyWindowsill, midnightZoomies, yarnBallWaltz, rooftopBossa, laserPointer];
@@ -2,7 +2,7 @@
2
2
  "schemaVersion": 2,
3
3
  "sdkVersion": 1,
4
4
  "id": "paw-beat",
5
- "version": "1.1.0",
5
+ "version": "1.2.0",
6
6
  "name": "Paw Beat",
7
7
  "tagline": "A 3D cat, four arrows and a beat. Hit the steps, keep the combo.",
8
8
  "category": "vibexp-app",
@@ -13,7 +13,7 @@
13
13
  "store": {
14
14
  "icon": "store/icon.png",
15
15
  "screenshots": ["store/screenshot-1.webp", "store/screenshot-2.webp"],
16
- "description": "Biscuit the cat dances to a one-minute song made entirely in code. Arrows slide down four lanes toward their outlines: press the matching arrow key or WASD, or tap the on-screen pads, as each one lands, and Biscuit dances the step (a side step, a leap or a squat) while the stage pulses with the music.\n\nTiming is judged perfect, great or good, and every ten steps in a row adds 10% to each step, up to double. Long combos earn a spin and confetti; a miss makes Biscuit stumble. The song builds, drops, breaks down and comes back for a finale, and the steps follow it, changing a little every round. Each round ends with a grade, your accuracy and every judgement. Your best score and sound setting are kept while the window stays open.",
16
+ "description": "Biscuit the cat dances to six original tracks made entirely in code, about a minute each: a dance groove, a swung funk, a fast breakbeat, a music-box waltz, a bossa nova and a chiptune chase. A random track plays each time you start. Arrows slide down four lanes toward their outlines: press the matching arrow key or WASD, or tap the on-screen pads, as each one lands, and Biscuit dances the step (a side step, a leap or a squat) while the stage pulses with the music.\n\nTiming is judged perfect, great or good, and every ten steps in a row adds 10% to each step, up to double. Long combos earn a spin and confetti; a miss makes Biscuit stumble. Each song builds, drops, breaks down and comes back for a finale, and the steps follow its tune, changing a little every round. Each round ends with a grade, your accuracy and every judgement. Your best score on each track and your sound setting are kept while the window stays open.",
17
17
  "category": "game",
18
18
  "rating": { "violence": "none", "language": "none", "mature": false },
19
19
  "support": "https://vibechain.com/os/docs"
@@ -6,9 +6,13 @@ import type { connect } from "@vibechain/os";
6
6
 
7
7
  declare global { const VibemarketOS: { connect: typeof connect } }
8
8
 
9
+ // Everything from here on is plain JavaScript as well as TypeScript: the agent skill (https://vibechain.com/os/skill.md)
10
+ // shows it as the smallest app's game.js.
9
11
  VibemarketOS.connect().then(async os => {
10
- const cat = document.getElementById("cat") as HTMLButtonElement;
11
- const best = (await os.load<{ best?: number }>())?.best ?? 0;
12
+ const cat = document.getElementById("cat");
13
+ if (!(cat instanceof HTMLButtonElement)) return;
14
+ const saved = await os.load();
15
+ const best = saved !== null && typeof saved === "object" && "best" in saved && typeof saved.best === "number" ? saved.best : 0;
12
16
  let taps = 0;
13
17
  cat.onclick = () => { taps++; cat.textContent = `${taps} (best ${best})`; };
14
18
  os.ready();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibechain/os",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -16,6 +16,7 @@
16
16
  "files": [
17
17
  "dist",
18
18
  "AGENTS.md",
19
+ "skill.md",
19
20
  "SECURITY.md",
20
21
  "LICENSE",
21
22
  "examples/paw-beat",
@@ -46,6 +47,10 @@
46
47
  "types": "./dist/canvas.d.ts",
47
48
  "import": "./dist/canvas.js"
48
49
  },
50
+ "./audio": {
51
+ "types": "./dist/audio.d.ts",
52
+ "import": "./dist/audio.js"
53
+ },
49
54
  "./testing": {
50
55
  "types": "./dist/testing.d.ts",
51
56
  "import": "./dist/testing.js"
@@ -58,6 +63,7 @@
58
63
  "scripts": {
59
64
  "build": "tsc && esbuild src/preview-parent.ts --bundle --minify --format=esm --target=es2022 --outfile=dist/preview-ui.js && esbuild src/browser.ts --bundle --minify --format=iife --global-name=VibemarketOS --target=es2022 --outfile=dist/vibemarket-os.js && esbuild examples/vibexp-app/plain/game.ts --format=iife --target=es2022 --outfile=dist/templates/plain/game.js",
60
65
  "typecheck": "tsc --noEmit",
66
+ "skill": "node --experimental-strip-types tools/write-skill.mts",
61
67
  "review": "pnpm typecheck && tsc -p examples/tsconfig.json && vitest run --coverage",
62
68
  "check:package": "publint --pack npm && attw --pack --profile esm-only",
63
69
  "prepublishOnly": "pnpm review && pnpm build && pnpm check:package",