@algorisys/tinyfly 0.95.0 → 0.98.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.
Files changed (51) hide show
  1. package/README.md +8 -8
  2. package/docs/acting.md +165 -0
  3. package/docs/character-appearance.md +281 -0
  4. package/docs/editor-guide.md +14 -6
  5. package/docs/examples.md +1 -1
  6. package/docs/getting-started.md +1 -1
  7. package/docs/gsap-compat.md +1 -1
  8. package/docs/llm-guide.md +44 -2
  9. package/docs/maps.md +2 -2
  10. package/docs/props.md +8 -6
  11. package/docs/teaching.md +1 -1
  12. package/lib/addons/characters.js +6266 -4087
  13. package/lib/browser/tinyfly.iife.js +16 -14
  14. package/lib/browser/tinyfly.js +8441 -6262
  15. package/lib/browser/tinyfly.umd.js +16 -14
  16. package/lib/types/characters/acting/index.d.ts +1 -0
  17. package/lib/types/characters/acting/surface-script.d.ts +92 -0
  18. package/lib/types/characters/capabilities.d.ts +20 -0
  19. package/lib/types/characters/cast.d.ts +284 -0
  20. package/lib/types/characters/character.d.ts +22 -4
  21. package/lib/types/characters/chart.d.ts +108 -0
  22. package/lib/types/characters/code-panel.d.ts +21 -46
  23. package/lib/types/characters/hands/held-items.d.ts +88 -0
  24. package/lib/types/characters/hands/index.d.ts +1 -0
  25. package/lib/types/characters/head/ears.d.ts +10 -0
  26. package/lib/types/characters/head/facial-hair.d.ts +118 -0
  27. package/lib/types/characters/head/glasses.d.ts +24 -0
  28. package/lib/types/characters/head/hair.d.ts +560 -0
  29. package/lib/types/characters/head/hats.d.ts +58 -0
  30. package/lib/types/characters/head/head-look.d.ts +53 -0
  31. package/lib/types/characters/head/index.d.ts +5 -0
  32. package/lib/types/characters/head/shell.d.ts +64 -0
  33. package/lib/types/characters/index.d.ts +7 -1
  34. package/lib/types/characters/interactions.d.ts +69 -0
  35. package/lib/types/characters/props/families/animals.d.ts +6 -0
  36. package/lib/types/characters/props/index.d.ts +1 -0
  37. package/lib/types/characters/props/prop-surface.d.ts +63 -0
  38. package/lib/types/characters/species/human-motion.d.ts +5 -2
  39. package/lib/types/characters/species/human.d.ts +111 -4
  40. package/lib/types/characters/surface/edit-log.d.ts +47 -0
  41. package/lib/types/characters/surface/index.d.ts +11 -0
  42. package/lib/types/characters/surface/pieces.d.ts +61 -0
  43. package/lib/types/characters/surface/ride.d.ts +31 -0
  44. package/lib/types/characters/surface/surface-box.d.ts +18 -0
  45. package/lib/types/characters/surface/surface.d.ts +79 -0
  46. package/lib/types/characters/wardrobe/basic-outfit.d.ts +19 -5
  47. package/lib/types/characters/whiteboard.d.ts +131 -0
  48. package/llms-full.txt +625 -28
  49. package/llms.txt +29 -28
  50. package/package.json +1 -1
  51. package/skills/tinyfly/SKILL.md +38 -9
package/docs/llm-guide.md CHANGED
@@ -18,8 +18,10 @@ npx @algorisys/tinyfly capabilities --json # the same as data
18
18
  It lists the easings, track kinds, every property each canvas shape can
19
19
  animate (with units and ranges), the stick figure's joints, poses,
20
20
  expressions, gags, gaits, beat actions, dances, flips and hand shapes, the v2
21
- character's poses, the code panel's languages, anchors and edits, camera
22
- shots and the teaching helpers. It is generated from the code, so it can't
21
+ character's poses, expressions, builds, hairstyles, facial hair, glasses,
22
+ hats and cast, the code panel's languages, every surface's anchors and
23
+ edits (code panel, whiteboard, chart), camera shots and the teaching
24
+ helpers. It is generated from the code, so it can't
23
25
  fall behind: **a name in it is accepted, and a name not in it is rejected.**
24
26
  It is also the last part of `llms-full.txt`.
25
27
 
@@ -43,6 +45,34 @@ Characters in a 3D scene walk the same way with `characterScript3D`
43
45
  (`{ do: 'walk', to: [x, z] }`, `pose`, `gag`, `face`, `place`); a rider is
44
46
  seated with `propRide3D` and spliced into its script with `spliceTracks`. See `docs/props.md`.
45
47
 
48
+ ## Characters with a look
49
+
50
+ A v2 character's appearance is plain options to `character()`, never drawing
51
+ code: `build` (`child`, `tall`, `short`…), `hair` (a style name, or
52
+ `{ style, color, length, … }`), `facialHair`, `glasses`, `hat`, `ears: true`
53
+ and `outfit: { shirt, trousers }`. `castMember('grandpa', 300)` gives a whole
54
+ ready-made character to start from. Expressions come from `HUMAN_EXPRESSIONS`
55
+ and are pose fields, as are the face marks `blush`, `tears` and `sweat` (0–1),
56
+ so any face goes with any action or view. Hair and hats turn with the head:
57
+ don't draw a different hairstyle per view. Put things in hands with `holding`
58
+ (`{ right: 'mug' }`, `{ both: 'parcel' }`; the pose field `held.both` lets go),
59
+ and for two characters touching use `meetHands('handshake', a, b)` with the
60
+ two standing `meetingSpacing(…)` apart, never two separate clips. See
61
+ `docs/character-appearance.md`.
62
+
63
+ ## Surfaces
64
+
65
+ Code panels (`codePanel()`), whiteboards (`whiteboard()`), charts
66
+ (`chart()`) and props (`propSurface(propTarget(…))`) are surfaces: their places have names (`line:7`,
67
+ `token:4:Println`, `text:eq`, `term:eq:+ 4`, `bar:q4`) and their edits are
68
+ called by name (`surface.edit('highlight', 'line:4', { at })`). Write a scene
69
+ on one with `surfaceScript()`: beats aim at `{ surface, anchor }` and say what
70
+ the surface does in answer with `then`, at a moment of the beat (`at:
71
+ 'contact'`, `'release'`…). A whiteboard's texts and marks and a chart's data
72
+ are declared up front, each with an id the places use. The catalog lists each
73
+ surface's places and edits. See "A whole scene as data", "Whiteboards" and
74
+ "Charts" in `docs/acting.md`.
75
+
46
76
  ## Your own behaviours
47
77
 
48
78
  Write new actions with `defineAction()` (from beats, or as timed pose steps),
@@ -109,14 +139,26 @@ Fix, render again.
109
139
  positions. A beat script's `to` is a scene x, and its tracks are offsets
110
140
  from `from` (and `ground` for y).
111
141
  - **Scene y grows downward.** A floor higher up the screen has a smaller y.
142
+ - **Walk figures in front of props, not through them.** A prop stands on its
143
+ middle; its front comes forward of that. Use its front line as the
144
+ figure's `ground` (a house's `anchor:doorstep`).
112
145
  - **Angles are degrees.** Stick-figure arms: 0 hangs down, 90 straight out,
113
146
  180 straight up; in profile the left arm's forward is negative.
147
+ - **A character's look is data, and names are checked.** `hair: 'bob'`, not
148
+ a drawing in `layers`; a style name not in the catalog throws (`hair:
149
+ unknown style`). Side names (`at: 'left'`, `arm.left`) are the character's
150
+ own: from the front its left is on screen right.
114
151
  - **Aim beats at anchors, not guessed numbers**: `code.line(7)`,
115
152
  `code.token(3, 'var')`, `code.spot(2, 8, 4)`, `piece.home`.
116
153
  - **Key reactions to contact times.** Beats that touch something report
117
154
  `result.beats[i].contact` (and `release`): wipe the line, fling the word or
118
155
  type the text at those times.
119
156
  - **Record panel edits before `code.ride()`**, which reads the moves they make.
157
+ - **Or write it all as data with `surfaceScript`**: name places
158
+ (`target: { surface: 'code', anchor: 'token:3:var' }`) and put the surface's
159
+ answer on the beat (`then: { surface: 'code', edit: 'fling', anchor: 'token:3:var', at: 'release' }`).
160
+ A cue's `at` is a moment name (`start`, `contact`, `release`, `end`), never
161
+ ms. It records the edits and rides the lines for you, in beat order.
120
162
 
121
163
  ## Set up your assistant
122
164
 
package/docs/maps.md CHANGED
@@ -14,8 +14,8 @@ On a page with no build step, load the maps add-on after the browser bundle; it
14
14
  adds to the same `tinyfly` global:
15
15
 
16
16
  ```html
17
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly.iife.js"></script>
18
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly-maps.iife.js"></script>
17
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly.iife.js"></script>
18
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-maps.iife.js"></script>
19
19
  ```
20
20
 
21
21
  It is a separate script because the offline world map it carries adds about
package/docs/props.md CHANGED
@@ -109,11 +109,11 @@ one probably meant, and `propScript` throws on them.
109
109
  | `house()` | `door` (`open`), `lights` (`on`), `smoke` (`for`, runs in the background), `shake` |
110
110
  | `helicopter()` | `takeOff` (`height`), `fly` (`to`, `height`), `hover`, `land` |
111
111
  | `airplane()` | `takeOff` (`to`, `height`), `fly` (`to`, `height`), `loop`, `land` (`to`) |
112
- | `horse()` | `walk`, `trot`, `canter`, `gallop` (`to`), `rear`, `buck`, `neigh`, `graze`, `sit`, `jump`, `nod`, `swish` |
113
- | `dog()` | `walk`, `trot`, `run` (`to`), `bark`, `wag`, `sniff`, `sit`, `jump`, `nod`, `swish` |
114
- | `cat()` | `walk`, `trot`, `run` (`to`), `meow`, `arch`, `pounce` (`to`), `sit`, `jump`, `nod`, `swish` |
115
- | `cow()` | `walk`, `trot` (`to`), `moo`, `graze`, `sit`, `jump`, `nod`, `swish` |
116
- | `songbird()`, `crow()` | `hop`, `walk` (`to`), `peck` (`for`), `flap` (`for`), `fly` (`to`, `height`), `land` (`height`, `to`), `tweet` / `caw` |
112
+ | `horse()` | `walk`, `trot`, `canter`, `gallop` (`to`), `rear`, `buck`, `neigh`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
113
+ | `dog()` | `walk`, `trot`, `run` (`to`), `bark`, `wag`, `sniff`, `sit`, `lie`, `jump`, `nod`, `swish` |
114
+ | `cat()` | `walk`, `trot`, `run` (`to`), `meow`, `arch`, `pounce` (`to`), `sit`, `lie`, `jump`, `nod`, `swish` |
115
+ | `cow()` | `walk`, `trot` (`to`), `moo`, `graze`, `sit`, `lie`, `jump`, `nod`, `swish` |
116
+ | `songbird()`, `crow()` | `hop`, `walk` (`to`), `peck` (`for`), `flap` (`for`), `fly` (`to`, `height`), `glide` (`to`, `height`), `land` (`height`, `to`), `tweet` / `caw` |
117
117
  | `chicken()` | `walk` (`to`), `peck`, `flap`, `flutter`, `cluck` (it cannot fly) |
118
118
 
119
119
  **Line art.** `propTarget({ …, style: 'stick' })` (or `drawSolvedProp(…, { style: 'stick' })`)
@@ -138,7 +138,9 @@ and while `flapping` is on, the rig's `derive` beats them from a phase,
138
138
  a second, a crow four). Its head pecks from a neck joint (`peck`; a chicken's
139
139
  neck stretches down to reach), and it walks with its head bobbing or hops.
140
140
  `fly` takes off with a crouch and a leap (no crouch if it is already in the
141
- air) and flies to `height` metres; `land` comes down to the ground or to a
141
+ air) and flies to `height` metres; `glide` holds the wings out still and sinks
142
+ gently toward `height` on the way to `to` (from the ground it flies the first
143
+ stretch); `land` comes down to the ground or to a
142
144
  perch (`height`). Perch it with anchors:
143
145
 
144
146
  ```js
package/docs/teaching.md CHANGED
@@ -25,7 +25,7 @@ path for all of that:
25
25
  </figure>
26
26
 
27
27
  <!-- once, anywhere on the page (a site-wide footer is fine) -->
28
- <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.95.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
28
+ <script src="https://cdn.jsdelivr.net/gh/algorisys-oss/tinyfly@v0.98.0/cdn/tinyfly-embed.iife.js" data-tinyfly-auto></script>
29
29
  ```
30
30
 
31
31
  Every `[data-tinyfly-embed]` mounts when the page is ready, with no per-post