@energy8platform/golem 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.
Files changed (62) hide show
  1. package/README.md +376 -0
  2. package/bin/golem.js +2 -0
  3. package/dist/editor.css +701 -0
  4. package/dist/editor.js +59202 -0
  5. package/dist/lib/cli.d.ts +1 -0
  6. package/dist/lib/cli.js +5521 -0
  7. package/dist/lib/cli.js.map +7 -0
  8. package/dist/lib/editor/api.d.ts +42 -0
  9. package/dist/lib/editor/app.d.ts +13 -0
  10. package/dist/lib/editor/atlas-detect.d.ts +28 -0
  11. package/dist/lib/editor/atlas-panel.d.ts +1 -0
  12. package/dist/lib/editor/atlas.d.ts +39 -0
  13. package/dist/lib/editor/gizmo-math.d.ts +36 -0
  14. package/dist/lib/editor/gizmos.d.ts +185 -0
  15. package/dist/lib/editor/layers.d.ts +1 -0
  16. package/dist/lib/editor/library.d.ts +3 -0
  17. package/dist/lib/editor/panels.d.ts +26 -0
  18. package/dist/lib/editor/props.d.ts +19 -0
  19. package/dist/lib/editor/server.d.ts +11 -0
  20. package/dist/lib/editor/stage.d.ts +222 -0
  21. package/dist/lib/editor/store.d.ts +1053 -0
  22. package/dist/lib/editor/timeline-layout.d.ts +64 -0
  23. package/dist/lib/editor/timeline.d.ts +45 -0
  24. package/dist/lib/editor-entry.d.ts +2 -0
  25. package/dist/lib/editor-entry.js +5490 -0
  26. package/dist/lib/editor-entry.js.map +7 -0
  27. package/dist/lib/harness.js +51012 -0
  28. package/dist/lib/ktx2.d.ts +15 -0
  29. package/dist/lib/mcp-server.d.ts +2 -0
  30. package/dist/lib/preview/harness.d.ts +16 -0
  31. package/dist/lib/preview/render-preview.d.ts +27 -0
  32. package/dist/lib/preview/viewer.d.ts +1 -0
  33. package/dist/lib/rig-anim.d.ts +109 -0
  34. package/dist/lib/rig-api.d.ts +26 -0
  35. package/dist/lib/rig-atlas.d.ts +20 -0
  36. package/dist/lib/rig-check.d.ts +45 -0
  37. package/dist/lib/rig-constraints.d.ts +59 -0
  38. package/dist/lib/rig-deform.d.ts +27 -0
  39. package/dist/lib/rig-format.d.ts +5036 -0
  40. package/dist/lib/rig-history.d.ts +21 -0
  41. package/dist/lib/rig-import-layers.d.ts +32 -0
  42. package/dist/lib/rig-io.d.ts +9 -0
  43. package/dist/lib/rig-mesh-image.d.ts +2 -0
  44. package/dist/lib/rig-mesh.d.ts +143 -0
  45. package/dist/lib/rig-path.d.ts +101 -0
  46. package/dist/lib/rig-presets.d.ts +101 -0
  47. package/dist/lib/rig-queue.d.ts +2 -0
  48. package/dist/lib/rig-runtime.d.ts +70 -0
  49. package/dist/lib/rig-state.d.ts +64 -0
  50. package/dist/lib/rig-symbol.d.ts +60 -0
  51. package/dist/lib/rig-template-library.d.ts +3 -0
  52. package/dist/lib/rig-templates.d.ts +46 -0
  53. package/dist/lib/rig-tools.d.ts +376 -0
  54. package/dist/lib/runtime.d.ts +9 -0
  55. package/dist/lib/runtime.js +1584 -0
  56. package/dist/lib/runtime.js.map +7 -0
  57. package/dist/lib/spine-import.d.ts +68 -0
  58. package/dist/lib/tools.d.ts +2 -0
  59. package/dist/lib/tools.js +5242 -0
  60. package/dist/lib/tools.js.map +7 -0
  61. package/editor.html +3 -0
  62. package/package.json +96 -0
@@ -0,0 +1,1053 @@
1
+ import { type Pose, type Skeleton } from "../rig-anim";
2
+ import { type Reference, type RigDocument, type Track } from "../rig-format";
3
+ import type { AnimationTemplate } from "../rig-templates";
4
+ import { type FileEntry } from "./api";
5
+ import { type Mask, type Rect } from "./atlas-detect";
6
+ export type Selection = {
7
+ kind: "bone" | "slot" | "attachment" | "vertex" | "constraint";
8
+ id: string;
9
+ index?: number;
10
+ };
11
+ export type TrackRef = {
12
+ target: Track["target"];
13
+ id: string;
14
+ prop: string;
15
+ };
16
+ /** rig path relative to the server root */
17
+ export declare const rigPath: string;
18
+ /** the rig file's directory, "" at the root — asset `src` values are relative to it */
19
+ export declare const rigDir: string;
20
+ export declare const doc: import("@preact/signals-core").Signal<{
21
+ path: {
22
+ rotation: number;
23
+ id: string;
24
+ order: number;
25
+ bones: string[];
26
+ target: string;
27
+ mixRotate: number;
28
+ mixX: number;
29
+ mixY: number;
30
+ positionMode: "fixed" | "percent";
31
+ spacingMode: "length" | "fixed" | "percent" | "proportional";
32
+ rotateMode: "tangent" | "chain" | "chainScale";
33
+ position: number;
34
+ spacing: number;
35
+ }[];
36
+ transform: {
37
+ x: number;
38
+ y: number;
39
+ rotation: number;
40
+ scaleX: number;
41
+ scaleY: number;
42
+ shearY: number;
43
+ id: string;
44
+ order: number;
45
+ bones: string[];
46
+ target: string;
47
+ local: boolean;
48
+ relative: boolean;
49
+ mixRotate: number;
50
+ mixX: number;
51
+ mixY: number;
52
+ mixScaleX: number;
53
+ mixScaleY: number;
54
+ mixShearY: number;
55
+ }[];
56
+ bones: {
57
+ length: number;
58
+ id: string;
59
+ transform: {
60
+ x: number;
61
+ y: number;
62
+ rotation: number;
63
+ scaleX: number;
64
+ scaleY: number;
65
+ shearX: number;
66
+ shearY: number;
67
+ };
68
+ inherit: "normal" | "onlyTranslation" | "noRotationOrReflection" | "noScale" | "noScaleOrReflection";
69
+ parent?: string | undefined;
70
+ role?: string | undefined;
71
+ color?: string | undefined;
72
+ }[];
73
+ ik: {
74
+ id: string;
75
+ order: number;
76
+ bones: string[];
77
+ target: string;
78
+ mix: number;
79
+ softness: number;
80
+ bendPositive: boolean;
81
+ compress: boolean;
82
+ stretch: boolean;
83
+ uniform: boolean;
84
+ }[];
85
+ format: "energy8.rig";
86
+ version: 2;
87
+ meta: {
88
+ width: number;
89
+ height: number;
90
+ name: string;
91
+ notes?: string | undefined;
92
+ reference?: {
93
+ x: number;
94
+ y: number;
95
+ src: string;
96
+ opacity: number;
97
+ scale: number;
98
+ } | undefined;
99
+ };
100
+ assets: {
101
+ id: string;
102
+ src: string;
103
+ width: number;
104
+ height: number;
105
+ rotate: 0 | 90;
106
+ frame?: [number, number, number, number] | undefined;
107
+ trim?: [number, number] | undefined;
108
+ origin?: {
109
+ inpainted: boolean;
110
+ sourceImage?: string | undefined;
111
+ bbox?: [number, number, number, number] | undefined;
112
+ prompt?: string | undefined;
113
+ } | undefined;
114
+ }[];
115
+ slots: {
116
+ id: string;
117
+ color: string;
118
+ bone: string;
119
+ alpha: number;
120
+ z: number;
121
+ blend: "normal" | "add" | "multiply" | "screen";
122
+ attachment?: string | undefined;
123
+ }[];
124
+ attachments: ({
125
+ x: number;
126
+ y: number;
127
+ type: "region";
128
+ rotation: number;
129
+ scaleX: number;
130
+ scaleY: number;
131
+ id: string;
132
+ slot: string;
133
+ asset: string;
134
+ width?: number | undefined;
135
+ height?: number | undefined;
136
+ } | {
137
+ type: "mesh";
138
+ id: string;
139
+ slot: string;
140
+ asset: string;
141
+ uvs: number[];
142
+ triangles: number[];
143
+ hull: number;
144
+ width?: number | undefined;
145
+ height?: number | undefined;
146
+ vertices?: number[] | undefined;
147
+ weights?: {
148
+ x: number;
149
+ y: number;
150
+ bone: string;
151
+ w: number;
152
+ }[][] | undefined;
153
+ } | {
154
+ type: "path";
155
+ id: string;
156
+ slot: string;
157
+ lengths: number[];
158
+ closed: boolean;
159
+ constantSpeed: boolean;
160
+ vertices?: number[] | undefined;
161
+ weights?: {
162
+ x: number;
163
+ y: number;
164
+ bone: string;
165
+ w: number;
166
+ }[][] | undefined;
167
+ })[];
168
+ animations: {
169
+ id: string;
170
+ duration: number;
171
+ loop: boolean;
172
+ tracks: ({
173
+ keys: {
174
+ t: number;
175
+ v: string | number | number[] | string[] | null;
176
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
177
+ bezier: [number, number, number, number];
178
+ };
179
+ }[];
180
+ id: string;
181
+ target: "bone";
182
+ prop: "x" | "y" | "rotation" | "scaleX" | "scaleY" | "shearX" | "shearY";
183
+ } | {
184
+ keys: {
185
+ t: number;
186
+ v: string | number | number[] | string[] | null;
187
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
188
+ bezier: [number, number, number, number];
189
+ };
190
+ }[];
191
+ id: string;
192
+ target: "slot";
193
+ prop: "color" | "attachment" | "alpha" | "z";
194
+ } | {
195
+ keys: {
196
+ t: number;
197
+ v: string | number | number[] | string[] | null;
198
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
199
+ bezier: [number, number, number, number];
200
+ };
201
+ }[];
202
+ id: string;
203
+ target: "deform";
204
+ prop: string;
205
+ } | {
206
+ keys: {
207
+ t: number;
208
+ v: string | number | number[] | string[] | null;
209
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
210
+ bezier: [number, number, number, number];
211
+ };
212
+ }[];
213
+ id: string;
214
+ target: "ik";
215
+ prop: "mix" | "softness" | "bendPositive" | "compress" | "stretch";
216
+ } | {
217
+ keys: {
218
+ t: number;
219
+ v: string | number | number[] | string[] | null;
220
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
221
+ bezier: [number, number, number, number];
222
+ };
223
+ }[];
224
+ id: string;
225
+ target: "transform";
226
+ prop: "mixRotate" | "mixX" | "mixY" | "mixScaleX" | "mixScaleY" | "mixShearY";
227
+ } | {
228
+ keys: {
229
+ t: number;
230
+ v: string | number | number[] | string[] | null;
231
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
232
+ bezier: [number, number, number, number];
233
+ };
234
+ }[];
235
+ id: string;
236
+ target: "path";
237
+ prop: "mixRotate" | "mixX" | "mixY" | "position" | "spacing";
238
+ } | {
239
+ keys: {
240
+ t: number;
241
+ v: string | number | number[] | string[] | null;
242
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
243
+ bezier: [number, number, number, number];
244
+ };
245
+ }[];
246
+ id: string;
247
+ target: "drawOrder";
248
+ prop: "order";
249
+ })[];
250
+ events: {
251
+ t: number;
252
+ name: string;
253
+ payload?: Record<string, unknown> | undefined;
254
+ }[];
255
+ preset?: {
256
+ params: Record<string, unknown>;
257
+ name: string;
258
+ } | undefined;
259
+ }[];
260
+ } | undefined>;
261
+ export declare const draft: import("@preact/signals-core").Signal<{
262
+ path: {
263
+ rotation: number;
264
+ id: string;
265
+ order: number;
266
+ bones: string[];
267
+ target: string;
268
+ mixRotate: number;
269
+ mixX: number;
270
+ mixY: number;
271
+ positionMode: "fixed" | "percent";
272
+ spacingMode: "length" | "fixed" | "percent" | "proportional";
273
+ rotateMode: "tangent" | "chain" | "chainScale";
274
+ position: number;
275
+ spacing: number;
276
+ }[];
277
+ transform: {
278
+ x: number;
279
+ y: number;
280
+ rotation: number;
281
+ scaleX: number;
282
+ scaleY: number;
283
+ shearY: number;
284
+ id: string;
285
+ order: number;
286
+ bones: string[];
287
+ target: string;
288
+ local: boolean;
289
+ relative: boolean;
290
+ mixRotate: number;
291
+ mixX: number;
292
+ mixY: number;
293
+ mixScaleX: number;
294
+ mixScaleY: number;
295
+ mixShearY: number;
296
+ }[];
297
+ bones: {
298
+ length: number;
299
+ id: string;
300
+ transform: {
301
+ x: number;
302
+ y: number;
303
+ rotation: number;
304
+ scaleX: number;
305
+ scaleY: number;
306
+ shearX: number;
307
+ shearY: number;
308
+ };
309
+ inherit: "normal" | "onlyTranslation" | "noRotationOrReflection" | "noScale" | "noScaleOrReflection";
310
+ parent?: string | undefined;
311
+ role?: string | undefined;
312
+ color?: string | undefined;
313
+ }[];
314
+ ik: {
315
+ id: string;
316
+ order: number;
317
+ bones: string[];
318
+ target: string;
319
+ mix: number;
320
+ softness: number;
321
+ bendPositive: boolean;
322
+ compress: boolean;
323
+ stretch: boolean;
324
+ uniform: boolean;
325
+ }[];
326
+ format: "energy8.rig";
327
+ version: 2;
328
+ meta: {
329
+ width: number;
330
+ height: number;
331
+ name: string;
332
+ notes?: string | undefined;
333
+ reference?: {
334
+ x: number;
335
+ y: number;
336
+ src: string;
337
+ opacity: number;
338
+ scale: number;
339
+ } | undefined;
340
+ };
341
+ assets: {
342
+ id: string;
343
+ src: string;
344
+ width: number;
345
+ height: number;
346
+ rotate: 0 | 90;
347
+ frame?: [number, number, number, number] | undefined;
348
+ trim?: [number, number] | undefined;
349
+ origin?: {
350
+ inpainted: boolean;
351
+ sourceImage?: string | undefined;
352
+ bbox?: [number, number, number, number] | undefined;
353
+ prompt?: string | undefined;
354
+ } | undefined;
355
+ }[];
356
+ slots: {
357
+ id: string;
358
+ color: string;
359
+ bone: string;
360
+ alpha: number;
361
+ z: number;
362
+ blend: "normal" | "add" | "multiply" | "screen";
363
+ attachment?: string | undefined;
364
+ }[];
365
+ attachments: ({
366
+ x: number;
367
+ y: number;
368
+ type: "region";
369
+ rotation: number;
370
+ scaleX: number;
371
+ scaleY: number;
372
+ id: string;
373
+ slot: string;
374
+ asset: string;
375
+ width?: number | undefined;
376
+ height?: number | undefined;
377
+ } | {
378
+ type: "mesh";
379
+ id: string;
380
+ slot: string;
381
+ asset: string;
382
+ uvs: number[];
383
+ triangles: number[];
384
+ hull: number;
385
+ width?: number | undefined;
386
+ height?: number | undefined;
387
+ vertices?: number[] | undefined;
388
+ weights?: {
389
+ x: number;
390
+ y: number;
391
+ bone: string;
392
+ w: number;
393
+ }[][] | undefined;
394
+ } | {
395
+ type: "path";
396
+ id: string;
397
+ slot: string;
398
+ lengths: number[];
399
+ closed: boolean;
400
+ constantSpeed: boolean;
401
+ vertices?: number[] | undefined;
402
+ weights?: {
403
+ x: number;
404
+ y: number;
405
+ bone: string;
406
+ w: number;
407
+ }[][] | undefined;
408
+ })[];
409
+ animations: {
410
+ id: string;
411
+ duration: number;
412
+ loop: boolean;
413
+ tracks: ({
414
+ keys: {
415
+ t: number;
416
+ v: string | number | number[] | string[] | null;
417
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
418
+ bezier: [number, number, number, number];
419
+ };
420
+ }[];
421
+ id: string;
422
+ target: "bone";
423
+ prop: "x" | "y" | "rotation" | "scaleX" | "scaleY" | "shearX" | "shearY";
424
+ } | {
425
+ keys: {
426
+ t: number;
427
+ v: string | number | number[] | string[] | null;
428
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
429
+ bezier: [number, number, number, number];
430
+ };
431
+ }[];
432
+ id: string;
433
+ target: "slot";
434
+ prop: "color" | "attachment" | "alpha" | "z";
435
+ } | {
436
+ keys: {
437
+ t: number;
438
+ v: string | number | number[] | string[] | null;
439
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
440
+ bezier: [number, number, number, number];
441
+ };
442
+ }[];
443
+ id: string;
444
+ target: "deform";
445
+ prop: string;
446
+ } | {
447
+ keys: {
448
+ t: number;
449
+ v: string | number | number[] | string[] | null;
450
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
451
+ bezier: [number, number, number, number];
452
+ };
453
+ }[];
454
+ id: string;
455
+ target: "ik";
456
+ prop: "mix" | "softness" | "bendPositive" | "compress" | "stretch";
457
+ } | {
458
+ keys: {
459
+ t: number;
460
+ v: string | number | number[] | string[] | null;
461
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
462
+ bezier: [number, number, number, number];
463
+ };
464
+ }[];
465
+ id: string;
466
+ target: "transform";
467
+ prop: "mixRotate" | "mixX" | "mixY" | "mixScaleX" | "mixScaleY" | "mixShearY";
468
+ } | {
469
+ keys: {
470
+ t: number;
471
+ v: string | number | number[] | string[] | null;
472
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
473
+ bezier: [number, number, number, number];
474
+ };
475
+ }[];
476
+ id: string;
477
+ target: "path";
478
+ prop: "mixRotate" | "mixX" | "mixY" | "position" | "spacing";
479
+ } | {
480
+ keys: {
481
+ t: number;
482
+ v: string | number | number[] | string[] | null;
483
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
484
+ bezier: [number, number, number, number];
485
+ };
486
+ }[];
487
+ id: string;
488
+ target: "drawOrder";
489
+ prop: "order";
490
+ })[];
491
+ events: {
492
+ t: number;
493
+ name: string;
494
+ payload?: Record<string, unknown> | undefined;
495
+ }[];
496
+ preset?: {
497
+ params: Record<string, unknown>;
498
+ name: string;
499
+ } | undefined;
500
+ }[];
501
+ } | undefined>;
502
+ export declare const shown: import("@preact/signals-core").ReadonlySignal<{
503
+ path: {
504
+ rotation: number;
505
+ id: string;
506
+ order: number;
507
+ bones: string[];
508
+ target: string;
509
+ mixRotate: number;
510
+ mixX: number;
511
+ mixY: number;
512
+ positionMode: "fixed" | "percent";
513
+ spacingMode: "length" | "fixed" | "percent" | "proportional";
514
+ rotateMode: "tangent" | "chain" | "chainScale";
515
+ position: number;
516
+ spacing: number;
517
+ }[];
518
+ transform: {
519
+ x: number;
520
+ y: number;
521
+ rotation: number;
522
+ scaleX: number;
523
+ scaleY: number;
524
+ shearY: number;
525
+ id: string;
526
+ order: number;
527
+ bones: string[];
528
+ target: string;
529
+ local: boolean;
530
+ relative: boolean;
531
+ mixRotate: number;
532
+ mixX: number;
533
+ mixY: number;
534
+ mixScaleX: number;
535
+ mixScaleY: number;
536
+ mixShearY: number;
537
+ }[];
538
+ bones: {
539
+ length: number;
540
+ id: string;
541
+ transform: {
542
+ x: number;
543
+ y: number;
544
+ rotation: number;
545
+ scaleX: number;
546
+ scaleY: number;
547
+ shearX: number;
548
+ shearY: number;
549
+ };
550
+ inherit: "normal" | "onlyTranslation" | "noRotationOrReflection" | "noScale" | "noScaleOrReflection";
551
+ parent?: string | undefined;
552
+ role?: string | undefined;
553
+ color?: string | undefined;
554
+ }[];
555
+ ik: {
556
+ id: string;
557
+ order: number;
558
+ bones: string[];
559
+ target: string;
560
+ mix: number;
561
+ softness: number;
562
+ bendPositive: boolean;
563
+ compress: boolean;
564
+ stretch: boolean;
565
+ uniform: boolean;
566
+ }[];
567
+ format: "energy8.rig";
568
+ version: 2;
569
+ meta: {
570
+ width: number;
571
+ height: number;
572
+ name: string;
573
+ notes?: string | undefined;
574
+ reference?: {
575
+ x: number;
576
+ y: number;
577
+ src: string;
578
+ opacity: number;
579
+ scale: number;
580
+ } | undefined;
581
+ };
582
+ assets: {
583
+ id: string;
584
+ src: string;
585
+ width: number;
586
+ height: number;
587
+ rotate: 0 | 90;
588
+ frame?: [number, number, number, number] | undefined;
589
+ trim?: [number, number] | undefined;
590
+ origin?: {
591
+ inpainted: boolean;
592
+ sourceImage?: string | undefined;
593
+ bbox?: [number, number, number, number] | undefined;
594
+ prompt?: string | undefined;
595
+ } | undefined;
596
+ }[];
597
+ slots: {
598
+ id: string;
599
+ color: string;
600
+ bone: string;
601
+ alpha: number;
602
+ z: number;
603
+ blend: "normal" | "add" | "multiply" | "screen";
604
+ attachment?: string | undefined;
605
+ }[];
606
+ attachments: ({
607
+ x: number;
608
+ y: number;
609
+ type: "region";
610
+ rotation: number;
611
+ scaleX: number;
612
+ scaleY: number;
613
+ id: string;
614
+ slot: string;
615
+ asset: string;
616
+ width?: number | undefined;
617
+ height?: number | undefined;
618
+ } | {
619
+ type: "mesh";
620
+ id: string;
621
+ slot: string;
622
+ asset: string;
623
+ uvs: number[];
624
+ triangles: number[];
625
+ hull: number;
626
+ width?: number | undefined;
627
+ height?: number | undefined;
628
+ vertices?: number[] | undefined;
629
+ weights?: {
630
+ x: number;
631
+ y: number;
632
+ bone: string;
633
+ w: number;
634
+ }[][] | undefined;
635
+ } | {
636
+ type: "path";
637
+ id: string;
638
+ slot: string;
639
+ lengths: number[];
640
+ closed: boolean;
641
+ constantSpeed: boolean;
642
+ vertices?: number[] | undefined;
643
+ weights?: {
644
+ x: number;
645
+ y: number;
646
+ bone: string;
647
+ w: number;
648
+ }[][] | undefined;
649
+ })[];
650
+ animations: {
651
+ id: string;
652
+ duration: number;
653
+ loop: boolean;
654
+ tracks: ({
655
+ keys: {
656
+ t: number;
657
+ v: string | number | number[] | string[] | null;
658
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
659
+ bezier: [number, number, number, number];
660
+ };
661
+ }[];
662
+ id: string;
663
+ target: "bone";
664
+ prop: "x" | "y" | "rotation" | "scaleX" | "scaleY" | "shearX" | "shearY";
665
+ } | {
666
+ keys: {
667
+ t: number;
668
+ v: string | number | number[] | string[] | null;
669
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
670
+ bezier: [number, number, number, number];
671
+ };
672
+ }[];
673
+ id: string;
674
+ target: "slot";
675
+ prop: "color" | "attachment" | "alpha" | "z";
676
+ } | {
677
+ keys: {
678
+ t: number;
679
+ v: string | number | number[] | string[] | null;
680
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
681
+ bezier: [number, number, number, number];
682
+ };
683
+ }[];
684
+ id: string;
685
+ target: "deform";
686
+ prop: string;
687
+ } | {
688
+ keys: {
689
+ t: number;
690
+ v: string | number | number[] | string[] | null;
691
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
692
+ bezier: [number, number, number, number];
693
+ };
694
+ }[];
695
+ id: string;
696
+ target: "ik";
697
+ prop: "mix" | "softness" | "bendPositive" | "compress" | "stretch";
698
+ } | {
699
+ keys: {
700
+ t: number;
701
+ v: string | number | number[] | string[] | null;
702
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
703
+ bezier: [number, number, number, number];
704
+ };
705
+ }[];
706
+ id: string;
707
+ target: "transform";
708
+ prop: "mixRotate" | "mixX" | "mixY" | "mixScaleX" | "mixScaleY" | "mixShearY";
709
+ } | {
710
+ keys: {
711
+ t: number;
712
+ v: string | number | number[] | string[] | null;
713
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
714
+ bezier: [number, number, number, number];
715
+ };
716
+ }[];
717
+ id: string;
718
+ target: "path";
719
+ prop: "mixRotate" | "mixX" | "mixY" | "position" | "spacing";
720
+ } | {
721
+ keys: {
722
+ t: number;
723
+ v: string | number | number[] | string[] | null;
724
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
725
+ bezier: [number, number, number, number];
726
+ };
727
+ }[];
728
+ id: string;
729
+ target: "drawOrder";
730
+ prop: "order";
731
+ })[];
732
+ events: {
733
+ t: number;
734
+ name: string;
735
+ payload?: Record<string, unknown> | undefined;
736
+ }[];
737
+ preset?: {
738
+ params: Record<string, unknown>;
739
+ name: string;
740
+ } | undefined;
741
+ }[];
742
+ } | undefined>;
743
+ export declare const version: import("@preact/signals-core").Signal<string>;
744
+ export declare const mode: import("@preact/signals-core").Signal<"setup" | "atlas" | "animate">;
745
+ export declare const animId: import("@preact/signals-core").Signal<string | undefined>;
746
+ export declare const time: import("@preact/signals-core").Signal<number>;
747
+ export declare const playing: import("@preact/signals-core").Signal<boolean>;
748
+ export declare const loop: import("@preact/signals-core").Signal<boolean>;
749
+ export declare const overlays: import("@preact/signals-core").Signal<string[]>;
750
+ export declare const selection: import("@preact/signals-core").Signal<Selection | undefined>;
751
+ export declare const selectedTrack: import("@preact/signals-core").Signal<TrackRef | undefined>;
752
+ export declare const selectedKeys: import("@preact/signals-core").Signal<number[]>;
753
+ /**
754
+ * Every selected vertex of the mesh being edited, in click order — the last one is `selection.index`, so this
755
+ * always contains the primary vertex while `selection.kind === "vertex"` and is empty otherwise.
756
+ */
757
+ export declare const selectedVertices: import("@preact/signals-core").Signal<number[]>;
758
+ /** draw every triangle edge of the selected mesh, whatever the zoom */
759
+ export declare const wireframe: import("@preact/signals-core").Signal<boolean>;
760
+ /** paint skinning weights on the selected mesh instead of moving things: heatmap overlay, brush, weights panel */
761
+ export declare const weightsMode: import("@preact/signals-core").Signal<boolean>;
762
+ /** the weight brush — panel state, never part of the document; `radius` is document px, `strength` per stroke step */
763
+ export declare const brush: import("@preact/signals-core").Signal<{
764
+ bone: string;
765
+ radius: number;
766
+ strength: number;
767
+ maxInfluences: number;
768
+ }>;
769
+ /** the bones `auto weights` in the weights panel offers as candidates (`defaultWeightBones` of the slot by default) */
770
+ export declare const weightCandidates: import("@preact/signals-core").Signal<string[]>;
771
+ export declare const hiddenSlots: import("@preact/signals-core").Signal<Set<string>>;
772
+ export declare const status: import("@preact/signals-core").Signal<{
773
+ text: string;
774
+ level: "info" | "warn" | "error";
775
+ }>;
776
+ export declare const online: import("@preact/signals-core").Signal<boolean>;
777
+ /** the rig file was not there at the last load — like offline until the watcher says it is back */
778
+ export declare const blocked: import("@preact/signals-core").Signal<boolean>;
779
+ /** the document on screen arrived from someone else's write → the status bar offers `rig_diff` */
780
+ export declare const externalChange: import("@preact/signals-core").Signal<boolean>;
781
+ /** the pointer in document px, undefined when it is off the scene (the Stage writes it once per frame) */
782
+ export declare const cursor: import("@preact/signals-core").Signal<{
783
+ x: number;
784
+ y: number;
785
+ } | undefined>;
786
+ /** the Stage camera's scale, mirrored here for the status bar */
787
+ export declare const zoom: import("@preact/signals-core").Signal<number>;
788
+ /** asset `src` values whose texture failed to load (the Stage fills this, the tree marks them) */
789
+ export declare const missingAssets: import("@preact/signals-core").Signal<Set<string>>;
790
+ /** what the bin needs from the Stage to drop onto it: its canvas and the screen → document conversion */
791
+ export declare const stageApi: import("@preact/signals-core").Signal<{
792
+ canvas: HTMLCanvasElement;
793
+ toDoc(sx: number, sy: number): [number, number];
794
+ } | undefined>;
795
+ /** the file is reachable and writable: no commit and no gizmo drag outside this */
796
+ export declare const editable: import("@preact/signals-core").ReadonlySignal<boolean>;
797
+ /** a pointer gesture is in progress → defer external reloads */
798
+ export declare const gesture: import("@preact/signals-core").Signal<boolean>;
799
+ /** version announced while a gesture ran */
800
+ export declare const pendingExternal: import("@preact/signals-core").Signal<string | undefined>;
801
+ /**
802
+ * A `changed` version from the watcher. Ours is ignored; one that arrives while a commit is in flight is parked
803
+ * until that commit's response says which version it wrote; anything else reloads (deferred while a gesture runs,
804
+ * so a drag is never yanked out from under the cursor).
805
+ */
806
+ export declare function noteChanged(v: string): void;
807
+ export declare const currentAnim: import("@preact/signals-core").ReadonlySignal<{
808
+ id: string;
809
+ duration: number;
810
+ loop: boolean;
811
+ tracks: ({
812
+ keys: {
813
+ t: number;
814
+ v: string | number | number[] | string[] | null;
815
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
816
+ bezier: [number, number, number, number];
817
+ };
818
+ }[];
819
+ id: string;
820
+ target: "bone";
821
+ prop: "x" | "y" | "rotation" | "scaleX" | "scaleY" | "shearX" | "shearY";
822
+ } | {
823
+ keys: {
824
+ t: number;
825
+ v: string | number | number[] | string[] | null;
826
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
827
+ bezier: [number, number, number, number];
828
+ };
829
+ }[];
830
+ id: string;
831
+ target: "slot";
832
+ prop: "color" | "attachment" | "alpha" | "z";
833
+ } | {
834
+ keys: {
835
+ t: number;
836
+ v: string | number | number[] | string[] | null;
837
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
838
+ bezier: [number, number, number, number];
839
+ };
840
+ }[];
841
+ id: string;
842
+ target: "deform";
843
+ prop: string;
844
+ } | {
845
+ keys: {
846
+ t: number;
847
+ v: string | number | number[] | string[] | null;
848
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
849
+ bezier: [number, number, number, number];
850
+ };
851
+ }[];
852
+ id: string;
853
+ target: "ik";
854
+ prop: "mix" | "softness" | "bendPositive" | "compress" | "stretch";
855
+ } | {
856
+ keys: {
857
+ t: number;
858
+ v: string | number | number[] | string[] | null;
859
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
860
+ bezier: [number, number, number, number];
861
+ };
862
+ }[];
863
+ id: string;
864
+ target: "transform";
865
+ prop: "mixRotate" | "mixX" | "mixY" | "mixScaleX" | "mixScaleY" | "mixShearY";
866
+ } | {
867
+ keys: {
868
+ t: number;
869
+ v: string | number | number[] | string[] | null;
870
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
871
+ bezier: [number, number, number, number];
872
+ };
873
+ }[];
874
+ id: string;
875
+ target: "path";
876
+ prop: "mixRotate" | "mixX" | "mixY" | "position" | "spacing";
877
+ } | {
878
+ keys: {
879
+ t: number;
880
+ v: string | number | number[] | string[] | null;
881
+ ease: "linear" | "step" | "ease_in" | "ease_out" | "ease_in_out" | "back_out" | "elastic_out" | {
882
+ bezier: [number, number, number, number];
883
+ };
884
+ }[];
885
+ id: string;
886
+ target: "drawOrder";
887
+ prop: "order";
888
+ })[];
889
+ events: {
890
+ t: number;
891
+ name: string;
892
+ payload?: Record<string, unknown> | undefined;
893
+ }[];
894
+ preset?: {
895
+ params: Record<string, unknown>;
896
+ name: string;
897
+ } | undefined;
898
+ } | undefined>;
899
+ /** pose shown when not playing: poseOf(currentAnim, time) in animate mode, rest otherwise */
900
+ export declare const pose: import("@preact/signals-core").ReadonlySignal<Pose>;
901
+ /**
902
+ * The evaluated skeleton of what is on screen — posed bone locals and world matrices, constraints applied.
903
+ * A `computed` memoizes on (shown, pose), so the Stage's gizmos and hit-tests, the properties panel and anything
904
+ * else all share one evaluation per frame instead of reaching into the Stage for it.
905
+ */
906
+ export declare const skeleton: import("@preact/signals-core").ReadonlySignal<Skeleton | undefined>;
907
+ /**
908
+ * Bone id → the constraints that WRITE that bone, in the order the solver applies them (so the last id in a list
909
+ * is the one whose value survives). The Stage reads it to refuse — or redirect — a drag the solver would overwrite.
910
+ */
911
+ export declare const drivenBy: import("@preact/signals-core").ReadonlySignal<Map<string, string[]>>;
912
+ /**
913
+ * Slot ids front-most first — the Stage's draw key: the drawOrder key at the playhead in animate, else z; ties
914
+ * break by the shown attachment's position in `d.attachments`, exactly like `Stage.drawOrder` (and the runtime,
915
+ * which sorts attachments the same way) — they never compare slots directly, so breaking ties by SLOT document
916
+ * order instead would let this list and the canvas disagree whenever two slots share a z, which the z field
917
+ * makes easy to produce. A slot showing nothing has no attachment to rank by and never draws, so its position
918
+ * among other empty/hidden slots is cosmetic: it falls back to its own slot index.
919
+ */
920
+ export declare const drawOrderFront: import("@preact/signals-core").ReadonlySignal<string[]>;
921
+ export declare function setStatus(text: string, level?: "info" | "warn" | "error"): void;
922
+ /**
923
+ * End a pointer gesture (Stage handles, timeline drags): the flag drops first, then a file change that arrived
924
+ * while the gesture ran is taken — as an *external* reload, so the status bar says so and offers the diff.
925
+ */
926
+ export declare function finishGesture(): Promise<void>;
927
+ /**
928
+ * Point the vertex selection at `indices` of one mesh (in click order) and return the selection the caller should
929
+ * store: the LAST index is the primary one, and an empty list falls back to the mesh itself. Written before
930
+ * `selection` so the effect below recognises it as the same mesh and keeps the list.
931
+ */
932
+ export declare function selectVertices(id: string, indices: number[]): Selection;
933
+ /** the mesh the selection is working on — the attachment itself, or the mesh one of whose vertices is selected */
934
+ export declare const selectedMesh: import("@preact/signals-core").ReadonlySignal<{
935
+ type: "mesh";
936
+ id: string;
937
+ slot: string;
938
+ asset: string;
939
+ uvs: number[];
940
+ triangles: number[];
941
+ hull: number;
942
+ width?: number | undefined;
943
+ height?: number | undefined;
944
+ vertices?: number[] | undefined;
945
+ weights?: {
946
+ x: number;
947
+ y: number;
948
+ bone: string;
949
+ w: number;
950
+ }[][] | undefined;
951
+ } | undefined>;
952
+ /**
953
+ * Enter or leave weights mode. Only a mesh selection can be painted, so turning it on anywhere else is refused
954
+ * (with a reason, since the key and the button are the same gesture); entering aims the brush at the mesh's own
955
+ * slot bone while it has no usable one — a bone the user picked by hand survives the next mesh — and fills the
956
+ * candidate list from the mesh's default bones whenever the mesh it was filled for is not this one.
957
+ *
958
+ * Weights mode is a SETUP tool: influences hold the vertex in each bone's local space, so painting against a
959
+ * posed skeleton would bake the pose into the file. Entering from animate switches to setup rather than refusing
960
+ * — the user asked to paint, and the rest pose is the only place that means anything.
961
+ */
962
+ export declare function setWeightsMode(on: boolean): void;
963
+ /** library templates fetched by name (`rig_get_preset`), so the panel can preview param changes locally */
964
+ export declare const templates: import("@preact/signals-core").Signal<Map<string, AnimationTemplate>>;
965
+ /**
966
+ * The library template named `name`, from the cache or from the server (read-only: `rig_get_preset` does not
967
+ * write, so it goes through `callTool` rather than `commit`). `undefined` for a built-in preset or an unknown name.
968
+ */
969
+ export declare function ensureTemplate(name: string): Promise<AnimationTemplate | undefined>;
970
+ /** the editing frame rate — the playhead snaps to this grid when stepped */
971
+ export declare const FPS = 30;
972
+ /** step the playhead by n frames, snapped to the frame grid and clamped to [0, duration]; stops playback */
973
+ export declare function stepFrames(n: number): void;
974
+ /** play/pause the current animation; with nothing to play it only warns (the Stage stops playback outside animate mode) */
975
+ export declare function togglePlay(): void;
976
+ /**
977
+ * POST a tool call; on success replaces doc/version, drops the preview it was made from, reports the tool's
978
+ * "changed:" lines. Only THAT preview is dropped: a drag started while the call was in flight owns `draft` now,
979
+ * and wiping it would snap the view back under the user's cursor.
980
+ * The call carries the version it was made against, so a write another process has moved on from is refused (409)
981
+ * instead of clobbering it — `false` comes back, with that other writer's document already on screen.
982
+ */
983
+ export declare function commit(tool: string, args: Record<string, unknown>): Promise<boolean>;
984
+ /**
985
+ * GET the document (at start and after an external change); keeps selection / animId / time when still valid.
986
+ * `external` marks a reload caused by someone else's write: it is reported, and the status bar offers the diff.
987
+ */
988
+ export declare function reload(external?: boolean): Promise<void>;
989
+ /** the bone a placed part goes on: the selected bone, else the selection's slot bone, else the root */
990
+ export declare function boneForPlacement(): string | undefined;
991
+ /** `rig_place_asset` at a document point; placement is a setup property, so animate refuses with a reason */
992
+ export declare function placeAsset(asset: string, x: number, y: number, bone?: string | undefined): Promise<void>;
993
+ /** the bone tool: a press is the joint, a drag the direction and length; a selected part re-binds onto the new bone */
994
+ export declare const boneTool: import("@preact/signals-core").Signal<boolean>;
995
+ export declare function setBoneTool(on: boolean): void;
996
+ /**
997
+ * The bone a drag from `from` to `to` (document points) describes, committed: under the selected bone, or the
998
+ * selected part's bone (which then re-binds onto the new one), or the root. The id is asked for, like the tree's
999
+ * "add child bone".
1000
+ */
1001
+ export declare function placeBone(from: [number, number], to: [number, number]): Promise<void>;
1002
+ /** clicks on images select their slot's bone instead — the images are "locked", as Spine puts it */
1003
+ export declare const lockImages: import("@preact/signals-core").Signal<boolean>;
1004
+ /** collapsed panel sections by id */
1005
+ export declare const sections: import("@preact/signals-core").Signal<Record<string, boolean>>;
1006
+ export declare function toggleSection(id: string): void;
1007
+ /** the PNGs beside the rig (`/api/files`); refreshed after an upload and on every reload */
1008
+ export declare const files: import("@preact/signals-core").Signal<FileEntry[]>;
1009
+ export declare function refreshFiles(): Promise<void>;
1010
+ /** a prompted id, or undefined when the user cancelled or typed something the format would reject */
1011
+ export declare function askId(what: string, suggestion?: string): string | undefined;
1012
+ /** `Sheet-01.png` → `sheet_01`; an id the format accepts, from a file name */
1013
+ export declare const idFromFile: (name: string) => string;
1014
+ /** a reference underlay fitted inside the canvas and centred: `{src, opacity 0.5, x, y, scale}` */
1015
+ export declare function fitReference(d: RigDocument, f: FileEntry): Reference;
1016
+ export declare const atlasSrc: import("@preact/signals-core").Signal<string | undefined>;
1017
+ /** the alpha of the open sheet — the AtlasView fills it once the image is decoded */
1018
+ export declare const atlasMask: import("@preact/signals-core").Signal<Mask | undefined>;
1019
+ /** the open sheet could not be decoded (the AtlasView says why) — so an empty `atlasMask` is not "still loading" */
1020
+ export declare const atlasFailed: import("@preact/signals-core").Signal<boolean>;
1021
+ /** rectangles detected or drawn but not yet named — editor memory, per sheet, for this page's lifetime */
1022
+ export declare const proposed: import("@preact/signals-core").Signal<{
1023
+ key: string;
1024
+ rect: Rect;
1025
+ }[]>;
1026
+ /** keys: an asset id, or a proposed `p<n>` */
1027
+ export declare const atlasSelected: import("@preact/signals-core").Signal<string[]>;
1028
+ /** drawn and resized rectangles shrink to the opaque pixels inside them */
1029
+ export declare const snap: import("@preact/signals-core").Signal<boolean>;
1030
+ export declare const detectGap: import("@preact/signals-core").Signal<number>;
1031
+ export declare const detectMinArea: import("@preact/signals-core").Signal<number>;
1032
+ export type AtlasRect = {
1033
+ key: string;
1034
+ id?: string;
1035
+ rect: Rect;
1036
+ };
1037
+ /** named rectangles are the document's framed assets of this sheet; proposed ones follow */
1038
+ export declare const atlasRects: import("@preact/signals-core").ReadonlySignal<AtlasRect[]>;
1039
+ /** show `src` in atlas mode; another sheet's proposals are parked under its name and come back with it */
1040
+ export declare function openAtlas(src: string): void;
1041
+ export declare function addProposed(rect: Rect): string;
1042
+ /** islands of the open sheet → the proposal list (named rectangles stay; islands inside one are not proposed) */
1043
+ export declare function runDetect(): void;
1044
+ /** `snap`: shrink to the opaque pixels inside; undefined = nothing opaque there */
1045
+ export declare function snapped(rect: Rect): Rect | undefined;
1046
+ export declare function setRect(key: string, rect: Rect): Promise<void>;
1047
+ /** a proposed rectangle becomes an asset of the sheet (and leaves the proposals); a named one is renamed */
1048
+ export declare function nameRect(key: string, id: string): Promise<void>;
1049
+ export declare function removeRect(key: string): Promise<void>;
1050
+ /** Delete: every selected rectangle, one commit at a time so each write builds on the last */
1051
+ export declare function removeSelectedRects(): Promise<void>;
1052
+ /** the selected rectangles become their union — the first named one keeps its name, the others go */
1053
+ export declare function mergeSelected(): Promise<void>;