@almadar/std 3.2.2 → 3.3.4

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/LICENSE +72 -21
  2. package/README.md +1 -1
  3. package/behaviors/exports/atoms/std-browse.orb +38 -45
  4. package/behaviors/exports/atoms/std-calendar.orb +770 -0
  5. package/behaviors/exports/atoms/std-combat-log.orb +12 -12
  6. package/behaviors/exports/atoms/std-dialogue-box.orb +11 -11
  7. package/behaviors/exports/atoms/std-display.orb +1175 -510
  8. package/behaviors/exports/atoms/std-drawer.orb +235 -133
  9. package/behaviors/exports/atoms/std-flip-card.orb +596 -0
  10. package/behaviors/exports/atoms/std-gallery.orb +382 -0
  11. package/behaviors/exports/atoms/std-game-audio.orb +9 -9
  12. package/behaviors/exports/atoms/std-game-canvas3d.orb +24 -24
  13. package/behaviors/exports/atoms/std-game-hud.orb +10 -10
  14. package/behaviors/exports/atoms/std-game-menu.orb +12 -12
  15. package/behaviors/exports/atoms/std-game-over-screen.orb +9 -9
  16. package/behaviors/exports/atoms/std-inventory-panel.orb +13 -13
  17. package/behaviors/exports/atoms/std-isometric-canvas.orb +9 -9
  18. package/behaviors/exports/atoms/std-loading.orb +131 -103
  19. package/behaviors/exports/atoms/std-modal.orb +5 -24
  20. package/behaviors/exports/atoms/std-notification.orb +71 -0
  21. package/behaviors/exports/atoms/std-pagination.orb +32 -40
  22. package/behaviors/exports/atoms/std-platformer-canvas.orb +9 -9
  23. package/behaviors/exports/atoms/std-rating.orb +328 -0
  24. package/behaviors/exports/atoms/std-score-board.orb +9 -9
  25. package/behaviors/exports/atoms/std-score.orb +41 -0
  26. package/behaviors/exports/atoms/std-search.orb +44 -30
  27. package/behaviors/exports/atoms/std-selection.orb +30 -24
  28. package/behaviors/exports/atoms/std-service-custom-bearer.orb +557 -0
  29. package/behaviors/exports/atoms/std-service-custom-header.orb +559 -0
  30. package/behaviors/exports/atoms/std-service-custom-noauth.orb +553 -0
  31. package/behaviors/exports/atoms/std-service-custom-query.orb +559 -0
  32. package/behaviors/exports/atoms/std-service-email.orb +540 -0
  33. package/behaviors/exports/atoms/std-service-github.orb +586 -0
  34. package/behaviors/exports/atoms/std-service-llm.orb +671 -0
  35. package/behaviors/exports/atoms/std-service-oauth.orb +764 -0
  36. package/behaviors/exports/atoms/std-service-redis.orb +580 -0
  37. package/behaviors/exports/atoms/std-service-storage.orb +664 -0
  38. package/behaviors/exports/atoms/std-service-stripe.orb +639 -0
  39. package/behaviors/exports/atoms/std-service-twilio.orb +611 -0
  40. package/behaviors/exports/atoms/std-service-youtube.orb +696 -0
  41. package/behaviors/exports/atoms/std-simulation-canvas.orb +9 -9
  42. package/behaviors/exports/atoms/std-sort.orb +82 -60
  43. package/behaviors/exports/atoms/std-sprite.orb +17 -17
  44. package/behaviors/exports/atoms/std-text-effects.orb +658 -0
  45. package/behaviors/exports/atoms/std-theme.orb +573 -0
  46. package/behaviors/exports/atoms/std-upload.orb +535 -0
  47. package/behaviors/exports/atoms/std-validate-on-save.orb +623 -0
  48. package/behaviors/exports/atoms/std-wizard.orb +664 -224
  49. package/behaviors/exports/molecules/std-builder-game.orb +43 -3
  50. package/behaviors/exports/molecules/std-cart.orb +319 -101
  51. package/behaviors/exports/molecules/std-classifier-game.orb +43 -3
  52. package/behaviors/exports/molecules/std-debugger-game.orb +43 -3
  53. package/behaviors/exports/molecules/std-detail.orb +46 -49
  54. package/behaviors/exports/molecules/std-event-handler-game.orb +43 -3
  55. package/behaviors/exports/molecules/std-form-advanced.orb +654 -0
  56. package/behaviors/exports/molecules/std-geospatial.orb +48 -48
  57. package/behaviors/exports/molecules/std-inventory.orb +70 -50
  58. package/behaviors/exports/molecules/std-list.orb +174 -197
  59. package/behaviors/exports/molecules/std-messaging.orb +35 -50
  60. package/behaviors/exports/molecules/std-negotiator-game.orb +43 -3
  61. package/behaviors/exports/molecules/std-platformer-game.orb +18 -2
  62. package/behaviors/exports/molecules/std-puzzle-game.orb +32 -6
  63. package/behaviors/exports/molecules/std-quiz.orb +1069 -0
  64. package/behaviors/exports/molecules/std-sequencer-game.orb +43 -3
  65. package/behaviors/exports/molecules/std-service-content-pipeline.orb +915 -0
  66. package/behaviors/exports/molecules/std-service-custom-api-tester.orb +860 -0
  67. package/behaviors/exports/molecules/std-service-devops-toolkit.orb +1526 -0
  68. package/behaviors/exports/molecules/std-service-notification-hub.orb +696 -0
  69. package/behaviors/exports/molecules/std-service-payment-flow.orb +873 -0
  70. package/behaviors/exports/molecules/std-simulator-game.orb +43 -3
  71. package/behaviors/exports/molecules/std-turn-based-battle.orb +26 -0
  72. package/behaviors/exports/organisms/std-api-gateway.orb +2326 -1320
  73. package/behaviors/exports/organisms/std-arcade-game.orb +377 -265
  74. package/behaviors/exports/organisms/std-booking-system.orb +3144 -1855
  75. package/behaviors/exports/organisms/std-cicd-pipeline.orb +2107 -1122
  76. package/behaviors/exports/organisms/std-cms.orb +929 -822
  77. package/behaviors/exports/organisms/std-coding-academy.orb +1347 -458
  78. package/behaviors/exports/organisms/std-crm.orb +2302 -1282
  79. package/behaviors/exports/organisms/std-devops-dashboard.orb +3902 -2005
  80. package/behaviors/exports/organisms/std-ecommerce.orb +2432 -1630
  81. package/behaviors/exports/organisms/std-finance-tracker.orb +1674 -846
  82. package/behaviors/exports/organisms/std-healthcare.orb +3545 -1992
  83. package/behaviors/exports/organisms/std-helpdesk.orb +1853 -940
  84. package/behaviors/exports/organisms/std-hr-portal.orb +3249 -1939
  85. package/behaviors/exports/organisms/std-iot-dashboard.orb +2422 -1418
  86. package/behaviors/exports/organisms/std-lms.orb +2495 -1435
  87. package/behaviors/exports/organisms/std-logic-training.orb +220 -66
  88. package/behaviors/exports/organisms/std-platformer-app.orb +345 -214
  89. package/behaviors/exports/organisms/std-project-manager.orb +2217 -1190
  90. package/behaviors/exports/organisms/std-puzzle-app.orb +228 -103
  91. package/behaviors/exports/organisms/std-realtime-chat.orb +1887 -1051
  92. package/behaviors/exports/organisms/std-rpg-game.orb +1170 -948
  93. package/behaviors/exports/organisms/std-service-marketplace.orb +5191 -0
  94. package/behaviors/exports/organisms/std-service-research-assistant.orb +3568 -0
  95. package/behaviors/exports/organisms/std-social-feed.orb +184 -172
  96. package/behaviors/exports/organisms/std-stem-lab.orb +1308 -482
  97. package/behaviors/exports/organisms/std-strategy-game.orb +1520 -696
  98. package/behaviors/exports/organisms/std-trading-dashboard.orb +1884 -904
  99. package/behaviors/exports/test-schemas/os-trigger-simulation.orb +202 -0
  100. package/behaviors/exports/validation-report.json +0 -747
  101. package/dist/behaviors/exports/atoms/std-browse.orb +38 -45
  102. package/dist/behaviors/exports/atoms/std-calendar.orb +770 -0
  103. package/dist/behaviors/exports/atoms/std-combat-log.orb +12 -12
  104. package/dist/behaviors/exports/atoms/std-dialogue-box.orb +11 -11
  105. package/dist/behaviors/exports/atoms/std-display.orb +1175 -510
  106. package/dist/behaviors/exports/atoms/std-drawer.orb +235 -133
  107. package/dist/behaviors/exports/atoms/std-flip-card.orb +596 -0
  108. package/dist/behaviors/exports/atoms/std-gallery.orb +382 -0
  109. package/dist/behaviors/exports/atoms/std-game-audio.orb +9 -9
  110. package/dist/behaviors/exports/atoms/std-game-canvas3d.orb +24 -24
  111. package/dist/behaviors/exports/atoms/std-game-hud.orb +10 -10
  112. package/dist/behaviors/exports/atoms/std-game-menu.orb +12 -12
  113. package/dist/behaviors/exports/atoms/std-game-over-screen.orb +9 -9
  114. package/dist/behaviors/exports/atoms/std-inventory-panel.orb +13 -13
  115. package/dist/behaviors/exports/atoms/std-isometric-canvas.orb +9 -9
  116. package/dist/behaviors/exports/atoms/std-loading.orb +131 -103
  117. package/dist/behaviors/exports/atoms/std-modal.orb +5 -24
  118. package/dist/behaviors/exports/atoms/std-notification.orb +71 -0
  119. package/dist/behaviors/exports/atoms/std-pagination.orb +32 -40
  120. package/dist/behaviors/exports/atoms/std-platformer-canvas.orb +9 -9
  121. package/dist/behaviors/exports/atoms/std-rating.orb +328 -0
  122. package/dist/behaviors/exports/atoms/std-score-board.orb +9 -9
  123. package/dist/behaviors/exports/atoms/std-score.orb +41 -0
  124. package/dist/behaviors/exports/atoms/std-search.orb +44 -30
  125. package/dist/behaviors/exports/atoms/std-selection.orb +30 -24
  126. package/dist/behaviors/exports/atoms/std-service-custom-bearer.orb +557 -0
  127. package/dist/behaviors/exports/atoms/std-service-custom-header.orb +559 -0
  128. package/dist/behaviors/exports/atoms/std-service-custom-noauth.orb +553 -0
  129. package/dist/behaviors/exports/atoms/std-service-custom-query.orb +559 -0
  130. package/dist/behaviors/exports/atoms/std-service-email.orb +540 -0
  131. package/dist/behaviors/exports/atoms/std-service-github.orb +586 -0
  132. package/dist/behaviors/exports/atoms/std-service-llm.orb +671 -0
  133. package/dist/behaviors/exports/atoms/std-service-oauth.orb +764 -0
  134. package/dist/behaviors/exports/atoms/std-service-redis.orb +580 -0
  135. package/dist/behaviors/exports/atoms/std-service-storage.orb +664 -0
  136. package/dist/behaviors/exports/atoms/std-service-stripe.orb +639 -0
  137. package/dist/behaviors/exports/atoms/std-service-twilio.orb +611 -0
  138. package/dist/behaviors/exports/atoms/std-service-youtube.orb +696 -0
  139. package/dist/behaviors/exports/atoms/std-simulation-canvas.orb +9 -9
  140. package/dist/behaviors/exports/atoms/std-sort.orb +82 -60
  141. package/dist/behaviors/exports/atoms/std-sprite.orb +17 -17
  142. package/dist/behaviors/exports/atoms/std-text-effects.orb +658 -0
  143. package/dist/behaviors/exports/atoms/std-theme.orb +573 -0
  144. package/dist/behaviors/exports/atoms/std-upload.orb +535 -0
  145. package/dist/behaviors/exports/atoms/std-validate-on-save.orb +623 -0
  146. package/dist/behaviors/exports/atoms/std-wizard.orb +664 -224
  147. package/dist/behaviors/exports/molecules/std-builder-game.orb +43 -3
  148. package/dist/behaviors/exports/molecules/std-cart.orb +319 -101
  149. package/dist/behaviors/exports/molecules/std-classifier-game.orb +43 -3
  150. package/dist/behaviors/exports/molecules/std-debugger-game.orb +43 -3
  151. package/dist/behaviors/exports/molecules/std-detail.orb +46 -49
  152. package/dist/behaviors/exports/molecules/std-event-handler-game.orb +43 -3
  153. package/dist/behaviors/exports/molecules/std-form-advanced.orb +654 -0
  154. package/dist/behaviors/exports/molecules/std-geospatial.orb +48 -48
  155. package/dist/behaviors/exports/molecules/std-inventory.orb +70 -50
  156. package/dist/behaviors/exports/molecules/std-list.orb +174 -197
  157. package/dist/behaviors/exports/molecules/std-messaging.orb +35 -50
  158. package/dist/behaviors/exports/molecules/std-negotiator-game.orb +43 -3
  159. package/dist/behaviors/exports/molecules/std-platformer-game.orb +18 -2
  160. package/dist/behaviors/exports/molecules/std-puzzle-game.orb +32 -6
  161. package/dist/behaviors/exports/molecules/std-quiz.orb +1069 -0
  162. package/dist/behaviors/exports/molecules/std-sequencer-game.orb +43 -3
  163. package/dist/behaviors/exports/molecules/std-service-content-pipeline.orb +915 -0
  164. package/dist/behaviors/exports/molecules/std-service-custom-api-tester.orb +860 -0
  165. package/dist/behaviors/exports/molecules/std-service-devops-toolkit.orb +1526 -0
  166. package/dist/behaviors/exports/molecules/std-service-notification-hub.orb +696 -0
  167. package/dist/behaviors/exports/molecules/std-service-payment-flow.orb +873 -0
  168. package/dist/behaviors/exports/molecules/std-simulator-game.orb +43 -3
  169. package/dist/behaviors/exports/molecules/std-turn-based-battle.orb +26 -0
  170. package/dist/behaviors/exports/organisms/std-api-gateway.orb +2326 -1320
  171. package/dist/behaviors/exports/organisms/std-arcade-game.orb +377 -265
  172. package/dist/behaviors/exports/organisms/std-booking-system.orb +3144 -1855
  173. package/dist/behaviors/exports/organisms/std-cicd-pipeline.orb +2107 -1122
  174. package/dist/behaviors/exports/organisms/std-cms.orb +929 -822
  175. package/dist/behaviors/exports/organisms/std-coding-academy.orb +1347 -458
  176. package/dist/behaviors/exports/organisms/std-crm.orb +2302 -1282
  177. package/dist/behaviors/exports/organisms/std-devops-dashboard.orb +3902 -2005
  178. package/dist/behaviors/exports/organisms/std-ecommerce.orb +2432 -1630
  179. package/dist/behaviors/exports/organisms/std-finance-tracker.orb +1674 -846
  180. package/dist/behaviors/exports/organisms/std-healthcare.orb +3545 -1992
  181. package/dist/behaviors/exports/organisms/std-helpdesk.orb +1853 -940
  182. package/dist/behaviors/exports/organisms/std-hr-portal.orb +3249 -1939
  183. package/dist/behaviors/exports/organisms/std-iot-dashboard.orb +2422 -1418
  184. package/dist/behaviors/exports/organisms/std-lms.orb +2495 -1435
  185. package/dist/behaviors/exports/organisms/std-logic-training.orb +220 -66
  186. package/dist/behaviors/exports/organisms/std-platformer-app.orb +345 -214
  187. package/dist/behaviors/exports/organisms/std-project-manager.orb +2217 -1190
  188. package/dist/behaviors/exports/organisms/std-puzzle-app.orb +228 -103
  189. package/dist/behaviors/exports/organisms/std-realtime-chat.orb +1887 -1051
  190. package/dist/behaviors/exports/organisms/std-rpg-game.orb +1170 -948
  191. package/dist/behaviors/exports/organisms/std-service-marketplace.orb +5191 -0
  192. package/dist/behaviors/exports/organisms/std-service-research-assistant.orb +3568 -0
  193. package/dist/behaviors/exports/organisms/std-social-feed.orb +184 -172
  194. package/dist/behaviors/exports/organisms/std-stem-lab.orb +1308 -482
  195. package/dist/behaviors/exports/organisms/std-strategy-game.orb +1520 -696
  196. package/dist/behaviors/exports/organisms/std-trading-dashboard.orb +1884 -904
  197. package/dist/behaviors/exports/test-schemas/os-trigger-simulation.orb +202 -0
  198. package/dist/behaviors/exports/validation-report.json +0 -747
  199. package/dist/behaviors/functions/index.d.ts +931 -1
  200. package/dist/behaviors/functions/index.js +12511 -4634
  201. package/dist/behaviors/functions/index.js.map +1 -1
  202. package/dist/behaviors/index.d.ts +1 -1
  203. package/dist/behaviors/index.js +12434 -4557
  204. package/dist/behaviors/index.js.map +1 -1
  205. package/dist/exports/atoms/std-browse.orb +38 -45
  206. package/dist/exports/atoms/std-calendar.orb +770 -0
  207. package/dist/exports/atoms/std-combat-log.orb +12 -12
  208. package/dist/exports/atoms/std-dialogue-box.orb +11 -11
  209. package/dist/exports/atoms/std-display.orb +1175 -510
  210. package/dist/exports/atoms/std-drawer.orb +235 -133
  211. package/dist/exports/atoms/std-flip-card.orb +596 -0
  212. package/dist/exports/atoms/std-gallery.orb +382 -0
  213. package/dist/exports/atoms/std-game-audio.orb +9 -9
  214. package/dist/exports/atoms/std-game-canvas3d.orb +24 -24
  215. package/dist/exports/atoms/std-game-hud.orb +10 -10
  216. package/dist/exports/atoms/std-game-menu.orb +12 -12
  217. package/dist/exports/atoms/std-game-over-screen.orb +9 -9
  218. package/dist/exports/atoms/std-inventory-panel.orb +13 -13
  219. package/dist/exports/atoms/std-isometric-canvas.orb +9 -9
  220. package/dist/exports/atoms/std-loading.orb +131 -103
  221. package/dist/exports/atoms/std-modal.orb +5 -24
  222. package/dist/exports/atoms/std-notification.orb +71 -0
  223. package/dist/exports/atoms/std-pagination.orb +32 -40
  224. package/dist/exports/atoms/std-platformer-canvas.orb +9 -9
  225. package/dist/exports/atoms/std-rating.orb +328 -0
  226. package/dist/exports/atoms/std-score-board.orb +9 -9
  227. package/dist/exports/atoms/std-score.orb +41 -0
  228. package/dist/exports/atoms/std-search.orb +44 -30
  229. package/dist/exports/atoms/std-selection.orb +30 -24
  230. package/dist/exports/atoms/std-service-custom-bearer.orb +557 -0
  231. package/dist/exports/atoms/std-service-custom-header.orb +559 -0
  232. package/dist/exports/atoms/std-service-custom-noauth.orb +553 -0
  233. package/dist/exports/atoms/std-service-custom-query.orb +559 -0
  234. package/dist/exports/atoms/std-service-email.orb +540 -0
  235. package/dist/exports/atoms/std-service-github.orb +586 -0
  236. package/dist/exports/atoms/std-service-llm.orb +671 -0
  237. package/dist/exports/atoms/std-service-oauth.orb +764 -0
  238. package/dist/exports/atoms/std-service-redis.orb +580 -0
  239. package/dist/exports/atoms/std-service-storage.orb +664 -0
  240. package/dist/exports/atoms/std-service-stripe.orb +639 -0
  241. package/dist/exports/atoms/std-service-twilio.orb +611 -0
  242. package/dist/exports/atoms/std-service-youtube.orb +696 -0
  243. package/dist/exports/atoms/std-simulation-canvas.orb +9 -9
  244. package/dist/exports/atoms/std-sort.orb +82 -60
  245. package/dist/exports/atoms/std-sprite.orb +17 -17
  246. package/dist/exports/atoms/std-text-effects.orb +658 -0
  247. package/dist/exports/atoms/std-theme.orb +573 -0
  248. package/dist/exports/atoms/std-upload.orb +535 -0
  249. package/dist/exports/atoms/std-validate-on-save.orb +623 -0
  250. package/dist/exports/atoms/std-wizard.orb +664 -224
  251. package/dist/exports/molecules/std-builder-game.orb +43 -3
  252. package/dist/exports/molecules/std-cart.orb +319 -101
  253. package/dist/exports/molecules/std-classifier-game.orb +43 -3
  254. package/dist/exports/molecules/std-debugger-game.orb +43 -3
  255. package/dist/exports/molecules/std-detail.orb +46 -49
  256. package/dist/exports/molecules/std-event-handler-game.orb +43 -3
  257. package/dist/exports/molecules/std-form-advanced.orb +654 -0
  258. package/dist/exports/molecules/std-geospatial.orb +48 -48
  259. package/dist/exports/molecules/std-inventory.orb +70 -50
  260. package/dist/exports/molecules/std-list.orb +174 -197
  261. package/dist/exports/molecules/std-messaging.orb +35 -50
  262. package/dist/exports/molecules/std-negotiator-game.orb +43 -3
  263. package/dist/exports/molecules/std-platformer-game.orb +18 -2
  264. package/dist/exports/molecules/std-puzzle-game.orb +32 -6
  265. package/dist/exports/molecules/std-quiz.orb +1069 -0
  266. package/dist/exports/molecules/std-sequencer-game.orb +43 -3
  267. package/dist/exports/molecules/std-service-content-pipeline.orb +915 -0
  268. package/dist/exports/molecules/std-service-custom-api-tester.orb +860 -0
  269. package/dist/exports/molecules/std-service-devops-toolkit.orb +1526 -0
  270. package/dist/exports/molecules/std-service-notification-hub.orb +696 -0
  271. package/dist/exports/molecules/std-service-payment-flow.orb +873 -0
  272. package/dist/exports/molecules/std-simulator-game.orb +43 -3
  273. package/dist/exports/molecules/std-turn-based-battle.orb +26 -0
  274. package/dist/exports/organisms/std-api-gateway.orb +2326 -1320
  275. package/dist/exports/organisms/std-arcade-game.orb +377 -265
  276. package/dist/exports/organisms/std-booking-system.orb +3144 -1855
  277. package/dist/exports/organisms/std-cicd-pipeline.orb +2107 -1122
  278. package/dist/exports/organisms/std-cms.orb +929 -822
  279. package/dist/exports/organisms/std-coding-academy.orb +1347 -458
  280. package/dist/exports/organisms/std-crm.orb +2302 -1282
  281. package/dist/exports/organisms/std-devops-dashboard.orb +3902 -2005
  282. package/dist/exports/organisms/std-ecommerce.orb +2432 -1630
  283. package/dist/exports/organisms/std-finance-tracker.orb +1674 -846
  284. package/dist/exports/organisms/std-healthcare.orb +3545 -1992
  285. package/dist/exports/organisms/std-helpdesk.orb +1853 -940
  286. package/dist/exports/organisms/std-hr-portal.orb +3249 -1939
  287. package/dist/exports/organisms/std-iot-dashboard.orb +2422 -1418
  288. package/dist/exports/organisms/std-lms.orb +2495 -1435
  289. package/dist/exports/organisms/std-logic-training.orb +220 -66
  290. package/dist/exports/organisms/std-platformer-app.orb +345 -214
  291. package/dist/exports/organisms/std-project-manager.orb +2217 -1190
  292. package/dist/exports/organisms/std-puzzle-app.orb +228 -103
  293. package/dist/exports/organisms/std-realtime-chat.orb +1887 -1051
  294. package/dist/exports/organisms/std-rpg-game.orb +1170 -948
  295. package/dist/exports/organisms/std-service-marketplace.orb +5191 -0
  296. package/dist/exports/organisms/std-service-research-assistant.orb +3568 -0
  297. package/dist/exports/organisms/std-social-feed.orb +184 -172
  298. package/dist/exports/organisms/std-stem-lab.orb +1308 -482
  299. package/dist/exports/organisms/std-strategy-game.orb +1520 -696
  300. package/dist/exports/organisms/std-trading-dashboard.orb +1884 -904
  301. package/dist/exports/test-schemas/os-trigger-simulation.orb +202 -0
  302. package/dist/exports/validation-report.json +0 -747
  303. package/dist/index.d.ts +3 -3
  304. package/dist/index.js +12826 -4799
  305. package/dist/index.js.map +1 -1
  306. package/dist/modules/array.d.ts +1 -1
  307. package/dist/modules/async.d.ts +1 -1
  308. package/dist/modules/contract.d.ts +22 -0
  309. package/dist/modules/contract.js +100 -0
  310. package/dist/modules/contract.js.map +1 -0
  311. package/dist/modules/data.d.ts +22 -0
  312. package/dist/modules/data.js +117 -0
  313. package/dist/modules/data.js.map +1 -0
  314. package/dist/modules/format.d.ts +1 -1
  315. package/dist/modules/graph.d.ts +23 -0
  316. package/dist/modules/graph.js +209 -0
  317. package/dist/modules/graph.js.map +1 -0
  318. package/dist/modules/index.d.ts +5 -1
  319. package/dist/modules/index.js +593 -63
  320. package/dist/modules/index.js.map +1 -1
  321. package/dist/modules/math.d.ts +1 -1
  322. package/dist/modules/nn.d.ts +1 -1
  323. package/dist/modules/nn.js +14 -14
  324. package/dist/modules/nn.js.map +1 -1
  325. package/dist/modules/object.d.ts +1 -1
  326. package/dist/modules/os.d.ts +19 -0
  327. package/dist/modules/os.js +116 -0
  328. package/dist/modules/os.js.map +1 -0
  329. package/dist/modules/prob.d.ts +1 -1
  330. package/dist/modules/str.d.ts +1 -1
  331. package/dist/modules/tensor.d.ts +1 -1
  332. package/dist/modules/tensor.js +29 -29
  333. package/dist/modules/tensor.js.map +1 -1
  334. package/dist/modules/time.d.ts +1 -1
  335. package/dist/modules/train.d.ts +1 -1
  336. package/dist/modules/train.js +19 -19
  337. package/dist/modules/train.js.map +1 -1
  338. package/dist/modules/validate.d.ts +1 -1
  339. package/dist/registry.d.ts +2 -2
  340. package/dist/registry.js +184 -65
  341. package/dist/registry.js.map +1 -1
  342. package/dist/{types-CmNM_IbV.d.ts → types-DOeGXRCm.d.ts} +3 -3
  343. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"sources":["../../modules/tensor.ts"],"names":[],"mappings":";AAgBO,IAAM,gBAAA,GAAoD;AAAA;AAAA;AAAA;AAAA,EAK/D,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ,QAAA;AAAA,IACR,QAAA,EAAU,YAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,0BAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,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;AAAA,IACV,WAAA,EAAa,gCAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,YAAA;AAAa,KAC9D;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,MAAA,EAAQ,QAAA;AAAA,IACR,QAAA,EAAU,YAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,iCAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,UAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,yBAAA;AAA0B,KAC3E;AAAA,IACA,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,kBAAA,GAA+B;AAC7C,EAAA,OAAO,MAAA,CAAO,KAAK,gBAAgB,CAAA;AACrC","file":"tensor.js","sourcesContent":["/**\n * Tensor Module - Tensor Operations\n *\n * Provides operators for creating and manipulating tensors.\n * Tensors are multi-dimensional arrays used for neural network inputs/outputs.\n * Compiled to native tensor libraries (PyTorch, NumPy, etc.) by the Rust compiler.\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Tensor module operators.\n * These operators create and manipulate tensors.\n */\nexport const TENSOR_OPERATORS: Record<string, StdOperatorMeta> = {\n // ============================================================================\n // Creation\n // ============================================================================\n\n 'tensor/from': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Create tensor from array',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'data', type: 'array', description: 'Array of numbers (can be nested for multi-dimensional)' },\n ],\n example: '[\"tensor/from\", [1.0, 2.0, 3.0]]',\n },\n 'tensor/zeros': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Create tensor filled with zeros',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'shape', type: 'number[]', description: 'Shape of the tensor' },\n ],\n example: '[\"tensor/zeros\", [3, 4]] // 3x4 tensor of zeros',\n },\n 'tensor/ones': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Create tensor filled with ones',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'shape', type: 'number[]', description: 'Shape of the tensor' },\n ],\n example: '[\"tensor/ones\", [3, 4]] // 3x4 tensor of ones',\n },\n 'tensor/rand': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Create tensor with random values in [0, 1)',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'shape', type: 'number[]', description: 'Shape of the tensor' },\n ],\n example: '[\"tensor/rand\", [16]] // Random 16-element vector',\n },\n 'tensor/randn': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Create tensor with random values from standard normal distribution',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'shape', type: 'number[]', description: 'Shape of the tensor' },\n ],\n example: '[\"tensor/randn\", [16]] // Random normal 16-element vector',\n },\n\n // ============================================================================\n // Shape & Indexing\n // ============================================================================\n\n 'tensor/shape': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Get tensor shape as array',\n hasSideEffects: false,\n returnType: 'number[]',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n ],\n example: '[\"tensor/shape\", \"@entity.sensors\"] // => [16]',\n },\n 'tensor/get': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Get element at index',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'index', type: 'number | number[]', description: 'Index (single for 1D, array for multi-D)' },\n ],\n example: '[\"tensor/get\", \"@entity.output\", 3] // Get 4th element',\n },\n 'tensor/slice': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 3,\n maxArity: 3,\n description: 'Get slice of tensor',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'start', type: 'number', description: 'Start index' },\n { name: 'end', type: 'number', description: 'End index (exclusive)' },\n ],\n example: '[\"tensor/slice\", \"@entity.output\", 0, 3] // First 3 elements',\n },\n 'tensor/reshape': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Reshape tensor to new shape (total elements must match)',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'shape', type: 'number[]', description: 'New shape' },\n ],\n example: '[\"tensor/reshape\", \"@entity.data\", [4, 4]] // Reshape to 4x4',\n },\n 'tensor/flatten': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Flatten tensor to 1D',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n ],\n example: '[\"tensor/flatten\", \"@entity.data\"]',\n },\n\n // ============================================================================\n // Math Operations\n // ============================================================================\n\n 'tensor/add': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Element-wise addition',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'a', type: 'tensor', description: 'First tensor' },\n { name: 'b', type: 'tensor | number', description: 'Second tensor or scalar' },\n ],\n example: '[\"tensor/add\", \"@entity.a\", \"@entity.b\"]',\n },\n 'tensor/sub': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Element-wise subtraction',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'a', type: 'tensor', description: 'First tensor' },\n { name: 'b', type: 'tensor | number', description: 'Second tensor or scalar' },\n ],\n example: '[\"tensor/sub\", \"@entity.a\", \"@entity.b\"]',\n },\n 'tensor/mul': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Element-wise multiplication',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'a', type: 'tensor', description: 'First tensor' },\n { name: 'b', type: 'tensor | number', description: 'Second tensor or scalar' },\n ],\n example: '[\"tensor/mul\", \"@entity.weights\", 0.99] // Decay weights',\n },\n 'tensor/div': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Element-wise division',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'a', type: 'tensor', description: 'First tensor' },\n { name: 'b', type: 'tensor | number', description: 'Second tensor or scalar' },\n ],\n example: '[\"tensor/div\", \"@entity.gradient\", \"@entity.batchSize\"]',\n },\n 'tensor/matmul': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Matrix multiplication',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'a', type: 'tensor', description: 'First tensor (NxM)' },\n { name: 'b', type: 'tensor', description: 'Second tensor (MxK)' },\n ],\n example: '[\"tensor/matmul\", \"@entity.input\", \"@entity.weights\"]',\n },\n 'tensor/dot': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Dot product of two 1D tensors',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'a', type: 'tensor', description: 'First vector' },\n { name: 'b', type: 'tensor', description: 'Second vector' },\n ],\n example: '[\"tensor/dot\", \"@entity.a\", \"@entity.b\"]',\n },\n\n // ============================================================================\n // Reductions\n // ============================================================================\n\n 'tensor/sum': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'Sum of tensor elements',\n hasSideEffects: false,\n returnType: 'number | tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'dim', type: 'number', description: 'Dimension to reduce', optional: true },\n ],\n example: '[\"tensor/sum\", \"@entity.rewards\"] // Total reward',\n },\n 'tensor/mean': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'Mean of tensor elements',\n hasSideEffects: false,\n returnType: 'number | tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'dim', type: 'number', description: 'Dimension to reduce', optional: true },\n ],\n example: '[\"tensor/mean\", \"@entity.losses\"]',\n },\n 'tensor/max': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'Maximum value in tensor',\n hasSideEffects: false,\n returnType: 'number | tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'dim', type: 'number', description: 'Dimension to reduce', optional: true },\n ],\n example: '[\"tensor/max\", \"@entity.qValues\"]',\n },\n 'tensor/min': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'Minimum value in tensor',\n hasSideEffects: false,\n returnType: 'number | tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'dim', type: 'number', description: 'Dimension to reduce', optional: true },\n ],\n example: '[\"tensor/min\", \"@entity.distances\"]',\n },\n 'tensor/argmax': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'Index of maximum value',\n hasSideEffects: false,\n returnType: 'number | tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'dim', type: 'number', description: 'Dimension to reduce', optional: true },\n ],\n example: '[\"tensor/argmax\", \"@entity.qValues\"] // Best action index',\n },\n 'tensor/norm': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'L2 norm of tensor',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'p', type: 'number', description: 'Norm order (default 2)', optional: true, defaultValue: 2 },\n ],\n example: '[\"tensor/norm\", \"@entity.gradient\"]',\n },\n\n // ============================================================================\n // Range Validation (for contracts)\n // ============================================================================\n\n 'tensor/allInRange': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Check if all elements are within range [min, max]',\n hasSideEffects: false,\n returnType: 'boolean',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'range', type: '[number, number]', description: 'Range as [min, max]' },\n ],\n example: '[\"tensor/allInRange\", \"@payload.input\", [-1.0, 1.0]]',\n },\n 'tensor/outOfRangeIndices': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Get indices of elements outside range',\n hasSideEffects: false,\n returnType: 'number[]',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'range', type: '[number, number]', description: 'Range as [min, max]' },\n ],\n example: '[\"tensor/outOfRangeIndices\", \"@payload.input\", [-1.0, 1.0]]',\n },\n 'tensor/clamp': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 3,\n maxArity: 3,\n description: 'Clamp all elements to range [min, max]',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'min', type: 'number', description: 'Minimum value' },\n { name: 'max', type: 'number', description: 'Maximum value' },\n ],\n example: '[\"tensor/clamp\", \"@entity.output\", -10.0, 10.0]',\n },\n 'tensor/clampPerDim': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Clamp each dimension to its specified range',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'ranges', type: 'object', description: 'Per-dimension ranges { \"0\": {min, max}, ... }' },\n ],\n example: '[\"tensor/clampPerDim\", \"@entity.rawOutput\", \"@entity.outputContract.ranges\"]',\n },\n 'tensor/outOfRangeDims': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Get dimensions that exceed their specified ranges',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'ranges', type: 'object', description: 'Per-dimension ranges { \"0\": {min, max}, ... }' },\n ],\n example: '[\"tensor/outOfRangeDims\", \"@entity.rawOutput\", \"@entity.outputContract.ranges\"]',\n },\n\n // ============================================================================\n // Conversion\n // ============================================================================\n\n 'tensor/toArray': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Convert tensor to nested array',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n ],\n example: '[\"tensor/toArray\", \"@entity.output\"]',\n },\n 'tensor/toList': {\n module: 'tensor',\n category: 'std-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Convert 1D tensor to flat array',\n hasSideEffects: false,\n returnType: 'number[]',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor (must be 1D)' },\n ],\n example: '[\"tensor/toList\", \"@entity.output\"]',\n },\n};\n\n/**\n * Get all tensor operator names.\n */\nexport function getTensorOperators(): string[] {\n return Object.keys(TENSOR_OPERATORS);\n}\n"]}
1
+ {"version":3,"sources":["../../modules/tensor.ts"],"names":[],"mappings":";AAgBO,IAAM,gBAAA,GAAoD;AAAA;AAAA;AAAA;AAAA,EAK/D,aAAA,EAAe;AAAA,IACb,MAAA,EAAQ,QAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,0BAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAA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B,UAAA,EAAY,OAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,YAAA;AAAa,KAC9D;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AAAA,EACA,eAAA,EAAiB;AAAA,IACf,MAAA,EAAQ,QAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,iCAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,UAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,yBAAA;AAA0B,KAC3E;AAAA,IACA,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,kBAAA,GAA+B;AAC7C,EAAA,OAAO,MAAA,CAAO,KAAK,gBAAgB,CAAA;AACrC","file":"tensor.js","sourcesContent":["/**\n * Tensor Module - Tensor Operations\n *\n * Provides operators for creating and manipulating tensors.\n * Tensors are multi-dimensional arrays used for neural network inputs/outputs.\n * Compiled to native tensor libraries (PyTorch, NumPy, etc.) by the Rust compiler.\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Tensor module operators.\n * These operators create and manipulate tensors.\n */\nexport const TENSOR_OPERATORS: Record<string, StdOperatorMeta> = {\n // ============================================================================\n // Creation\n // ============================================================================\n\n 'tensor/from': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Create tensor from array',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'data', type: 'array', description: 'Array of numbers (can be nested for multi-dimensional)' },\n ],\n example: '[\"tensor/from\", [1.0, 2.0, 3.0]]',\n },\n 'tensor/zeros': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Create tensor filled with zeros',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'shape', type: 'number[]', description: 'Shape of the tensor' },\n ],\n example: '[\"tensor/zeros\", [3, 4]] // 3x4 tensor of zeros',\n },\n 'tensor/ones': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Create tensor filled with ones',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'shape', type: 'number[]', description: 'Shape of the tensor' },\n ],\n example: '[\"tensor/ones\", [3, 4]] // 3x4 tensor of ones',\n },\n 'tensor/rand': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Create tensor with random values in [0, 1)',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'shape', type: 'number[]', description: 'Shape of the tensor' },\n ],\n example: '[\"tensor/rand\", [16]] // Random 16-element vector',\n },\n 'tensor/randn': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Create tensor with random values from standard normal distribution',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'shape', type: 'number[]', description: 'Shape of the tensor' },\n ],\n example: '[\"tensor/randn\", [16]] // Random normal 16-element vector',\n },\n\n // ============================================================================\n // Shape & Indexing\n // ============================================================================\n\n 'tensor/shape': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Get tensor shape as array',\n hasSideEffects: false,\n returnType: 'number[]',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n ],\n example: '[\"tensor/shape\", \"@entity.sensors\"] // => [16]',\n },\n 'tensor/get': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Get element at index',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'index', type: 'number | number[]', description: 'Index (single for 1D, array for multi-D)' },\n ],\n example: '[\"tensor/get\", \"@entity.output\", 3] // Get 4th element',\n },\n 'tensor/slice': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 3,\n maxArity: 3,\n description: 'Get slice of tensor',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'start', type: 'number', description: 'Start index' },\n { name: 'end', type: 'number', description: 'End index (exclusive)' },\n ],\n example: '[\"tensor/slice\", \"@entity.output\", 0, 3] // First 3 elements',\n },\n 'tensor/reshape': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Reshape tensor to new shape (total elements must match)',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'shape', type: 'number[]', description: 'New shape' },\n ],\n example: '[\"tensor/reshape\", \"@entity.data\", [4, 4]] // Reshape to 4x4',\n },\n 'tensor/flatten': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Flatten tensor to 1D',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n ],\n example: '[\"tensor/flatten\", \"@entity.data\"]',\n },\n\n // ============================================================================\n // Math Operations\n // ============================================================================\n\n 'tensor/add': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Element-wise addition',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'a', type: 'tensor', description: 'First tensor' },\n { name: 'b', type: 'tensor | number', description: 'Second tensor or scalar' },\n ],\n example: '[\"tensor/add\", \"@entity.a\", \"@entity.b\"]',\n },\n 'tensor/sub': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Element-wise subtraction',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'a', type: 'tensor', description: 'First tensor' },\n { name: 'b', type: 'tensor | number', description: 'Second tensor or scalar' },\n ],\n example: '[\"tensor/sub\", \"@entity.a\", \"@entity.b\"]',\n },\n 'tensor/mul': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Element-wise multiplication',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'a', type: 'tensor', description: 'First tensor' },\n { name: 'b', type: 'tensor | number', description: 'Second tensor or scalar' },\n ],\n example: '[\"tensor/mul\", \"@entity.weights\", 0.99] // Decay weights',\n },\n 'tensor/div': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Element-wise division',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'a', type: 'tensor', description: 'First tensor' },\n { name: 'b', type: 'tensor | number', description: 'Second tensor or scalar' },\n ],\n example: '[\"tensor/div\", \"@entity.gradient\", \"@entity.batchSize\"]',\n },\n 'tensor/matmul': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Matrix multiplication',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'a', type: 'tensor', description: 'First tensor (NxM)' },\n { name: 'b', type: 'tensor', description: 'Second tensor (MxK)' },\n ],\n example: '[\"tensor/matmul\", \"@entity.input\", \"@entity.weights\"]',\n },\n 'tensor/dot': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Dot product of two 1D tensors',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'a', type: 'tensor', description: 'First vector' },\n { name: 'b', type: 'tensor', description: 'Second vector' },\n ],\n example: '[\"tensor/dot\", \"@entity.a\", \"@entity.b\"]',\n },\n\n // ============================================================================\n // Reductions\n // ============================================================================\n\n 'tensor/sum': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'Sum of tensor elements',\n hasSideEffects: false,\n returnType: 'number | tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'dim', type: 'number', description: 'Dimension to reduce', optional: true },\n ],\n example: '[\"tensor/sum\", \"@entity.rewards\"] // Total reward',\n },\n 'tensor/mean': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'Mean of tensor elements',\n hasSideEffects: false,\n returnType: 'number | tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'dim', type: 'number', description: 'Dimension to reduce', optional: true },\n ],\n example: '[\"tensor/mean\", \"@entity.losses\"]',\n },\n 'tensor/max': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'Maximum value in tensor',\n hasSideEffects: false,\n returnType: 'number | tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'dim', type: 'number', description: 'Dimension to reduce', optional: true },\n ],\n example: '[\"tensor/max\", \"@entity.qValues\"]',\n },\n 'tensor/min': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'Minimum value in tensor',\n hasSideEffects: false,\n returnType: 'number | tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'dim', type: 'number', description: 'Dimension to reduce', optional: true },\n ],\n example: '[\"tensor/min\", \"@entity.distances\"]',\n },\n 'tensor/argmax': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'Index of maximum value',\n hasSideEffects: false,\n returnType: 'number | tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'dim', type: 'number', description: 'Dimension to reduce', optional: true },\n ],\n example: '[\"tensor/argmax\", \"@entity.qValues\"] // Best action index',\n },\n 'tensor/norm': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 2,\n description: 'L2 norm of tensor',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'p', type: 'number', description: 'Norm order (default 2)', optional: true, defaultValue: 2 },\n ],\n example: '[\"tensor/norm\", \"@entity.gradient\"]',\n },\n\n // ============================================================================\n // Range Validation (for contracts)\n // ============================================================================\n\n 'tensor/allInRange': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Check if all elements are within range [min, max]',\n hasSideEffects: false,\n returnType: 'boolean',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'range', type: '[number, number]', description: 'Range as [min, max]' },\n ],\n example: '[\"tensor/allInRange\", \"@payload.input\", [-1.0, 1.0]]',\n },\n 'tensor/outOfRangeIndices': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Get indices of elements outside range',\n hasSideEffects: false,\n returnType: 'number[]',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'range', type: '[number, number]', description: 'Range as [min, max]' },\n ],\n example: '[\"tensor/outOfRangeIndices\", \"@payload.input\", [-1.0, 1.0]]',\n },\n 'tensor/clamp': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 3,\n maxArity: 3,\n description: 'Clamp all elements to range [min, max]',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'min', type: 'number', description: 'Minimum value' },\n { name: 'max', type: 'number', description: 'Maximum value' },\n ],\n example: '[\"tensor/clamp\", \"@entity.output\", -10.0, 10.0]',\n },\n 'tensor/clampPerDim': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Clamp each dimension to its specified range',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'ranges', type: 'object', description: 'Per-dimension ranges { \"0\": {min, max}, ... }' },\n ],\n example: '[\"tensor/clampPerDim\", \"@entity.rawOutput\", \"@entity.outputContract.ranges\"]',\n },\n 'tensor/outOfRangeDims': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 2,\n maxArity: 2,\n description: 'Get dimensions that exceed their specified ranges',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n { name: 'ranges', type: 'object', description: 'Per-dimension ranges { \"0\": {min, max}, ... }' },\n ],\n example: '[\"tensor/outOfRangeDims\", \"@entity.rawOutput\", \"@entity.outputContract.ranges\"]',\n },\n\n // ============================================================================\n // Conversion\n // ============================================================================\n\n 'tensor/toArray': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Convert tensor to nested array',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor' },\n ],\n example: '[\"tensor/toArray\", \"@entity.output\"]',\n },\n 'tensor/toList': {\n module: 'tensor',\n category: 'ml-tensor',\n minArity: 1,\n maxArity: 1,\n description: 'Convert 1D tensor to flat array',\n hasSideEffects: false,\n returnType: 'number[]',\n params: [\n { name: 'tensor', type: 'tensor', description: 'The tensor (must be 1D)' },\n ],\n example: '[\"tensor/toList\", \"@entity.output\"]',\n },\n};\n\n/**\n * Get all tensor operator names.\n */\nexport function getTensorOperators(): string[] {\n return Object.keys(TENSOR_OPERATORS);\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { a as StdOperatorMeta } from '../types-CmNM_IbV.js';
1
+ import { a as StdOperatorMeta } from '../types-DOeGXRCm.js';
2
2
 
3
3
  /**
4
4
  * Time Module - Date and Time Operations
@@ -1,4 +1,4 @@
1
- import { a as StdOperatorMeta } from '../types-CmNM_IbV.js';
1
+ import { a as StdOperatorMeta } from '../types-DOeGXRCm.js';
2
2
 
3
3
  /**
4
4
  * Training Module - Neural Network Training Operations
@@ -5,7 +5,7 @@ var TRAIN_OPERATORS = {
5
5
  // ============================================================================
6
6
  "train/loop": {
7
7
  module: "train",
8
- category: "std-train",
8
+ category: "ml-effect",
9
9
  minArity: 3,
10
10
  maxArity: 3,
11
11
  description: "Execute training loop with constraints",
@@ -20,7 +20,7 @@ var TRAIN_OPERATORS = {
20
20
  },
21
21
  "train/step": {
22
22
  module: "train",
23
- category: "std-train",
23
+ category: "ml-effect",
24
24
  minArity: 4,
25
25
  maxArity: 4,
26
26
  description: "Execute single training step (forward, loss, backward, update)",
@@ -39,7 +39,7 @@ var TRAIN_OPERATORS = {
39
39
  // ============================================================================
40
40
  "train/validate": {
41
41
  module: "train",
42
- category: "std-train",
42
+ category: "ml-effect",
43
43
  minArity: 2,
44
44
  maxArity: 2,
45
45
  description: "Validate model on test cases, returns pass/fail metrics",
@@ -53,7 +53,7 @@ var TRAIN_OPERATORS = {
53
53
  },
54
54
  "train/checkRegression": {
55
55
  module: "train",
56
- category: "std-train",
56
+ category: "ml-effect",
57
57
  minArity: 3,
58
58
  maxArity: 3,
59
59
  description: "Check if new model regresses on required invariants",
@@ -71,7 +71,7 @@ var TRAIN_OPERATORS = {
71
71
  // ============================================================================
72
72
  "train/checkConstraints": {
73
73
  module: "train",
74
- category: "std-train",
74
+ category: "ml-effect",
75
75
  minArity: 2,
76
76
  maxArity: 2,
77
77
  description: "Check if network weights satisfy all constraints",
@@ -85,7 +85,7 @@ var TRAIN_OPERATORS = {
85
85
  },
86
86
  "train/checkWeightMagnitude": {
87
87
  module: "train",
88
- category: "std-train",
88
+ category: "ml-effect",
89
89
  minArity: 2,
90
90
  maxArity: 2,
91
91
  description: "Check if all weights are within magnitude limit",
@@ -99,7 +99,7 @@ var TRAIN_OPERATORS = {
99
99
  },
100
100
  "train/checkForbiddenOutputs": {
101
101
  module: "train",
102
- category: "std-train",
102
+ category: "ml-effect",
103
103
  minArity: 3,
104
104
  maxArity: 3,
105
105
  description: "Check if model produces outputs in forbidden regions",
@@ -117,7 +117,7 @@ var TRAIN_OPERATORS = {
117
117
  // ============================================================================
118
118
  "train/clipGradients": {
119
119
  module: "train",
120
- category: "std-train",
120
+ category: "ml-effect",
121
121
  minArity: 2,
122
122
  maxArity: 2,
123
123
  description: "Clip gradients to max norm (modifies in place)",
@@ -131,7 +131,7 @@ var TRAIN_OPERATORS = {
131
131
  },
132
132
  "train/getGradientNorm": {
133
133
  module: "train",
134
- category: "std-train",
134
+ category: "ml-effect",
135
135
  minArity: 1,
136
136
  maxArity: 1,
137
137
  description: "Get current gradient norm",
@@ -147,7 +147,7 @@ var TRAIN_OPERATORS = {
147
147
  // ============================================================================
148
148
  "train/clipWeights": {
149
149
  module: "train",
150
- category: "std-train",
150
+ category: "ml-effect",
151
151
  minArity: 2,
152
152
  maxArity: 2,
153
153
  description: "Clip weights to max magnitude (modifies in place)",
@@ -161,7 +161,7 @@ var TRAIN_OPERATORS = {
161
161
  },
162
162
  "train/getMaxWeightMagnitude": {
163
163
  module: "train",
164
- category: "std-train",
164
+ category: "ml-effect",
165
165
  minArity: 1,
166
166
  maxArity: 1,
167
167
  description: "Get maximum weight magnitude in network",
@@ -177,7 +177,7 @@ var TRAIN_OPERATORS = {
177
177
  // ============================================================================
178
178
  "train/mse": {
179
179
  module: "train",
180
- category: "std-train",
180
+ category: "ml-effect",
181
181
  minArity: 2,
182
182
  maxArity: 2,
183
183
  description: "Mean squared error loss",
@@ -191,7 +191,7 @@ var TRAIN_OPERATORS = {
191
191
  },
192
192
  "train/crossEntropy": {
193
193
  module: "train",
194
- category: "std-train",
194
+ category: "ml-effect",
195
195
  minArity: 2,
196
196
  maxArity: 2,
197
197
  description: "Cross-entropy loss for classification",
@@ -205,7 +205,7 @@ var TRAIN_OPERATORS = {
205
205
  },
206
206
  "train/huber": {
207
207
  module: "train",
208
- category: "std-train",
208
+ category: "ml-effect",
209
209
  minArity: 2,
210
210
  maxArity: 3,
211
211
  description: "Huber loss (smooth L1, robust to outliers)",
@@ -223,7 +223,7 @@ var TRAIN_OPERATORS = {
223
223
  // ============================================================================
224
224
  "train/sgd": {
225
225
  module: "train",
226
- category: "std-train",
226
+ category: "ml-effect",
227
227
  minArity: 2,
228
228
  maxArity: 3,
229
229
  description: "Stochastic gradient descent optimizer step",
@@ -238,7 +238,7 @@ var TRAIN_OPERATORS = {
238
238
  },
239
239
  "train/adam": {
240
240
  module: "train",
241
- category: "std-train",
241
+ category: "ml-effect",
242
242
  minArity: 2,
243
243
  maxArity: 4,
244
244
  description: "Adam optimizer step",
@@ -257,7 +257,7 @@ var TRAIN_OPERATORS = {
257
257
  // ============================================================================
258
258
  "train/sampleBatch": {
259
259
  module: "train",
260
- category: "std-train",
260
+ category: "ml-effect",
261
261
  minArity: 2,
262
262
  maxArity: 2,
263
263
  description: "Sample random batch from experience buffer",
@@ -271,7 +271,7 @@ var TRAIN_OPERATORS = {
271
271
  },
272
272
  "train/computeReturns": {
273
273
  module: "train",
274
- category: "std-train",
274
+ category: "ml-effect",
275
275
  minArity: 2,
276
276
  maxArity: 2,
277
277
  description: "Compute discounted returns from rewards",
@@ -285,7 +285,7 @@ var TRAIN_OPERATORS = {
285
285
  },
286
286
  "train/computeAdvantages": {
287
287
  module: "train",
288
- category: "std-train",
288
+ category: "ml-effect",
289
289
  minArity: 3,
290
290
  maxArity: 3,
291
291
  description: "Compute GAE advantages for policy gradient",
@@ -1 +1 @@
1
- {"version":3,"sources":["../../modules/train.ts"],"names":[],"mappings":";AAgBO,IAAM,eAAA,GAAmD;AAAA;AAAA;AAAA;AAAA,EAK9D,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,wCAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,cAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,WAAA,EAAa,aAAa,6BAAA,EAA8B;AAAA,MAChF,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,OAAA,EAAS,aAAa,yDAAA,EAA0D;AAAA,MAC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V,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,yCAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAM,OAAA,EAAS,aAAa,kBAAA,EAAmB;AAAA,MAClE,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,QAAA,EAAU,aAAa,iBAAA;AAAkB,KAClE;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AAAA,EACA,yBAAA,EAA2B;AAAA,IACzB,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,4CAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAM,OAAA,EAAS,aAAa,kBAAA,EAAmB;AAAA,MAClE,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,iBAAA,EAAkB;AAAA,MACjE,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,2BAAA;AAA4B,KAC7E;AAAA,IACA,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,iBAAA,GAA8B;AAC5C,EAAA,OAAO,MAAA,CAAO,KAAK,eAAe,CAAA;AACpC","file":"train.js","sourcesContent":["/**\n * Training Module - Neural Network Training Operations\n *\n * Provides operators for training neural networks with explicit constraints.\n * Training is bounded by readable rules: gradient clipping, weight constraints,\n * forbidden output regions, and validation gates.\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Training module operators.\n * These operators handle training loops, validation, and constraint enforcement.\n */\nexport const TRAIN_OPERATORS: Record<string, StdOperatorMeta> = {\n // ============================================================================\n // Training Loop\n // ============================================================================\n\n 'train/loop': {\n module: 'train',\n category: 'std-train',\n minArity: 3,\n maxArity: 3,\n description: 'Execute training loop with constraints',\n hasSideEffects: true,\n returnType: 'train/result',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network to train' },\n { name: 'data', type: 'array', description: 'Training data (array of {input, target} or experiences)' },\n { name: 'config', type: 'train/config', description: 'Training configuration with constraints' },\n ],\n example: '[\"train/loop\", \"@entity.architecture\", \"@entity.buffer\", \"@entity.trainingConfig\"]',\n },\n 'train/step': {\n module: 'train',\n category: 'std-train',\n minArity: 4,\n maxArity: 4,\n description: 'Execute single training step (forward, loss, backward, update)',\n hasSideEffects: true,\n returnType: 'train/stepResult',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'input', type: 'tensor', description: 'Input tensor' },\n { name: 'target', type: 'tensor', description: 'Target tensor' },\n { name: 'config', type: 'train/config', description: 'Training configuration' },\n ],\n example: '[\"train/step\", \"@entity.architecture\", \"@batch.input\", \"@batch.target\", \"@entity.config\"]',\n },\n\n // ============================================================================\n // Validation\n // ============================================================================\n\n 'train/validate': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 2,\n description: 'Validate model on test cases, returns pass/fail metrics',\n hasSideEffects: false,\n returnType: 'train/validationResult',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'testCases', type: 'array', description: 'Array of {input, expected, tolerance?}' },\n ],\n example: '[\"train/validate\", \"@entity.architecture\", \"@entity.validationSet\"]',\n },\n 'train/checkRegression': {\n module: 'train',\n category: 'std-train',\n minArity: 3,\n maxArity: 3,\n description: 'Check if new model regresses on required invariants',\n hasSideEffects: false,\n returnType: 'train/regressionResult',\n params: [\n { name: 'newModule', type: 'nn/module', description: 'Newly trained network' },\n { name: 'oldModule', type: 'nn/module', description: 'Previous network' },\n { name: 'invariants', type: 'array', description: 'Test cases that must not regress' },\n ],\n example: '[\"train/checkRegression\", \"@payload.newWeights\", \"@entity.architecture\", \"@entity.requiredInvariants\"]',\n },\n\n // ============================================================================\n // Constraint Checking\n // ============================================================================\n\n 'train/checkConstraints': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 2,\n description: 'Check if network weights satisfy all constraints',\n hasSideEffects: false,\n returnType: 'train/constraintResult',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'constraints', type: 'train/constraints', description: 'Constraint specification' },\n ],\n example: '[\"train/checkConstraints\", \"@payload.newWeights\", \"@entity.constraints\"]',\n },\n 'train/checkWeightMagnitude': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 2,\n description: 'Check if all weights are within magnitude limit',\n hasSideEffects: false,\n returnType: 'boolean',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'maxMagnitude', type: 'number', description: 'Maximum allowed weight magnitude' },\n ],\n example: '[\"train/checkWeightMagnitude\", \"@entity.architecture\", 10.0]',\n },\n 'train/checkForbiddenOutputs': {\n module: 'train',\n category: 'std-train',\n minArity: 3,\n maxArity: 3,\n description: 'Check if model produces outputs in forbidden regions',\n hasSideEffects: false,\n returnType: 'train/forbiddenResult',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'testInputs', type: 'array', description: 'Inputs to test' },\n { name: 'forbiddenRegions', type: 'array', description: 'Forbidden output regions' },\n ],\n example: '[\"train/checkForbiddenOutputs\", \"@entity.architecture\", \"@entity.testInputs\", \"@entity.forbiddenOutputRegions\"]',\n },\n\n // ============================================================================\n // Gradient Operations\n // ============================================================================\n\n 'train/clipGradients': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 2,\n description: 'Clip gradients to max norm (modifies in place)',\n hasSideEffects: true,\n returnType: 'number',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'maxNorm', type: 'number', description: 'Maximum gradient norm' },\n ],\n example: '[\"train/clipGradients\", \"@entity.architecture\", 1.0]',\n },\n 'train/getGradientNorm': {\n module: 'train',\n category: 'std-train',\n minArity: 1,\n maxArity: 1,\n description: 'Get current gradient norm',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n ],\n example: '[\"train/getGradientNorm\", \"@entity.architecture\"]',\n },\n\n // ============================================================================\n // Weight Operations\n // ============================================================================\n\n 'train/clipWeights': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 2,\n description: 'Clip weights to max magnitude (modifies in place)',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'maxMagnitude', type: 'number', description: 'Maximum weight magnitude' },\n ],\n example: '[\"train/clipWeights\", \"@entity.architecture\", 10.0]',\n },\n 'train/getMaxWeightMagnitude': {\n module: 'train',\n category: 'std-train',\n minArity: 1,\n maxArity: 1,\n description: 'Get maximum weight magnitude in network',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n ],\n example: '[\"train/getMaxWeightMagnitude\", \"@entity.architecture\"]',\n },\n\n // ============================================================================\n // Loss Functions\n // ============================================================================\n\n 'train/mse': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 2,\n description: 'Mean squared error loss',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'predicted', type: 'tensor', description: 'Predicted values' },\n { name: 'target', type: 'tensor', description: 'Target values' },\n ],\n example: '[\"train/mse\", \"@entity.output\", \"@batch.target\"]',\n },\n 'train/crossEntropy': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 2,\n description: 'Cross-entropy loss for classification',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'logits', type: 'tensor', description: 'Raw model outputs (logits)' },\n { name: 'labels', type: 'tensor', description: 'Target class labels' },\n ],\n example: '[\"train/crossEntropy\", \"@entity.logits\", \"@batch.labels\"]',\n },\n 'train/huber': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 3,\n description: 'Huber loss (smooth L1, robust to outliers)',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'predicted', type: 'tensor', description: 'Predicted values' },\n { name: 'target', type: 'tensor', description: 'Target values' },\n { name: 'delta', type: 'number', description: 'Threshold for quadratic vs linear', optional: true, defaultValue: 1.0 },\n ],\n example: '[\"train/huber\", \"@entity.qValues\", \"@batch.targets\", 1.0]',\n },\n\n // ============================================================================\n // Optimizers\n // ============================================================================\n\n 'train/sgd': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 3,\n description: 'Stochastic gradient descent optimizer step',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'lr', type: 'number', description: 'Learning rate' },\n { name: 'momentum', type: 'number', description: 'Momentum factor', optional: true, defaultValue: 0 },\n ],\n example: '[\"train/sgd\", \"@entity.architecture\", 0.01, 0.9]',\n },\n 'train/adam': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 4,\n description: 'Adam optimizer step',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'lr', type: 'number', description: 'Learning rate' },\n { name: 'beta1', type: 'number', description: 'First moment decay', optional: true, defaultValue: 0.9 },\n { name: 'beta2', type: 'number', description: 'Second moment decay', optional: true, defaultValue: 0.999 },\n ],\n example: '[\"train/adam\", \"@entity.architecture\", 0.001]',\n },\n\n // ============================================================================\n // Experience Replay (for RL)\n // ============================================================================\n\n 'train/sampleBatch': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 2,\n description: 'Sample random batch from experience buffer',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'buffer', type: 'array', description: 'Experience buffer' },\n { name: 'batchSize', type: 'number', description: 'Number of samples' },\n ],\n example: '[\"train/sampleBatch\", \"@entity.experienceBuffer\", 32]',\n },\n 'train/computeReturns': {\n module: 'train',\n category: 'std-train',\n minArity: 2,\n maxArity: 2,\n description: 'Compute discounted returns from rewards',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'rewards', type: 'array', description: 'Array of rewards' },\n { name: 'gamma', type: 'number', description: 'Discount factor' },\n ],\n example: '[\"train/computeReturns\", \"@episode.rewards\", 0.99]',\n },\n 'train/computeAdvantages': {\n module: 'train',\n category: 'std-train',\n minArity: 3,\n maxArity: 3,\n description: 'Compute GAE advantages for policy gradient',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'rewards', type: 'array', description: 'Array of rewards' },\n { name: 'values', type: 'tensor', description: 'Value estimates' },\n { name: 'config', type: 'object', description: 'Config with gamma, lambda' },\n ],\n example: '[\"train/computeAdvantages\", \"@episode.rewards\", \"@episode.values\", { \"gamma\": 0.99, \"lambda\": 0.95 }]',\n },\n};\n\n/**\n * Get all train operator names.\n */\nexport function getTrainOperators(): string[] {\n return Object.keys(TRAIN_OPERATORS);\n}\n"]}
1
+ {"version":3,"sources":["../../modules/train.ts"],"names":[],"mappings":";AAgBO,IAAM,eAAA,GAAmD;AAAA;AAAA;AAAA;AAAA,EAK9D,YAAA,EAAc;AAAA,IACZ,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,wCAAA;AAAA,IACb,cAAA,EAAgB,IAAA;AAAA,IAChB,UAAA,EAAY,cAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,WAAA,EAAa,aAAa,6BAAA,EAA8B;AAAA,MAChF,EAAE,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,OAAA,EAAS,aAAa,yDAAA,EAA0D;AAAA,MACtG,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,cAAA,EAAgB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ACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAM,OAAA,EAAS,aAAa,kBAAA,EAAmB;AAAA,MAClE,EAAE,IAAA,EAAM,OAAA,EAAS,IAAA,EAAM,QAAA,EAAU,aAAa,iBAAA;AAAkB,KAClE;AAAA,IACA,OAAA,EAAS;AAAA,GACX;AAAA,EACA,yBAAA,EAA2B;AAAA,IACzB,MAAA,EAAQ,OAAA;AAAA,IACR,QAAA,EAAU,WAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,QAAA,EAAU,CAAA;AAAA,IACV,WAAA,EAAa,4CAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,UAAA,EAAY,QAAA;AAAA,IACZ,MAAA,EAAQ;AAAA,MACN,EAAE,IAAA,EAAM,SAAA,EAAW,IAAA,EAAM,OAAA,EAAS,aAAa,kBAAA,EAAmB;AAAA,MAClE,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,iBAAA,EAAkB;AAAA,MACjE,EAAE,IAAA,EAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,aAAa,2BAAA;AAA4B,KAC7E;AAAA,IACA,OAAA,EAAS;AAAA;AAEb;AAKO,SAAS,iBAAA,GAA8B;AAC5C,EAAA,OAAO,MAAA,CAAO,KAAK,eAAe,CAAA;AACpC","file":"train.js","sourcesContent":["/**\n * Training Module - Neural Network Training Operations\n *\n * Provides operators for training neural networks with explicit constraints.\n * Training is bounded by readable rules: gradient clipping, weight constraints,\n * forbidden output regions, and validation gates.\n *\n * @packageDocumentation\n */\n\nimport type { StdOperatorMeta } from '../types.js';\n\n/**\n * Training module operators.\n * These operators handle training loops, validation, and constraint enforcement.\n */\nexport const TRAIN_OPERATORS: Record<string, StdOperatorMeta> = {\n // ============================================================================\n // Training Loop\n // ============================================================================\n\n 'train/loop': {\n module: 'train',\n category: 'ml-effect',\n minArity: 3,\n maxArity: 3,\n description: 'Execute training loop with constraints',\n hasSideEffects: true,\n returnType: 'train/result',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network to train' },\n { name: 'data', type: 'array', description: 'Training data (array of {input, target} or experiences)' },\n { name: 'config', type: 'train/config', description: 'Training configuration with constraints' },\n ],\n example: '[\"train/loop\", \"@entity.architecture\", \"@entity.buffer\", \"@entity.trainingConfig\"]',\n },\n 'train/step': {\n module: 'train',\n category: 'ml-effect',\n minArity: 4,\n maxArity: 4,\n description: 'Execute single training step (forward, loss, backward, update)',\n hasSideEffects: true,\n returnType: 'train/stepResult',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'input', type: 'tensor', description: 'Input tensor' },\n { name: 'target', type: 'tensor', description: 'Target tensor' },\n { name: 'config', type: 'train/config', description: 'Training configuration' },\n ],\n example: '[\"train/step\", \"@entity.architecture\", \"@batch.input\", \"@batch.target\", \"@entity.config\"]',\n },\n\n // ============================================================================\n // Validation\n // ============================================================================\n\n 'train/validate': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 2,\n description: 'Validate model on test cases, returns pass/fail metrics',\n hasSideEffects: false,\n returnType: 'train/validationResult',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'testCases', type: 'array', description: 'Array of {input, expected, tolerance?}' },\n ],\n example: '[\"train/validate\", \"@entity.architecture\", \"@entity.validationSet\"]',\n },\n 'train/checkRegression': {\n module: 'train',\n category: 'ml-effect',\n minArity: 3,\n maxArity: 3,\n description: 'Check if new model regresses on required invariants',\n hasSideEffects: false,\n returnType: 'train/regressionResult',\n params: [\n { name: 'newModule', type: 'nn/module', description: 'Newly trained network' },\n { name: 'oldModule', type: 'nn/module', description: 'Previous network' },\n { name: 'invariants', type: 'array', description: 'Test cases that must not regress' },\n ],\n example: '[\"train/checkRegression\", \"@payload.newWeights\", \"@entity.architecture\", \"@entity.requiredInvariants\"]',\n },\n\n // ============================================================================\n // Constraint Checking\n // ============================================================================\n\n 'train/checkConstraints': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 2,\n description: 'Check if network weights satisfy all constraints',\n hasSideEffects: false,\n returnType: 'train/constraintResult',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'constraints', type: 'train/constraints', description: 'Constraint specification' },\n ],\n example: '[\"train/checkConstraints\", \"@payload.newWeights\", \"@entity.constraints\"]',\n },\n 'train/checkWeightMagnitude': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 2,\n description: 'Check if all weights are within magnitude limit',\n hasSideEffects: false,\n returnType: 'boolean',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'maxMagnitude', type: 'number', description: 'Maximum allowed weight magnitude' },\n ],\n example: '[\"train/checkWeightMagnitude\", \"@entity.architecture\", 10.0]',\n },\n 'train/checkForbiddenOutputs': {\n module: 'train',\n category: 'ml-effect',\n minArity: 3,\n maxArity: 3,\n description: 'Check if model produces outputs in forbidden regions',\n hasSideEffects: false,\n returnType: 'train/forbiddenResult',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'testInputs', type: 'array', description: 'Inputs to test' },\n { name: 'forbiddenRegions', type: 'array', description: 'Forbidden output regions' },\n ],\n example: '[\"train/checkForbiddenOutputs\", \"@entity.architecture\", \"@entity.testInputs\", \"@entity.forbiddenOutputRegions\"]',\n },\n\n // ============================================================================\n // Gradient Operations\n // ============================================================================\n\n 'train/clipGradients': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 2,\n description: 'Clip gradients to max norm (modifies in place)',\n hasSideEffects: true,\n returnType: 'number',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'maxNorm', type: 'number', description: 'Maximum gradient norm' },\n ],\n example: '[\"train/clipGradients\", \"@entity.architecture\", 1.0]',\n },\n 'train/getGradientNorm': {\n module: 'train',\n category: 'ml-effect',\n minArity: 1,\n maxArity: 1,\n description: 'Get current gradient norm',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n ],\n example: '[\"train/getGradientNorm\", \"@entity.architecture\"]',\n },\n\n // ============================================================================\n // Weight Operations\n // ============================================================================\n\n 'train/clipWeights': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 2,\n description: 'Clip weights to max magnitude (modifies in place)',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'maxMagnitude', type: 'number', description: 'Maximum weight magnitude' },\n ],\n example: '[\"train/clipWeights\", \"@entity.architecture\", 10.0]',\n },\n 'train/getMaxWeightMagnitude': {\n module: 'train',\n category: 'ml-effect',\n minArity: 1,\n maxArity: 1,\n description: 'Get maximum weight magnitude in network',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n ],\n example: '[\"train/getMaxWeightMagnitude\", \"@entity.architecture\"]',\n },\n\n // ============================================================================\n // Loss Functions\n // ============================================================================\n\n 'train/mse': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 2,\n description: 'Mean squared error loss',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'predicted', type: 'tensor', description: 'Predicted values' },\n { name: 'target', type: 'tensor', description: 'Target values' },\n ],\n example: '[\"train/mse\", \"@entity.output\", \"@batch.target\"]',\n },\n 'train/crossEntropy': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 2,\n description: 'Cross-entropy loss for classification',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'logits', type: 'tensor', description: 'Raw model outputs (logits)' },\n { name: 'labels', type: 'tensor', description: 'Target class labels' },\n ],\n example: '[\"train/crossEntropy\", \"@entity.logits\", \"@batch.labels\"]',\n },\n 'train/huber': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 3,\n description: 'Huber loss (smooth L1, robust to outliers)',\n hasSideEffects: false,\n returnType: 'number',\n params: [\n { name: 'predicted', type: 'tensor', description: 'Predicted values' },\n { name: 'target', type: 'tensor', description: 'Target values' },\n { name: 'delta', type: 'number', description: 'Threshold for quadratic vs linear', optional: true, defaultValue: 1.0 },\n ],\n example: '[\"train/huber\", \"@entity.qValues\", \"@batch.targets\", 1.0]',\n },\n\n // ============================================================================\n // Optimizers\n // ============================================================================\n\n 'train/sgd': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 3,\n description: 'Stochastic gradient descent optimizer step',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'lr', type: 'number', description: 'Learning rate' },\n { name: 'momentum', type: 'number', description: 'Momentum factor', optional: true, defaultValue: 0 },\n ],\n example: '[\"train/sgd\", \"@entity.architecture\", 0.01, 0.9]',\n },\n 'train/adam': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 4,\n description: 'Adam optimizer step',\n hasSideEffects: true,\n returnType: 'void',\n params: [\n { name: 'module', type: 'nn/module', description: 'The neural network' },\n { name: 'lr', type: 'number', description: 'Learning rate' },\n { name: 'beta1', type: 'number', description: 'First moment decay', optional: true, defaultValue: 0.9 },\n { name: 'beta2', type: 'number', description: 'Second moment decay', optional: true, defaultValue: 0.999 },\n ],\n example: '[\"train/adam\", \"@entity.architecture\", 0.001]',\n },\n\n // ============================================================================\n // Experience Replay (for RL)\n // ============================================================================\n\n 'train/sampleBatch': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 2,\n description: 'Sample random batch from experience buffer',\n hasSideEffects: false,\n returnType: 'array',\n params: [\n { name: 'buffer', type: 'array', description: 'Experience buffer' },\n { name: 'batchSize', type: 'number', description: 'Number of samples' },\n ],\n example: '[\"train/sampleBatch\", \"@entity.experienceBuffer\", 32]',\n },\n 'train/computeReturns': {\n module: 'train',\n category: 'ml-effect',\n minArity: 2,\n maxArity: 2,\n description: 'Compute discounted returns from rewards',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'rewards', type: 'array', description: 'Array of rewards' },\n { name: 'gamma', type: 'number', description: 'Discount factor' },\n ],\n example: '[\"train/computeReturns\", \"@episode.rewards\", 0.99]',\n },\n 'train/computeAdvantages': {\n module: 'train',\n category: 'ml-effect',\n minArity: 3,\n maxArity: 3,\n description: 'Compute GAE advantages for policy gradient',\n hasSideEffects: false,\n returnType: 'tensor',\n params: [\n { name: 'rewards', type: 'array', description: 'Array of rewards' },\n { name: 'values', type: 'tensor', description: 'Value estimates' },\n { name: 'config', type: 'object', description: 'Config with gamma, lambda' },\n ],\n example: '[\"train/computeAdvantages\", \"@episode.rewards\", \"@episode.values\", { \"gamma\": 0.99, \"lambda\": 0.95 }]',\n },\n};\n\n/**\n * Get all train operator names.\n */\nexport function getTrainOperators(): string[] {\n return Object.keys(TRAIN_OPERATORS);\n}\n"]}
@@ -1,4 +1,4 @@
1
- import { a as StdOperatorMeta } from '../types-CmNM_IbV.js';
1
+ import { a as StdOperatorMeta } from '../types-DOeGXRCm.js';
2
2
 
3
3
  /**
4
4
  * Validate Module - Input Validation
@@ -1,5 +1,5 @@
1
1
  import { OperatorMeta } from '@almadar/core/types';
2
- import { a as StdOperatorMeta, S as StdModule } from './types-CmNM_IbV.js';
2
+ import { a as StdOperatorMeta, S as StdModule } from './types-DOeGXRCm.js';
3
3
 
4
4
  /**
5
5
  * Standard Library Registry
@@ -17,7 +17,7 @@ declare const STD_OPERATORS: Record<string, StdOperatorMeta>;
17
17
  /**
18
18
  * Module-specific operator registries.
19
19
  */
20
- declare const STD_OPERATORS_BY_MODULE: Record<StdModule, Record<string, StdOperatorMeta>>;
20
+ declare const STD_OPERATORS_BY_MODULE: Record<string, Record<string, StdOperatorMeta>>;
21
21
  /**
22
22
  * Get std operator metadata by name.
23
23
  *