moonscratch 0.1.0-alpha.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 (151) hide show
  1. package/.agents/skills/moonbit-agent-guide/LICENSE +202 -0
  2. package/.agents/skills/moonbit-agent-guide/SKILL.mbt.md +1126 -0
  3. package/.agents/skills/moonbit-agent-guide/SKILL.md +1126 -0
  4. package/.agents/skills/moonbit-agent-guide/ide.md +116 -0
  5. package/.agents/skills/moonbit-agent-guide/references/advanced-moonbit-build.md +106 -0
  6. package/.agents/skills/moonbit-agent-guide/references/moonbit-language-fundamentals.mbt.md +422 -0
  7. package/.agents/skills/moonbit-agent-guide/references/moonbit-language-fundamentals.md +422 -0
  8. package/.agents/skills/moonbit-practice/SKILL.md +258 -0
  9. package/.agents/skills/moonbit-practice/assets/ci.yaml +25 -0
  10. package/.agents/skills/moonbit-practice/reference/agents.md +1469 -0
  11. package/.agents/skills/moonbit-practice/reference/configuration.md +228 -0
  12. package/.agents/skills/moonbit-practice/reference/ffi.md +229 -0
  13. package/.agents/skills/moonbit-practice/reference/ide.md +189 -0
  14. package/.agents/skills/moonbit-practice/reference/performance.md +217 -0
  15. package/.agents/skills/moonbit-practice/reference/refactor.md +154 -0
  16. package/.agents/skills/moonbit-practice/reference/stdlib.md +351 -0
  17. package/.agents/skills/moonbit-practice/reference/testing.md +228 -0
  18. package/.agents/skills/moonbit-refactoring/LICENSE +21 -0
  19. package/.agents/skills/moonbit-refactoring/SKILL.md +323 -0
  20. package/.githooks/README.md +23 -0
  21. package/.githooks/pre-commit +3 -0
  22. package/.github/workflows/copilot-setup-steps.yml +40 -0
  23. package/.turbo/turbo-typecheck.log +2 -0
  24. package/AGENTS.md +91 -0
  25. package/LICENSE +21 -0
  26. package/PLAN.md +64 -0
  27. package/README.mbt.md +77 -0
  28. package/README.md +84 -0
  29. package/TODO.md +120 -0
  30. package/a.png +0 -0
  31. package/benchmarks/calc.bench.ts +144 -0
  32. package/benchmarks/draw.bench.ts +215 -0
  33. package/benchmarks/load.bench.ts +28 -0
  34. package/benchmarks/render.bench.ts +53 -0
  35. package/benchmarks/run.bench.ts +8 -0
  36. package/benchmarks/types.d.ts +15 -0
  37. package/docs/scratch-vm-specs/eventloop.md +103 -0
  38. package/docs/scratch-vm-specs/moonscratch-time-separation.md +50 -0
  39. package/index.html +91 -0
  40. package/js/AGENTS.md +5 -0
  41. package/js/a.ts +52 -0
  42. package/js/assets/AGENTS.md +5 -0
  43. package/js/assets/base64.test.ts +14 -0
  44. package/js/assets/base64.ts +21 -0
  45. package/js/assets/build-asset.test.ts +26 -0
  46. package/js/assets/build-asset.ts +28 -0
  47. package/js/assets/create.test.ts +142 -0
  48. package/js/assets/create.ts +122 -0
  49. package/js/assets/index.test.ts +15 -0
  50. package/js/assets/index.ts +2 -0
  51. package/js/assets/types.ts +26 -0
  52. package/js/assets/validation.test.ts +34 -0
  53. package/js/assets/validation.ts +25 -0
  54. package/js/assets.test.ts +14 -0
  55. package/js/assets.ts +1 -0
  56. package/js/index.test.ts +26 -0
  57. package/js/index.ts +3 -0
  58. package/js/render/index.test.ts +65 -0
  59. package/js/render/index.ts +13 -0
  60. package/js/render/sharp.ts +87 -0
  61. package/js/render/svg.ts +68 -0
  62. package/js/render/types.ts +35 -0
  63. package/js/render/utils.ts +108 -0
  64. package/js/render/webgl.ts +274 -0
  65. package/js/sharp-optional.d.ts +16 -0
  66. package/js/test/helpers.ts +116 -0
  67. package/js/test/hikkaku-sample.test.ts +37 -0
  68. package/js/test/rubik-components.input-motion.test.ts +60 -0
  69. package/js/test/rubik-components.lists.test.ts +49 -0
  70. package/js/test/rubik-components.operators.test.ts +104 -0
  71. package/js/test/rubik-components.pen.test.ts +112 -0
  72. package/js/test/rubik-components.procedures-loops.test.ts +72 -0
  73. package/js/test/rubik-components.variables-branches.test.ts +57 -0
  74. package/js/test/rubik-components.visibility-entry.test.ts +31 -0
  75. package/js/test/test-projects.ts +598 -0
  76. package/js/test/variable.ts +200 -0
  77. package/js/test/warp.test.ts +59 -0
  78. package/js/vm/AGENTS.md +6 -0
  79. package/js/vm/README.md +183 -0
  80. package/js/vm/bindings.test.ts +13 -0
  81. package/js/vm/bindings.ts +5 -0
  82. package/js/vm/compare-operators.test.ts +145 -0
  83. package/js/vm/constants.test.ts +11 -0
  84. package/js/vm/constants.ts +4 -0
  85. package/js/vm/effect-guards.test.ts +68 -0
  86. package/js/vm/effect-guards.ts +44 -0
  87. package/js/vm/factory.test.ts +486 -0
  88. package/js/vm/factory.ts +615 -0
  89. package/js/vm/headless-vm.test.ts +131 -0
  90. package/js/vm/headless-vm.ts +342 -0
  91. package/js/vm/index.test.ts +28 -0
  92. package/js/vm/index.ts +5 -0
  93. package/js/vm/internal-types.ts +32 -0
  94. package/js/vm/json.test.ts +40 -0
  95. package/js/vm/json.ts +273 -0
  96. package/js/vm/normalize.test.ts +48 -0
  97. package/js/vm/normalize.ts +65 -0
  98. package/js/vm/options.test.ts +30 -0
  99. package/js/vm/options.ts +55 -0
  100. package/js/vm/pen-transparency.test.ts +115 -0
  101. package/js/vm/program-wasm.ts +322 -0
  102. package/js/vm/scheduler-render.test.ts +401 -0
  103. package/js/vm/scratch-assets.test.ts +136 -0
  104. package/js/vm/scratch-assets.ts +202 -0
  105. package/js/vm/types.ts +358 -0
  106. package/js/vm/value-guards.test.ts +25 -0
  107. package/js/vm/value-guards.ts +18 -0
  108. package/moon.mod.json +10 -0
  109. package/package.json +33 -0
  110. package/scripts/preinstall.ts +4 -0
  111. package/src/AGENTS.md +6 -0
  112. package/src/api.mbt +161 -0
  113. package/src/api_aot_commands.mbt +184 -0
  114. package/src/api_effects_json.mbt +72 -0
  115. package/src/api_options.mbt +60 -0
  116. package/src/api_program_wasm.mbt +1647 -0
  117. package/src/api_program_wat.mbt +2206 -0
  118. package/src/api_snapshot_json.mbt +44 -0
  119. package/src/cmd/AGENTS.md +5 -0
  120. package/src/cmd/main/AGENTS.md +5 -0
  121. package/src/cmd/main/main.mbt +29 -0
  122. package/src/cmd/main/moon.pkg +7 -0
  123. package/src/cmd/main/pkg.generated.mbti +13 -0
  124. package/src/json_helpers.mbt +176 -0
  125. package/src/moon.pkg +65 -0
  126. package/src/moonscratch.mbt +3 -0
  127. package/src/moonscratch_wbtest.mbt +40 -0
  128. package/src/parser_sb3.mbt +890 -0
  129. package/src/pkg.generated.mbti +479 -0
  130. package/src/runtime_eval.mbt +2844 -0
  131. package/src/runtime_exec.mbt +3850 -0
  132. package/src/runtime_render.mbt +2550 -0
  133. package/src/runtime_state.mbt +870 -0
  134. package/src/test/AGENTS.md +3 -0
  135. package/src/test/projects/AGENTS.md +6 -0
  136. package/src/test/projects/moon.pkg +4 -0
  137. package/src/test/projects/moonscratch_compat_test.mbt +642 -0
  138. package/src/test/projects/moonscratch_core_test.mbt +1332 -0
  139. package/src/test/projects/moonscratch_runtime_test.mbt +1087 -0
  140. package/src/test/projects/pkg.generated.mbti +13 -0
  141. package/src/test/projects/test_support.mbt +35 -0
  142. package/src/types_effects.mbt +20 -0
  143. package/src/types_error.mbt +4 -0
  144. package/src/types_options.mbt +31 -0
  145. package/src/types_runtime_structs.mbt +254 -0
  146. package/src/types_vm.mbt +109 -0
  147. package/tsconfig.json +29 -0
  148. package/viewer/index.ts +399 -0
  149. package/viewer/vite.d.ts +1 -0
  150. package/viewer/worker.ts +161 -0
  151. package/vite.config.ts +11 -0
@@ -0,0 +1,13 @@
1
+ // Generated using `moon info`, DON'T EDIT IT
2
+ package "nakasyou/moonscratch/test/projects"
3
+
4
+ // Values
5
+
6
+ // Errors
7
+
8
+ // Types and methods
9
+
10
+ // Type aliases
11
+
12
+ // Traits
13
+
@@ -0,0 +1,35 @@
1
+ ///|
2
+ fn _test_dependency_probe() -> Unit {
3
+ let minimal_project =
4
+ #|{
5
+ #| "targets": [
6
+ #| {
7
+ #| "isStage": true,
8
+ #| "name": "Stage",
9
+ #| "variables": {},
10
+ #| "lists": {},
11
+ #| "blocks": {}
12
+ #| }
13
+ #| ]
14
+ #|}
15
+ ignore(try? @json.parse("null"))
16
+ ignore(try? vm_new_precompiled_from_json(minimal_project))
17
+ }
18
+
19
+ ///|
20
+ fn vm_new_precompiled_from_json(
21
+ project_json : String,
22
+ assets_json? : String,
23
+ options_json? : String,
24
+ ) -> @moonscratch.Vm raise @moonscratch.VmError {
25
+ let precompiled = match assets_json {
26
+ Some(assets_json) =>
27
+ @moonscratch.vm_compile_from_json(project_json, assets_json~)
28
+ None => @moonscratch.vm_compile_from_json(project_json)
29
+ }
30
+ match options_json {
31
+ Some(options_json) =>
32
+ @moonscratch.vm_new_from_compiled(precompiled, options_json~)
33
+ None => @moonscratch.vm_new_from_compiled(precompiled)
34
+ }
35
+ }
@@ -0,0 +1,20 @@
1
+ ///|
2
+ pub enum HostEffect {
3
+ PlaySound(String, String)
4
+ PlayNote(String, Int, Double, Int, Double)
5
+ PlayDrum(String, Int, Double, Double)
6
+ TextToSpeech(String, String, String, String, String)
7
+ TranslateRequest(String, String)
8
+ StopAllSounds
9
+ Say(String, String)
10
+ Think(String, String)
11
+ Ask(String)
12
+ Broadcast(String)
13
+ Log(String, String)
14
+ } derive(Show, Eq, ToJson)
15
+
16
+ ///|
17
+ pub enum ControlFrameKind {
18
+ Repeat
19
+ Forever
20
+ } derive(Show, Eq, ToJson)
@@ -0,0 +1,4 @@
1
+ ///|
2
+ pub suberror VmError {
3
+ InvalidProject(String)
4
+ }
@@ -0,0 +1,31 @@
1
+ ///|
2
+ pub(all) struct ProjectBundle {
3
+ project_json : String
4
+ assets : Map[String, Json]
5
+ } derive(Show, Eq, ToJson)
6
+
7
+ ///|
8
+ pub(all) struct VmOptions {
9
+ mut turbo : Bool
10
+ mut compatibility_30tps : Bool
11
+ mut max_clones : Int
12
+ mut deterministic : Bool
13
+ mut seed : Int
14
+ mut pen_width : Int
15
+ mut pen_height : Int
16
+ mut step_timeout_ticks : Int
17
+ } derive(Show, Eq, ToJson)
18
+
19
+ ///|
20
+ pub fn default_vm_options() -> VmOptions {
21
+ {
22
+ turbo: false,
23
+ compatibility_30tps: false,
24
+ max_clones: 300,
25
+ deterministic: false,
26
+ seed: 0x1234_5678,
27
+ pen_width: 480,
28
+ pen_height: 360,
29
+ step_timeout_ticks: 2048,
30
+ }
31
+ }
@@ -0,0 +1,254 @@
1
+ ///|
2
+ pub(all) struct ControlFrame {
3
+ kind : ControlFrameKind
4
+ mut remaining : Int
5
+ substack : Int?
6
+ after : Int?
7
+ } derive(Show, Eq, ToJson)
8
+
9
+ ///|
10
+ pub(all) enum OpcodeTag {
11
+ Unknown
12
+ MotionChangeXBy
13
+ MotionChangeYBy
14
+ MotionSetY
15
+ PenPenDown
16
+ PenPenUp
17
+ ControlRepeat
18
+ ControlRepeatUntil
19
+ ControlIf
20
+ DataSetVariableTo
21
+ DataChangeVariableBy
22
+ } derive(Show, Eq, ToJson)
23
+
24
+ ///|
25
+ pub(all) struct ScratchBlock {
26
+ id : String
27
+ opcode : String
28
+ opcode_tag : OpcodeTag
29
+ next : String?
30
+ parent : String?
31
+ inputs : Map[String, Json]
32
+ const_number_inputs : Map[String, Double]
33
+ input_block_ids : Map[String, String]
34
+ fields : Map[String, Json]
35
+ mutation : Map[String, Json]
36
+ top_level : Bool
37
+ } derive(Show, Eq, ToJson)
38
+
39
+ ///|
40
+ pub(all) struct BlockFieldRef {
41
+ name : String
42
+ id : String?
43
+ } derive(Show, Eq, ToJson)
44
+
45
+ ///|
46
+ pub(all) struct BlockFastMeta {
47
+ next_pc : Int?
48
+ substack_pc : Int?
49
+ substack2_pc : Int?
50
+ variable : BlockFieldRef?
51
+ list : BlockFieldRef?
52
+ } derive(Show, Eq, ToJson)
53
+
54
+ ///|
55
+ pub(all) enum NumericReporterOp {
56
+ PushConst(Double)
57
+ LoadVariable(String, String)
58
+ LoadVariableByRef(Int, String, Int?)
59
+ Add
60
+ Subtract
61
+ Multiply
62
+ Divide
63
+ Mod
64
+ Round
65
+ MathOp(String)
66
+ LoadXPosition
67
+ LoadYPosition
68
+ LoadDirection
69
+ LoadSize
70
+ LoadVolume
71
+ LoadTempo
72
+ LoadTimer
73
+ LoadMouseX
74
+ LoadMouseY
75
+ LoadControlCounter
76
+ } derive(Show, Eq)
77
+
78
+ ///|
79
+ pub(all) struct NumericReporterProgram {
80
+ ops : Array[NumericReporterOp]
81
+ } derive(Show, Eq)
82
+
83
+ ///|
84
+ pub(all) struct CompareNumericGuard {
85
+ owner_kind : Int
86
+ variable_id : String
87
+ slot : Int?
88
+ } derive(Show, Eq)
89
+
90
+ ///|
91
+ pub(all) enum BoolReporterOp {
92
+ CompareLt(Int, Int, Bool, CompareNumericGuard?, CompareNumericGuard?)
93
+ CompareGt(Int, Int, Bool, CompareNumericGuard?, CompareNumericGuard?)
94
+ CompareEq(Int, Int, Bool, CompareNumericGuard?, CompareNumericGuard?)
95
+ And
96
+ Or
97
+ Not
98
+ } derive(Show, Eq)
99
+
100
+ ///|
101
+ pub(all) struct BoolReporterProgram {
102
+ numeric_programs : Array[NumericReporterProgram]
103
+ ops : Array[BoolReporterOp]
104
+ } derive(Show, Eq)
105
+
106
+ ///|
107
+ pub(all) struct ProcedureSpec {
108
+ start_block : String
109
+ param_names : Array[String]
110
+ param_ids : Array[String]
111
+ param_defaults : Array[Json]
112
+ warp_mode : Bool
113
+ } derive(Show, Eq)
114
+
115
+ ///|
116
+ pub(all) enum PredicateHatKind {
117
+ WhenGreaterThan
118
+ WhenTouchingObject
119
+ }
120
+
121
+ ///|
122
+ pub(all) struct KeyPressedHatStart {
123
+ key_option : String
124
+ start_block : String
125
+ }
126
+
127
+ ///|
128
+ pub(all) struct BroadcastHatStart {
129
+ message : String
130
+ start_block : String
131
+ }
132
+
133
+ ///|
134
+ pub(all) struct BackdropHatStart {
135
+ backdrop_name : String
136
+ start_block : String
137
+ }
138
+
139
+ ///|
140
+ pub(all) struct PredicateHatStart {
141
+ kind : PredicateHatKind
142
+ hat_id : String
143
+ menu : String
144
+ start_block : String
145
+ }
146
+
147
+ ///|
148
+ pub(all) struct CostumeImage {
149
+ name : String
150
+ asset_id : String
151
+ bitmap_resolution : Int
152
+ rotation_center_x : Double
153
+ rotation_center_y : Double
154
+ width : Int
155
+ height : Int
156
+ pixels : Array[Byte]
157
+ }
158
+
159
+ ///|
160
+ pub(all) struct TargetState {
161
+ id : String
162
+ name : String
163
+ is_stage : Bool
164
+ is_original : Bool
165
+ mut deleted : Bool
166
+ mut x : Double
167
+ mut y : Double
168
+ mut direction : Double
169
+ mut size : Double
170
+ mut volume : Double
171
+ mut music_instrument : Int
172
+ mut tts_voice : String
173
+ mut visible : Bool
174
+ mut current_costume : Int
175
+ costume_names : Array[String]
176
+ costumes : Array[CostumeImage]
177
+ mut pen_down : Bool
178
+ mut pen_color : Double
179
+ mut pen_saturation : Double
180
+ mut pen_brightness : Double
181
+ mut pen_transparency : Double
182
+ mut pen_size : Double
183
+ mut pen_legacy_shade : Double
184
+ mut looks_effect_color : Double
185
+ mut looks_effect_fisheye : Double
186
+ mut looks_effect_whirl : Double
187
+ mut looks_effect_pixelate : Double
188
+ mut looks_effect_mosaic : Double
189
+ mut looks_effect_brightness : Double
190
+ mut looks_effect_ghost : Double
191
+ variables : Map[String, Json]
192
+ variable_names : Map[String, String]
193
+ variable_slot_by_id : Map[String, Int]
194
+ variable_slot_by_name : Map[String, Int]
195
+ variable_id_by_slot : Array[String]
196
+ mut variable_values : Array[Json]
197
+ mut variable_numeric_flags : Array[Bool]
198
+ lists : Map[String, Array[Json]]
199
+ list_names : Map[String, String]
200
+ list_slot_by_id : Map[String, Int]
201
+ list_slot_by_name : Map[String, Int]
202
+ list_id_by_slot : Array[String]
203
+ mut list_values : Array[Array[Json]]
204
+ blocks : Map[String, ScratchBlock]
205
+ const_number_block_values : Map[String, Double]
206
+ procedures : Map[String, ProcedureSpec]
207
+ block_pc_by_id : Map[String, Int]
208
+ blocks_by_pc : Array[ScratchBlock]
209
+ block_fast_meta_by_pc : Array[BlockFastMeta]
210
+ mut numeric_program_cache : Map[String, NumericReporterProgram]
211
+ mut numeric_program_compile_failed : Map[String, Bool]
212
+ mut bool_program_cache : Map[String, BoolReporterProgram]
213
+ mut bool_program_compile_failed : Map[String, Bool]
214
+ top_level_hats : Array[String]
215
+ green_flag_starts : Array[String]
216
+ stage_clicked_starts : Array[String]
217
+ sprite_clicked_starts : Array[String]
218
+ clone_start_starts : Array[String]
219
+ key_pressed_hats : Array[KeyPressedHatStart]
220
+ broadcast_hats : Array[BroadcastHatStart]
221
+ backdrop_hats : Array[BackdropHatStart]
222
+ predicate_hats : Array[PredicateHatStart]
223
+ }
224
+
225
+ ///|
226
+ pub(all) struct RenderFrame {
227
+ width : Int
228
+ height : Int
229
+ pixels : Array[Byte]
230
+ }
231
+
232
+ ///|
233
+ pub(all) struct Thread {
234
+ id : Int
235
+ target_index : Int
236
+ mut pc : Int?
237
+ mut wait_until_ms : Int?
238
+ mut wait_for_input : String?
239
+ mut done : Bool
240
+ mut warp_mode : Bool
241
+ mut warp_started_ms : Int
242
+ mut stack : Array[ControlFrame]
243
+ mut loop_counters : Map[String, Int]
244
+ parent_waiter : Int?
245
+ }
246
+
247
+ ///|
248
+ pub(all) struct ProcedureFrame {
249
+ return_pc : Int?
250
+ control_depth : Int
251
+ params : Map[String, Json]
252
+ proccode : String
253
+ mut warp_mode : Bool
254
+ }
@@ -0,0 +1,109 @@
1
+ ///|
2
+ pub(all) struct PrecompiledProject {
3
+ targets : Array[TargetState]
4
+ stage_index : Int
5
+ assets : Map[String, Json]
6
+ mut initial_opaque_backdrops : Map[String, Array[Byte]]
7
+ }
8
+
9
+ ///|
10
+ pub(all) struct PenVectorStroke {
11
+ x0 : Double
12
+ y0 : Double
13
+ x1 : Double
14
+ y1 : Double
15
+ diameter : Double
16
+ offset : Double
17
+ r : Int
18
+ g : Int
19
+ b : Int
20
+ a : Int
21
+ }
22
+
23
+ ///|
24
+ pub(all) struct Vm {
25
+ targets : Array[TargetState]
26
+ stage_index : Int
27
+ assets : Map[String, Json]
28
+ options : VmOptions
29
+ pen_width : Int
30
+ pen_height : Int
31
+ mut pen_pixels : Array[Byte]
32
+ mut pen_vectors : Array[PenVectorStroke]
33
+ mut render_revision : Int
34
+ mut render_cache_valid : Bool
35
+ mut render_cache_revision : Int
36
+ mut render_cache_pixels : Array[Byte]
37
+ mut pen_bounds_valid : Bool
38
+ mut pen_min_x : Int
39
+ mut pen_min_y : Int
40
+ mut pen_max_x : Int
41
+ mut pen_max_y : Int
42
+ mut backdrop_cache_valid : Bool
43
+ mut backdrop_cache_pixels : Array[Byte]
44
+ mut backdrop_cache_width : Int
45
+ mut backdrop_cache_height : Int
46
+ mut backdrop_cache_stage_index : Int
47
+ mut backdrop_cache_stage_costume_index : Int
48
+ mut backdrop_cache_effect_color : Double
49
+ mut backdrop_cache_effect_fisheye : Double
50
+ mut backdrop_cache_effect_whirl : Double
51
+ mut backdrop_cache_effect_pixelate : Double
52
+ mut backdrop_cache_effect_mosaic : Double
53
+ mut backdrop_cache_effect_brightness : Double
54
+ mut backdrop_cache_effect_ghost : Double
55
+ mut threads : Array[Thread]
56
+ mut next_thread_id : Int
57
+ mut run_id : Int
58
+ mut now_ms : Int
59
+ mut running : Bool
60
+ mut answer : String
61
+ mut effects : Array[HostEffect]
62
+ mut io_state : Map[String, Json]
63
+ mut io_prev_state : Map[String, Json]
64
+ mut waiting_children : Map[Int, Int]
65
+ mut rng_state : Int
66
+ mut control_counter : Int
67
+ mut hot_op_counts : Map[String, Int]
68
+ mut next_clone_id : Int
69
+ mut hat_predicates : Map[String, Bool]
70
+ mut timer_start_ms : Int
71
+ mut music_tempo : Double
72
+ mut tts_language : String
73
+ mut procedure_frames : Map[Int, Array[ProcedureFrame]]
74
+ mut pending_translate_requests : Map[String, Bool]
75
+ mut redraw_requested : Bool
76
+ mut redraw_requested_while_warp : Bool
77
+ mut current_thread_id : Int?
78
+ mut mathop_sin_cache_valid : Bool
79
+ mut mathop_sin_cache_input : Double
80
+ mut mathop_sin_cache_output : Double
81
+ mut mathop_cos_cache_valid : Bool
82
+ mut mathop_cos_cache_input : Double
83
+ mut mathop_cos_cache_output : Double
84
+ mut aot_commands : Array[AotCommand]
85
+ mut aot_pending : Bool
86
+ mut aot_full_green_flag_starts : Map[Int, Array[Int]]
87
+ mut aot_use_full_exec : Bool
88
+ mut aot_wasm_only : Bool
89
+ mut frame_override : FrameReport?
90
+ }
91
+
92
+ ///|
93
+ pub(all) struct FrameReport {
94
+ active_threads : Int
95
+ tick_count : Int
96
+ op_count : Int
97
+ emitted_effects : Int
98
+ stop_reason : String
99
+ should_render : Bool
100
+ is_in_warp : Bool
101
+ } derive(Show, Eq, ToJson)
102
+
103
+ ///|
104
+ pub(all) enum AotCommand {
105
+ SetVariable(Int, String, Json)
106
+ ChangeVariable(Int, String, Double)
107
+ HostOpcode(Int, Int)
108
+ HostTail(Int, Int)
109
+ } derive(Show, Eq, ToJson)
package/tsconfig.json ADDED
@@ -0,0 +1,29 @@
1
+ {
2
+ "compilerOptions": {
3
+ // Environment setup & latest features
4
+ "lib": ["ESNext", "DOM"],
5
+ "target": "ESNext",
6
+ "module": "Preserve",
7
+ "moduleDetection": "force",
8
+ "jsx": "react-jsx",
9
+ "allowJs": true,
10
+
11
+ // Bundler mode
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "verbatimModuleSyntax": true,
15
+ "noEmit": true,
16
+
17
+ // Best practices
18
+ "strict": true,
19
+ "skipLibCheck": true,
20
+ "noFallthroughCasesInSwitch": true,
21
+ "noUncheckedIndexedAccess": true,
22
+ "noImplicitOverride": true,
23
+
24
+ // Some stricter flags (disabled by default)
25
+ "noUnusedLocals": false,
26
+ "noUnusedParameters": false,
27
+ "noPropertyAccessFromIndexSignature": false
28
+ }
29
+ }