@typecad/cuttlefish 1.0.0-alpha.13 → 1.0.0-alpha.15

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 (343) hide show
  1. package/README.md +82 -79
  2. package/assets/editor-extensions/typecad-debug/README.md +141 -0
  3. package/assets/editor-extensions/typecad-debug/out/extension.js +347 -0
  4. package/assets/editor-extensions/typecad-debug/out/extension.js.map +1 -0
  5. package/assets/editor-extensions/typecad-debug/package.json +76 -0
  6. package/assets/editor-extensions/typecad-ui/LICENSE +27 -0
  7. package/assets/editor-extensions/typecad-ui/README.md +52 -0
  8. package/assets/editor-extensions/typecad-ui/file-icon-dark.png +0 -0
  9. package/assets/editor-extensions/typecad-ui/file-icon-light.png +0 -0
  10. package/assets/editor-extensions/typecad-ui/icon.png +0 -0
  11. package/assets/editor-extensions/typecad-ui/language-configuration.json +43 -0
  12. package/assets/editor-extensions/typecad-ui/package.json +54 -0
  13. package/assets/editor-extensions/typecad-ui/snippets/typecad-ui.json +80 -0
  14. package/assets/editor-extensions/typecad-ui/syntaxes/markdown-ui.json +45 -0
  15. package/assets/editor-extensions/typecad-ui/syntaxes/typecad-ui.tmLanguage.json +1269 -0
  16. package/dist/api/config.d.ts +30 -27
  17. package/dist/api/schema/types.d.ts +20 -3
  18. package/dist/api/shared/async-runtime-static.d.ts +1 -1
  19. package/dist/api/shared/async-runtime-static.js +5 -5
  20. package/dist/api/shared/async-types.d.ts +3 -2
  21. package/dist/api/shared/board-catalog.d.ts +2 -0
  22. package/dist/api/shared/board-catalog.js +6 -0
  23. package/dist/api/shared/board-resolver.d.ts +4 -7
  24. package/dist/api/shared/board-resolver.js +2 -1
  25. package/dist/api/shared/coop-scheduler.d.ts +1 -1
  26. package/dist/api/shared/coop-scheduler.js +1 -1
  27. package/dist/api/shared/cpp-type-ir.d.ts +1 -1
  28. package/dist/api/shared/cpp-type-ir.js +1 -1
  29. package/dist/api/shared/display-profile.d.ts +1 -1
  30. package/dist/api/shared/display-profile.js +3 -5
  31. package/dist/api/shared/framework-manifest-registry.d.ts +1 -1
  32. package/dist/api/shared/framework-manifest-registry.js +0 -1
  33. package/dist/api/shared/framework-manifest.d.ts +65 -507
  34. package/dist/api/shared/framework-manifest.js +6 -11
  35. package/dist/api/shared/hal-op-ir.d.ts +294 -685
  36. package/dist/api/shared/hal-op-ir.js +31 -65
  37. package/dist/api/shared/index.d.ts +0 -4
  38. package/dist/api/shared/index.js +1 -7
  39. package/dist/api/shared/ir-core.d.ts +6 -0
  40. package/dist/api/shared/ir-declarations.d.ts +4 -0
  41. package/dist/api/shared/ir.d.ts +1 -3
  42. package/dist/api/shared/platform-strategy.d.ts +14 -37
  43. package/dist/api/shared/polyfill-helper-registry.js +0 -5
  44. package/dist/api/shared/polyfill-types.js +0 -27
  45. package/dist/api/shared/promise-runtime.js +3 -3
  46. package/dist/api/shared/spdx-licenses.d.ts +12 -10
  47. package/dist/api/shared/spdx-licenses.js +1 -1
  48. package/dist/api/shared/toolchain-types.d.ts +1 -1
  49. package/dist/api/shared/toolchain-types.js +3 -3
  50. package/dist/api/shared/types.d.ts +0 -3
  51. package/dist/api/shared/validate-framework-manifest.js +13 -33
  52. package/dist/board-catalog/dts-reader.d.ts +220 -0
  53. package/dist/board-catalog/dts-reader.js +1052 -0
  54. package/dist/board-catalog/index.d.ts +11 -0
  55. package/dist/board-catalog/index.js +12 -0
  56. package/dist/board-catalog/pinconfig.d.ts +48 -0
  57. package/dist/board-catalog/pinconfig.js +263 -0
  58. package/dist/board-catalog/sdk.d.ts +82 -0
  59. package/dist/board-catalog/sdk.js +180 -0
  60. package/dist/board-catalog/store.d.ts +196 -0
  61. package/dist/board-catalog/store.js +363 -0
  62. package/dist/board-catalog/types.d.ts +233 -0
  63. package/dist/board-catalog/types.js +7 -0
  64. package/dist/board-catalog/walker.d.ts +112 -0
  65. package/dist/board-catalog/walker.js +1101 -0
  66. package/dist/cli-utils.d.ts +2 -2
  67. package/dist/cli-utils.js +5 -5
  68. package/dist/cli.js +227 -244
  69. package/dist/config-loader.d.ts +14 -19
  70. package/dist/config-loader.js +242 -78
  71. package/dist/config-schema.d.ts +19 -227
  72. package/dist/config-schema.js +9 -8
  73. package/dist/contract/board-generator.d.ts +4 -4
  74. package/dist/contract/board-generator.js +16 -5
  75. package/dist/contract/contract-parser.d.ts +36 -127
  76. package/dist/contract/contract-parser.js +76 -0
  77. package/dist/contract/index.d.ts +1 -1
  78. package/dist/contract/index.js +70 -21
  79. package/dist/create/active-board-catalog.d.ts +9 -0
  80. package/dist/create/active-board-catalog.js +94 -0
  81. package/dist/create/board-catalog.generated.d.ts +96 -0
  82. package/dist/create/board-catalog.generated.js +128737 -0
  83. package/dist/create/board-search.d.ts +23 -0
  84. package/dist/create/board-search.js +88 -0
  85. package/dist/create/editor-integration.d.ts +32 -0
  86. package/dist/create/editor-integration.js +257 -0
  87. package/dist/create/eslint-rules-template.d.ts +2 -2
  88. package/dist/create/framework-catalog.d.ts +48 -8
  89. package/dist/create/framework-catalog.js +58 -44
  90. package/dist/create/index.d.ts +8 -13
  91. package/dist/create/index.js +5 -9
  92. package/dist/create/mcu-target.d.ts +39 -0
  93. package/dist/create/mcu-target.js +80 -0
  94. package/dist/create/pack-targets.d.ts +19 -0
  95. package/dist/create/pack-targets.js +56 -0
  96. package/dist/create/{init-scaffold.d.ts → scaffold.d.ts} +8 -11
  97. package/dist/create/{init-scaffold.js → scaffold.js} +28 -87
  98. package/dist/create/templates.d.ts +51 -0
  99. package/dist/create/{init-templates.js → templates.js} +135 -116
  100. package/dist/create/wizard.d.ts +19 -0
  101. package/dist/create/wizard.js +314 -0
  102. package/dist/debug/preprocessor.d.ts +5 -0
  103. package/dist/debug/preprocessor.js +31 -7
  104. package/dist/diagnostics/diagnostics-report.d.ts +1 -1
  105. package/dist/diagnostics/diagnostics-report.js +3 -11
  106. package/dist/diagnostics/json-schema.d.ts +1 -1
  107. package/dist/diagnostics/md-writer.js +2 -2
  108. package/dist/diagnostics/mermaid-builder.d.ts +1 -1
  109. package/dist/diagnostics/mermaid-builder.js +1 -1
  110. package/dist/emit/cpp-emitter.js +4 -1
  111. package/dist/emit/emitters/class-emitter.js +32 -4
  112. package/dist/emit/emitters/emitter-context.d.ts +11 -0
  113. package/dist/emit/emitters/entrypoint-synthesizer.js +1 -1
  114. package/dist/emit/emitters/function-emitter-impl.js +33 -17
  115. package/dist/emit/emitters/output-finalizer.d.ts +7 -0
  116. package/dist/emit/emitters/output-finalizer.js +31 -23
  117. package/dist/emit/emitters/setup.js +147 -63
  118. package/dist/emit/emitters/top-level-prep.js +1 -1
  119. package/dist/emit/emitters/type-decl-emitter.js +13 -8
  120. package/dist/emit/emitters/ui-emitter.js +1 -1
  121. package/dist/emit/expression-renderer.d.ts +3 -3
  122. package/dist/emit/expression-renderer.js +17 -7
  123. package/dist/emit/route-hal-op.js +17 -48
  124. package/dist/emit/snprintf-helpers.d.ts +1 -3
  125. package/dist/emit/snprintf-helpers.js +1 -39
  126. package/dist/emit/statement-renderer.d.ts +0 -4
  127. package/dist/emit/statement-renderer.js +54 -45
  128. package/dist/emit/utils/async-state-machine.d.ts +16 -9
  129. package/dist/emit/utils/async-state-machine.js +56 -54
  130. package/dist/emit/utils/comment-helpers.d.ts +0 -8
  131. package/dist/emit/utils/comment-helpers.js +1 -1
  132. package/dist/emit/utils/cpp-helpers.d.ts +2 -2
  133. package/dist/emit/utils/cpp-helpers.js +2 -2
  134. package/dist/emit/utils/hal-op-cpp-type.js +4 -6
  135. package/dist/emit/utils/index.d.ts +3 -3
  136. package/dist/emit/utils/index.js +3 -3
  137. package/dist/emit/utils/type-inference.d.ts +1 -29
  138. package/dist/emit/utils/type-inference.js +0 -75
  139. package/dist/framework-package.d.ts +3 -0
  140. package/dist/framework-package.js +23 -6
  141. package/dist/framework-registry.d.ts +5 -5
  142. package/dist/frameworks/native/graphics/terminal-preview.d.ts +5 -0
  143. package/dist/frameworks/native/graphics/terminal-preview.js +33 -0
  144. package/dist/frameworks/native/index.d.ts +3 -0
  145. package/dist/frameworks/native/index.js +15 -0
  146. package/dist/frameworks/native/native-compile.d.ts +17 -0
  147. package/dist/frameworks/native/native-compile.js +170 -0
  148. package/dist/frameworks/native/native-config.d.ts +41 -0
  149. package/dist/frameworks/native/native-config.js +7 -0
  150. package/dist/frameworks/native/strategy.d.ts +97 -0
  151. package/dist/frameworks/native/strategy.js +664 -0
  152. package/dist/ir/board-resolver.d.ts +18 -23
  153. package/dist/ir/board-resolver.js +43 -401
  154. package/dist/ir/build-ir-state.d.ts +3 -0
  155. package/dist/ir/build-ir-state.js +42 -0
  156. package/dist/ir/build-ir.d.ts +1 -1
  157. package/dist/ir/build-ir.js +64 -45
  158. package/dist/ir/declaration-builders.js +1 -0
  159. package/dist/ir/expression-to-ir.js +17 -10
  160. package/dist/ir/hal/hal-emitter.d.ts +0 -2
  161. package/dist/ir/hal/hal-emitter.js +92 -41
  162. package/dist/ir/hal/hal-parser.d.ts +5 -5
  163. package/dist/ir/hal/hal-parser.js +128 -36
  164. package/dist/ir/hal/hal-plugins.d.ts +0 -1
  165. package/dist/ir/hal/hal-plugins.js +425 -716
  166. package/dist/ir/heap-analysis.js +2 -41
  167. package/dist/ir/identifier-collector.js +32 -20
  168. package/dist/ir/network-validation.js +7 -11
  169. package/dist/ir/ownership-analysis.js +75 -13
  170. package/dist/ir/peripheral-usage.d.ts +8 -2
  171. package/dist/ir/peripheral-usage.js +78 -149
  172. package/dist/ir/peripheral-validation.js +23 -3
  173. package/dist/ir/pin-capability-validation.d.ts +12 -0
  174. package/dist/ir/pin-capability-validation.js +61 -97
  175. package/dist/ir/pin-mode-validation.js +5 -5
  176. package/dist/ir/program-analysis.d.ts +8 -15
  177. package/dist/ir/program-analysis.js +140 -323
  178. package/dist/ir/pulldown-validation.js +11 -4
  179. package/dist/ir/resource-analysis.js +15 -3
  180. package/dist/ir/statement-to-ir.js +0 -6
  181. package/dist/ir/timing-validation.js +1 -1
  182. package/dist/ir/transformers/array-methods.js +11 -5
  183. package/dist/ir/transformers/call-statement.js +20 -87
  184. package/dist/ir/transformers/callback-context-registry.d.ts +1 -1
  185. package/dist/ir/transformers/callback-context-registry.js +8 -16
  186. package/dist/ir/transformers/control-flow.js +0 -13
  187. package/dist/ir/transformers/expressions.js +10 -9
  188. package/dist/ir/transformers/hal-call-resolver.d.ts +2 -2
  189. package/dist/ir/transformers/hal-call-resolver.js +24 -10
  190. package/dist/ir/transformers/hal-emit-helpers.d.ts +2 -2
  191. package/dist/ir/transformers/hal-emit-helpers.js +2 -2
  192. package/dist/ir/transformers/namespace-methods.js +1 -1
  193. package/dist/ir/transformers/ui-callback-lowering.d.ts +0 -2
  194. package/dist/ir/transformers/ui-callback-lowering.js +0 -24
  195. package/dist/ir/transformers/variables.js +338 -42
  196. package/dist/ir/try-catch-validation.js +4 -3
  197. package/dist/ir/type-resolution.js +15 -4
  198. package/dist/ir/validation-orchestrator.js +0 -9
  199. package/dist/libdef/cpp-to-decl.d.ts +0 -9
  200. package/dist/libdef/cpp-to-decl.js +0 -72
  201. package/dist/libdef/registry.d.ts +0 -1
  202. package/dist/libdef/registry.js +1 -24
  203. package/dist/library/catalog.d.ts +35 -0
  204. package/dist/library/catalog.js +67 -0
  205. package/dist/library/cli.d.ts +2 -0
  206. package/dist/library/cli.js +168 -0
  207. package/dist/library/init.d.ts +25 -0
  208. package/dist/library/init.js +397 -0
  209. package/dist/library/install.d.ts +9 -0
  210. package/dist/library/install.js +80 -0
  211. package/dist/library/registry-search.d.ts +34 -0
  212. package/dist/library/registry-search.js +50 -0
  213. package/dist/library/validate.d.ts +17 -0
  214. package/dist/library/validate.js +175 -0
  215. package/dist/library-packages.d.ts +95 -0
  216. package/dist/library-packages.js +275 -0
  217. package/dist/mapping/peripheral-names.js +9 -4
  218. package/dist/mapping/source-map.d.ts +3 -4
  219. package/dist/mapping/source-map.js +12 -18
  220. package/dist/orchestrator/graph-builder.d.ts +3 -3
  221. package/dist/orchestrator/graph-builder.js +29 -12
  222. package/dist/orchestrator/type-checker.d.ts +3 -3
  223. package/dist/orchestrator/type-checker.js +3 -3
  224. package/dist/platform/async-runtime.js +1 -1
  225. package/dist/platform/coop-scheduler-runtime.js +2 -2
  226. package/dist/platform/generic-debug-codegen.d.ts +36 -0
  227. package/dist/platform/generic-debug-codegen.js +185 -0
  228. package/dist/platform/generic-strategy.d.ts +3 -4
  229. package/dist/platform/generic-strategy.js +5 -80
  230. package/dist/platform/index.js +1 -1
  231. package/dist/platform/registry.d.ts +2 -2
  232. package/dist/platform/registry.js +2 -2
  233. package/dist/preview/client.js +17 -3
  234. package/dist/safety/asil-decorators.d.ts +32 -0
  235. package/dist/safety/asil-decorators.js +32 -0
  236. package/dist/safety/authoring.d.ts +85 -0
  237. package/dist/safety/authoring.js +61 -0
  238. package/dist/safety/engine.d.ts +3 -0
  239. package/dist/safety/engine.js +83 -0
  240. package/dist/safety/hal/ops.d.ts +48 -0
  241. package/dist/safety/hal/ops.js +46 -0
  242. package/dist/safety/iso26262/analyze.d.ts +13 -0
  243. package/dist/safety/iso26262/analyze.js +29 -0
  244. package/dist/safety/iso26262/asil.d.ts +10 -0
  245. package/dist/safety/iso26262/asil.js +22 -0
  246. package/dist/safety/iso26262/collect.d.ts +14 -0
  247. package/dist/safety/iso26262/collect.js +137 -0
  248. package/dist/safety/iso26262/goto-checker.d.ts +10 -0
  249. package/dist/safety/iso26262/goto-checker.js +72 -0
  250. package/dist/safety/iso26262/heap-checker.d.ts +7 -0
  251. package/dist/safety/iso26262/heap-checker.js +57 -0
  252. package/dist/safety/iso26262/init-checker.d.ts +13 -0
  253. package/dist/safety/iso26262/init-checker.js +127 -0
  254. package/dist/safety/iso26262/loop-checker.d.ts +7 -0
  255. package/dist/safety/iso26262/loop-checker.js +86 -0
  256. package/dist/safety/iso26262/recursion-checker.d.ts +9 -0
  257. package/dist/safety/iso26262/recursion-checker.js +134 -0
  258. package/dist/safety/iso26262/sidecar-writer.d.ts +25 -0
  259. package/dist/safety/iso26262/sidecar-writer.js +13 -0
  260. package/dist/safety/passes/pinMode-intercept.d.ts +3 -0
  261. package/dist/safety/passes/pinMode-intercept.js +60 -0
  262. package/dist/safety/runtime/mode-table.d.ts +5 -0
  263. package/dist/safety/runtime/mode-table.js +55 -0
  264. package/dist/safety/runtime/polyfills.d.ts +6 -0
  265. package/dist/safety/runtime/polyfills.js +12 -0
  266. package/dist/safety/runtime/result-struct.d.ts +11 -0
  267. package/dist/safety/runtime/result-struct.js +98 -0
  268. package/dist/safety/runtime/safe-int.d.ts +33 -0
  269. package/dist/safety/runtime/safe-int.js +170 -0
  270. package/dist/safety/runtime/safe-traits.d.ts +4 -0
  271. package/dist/safety/runtime/safe-traits.js +95 -0
  272. package/dist/safety/runtime/safe-variable.d.ts +39 -0
  273. package/dist/safety/runtime/safe-variable.js +226 -0
  274. package/dist/safety/runtime/vote.d.ts +8 -0
  275. package/dist/safety/runtime/vote.js +92 -0
  276. package/dist/safety/runtime/write-verify.d.ts +8 -0
  277. package/dist/safety/runtime/write-verify.js +71 -0
  278. package/dist/safety/safe-int-types.d.ts +45 -0
  279. package/dist/safety/safe-int-types.js +25 -0
  280. package/dist/safety/safe-variable-types.d.ts +29 -0
  281. package/dist/safety/safe-variable-types.js +19 -0
  282. package/dist/safety/safety-bridge.d.ts +5 -6
  283. package/dist/safety/safety-bridge.js +15 -28
  284. package/dist/safety/sidecar-bridge.d.ts +1 -3
  285. package/dist/safety/sidecar-bridge.js +3 -20
  286. package/dist/safety/specifiers.d.ts +6 -0
  287. package/dist/safety/specifiers.js +14 -0
  288. package/dist/safety-hook.d.ts +8 -7
  289. package/dist/safety-hook.js +12 -13
  290. package/dist/testing.d.ts +5 -6
  291. package/dist/testing.js +5 -5
  292. package/dist/transpile/resolution.d.ts +1 -1
  293. package/dist/transpile/resolution.js +18 -9
  294. package/dist/transpile/test-pins.d.ts +18 -0
  295. package/dist/transpile/test-pins.js +142 -0
  296. package/dist/transpile.d.ts +1 -2
  297. package/dist/transpile.js +90 -29
  298. package/dist/types.d.ts +45 -26
  299. package/dist/ui-hook.d.ts +1 -1
  300. package/dist/utils/cli.d.ts +2 -2
  301. package/dist/utils/cli.js +160 -157
  302. package/dist/utils/fs.d.ts +3 -4
  303. package/dist/utils/fs.js +4 -5
  304. package/dist/utils/strings.d.ts +0 -1
  305. package/dist/utils/strings.js +0 -8
  306. package/dist/utils/ui.d.ts +5 -2
  307. package/dist/utils/ui.js +13 -3
  308. package/package.json +158 -149
  309. package/dist/add-preset.d.ts +0 -4
  310. package/dist/add-preset.js +0 -74
  311. package/dist/api/shared/async-symbol-detector.d.ts +0 -11
  312. package/dist/api/shared/async-symbol-detector.js +0 -140
  313. package/dist/api/shared/native-display-op-resolver.d.ts +0 -10
  314. package/dist/api/shared/native-display-op-resolver.js +0 -64
  315. package/dist/create/board-checklist.d.ts +0 -2
  316. package/dist/create/board-checklist.js +0 -52
  317. package/dist/create/board-codegen.d.ts +0 -9
  318. package/dist/create/board-codegen.js +0 -238
  319. package/dist/create/board-generators.d.ts +0 -12
  320. package/dist/create/board-generators.js +0 -651
  321. package/dist/create/board-spec.d.ts +0 -637
  322. package/dist/create/board-spec.js +0 -214
  323. package/dist/create/init-templates.d.ts +0 -28
  324. package/dist/create/init-wizard.d.ts +0 -8
  325. package/dist/create/init-wizard.js +0 -182
  326. package/dist/install/framework-catalog.d.ts +0 -53
  327. package/dist/install/framework-catalog.js +0 -107
  328. package/dist/install/handle-install.d.ts +0 -35
  329. package/dist/install/handle-install.js +0 -177
  330. package/dist/install/index.d.ts +0 -4
  331. package/dist/install/index.js +0 -3
  332. package/dist/ir/pin-state-tracking.d.ts +0 -58
  333. package/dist/ir/pin-state-tracking.js +0 -182
  334. package/dist/ir/pwm-timer-sharing.d.ts +0 -4
  335. package/dist/ir/pwm-timer-sharing.js +0 -94
  336. package/dist/ir/timer0-pwm-timing-conflict.d.ts +0 -4
  337. package/dist/ir/timer0-pwm-timing-conflict.js +0 -72
  338. package/dist/libdef/component-decls.d.ts +0 -2
  339. package/dist/libdef/component-decls.js +0 -6
  340. package/dist/libdef/component-discovery.d.ts +0 -43
  341. package/dist/libdef/component-discovery.js +0 -83
  342. package/dist/theme-tokens.d.ts +0 -22
  343. package/dist/theme-tokens.js +0 -172
@@ -6,7 +6,7 @@
6
6
  // framework-specific C++.
7
7
  //
8
8
  // The transpiler produces these nodes when resolving HAL method calls.
9
- // Framework strategies (ArduinoStrategy, NativeAVRStrategy, etc.) implement
9
+ // Framework strategies (ZephyrStrategy, NativeStrategy, etc.) implement
10
10
  // resolveHALOperation() to map each operation to concrete C++ code.
11
11
  //
12
12
  // Pin-carrying operations include an optional `port` field for the MCU
@@ -27,116 +27,82 @@
27
27
  */
28
28
  export const HAL_OPERATION_KINDS = [
29
29
  // GPIO
30
- 'gpio.write', 'gpio.read', 'gpio.toggle', 'gpio.set_mode',
30
+ 'gpio.write', 'gpio.read', 'gpio.toggle',
31
31
  // PWM
32
- 'pwm.write', 'pwm.get_frequency', 'pwm.get_resolution',
33
32
  // RMT
34
- 'rmt.tx_init', 'rmt.tx_write_bytes', 'rmt.tx_write_symbols',
35
- 'rmt.tx_wait_done', 'rmt.tx_deinit',
36
- 'rmt.rx_init', 'rmt.rx_on_received', 'rmt.rx_start',
37
- 'rmt.rx_stop', 'rmt.rx_read', 'rmt.rx_deinit',
38
33
  // ADC
39
- 'adc.read', 'adc.get_resolution', 'adc.set_reference',
40
- 'adc.get_reference', 'adc.read_voltage',
41
34
  // DAC
42
- 'dac.write',
43
35
  // Interrupts
44
- 'interrupt.attach', 'interrupt.detach',
45
- // Tone
46
- 'tone.play', 'tone.stop',
47
- // Timing
48
- 'timing.delay', 'timing.delay_microseconds', 'timing.millis',
49
- 'timing.micros', 'timing.free_heap', 'timing.set_interval',
50
- 'timing.set_timeout', 'timing.clear_interval', 'timing.clear_timeout',
51
- // Power
52
- 'power.deep_sleep', 'power.light_sleep', 'power.set_cpu_frequency', 'power.deep_sleep_pin',
53
- // I2C
54
- 'i2c.begin', 'i2c.end', 'i2c.set_clock', 'i2c.begin_transmission',
55
- 'i2c.write', 'i2c.write_bytes', 'i2c.write_buffer', 'i2c.read_buffer',
56
- 'i2c.end_transmission', 'i2c.request_from', 'i2c.available', 'i2c.read',
57
- 'i2c.recover',
58
- // SPI
59
- 'spi.begin', 'spi.end', 'spi.transfer', 'spi.begin_transaction',
60
- 'spi.end_transaction', 'spi.set_mode', 'spi.set_bit_order',
61
- 'spi.cs_low', 'spi.cs_high', 'spi.read_buffer',
62
- // UART
63
- 'uart.begin', 'uart.end', 'uart.print', 'uart.println', 'uart.printf',
64
- 'uart.write', 'uart.read', 'uart.peek', 'uart.available', 'uart.flush',
36
+ 'interrupt.attach_flags', 'interrupt.detach',
37
+ // Timing (legacy Arduino-named ops removed; timers keep JS names)
38
+ 'timing.sleep', 'timing.now', 'timing.now_us', 'timing.busy_wait_us',
39
+ // Thin Zephyr-shaped peripherals
40
+ 'gpio.configure', 'gpio.read_cfg', 'gpio.shift_out', 'gpio.shift_in',
41
+ 'pwm.set_pulse', 'pwm.set_duty', 'pwm.set_period',
42
+ 'adc.read_raw', 'adc.read_mv',
43
+ 'dac.write_value',
44
+ 'wdt.setup', 'wdt.feed',
45
+ 'counter.on_alarm', 'counter.start', 'counter.stop',
46
+ // Tier-2 thin buses
47
+ 'i2c.reg_write', 'i2c.reg_read', 'i2c.reg_update', 'i2c.dev_write',
48
+ 'spi.transceive', 'spi.dev_write', 'spi.reg_read',
49
+ 'uart.poll_write', 'uart.rx_arm', 'uart.rx_available', 'uart.rx_peek', 'uart.rx_read',
50
+ 'thread.start', 'thread.join',
65
51
  // Pulse
66
- 'pulse.in', 'pulse.in_long',
67
52
  // Shift
68
- 'shift.out', 'shift.in',
69
53
  // Board
70
54
  'board.resolve',
71
55
  // Watchdog timer
72
- 'wdt.enable', 'wdt.reset', 'wdt.disable',
56
+ 'wdt.disable',
73
57
  // Snprintf
74
58
  'snprintf.emit',
75
59
  // WiFi
76
- 'wifi.connect', 'wifi.connect_start', 'wifi.disconnect', 'wifi.status',
60
+ 'wifi.join', 'wifi.connect_start', 'wifi.disconnect',
77
61
  'wifi.is_connected', 'wifi.local_ip', 'wifi.rssi', 'wifi.mac',
78
- 'wifi.set_hostname', 'wifi.set_static_ip', 'wifi.set_auto_reconnect',
79
- 'wifi.set_power_save', 'wifi.set_tx_power', 'wifi.on_event',
80
- 'wifi.ap_start', 'wifi.ap_stop', 'wifi.ap_client_count', 'wifi.ap_ip',
81
- 'wifi.ap_set_channel', 'wifi.ap_set_hidden', 'wifi.ap_set_max_clients',
62
+ 'wifi.on_event',
63
+ 'wifi.ap_start', 'wifi.ap_stop',
82
64
  'wifi.scan', 'wifi.scan_start', 'wifi.scan_done', 'wifi.scan_count',
83
65
  'wifi.scan_ssid', 'wifi.scan_rssi', 'wifi.scan_encryption',
84
- 'wifi.scan_channel', 'wifi.save_credentials', 'wifi.connect_saved',
85
- 'wifi.clear_credentials', 'wifi.wait_connected', 'wifi.wait_disconnected',
66
+ 'wifi.scan_channel',
86
67
  // HTTP
87
- 'http.begin', 'http.reset', 'http.set_header', 'http.set_timeout',
68
+ 'http.begin', 'http.set_header', 'http.set_timeout',
88
69
  'http.set_max_body', 'http.set_body', 'http.set_insecure',
89
70
  'http.set_ca_cert', 'http.send', 'http.send_start', 'http.done',
90
71
  'http.status', 'http.ok', 'http.body', 'http.content_length',
91
72
  'http.response_header',
92
- // Worker offload (generalized request-in / poll-out over a worker pool)
93
- 'worker.submit', 'worker.done',
94
73
  // BLE (NimBLE GATT peripheral)
95
74
  'ble.server_begin', 'ble.advertise_start', 'ble.advertise_stop',
96
75
  'ble.add_service', 'ble.add_char',
97
76
  'ble.on_read', 'ble.on_write', 'ble.on_connect', 'ble.on_disconnect', 'ble.notify',
98
- 'ble.is_connected', 'ble.client_count', 'ble.set_name',
99
- 'ble.until_connected', 'ble.until_connected_start',
100
- 'ble.set_tx_power', 'ble.status',
77
+ 'ble.is_connected', 'ble.client_count',
101
78
  // Preferences (NVS)
102
- 'preferences.begin', 'preferences.end', 'preferences.clear', 'preferences.remove',
79
+ 'preferences.clear', 'preferences.remove',
103
80
  'preferences.put_int', 'preferences.get_int',
104
- 'preferences.put_uint', 'preferences.get_uint',
105
81
  'preferences.put_bool', 'preferences.get_bool',
106
82
  'preferences.put_float', 'preferences.get_float',
107
83
  'preferences.put_string', 'preferences.get_string',
108
84
  // Random
109
85
  'random.int', 'random.range', 'random.seed',
110
86
  // FS (filesystem)
111
- 'fs.begin', 'fs.read_text', 'fs.write_text', 'fs.exists', 'fs.remove',
112
- // mDNS
113
- 'mdns.start', 'mdns.set_hostname', 'mdns.add_service', 'mdns.announce', 'mdns.stop',
87
+ 'fs.read_text', 'fs.write_text', 'fs.exists', 'fs.remove',
114
88
  // MQTT
115
89
  'mqtt.connect', 'mqtt.on_message', 'mqtt.subscribe', 'mqtt.publish', 'mqtt.connected', 'mqtt.disconnect',
116
- // OTA
117
- 'ota.from_url', 'ota.begin', 'ota.write', 'ota.apply',
118
- // Temperature
119
- 'temp.read',
90
+ 'sensor.fetch',
91
+ 'sensor.get',
120
92
  // Hardware timer
121
- 'hwtimer.set_frequency', 'hwtimer.on_overflow', 'hwtimer.start', 'hwtimer.stop',
122
- // Capacitive touch pins
123
- 'capacitive.read',
124
93
  // I2S / digital audio (unimplemented — declared unsupported by all frameworks)
125
94
  'i2s.init', 'i2s.write', 'i2s.read',
126
95
  // TWAI / CAN (unimplemented)
127
96
  'twai.init', 'twai.send', 'twai.receive',
128
- // USB OTG / USB-Serial-JTAG (unimplemented)
129
- 'usb.init', 'usb.write', 'usb.read',
97
+ // USB CDC-ACM serial port
98
+ 'usb.begin', 'usb.wait_ready', 'usb.end', 'usb.print', 'usb.println',
99
+ 'usb.read', 'usb.available', 'usb.connected',
130
100
  // Ethernet MAC (unimplemented)
131
101
  'eth.init', 'eth.start', 'eth.is_linked',
132
102
  // ESPNOW (unimplemented)
133
- 'espnow.init', 'espnow.add_peer', 'espnow.send', 'espnow.on_receive',
134
103
  // Hardware crypto (unimplemented)
135
- 'crypto.aes_encrypt', 'crypto.sha256', 'crypto.hmac',
136
104
  // Pulse counter (unimplemented)
137
- 'pcnt.init', 'pcnt.count', 'pcnt.clear',
138
105
  // Motor control PWM (unimplemented)
139
- 'mcpwm.init', 'mcpwm.set_duty', 'mcpwm.start',
140
106
  // Raw passthrough
141
107
  'raw',
142
108
  ];
@@ -12,7 +12,6 @@ export type { DisplayProfile, DisplayConfig, DisplaySize, TouchProfile, TouchLib
12
12
  export { effectiveDisplaySize, normalizeDisplayRotation, resolveDisplayProfile, resolveScrollConfig } from './display-profile.js';
13
13
  export { GLCDFONT_BYTES, renderGlcdfontArray } from './glcdfont.js';
14
14
  export type { DisplayAdapterCode, DisplayAdapterGenerator } from './display-adapter.js';
15
- export { resolveNativeDisplayOp } from './native-display-op-resolver.js';
16
15
  export type { DisplayCapabilities, DisplayFeatureFlags, NativeFormat, RefreshModel, PartialRefreshScope, } from './display-capabilities.js';
17
16
  export { defaultTftCapabilities, deriveCapabilities } from './display-capabilities.js';
18
17
  export type { BoardConstants } from './board-resolver.js';
@@ -33,9 +32,6 @@ export { generatePromiseRuntime } from './promise-runtime.js';
33
32
  export { generateStaticAsyncRuntime } from './async-runtime-static.js';
34
33
  export { generateCoopScheduler, buildCoopSchedInjection } from './coop-scheduler.js';
35
34
  export type { CoopWorkUnit, CoopSchedOptions } from './coop-scheduler.js';
36
- export { generateWorkerRuntime, lowerWorkerOp } from './worker-runtime.js';
37
- export type { WorkerRuntimeOptions, WorkerBacking } from './worker-runtime.js';
38
- export { buildWorkerRuntimePolyfill } from './worker-runtime-polyfill.js';
39
35
  export { FrameworkManifestSchema, defineFrameworkManifest, HAL_CATEGORIES, POLYFILL_BACKED_OPS, } from './framework-manifest.js';
40
36
  export type { FrameworkManifest, HalCategory, } from './framework-manifest.js';
41
37
  export { KNOWN_FRAMEWORK_PACKAGES, loadFrameworkManifest, } from './framework-manifest-registry.js';
@@ -10,10 +10,6 @@ export { effectiveDisplaySize, normalizeDisplayRotation, resolveDisplayProfile,
10
10
  // Shared 5x7 glcdfont table (Adafruit public-domain source). Consumed by
11
11
  // the SDL preview adapter and the native CuttlefishGFX runtime-header slice.
12
12
  export { GLCDFONT_BYTES, renderGlcdfontArray } from './glcdfont.js';
13
- // Native display-op resolver — lowers display.* HAL ops into calls against
14
- // the adapter surface (display_init / display_targetFillRect / etc.). Used
15
- // by NativeAVRStrategy and Esp32Strategy's resolveDisplayOp overrides.
16
- export { resolveNativeDisplayOp } from './native-display-op-resolver.js';
17
13
  export { defaultTftCapabilities, deriveCapabilities } from './display-capabilities.js';
18
14
  export { getStdLibSupport, DEFAULT_STDLIB_SUPPORT } from './polyfill-types.js';
19
15
  export { parseCompileErrors, collectCppFiles } from './toolchain-types.js';
@@ -34,9 +30,6 @@ export { generatePromiseRuntime } from './promise-runtime.js';
34
30
  export { generateStaticAsyncRuntime } from './async-runtime-static.js';
35
31
  // No-STL cooperative scheduler (priority + time-budget) — Zephyr-friendly
36
32
  export { generateCoopScheduler, buildCoopSchedInjection } from './coop-scheduler.js';
37
- // Worker offload runtime (generalized request-in / poll-out)
38
- export { generateWorkerRuntime, lowerWorkerOp } from './worker-runtime.js';
39
- export { buildWorkerRuntimePolyfill } from './worker-runtime-polyfill.js';
40
33
  // Framework manifest schema + helper
41
34
  export { FrameworkManifestSchema, defineFrameworkManifest, HAL_CATEGORIES, POLYFILL_BACKED_OPS, } from './framework-manifest.js';
42
35
  // Framework manifest discovery
@@ -44,3 +37,4 @@ export { KNOWN_FRAMEWORK_PACKAGES, loadFrameworkManifest, } from './framework-ma
44
37
  // Framework manifest validator
45
38
  export { validateFrameworkManifest } from './validate-framework-manifest.js';
46
39
  export { SPDX_TABLE, RISK_RANK, LICENSE_FILENAMES, normalize, identifySpdx, classifyRisk, readLicenseFileIn, readLicenseFile, readSourceHeaders, resolveLibraryLicense, riskBracket, statusMark, countByRisk, } from './spdx-licenses.js';
40
+ // Generated Zephyr board catalog (shared with the create/scaffold flow).
@@ -160,10 +160,16 @@ export type ExpressionIR = {
160
160
  /**
161
161
  * HAL operation used as an expression (returns a value).
162
162
  * The framework strategy resolves the operation to a C++ expression string.
163
+ * `prefixOps` carries a method body's PRECEDING side-effect ops: expression
164
+ * positions historically kept only the last op, silently dropping e.g. a
165
+ * bus transaction prefix (i2c begin/write/end before a read) or a pin
166
+ * configure before a read. The renderer emits them as a GCC
167
+ * statement-expression `({ op; ...; value; })` so every op runs.
163
168
  */
164
169
  | {
165
170
  kind: "hal-expr";
166
171
  operation: HALOpIR;
172
+ prefixOps?: HALOpIR[];
167
173
  };
168
174
  export interface CallExpressionIR {
169
175
  kind: "call";
@@ -84,6 +84,10 @@ export interface ClassMethodIR {
84
84
  typeParameters?: string[];
85
85
  /** True when this is a generator method. */
86
86
  isGenerator?: boolean;
87
+ /** True when declared `async` — the body lowers to an owner-bound
88
+ * cooperative state-machine task (see async-state-machine.ts), not an
89
+ * ordinary method. */
90
+ isAsync?: boolean;
87
91
  /** Decorators applied to this method (e.g. ["asilD"]). */
88
92
  decorators?: string[];
89
93
  }
@@ -2,7 +2,7 @@ import type { BoardConstants } from './board-resolver.js';
2
2
  import type { Diagnostic } from './types.js';
3
3
  import type { RegisteredCallback } from '../../ir/build-ir-state.js';
4
4
  export type { CppType, ParameterIR, ExpressionIR, CallExpressionIR, SuperCallIR, VariableDeclarationIR, AssignmentIR, UpdateIR, ReturnIR, WhileIR, IfIR, ForIR, ForOfIR, ForInIR, BreakIR, ContinueIR, DoWhileIR, SwitchIR, CaseIR, TryIR, ThrowIR, LabeledIR, BlockIR, HALOpStatementIR, StatementIR, } from './ir-core.js';
5
- export type { HALOpIR, HALOperationKind, GpioWriteOp, GpioReadOp, GpioToggleOp, GpioSetModeOp, PwmWriteOp, PwmGetFrequencyOp, PwmGetResolutionOp, AdcReadOp, AdcGetResolutionOp, AdcSetReferenceOp, AdcGetReferenceOp, AdcReadVoltageOp, DacWriteOp, InterruptAttachOp, InterruptDetachOp, TonePlayOp, ToneStopOp, TimingDelayOp, TimingDelayMicrosecondsOp, TimingMillisOp, TimingMicrosOp, TimingFreeHeapOp, TimingSetIntervalOp, TimingSetTimeoutOp, TimingClearIntervalOp, TimingClearTimeoutOp, I2cBeginOp, I2cEndOp, I2cSetClockOp, I2cBeginTransmissionOp, I2cWriteOp, I2cEndTransmissionOp, I2cRequestFromOp, I2cAvailableOp, I2cReadOp, I2cRecoverOp, SpiBeginOp, SpiEndOp, SpiTransferOp, SpibeginTransactionOp, SpiEndTransactionOp, SpiSetModeOp, SpiSetBitOrderOp, SpiCsLowOp, SpiCsHighOp, UartBeginOp, UartEndOp, UartPrintOp, UartPrintlnOp, UartPrintfOp, UartWriteOp, UartReadOp, UartPeekOp, UartAvailableOp, UartFlushOp, PulseInOp, PulseInLongOp, ShiftOutOp, ShiftInOp, BoardResolveOp, SnprintfEmitOp, RawCppOp, } from './hal-op-ir.js';
5
+ export type { HALOpIR, HALOperationKind, GpioWriteOp, GpioReadOp, GpioToggleOp, InterruptDetachOp, I2cReadOp, I2cRecoverOp, BoardResolveOp, SnprintfEmitOp, RawCppOp, } from './hal-op-ir.js';
6
6
  export type { FunctionIR, StructDefIR, EnumIR, ClassFieldIR, ClassConstructorIR, ClassMethodIR, ClassGetterIR, ClassSetterIR, ClassIR, InterfaceIR, TypeAliasIR, NamespaceIR, RegisterBitFieldIR, RegisterClassIR, } from './ir-declarations.js';
7
7
  export interface ImportIR {
8
8
  moduleSpecifier: string;
@@ -27,8 +27,6 @@ export interface PeripheralUsageIR {
27
27
  pwm: boolean;
28
28
  /** External interrupts are used (attachInterrupt on D2, D3) */
29
29
  externalInterrupts: boolean;
30
- /** Timer0-based timing is used (millis, micros) */
31
- timer0: boolean;
32
30
  /** I2C bus is used */
33
31
  i2c: boolean;
34
32
  /** SPI bus is used */
@@ -49,8 +49,6 @@ export interface PlatformProfileStrategy {
49
49
  mathHeader(): string;
50
50
  /** cstring header name ("<cstring>" on hosted, "<string.h>" on embedded/AVR). */
51
51
  cstringHeader(): string;
52
- /** Whether the vector operator<< overload should be emitted. */
53
- needsVectorOverload(): boolean;
54
52
  /** Whether a large enum needs an explicit underlying type. */
55
53
  needsLargeEnumUnderlying(): boolean;
56
54
  /** Whether to skip a type alias for this platform (e.g. std::string where unsupported). */
@@ -140,7 +138,7 @@ export interface PlatformExpressionStrategy {
140
138
  wrapStringConcat(leftRendered: string, rightRendered: string, leftIsString: boolean): string | undefined;
141
139
  /** Wrap an expression in the platform's string object type (e.g. String(...) on Arduino). */
142
140
  wrapStringObject(expr: string): string;
143
- /** Platform-specific expression for current time in milliseconds (e.g. "millis()" on Arduino, "std::chrono" on hosted). */
141
+ /** Platform-specific expression for the monotonic runtime clock in milliseconds (e.g. "__tc_now_ms()" on Zephyr/native). */
144
142
  currentTimeMillis(): string;
145
143
  /**
146
144
  * Whether string concat / template interpolation should use snprintf()
@@ -184,18 +182,6 @@ export interface PlatformStatementStrategy {
184
182
  * Embedded targets without exception support may emit an infinite loop or halt.
185
183
  */
186
184
  renderThrow(valueExpr: string): string;
187
- /**
188
- * Transform console.log/error/warn calls to platform output.
189
- */
190
- isConsoleCall(callee: string): boolean;
191
- /** Transform console.log/error/warn calls based on target platform. */
192
- transformConsoleCall(method: string, renderedArgs: string, forHeader: boolean): string;
193
- /**
194
- * Transform console expressions that return values (e.g., console.readLine, console.readCharacter).
195
- * Returns the C++ expression that evaluates to the result.
196
- * Return undefined to fall back to default rendering.
197
- */
198
- transformConsoleExpression?(method: string, renderedArgs: string): string | undefined;
199
185
  /**
200
186
  * Fallback value for an object initializer field on this platform.
201
187
  * Some targets use "0" for nested objects; hosted targets pass through.
@@ -272,7 +258,7 @@ export interface PlatformSafetyStrategy {
272
258
  isHeapAllocationUnsafe?(architecture: string): boolean;
273
259
  /**
274
260
  * Whether C++ exceptions are disabled on the given architecture.
275
- * Frameworks return true for targets compiled with -fno-exceptions (e.g. AVR-GCC).
261
+ * Frameworks return true for targets compiled with -fno-exceptions (e.g. Zephyr).
276
262
  */
277
263
  isExceptionSupportDisabled?(architecture: string): boolean;
278
264
  /**
@@ -384,6 +370,18 @@ export interface PlatformAsyncStrategy {
384
370
  * - What queue capacity to use
385
371
  */
386
372
  getAsyncRuntimeConfig(): AsyncRuntimeConfig;
373
+ /**
374
+ * Generate the project-local board module for a board target — the
375
+ * framework owns its board data (the Zephyr framework joins its generated
376
+ * data pack with its curated soc descriptors). Returns the contents of
377
+ * `.cuttlefish/board.ts` and `.cuttlefish/board.json`; the caller writes
378
+ * them. Undefined = the framework has no board generation (the config's
379
+ * board field then requires a different resolution path).
380
+ */
381
+ generateBoardModule?(target: string): {
382
+ boardTs: string;
383
+ boardJson: string;
384
+ } | undefined;
387
385
  /**
388
386
  * Lines to inject into the loop/run function body to drive async tasks.
389
387
  */
@@ -405,27 +403,6 @@ export interface PlatformAsyncStrategy {
405
403
  preIteration: string;
406
404
  postIteration: string;
407
405
  } | null;
408
- /**
409
- * C++ statements that spawn the worker for slot `handleId`, running
410
- * `fn(arg)`. Emitted as the body of __tc_worker_submit. Return undefined
411
- * to declare worker offload unsupported on this framework.
412
- *
413
- * The shared runtime has already recorded `waiter`/set `done=false` before
414
- * this runs; the hook need only spawn. `fn` and `arg` are C++ expressions
415
- * (a function pointer and a void*).
416
- */
417
- workerSpawnLines?(handleId: number, fn: string, arg: string): string[] | undefined;
418
- /**
419
- * C++ expression the worker calls AFTER completing its work and writing its
420
- * outputs, to signal completion to the waiter. Emitted inside the worker
421
- * trampoline. Must issue a memory barrier. Return undefined if unsupported.
422
- */
423
- workerSignalDoneExpr?(handleId: number): string | undefined;
424
- /**
425
- * C++ boolean expression polled by __tc_worker_done to test completion.
426
- * Must observe the signal's memory barrier. Return undefined if unsupported.
427
- */
428
- workerIsDoneExpr?(handleId: number): string | undefined;
429
406
  }
430
407
  /**
431
408
  * Strategy for resolving semantic HAL operations to framework-specific C++.
@@ -27,11 +27,6 @@ export const POLYFILL_HELPER_MAP = {
27
27
  '.includes(': ['__tc_includes'],
28
28
  '.indexOf(': ['__tc_indexOf'],
29
29
  '.slice(': ['__tc_slice2', '__tc_slice1'],
30
- // Timer methods
31
- 'setTimeout(': ['__tc_setTimeout'],
32
- 'setInterval(': ['__tc_setInterval'],
33
- 'clearTimeout(': ['__tc_clearTimeout'],
34
- 'clearInterval(': ['__tc_clearInterval'],
35
30
  // Math methods
36
31
  'Math.random(': ['__tc_random'],
37
32
  // Array methods
@@ -13,15 +13,6 @@ export const DEFAULT_STDLIB_SUPPORT = {
13
13
  recommendedStringImpl: "std_string",
14
14
  };
15
15
  const STDLIB_SUPPORT = {
16
- avr: {
17
- hasVector: false,
18
- hasString: false,
19
- hasIostream: false,
20
- hasExceptions: false,
21
- hasRTTI: false,
22
- recommendedArrayImpl: "static_array",
23
- recommendedStringImpl: "static_string",
24
- },
25
16
  esp32: {
26
17
  hasVector: true,
27
18
  hasString: true,
@@ -31,15 +22,6 @@ const STDLIB_SUPPORT = {
31
22
  recommendedArrayImpl: "std_vector",
32
23
  recommendedStringImpl: "std_string",
33
24
  },
34
- esp8266: {
35
- hasVector: true,
36
- hasString: true,
37
- hasIostream: true,
38
- hasExceptions: true,
39
- hasRTTI: true,
40
- recommendedArrayImpl: "std_vector",
41
- recommendedStringImpl: "std_string",
42
- },
43
25
  rp2040: {
44
26
  hasVector: true,
45
27
  hasString: true,
@@ -58,15 +40,6 @@ const STDLIB_SUPPORT = {
58
40
  recommendedArrayImpl: "std_vector",
59
41
  recommendedStringImpl: "std_string",
60
42
  },
61
- megaavr: {
62
- hasVector: false,
63
- hasString: false,
64
- hasIostream: false,
65
- hasExceptions: false,
66
- hasRTTI: false,
67
- recommendedArrayImpl: "static_array",
68
- recommendedStringImpl: "static_string",
69
- },
70
43
  default: DEFAULT_STDLIB_SUPPORT,
71
44
  };
72
45
  export function getStdLibSupport(architecture) {
@@ -21,10 +21,10 @@
21
21
  * (used by Arduino targets).
22
22
  */
23
23
  export function generatePromiseRuntime(queueCapacity, includeWaitForPinEdge = false, strategy) {
24
- // The current-time expression (millis() on Wiring-derived frameworks,
25
- // std::chrono on generic). Falling back to millis() preserves the historical
24
+ // The current-time expression (__tc_now_ms() the runtime clock contract
25
+ // every strategy provides). Falling back to the contract symbol keeps the
26
26
  // behavior when no strategy is supplied.
27
- const now = strategy?.currentTimeMillis?.() ?? "millis()";
27
+ const now = strategy?.currentTimeMillis?.() ?? "__tc_now_ms()";
28
28
  const waitForPinEdge = includeWaitForPinEdge ? `
29
29
  // HAL-level wait for pin edge — polling-based implementation.
30
30
  // Detects an actual transition (idle→target), not just the current level.
@@ -2,8 +2,8 @@ export type CopyleftRisk = "permissive" | "weak-copyleft" | "strong-copyleft" |
2
2
  /**
3
3
  * Where a license declaration was found.
4
4
  *
5
- * `"library.properties"` is the Arduino library-manifest form (kept verbatim
6
- * for Arduino parity); `"manifest"` is the framework-neutral form for any
5
+ * `"library.properties"` is the Arduino-ecosystem library-manifest form (kept
6
+ * verbatim for packages that carry one); `"manifest"` is the framework-neutral form for any
7
7
  * other manifest reader a framework supplies (e.g. a west module.yml).
8
8
  */
9
9
  export type LicenseSource = "library.properties" | "manifest" | "license-file" | "source-header" | "none";
@@ -22,9 +22,10 @@ export interface LibraryLicenseEntry {
22
22
  source: LicenseSource;
23
23
  }
24
24
  /**
25
- * Neutral dependency shape every framework adapts its enumeration to. Arduino
26
- * maps `{ name, version, install_dir }` → `{ name, version, installDir }`;
27
- * Zephyr maps a west-listed project (`{ name, abspath }`) the same way.
25
+ * Neutral dependency shape every framework adapts its enumeration to.
26
+ * Package-manager listings map `{ name, version, install_dir }` →
27
+ * `{ name, version, installDir }`; Zephyr maps a west-listed project
28
+ * (`{ name, abspath }`) the same way.
28
29
  */
29
30
  export interface DiscoveredDependency {
30
31
  name: string;
@@ -113,15 +114,16 @@ export interface ResolveLicenseOptions {
113
114
  subdirs?: readonly string[];
114
115
  /**
115
116
  * Read a manifest file's text for a license field. Given the install dir and
116
- * the readFile seam, return the raw license value (or undefined). Arduino
117
- * wires this to read `library.properties` `license=`. Omit to skip the
118
- * manifest step (e.g. a framework whose manifest carries no license field).
117
+ * the readFile seam, return the raw license value (or undefined). A
118
+ * library.properties-style adapter wires this to read its `license=` field.
119
+ * Omit to skip the manifest step (e.g. a framework whose manifest carries
120
+ * no license field).
119
121
  */
120
122
  readManifestLicense?: (installDir: string, readFile: ReadFile) => string | undefined;
121
123
  /**
122
124
  * LicenseSource label attached when the license is found via
123
- * `readManifestLicense`. Defaults to `"manifest"`; Arduino passes
124
- * `"library.properties"` for parity with its existing output.
125
+ * `readManifestLicense`. Defaults to `"manifest"`; a library.properties
126
+ * adapter passes `"library.properties"` for parity with its existing output.
125
127
  */
126
128
  manifestSourceLabel?: LicenseSource;
127
129
  }
@@ -6,7 +6,7 @@
6
6
  // classification) and the file-based license resolver (LICENSE file + source
7
7
  // header comments + an injected manifest reader) live here so every framework
8
8
  // package can reuse them. Each framework supplies only its own dependency
9
- // enumeration (arduino-cli lib list, west list, …) and a manifest reader, then
9
+ // enumeration (package-manager listings, west list, …) and a manifest reader, then
10
10
  // calls resolveLibraryLicense.
11
11
  //
12
12
  // Nothing here imports a framework package or shells out to a toolchain: all
@@ -72,7 +72,7 @@ export interface UploadResult {
72
72
  /**
73
73
  * Parse compile errors from output (GCC and Clang formats)
74
74
  */
75
- export declare function parseCompileErrors(output: string, sketchDir?: string): CompileError[];
75
+ export declare function parseCompileErrors(output: string, projectDir?: string): CompileError[];
76
76
  /**
77
77
  * Collect all .cpp files in a directory (non-recursive).
78
78
  */
@@ -17,7 +17,7 @@ const CLANG_ERROR = /^(.*?):(\d+):(\d+):\s*(error|warning|note):\s*(.*)$/i;
17
17
  /**
18
18
  * Parse compile errors from output (GCC and Clang formats)
19
19
  */
20
- export function parseCompileErrors(output, sketchDir) {
20
+ export function parseCompileErrors(output, projectDir) {
21
21
  const errors = [];
22
22
  for (const rawLine of output.split(/\r?\n/)) {
23
23
  const line = rawLine.trim();
@@ -34,9 +34,9 @@ export function parseCompileErrors(output, sketchDir) {
34
34
  const severity = severityRaw.includes("error") ? "error" : severityRaw === "warning" ? "warning" : "note";
35
35
  let filePath = match[1];
36
36
  // Normalize file paths
37
- if (sketchDir) {
37
+ if (projectDir) {
38
38
  if (!path.isAbsolute(filePath)) {
39
- const resolved = path.resolve(sketchDir, filePath);
39
+ const resolved = path.resolve(projectDir, filePath);
40
40
  if (fs.existsSync(resolved)) {
41
41
  filePath = resolved;
42
42
  }
@@ -47,9 +47,6 @@ export type TargetProfile = "generic" | (string & {});
47
47
  * Frameworks add their own context via the index signature.
48
48
  */
49
49
  export interface PlatformContext {
50
- console?: {
51
- baudRate?: number;
52
- };
53
50
  /** Target architecture identifier (e.g., 'avr', 'esp32'). Populated from board config. */
54
51
  architecture?: string;
55
52
  /** Framework-specific data. Each framework reads its own key. */
@@ -29,18 +29,13 @@ class Accumulator {
29
29
  const CATEGORY_PREFIXES = {
30
30
  gpio: ['gpio.'],
31
31
  pwm: ['pwm.'],
32
- rmt: ['rmt.'],
33
32
  adc: ['adc.'],
34
33
  dac: ['dac.'],
35
34
  interrupts: ['interrupt.'],
36
- tone: ['tone.'],
37
35
  timing: ['timing.'],
38
- power: ['power.'],
39
36
  i2c: ['i2c.'],
40
37
  spi: ['spi.'],
41
38
  uart: ['uart.'],
42
- pulse: ['pulse.'],
43
- shift: ['shift.'],
44
39
  board: ['board.'],
45
40
  wdt: ['wdt.'],
46
41
  wifi: ['wifi.'],
@@ -50,12 +45,7 @@ const CATEGORY_PREFIXES = {
50
45
  ble: ['ble.'],
51
46
  random: ['random.'],
52
47
  fs: ['fs.'],
53
- mdns: ['mdns.'],
54
48
  mqtt: ['mqtt.'],
55
- ota: ['ota.'],
56
- temp: ['temp.'],
57
- hwtimer: ['hwtimer.'],
58
- capacitive: ['capacitive.'],
59
49
  // Unimplemented-but-recognized categories: each framework may declare these
60
50
  // as unsupported in its manifest so the coverage matrix records them as a
61
51
  // roadmap. The validator probes the resolver and confirms it does NOT lower
@@ -64,14 +54,8 @@ const CATEGORY_PREFIXES = {
64
54
  twai: ['twai.'],
65
55
  usb: ['usb.'],
66
56
  eth: ['eth.'],
67
- espnow: ['espnow.'],
68
- crypto: ['crypto.'],
69
- pcnt: ['pcnt.'],
70
- mcpwm: ['mcpwm.'],
71
- // Worker offload + snprintf raw-escape: recognized categories. Frameworks
72
- // that lower worker.* declare it supported; snprintf.emit is a raw escape
73
- // hatch (declared unsupported by frameworks that don't special-case it).
74
- worker: ['worker.'],
57
+ // snprintf raw-escape: recognized category; declared unsupported by
58
+ // frameworks that don't special-case it.
75
59
  snprintf: ['snprintf.'],
76
60
  };
77
61
  function opKindsForCategory(category) {
@@ -90,8 +74,12 @@ function opKindsForCategory(category) {
90
74
  const OP_PROBE_PAYLOADS = {
91
75
  // i2c.write_bytes requires bus + bytes (resolver iterates bytes).
92
76
  'i2c.write_bytes': { bus: 'i2c0', address: 0x50, bytes: [0x00, 0x01] },
93
- // uart.printf requires format + args (resolver joins args).
94
- 'uart.printf': { port: 'Serial', format: '%d', args: ['x'] },
77
+ // usb.* require port (+ value/format where the resolver renders them).
78
+ 'usb.begin': { port: 'USB0' },
79
+ 'usb.print': { port: 'USB0', value: '"x"' },
80
+ 'usb.println': { port: 'USB0', value: '"x"' },
81
+ 'usb.write': { port: 'USB0', data: '"x"' },
82
+ 'usb.printf': { port: 'USB0', format: '%d', args: ['x'] },
95
83
  // adc.read / adc.read_voltage require pin.
96
84
  'adc.read': { pin: 0 },
97
85
  'adc.read_voltage': { pin: 0 },
@@ -112,10 +100,6 @@ const OP_PROBE_PAYLOADS = {
112
100
  'fs.remove': { path: '/sdcard/x.txt' },
113
101
  // random.range requires min/max.
114
102
  'random.range': { min: 0, max: 10 },
115
- // mdns.add_service requires instance/proto/port.
116
- 'mdns.start': { hostname: 'h' },
117
- 'mdns.set_hostname': { name: 'h' },
118
- 'mdns.add_service': { instance: 'i', proto: '_tcp', port: 80 },
119
103
  // mqtt.connect requires brokerUri/clientId; mqtt.publish requires topic/data.
120
104
  'mqtt.connect': { brokerUri: 'mqtt://b', clientId: 'c' },
121
105
  'mqtt.on_message': { handler: 'cb' },
@@ -125,16 +109,12 @@ const OP_PROBE_PAYLOADS = {
125
109
  // Without a payload the probe sends event=undefined and a 'supported'
126
110
  // declaration would false-fail as "resolver returned undefined".
127
111
  'wifi.on_event': { event: 'connect', handler: 'cb' },
128
- // ota.from_url requires url; ota.write requires chunk.
129
- 'ota.from_url': { url: 'https://x' },
130
- 'ota.write': { chunk: 'buf' },
131
- // hwtimer.* require an instance (and hz/handler).
132
- 'hwtimer.set_frequency': { instance: 0, hz: 1000 },
133
- 'hwtimer.on_overflow': { instance: 0, handler: 'cb' },
134
- 'hwtimer.start': { instance: 0 },
135
- 'hwtimer.stop': { instance: 0 },
136
112
  // capacitive.read requires pin.
137
- 'capacitive.read': { pin: 4 },
113
+ // sensor.* resolve their part against the generated catalog (hal's
114
+ // sensor-catalog.generated.ts) — sensirion_sht3xd is the stable probe part
115
+ // (in-tree since 2.x; the catalog regeneration checklist covers its removal).
116
+ 'sensor.fetch': { part: 'sensirion_sht3xd', bus: 'I2C0', address: 0x44 },
117
+ 'sensor.get': { part: 'sensirion_sht3xd', bus: 'I2C0', address: 0x44, chan: 'AMBIENT_TEMP' },
138
118
  };
139
119
  // Builds a HALOpIR probe. Uses OP_PROBE_PAYLOADS when available so resolvers
140
120
  // that destructure required fields don't throw on the probe itself.