@classytic/stage 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (431) hide show
  1. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  2. package/dist/atomic/aufbau.d.mts +144 -0
  3. package/dist/atomic/aufbau.mjs +384 -0
  4. package/dist/atomic/elements.d.mts +67 -0
  5. package/dist/atomic/elements.mjs +785 -0
  6. package/dist/atomic/emission.d.mts +112 -0
  7. package/dist/atomic/emission.mjs +179 -0
  8. package/dist/atomic/index.d.mts +8 -0
  9. package/dist/atomic/index.mjs +9 -0
  10. package/dist/atomic/periodic.d.mts +82 -0
  11. package/dist/atomic/periodic.mjs +231 -0
  12. package/dist/atomic/properties.d.mts +100 -0
  13. package/dist/atomic/properties.mjs +574 -0
  14. package/dist/atomic/shells.d.mts +137 -0
  15. package/dist/atomic/shells.mjs +170 -0
  16. package/dist/atomic/trends.d.mts +148 -0
  17. package/dist/atomic/trends.mjs +225 -0
  18. package/dist/chem/chromatography.d.mts +66 -0
  19. package/dist/chem/chromatography.mjs +63 -0
  20. package/dist/chem/complex.d.mts +114 -0
  21. package/dist/chem/complex.mjs +234 -0
  22. package/dist/chem/cycle.d.mts +75 -0
  23. package/dist/chem/cycle.mjs +145 -0
  24. package/dist/chem/equation.d.mts +86 -0
  25. package/dist/chem/equation.mjs +168 -0
  26. package/dist/chem/formula.d.mts +90 -0
  27. package/dist/chem/formula.mjs +201 -0
  28. package/dist/chem/functional-groups.d.mts +31 -0
  29. package/dist/chem/functional-groups.mjs +187 -0
  30. package/dist/chem/hazard.d.mts +94 -0
  31. package/dist/chem/hazard.mjs +329 -0
  32. package/dist/chem/index.d.mts +34 -33
  33. package/dist/chem/index.mjs +34 -28
  34. package/dist/chem/ionic.d.mts +98 -0
  35. package/dist/chem/ionic.mjs +156 -0
  36. package/dist/chem/layout.d.mts +46 -0
  37. package/dist/chem/layout.mjs +342 -0
  38. package/dist/chem/lewis.d.mts +79 -0
  39. package/dist/chem/lewis.mjs +163 -0
  40. package/dist/chem/molecular-orbital.d.mts +114 -0
  41. package/dist/chem/molecular-orbital.mjs +201 -0
  42. package/dist/chem/molecule.d.mts +154 -0
  43. package/dist/chem/molecule.mjs +282 -0
  44. package/dist/chem/nmr.d.mts +153 -0
  45. package/dist/chem/nmr.mjs +165 -0
  46. package/dist/chem/polymer.d.mts +65 -0
  47. package/dist/chem/polymer.mjs +179 -0
  48. package/dist/chem/redox.d.mts +138 -0
  49. package/dist/chem/redox.mjs +328 -0
  50. package/dist/chem/relations.d.mts +183 -0
  51. package/dist/chem/relations.mjs +299 -0
  52. package/dist/chem/skeleton.d.mts +51 -0
  53. package/dist/chem/skeleton.mjs +186 -0
  54. package/dist/chem/solution.d.mts +116 -0
  55. package/dist/chem/solution.mjs +186 -0
  56. package/dist/chem/species.d.mts +47 -0
  57. package/dist/chem/species.mjs +128 -0
  58. package/dist/chem/stereo.d.mts +108 -0
  59. package/dist/chem/stereo.mjs +286 -0
  60. package/dist/chem/stoichiometry.d.mts +95 -0
  61. package/dist/chem/stoichiometry.mjs +145 -0
  62. package/dist/chem/synthesis.d.mts +113 -0
  63. package/dist/chem/synthesis.mjs +281 -0
  64. package/dist/chem/vsepr.d.mts +80 -0
  65. package/dist/chem/vsepr.mjs +247 -0
  66. package/dist/circuit/ac.d.mts +163 -0
  67. package/dist/circuit/ac.mjs +452 -0
  68. package/dist/circuit/dc.d.mts +92 -0
  69. package/dist/circuit/dc.mjs +333 -0
  70. package/dist/circuit/index.d.mts +5 -92
  71. package/dist/circuit/index.mjs +5 -332
  72. package/dist/circuit/network.d.mts +99 -0
  73. package/dist/circuit/network.mjs +440 -0
  74. package/dist/circuit/topology.d.mts +102 -0
  75. package/dist/circuit/topology.mjs +143 -0
  76. package/dist/colour/absorption.d.mts +79 -0
  77. package/dist/colour/absorption.mjs +137 -0
  78. package/dist/colour/index.d.mts +6 -0
  79. package/dist/colour/index.mjs +7 -0
  80. package/dist/colour/name.d.mts +14 -0
  81. package/dist/colour/name.mjs +76 -0
  82. package/dist/colour/observer.d.mts +31 -0
  83. package/dist/colour/observer.mjs +46 -0
  84. package/dist/colour/spectrum.d.mts +61 -0
  85. package/dist/colour/spectrum.mjs +108 -0
  86. package/dist/colour/srgb.d.mts +49 -0
  87. package/dist/colour/srgb.mjs +108 -0
  88. package/dist/core/constants.d.mts +138 -0
  89. package/dist/core/constants.mjs +139 -0
  90. package/dist/core/index.d.mts +3 -1
  91. package/dist/core/index.mjs +3 -1
  92. package/dist/core/vec3.d.mts +94 -0
  93. package/dist/core/vec3.mjs +123 -0
  94. package/dist/core/worked.d.mts +35 -0
  95. package/dist/core/worked.mjs +44 -0
  96. package/dist/electro/cell.d.mts +102 -0
  97. package/dist/electro/cell.mjs +170 -0
  98. package/dist/electro/conductivity.d.mts +157 -0
  99. package/dist/electro/conductivity.mjs +156 -0
  100. package/dist/electro/couples.d.mts +114 -0
  101. package/dist/electro/couples.mjs +334 -0
  102. package/dist/electro/electrolysis.d.mts +96 -0
  103. package/dist/electro/electrolysis.mjs +274 -0
  104. package/dist/electro/faraday.d.mts +150 -0
  105. package/dist/electro/faraday.mjs +118 -0
  106. package/dist/electro/index.d.mts +6 -0
  107. package/dist/electro/index.mjs +7 -0
  108. package/dist/finance/accounting/adjustments.d.mts +17 -0
  109. package/dist/finance/accounting/adjustments.mjs +202 -0
  110. package/dist/finance/accounting/analysis.d.mts +8 -0
  111. package/dist/finance/accounting/analysis.mjs +205 -0
  112. package/dist/finance/accounting/clubs.d.mts +21 -0
  113. package/dist/finance/accounting/clubs.mjs +217 -0
  114. package/dist/finance/accounting/company-statements.d.mts +7 -0
  115. package/dist/finance/accounting/company-statements.mjs +150 -0
  116. package/dist/finance/accounting/harness.d.mts +7 -0
  117. package/dist/finance/accounting/harness.mjs +45 -0
  118. package/dist/finance/accounting/index.d.mts +18 -0
  119. package/dist/finance/accounting/index.mjs +18 -0
  120. package/dist/finance/accounting/journalize.d.mts +16 -0
  121. package/dist/finance/accounting/journalize.mjs +128 -0
  122. package/dist/finance/accounting/manufacturing.d.mts +8 -0
  123. package/dist/finance/accounting/manufacturing.mjs +236 -0
  124. package/dist/finance/accounting/partnership.d.mts +7 -0
  125. package/dist/finance/accounting/partnership.mjs +152 -0
  126. package/dist/finance/accounting/period-case.d.mts +6 -0
  127. package/dist/finance/accounting/period-case.mjs +71 -0
  128. package/dist/finance/accounting/post.d.mts +9 -0
  129. package/dist/finance/accounting/post.mjs +84 -0
  130. package/dist/finance/accounting/precision.d.mts +9 -0
  131. package/dist/finance/accounting/precision.mjs +15 -0
  132. package/dist/finance/accounting/rules.d.mts +21 -0
  133. package/dist/finance/accounting/rules.mjs +37 -0
  134. package/dist/finance/accounting/solve.d.mts +28 -0
  135. package/dist/finance/accounting/solve.mjs +92 -0
  136. package/dist/finance/accounting/statements.d.mts +7 -0
  137. package/dist/finance/accounting/statements.mjs +142 -0
  138. package/dist/finance/accounting/types.d.mts +649 -0
  139. package/dist/finance/accounting/validate.d.mts +7 -0
  140. package/dist/finance/accounting/validate.mjs +67 -0
  141. package/dist/finance/accounting/verification.d.mts +24 -0
  142. package/dist/finance/accounting/verification.mjs +386 -0
  143. package/dist/finance/bizsim.d.mts +21 -39
  144. package/dist/finance/bizsim.mjs +276 -97
  145. package/dist/finance/index.d.mts +20 -43
  146. package/dist/finance/index.mjs +19 -77
  147. package/dist/finance/investment-math.d.mts +7 -0
  148. package/dist/finance/investment-math.mjs +18 -0
  149. package/dist/finance/management-accounting/budgeting.d.mts +7 -0
  150. package/dist/finance/management-accounting/budgeting.mjs +189 -0
  151. package/dist/finance/management-accounting/cash-budget.d.mts +7 -0
  152. package/dist/finance/management-accounting/cash-budget.mjs +154 -0
  153. package/dist/finance/management-accounting/costing.d.mts +8 -0
  154. package/dist/finance/management-accounting/costing.mjs +175 -0
  155. package/dist/finance/management-accounting/decisions.d.mts +8 -0
  156. package/dist/finance/management-accounting/decisions.mjs +164 -0
  157. package/dist/finance/management-accounting/index.d.mts +13 -0
  158. package/dist/finance/management-accounting/index.mjs +13 -0
  159. package/dist/finance/management-accounting/integrated-budget.d.mts +8 -0
  160. package/dist/finance/management-accounting/integrated-budget.mjs +67 -0
  161. package/dist/finance/management-accounting/inventory-costing.d.mts +7 -0
  162. package/dist/finance/management-accounting/inventory-costing.mjs +173 -0
  163. package/dist/finance/management-accounting/investment-appraisal.d.mts +7 -0
  164. package/dist/finance/management-accounting/investment-appraisal.mjs +148 -0
  165. package/dist/finance/management-accounting/management-case.d.mts +8 -0
  166. package/dist/finance/management-accounting/management-case.mjs +91 -0
  167. package/dist/finance/management-accounting/master-budget.d.mts +7 -0
  168. package/dist/finance/management-accounting/master-budget.mjs +137 -0
  169. package/dist/finance/management-accounting/production-costing.d.mts +8 -0
  170. package/dist/finance/management-accounting/production-costing.mjs +214 -0
  171. package/dist/finance/management-accounting/types.d.mts +644 -0
  172. package/dist/finance/management-accounting/variances.d.mts +7 -0
  173. package/dist/finance/management-accounting/variances.mjs +150 -0
  174. package/dist/index.d.mts +6 -6
  175. package/dist/index.mjs +1 -1
  176. package/dist/math/analysis.d.mts +61 -0
  177. package/dist/math/analysis.mjs +187 -0
  178. package/dist/math/answer-check.d.mts +50 -0
  179. package/dist/math/answer-check.mjs +106 -0
  180. package/dist/math/calculus.d.mts +4 -9
  181. package/dist/math/calculus.mjs +216 -7
  182. package/dist/math/complex.d.mts +93 -0
  183. package/dist/math/complex.mjs +239 -0
  184. package/dist/math/expr.d.mts +23 -0
  185. package/dist/math/expr.mjs +36 -0
  186. package/dist/math/index.d.mts +8 -22
  187. package/dist/math/index.mjs +8 -37
  188. package/dist/math/latex.mjs +2 -1
  189. package/dist/math/parse.mjs +1 -1
  190. package/dist/math/poly.d.mts +55 -0
  191. package/dist/math/poly.mjs +273 -0
  192. package/dist/math/rearrange.d.mts +14 -0
  193. package/dist/math/rearrange.mjs +125 -0
  194. package/dist/math/solve.d.mts +21 -0
  195. package/dist/math/solve.mjs +75 -0
  196. package/dist/networking/addressing.d.mts +26 -0
  197. package/dist/networking/addressing.mjs +33 -0
  198. package/dist/networking/cloud/access.d.mts +36 -0
  199. package/dist/networking/cloud/access.mjs +95 -0
  200. package/dist/networking/cloud/containers.d.mts +43 -0
  201. package/dist/networking/cloud/containers.mjs +54 -0
  202. package/dist/networking/cloud/edge.d.mts +17 -0
  203. package/dist/networking/cloud/edge.mjs +31 -0
  204. package/dist/networking/cloud/failure-domains.d.mts +19 -0
  205. package/dist/networking/cloud/failure-domains.mjs +22 -0
  206. package/dist/networking/cloud/geo-routing.d.mts +22 -0
  207. package/dist/networking/cloud/geo-routing.mjs +64 -0
  208. package/dist/networking/cloud/index.d.mts +18 -0
  209. package/dist/networking/cloud/index.mjs +19 -0
  210. package/dist/networking/cloud/inference-reliability.d.mts +30 -0
  211. package/dist/networking/cloud/inference-reliability.mjs +76 -0
  212. package/dist/networking/cloud/inference.d.mts +118 -0
  213. package/dist/networking/cloud/inference.mjs +179 -0
  214. package/dist/networking/cloud/infrastructure.d.mts +45 -0
  215. package/dist/networking/cloud/infrastructure.mjs +96 -0
  216. package/dist/networking/cloud/observability.d.mts +24 -0
  217. package/dist/networking/cloud/observability.mjs +34 -0
  218. package/dist/networking/cloud/orchestration.d.mts +32 -0
  219. package/dist/networking/cloud/orchestration.mjs +38 -0
  220. package/dist/networking/cloud/recovery.d.mts +21 -0
  221. package/dist/networking/cloud/recovery.mjs +27 -0
  222. package/dist/networking/cloud/releases.d.mts +42 -0
  223. package/dist/networking/cloud/releases.mjs +135 -0
  224. package/dist/networking/cloud/scaling.d.mts +25 -0
  225. package/dist/networking/cloud/scaling.mjs +65 -0
  226. package/dist/networking/cloud/secrets.d.mts +39 -0
  227. package/dist/networking/cloud/secrets.mjs +68 -0
  228. package/dist/networking/cloud/server-deployment.d.mts +29 -0
  229. package/dist/networking/cloud/server-deployment.mjs +72 -0
  230. package/dist/networking/cloud/storage.d.mts +16 -0
  231. package/dist/networking/cloud/storage.mjs +58 -0
  232. package/dist/networking/cloud/vpc.d.mts +18 -0
  233. package/dist/networking/cloud/vpc.mjs +100 -0
  234. package/dist/networking/delivery.d.mts +34 -0
  235. package/dist/networking/delivery.mjs +52 -0
  236. package/dist/networking/index.d.mts +47 -0
  237. package/dist/networking/index.mjs +47 -0
  238. package/dist/networking/ipv6.d.mts +28 -0
  239. package/dist/networking/ipv6.mjs +17 -0
  240. package/dist/networking/journeys.d.mts +83 -0
  241. package/dist/networking/journeys.mjs +161 -0
  242. package/dist/networking/models/airtime.d.mts +87 -0
  243. package/dist/networking/models/airtime.mjs +130 -0
  244. package/dist/networking/models/cellular.d.mts +157 -0
  245. package/dist/networking/models/cellular.mjs +252 -0
  246. package/dist/networking/models/encapsulation.d.mts +98 -0
  247. package/dist/networking/models/encapsulation.mjs +132 -0
  248. package/dist/networking/models/handover.d.mts +116 -0
  249. package/dist/networking/models/handover.mjs +209 -0
  250. package/dist/networking/models/handshake.d.mts +90 -0
  251. package/dist/networking/models/handshake.mjs +122 -0
  252. package/dist/networking/models/index.d.mts +14 -0
  253. package/dist/networking/models/index.mjs +15 -0
  254. package/dist/networking/models/media.d.mts +82 -0
  255. package/dist/networking/models/media.mjs +188 -0
  256. package/dist/networking/models/satellite.d.mts +86 -0
  257. package/dist/networking/models/satellite.mjs +121 -0
  258. package/dist/networking/models/spectrum.d.mts +83 -0
  259. package/dist/networking/models/spectrum.mjs +235 -0
  260. package/dist/networking/models/switch.d.mts +80 -0
  261. package/dist/networking/models/switch.mjs +155 -0
  262. package/dist/networking/models/vlan.d.mts +62 -0
  263. package/dist/networking/models/vlan.mjs +100 -0
  264. package/dist/networking/models/vpn.d.mts +66 -0
  265. package/dist/networking/models/vpn.mjs +125 -0
  266. package/dist/networking/models/wifi-privacy.d.mts +82 -0
  267. package/dist/networking/models/wifi-privacy.mjs +130 -0
  268. package/dist/networking/models/wifi.d.mts +240 -0
  269. package/dist/networking/models/wifi.mjs +562 -0
  270. package/dist/networking/nat-traversal.d.mts +24 -0
  271. package/dist/networking/nat-traversal.mjs +38 -0
  272. package/dist/networking/protocols.d.mts +17 -0
  273. package/dist/networking/protocols.mjs +57 -0
  274. package/dist/networking/queue.d.mts +12 -0
  275. package/dist/networking/queue.mjs +18 -0
  276. package/dist/networking/route-learning.d.mts +23 -0
  277. package/dist/networking/route-learning.mjs +43 -0
  278. package/dist/networking/routing.d.mts +11 -0
  279. package/dist/networking/routing.mjs +25 -0
  280. package/dist/networking/signals.d.mts +26 -0
  281. package/dist/networking/signals.mjs +35 -0
  282. package/dist/networking/subnet.d.mts +49 -0
  283. package/dist/networking/subnet.mjs +89 -0
  284. package/dist/networking/tcp-reliability.d.mts +24 -0
  285. package/dist/networking/tcp-reliability.mjs +38 -0
  286. package/dist/networking/topology/contract.d.mts +123 -0
  287. package/dist/networking/topology/index.d.mts +4 -0
  288. package/dist/networking/topology/index.mjs +4 -0
  289. package/dist/networking/topology/presets.d.mts +7 -0
  290. package/dist/networking/topology/presets.mjs +302 -0
  291. package/dist/networking/topology/simulation.d.mts +8 -0
  292. package/dist/networking/topology/simulation.mjs +179 -0
  293. package/dist/networking/wireless.d.mts +11 -0
  294. package/dist/networking/wireless.mjs +17 -0
  295. package/dist/optics/imaging.d.mts +218 -0
  296. package/dist/optics/imaging.mjs +276 -0
  297. package/dist/optics/index.d.mts +7 -0
  298. package/dist/optics/index.mjs +8 -0
  299. package/dist/optics/laws.d.mts +70 -0
  300. package/dist/optics/laws.mjs +195 -0
  301. package/dist/optics/prism.d.mts +148 -0
  302. package/dist/optics/prism.mjs +197 -0
  303. package/dist/optics/refraction.d.mts +201 -0
  304. package/dist/optics/refraction.mjs +270 -0
  305. package/dist/optics/wave-optics.d.mts +171 -0
  306. package/dist/optics/wave-optics.mjs +259 -0
  307. package/dist/physics/ac/index.d.mts +183 -0
  308. package/dist/physics/ac/index.mjs +203 -0
  309. package/dist/physics/dynamics/forces.d.mts +98 -0
  310. package/dist/physics/dynamics/forces.mjs +153 -0
  311. package/dist/physics/dynamics/friction.d.mts +76 -0
  312. package/dist/physics/dynamics/friction.mjs +119 -0
  313. package/dist/physics/dynamics/system.d.mts +68 -0
  314. package/dist/physics/dynamics/system.mjs +125 -0
  315. package/dist/physics/electrostatics/index.d.mts +169 -0
  316. package/dist/physics/electrostatics/index.mjs +249 -0
  317. package/dist/physics/energy/centre-of-mass.d.mts +115 -0
  318. package/dist/physics/energy/centre-of-mass.mjs +180 -0
  319. package/dist/physics/energy/conservation.d.mts +81 -0
  320. package/dist/physics/energy/conservation.mjs +129 -0
  321. package/dist/physics/energy/power.d.mts +90 -0
  322. package/dist/physics/energy/power.mjs +167 -0
  323. package/dist/physics/energy/spring.d.mts +73 -0
  324. package/dist/physics/energy/spring.mjs +129 -0
  325. package/dist/physics/energy/store.d.mts +63 -0
  326. package/dist/physics/energy/store.mjs +108 -0
  327. package/dist/physics/energy/theorem.d.mts +65 -0
  328. package/dist/physics/energy/theorem.mjs +113 -0
  329. package/dist/physics/energy/work.d.mts +114 -0
  330. package/dist/physics/energy/work.mjs +219 -0
  331. package/dist/physics/gravitation/body.d.mts +85 -0
  332. package/dist/physics/gravitation/body.mjs +168 -0
  333. package/dist/physics/gravitation/kepler.d.mts +127 -0
  334. package/dist/physics/gravitation/kepler.mjs +216 -0
  335. package/dist/physics/gravitation/law.d.mts +117 -0
  336. package/dist/physics/gravitation/law.mjs +175 -0
  337. package/dist/physics/gravitation/orbit.d.mts +119 -0
  338. package/dist/physics/gravitation/orbit.mjs +202 -0
  339. package/dist/physics/gravitation/potential.d.mts +114 -0
  340. package/dist/physics/gravitation/potential.mjs +202 -0
  341. package/dist/physics/gravitation/variation.d.mts +97 -0
  342. package/dist/physics/gravitation/variation.mjs +175 -0
  343. package/dist/physics/index.d.mts +35 -0
  344. package/dist/physics/index.mjs +36 -0
  345. package/dist/physics/integral-sweep.d.mts +63 -0
  346. package/dist/physics/integral-sweep.mjs +126 -0
  347. package/dist/physics/kinematics/equations.d.mts +47 -0
  348. package/dist/physics/kinematics/equations.mjs +126 -0
  349. package/dist/physics/kinematics/free-fall.d.mts +53 -0
  350. package/dist/physics/kinematics/free-fall.mjs +71 -0
  351. package/dist/physics/kinematics/given.d.mts +16 -0
  352. package/dist/physics/kinematics/given.mjs +55 -0
  353. package/dist/physics/kinematics/roots.d.mts +41 -0
  354. package/dist/physics/kinematics/roots.mjs +72 -0
  355. package/dist/physics/kinematics/solve.d.mts +52 -0
  356. package/dist/physics/kinematics/solve.mjs +172 -0
  357. package/dist/physics/magnetism/biot-savart.d.mts +161 -0
  358. package/dist/physics/magnetism/biot-savart.mjs +353 -0
  359. package/dist/physics/magnetism/flux.d.mts +94 -0
  360. package/dist/physics/magnetism/flux.mjs +313 -0
  361. package/dist/physics/magnetism/geomagnetism.d.mts +151 -0
  362. package/dist/physics/magnetism/geomagnetism.mjs +184 -0
  363. package/dist/physics/magnetism/index.d.mts +12 -0
  364. package/dist/physics/magnetism/index.mjs +74 -0
  365. package/dist/physics/magnetism/lorentz.d.mts +28 -0
  366. package/dist/physics/magnetism/lorentz.mjs +88 -0
  367. package/dist/physics/magnetism/magnetic-force.d.mts +102 -0
  368. package/dist/physics/magnetism/magnetic-force.mjs +169 -0
  369. package/dist/physics/momentum/collide.d.mts +77 -0
  370. package/dist/physics/momentum/collide.mjs +115 -0
  371. package/dist/physics/momentum/impulse.d.mts +89 -0
  372. package/dist/physics/momentum/impulse.mjs +159 -0
  373. package/dist/physics/momentum/planar.d.mts +60 -0
  374. package/dist/physics/momentum/planar.mjs +110 -0
  375. package/dist/physics/projectile.d.mts +107 -0
  376. package/dist/physics/projectile.mjs +185 -0
  377. package/dist/physics/rotation/angular.d.mts +85 -0
  378. package/dist/physics/rotation/angular.mjs +130 -0
  379. package/dist/physics/rotation/circular.d.mts +79 -0
  380. package/dist/physics/rotation/circular.mjs +131 -0
  381. package/dist/physics/rotation/inertia.d.mts +164 -0
  382. package/dist/physics/rotation/inertia.mjs +332 -0
  383. package/dist/physics/rotation/torque.d.mts +65 -0
  384. package/dist/physics/rotation/torque.mjs +134 -0
  385. package/dist/physics/vectors.d.mts +64 -0
  386. package/dist/physics/vectors.mjs +114 -0
  387. package/dist/quantity/index.d.mts +119 -0
  388. package/dist/quantity/index.mjs +417 -0
  389. package/dist/relation/derive.d.mts +74 -0
  390. package/dist/relation/derive.mjs +73 -0
  391. package/dist/relation/index.d.mts +56 -0
  392. package/dist/relation/index.mjs +234 -0
  393. package/dist/scene/evaluators.mjs +1 -1
  394. package/dist/sim/thermal.mjs +45 -20
  395. package/dist/thermo/calorimetry.d.mts +207 -0
  396. package/dist/thermo/calorimetry.mjs +345 -0
  397. package/dist/thermo/cycles.d.mts +142 -0
  398. package/dist/thermo/cycles.mjs +256 -0
  399. package/dist/thermo/entropy.d.mts +87 -0
  400. package/dist/thermo/entropy.mjs +140 -0
  401. package/dist/thermo/expansion.d.mts +130 -0
  402. package/dist/thermo/expansion.mjs +178 -0
  403. package/dist/thermo/gas.d.mts +197 -0
  404. package/dist/thermo/gas.mjs +279 -0
  405. package/dist/thermo/heat-transfer.d.mts +164 -0
  406. package/dist/thermo/heat-transfer.mjs +217 -0
  407. package/dist/thermo/index.d.mts +9 -82
  408. package/dist/thermo/index.mjs +9 -132
  409. package/dist/thermo/processes.d.mts +95 -0
  410. package/dist/thermo/processes.mjs +154 -0
  411. package/dist/thermo/temperature.d.mts +174 -0
  412. package/dist/thermo/temperature.mjs +236 -0
  413. package/dist/waves/damping.d.mts +224 -0
  414. package/dist/waves/damping.mjs +317 -0
  415. package/dist/waves/doppler.d.mts +72 -0
  416. package/dist/waves/doppler.mjs +125 -0
  417. package/dist/waves/index.d.mts +10 -0
  418. package/dist/waves/index.mjs +10 -0
  419. package/dist/waves/pendulum.d.mts +130 -0
  420. package/dist/waves/pendulum.mjs +211 -0
  421. package/dist/waves/pitch.d.mts +125 -0
  422. package/dist/waves/pitch.mjs +158 -0
  423. package/dist/waves/shm.d.mts +170 -0
  424. package/dist/waves/shm.mjs +279 -0
  425. package/dist/waves/springs.d.mts +103 -0
  426. package/dist/waves/springs.mjs +176 -0
  427. package/dist/waves/superposition.d.mts +124 -0
  428. package/dist/waves/superposition.mjs +196 -0
  429. package/dist/waves/wave.d.mts +154 -0
  430. package/dist/waves/wave.mjs +178 -0
  431. package/package.json +74 -2
@@ -0,0 +1,302 @@
1
+ //#region src/networking/topology/presets.ts
2
+ const HOME_NETWORK = {
3
+ schemaVersion: 1,
4
+ type: "network",
5
+ title: "From a home laptop to a web server",
6
+ devices: [
7
+ {
8
+ id: "laptop",
9
+ kind: "client",
10
+ label: "Laptop",
11
+ at: {
12
+ x: 80,
13
+ y: 150
14
+ },
15
+ interfaces: [{
16
+ id: "wifi0",
17
+ mac: "02:00:00:00:00:10",
18
+ addresses: ["192.168.1.20/24"]
19
+ }]
20
+ },
21
+ {
22
+ id: "wifi",
23
+ kind: "access-point",
24
+ label: "Wi-Fi AP",
25
+ at: {
26
+ x: 230,
27
+ y: 150
28
+ },
29
+ interfaces: [{ id: "lan1" }, { id: "lan2" }]
30
+ },
31
+ {
32
+ id: "router",
33
+ kind: "router",
34
+ label: "Home router",
35
+ at: {
36
+ x: 390,
37
+ y: 150
38
+ },
39
+ interfaces: [{
40
+ id: "lan",
41
+ addresses: ["192.168.1.1/24"]
42
+ }, {
43
+ id: "wan",
44
+ addresses: ["203.0.113.2/30"]
45
+ }]
46
+ },
47
+ {
48
+ id: "internet",
49
+ kind: "cloud",
50
+ label: "Internet",
51
+ at: {
52
+ x: 550,
53
+ y: 150
54
+ },
55
+ interfaces: [{ id: "edge1" }, { id: "edge2" }]
56
+ },
57
+ {
58
+ id: "web",
59
+ kind: "server",
60
+ label: "Web server",
61
+ at: {
62
+ x: 710,
63
+ y: 150
64
+ },
65
+ interfaces: [{
66
+ id: "eth0",
67
+ addresses: ["198.51.100.20/24"]
68
+ }],
69
+ services: [{
70
+ kind: "http",
71
+ port: 80
72
+ }]
73
+ }
74
+ ],
75
+ links: [
76
+ {
77
+ id: "wifi-link",
78
+ a: {
79
+ deviceId: "laptop",
80
+ interfaceId: "wifi0"
81
+ },
82
+ b: {
83
+ deviceId: "wifi",
84
+ interfaceId: "lan1"
85
+ },
86
+ label: "Wi-Fi",
87
+ latencyMs: 4,
88
+ bandwidthMbps: 300
89
+ },
90
+ {
91
+ id: "lan-link",
92
+ a: {
93
+ deviceId: "wifi",
94
+ interfaceId: "lan2"
95
+ },
96
+ b: {
97
+ deviceId: "router",
98
+ interfaceId: "lan"
99
+ },
100
+ label: "LAN",
101
+ latencyMs: 1,
102
+ bandwidthMbps: 1e3
103
+ },
104
+ {
105
+ id: "isp-link",
106
+ a: {
107
+ deviceId: "router",
108
+ interfaceId: "wan"
109
+ },
110
+ b: {
111
+ deviceId: "internet",
112
+ interfaceId: "edge1"
113
+ },
114
+ label: "ISP",
115
+ latencyMs: 14,
116
+ bandwidthMbps: 100
117
+ },
118
+ {
119
+ id: "server-link",
120
+ a: {
121
+ deviceId: "internet",
122
+ interfaceId: "edge2"
123
+ },
124
+ b: {
125
+ deviceId: "web",
126
+ interfaceId: "eth0"
127
+ },
128
+ label: "datacenter",
129
+ latencyMs: 18,
130
+ bandwidthMbps: 1e3
131
+ }
132
+ ]
133
+ };
134
+ const COMPANY_NETWORK = {
135
+ schemaVersion: 1,
136
+ type: "network",
137
+ title: "Company network with redundant routes",
138
+ devices: [
139
+ {
140
+ id: "employee",
141
+ kind: "client",
142
+ label: "Employee",
143
+ at: {
144
+ x: 70,
145
+ y: 150
146
+ },
147
+ interfaces: [{
148
+ id: "eth0",
149
+ addresses: ["10.20.1.25/24"]
150
+ }]
151
+ },
152
+ {
153
+ id: "access",
154
+ kind: "switch",
155
+ label: "Access switch",
156
+ at: {
157
+ x: 210,
158
+ y: 150
159
+ },
160
+ interfaces: [
161
+ { id: "p1" },
162
+ { id: "p2" },
163
+ { id: "p3" }
164
+ ]
165
+ },
166
+ {
167
+ id: "r1",
168
+ kind: "router",
169
+ label: "Router A",
170
+ at: {
171
+ x: 380,
172
+ y: 80
173
+ },
174
+ interfaces: [{ id: "lan" }, { id: "wan" }]
175
+ },
176
+ {
177
+ id: "r2",
178
+ kind: "router",
179
+ label: "Router B",
180
+ at: {
181
+ x: 380,
182
+ y: 220
183
+ },
184
+ interfaces: [{ id: "lan" }, { id: "wan" }]
185
+ },
186
+ {
187
+ id: "firewall",
188
+ kind: "firewall",
189
+ label: "Firewall",
190
+ at: {
191
+ x: 550,
192
+ y: 150
193
+ },
194
+ interfaces: [
195
+ { id: "inside1" },
196
+ { id: "inside2" },
197
+ { id: "dmz" }
198
+ ]
199
+ },
200
+ {
201
+ id: "api",
202
+ kind: "server",
203
+ label: "API server",
204
+ at: {
205
+ x: 720,
206
+ y: 150
207
+ },
208
+ interfaces: [{
209
+ id: "eth0",
210
+ addresses: ["10.30.0.10/24"]
211
+ }],
212
+ services: [{
213
+ kind: "https",
214
+ port: 443
215
+ }, {
216
+ kind: "websocket",
217
+ port: 443
218
+ }]
219
+ }
220
+ ],
221
+ links: [
222
+ {
223
+ id: "employee-access",
224
+ a: {
225
+ deviceId: "employee",
226
+ interfaceId: "eth0"
227
+ },
228
+ b: {
229
+ deviceId: "access",
230
+ interfaceId: "p1"
231
+ },
232
+ latencyMs: 1
233
+ },
234
+ {
235
+ id: "access-r1",
236
+ a: {
237
+ deviceId: "access",
238
+ interfaceId: "p2"
239
+ },
240
+ b: {
241
+ deviceId: "r1",
242
+ interfaceId: "lan"
243
+ },
244
+ latencyMs: 2,
245
+ cost: 2
246
+ },
247
+ {
248
+ id: "access-r2",
249
+ a: {
250
+ deviceId: "access",
251
+ interfaceId: "p3"
252
+ },
253
+ b: {
254
+ deviceId: "r2",
255
+ interfaceId: "lan"
256
+ },
257
+ latencyMs: 4,
258
+ cost: 4
259
+ },
260
+ {
261
+ id: "r1-fw",
262
+ a: {
263
+ deviceId: "r1",
264
+ interfaceId: "wan"
265
+ },
266
+ b: {
267
+ deviceId: "firewall",
268
+ interfaceId: "inside1"
269
+ },
270
+ latencyMs: 2,
271
+ cost: 2
272
+ },
273
+ {
274
+ id: "r2-fw",
275
+ a: {
276
+ deviceId: "r2",
277
+ interfaceId: "wan"
278
+ },
279
+ b: {
280
+ deviceId: "firewall",
281
+ interfaceId: "inside2"
282
+ },
283
+ latencyMs: 2,
284
+ cost: 2
285
+ },
286
+ {
287
+ id: "fw-api",
288
+ a: {
289
+ deviceId: "firewall",
290
+ interfaceId: "dmz"
291
+ },
292
+ b: {
293
+ deviceId: "api",
294
+ interfaceId: "eth0"
295
+ },
296
+ latencyMs: 1
297
+ }
298
+ ]
299
+ };
300
+
301
+ //#endregion
302
+ export { COMPANY_NETWORK, HOME_NETWORK };
@@ -0,0 +1,8 @@
1
+ import { NetworkDoc, NetworkPacket, NetworkTrace } from "./contract.mjs";
2
+
3
+ //#region src/networking/topology/simulation.d.ts
4
+ declare function createPacket(doc: NetworkDoc, from: string, to: string, protocol?: "icmp" | "http"): NetworkPacket;
5
+ /** Small deterministic packet trace: topology/path truth is real, protocol narration is explicit. */
6
+ declare function simulatePacket(doc: NetworkDoc, from: string, to: string, protocol?: "icmp" | "http"): NetworkTrace;
7
+ //#endregion
8
+ export { createPacket, simulatePacket };
@@ -0,0 +1,179 @@
1
+ //#region src/networking/topology/simulation.ts
2
+ function shortestPaths(nodes, edges, source) {
3
+ const distances = Object.fromEntries(nodes.map((id) => [id, id === source ? 0 : Infinity]));
4
+ const previous = {};
5
+ const remaining = new Set(nodes);
6
+ while (remaining.size) {
7
+ const current = [...remaining].reduce((best, id) => (distances[id] ?? Infinity) < (distances[best] ?? Infinity) ? id : best);
8
+ remaining.delete(current);
9
+ for (const edge of edges) {
10
+ const next = edge.from === current ? edge.to : edge.to === current ? edge.from : void 0;
11
+ if (!next || !remaining.has(next)) continue;
12
+ const candidate = (distances[current] ?? Infinity) + edge.weight;
13
+ if (candidate < (distances[next] ?? Infinity)) {
14
+ distances[next] = candidate;
15
+ previous[next] = current;
16
+ }
17
+ }
18
+ }
19
+ return {
20
+ distances,
21
+ previous
22
+ };
23
+ }
24
+ function reconstructPath(previous, from, to) {
25
+ const path = [];
26
+ let current = to;
27
+ while (current) {
28
+ path.unshift(current);
29
+ if (current === from) return path;
30
+ current = previous[current];
31
+ }
32
+ return [];
33
+ }
34
+ const primaryIp = (doc, deviceId) => doc.devices.find((d) => d.id === deviceId)?.interfaces.flatMap((i) => i.addresses ?? [])[0]?.split("/")[0] ?? deviceId;
35
+ function createPacket(doc, from, to, protocol = "icmp") {
36
+ const sourceIp = primaryIp(doc, from);
37
+ const destinationIp = primaryIp(doc, to);
38
+ return {
39
+ id: `${protocol}-${from}-${to}`,
40
+ from,
41
+ to,
42
+ bytes: protocol === "http" ? 428 : 84,
43
+ layers: [
44
+ {
45
+ kind: "application",
46
+ protocol: protocol === "http" ? "HTTP" : "Ping",
47
+ summary: protocol === "http" ? "GET / HTTP/1.1" : "Echo request"
48
+ },
49
+ {
50
+ kind: "transport",
51
+ protocol: protocol === "http" ? "TCP" : "ICMP",
52
+ summary: protocol === "http" ? "49152 → 80" : "type 8, code 0",
53
+ fields: protocol === "http" ? {
54
+ sourcePort: 49152,
55
+ destinationPort: 80
56
+ } : { type: 8 }
57
+ },
58
+ {
59
+ kind: "network",
60
+ protocol: "IPv4",
61
+ summary: `${sourceIp} → ${destinationIp}`,
62
+ fields: {
63
+ source: sourceIp,
64
+ destination: destinationIp,
65
+ ttl: 64
66
+ }
67
+ },
68
+ {
69
+ kind: "data-link",
70
+ protocol: "Ethernet",
71
+ summary: "next-hop frame (MAC addresses change each routed hop)"
72
+ },
73
+ {
74
+ kind: "physical",
75
+ protocol: "Link",
76
+ summary: "bits transmitted over the selected medium"
77
+ }
78
+ ]
79
+ };
80
+ }
81
+ /** Small deterministic packet trace: topology/path truth is real, protocol narration is explicit. */
82
+ function simulatePacket(doc, from, to, protocol = "icmp") {
83
+ const packet = createPacket(doc, from, to, protocol);
84
+ const upLinks = doc.links.filter((link) => link.state !== "down");
85
+ const graph = {
86
+ nodes: doc.devices.map((device, index) => ({
87
+ id: device.id,
88
+ x: index,
89
+ y: 0
90
+ })),
91
+ edges: upLinks.map((link) => ({
92
+ id: link.id,
93
+ from: link.a.deviceId,
94
+ to: link.b.deviceId,
95
+ weight: link.cost ?? link.latencyMs ?? 1
96
+ }))
97
+ };
98
+ const path = reconstructPath(shortestPaths(graph.nodes.map((node) => node.id), graph.edges, from).previous, from, to);
99
+ const events = [{
100
+ type: "packet-created",
101
+ at: from,
102
+ packet,
103
+ message: `${protocol.toUpperCase()} packet created at ${from}.`
104
+ }];
105
+ if (!path.length) {
106
+ events.push({
107
+ type: "packet-dropped",
108
+ at: from,
109
+ reason: "unreachable",
110
+ message: `No available route from ${from} to ${to}.`
111
+ });
112
+ return {
113
+ delivered: false,
114
+ path: [],
115
+ totalLatencyMs: 0,
116
+ events
117
+ };
118
+ }
119
+ let totalLatencyMs = 0;
120
+ for (let i = 0; i < path.length - 1; i++) {
121
+ const at = path[i];
122
+ const next = path[i + 1];
123
+ const link = upLinks.find((candidate) => candidate.a.deviceId === at && candidate.b.deviceId === next || candidate.b.deviceId === at && candidate.a.deviceId === next);
124
+ if (!link) continue;
125
+ if (i === 0) {
126
+ events.push({
127
+ type: "arp-requested",
128
+ at,
129
+ target: next,
130
+ message: `${at} asks for the next hop's hardware address.`
131
+ });
132
+ events.push({
133
+ type: "arp-resolved",
134
+ at,
135
+ target: next,
136
+ message: `${next} answers; ${at} can now build the Ethernet frame.`
137
+ });
138
+ }
139
+ const device = doc.devices.find((d) => d.id === at);
140
+ if (device?.kind === "router") events.push({
141
+ type: "route-selected",
142
+ at,
143
+ next,
144
+ message: `${device.label} selects the lowest-cost available next hop: ${next}.`
145
+ });
146
+ events.push({
147
+ type: "frame-sent",
148
+ at,
149
+ linkId: link.id,
150
+ next,
151
+ packet,
152
+ message: `${at} sends the frame over ${link.label ?? link.id}.`
153
+ });
154
+ totalLatencyMs += link.latencyMs ?? 1;
155
+ events.push({
156
+ type: "frame-received",
157
+ at: next,
158
+ linkId: link.id,
159
+ from: at,
160
+ packet,
161
+ message: `${next} receives and inspects the frame.`
162
+ });
163
+ }
164
+ events.push({
165
+ type: "packet-delivered",
166
+ at: to,
167
+ packet,
168
+ message: `${packet.layers[0]?.protocol ?? "Packet"} delivered to ${to} in ${totalLatencyMs} ms simulated time.`
169
+ });
170
+ return {
171
+ delivered: true,
172
+ path,
173
+ totalLatencyMs,
174
+ events
175
+ };
176
+ }
177
+
178
+ //#endregion
179
+ export { createPacket, simulatePacket };
@@ -0,0 +1,11 @@
1
+ //#region src/networking/wireless.d.ts
2
+ interface ContentionResult {
3
+ readonly offered: number;
4
+ readonly contenders: number;
5
+ readonly collisionPercent: number;
6
+ readonly usefulPercent: number;
7
+ readonly hiddenPenalty: number;
8
+ }
9
+ declare function simulateContention(stations: number, backoffSlots: number, hidden: boolean): ContentionResult;
10
+ //#endregion
11
+ export { ContentionResult, simulateContention };
@@ -0,0 +1,17 @@
1
+ //#region src/networking/wireless.ts
2
+ function simulateContention(stations, backoffSlots, hidden) {
3
+ const contenders = Math.max(1, Math.round(stations));
4
+ const baseCollision = contenders === 1 ? 0 : 1 - Math.pow(1 - 1 / Math.max(1, Math.round(backoffSlots)), contenders - 1);
5
+ const hiddenPenalty = hidden && contenders > 1 ? Math.min(.45, (contenders - 1) * .07) : 0;
6
+ const collision = Math.min(.92, baseCollision + hiddenPenalty);
7
+ return {
8
+ offered: contenders,
9
+ contenders,
10
+ collisionPercent: Math.round(collision * 100),
11
+ usefulPercent: Math.round((1 - collision) * 100),
12
+ hiddenPenalty: Math.round(hiddenPenalty * 100)
13
+ };
14
+ }
15
+
16
+ //#endregion
17
+ export { simulateContention };