@classytic/stage 0.2.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 (458) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +5 -1
  3. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  4. package/dist/assets/index.mjs +0 -1
  5. package/dist/atomic/aufbau.d.mts +144 -0
  6. package/dist/atomic/aufbau.mjs +384 -0
  7. package/dist/atomic/elements.d.mts +67 -0
  8. package/dist/atomic/elements.mjs +785 -0
  9. package/dist/atomic/emission.d.mts +112 -0
  10. package/dist/atomic/emission.mjs +179 -0
  11. package/dist/atomic/index.d.mts +8 -0
  12. package/dist/atomic/index.mjs +9 -0
  13. package/dist/atomic/periodic.d.mts +82 -0
  14. package/dist/atomic/periodic.mjs +231 -0
  15. package/dist/atomic/properties.d.mts +100 -0
  16. package/dist/atomic/properties.mjs +574 -0
  17. package/dist/atomic/shells.d.mts +137 -0
  18. package/dist/atomic/shells.mjs +170 -0
  19. package/dist/atomic/trends.d.mts +148 -0
  20. package/dist/atomic/trends.mjs +225 -0
  21. package/dist/builder/Palette.mjs +50 -89
  22. package/dist/builder/SceneBuilder.mjs +15 -73
  23. package/dist/chem/chromatography.d.mts +66 -0
  24. package/dist/chem/chromatography.mjs +63 -0
  25. package/dist/chem/complex.d.mts +114 -0
  26. package/dist/chem/complex.mjs +234 -0
  27. package/dist/chem/cycle.d.mts +75 -0
  28. package/dist/chem/cycle.mjs +145 -0
  29. package/dist/chem/equation.d.mts +86 -0
  30. package/dist/chem/equation.mjs +168 -0
  31. package/dist/chem/formula.d.mts +90 -0
  32. package/dist/chem/formula.mjs +201 -0
  33. package/dist/chem/functional-groups.d.mts +31 -0
  34. package/dist/chem/functional-groups.mjs +187 -0
  35. package/dist/chem/hazard.d.mts +94 -0
  36. package/dist/chem/hazard.mjs +329 -0
  37. package/dist/chem/index.d.mts +34 -33
  38. package/dist/chem/index.mjs +34 -28
  39. package/dist/chem/ionic.d.mts +98 -0
  40. package/dist/chem/ionic.mjs +156 -0
  41. package/dist/chem/layout.d.mts +46 -0
  42. package/dist/chem/layout.mjs +342 -0
  43. package/dist/chem/lewis.d.mts +79 -0
  44. package/dist/chem/lewis.mjs +163 -0
  45. package/dist/chem/molecular-orbital.d.mts +114 -0
  46. package/dist/chem/molecular-orbital.mjs +201 -0
  47. package/dist/chem/molecule.d.mts +154 -0
  48. package/dist/chem/molecule.mjs +282 -0
  49. package/dist/chem/nmr.d.mts +153 -0
  50. package/dist/chem/nmr.mjs +165 -0
  51. package/dist/chem/polymer.d.mts +65 -0
  52. package/dist/chem/polymer.mjs +179 -0
  53. package/dist/chem/redox.d.mts +138 -0
  54. package/dist/chem/redox.mjs +328 -0
  55. package/dist/chem/relations.d.mts +183 -0
  56. package/dist/chem/relations.mjs +299 -0
  57. package/dist/chem/skeleton.d.mts +51 -0
  58. package/dist/chem/skeleton.mjs +186 -0
  59. package/dist/chem/solution.d.mts +116 -0
  60. package/dist/chem/solution.mjs +186 -0
  61. package/dist/chem/species.d.mts +47 -0
  62. package/dist/chem/species.mjs +128 -0
  63. package/dist/chem/stereo.d.mts +108 -0
  64. package/dist/chem/stereo.mjs +286 -0
  65. package/dist/chem/stoichiometry.d.mts +95 -0
  66. package/dist/chem/stoichiometry.mjs +145 -0
  67. package/dist/chem/synthesis.d.mts +113 -0
  68. package/dist/chem/synthesis.mjs +281 -0
  69. package/dist/chem/vsepr.d.mts +80 -0
  70. package/dist/chem/vsepr.mjs +247 -0
  71. package/dist/circuit/ac.d.mts +163 -0
  72. package/dist/circuit/ac.mjs +452 -0
  73. package/dist/circuit/dc.d.mts +92 -0
  74. package/dist/circuit/dc.mjs +333 -0
  75. package/dist/circuit/index.d.mts +5 -92
  76. package/dist/circuit/index.mjs +5 -332
  77. package/dist/circuit/network.d.mts +99 -0
  78. package/dist/circuit/network.mjs +440 -0
  79. package/dist/circuit/topology.d.mts +102 -0
  80. package/dist/circuit/topology.mjs +143 -0
  81. package/dist/colour/absorption.d.mts +79 -0
  82. package/dist/colour/absorption.mjs +137 -0
  83. package/dist/colour/index.d.mts +6 -0
  84. package/dist/colour/index.mjs +7 -0
  85. package/dist/colour/name.d.mts +14 -0
  86. package/dist/colour/name.mjs +76 -0
  87. package/dist/colour/observer.d.mts +31 -0
  88. package/dist/colour/observer.mjs +46 -0
  89. package/dist/colour/spectrum.d.mts +61 -0
  90. package/dist/colour/spectrum.mjs +108 -0
  91. package/dist/colour/srgb.d.mts +49 -0
  92. package/dist/colour/srgb.mjs +108 -0
  93. package/dist/core/constants.d.mts +138 -0
  94. package/dist/core/constants.mjs +139 -0
  95. package/dist/core/index.d.mts +4 -1
  96. package/dist/core/index.mjs +4 -1
  97. package/dist/core/math.d.mts +26 -0
  98. package/dist/core/math.mjs +37 -0
  99. package/dist/core/vec3.d.mts +94 -0
  100. package/dist/core/vec3.mjs +123 -0
  101. package/dist/core/worked.d.mts +35 -0
  102. package/dist/core/worked.mjs +44 -0
  103. package/dist/electro/cell.d.mts +102 -0
  104. package/dist/electro/cell.mjs +170 -0
  105. package/dist/electro/conductivity.d.mts +157 -0
  106. package/dist/electro/conductivity.mjs +156 -0
  107. package/dist/electro/couples.d.mts +114 -0
  108. package/dist/electro/couples.mjs +334 -0
  109. package/dist/electro/electrolysis.d.mts +96 -0
  110. package/dist/electro/electrolysis.mjs +274 -0
  111. package/dist/electro/faraday.d.mts +150 -0
  112. package/dist/electro/faraday.mjs +118 -0
  113. package/dist/electro/index.d.mts +6 -0
  114. package/dist/electro/index.mjs +7 -0
  115. package/dist/finance/accounting/adjustments.d.mts +17 -0
  116. package/dist/finance/accounting/adjustments.mjs +202 -0
  117. package/dist/finance/accounting/analysis.d.mts +8 -0
  118. package/dist/finance/accounting/analysis.mjs +205 -0
  119. package/dist/finance/accounting/clubs.d.mts +21 -0
  120. package/dist/finance/accounting/clubs.mjs +217 -0
  121. package/dist/finance/accounting/company-statements.d.mts +7 -0
  122. package/dist/finance/accounting/company-statements.mjs +150 -0
  123. package/dist/finance/accounting/harness.d.mts +7 -0
  124. package/dist/finance/accounting/harness.mjs +45 -0
  125. package/dist/finance/accounting/index.d.mts +18 -0
  126. package/dist/finance/accounting/index.mjs +18 -0
  127. package/dist/finance/accounting/journalize.d.mts +16 -0
  128. package/dist/finance/accounting/journalize.mjs +128 -0
  129. package/dist/finance/accounting/manufacturing.d.mts +8 -0
  130. package/dist/finance/accounting/manufacturing.mjs +236 -0
  131. package/dist/finance/accounting/partnership.d.mts +7 -0
  132. package/dist/finance/accounting/partnership.mjs +152 -0
  133. package/dist/finance/accounting/period-case.d.mts +6 -0
  134. package/dist/finance/accounting/period-case.mjs +71 -0
  135. package/dist/finance/accounting/post.d.mts +9 -0
  136. package/dist/finance/accounting/post.mjs +84 -0
  137. package/dist/finance/accounting/precision.d.mts +9 -0
  138. package/dist/finance/accounting/precision.mjs +15 -0
  139. package/dist/finance/accounting/rules.d.mts +21 -0
  140. package/dist/finance/accounting/rules.mjs +37 -0
  141. package/dist/finance/accounting/solve.d.mts +28 -0
  142. package/dist/finance/accounting/solve.mjs +92 -0
  143. package/dist/finance/accounting/statements.d.mts +7 -0
  144. package/dist/finance/accounting/statements.mjs +142 -0
  145. package/dist/finance/accounting/types.d.mts +649 -0
  146. package/dist/finance/accounting/validate.d.mts +7 -0
  147. package/dist/finance/accounting/validate.mjs +67 -0
  148. package/dist/finance/accounting/verification.d.mts +24 -0
  149. package/dist/finance/accounting/verification.mjs +386 -0
  150. package/dist/finance/bizsim.d.mts +75 -0
  151. package/dist/finance/bizsim.mjs +296 -0
  152. package/dist/finance/index.d.mts +95 -0
  153. package/dist/finance/index.mjs +145 -0
  154. package/dist/finance/investment-math.d.mts +7 -0
  155. package/dist/finance/investment-math.mjs +18 -0
  156. package/dist/finance/management-accounting/budgeting.d.mts +7 -0
  157. package/dist/finance/management-accounting/budgeting.mjs +189 -0
  158. package/dist/finance/management-accounting/cash-budget.d.mts +7 -0
  159. package/dist/finance/management-accounting/cash-budget.mjs +154 -0
  160. package/dist/finance/management-accounting/costing.d.mts +8 -0
  161. package/dist/finance/management-accounting/costing.mjs +175 -0
  162. package/dist/finance/management-accounting/decisions.d.mts +8 -0
  163. package/dist/finance/management-accounting/decisions.mjs +164 -0
  164. package/dist/finance/management-accounting/index.d.mts +13 -0
  165. package/dist/finance/management-accounting/index.mjs +13 -0
  166. package/dist/finance/management-accounting/integrated-budget.d.mts +8 -0
  167. package/dist/finance/management-accounting/integrated-budget.mjs +67 -0
  168. package/dist/finance/management-accounting/inventory-costing.d.mts +7 -0
  169. package/dist/finance/management-accounting/inventory-costing.mjs +173 -0
  170. package/dist/finance/management-accounting/investment-appraisal.d.mts +7 -0
  171. package/dist/finance/management-accounting/investment-appraisal.mjs +148 -0
  172. package/dist/finance/management-accounting/management-case.d.mts +8 -0
  173. package/dist/finance/management-accounting/management-case.mjs +91 -0
  174. package/dist/finance/management-accounting/master-budget.d.mts +7 -0
  175. package/dist/finance/management-accounting/master-budget.mjs +137 -0
  176. package/dist/finance/management-accounting/production-costing.d.mts +8 -0
  177. package/dist/finance/management-accounting/production-costing.mjs +214 -0
  178. package/dist/finance/management-accounting/types.d.mts +644 -0
  179. package/dist/finance/management-accounting/variances.d.mts +7 -0
  180. package/dist/finance/management-accounting/variances.mjs +150 -0
  181. package/dist/index.d.mts +9 -8
  182. package/dist/index.mjs +5 -5
  183. package/dist/interaction/MovableDot.mjs +19 -0
  184. package/dist/interaction/useDraggable.mjs +24 -4
  185. package/dist/math/analysis.d.mts +61 -0
  186. package/dist/math/analysis.mjs +187 -0
  187. package/dist/math/answer-check.d.mts +50 -0
  188. package/dist/math/answer-check.mjs +106 -0
  189. package/dist/math/calculus.d.mts +17 -1
  190. package/dist/math/calculus.mjs +365 -2
  191. package/dist/math/complex.d.mts +93 -0
  192. package/dist/math/complex.mjs +239 -0
  193. package/dist/math/expr.d.mts +23 -0
  194. package/dist/math/expr.mjs +36 -0
  195. package/dist/math/index.d.mts +9 -23
  196. package/dist/math/index.mjs +9 -38
  197. package/dist/math/latex.mjs +10 -1
  198. package/dist/math/parse.mjs +1 -1
  199. package/dist/math/poly.d.mts +55 -0
  200. package/dist/math/poly.mjs +273 -0
  201. package/dist/math/rearrange.d.mts +14 -0
  202. package/dist/math/rearrange.mjs +125 -0
  203. package/dist/math/solve.d.mts +21 -0
  204. package/dist/math/solve.mjs +75 -0
  205. package/dist/networking/addressing.d.mts +26 -0
  206. package/dist/networking/addressing.mjs +33 -0
  207. package/dist/networking/cloud/access.d.mts +36 -0
  208. package/dist/networking/cloud/access.mjs +95 -0
  209. package/dist/networking/cloud/containers.d.mts +43 -0
  210. package/dist/networking/cloud/containers.mjs +54 -0
  211. package/dist/networking/cloud/edge.d.mts +17 -0
  212. package/dist/networking/cloud/edge.mjs +31 -0
  213. package/dist/networking/cloud/failure-domains.d.mts +19 -0
  214. package/dist/networking/cloud/failure-domains.mjs +22 -0
  215. package/dist/networking/cloud/geo-routing.d.mts +22 -0
  216. package/dist/networking/cloud/geo-routing.mjs +64 -0
  217. package/dist/networking/cloud/index.d.mts +18 -0
  218. package/dist/networking/cloud/index.mjs +19 -0
  219. package/dist/networking/cloud/inference-reliability.d.mts +30 -0
  220. package/dist/networking/cloud/inference-reliability.mjs +76 -0
  221. package/dist/networking/cloud/inference.d.mts +118 -0
  222. package/dist/networking/cloud/inference.mjs +179 -0
  223. package/dist/networking/cloud/infrastructure.d.mts +45 -0
  224. package/dist/networking/cloud/infrastructure.mjs +96 -0
  225. package/dist/networking/cloud/observability.d.mts +24 -0
  226. package/dist/networking/cloud/observability.mjs +34 -0
  227. package/dist/networking/cloud/orchestration.d.mts +32 -0
  228. package/dist/networking/cloud/orchestration.mjs +38 -0
  229. package/dist/networking/cloud/recovery.d.mts +21 -0
  230. package/dist/networking/cloud/recovery.mjs +27 -0
  231. package/dist/networking/cloud/releases.d.mts +42 -0
  232. package/dist/networking/cloud/releases.mjs +135 -0
  233. package/dist/networking/cloud/scaling.d.mts +25 -0
  234. package/dist/networking/cloud/scaling.mjs +65 -0
  235. package/dist/networking/cloud/secrets.d.mts +39 -0
  236. package/dist/networking/cloud/secrets.mjs +68 -0
  237. package/dist/networking/cloud/server-deployment.d.mts +29 -0
  238. package/dist/networking/cloud/server-deployment.mjs +72 -0
  239. package/dist/networking/cloud/storage.d.mts +16 -0
  240. package/dist/networking/cloud/storage.mjs +58 -0
  241. package/dist/networking/cloud/vpc.d.mts +18 -0
  242. package/dist/networking/cloud/vpc.mjs +100 -0
  243. package/dist/networking/delivery.d.mts +34 -0
  244. package/dist/networking/delivery.mjs +52 -0
  245. package/dist/networking/index.d.mts +47 -0
  246. package/dist/networking/index.mjs +47 -0
  247. package/dist/networking/ipv6.d.mts +28 -0
  248. package/dist/networking/ipv6.mjs +17 -0
  249. package/dist/networking/journeys.d.mts +83 -0
  250. package/dist/networking/journeys.mjs +161 -0
  251. package/dist/networking/models/airtime.d.mts +87 -0
  252. package/dist/networking/models/airtime.mjs +130 -0
  253. package/dist/networking/models/cellular.d.mts +157 -0
  254. package/dist/networking/models/cellular.mjs +252 -0
  255. package/dist/networking/models/encapsulation.d.mts +98 -0
  256. package/dist/networking/models/encapsulation.mjs +132 -0
  257. package/dist/networking/models/handover.d.mts +116 -0
  258. package/dist/networking/models/handover.mjs +209 -0
  259. package/dist/networking/models/handshake.d.mts +90 -0
  260. package/dist/networking/models/handshake.mjs +122 -0
  261. package/dist/networking/models/index.d.mts +14 -0
  262. package/dist/networking/models/index.mjs +15 -0
  263. package/dist/networking/models/media.d.mts +82 -0
  264. package/dist/networking/models/media.mjs +188 -0
  265. package/dist/networking/models/satellite.d.mts +86 -0
  266. package/dist/networking/models/satellite.mjs +121 -0
  267. package/dist/networking/models/spectrum.d.mts +83 -0
  268. package/dist/networking/models/spectrum.mjs +235 -0
  269. package/dist/networking/models/switch.d.mts +80 -0
  270. package/dist/networking/models/switch.mjs +155 -0
  271. package/dist/networking/models/vlan.d.mts +62 -0
  272. package/dist/networking/models/vlan.mjs +100 -0
  273. package/dist/networking/models/vpn.d.mts +66 -0
  274. package/dist/networking/models/vpn.mjs +125 -0
  275. package/dist/networking/models/wifi-privacy.d.mts +82 -0
  276. package/dist/networking/models/wifi-privacy.mjs +130 -0
  277. package/dist/networking/models/wifi.d.mts +240 -0
  278. package/dist/networking/models/wifi.mjs +562 -0
  279. package/dist/networking/nat-traversal.d.mts +24 -0
  280. package/dist/networking/nat-traversal.mjs +38 -0
  281. package/dist/networking/protocols.d.mts +17 -0
  282. package/dist/networking/protocols.mjs +57 -0
  283. package/dist/networking/queue.d.mts +12 -0
  284. package/dist/networking/queue.mjs +18 -0
  285. package/dist/networking/route-learning.d.mts +23 -0
  286. package/dist/networking/route-learning.mjs +43 -0
  287. package/dist/networking/routing.d.mts +11 -0
  288. package/dist/networking/routing.mjs +25 -0
  289. package/dist/networking/signals.d.mts +26 -0
  290. package/dist/networking/signals.mjs +35 -0
  291. package/dist/networking/subnet.d.mts +49 -0
  292. package/dist/networking/subnet.mjs +89 -0
  293. package/dist/networking/tcp-reliability.d.mts +24 -0
  294. package/dist/networking/tcp-reliability.mjs +38 -0
  295. package/dist/networking/topology/contract.d.mts +123 -0
  296. package/dist/networking/topology/index.d.mts +4 -0
  297. package/dist/networking/topology/index.mjs +4 -0
  298. package/dist/networking/topology/presets.d.mts +7 -0
  299. package/dist/networking/topology/presets.mjs +302 -0
  300. package/dist/networking/topology/simulation.d.mts +8 -0
  301. package/dist/networking/topology/simulation.mjs +179 -0
  302. package/dist/networking/wireless.d.mts +11 -0
  303. package/dist/networking/wireless.mjs +17 -0
  304. package/dist/optics/imaging.d.mts +218 -0
  305. package/dist/optics/imaging.mjs +276 -0
  306. package/dist/optics/index.d.mts +7 -0
  307. package/dist/optics/index.mjs +8 -0
  308. package/dist/optics/laws.d.mts +70 -0
  309. package/dist/optics/laws.mjs +195 -0
  310. package/dist/optics/prism.d.mts +148 -0
  311. package/dist/optics/prism.mjs +197 -0
  312. package/dist/optics/refraction.d.mts +201 -0
  313. package/dist/optics/refraction.mjs +270 -0
  314. package/dist/optics/wave-optics.d.mts +171 -0
  315. package/dist/optics/wave-optics.mjs +259 -0
  316. package/dist/physics/ac/index.d.mts +183 -0
  317. package/dist/physics/ac/index.mjs +203 -0
  318. package/dist/physics/dynamics/forces.d.mts +98 -0
  319. package/dist/physics/dynamics/forces.mjs +153 -0
  320. package/dist/physics/dynamics/friction.d.mts +76 -0
  321. package/dist/physics/dynamics/friction.mjs +119 -0
  322. package/dist/physics/dynamics/system.d.mts +68 -0
  323. package/dist/physics/dynamics/system.mjs +125 -0
  324. package/dist/physics/electrostatics/index.d.mts +169 -0
  325. package/dist/physics/electrostatics/index.mjs +249 -0
  326. package/dist/physics/energy/centre-of-mass.d.mts +115 -0
  327. package/dist/physics/energy/centre-of-mass.mjs +180 -0
  328. package/dist/physics/energy/conservation.d.mts +81 -0
  329. package/dist/physics/energy/conservation.mjs +129 -0
  330. package/dist/physics/energy/power.d.mts +90 -0
  331. package/dist/physics/energy/power.mjs +167 -0
  332. package/dist/physics/energy/spring.d.mts +73 -0
  333. package/dist/physics/energy/spring.mjs +129 -0
  334. package/dist/physics/energy/store.d.mts +63 -0
  335. package/dist/physics/energy/store.mjs +108 -0
  336. package/dist/physics/energy/theorem.d.mts +65 -0
  337. package/dist/physics/energy/theorem.mjs +113 -0
  338. package/dist/physics/energy/work.d.mts +114 -0
  339. package/dist/physics/energy/work.mjs +219 -0
  340. package/dist/physics/gravitation/body.d.mts +85 -0
  341. package/dist/physics/gravitation/body.mjs +168 -0
  342. package/dist/physics/gravitation/kepler.d.mts +127 -0
  343. package/dist/physics/gravitation/kepler.mjs +216 -0
  344. package/dist/physics/gravitation/law.d.mts +117 -0
  345. package/dist/physics/gravitation/law.mjs +175 -0
  346. package/dist/physics/gravitation/orbit.d.mts +119 -0
  347. package/dist/physics/gravitation/orbit.mjs +202 -0
  348. package/dist/physics/gravitation/potential.d.mts +114 -0
  349. package/dist/physics/gravitation/potential.mjs +202 -0
  350. package/dist/physics/gravitation/variation.d.mts +97 -0
  351. package/dist/physics/gravitation/variation.mjs +175 -0
  352. package/dist/physics/index.d.mts +35 -0
  353. package/dist/physics/index.mjs +36 -0
  354. package/dist/physics/integral-sweep.d.mts +63 -0
  355. package/dist/physics/integral-sweep.mjs +126 -0
  356. package/dist/physics/kinematics/equations.d.mts +47 -0
  357. package/dist/physics/kinematics/equations.mjs +126 -0
  358. package/dist/physics/kinematics/free-fall.d.mts +53 -0
  359. package/dist/physics/kinematics/free-fall.mjs +71 -0
  360. package/dist/physics/kinematics/given.d.mts +16 -0
  361. package/dist/physics/kinematics/given.mjs +55 -0
  362. package/dist/physics/kinematics/roots.d.mts +41 -0
  363. package/dist/physics/kinematics/roots.mjs +72 -0
  364. package/dist/physics/kinematics/solve.d.mts +52 -0
  365. package/dist/physics/kinematics/solve.mjs +172 -0
  366. package/dist/physics/magnetism/biot-savart.d.mts +161 -0
  367. package/dist/physics/magnetism/biot-savart.mjs +353 -0
  368. package/dist/physics/magnetism/flux.d.mts +94 -0
  369. package/dist/physics/magnetism/flux.mjs +313 -0
  370. package/dist/physics/magnetism/geomagnetism.d.mts +151 -0
  371. package/dist/physics/magnetism/geomagnetism.mjs +184 -0
  372. package/dist/physics/magnetism/index.d.mts +12 -0
  373. package/dist/physics/magnetism/index.mjs +74 -0
  374. package/dist/physics/magnetism/lorentz.d.mts +28 -0
  375. package/dist/physics/magnetism/lorentz.mjs +88 -0
  376. package/dist/physics/magnetism/magnetic-force.d.mts +102 -0
  377. package/dist/physics/magnetism/magnetic-force.mjs +169 -0
  378. package/dist/physics/momentum/collide.d.mts +77 -0
  379. package/dist/physics/momentum/collide.mjs +115 -0
  380. package/dist/physics/momentum/impulse.d.mts +89 -0
  381. package/dist/physics/momentum/impulse.mjs +159 -0
  382. package/dist/physics/momentum/planar.d.mts +60 -0
  383. package/dist/physics/momentum/planar.mjs +110 -0
  384. package/dist/physics/projectile.d.mts +107 -0
  385. package/dist/physics/projectile.mjs +185 -0
  386. package/dist/physics/rotation/angular.d.mts +85 -0
  387. package/dist/physics/rotation/angular.mjs +130 -0
  388. package/dist/physics/rotation/circular.d.mts +79 -0
  389. package/dist/physics/rotation/circular.mjs +131 -0
  390. package/dist/physics/rotation/inertia.d.mts +164 -0
  391. package/dist/physics/rotation/inertia.mjs +332 -0
  392. package/dist/physics/rotation/torque.d.mts +65 -0
  393. package/dist/physics/rotation/torque.mjs +134 -0
  394. package/dist/physics/vectors.d.mts +64 -0
  395. package/dist/physics/vectors.mjs +114 -0
  396. package/dist/primitives/Dot.d.mts +2 -15
  397. package/dist/primitives/Dot.mjs +6 -4
  398. package/dist/primitives/Grid.d.mts +33 -17
  399. package/dist/primitives/Grid.mjs +89 -17
  400. package/dist/primitives/Label.d.mts +1 -14
  401. package/dist/primitives/Label.mjs +3 -2
  402. package/dist/primitives/Lines.d.mts +4 -32
  403. package/dist/primitives/Lines.mjs +10 -8
  404. package/dist/primitives/Shapes.d.mts +5 -43
  405. package/dist/primitives/Shapes.mjs +12 -10
  406. package/dist/primitives/index.d.mts +2 -2
  407. package/dist/primitives/index.mjs +2 -2
  408. package/dist/primitives/props.mjs +31 -0
  409. package/dist/quantity/index.d.mts +119 -0
  410. package/dist/quantity/index.mjs +417 -0
  411. package/dist/relation/derive.d.mts +74 -0
  412. package/dist/relation/derive.mjs +73 -0
  413. package/dist/relation/index.d.mts +56 -0
  414. package/dist/relation/index.mjs +234 -0
  415. package/dist/scene/Scene.d.mts +6 -1
  416. package/dist/scene/Scene.mjs +15 -40
  417. package/dist/scene/evaluators.mjs +1 -1
  418. package/dist/sim/thermal.mjs +45 -20
  419. package/dist/thermo/calorimetry.d.mts +207 -0
  420. package/dist/thermo/calorimetry.mjs +345 -0
  421. package/dist/thermo/cycles.d.mts +142 -0
  422. package/dist/thermo/cycles.mjs +256 -0
  423. package/dist/thermo/entropy.d.mts +87 -0
  424. package/dist/thermo/entropy.mjs +140 -0
  425. package/dist/thermo/expansion.d.mts +130 -0
  426. package/dist/thermo/expansion.mjs +178 -0
  427. package/dist/thermo/gas.d.mts +197 -0
  428. package/dist/thermo/gas.mjs +279 -0
  429. package/dist/thermo/heat-transfer.d.mts +164 -0
  430. package/dist/thermo/heat-transfer.mjs +217 -0
  431. package/dist/thermo/index.d.mts +9 -82
  432. package/dist/thermo/index.mjs +9 -132
  433. package/dist/thermo/processes.d.mts +95 -0
  434. package/dist/thermo/processes.mjs +154 -0
  435. package/dist/thermo/temperature.d.mts +174 -0
  436. package/dist/thermo/temperature.mjs +236 -0
  437. package/dist/view/Stage.mjs +4 -11
  438. package/dist/waves/damping.d.mts +224 -0
  439. package/dist/waves/damping.mjs +317 -0
  440. package/dist/waves/doppler.d.mts +72 -0
  441. package/dist/waves/doppler.mjs +125 -0
  442. package/dist/waves/index.d.mts +10 -0
  443. package/dist/waves/index.mjs +10 -0
  444. package/dist/waves/pendulum.d.mts +130 -0
  445. package/dist/waves/pendulum.mjs +211 -0
  446. package/dist/waves/pitch.d.mts +125 -0
  447. package/dist/waves/pitch.mjs +158 -0
  448. package/dist/waves/shm.d.mts +170 -0
  449. package/dist/waves/shm.mjs +279 -0
  450. package/dist/waves/springs.d.mts +103 -0
  451. package/dist/waves/springs.mjs +176 -0
  452. package/dist/waves/superposition.d.mts +124 -0
  453. package/dist/waves/superposition.mjs +196 -0
  454. package/dist/waves/wave.d.mts +154 -0
  455. package/dist/waves/wave.mjs +178 -0
  456. package/package.json +103 -23
  457. package/styles.css +125 -8
  458. package/dist/assets/kit/index.mjs +0 -4
@@ -0,0 +1,135 @@
1
+ //#region src/networking/cloud/releases.ts
2
+ const TOTAL_STEPS = 4;
3
+ const clampReplicas = (value) => Math.max(2, Math.min(6, Math.round(value)));
4
+ function deploymentAt(plan, step) {
5
+ const replicas = clampReplicas(plan.replicas);
6
+ if (plan.strategy === "recreate") {
7
+ const stopped = step >= 1;
8
+ const started = step >= 3;
9
+ return {
10
+ step,
11
+ totalSteps: TOTAL_STEPS,
12
+ oldReplicas: stopped ? 0 : replicas,
13
+ newReplicas: started ? replicas : 0,
14
+ newTrafficPercent: started ? 100 : 0,
15
+ availableReplicas: stopped && !started ? 0 : replicas
16
+ };
17
+ }
18
+ if (plan.strategy === "rolling") {
19
+ const newReplicas = Math.min(replicas, Math.ceil(step / TOTAL_STEPS * replicas));
20
+ return {
21
+ step,
22
+ totalSteps: TOTAL_STEPS,
23
+ oldReplicas: replicas - newReplicas,
24
+ newReplicas,
25
+ newTrafficPercent: Math.round(newReplicas / replicas * 100),
26
+ availableReplicas: replicas
27
+ };
28
+ }
29
+ if (plan.strategy === "canary") {
30
+ const traffic = [
31
+ 0,
32
+ 5,
33
+ 15,
34
+ 30,
35
+ 100
36
+ ][step] ?? 100;
37
+ const complete = step === TOTAL_STEPS;
38
+ return {
39
+ step,
40
+ totalSteps: TOTAL_STEPS,
41
+ oldReplicas: complete ? 0 : replicas,
42
+ newReplicas: complete ? replicas : step === 0 ? 0 : 1,
43
+ newTrafficPercent: traffic,
44
+ availableReplicas: replicas
45
+ };
46
+ }
47
+ const switched = step === TOTAL_STEPS;
48
+ return {
49
+ step,
50
+ totalSteps: TOTAL_STEPS,
51
+ oldReplicas: switched ? 0 : replicas,
52
+ newReplicas: step === 0 ? 0 : replicas,
53
+ newTrafficPercent: switched ? 100 : 0,
54
+ availableReplicas: replicas
55
+ };
56
+ }
57
+ function describe(snapshot) {
58
+ if (snapshot.status === "rolled-back") return snapshot.dataSafe ? "Traffic is back on the stable version; the candidate is isolated." : "Traffic returned, but the shared data contract is incompatible and still blocks a safe rollback.";
59
+ if (snapshot.step === 0) return "The stable version serves all traffic. Start the release when ready.";
60
+ if (!snapshot.dataSafe) return "The candidate changes shared data incompatibly. Routing back would not restore the old contract.";
61
+ if (!snapshot.safeToContinue) return `${snapshot.newTrafficPercent}% of requests reach a faulty candidate. Roll back before increasing exposure.`;
62
+ if (snapshot.plan.strategy === "recreate" && snapshot.availableReplicas === 0) return "The old fleet is stopped before the candidate becomes ready, so the service is unavailable.";
63
+ if (snapshot.status === "completed") return "The candidate serves all traffic without crossing the error budget.";
64
+ if (snapshot.plan.strategy === "blue-green" && snapshot.newTrafficPercent === 0) return "The complete green fleet is ready, but users still reach blue until the traffic switch.";
65
+ return `${snapshot.newTrafficPercent}% of requests reach the candidate while the stable version remains available.`;
66
+ }
67
+ function releaseSnapshot(plan, step = 0, status = "running") {
68
+ const normalizedPlan = {
69
+ ...plan,
70
+ replicas: clampReplicas(plan.replicas)
71
+ };
72
+ const dataSafe = normalizedPlan.dataCompatibility === "compatible";
73
+ if (status === "rolled-back") {
74
+ const rolledBack = {
75
+ plan: normalizedPlan,
76
+ step,
77
+ totalSteps: TOTAL_STEPS,
78
+ oldReplicas: normalizedPlan.replicas,
79
+ newReplicas: 0,
80
+ newTrafficPercent: 0,
81
+ availableReplicas: normalizedPlan.replicas,
82
+ observedErrorPercent: 0,
83
+ readinessSeconds: 0,
84
+ rollbackSeconds: dataSafe ? 8 : 300,
85
+ dataSafe,
86
+ status,
87
+ safeToContinue: dataSafe
88
+ };
89
+ return {
90
+ ...rolledBack,
91
+ message: describe(rolledBack)
92
+ };
93
+ }
94
+ const deployment = deploymentAt(normalizedPlan, Math.max(0, Math.min(TOTAL_STEPS, step)));
95
+ const candidateError = normalizedPlan.candidateHealth === "faulty" ? 12 : .4;
96
+ const observedErrorPercent = Number((deployment.newTrafficPercent / 100 * candidateError).toFixed(1));
97
+ const contractSafe = dataSafe || deployment.newTrafficPercent === 0;
98
+ const safeToContinue = observedErrorPercent <= 1 && contractSafe;
99
+ const resolvedStatus = deployment.step === TOTAL_STEPS ? "completed" : "running";
100
+ const snapshot = {
101
+ ...deployment,
102
+ plan: normalizedPlan,
103
+ observedErrorPercent,
104
+ readinessSeconds: normalizedPlan.candidateHealth === "healthy" ? 12 : 28,
105
+ rollbackSeconds: !dataSafe ? 300 : normalizedPlan.strategy === "blue-green" ? 4 : normalizedPlan.strategy === "canary" ? 8 : 35,
106
+ dataSafe: contractSafe,
107
+ status: resolvedStatus,
108
+ safeToContinue
109
+ };
110
+ return {
111
+ ...snapshot,
112
+ message: describe(snapshot)
113
+ };
114
+ }
115
+ function transitionRelease(current, command) {
116
+ if (command.type === "reset") return releaseSnapshot(current.plan);
117
+ if (command.type === "rollback") return releaseSnapshot(current.plan, current.step, "rolled-back");
118
+ if (current.status !== "running") return current;
119
+ return releaseSnapshot(current.plan, current.step + 1);
120
+ }
121
+ function createReleaseEngine(plan) {
122
+ let current = releaseSnapshot(plan);
123
+ return {
124
+ get state() {
125
+ return current;
126
+ },
127
+ dispatch(command) {
128
+ current = transitionRelease(current, command);
129
+ return current;
130
+ }
131
+ };
132
+ }
133
+
134
+ //#endregion
135
+ export { createReleaseEngine, releaseSnapshot, transitionRelease };
@@ -0,0 +1,25 @@
1
+ //#region src/networking/cloud/scaling.d.ts
2
+ type LoadRoutingPolicy = "round-robin" | "least-connections";
3
+ type BackendHealth = "healthy" | "unhealthy";
4
+ interface BackendResult {
5
+ readonly id: number;
6
+ readonly health: BackendHealth;
7
+ readonly baselineConnections: number;
8
+ readonly assignedRps: number;
9
+ readonly utilizationPercent: number;
10
+ }
11
+ interface ServiceScalingResult {
12
+ readonly policy: LoadRoutingPolicy;
13
+ readonly incomingRps: number;
14
+ readonly instanceCapacityRps: number;
15
+ readonly healthyInstances: number;
16
+ readonly totalCapacityRps: number;
17
+ readonly backends: readonly BackendResult[];
18
+ readonly queued: number;
19
+ readonly dropped: number;
20
+ readonly delayMs: number;
21
+ readonly diagnosis: string;
22
+ }
23
+ declare function simulateServiceScaling(instances: number, incomingRps: number, policy: LoadRoutingPolicy, failedBackend: number | null, instanceCapacityRps?: number): ServiceScalingResult;
24
+ //#endregion
25
+ export { BackendHealth, BackendResult, LoadRoutingPolicy, ServiceScalingResult, simulateServiceScaling };
@@ -0,0 +1,65 @@
1
+ import { queueAtTime } from "../queue.mjs";
2
+
3
+ //#region src/networking/cloud/scaling.ts
4
+ const BASELINE = [
5
+ 12,
6
+ 4,
7
+ 9,
8
+ 2
9
+ ];
10
+ const baselineFor = (index) => BASELINE[index] ?? 0;
11
+ function assignRoundRobin(count, incomingRps) {
12
+ const base = Math.floor(incomingRps / count);
13
+ const extra = incomingRps % count;
14
+ return Array.from({ length: count }, (_, index) => base + (index < extra ? 1 : 0));
15
+ }
16
+ function assignLeastConnections(active, incomingRps) {
17
+ const assigned = active.map(() => 0);
18
+ for (let request = 0; request < incomingRps; request += 1) {
19
+ let target = 0;
20
+ let lightest = Infinity;
21
+ active.forEach((connections, index) => {
22
+ const load = connections + assigned[index];
23
+ if (load < lightest) {
24
+ lightest = load;
25
+ target = index;
26
+ }
27
+ });
28
+ assigned[target] = assigned[target] + 1;
29
+ }
30
+ return assigned;
31
+ }
32
+ function simulateServiceScaling(instances, incomingRps, policy, failedBackend, instanceCapacityRps = 20) {
33
+ const count = Math.max(1, Math.min(4, Math.round(instances)));
34
+ const activeIndexes = Array.from({ length: count }, (_, index) => index).filter((index) => index !== failedBackend);
35
+ const healthyInstances = activeIndexes.length;
36
+ const baseline = activeIndexes.map(baselineFor);
37
+ const assigned = healthyInstances === 0 ? [] : policy === "round-robin" ? assignRoundRobin(healthyInstances, incomingRps) : assignLeastConnections(baseline, incomingRps);
38
+ const totalCapacityRps = healthyInstances * instanceCapacityRps;
39
+ const queue = queueAtTime(incomingRps, totalCapacityRps, 60, 2);
40
+ const backends = Array.from({ length: count }, (_, id) => {
41
+ const activeIndex = activeIndexes.indexOf(id);
42
+ const assignedRps = activeIndex < 0 ? 0 : assigned[activeIndex];
43
+ return {
44
+ id,
45
+ health: activeIndex < 0 ? "unhealthy" : "healthy",
46
+ baselineConnections: baselineFor(id),
47
+ assignedRps,
48
+ utilizationPercent: activeIndex < 0 ? 0 : Math.min(100, Math.round(assignedRps / instanceCapacityRps * 100))
49
+ };
50
+ });
51
+ const diagnosis = healthyInstances === 0 ? "No backend passes the health check, so the load balancer has no eligible target." : queue.dropped > 0 ? "Healthy capacity is exhausted and the finite waiting queue is full. Excess requests receive an overload response." : queue.queued > 0 ? "The service is reachable, but incoming work exceeds the combined capacity of healthy backends." : failedBackend !== null ? "The health check removes the failed backend; remaining instances absorb its traffic." : policy === "least-connections" ? "New work goes to the backend with the fewest active and newly assigned connections." : "New work rotates across every healthy backend in order.";
52
+ return {
53
+ policy,
54
+ incomingRps,
55
+ instanceCapacityRps,
56
+ healthyInstances,
57
+ totalCapacityRps,
58
+ backends,
59
+ ...queue,
60
+ diagnosis
61
+ };
62
+ }
63
+
64
+ //#endregion
65
+ export { simulateServiceScaling };
@@ -0,0 +1,39 @@
1
+ //#region src/networking/cloud/secrets.d.ts
2
+ type SecretStrategy = "embedded-static" | "single-current" | "dual-overlap";
3
+ type ConsumerRefresh = "restart" | "reload";
4
+ type RotationTrigger = "scheduled" | "leaked";
5
+ type RotationPhase = "baseline" | "issue" | "publish" | "refresh" | "revoke";
6
+ interface SecretRotationPlan {
7
+ strategy: SecretStrategy;
8
+ refresh: ConsumerRefresh;
9
+ trigger: RotationTrigger;
10
+ consumers: number;
11
+ }
12
+ interface SecretRotationSnapshot {
13
+ plan: SecretRotationPlan;
14
+ step: number;
15
+ phase: RotationPhase;
16
+ oldValid: boolean;
17
+ newValid: boolean;
18
+ storeVersion: "old" | "new";
19
+ oldConsumers: number;
20
+ newConsumers: number;
21
+ failedConsumers: number;
22
+ outageSeconds: number;
23
+ leakContained: boolean;
24
+ rotationComplete: boolean;
25
+ message: string;
26
+ }
27
+ type SecretRotationCommand = {
28
+ type: "advance";
29
+ } | {
30
+ type: "reset";
31
+ };
32
+ declare function secretRotationSnapshot(plan: SecretRotationPlan, step?: number): SecretRotationSnapshot;
33
+ declare function transitionSecretRotation(current: SecretRotationSnapshot, command: SecretRotationCommand): SecretRotationSnapshot;
34
+ declare function createSecretRotationEngine(plan: SecretRotationPlan): {
35
+ readonly state: SecretRotationSnapshot;
36
+ dispatch(command: SecretRotationCommand): SecretRotationSnapshot;
37
+ };
38
+ //#endregion
39
+ export { ConsumerRefresh, RotationPhase, RotationTrigger, SecretRotationCommand, SecretRotationPlan, SecretRotationSnapshot, SecretStrategy, createSecretRotationEngine, secretRotationSnapshot, transitionSecretRotation };
@@ -0,0 +1,68 @@
1
+ //#region src/networking/cloud/secrets.ts
2
+ const PHASES = [
3
+ "baseline",
4
+ "issue",
5
+ "publish",
6
+ "refresh",
7
+ "revoke"
8
+ ];
9
+ const clampConsumers = (value) => Math.max(2, Math.min(6, Math.round(value)));
10
+ function secretRotationSnapshot(plan, step = 0) {
11
+ const normalized = {
12
+ ...plan,
13
+ consumers: clampConsumers(plan.consumers)
14
+ };
15
+ const currentStep = Math.max(0, Math.min(PHASES.length - 1, step));
16
+ const phase = PHASES[currentStep];
17
+ const staticSecret = normalized.strategy === "embedded-static";
18
+ const dual = normalized.strategy === "dual-overlap";
19
+ const issued = currentStep >= 1 && !staticSecret;
20
+ const published = currentStep >= 2 && !staticSecret;
21
+ const refreshed = currentStep >= 3 && !staticSecret;
22
+ const revoked = currentStep >= 4 && !staticSecret;
23
+ const oldValid = staticSecret || !issued || dual && !revoked;
24
+ const newValid = issued;
25
+ const oldConsumers = refreshed ? 0 : normalized.consumers;
26
+ const newConsumers = refreshed ? normalized.consumers : 0;
27
+ const oldClientsRejected = oldConsumers > 0 && !oldValid;
28
+ const failedConsumers = oldClientsRejected ? oldConsumers : 0;
29
+ const outageSeconds = staticSecret ? 0 : oldClientsRejected ? normalized.refresh === "restart" ? 45 : 8 : normalized.refresh === "restart" && phase === "refresh" ? 12 : 0;
30
+ const leakContained = normalized.trigger !== "leaked" || revoked;
31
+ const rotationComplete = revoked && newConsumers === normalized.consumers;
32
+ const message = staticSecret ? normalized.trigger === "leaked" ? "The leaked value is copied into deployments. There is no coordinated version to replace and revoke." : "The embedded value still works, but every copy extends the credential lifetime and makes emergency replacement manual." : oldClientsRejected ? "The service stopped accepting the old value before consumers loaded the new one, so valid workloads are denied." : phase === "issue" && dual ? "The service accepts old and new values during a bounded overlap window." : phase === "publish" ? "The manager now publishes the new version; consumers must refresh before the old value is revoked." : phase === "refresh" ? normalized.refresh === "restart" ? "Consumers loaded the new version through a restart, creating a small availability cost." : "Consumers reloaded the new version without replacing their processes." : rotationComplete ? "Every consumer uses the new version and the old value is revoked." : "The old version is current. Begin rotation by issuing a distinct new value.";
33
+ return {
34
+ plan: normalized,
35
+ step: currentStep,
36
+ phase,
37
+ oldValid,
38
+ newValid,
39
+ storeVersion: published ? "new" : "old",
40
+ oldConsumers,
41
+ newConsumers,
42
+ failedConsumers,
43
+ outageSeconds,
44
+ leakContained,
45
+ rotationComplete,
46
+ message
47
+ };
48
+ }
49
+ function transitionSecretRotation(current, command) {
50
+ if (command.type === "reset") return secretRotationSnapshot(current.plan);
51
+ if (current.plan.strategy === "embedded-static") return current;
52
+ return secretRotationSnapshot(current.plan, current.step + 1);
53
+ }
54
+ function createSecretRotationEngine(plan) {
55
+ let current = secretRotationSnapshot(plan);
56
+ return {
57
+ get state() {
58
+ return current;
59
+ },
60
+ dispatch(command) {
61
+ current = transitionSecretRotation(current, command);
62
+ return current;
63
+ }
64
+ };
65
+ }
66
+
67
+ //#endregion
68
+ export { createSecretRotationEngine, secretRotationSnapshot, transitionSecretRotation };
@@ -0,0 +1,29 @@
1
+ //#region src/networking/cloud/server-deployment.d.ts
2
+ type DeploymentScope = "lan" | "internet";
3
+ type ServerFrontEnd = "direct" | "nginx";
4
+ type DeploymentFault = "none" | "subnet" | "dns" | "forward" | "firewall" | "listener";
5
+ type DeploymentStage = "client" | "dns" | "router" | "firewall" | "nginx" | "app";
6
+ declare const DEPLOYMENT_STAGES: readonly DeploymentStage[];
7
+ interface ServerDeploymentResult {
8
+ readonly scope: DeploymentScope;
9
+ readonly frontEnd: ServerFrontEnd;
10
+ readonly stages: readonly DeploymentStage[];
11
+ readonly stoppedAt: DeploymentStage | null;
12
+ readonly reached: boolean;
13
+ readonly clientAddress: string;
14
+ readonly serverAddress: string;
15
+ readonly prefix: number;
16
+ readonly publicAddress: string;
17
+ readonly hostname: string;
18
+ readonly publicPort: number;
19
+ readonly listenerPort: number;
20
+ readonly appPort: number;
21
+ readonly queued: number;
22
+ readonly dropped: number;
23
+ readonly delayMs: number;
24
+ readonly diagnosis: string;
25
+ }
26
+ declare function simulateServerDeployment(scope: DeploymentScope, frontEnd: ServerFrontEnd, fault: DeploymentFault, requestsPerSecond: number, appCapacityRps?: number): ServerDeploymentResult;
27
+ declare function deploymentStageState(stage: DeploymentStage, current: number, result: ServerDeploymentResult): "idle" | "active" | "success" | "error";
28
+ //#endregion
29
+ export { DEPLOYMENT_STAGES, DeploymentFault, DeploymentScope, DeploymentStage, ServerDeploymentResult, ServerFrontEnd, deploymentStageState, simulateServerDeployment };
@@ -0,0 +1,72 @@
1
+ import { queueAtTime } from "../queue.mjs";
2
+ import { sameNetwork } from "../subnet.mjs";
3
+
4
+ //#region src/networking/cloud/server-deployment.ts
5
+ const DEPLOYMENT_STAGES = [
6
+ "client",
7
+ "dns",
8
+ "router",
9
+ "firewall",
10
+ "nginx",
11
+ "app"
12
+ ];
13
+ const DIAGNOSIS = {
14
+ subnet: "The client and server disagree about the LAN boundary. Fix the address or prefix.",
15
+ dns: "The name does not resolve to this router’s public address.",
16
+ forward: "The router has no public-port to private-listener mapping.",
17
+ firewall: "The host firewall rejects the incoming service port.",
18
+ listener: "The packet reaches the host, but no process is listening on that port."
19
+ };
20
+ function simulateServerDeployment(scope, frontEnd, fault, requestsPerSecond, appCapacityRps = 30) {
21
+ const prefix = fault === "subnet" ? 30 : 24;
22
+ const clientAddress = "192.168.1.24";
23
+ const serverAddress = "192.168.1.20";
24
+ const lanReachable = sameNetwork(clientAddress, serverAddress, prefix) === true;
25
+ const publicPort = frontEnd === "nginx" ? 443 : 3e3;
26
+ const listenerPort = publicPort;
27
+ const appPort = 3e3;
28
+ const effectiveFault = scope === "lan" && fault !== "subnet" && fault !== "listener" ? "none" : fault;
29
+ const stages = scope === "lan" ? [
30
+ "client",
31
+ ...frontEnd === "nginx" ? ["nginx"] : [],
32
+ "app"
33
+ ] : frontEnd === "nginx" ? DEPLOYMENT_STAGES : [
34
+ "client",
35
+ "dns",
36
+ "router",
37
+ "firewall",
38
+ "app"
39
+ ];
40
+ const stoppedAt = effectiveFault === "subnet" || !lanReachable ? "client" : effectiveFault === "dns" ? "dns" : effectiveFault === "forward" ? "router" : effectiveFault === "firewall" ? "firewall" : effectiveFault === "listener" ? frontEnd === "nginx" ? "nginx" : "app" : null;
41
+ const reached = stoppedAt === null;
42
+ const load = reached ? queueAtTime(requestsPerSecond, appCapacityRps, 40, 2) : queueAtTime(0, appCapacityRps, 40, 2);
43
+ return {
44
+ scope,
45
+ frontEnd,
46
+ stages,
47
+ stoppedAt,
48
+ reached,
49
+ clientAddress,
50
+ serverAddress,
51
+ prefix,
52
+ publicAddress: "203.0.113.18",
53
+ hostname: "lab.example",
54
+ publicPort,
55
+ listenerPort,
56
+ appPort,
57
+ ...load,
58
+ diagnosis: stoppedAt ? DIAGNOSIS[effectiveFault] : load.dropped > 0 ? "The route works, but demand exceeds app capacity. Requests wait, then the finite queue rejects excess work." : load.queued > 0 ? "The service is reachable. Demand now exceeds app capacity, so response delay is growing." : frontEnd === "nginx" ? "Nginx accepts the public service port and forwards each request to the private app port." : "The app is exposed directly on its own listening port."
59
+ };
60
+ }
61
+ function deploymentStageState(stage, current, result) {
62
+ const index = result.stages.indexOf(stage);
63
+ if (index < 0) return "idle";
64
+ const stop = result.stoppedAt ? result.stages.indexOf(result.stoppedAt) : Infinity;
65
+ if (index === stop && current >= index) return "error";
66
+ if (index === current && index < stop) return "active";
67
+ if (index < current && index < stop) return "success";
68
+ return "idle";
69
+ }
70
+
71
+ //#endregion
72
+ export { DEPLOYMENT_STAGES, deploymentStageState, simulateServerDeployment };
@@ -0,0 +1,16 @@
1
+ //#region src/networking/cloud/storage.d.ts
2
+ type CloudWorkload = "temporary-cache" | "boot-volume" | "user-uploads" | "shared-files" | "transactions";
3
+ type CloudStorage = "instance-disk" | "block-volume" | "object-store" | "shared-file" | "database";
4
+ interface StorageResult {
5
+ workload: CloudWorkload;
6
+ storage: CloudStorage;
7
+ fit: "good" | "tradeoff" | "wrong";
8
+ survivesReplacement: boolean;
9
+ sharedByInstances: boolean;
10
+ supportsTransactions: boolean;
11
+ access: string;
12
+ diagnosis: string;
13
+ }
14
+ declare function evaluateCloudStorage(workload: CloudWorkload, storage: CloudStorage): StorageResult;
15
+ //#endregion
16
+ export { CloudStorage, CloudWorkload, StorageResult, evaluateCloudStorage };
@@ -0,0 +1,58 @@
1
+ //#region src/networking/cloud/storage.ts
2
+ const CAPABILITIES = {
3
+ "instance-disk": {
4
+ persistent: false,
5
+ shared: false,
6
+ transactions: false,
7
+ access: "local filesystem"
8
+ },
9
+ "block-volume": {
10
+ persistent: true,
11
+ shared: false,
12
+ transactions: false,
13
+ access: "mounted block device"
14
+ },
15
+ "object-store": {
16
+ persistent: true,
17
+ shared: true,
18
+ transactions: false,
19
+ access: "object key API"
20
+ },
21
+ "shared-file": {
22
+ persistent: true,
23
+ shared: true,
24
+ transactions: false,
25
+ access: "shared filesystem"
26
+ },
27
+ database: {
28
+ persistent: true,
29
+ shared: true,
30
+ transactions: true,
31
+ access: "query / transaction API"
32
+ }
33
+ };
34
+ const IDEAL = {
35
+ "temporary-cache": "instance-disk",
36
+ "boot-volume": "block-volume",
37
+ "user-uploads": "object-store",
38
+ "shared-files": "shared-file",
39
+ transactions: "database"
40
+ };
41
+ function evaluateCloudStorage(workload, storage) {
42
+ const c = CAPABILITIES[storage];
43
+ const fit = storage === IDEAL[workload] ? "good" : workload === "user-uploads" && storage === "shared-file" || workload === "shared-files" && storage === "object-store" || workload === "boot-volume" && storage === "instance-disk" ? "tradeoff" : "wrong";
44
+ const diagnosis = fit === "good" ? `${storage} matches the access and lifecycle required by ${workload}.` : fit === "tradeoff" ? `${storage} can hold the data, but its access or lifecycle semantics create an operational tradeoff.` : `${storage} does not provide the required durability, sharing, or data semantics for ${workload}.`;
45
+ return {
46
+ workload,
47
+ storage,
48
+ fit,
49
+ survivesReplacement: c.persistent,
50
+ sharedByInstances: c.shared,
51
+ supportsTransactions: c.transactions,
52
+ access: c.access,
53
+ diagnosis
54
+ };
55
+ }
56
+
57
+ //#endregion
58
+ export { evaluateCloudStorage };
@@ -0,0 +1,18 @@
1
+ //#region src/networking/cloud/vpc.d.ts
2
+ type VpcScenario = "internet-to-web" | "internet-to-app" | "app-to-internet" | "db-to-internet" | "web-to-db";
3
+ type VpcDesign = "segmented" | "all-public" | "no-egress" | "blocked-data";
4
+ type VpcZone = "internet" | "public" | "private" | "isolated";
5
+ interface VpcRouteResult {
6
+ readonly scenario: VpcScenario;
7
+ readonly design: VpcDesign;
8
+ readonly source: VpcZone;
9
+ readonly destination: VpcZone;
10
+ readonly route: readonly string[];
11
+ readonly allowed: boolean;
12
+ readonly publicExposure: readonly string[];
13
+ readonly decision: string;
14
+ readonly rule: string;
15
+ }
16
+ declare function planVpcRoute(scenario: VpcScenario, design: VpcDesign): VpcRouteResult;
17
+ //#endregion
18
+ export { VpcDesign, VpcRouteResult, VpcScenario, VpcZone, planVpcRoute };
@@ -0,0 +1,100 @@
1
+ //#region src/networking/cloud/vpc.ts
2
+ const ENDPOINTS = {
3
+ "internet-to-web": {
4
+ source: "internet",
5
+ destination: "public"
6
+ },
7
+ "internet-to-app": {
8
+ source: "internet",
9
+ destination: "private"
10
+ },
11
+ "app-to-internet": {
12
+ source: "private",
13
+ destination: "internet"
14
+ },
15
+ "db-to-internet": {
16
+ source: "isolated",
17
+ destination: "internet"
18
+ },
19
+ "web-to-db": {
20
+ source: "public",
21
+ destination: "isolated"
22
+ }
23
+ };
24
+ function planVpcRoute(scenario, design) {
25
+ const { source, destination } = ENDPOINTS[scenario];
26
+ const allPublic = design === "all-public";
27
+ let allowed = false;
28
+ let route = [source];
29
+ let rule = "no matching route";
30
+ let decision = "No route carries this traffic to its destination.";
31
+ if (scenario === "internet-to-web") {
32
+ allowed = true;
33
+ route = [
34
+ "internet",
35
+ "internet gateway",
36
+ "public"
37
+ ];
38
+ rule = "0.0.0.0/0 ↔ internet gateway";
39
+ decision = "The public subnet has an internet-gateway route, a public endpoint, and an ingress rule for the service.";
40
+ } else if (scenario === "internet-to-app") {
41
+ allowed = allPublic;
42
+ route = allPublic ? [
43
+ "internet",
44
+ "internet gateway",
45
+ "private"
46
+ ] : ["internet", "internet gateway"];
47
+ rule = allPublic ? "0.0.0.0/0 ↔ internet gateway" : "private subnet has no inbound internet target";
48
+ decision = allPublic ? "The app tier was made public, so internet clients can address it directly." : "The private app tier has no direct public endpoint; clients must enter through the public service tier.";
49
+ } else if (scenario === "app-to-internet") {
50
+ allowed = design !== "no-egress";
51
+ route = allPublic ? [
52
+ "private",
53
+ "internet gateway",
54
+ "internet"
55
+ ] : allowed ? [
56
+ "private",
57
+ "NAT gateway",
58
+ "internet gateway",
59
+ "internet"
60
+ ] : ["private"];
61
+ rule = allPublic ? "0.0.0.0/0 → internet gateway" : allowed ? "0.0.0.0/0 → NAT gateway" : "no default route";
62
+ decision = allPublic ? "The app tier reaches the internet directly and is no longer private." : allowed ? "The NAT gateway provides outbound translation without making the app an inbound public target." : "Without a default route, the app cannot fetch updates or reach external APIs.";
63
+ } else if (scenario === "db-to-internet") {
64
+ allowed = allPublic;
65
+ route = allPublic ? [
66
+ "isolated",
67
+ "internet gateway",
68
+ "internet"
69
+ ] : ["isolated"];
70
+ rule = allPublic ? "0.0.0.0/0 → internet gateway" : "local VPC route only";
71
+ decision = allPublic ? "The database subnet has been given direct internet routing, increasing exposure." : "The isolated data tier has no default internet route.";
72
+ } else {
73
+ allowed = design !== "blocked-data";
74
+ route = [
75
+ "public",
76
+ "local VPC route",
77
+ "isolated"
78
+ ];
79
+ rule = allowed ? "10.20.0.0/16 → local; app port allowed" : "local route exists; firewall denies app-to-data port";
80
+ decision = allowed ? "Local VPC routing connects the subnets, while the data firewall admits only the required application traffic." : "A route exists, but the data-tier firewall still denies the connection.";
81
+ }
82
+ return {
83
+ scenario,
84
+ design,
85
+ source,
86
+ destination,
87
+ route,
88
+ allowed,
89
+ publicExposure: allPublic ? [
90
+ "web",
91
+ "app",
92
+ "database"
93
+ ] : ["web"],
94
+ decision,
95
+ rule
96
+ };
97
+ }
98
+
99
+ //#endregion
100
+ export { planVpcRoute };
@@ -0,0 +1,34 @@
1
+ //#region src/networking/delivery.d.ts
2
+ type DeliveryMode = "terrestrial" | "multicast" | "unicast";
3
+ interface BroadcastDeliveryResult {
4
+ readonly mode: DeliveryMode;
5
+ readonly viewers: number;
6
+ readonly bitrateMbps: number;
7
+ readonly sourceStreams: number;
8
+ readonly segmentCopies: number;
9
+ readonly segmentMbps: number;
10
+ readonly returnPath: boolean;
11
+ readonly personalized: boolean;
12
+ }
13
+ declare function compareDelivery(mode: DeliveryMode, viewers: number, bitrateMbps: number): BroadcastDeliveryResult;
14
+ type DeviceState = "online" | "offline";
15
+ interface GroupDeliveryResult {
16
+ readonly delivered: number;
17
+ readonly queued: number;
18
+ readonly copies: number;
19
+ }
20
+ declare function deliverGroupMessage(recipients: number, devicesEach: number, offlineDevices: number): GroupDeliveryResult;
21
+ interface LiveStreamResult {
22
+ readonly segmentSeconds: number;
23
+ readonly bufferSeconds: number;
24
+ readonly outageSeconds: number;
25
+ readonly startupSeconds: number;
26
+ readonly liveLatencySeconds: number;
27
+ readonly stallSeconds: number;
28
+ readonly bufferedThroughDrop: boolean;
29
+ }
30
+ declare function simulateLiveStream(segmentSeconds: number, bufferSeconds: number, outageSeconds: number): LiveStreamResult;
31
+ declare const STREAM_STAGES: readonly ["camera", "encoder", "origin", "cdn", "buffer", "viewer"];
32
+ type StreamStage = (typeof STREAM_STAGES)[number];
33
+ //#endregion
34
+ export { BroadcastDeliveryResult, DeliveryMode, DeviceState, GroupDeliveryResult, LiveStreamResult, STREAM_STAGES, StreamStage, compareDelivery, deliverGroupMessage, simulateLiveStream };