@wildshard/engine 0.0.0 → 0.1.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3051) hide show
  1. package/CHANGELOG.md +128 -0
  2. package/budgets/calibration/m5-2026-10-01T08-07-18-573Z.json +3985 -0
  3. package/budgets/calibration/m5-2026-10-01T22-02-53-510Z.json +4473 -0
  4. package/budgets/calibration-reports/README.md +25 -0
  5. package/budgets/calibration-reports/_template.desktop.json +1994 -0
  6. package/budgets/calibration-reports/_template.phone.json +2069 -0
  7. package/budgets/calibration-reports/assessment.json +571 -0
  8. package/budgets/calibration-reports/driftwood-isle.phone.json +72 -0
  9. package/budgets/calibration-reports/far-reach.desktop.json +73158 -0
  10. package/budgets/calibration-reports/far-reach.phone.json +73086 -0
  11. package/budgets/calibration-reports/nalati-grasslands-x22.desktop.json +19525 -0
  12. package/budgets/calibration-reports/nalati-grasslands.phone.json +72 -0
  13. package/budgets/calibration-reports/nine-dragon-stack-g224.desktop.json +146 -0
  14. package/budgets/calibration-reports/nine-dragon-stack.phone.json +89 -0
  15. package/budgets/calibration-reports/pine-hollow.desktop.json +54949 -0
  16. package/budgets/calibration-reports/pine-hollow.phone.json +72 -0
  17. package/budgets/calibration-reports/sunscar-dunes.desktop.json +7788 -0
  18. package/budgets/calibration-reports/sunscar-dunes.phone.json +9378 -0
  19. package/budgets/calibration.json +4473 -0
  20. package/budgets/ceiling-re-records.json +71 -0
  21. package/budgets/ceiling-sources.json +5985 -0
  22. package/budgets/desktop-reference.json +7 -0
  23. package/budgets/g224-ceiling-re-record.json +15 -0
  24. package/budgets/grid-strip-room.json +9 -0
  25. package/budgets/nalati-ceiling-sources.json +44 -0
  26. package/budgets/shard-size-baseline.json +552 -0
  27. package/budgets/x22-ceiling-re-record.json +15 -0
  28. package/budgets/x7-ceiling-sources.json +41 -0
  29. package/index.html +622 -0
  30. package/lint/api-undocumented.json +7 -0
  31. package/lint/authored-html.d.mts +4 -0
  32. package/lint/authored-html.mjs +313 -0
  33. package/lint/base64-debt.json +18 -0
  34. package/lint/class-moves.json +4 -0
  35. package/lint/client-plan-boundary.d.mts +2 -0
  36. package/lint/client-plan-boundary.mjs +102 -0
  37. package/lint/debug-flags.d.mts +5 -0
  38. package/lint/debug-flags.mjs +190 -0
  39. package/lint/declaration-config.d.mts +2 -0
  40. package/lint/declaration-config.mjs +19 -0
  41. package/lint/edge-exemptions.json +6 -0
  42. package/lint/engine-internal.json +26 -0
  43. package/lint/engine-side-edges.json +5 -0
  44. package/lint/engine-sides.d.mts +30 -0
  45. package/lint/engine-sides.json +1794 -0
  46. package/lint/engine-sides.mjs +269 -0
  47. package/lint/engine-words.json +7 -0
  48. package/lint/exec-max-buffer.mjs +88 -0
  49. package/lint/generated-import-debt.json +117 -0
  50. package/lint/generated-source-debt.json +1029 -0
  51. package/lint/host-callback-syntax.d.mts +4 -0
  52. package/lint/host-callback-syntax.mjs +62 -0
  53. package/lint/host-callbacks.d.mts +6 -0
  54. package/lint/host-callbacks.mjs +123 -0
  55. package/lint/host-files.d.mts +1 -0
  56. package/lint/host-files.mjs +7 -0
  57. package/lint/host-reviews.json +14 -0
  58. package/lint/layer-edges.json +15 -0
  59. package/lint/layer-exports.d.mts +2 -0
  60. package/lint/layer-exports.mjs +23 -0
  61. package/lint/legacy-line-basis.json +995 -0
  62. package/lint/listed-view-code.json +13 -0
  63. package/lint/manifest-closure-budget.json +6 -0
  64. package/lint/nine-tiling-baseline.json +35 -0
  65. package/lint/no-base64.d.mts +19 -0
  66. package/lint/no-base64.mjs +112 -0
  67. package/lint/no-binary-json.json +174 -0
  68. package/lint/no-generated-import.d.mts +22 -0
  69. package/lint/no-generated-import.mjs +114 -0
  70. package/lint/page-events.json +895 -0
  71. package/lint/platform-pending-users.json +2520 -0
  72. package/lint/platform-pending-users.md +18 -0
  73. package/lint/ratchet-files.d.mts +2 -0
  74. package/lint/ratchet-files.mjs +45 -0
  75. package/lint/ratchet.json +230 -0
  76. package/lint/ratchet.mjs +212 -0
  77. package/lint/recorded-debt.mjs +24 -0
  78. package/lint/row-functions.json +173 -0
  79. package/lint/runtime-files.d.mts +12 -0
  80. package/lint/runtime-files.json +16 -0
  81. package/lint/runtime-files.mjs +69 -0
  82. package/lint/runtime-performance.d.mts +6 -0
  83. package/lint/runtime-performance.json +14 -0
  84. package/lint/runtime-performance.mjs +184 -0
  85. package/lint/schema-types.d.mts +9 -0
  86. package/lint/schema-types.mjs +114 -0
  87. package/lint/shard-coupling.json +333 -0
  88. package/lint/shard-imports.d.mts +5 -0
  89. package/lint/shard-imports.mjs +43 -0
  90. package/lint/shard-layout.json +64 -0
  91. package/lint/shard-platform.json +24 -0
  92. package/lint/shard-words.pin.json +421 -0
  93. package/lint/shardfile-boundaries.d.mts +10 -0
  94. package/lint/shardfile-boundaries.mjs +122 -0
  95. package/lint/sim-closure.d.mts +3 -0
  96. package/lint/sim-closure.json +3 -0
  97. package/lint/sim-closure.mjs +112 -0
  98. package/lint/sim-players.json +17 -0
  99. package/lint/sim-schema-leaves.json +1 -0
  100. package/lint/source-stamps.mjs +12 -0
  101. package/lint/syntax-values.mjs +299 -0
  102. package/lint/tile-bake-debt.json +556 -0
  103. package/lint/url-params.json +48 -0
  104. package/lint/weapon-subclasses.json +4 -0
  105. package/lint/wildshard-plugin.d.ts +13 -0
  106. package/lint/wildshard-plugin.js +1196 -0
  107. package/package.json +1304 -4
  108. package/scripts/agent-parity.mjs +1524 -0
  109. package/scripts/agent-sync.mjs +518 -0
  110. package/scripts/agent-time.py +475 -0
  111. package/scripts/apfs-clone.mjs +67 -0
  112. package/scripts/api-origin.d.mts +3 -0
  113. package/scripts/api-origin.mjs +38 -0
  114. package/scripts/app-build/appCook.ts +19 -0
  115. package/scripts/app-build/assetHashes.ts +57 -0
  116. package/scripts/app-build/assetLimits.d.mts +15 -0
  117. package/scripts/app-build/assetLimits.mjs +61 -0
  118. package/scripts/app-build/assetTables.d.mts +19 -0
  119. package/scripts/app-build/assetTables.mjs +68 -0
  120. package/scripts/app-build/audioPacks.ts +41 -0
  121. package/scripts/app-build/bakedTextures.d.mts +2 -0
  122. package/scripts/app-build/bakedTextures.mjs +59 -0
  123. package/scripts/app-build/basis.ts +25 -0
  124. package/scripts/app-build/bootExtras.ts +127 -0
  125. package/scripts/app-build/bootModules.ts +271 -0
  126. package/scripts/app-build/bootProductTiers.ts +48 -0
  127. package/scripts/app-build/bootProducts.ts +67 -0
  128. package/scripts/app-build/buildIdentity.d.mts +16 -0
  129. package/scripts/app-build/buildIdentity.mjs +89 -0
  130. package/scripts/app-build/catalogue.ts +216 -0
  131. package/scripts/app-build/chunkReport.d.mts +3 -0
  132. package/scripts/app-build/chunkReport.mjs +29 -0
  133. package/scripts/app-build/contentBase.d.mts +2 -0
  134. package/scripts/app-build/contentBase.mjs +34 -0
  135. package/scripts/app-build/controlChunks.ts +106 -0
  136. package/scripts/app-build/crossroadsRig.ts +17 -0
  137. package/scripts/app-build/doctorOutput.mjs +19 -0
  138. package/scripts/app-build/finalChunkNames.d.mts +3 -0
  139. package/scripts/app-build/finalChunkNames.mjs +94 -0
  140. package/scripts/app-build/gen.ts +100 -0
  141. package/scripts/app-build/gridSeams.d.mts +16 -0
  142. package/scripts/app-build/gridSeams.mjs +95 -0
  143. package/scripts/app-build/homeIcons.d.mts +20 -0
  144. package/scripts/app-build/homeIcons.mjs +64 -0
  145. package/scripts/app-build/importMap.d.mts +7 -0
  146. package/scripts/app-build/importMap.mjs +102 -0
  147. package/scripts/app-build/noTopLevelAwait.d.mts +4 -0
  148. package/scripts/app-build/noTopLevelAwait.mjs +36 -0
  149. package/scripts/app-build/outputProducts.d.mts +10 -0
  150. package/scripts/app-build/outputProducts.mjs +114 -0
  151. package/scripts/app-build/previousDeploy.d.mts +24 -0
  152. package/scripts/app-build/previousDeploy.mjs +245 -0
  153. package/scripts/app-build/serviceWorker.ts +145 -0
  154. package/scripts/app-build/splitOutput.d.mts +6 -0
  155. package/scripts/app-build/splitOutput.mjs +98 -0
  156. package/scripts/app-build/standaloneOutput.d.mts +4 -0
  157. package/scripts/app-build/standaloneOutput.mjs +31 -0
  158. package/scripts/app-build/validationReceipts.d.mts +2 -0
  159. package/scripts/app-build/validationReceipts.mjs +25 -0
  160. package/scripts/app-build/versionFiles.ts +20 -0
  161. package/scripts/app-build/worldMapAtlas.ts +62 -0
  162. package/scripts/app-build/writtenBundle.ts +51 -0
  163. package/scripts/app-build-pipeline-proof.mjs +67 -0
  164. package/scripts/app-build-pipeline.mjs +274 -0
  165. package/scripts/assert-store-layout.mjs +17 -0
  166. package/scripts/author-bundle-cache.d.mts +1 -0
  167. package/scripts/author-bundle-cache.mjs +137 -0
  168. package/scripts/author-bundle-usage.d.mts +3 -0
  169. package/scripts/author-bundle-usage.mjs +20 -0
  170. package/scripts/authored-manifest.d.mts +7 -0
  171. package/scripts/authored-manifest.mjs +217 -0
  172. package/scripts/authoring-inputs.d.mts +8 -0
  173. package/scripts/authoring-inputs.mjs +104 -0
  174. package/scripts/bake-grid-seams.mjs +110 -0
  175. package/scripts/bake-input-hashes.d.mts +6 -0
  176. package/scripts/bake-input-hashes.mjs +59 -0
  177. package/scripts/bake-loader.mjs +105 -0
  178. package/scripts/bake-output.d.mts +29 -0
  179. package/scripts/bake-output.mjs +84 -0
  180. package/scripts/bench-load.mjs +391 -0
  181. package/scripts/boot-dist-plan.mjs +47 -0
  182. package/scripts/boot-dist.py +251 -0
  183. package/scripts/boot-pack-parts.d.mts +2 -0
  184. package/scripts/boot-pack-parts.mjs +51 -0
  185. package/scripts/boot-publication-proof.d.mts +2 -0
  186. package/scripts/boot-publication-proof.mjs +64 -0
  187. package/scripts/boot-publication.d.mts +19 -0
  188. package/scripts/boot-publication.generated.json +3684 -0
  189. package/scripts/boot-publication.mjs +100 -0
  190. package/scripts/boot-temp-warn.sh +70 -0
  191. package/scripts/boot-timing-proof.mjs +264 -0
  192. package/scripts/browser-lane.sh +288 -0
  193. package/scripts/browser-slot-lock.py +49 -0
  194. package/scripts/budget-ceilings.mjs +88 -0
  195. package/scripts/budget-ratchet.d.mts +1 -0
  196. package/scripts/budget-ratchet.mjs +8 -0
  197. package/scripts/build-app.mjs +49 -0
  198. package/scripts/build-cache-report.d.mts +20 -0
  199. package/scripts/build-cache-report.mjs +104 -0
  200. package/scripts/build-mirror.d.mts +24 -0
  201. package/scripts/build-mirror.mjs +387 -0
  202. package/scripts/build-server.mjs +47 -0
  203. package/scripts/build-without-browser.mjs +14 -0
  204. package/scripts/built-product.d.mts +22 -0
  205. package/scripts/built-product.mjs +187 -0
  206. package/scripts/calibrate.mjs +43 -0
  207. package/scripts/capture-main-menu-hero.mjs +457 -0
  208. package/scripts/catalogue-all-heads.ts +35 -0
  209. package/scripts/changelog.d.mts +18 -0
  210. package/scripts/changelog.mjs +129 -0
  211. package/scripts/chaos-proxy-core.mjs +978 -0
  212. package/scripts/chaos-proxy-proof.mjs +1130 -0
  213. package/scripts/chaos-proxy.mjs +68 -0
  214. package/scripts/chaos-router.mjs +107 -0
  215. package/scripts/chaos-rules.mjs +197 -0
  216. package/scripts/check-chunks.d.mts +8 -0
  217. package/scripts/check-chunks.mjs +143 -0
  218. package/scripts/check-closed-components.d.mts +7 -0
  219. package/scripts/check-closed-components.mjs +87 -0
  220. package/scripts/check-css.mjs +235 -0
  221. package/scripts/check-custom-sections-zero.d.mts +2 -0
  222. package/scripts/check-custom-sections-zero.mjs +43 -0
  223. package/scripts/check-devserver.d.mts +2 -0
  224. package/scripts/check-devserver.mjs +29 -0
  225. package/scripts/check-engine-sides.mjs +85 -0
  226. package/scripts/check-graph.d.mts +9 -0
  227. package/scripts/check-graph.mjs +217 -0
  228. package/scripts/check-listeners.mjs +122 -0
  229. package/scripts/check-model-sources.mjs +106 -0
  230. package/scripts/check-models.d.mts +22 -0
  231. package/scripts/check-models.mjs +367 -0
  232. package/scripts/check-page-events.mjs +386 -0
  233. package/scripts/check-paths.allow.json +1282 -0
  234. package/scripts/check-paths.mjs +97 -0
  235. package/scripts/check-platform-ratchets.d.mts +7 -0
  236. package/scripts/check-platform-ratchets.mjs +297 -0
  237. package/scripts/check-shards.d.mts +5 -0
  238. package/scripts/check-shards.mjs +101 -0
  239. package/scripts/check-sim-players.mjs +82 -0
  240. package/scripts/check-spelled-paths.d.mts +1 -0
  241. package/scripts/check-spelled-paths.mjs +34 -0
  242. package/scripts/chromium-keychain-check.mjs +140 -0
  243. package/scripts/chromium-keychain.d.mts +1 -0
  244. package/scripts/chromium-keychain.mjs +5 -0
  245. package/scripts/chromium-memory-browser.d.mts +4 -0
  246. package/scripts/chromium-memory-browser.mjs +52 -0
  247. package/scripts/ci-bisect.py +91 -0
  248. package/scripts/ci-browser.sh +45 -0
  249. package/scripts/ci-checks.d.mts +2 -0
  250. package/scripts/ci-checks.mjs +94 -0
  251. package/scripts/ci-disk-census.py +58 -0
  252. package/scripts/ci-docs-proof.mjs +84 -0
  253. package/scripts/ci-exact-reuse.d.mts +3 -0
  254. package/scripts/ci-exact-reuse.mjs +73 -0
  255. package/scripts/ci-generated-manifest.sh +18 -0
  256. package/scripts/ci-native-fixtures.mjs +36 -0
  257. package/scripts/ci-pack.d.mts +14 -0
  258. package/scripts/ci-pack.mjs +231 -0
  259. package/scripts/ci-playwright-install.sh +11 -0
  260. package/scripts/ci-product-cache.d.mts +2 -0
  261. package/scripts/ci-product-cache.mjs +57 -0
  262. package/scripts/ci-products.py +285 -0
  263. package/scripts/ci-proof-jobs.d.mts +3 -0
  264. package/scripts/ci-proof-jobs.mjs +34 -0
  265. package/scripts/ci-selection.mjs +63 -0
  266. package/scripts/ci-shard-wall-proof.mjs +26 -0
  267. package/scripts/ci-shard-wall.mjs +35 -0
  268. package/scripts/ci-static.sh +63 -0
  269. package/scripts/commit.sh +305 -0
  270. package/scripts/commit_lane.py +42 -0
  271. package/scripts/committed-fast-checks.mjs +262 -0
  272. package/scripts/committed-source-tables.mjs +47 -0
  273. package/scripts/compare-platform-steps.mjs +15 -0
  274. package/scripts/compiler-code.d.mts +3 -0
  275. package/scripts/compiler-code.mjs +69 -0
  276. package/scripts/complete-at-control-snapshot.mjs +297 -0
  277. package/scripts/complete-at-control.mjs +580 -0
  278. package/scripts/content-base-proof.mjs +158 -0
  279. package/scripts/content-sw-proof.mjs +215 -0
  280. package/scripts/cook-admission-proof.mjs +42 -0
  281. package/scripts/cook-audit.ts +57 -0
  282. package/scripts/cook-job.mjs +32 -0
  283. package/scripts/cook-parts-report.mjs +34 -0
  284. package/scripts/cook-revision.ts +60 -0
  285. package/scripts/cook-to-play.mjs +96 -0
  286. package/scripts/cook-worker.mjs +78 -0
  287. package/scripts/cook-worker.service +5 -0
  288. package/scripts/cook.mjs +19 -0
  289. package/scripts/core-heap-diagnostic.d.mts +21 -0
  290. package/scripts/core-heap-diagnostic.mjs +52 -0
  291. package/scripts/cpu-admission-proof.mjs +55 -0
  292. package/scripts/cpu-admission.mjs +32 -0
  293. package/scripts/cpu-admission.py +243 -0
  294. package/scripts/cpu-broker-proof.mjs +96 -0
  295. package/scripts/cpu-broker.mjs +56 -0
  296. package/scripts/cpu-broker.py +119 -0
  297. package/scripts/cpu-census-proof.py +193 -0
  298. package/scripts/cpu-census.py +374 -0
  299. package/scripts/crossroads-proof.mjs +32 -0
  300. package/scripts/crossroads-rig/core.d.ts +16 -0
  301. package/scripts/crossroads-rig/core.js +417 -0
  302. package/scripts/crossroads-rig/desktop-probe.mjs +163 -0
  303. package/scripts/crossroads-rig/index.html +21 -0
  304. package/scripts/crossroads-rig/phone.js +74 -0
  305. package/scripts/crossroads-rig/production-probe.mjs +160 -0
  306. package/scripts/crossroads-rig/production.html +23 -0
  307. package/scripts/crossroads-rig/production.md +28 -0
  308. package/scripts/crossroads-rig/rig.js +36 -0
  309. package/scripts/crossroads-rig/sim-probe.mjs +217 -0
  310. package/scripts/crossroads-rig/stage.sh +11 -0
  311. package/scripts/crossroads-smoke.mjs +83 -0
  312. package/scripts/debug-settings.d.mts +24 -0
  313. package/scripts/debug-settings.mjs +80 -0
  314. package/scripts/decision-legacy-lines.d.mts +4 -0
  315. package/scripts/decision-legacy-lines.mjs +30 -0
  316. package/scripts/deck-skip-proof.mjs +63 -0
  317. package/scripts/deny-browser.mjs +11 -0
  318. package/scripts/docs-inputs-proof.mjs +31 -0
  319. package/scripts/doctor-proof.mjs +186 -0
  320. package/scripts/dome-cameras.d.mts +27 -0
  321. package/scripts/dome-cameras.mjs +77 -0
  322. package/scripts/download-bench/link.mjs +101 -0
  323. package/scripts/e2e-client.mjs +153 -0
  324. package/scripts/e2e-offline.sh +9 -0
  325. package/scripts/e2e-paths.mjs +31 -0
  326. package/scripts/e2e-watcher.mjs +191 -0
  327. package/scripts/e7-doctor-proof.mjs +61 -0
  328. package/scripts/e7-doctor-request-proof.mjs +179 -0
  329. package/scripts/e7-doctor-worker-proof.mjs +221 -0
  330. package/scripts/e7-live-staging-proof.mjs +72 -0
  331. package/scripts/e7-playtest-table.mjs +67 -0
  332. package/scripts/e7-records-proof.mjs +17 -0
  333. package/scripts/e7-voice-staging-proof.mjs +94 -0
  334. package/scripts/engine-ci-budget.ts +39 -0
  335. package/scripts/engine-ci-membership-proof.ts +26 -0
  336. package/scripts/engine-ci-plan.ts +120 -0
  337. package/scripts/engine-ci-proof.mjs +41 -0
  338. package/scripts/engine-ci-sequencer.ts +18 -0
  339. package/scripts/engine-ci-shard.mjs +28 -0
  340. package/scripts/engine-ci.config.ts +17 -0
  341. package/scripts/engine-order-proof.mjs +41 -0
  342. package/scripts/environment-boundary-proof.mjs +28 -0
  343. package/scripts/fetch-assets.mjs +76 -0
  344. package/scripts/format-hook.mjs +20 -0
  345. package/scripts/format-lock.d.mts +6 -0
  346. package/scripts/format-lock.mjs +120 -0
  347. package/scripts/format-package.d.mts +4 -0
  348. package/scripts/format-package.mjs +12 -0
  349. package/scripts/frame-cost-report.ts +85 -0
  350. package/scripts/frame-floor-args.d.mts +14 -0
  351. package/scripts/frame-floor-args.mjs +156 -0
  352. package/scripts/frame-floor-buffer-pressure.d.mts +3 -0
  353. package/scripts/frame-floor-buffer-pressure.mjs +91 -0
  354. package/scripts/frame-floor-draw-report.d.mts +38 -0
  355. package/scripts/frame-floor-draw-report.mjs +112 -0
  356. package/scripts/frame-floor-gl-time.d.mts +4 -0
  357. package/scripts/frame-floor-gl-time.mjs +104 -0
  358. package/scripts/frame-floor-gpu-bisect.mjs +120 -0
  359. package/scripts/frame-floor-grid.d.mts +67 -0
  360. package/scripts/frame-floor-grid.mjs +552 -0
  361. package/scripts/frame-floor-inventory.d.mts +2 -0
  362. package/scripts/frame-floor-inventory.mjs +10 -0
  363. package/scripts/frame-floor-jsc-gc.d.mts +15 -0
  364. package/scripts/frame-floor-jsc-gc.mjs +122 -0
  365. package/scripts/frame-floor-native-pressure.d.mts +4 -0
  366. package/scripts/frame-floor-native-pressure.mjs +78 -0
  367. package/scripts/frame-floor-native.mjs +108 -0
  368. package/scripts/frame-floor-navigation.d.mts +12 -0
  369. package/scripts/frame-floor-navigation.mjs +41 -0
  370. package/scripts/frame-floor-pause-ablation.d.mts +15 -0
  371. package/scripts/frame-floor-pause-ablation.mjs +90 -0
  372. package/scripts/frame-floor-pending.d.mts +16 -0
  373. package/scripts/frame-floor-pending.mjs +29 -0
  374. package/scripts/frame-floor-programs.mjs +39 -0
  375. package/scripts/frame-floor-report-phase.d.mts +10 -0
  376. package/scripts/frame-floor-report-phase.mjs +41 -0
  377. package/scripts/frame-floor-script-profile.d.mts +20 -0
  378. package/scripts/frame-floor-script-profile.mjs +159 -0
  379. package/scripts/frame-floor-settings.d.mts +6 -0
  380. package/scripts/frame-floor-settings.mjs +118 -0
  381. package/scripts/frame-floor-standing.d.mts +4 -0
  382. package/scripts/frame-floor-standing.mjs +20 -0
  383. package/scripts/frame-floor-task-clock.d.mts +4 -0
  384. package/scripts/frame-floor-task-clock.mjs +284 -0
  385. package/scripts/frame-floor-timeline-session.ts +76 -0
  386. package/scripts/frame-floor-wasm-constructors.d.mts +6 -0
  387. package/scripts/frame-floor-wasm-constructors.mjs +37 -0
  388. package/scripts/frame-floor-wasm-probe.d.mts +2 -0
  389. package/scripts/frame-floor-wasm-probe.mjs +51 -0
  390. package/scripts/frame-floor-webkit-timeline.d.mts +26 -0
  391. package/scripts/frame-floor-webkit-timeline.mjs +285 -0
  392. package/scripts/frame-floor.mjs +1290 -0
  393. package/scripts/full-test-log-proof.py +191 -0
  394. package/scripts/full-test-report.py +154 -0
  395. package/scripts/function-source.d.mts +3 -0
  396. package/scripts/function-source.mjs +48 -0
  397. package/scripts/g571-hosts.d.mts +3 -0
  398. package/scripts/g571-hosts.mjs +54 -0
  399. package/scripts/game-plugins.d.mts +22 -0
  400. package/scripts/gate-related-tests.d.mts +7 -0
  401. package/scripts/gate-related-tests.mjs +178 -0
  402. package/scripts/gen-api.d.mts +10 -0
  403. package/scripts/gen-api.mjs +134 -0
  404. package/scripts/gen-boot-cache.d.mts +2 -0
  405. package/scripts/gen-boot-cache.mjs +146 -0
  406. package/scripts/gen-budget-derivations.d.mts +1 -0
  407. package/scripts/gen-budget-derivations.mjs +43 -0
  408. package/scripts/gen-programs.d.mts +8 -0
  409. package/scripts/gen-programs.mjs +82 -0
  410. package/scripts/gen-shard-words.d.mts +4 -0
  411. package/scripts/gen-shard-words.mjs +188 -0
  412. package/scripts/gen-source.d.mts +4 -0
  413. package/scripts/gen-source.mjs +73 -0
  414. package/scripts/gen-starter-arm-clips.d.mts +4 -0
  415. package/scripts/gen-starter-arm-clips.mjs +17 -0
  416. package/scripts/gen-starter-bag.d.mts +4 -0
  417. package/scripts/gen-starter-bag.mjs +16 -0
  418. package/scripts/gen-starter-effects.d.mts +4 -0
  419. package/scripts/gen-starter-effects.mjs +16 -0
  420. package/scripts/gen-starter-weapons.d.mts +4 -0
  421. package/scripts/gen-starter-weapons.mjs +16 -0
  422. package/scripts/gen.mjs +6 -0
  423. package/scripts/generate-title-launch.mjs +55 -0
  424. package/scripts/generated-files.d.mts +6 -0
  425. package/scripts/generated-files.mjs +86 -0
  426. package/scripts/generated-input-reading.d.mts +3 -0
  427. package/scripts/generated-input-reading.mjs +89 -0
  428. package/scripts/generated-policy.d.mts +13 -0
  429. package/scripts/generated-policy.mjs +113 -0
  430. package/scripts/generated-source.d.mts +11 -0
  431. package/scripts/generated-source.mjs +214 -0
  432. package/scripts/generation-cache-prune.d.mts +10 -0
  433. package/scripts/generation-cache-prune.mjs +128 -0
  434. package/scripts/gfx-toggle/compare.mjs +133 -0
  435. package/scripts/git-common.d.mts +1 -0
  436. package/scripts/git-common.mjs +13 -0
  437. package/scripts/git-rule-counts.mjs +16 -0
  438. package/scripts/git-source-view.mjs +225 -0
  439. package/scripts/goldens/board.py +176 -0
  440. package/scripts/goldens/capture-inputs.d.mts +4 -0
  441. package/scripts/goldens/capture-inputs.mjs +35 -0
  442. package/scripts/goldens/capture.mjs +214 -0
  443. package/scripts/goldens/colour_shift.py +27 -0
  444. package/scripts/goldens/native-residency.d.mts +10 -0
  445. package/scripts/goldens/native-residency.mjs +104 -0
  446. package/scripts/goldens/plot-inputs.d.mts +12 -0
  447. package/scripts/goldens/plot-inputs.mjs +46 -0
  448. package/scripts/gpu-gate/matrix.d.mts +3 -0
  449. package/scripts/gpu-gate/matrix.mjs +48 -0
  450. package/scripts/gpu-gate/probe.mjs +30 -0
  451. package/scripts/gpu-gate/status.d.mts +4 -0
  452. package/scripts/gpu-gate/status.mjs +112 -0
  453. package/scripts/gpu-perf/com.wildshard.gpu-perf.plist +11 -0
  454. package/scripts/gpu-perf/install.sh +31 -0
  455. package/scripts/gpu-perf/nightly.mjs +216 -0
  456. package/scripts/gpu-perf/nightly.sh +7 -0
  457. package/scripts/gpu-perf/report.d.mts +18 -0
  458. package/scripts/gpu-perf/report.mjs +109 -0
  459. package/scripts/gpu-perf/timing.sh +17 -0
  460. package/scripts/gpu-trace-frames.mjs +113 -0
  461. package/scripts/grid-crossing-walk-proof.mjs +172 -0
  462. package/scripts/grid-gate-proof.mjs +126 -0
  463. package/scripts/grid-ready-latches.d.mts +7 -0
  464. package/scripts/grid-ready-latches.mjs +44 -0
  465. package/scripts/grid-ready-memory.d.mts +3 -0
  466. package/scripts/grid-ready-memory.mjs +86 -0
  467. package/scripts/grid-runtime-evidence.d.mts +4 -0
  468. package/scripts/grid-runtime-evidence.mjs +107 -0
  469. package/scripts/grid-spawn-proof.mjs +317 -0
  470. package/scripts/guard-counts.d.mts +8 -0
  471. package/scripts/guard-counts.mjs +136 -0
  472. package/scripts/guard-index-tree.d.mts +2 -0
  473. package/scripts/guard-index-tree.mjs +19 -0
  474. package/scripts/heavy-lane-lease.d.mts +2 -0
  475. package/scripts/heavy-lane-lease.mjs +33 -0
  476. package/scripts/heavy-lane.py +652 -0
  477. package/scripts/herdr-prompt.sh +13 -0
  478. package/scripts/herdr-question-open.sh +22 -0
  479. package/scripts/hero-shots.mjs +168 -0
  480. package/scripts/home-icons.mjs +27 -0
  481. package/scripts/host-activity.ts +41 -0
  482. package/scripts/hud-worst/chat.ts +33 -0
  483. package/scripts/hud-worst.mjs +344 -0
  484. package/scripts/inbox-pull.mjs +129 -0
  485. package/scripts/inline-shell-css.mjs +30 -0
  486. package/scripts/input-hash-memo.d.mts +16 -0
  487. package/scripts/input-hash-memo.mjs +109 -0
  488. package/scripts/input-snapshot.d.mts +2 -0
  489. package/scripts/input-snapshot.mjs +45 -0
  490. package/scripts/ios-memory-watchdog.py +339 -0
  491. package/scripts/iphone-mem-reading.sh +40 -0
  492. package/scripts/js-entry-census.mjs +54 -0
  493. package/scripts/js-payload-heap.mjs +23 -0
  494. package/scripts/json-declarations.d.mts +3 -0
  495. package/scripts/json-declarations.mjs +101 -0
  496. package/scripts/json-output-guard.d.mts +6 -0
  497. package/scripts/json-output-guard.mjs +50 -0
  498. package/scripts/ktx2-engine-map.json +156 -0
  499. package/scripts/ktx2-tables.d.mts +5 -0
  500. package/scripts/ktx2-tables.mjs +103 -0
  501. package/scripts/land.d.mts +17 -0
  502. package/scripts/land.mjs +888 -0
  503. package/scripts/lane-watchdog.d.mts +11 -0
  504. package/scripts/lane-watchdog.mjs +256 -0
  505. package/scripts/latch-grid-evidence.d.mts +1 -0
  506. package/scripts/latch-grid-evidence.mjs +68 -0
  507. package/scripts/lift-pending-batches-proof.mjs +135 -0
  508. package/scripts/lift-pending-batches.mjs +124 -0
  509. package/scripts/lift-pending-history-proof.mjs +41 -0
  510. package/scripts/lift-pending-proof.mjs +27 -0
  511. package/scripts/lift-pending-schedule.mjs +23 -0
  512. package/scripts/lift-pending.d.mts +1 -0
  513. package/scripts/lift-pending.mjs +78 -0
  514. package/scripts/link-node-modules.d.mts +1 -0
  515. package/scripts/link-node-modules.mjs +291 -0
  516. package/scripts/lint-all.mjs +50 -0
  517. package/scripts/lint-cli.mjs +10 -0
  518. package/scripts/lint-fast.mjs +30 -0
  519. package/scripts/lint-game-selection-proof.mjs +27 -0
  520. package/scripts/lint-game.mjs +26 -0
  521. package/scripts/lint-tools.d.mts +4 -0
  522. package/scripts/lint-tools.mjs +28 -0
  523. package/scripts/listed-view-code.d.mts +7 -0
  524. package/scripts/listed-view-code.mjs +93 -0
  525. package/scripts/live-prepush.py +352 -0
  526. package/scripts/load-mem-probe.mjs +248 -0
  527. package/scripts/loading-bar-rule.mjs +107 -0
  528. package/scripts/loading-benchmark/accuracy-data.d.mts +12 -0
  529. package/scripts/loading-benchmark/accuracy-data.mjs +92 -0
  530. package/scripts/loading-benchmark/cache-bodies.d.mts +14 -0
  531. package/scripts/loading-benchmark/cache-bodies.mjs +103 -0
  532. package/scripts/loading-benchmark/catalogue.d.mts +8 -0
  533. package/scripts/loading-benchmark/catalogue.mjs +41 -0
  534. package/scripts/loading-benchmark/sim-shard.d.mts +60 -0
  535. package/scripts/loading-benchmark/sim-shard.mjs +289 -0
  536. package/scripts/loading-benchmark/transport.d.mts +9 -0
  537. package/scripts/loading-benchmark/transport.mjs +109 -0
  538. package/scripts/loading-card-proof.mjs +298 -0
  539. package/scripts/loading-fence-proof.mjs +67 -0
  540. package/scripts/loading-flow/analyse.mjs +280 -0
  541. package/scripts/loading-flow/benchmax.mjs +179 -0
  542. package/scripts/loading-flow/board.py +104 -0
  543. package/scripts/loading-flow/drive.mjs +283 -0
  544. package/scripts/loading-flow/layer-parity-proof.mjs +69 -0
  545. package/scripts/loading-flow/link-probe.mjs +99 -0
  546. package/scripts/loading-flow/profile.mjs +54 -0
  547. package/scripts/loading-flow/run.sh +51 -0
  548. package/scripts/loading-flow/source-maps-proof.mjs +86 -0
  549. package/scripts/loading-flow/source-maps.mjs +73 -0
  550. package/scripts/loading-flow/stalls.d.mts +39 -0
  551. package/scripts/loading-flow/stalls.mjs +141 -0
  552. package/scripts/loading-flow/sweep-input-proof.mjs +127 -0
  553. package/scripts/loading-flow/sweep-input.mjs +70 -0
  554. package/scripts/loading-flow/sweep-report.mjs +112 -0
  555. package/scripts/loading-flow/sweep.sh +101 -0
  556. package/scripts/loading-flow/target-proof.mjs +56 -0
  557. package/scripts/loading-flow/target.mjs +39 -0
  558. package/scripts/loading-time-left-proof.mjs +121 -0
  559. package/scripts/loading-time-left-rule.mjs +49 -0
  560. package/scripts/look-loop/cameras.d.mts +18 -0
  561. package/scripts/look-loop/cameras.mjs +109 -0
  562. package/scripts/look-loop/fit-lut.py +142 -0
  563. package/scripts/look-loop/palette-delta.py +183 -0
  564. package/scripts/look-loop/regions/driftwood-isle.json +25 -0
  565. package/scripts/look-loop/regions/far-reach.json +225 -0
  566. package/scripts/look-loop/regions/open-plot-night-market.json +855 -0
  567. package/scripts/look-loop/regions/pine-hollow.json +22 -0
  568. package/scripts/look-loop/regions/sunscar-dunes.json +281 -0
  569. package/scripts/look-loop/targets.py +229 -0
  570. package/scripts/look-loop/test_look_loop.py +133 -0
  571. package/scripts/look-loop/views.mjs +176 -0
  572. package/scripts/main-menu-aerial-plan.mjs +8 -0
  573. package/scripts/main-menu-aerial-poses.ts +292 -0
  574. package/scripts/main-pull.mjs +84 -0
  575. package/scripts/main-watch.d.mts +19 -0
  576. package/scripts/main-watch.mjs +248 -0
  577. package/scripts/manifest-art-inputs.json +4 -0
  578. package/scripts/manifest-budget.mjs +44 -0
  579. package/scripts/manifest-declaration.d.mts +3 -0
  580. package/scripts/manifest-declaration.mjs +40 -0
  581. package/scripts/manifest-spawns.mjs +38 -0
  582. package/scripts/manifest-static-imports.d.mts +2 -0
  583. package/scripts/manifest-static-imports.mjs +83 -0
  584. package/scripts/map-hash.d.mts +20 -0
  585. package/scripts/map-hash.mjs +155 -0
  586. package/scripts/map-painter.d.mts +13 -0
  587. package/scripts/map-painter.mjs +97 -0
  588. package/scripts/map-stylize.py +241 -0
  589. package/scripts/memory/cpuOwners.d.mts +4 -0
  590. package/scripts/memory/cpuOwners.mjs +51 -0
  591. package/scripts/memory/heapReader.d.mts +3 -0
  592. package/scripts/memory/heapReader.mjs +59 -0
  593. package/scripts/memory/js-heap-ratchet.json +17 -0
  594. package/scripts/memory/jsHeap.d.mts +6 -0
  595. package/scripts/memory/jsHeap.mjs +52 -0
  596. package/scripts/memory-report-blocks.d.mts +28 -0
  597. package/scripts/memory-report-blocks.mjs +60 -0
  598. package/scripts/memory-report-data.d.mts +25 -0
  599. package/scripts/memory-report-data.mjs +222 -0
  600. package/scripts/memory-report-graphic.d.mts +5 -0
  601. package/scripts/memory-report-graphic.mjs +90 -0
  602. package/scripts/memory-report-snapshot.d.mts +4 -0
  603. package/scripts/memory-report-snapshot.mjs +13 -0
  604. package/scripts/memory-report.d.mts +5 -0
  605. package/scripts/memory-report.mjs +94 -0
  606. package/scripts/mmo-bots.mjs +241 -0
  607. package/scripts/mobile-graphics-proof.mjs +120 -0
  608. package/scripts/model-spin-recording.d.mts +4 -0
  609. package/scripts/model-spin-recording.mjs +25 -0
  610. package/scripts/model-spin.mjs +327 -0
  611. package/scripts/module-cache-proof.mjs +43 -0
  612. package/scripts/name-prompt-proof.mjs +136 -0
  613. package/scripts/native-recorder-cache.d.mts +33 -0
  614. package/scripts/native-recorder-cache.mjs +287 -0
  615. package/scripts/native-retention-proof.mjs +79 -0
  616. package/scripts/night-market-kit-budget.d.mts +12 -0
  617. package/scripts/night-market-kit-budget.mjs +80 -0
  618. package/scripts/nightly-heads.ts +176 -0
  619. package/scripts/nightly-model.ts +127 -0
  620. package/scripts/nightly-tag.d.mts +1 -0
  621. package/scripts/nightly-tag.mjs +32 -0
  622. package/scripts/nightly.proof.ts +105 -0
  623. package/scripts/nightly.ts +43 -0
  624. package/scripts/nine-sim-memory.mjs +353 -0
  625. package/scripts/no-binary-json.d.mts +12 -0
  626. package/scripts/no-binary-json.mjs +270 -0
  627. package/scripts/non-engine-admission-proof.mjs +27 -0
  628. package/scripts/number-path-probe.d.mts +7 -0
  629. package/scripts/number-path-probe.mjs +57 -0
  630. package/scripts/offline-proof-rules.d.mts +23 -0
  631. package/scripts/offline-proof-rules.mjs +123 -0
  632. package/scripts/offline-proof.mjs +498 -0
  633. package/scripts/online-phone-proof.mjs +330 -0
  634. package/scripts/online-proof.mjs +150 -0
  635. package/scripts/online-ride-proof.mjs +74 -0
  636. package/scripts/online-rig.mjs +114 -0
  637. package/scripts/page-parity.mjs +99 -0
  638. package/scripts/page-release/content.d.mts +30 -0
  639. package/scripts/page-release/content.mjs +299 -0
  640. package/scripts/page-release/flow.d.mts +60 -0
  641. package/scripts/page-release/flow.mjs +365 -0
  642. package/scripts/page-release/hosts/workers.d.mts +8 -0
  643. package/scripts/page-release/hosts/workers.mjs +160 -0
  644. package/scripts/page-release/packs.mjs +108 -0
  645. package/scripts/page-release/redact.d.mts +1 -0
  646. package/scripts/page-release/redact.mjs +19 -0
  647. package/scripts/page-release.mjs +101 -0
  648. package/scripts/page-size.d.mts +13 -0
  649. package/scripts/page-size.mjs +198 -0
  650. package/scripts/parallel-fast-lint.d.mts +1 -0
  651. package/scripts/parallel-fast-lint.mjs +54 -0
  652. package/scripts/parity/audio-diagnostics.d.mts +5 -0
  653. package/scripts/parity/audio-diagnostics.mjs +63 -0
  654. package/scripts/parity/audio-settle.mjs +111 -0
  655. package/scripts/parity/black-frame.d.mts +11 -0
  656. package/scripts/parity/black-frame.mjs +58 -0
  657. package/scripts/parity/boot-smoke.d.mts +47 -0
  658. package/scripts/parity/boot-smoke.mjs +585 -0
  659. package/scripts/parity/boot-timing-delay.mjs +54 -0
  660. package/scripts/parity/browser-escape.d.mts +2 -0
  661. package/scripts/parity/browser-escape.mjs +50 -0
  662. package/scripts/parity/budgetCeilings.d.mts +3 -0
  663. package/scripts/parity/budgetCeilings.mjs +30 -0
  664. package/scripts/parity/budgets.d.mts +7 -0
  665. package/scripts/parity/budgets.mjs +73 -0
  666. package/scripts/parity/cache.d.mts +1 -0
  667. package/scripts/parity/cache.mjs +40 -0
  668. package/scripts/parity/canvas-bytes.d.mts +13 -0
  669. package/scripts/parity/canvas-bytes.mjs +96 -0
  670. package/scripts/parity/capture-rpc.d.mts +2 -0
  671. package/scripts/parity/capture-rpc.mjs +41 -0
  672. package/scripts/parity/capture-trace.d.mts +6 -0
  673. package/scripts/parity/capture-trace.mjs +63 -0
  674. package/scripts/parity/clock.d.mts +1 -0
  675. package/scripts/parity/clock.mjs +89 -0
  676. package/scripts/parity/combat.d.mts +14 -0
  677. package/scripts/parity/combat.mjs +81 -0
  678. package/scripts/parity/compare.d.mts +10 -0
  679. package/scripts/parity/compare.mjs +177 -0
  680. package/scripts/parity/explorer-smoke.d.mts +21 -0
  681. package/scripts/parity/explorer-smoke.mjs +310 -0
  682. package/scripts/parity/fast-png.d.mts +18 -0
  683. package/scripts/parity/fast-png.mjs +68 -0
  684. package/scripts/parity/fingerprint.mjs +8 -0
  685. package/scripts/parity/fixed-render.d.mts +11 -0
  686. package/scripts/parity/fixed-render.mjs +79 -0
  687. package/scripts/parity/frame-budget.d.mts +3 -0
  688. package/scripts/parity/frame-budget.mjs +39 -0
  689. package/scripts/parity/frame-bytes.d.mts +8 -0
  690. package/scripts/parity/frame-bytes.mjs +45 -0
  691. package/scripts/parity/frames.mjs +8 -0
  692. package/scripts/parity/glbytes.d.mts +8 -0
  693. package/scripts/parity/glbytes.mjs +148 -0
  694. package/scripts/parity/grid-boot-waits.d.mts +13 -0
  695. package/scripts/parity/grid-boot-waits.mjs +43 -0
  696. package/scripts/parity/heat-bytes.d.mts +5 -0
  697. package/scripts/parity/heat-bytes.mjs +32 -0
  698. package/scripts/parity/hover-touch.mjs +153 -0
  699. package/scripts/parity/hud.d.mts +4 -0
  700. package/scripts/parity/hud.mjs +17 -0
  701. package/scripts/parity/image-routes.d.mts +5 -0
  702. package/scripts/parity/image-routes.mjs +29 -0
  703. package/scripts/parity/init.d.mts +15 -0
  704. package/scripts/parity/init.mjs +63 -0
  705. package/scripts/parity/lane-browser.mjs +14 -0
  706. package/scripts/parity/offline.d.mts +5 -0
  707. package/scripts/parity/offline.mjs +24 -0
  708. package/scripts/parity/phone-route-browser.d.mts +20 -0
  709. package/scripts/parity/phone-route-browser.mjs +241 -0
  710. package/scripts/parity/phone-route-page.d.mts +10 -0
  711. package/scripts/parity/phone-route-page.mjs +245 -0
  712. package/scripts/parity/phone-route-runner.d.mts +2 -0
  713. package/scripts/parity/phone-route-runner.mjs +39 -0
  714. package/scripts/parity/phone-route.d.mts +43 -0
  715. package/scripts/parity/phone-route.mjs +212 -0
  716. package/scripts/parity/pool.d.mts +4 -0
  717. package/scripts/parity/pool.mjs +74 -0
  718. package/scripts/parity/poses.d.mts +6 -0
  719. package/scripts/parity/poses.mjs +57 -0
  720. package/scripts/parity/probe.d.mts +2 -0
  721. package/scripts/parity/probe.mjs +13 -0
  722. package/scripts/parity/profile.d.mts +2 -0
  723. package/scripts/parity/profile.mjs +52 -0
  724. package/scripts/parity/record.d.mts +8 -0
  725. package/scripts/parity/record.mjs +102 -0
  726. package/scripts/parity/resources.mjs +58 -0
  727. package/scripts/parity/saves.d.mts +1 -0
  728. package/scripts/parity/saves.mjs +14 -0
  729. package/scripts/parity/serve.d.mts +9 -0
  730. package/scripts/parity/serve.mjs +125 -0
  731. package/scripts/parity/shader-code.d.mts +2 -0
  732. package/scripts/parity/shader-code.mjs +10 -0
  733. package/scripts/parity/ssim.d.mts +4 -0
  734. package/scripts/parity/ssim.mjs +44 -0
  735. package/scripts/parity/telemetry.d.mts +1 -0
  736. package/scripts/parity/telemetry.mjs +19 -0
  737. package/scripts/parity/timeout.mjs +7 -0
  738. package/scripts/parity/title-trace.d.mts +13 -0
  739. package/scripts/parity/title-trace.mjs +59 -0
  740. package/scripts/parity/value.d.mts +11 -0
  741. package/scripts/parity/value.mjs +50 -0
  742. package/scripts/parity/walk.d.mts +10 -0
  743. package/scripts/parity/walk.mjs +109 -0
  744. package/scripts/parity.mjs +310 -0
  745. package/scripts/perf/README.md +47 -0
  746. package/scripts/perf/cameras24.json +2963 -0
  747. package/scripts/perf/draw-census-page.d.mts +10 -0
  748. package/scripts/perf/draw-census-page.mjs +162 -0
  749. package/scripts/perf/draw-census-poses.d.mts +14 -0
  750. package/scripts/perf/draw-census-poses.mjs +44 -0
  751. package/scripts/perf/draw-census-report.d.mts +24 -0
  752. package/scripts/perf/draw-census-report.mjs +86 -0
  753. package/scripts/perf/draw-census.mjs +156 -0
  754. package/scripts/perf/exact-world-capture.mjs +167 -0
  755. package/scripts/perf/gpu-census-coverage.d.mts +6 -0
  756. package/scripts/perf/gpu-census-coverage.mjs +47 -0
  757. package/scripts/perf/gpu-census-overdraw.mjs +105 -0
  758. package/scripts/perf/gpu-census-page.d.mts +11 -0
  759. package/scripts/perf/gpu-census-page.mjs +53 -0
  760. package/scripts/perf/gpu-census-report.d.mts +3 -0
  761. package/scripts/perf/gpu-census-report.mjs +15 -0
  762. package/scripts/perf/gpu-census.d.mts +6 -0
  763. package/scripts/perf/gpu-census.mjs +95 -0
  764. package/scripts/perf/material-program-loan.d.mts +18 -0
  765. package/scripts/perf/material-program-loan.mjs +88 -0
  766. package/scripts/perf/world-pixel-difference.d.mts +5 -0
  767. package/scripts/perf/world-pixel-difference.mjs +22 -0
  768. package/scripts/phone-loading/chromium.ts +113 -0
  769. package/scripts/phone-loading/cpu-profile.ts +47 -0
  770. package/scripts/phone-loading/fixtures.ts +18 -0
  771. package/scripts/phone-loading/instrument.ts +219 -0
  772. package/scripts/phone-loading/link.ts +115 -0
  773. package/scripts/phone-loading/main.ts +261 -0
  774. package/scripts/phone-loading/model.ts +123 -0
  775. package/scripts/phone-loading/native-body.ts +40 -0
  776. package/scripts/phone-loading/native-sizes.ts +194 -0
  777. package/scripts/phone-loading/network.ts +167 -0
  778. package/scripts/phone-loading/play.ts +132 -0
  779. package/scripts/phone-loading/post-control.ts +22 -0
  780. package/scripts/phone-loading/recording.ts +28 -0
  781. package/scripts/phone-loading/shaped-preview.ts +37 -0
  782. package/scripts/phone-loading/tsconfig.json +11 -0
  783. package/scripts/physics-baseline.mjs +433 -0
  784. package/scripts/physics-grid-entry.d.mts +15 -0
  785. package/scripts/physics-grid-entry.mjs +62 -0
  786. package/scripts/physics-grid.d.mts +10 -0
  787. package/scripts/physics-grid.mjs +102 -0
  788. package/scripts/physics-native.d.mts +6 -0
  789. package/scripts/physics-native.mjs +81 -0
  790. package/scripts/physics-route.json +4400 -0
  791. package/scripts/physics-walk.d.mts +16 -0
  792. package/scripts/physics-walk.mjs +79 -0
  793. package/scripts/pid-lock.d.mts +1 -0
  794. package/scripts/pid-lock.mjs +63 -0
  795. package/scripts/pin-assets.ts +94 -0
  796. package/scripts/pin-format.ts +43 -0
  797. package/scripts/pin-packs.ts +17 -0
  798. package/scripts/pins-exclude.d.mts +3 -0
  799. package/scripts/pins-exclude.mjs +54 -0
  800. package/scripts/pins-reuse.d.mts +27 -0
  801. package/scripts/pins-reuse.mjs +321 -0
  802. package/scripts/pins.ts +468 -0
  803. package/scripts/platform-chargebacks.d.mts +9 -0
  804. package/scripts/platform-chargebacks.mjs +135 -0
  805. package/scripts/playground-grapple.mjs +154 -0
  806. package/scripts/playground-harness.mjs +137 -0
  807. package/scripts/playground-horse.mjs +106 -0
  808. package/scripts/prebuilt-output.py +322 -0
  809. package/scripts/precommit-checks.d.mts +3 -0
  810. package/scripts/precommit-checks.mjs +115 -0
  811. package/scripts/precommit-inputs.d.mts +5 -0
  812. package/scripts/precommit-inputs.mjs +73 -0
  813. package/scripts/precommit-jobs.d.mts +5 -0
  814. package/scripts/precommit-jobs.mjs +85 -0
  815. package/scripts/precommit-source.py +493 -0
  816. package/scripts/preparation-cache-key.d.mts +2 -0
  817. package/scripts/preparation-cache-key.mjs +70 -0
  818. package/scripts/prepush-proof.mjs +36 -0
  819. package/scripts/preview-encoded-cache.d.mts +7 -0
  820. package/scripts/preview-encoded-cache.mjs +64 -0
  821. package/scripts/preview-lag.mjs +80 -0
  822. package/scripts/preview-server.mjs +256 -0
  823. package/scripts/preview-telemetry.d.mts +4 -0
  824. package/scripts/preview-telemetry.mjs +56 -0
  825. package/scripts/product-build-times.d.mts +3 -0
  826. package/scripts/product-build-times.mjs +42 -0
  827. package/scripts/program-discovery.d.mts +5 -0
  828. package/scripts/program-discovery.mjs +42 -0
  829. package/scripts/progress-recording.d.mts +6 -0
  830. package/scripts/progress-recording.mjs +26 -0
  831. package/scripts/progress-video.sh +27 -0
  832. package/scripts/proof-run.sh +69 -0
  833. package/scripts/prune-local-caches.mjs +10 -0
  834. package/scripts/public-grid.d.mts +11 -0
  835. package/scripts/public-grid.mjs +56 -0
  836. package/scripts/push-budget.d.mts +3 -0
  837. package/scripts/push-budget.mjs +5 -0
  838. package/scripts/push-cache-git-proof.mjs +32 -0
  839. package/scripts/push-cache-lease-proof.mjs +22 -0
  840. package/scripts/push-cache-proof.mjs +29 -0
  841. package/scripts/push-checks.d.mts +2 -0
  842. package/scripts/push-checks.mjs +116 -0
  843. package/scripts/push-cohort-proof.mjs +15 -0
  844. package/scripts/push-dependencies.mjs +97 -0
  845. package/scripts/push-dependency-proof.mjs +53 -0
  846. package/scripts/push-duration-sequencer.ts +26 -0
  847. package/scripts/push-environment.mjs +21 -0
  848. package/scripts/push-exclusion-proof.mjs +81 -0
  849. package/scripts/push-gate-copy.mjs +168 -0
  850. package/scripts/push-inputs.d.mts +4 -0
  851. package/scripts/push-inputs.mjs +99 -0
  852. package/scripts/push-lint-config.d.mts +4 -0
  853. package/scripts/push-lint-config.mjs +26 -0
  854. package/scripts/push-local-split.d.mts +15 -0
  855. package/scripts/push-local-split.mjs +116 -0
  856. package/scripts/push-loop.py +317 -0
  857. package/scripts/push-proof-cache.mjs +131 -0
  858. package/scripts/push-ref-tree-proof.mjs +63 -0
  859. package/scripts/push-related.mjs +29 -0
  860. package/scripts/push-selection-dev-proof.mjs +57 -0
  861. package/scripts/push-selection-proof.mjs +45 -0
  862. package/scripts/push-selection.d.mts +2 -0
  863. package/scripts/push-selection.mjs +65 -0
  864. package/scripts/push-vitest.config.ts +20 -0
  865. package/scripts/push_input_cache.py +306 -0
  866. package/scripts/quarantine-placement-proof.mjs +28 -0
  867. package/scripts/quarantine-renewal-proof.mjs +34 -0
  868. package/scripts/quarantine-window-proof.mjs +26 -0
  869. package/scripts/quest-complete-proof.mjs +78 -0
  870. package/scripts/quiet-cli.mjs +13 -0
  871. package/scripts/quiet_logs.py +79 -0
  872. package/scripts/ratchet-approval.d.mts +3 -0
  873. package/scripts/ratchet-approval.mjs +70 -0
  874. package/scripts/record-fence-reads.mjs +115 -0
  875. package/scripts/release-check.mjs +22 -0
  876. package/scripts/release-proof-proof.mjs +71 -0
  877. package/scripts/reload-title-proof.mjs +100 -0
  878. package/scripts/remote-air-proof.mjs +137 -0
  879. package/scripts/remote-bar-proof.mjs +75 -0
  880. package/scripts/remote-board-proof.mjs +129 -0
  881. package/scripts/remote-body-proof.mjs +101 -0
  882. package/scripts/remote-death-proof.mjs +134 -0
  883. package/scripts/remote-gait-proof.mjs +139 -0
  884. package/scripts/remote-held-proof.mjs +155 -0
  885. package/scripts/remote-hurt-proof.mjs +121 -0
  886. package/scripts/remote-map-proof.mjs +103 -0
  887. package/scripts/remote-name-proof.mjs +123 -0
  888. package/scripts/remote-players-proof.mjs +214 -0
  889. package/scripts/remote-room.mjs +75 -0
  890. package/scripts/remote-strike-proof.mjs +148 -0
  891. package/scripts/renderer-revision-replay.mjs +49 -0
  892. package/scripts/renderer-revision.d.mts +12 -0
  893. package/scripts/renderer-revision.mjs +101 -0
  894. package/scripts/renderer-revision.proof.mjs +71 -0
  895. package/scripts/repo-size.d.mts +43 -0
  896. package/scripts/repo-size.mjs +540 -0
  897. package/scripts/ring-cook.mjs +51 -0
  898. package/scripts/ring-step.ts +112 -0
  899. package/scripts/ring1.sh +79 -0
  900. package/scripts/room-deploy.mjs +130 -0
  901. package/scripts/room-soak.mjs +40 -0
  902. package/scripts/runtime_input_copies.py +49 -0
  903. package/scripts/scorecard.mjs +1156 -0
  904. package/scripts/script-scenario-metrics.d.mts +10 -0
  905. package/scripts/script-scenario-metrics.mjs +75 -0
  906. package/scripts/section-types.d.mts +3 -0
  907. package/scripts/section-types.mjs +35 -0
  908. package/scripts/sentry-maps.d.mts +9 -0
  909. package/scripts/sentry-maps.mjs +94 -0
  910. package/scripts/serialize-asset-tables.mjs +13 -0
  911. package/scripts/serve-build.sh +392 -0
  912. package/scripts/serve-port-lease.py +100 -0
  913. package/scripts/serve-shared-preview.py +295 -0
  914. package/scripts/server-origin.mjs +10 -0
  915. package/scripts/server-release/github.mjs +142 -0
  916. package/scripts/server-release/publish.d.mts +19 -0
  917. package/scripts/server-release/publish.mjs +143 -0
  918. package/scripts/server-release/sign.d.mts +10 -0
  919. package/scripts/server-release/sign.mjs +75 -0
  920. package/scripts/shard-component-spans.d.mts +15 -0
  921. package/scripts/shard-component-spans.mjs +18 -0
  922. package/scripts/shard-components.d.mts +16 -0
  923. package/scripts/shard-components.mjs +365 -0
  924. package/scripts/shard-coupling.d.mts +11 -0
  925. package/scripts/shard-coupling.mjs +238 -0
  926. package/scripts/shard-folders.mjs +14 -0
  927. package/scripts/shard-net-lines.d.mts +13 -0
  928. package/scripts/shard-net-lines.mjs +62 -0
  929. package/scripts/shard-output-content.d.mts +4 -0
  930. package/scripts/shard-output-content.mjs +27 -0
  931. package/scripts/shard-outputs.d.mts +12 -0
  932. package/scripts/shard-outputs.mjs +64 -0
  933. package/scripts/shard-phone-memory.d.mts +37 -0
  934. package/scripts/shard-phone-memory.mjs +556 -0
  935. package/scripts/shard-platform-format.d.mts +10 -0
  936. package/scripts/shard-platform-format.mjs +7 -0
  937. package/scripts/shard-platform-hosts.d.mts +2 -0
  938. package/scripts/shard-platform-hosts.mjs +93 -0
  939. package/scripts/shard-platform-output.d.mts +12 -0
  940. package/scripts/shard-platform-output.mjs +74 -0
  941. package/scripts/shard-platform-sections.d.mts +2 -0
  942. package/scripts/shard-platform-sections.mjs +9 -0
  943. package/scripts/shard-platform.d.mts +76 -0
  944. package/scripts/shard-platform.mjs +1072 -0
  945. package/scripts/shard-public.d.mts +3 -0
  946. package/scripts/shard-public.mjs +36 -0
  947. package/scripts/shard-runtime-closure.d.mts +3 -0
  948. package/scripts/shard-runtime-closure.mjs +30 -0
  949. package/scripts/shard-size-gate.d.mts +13 -0
  950. package/scripts/shard-size-gate.mjs +135 -0
  951. package/scripts/shard-size-watch.d.mts +7 -0
  952. package/scripts/shard-size-watch.mjs +70 -0
  953. package/scripts/shard-wire-meter.mjs +107 -0
  954. package/scripts/shardfile-cache.d.mts +17 -0
  955. package/scripts/shardfile-cache.mjs +268 -0
  956. package/scripts/shardfile-inputs.d.mts +19 -0
  957. package/scripts/shardfile-inputs.mjs +452 -0
  958. package/scripts/shardfile-validation-revision.d.mts +1 -0
  959. package/scripts/shardfile-validation-revision.mjs +30 -0
  960. package/scripts/shards.d.mts +7 -0
  961. package/scripts/shards.mjs +16 -0
  962. package/scripts/side-parity.d.mts +8 -0
  963. package/scripts/side-parity.mjs +220 -0
  964. package/scripts/sim-boost-lap.mjs +198 -0
  965. package/scripts/sim-grid-entry.mjs +534 -0
  966. package/scripts/sim-in-runtime.d.mts +6 -0
  967. package/scripts/sim-in-runtime.mjs +146 -0
  968. package/scripts/sim-lane.sh +351 -0
  969. package/scripts/sim-mem-phases.py +195 -0
  970. package/scripts/sim-memory.mjs +414 -0
  971. package/scripts/sim-node-loader.mjs +37 -0
  972. package/scripts/sim-presentation-proof.py +37 -0
  973. package/scripts/sim-quiet.py +160 -0
  974. package/scripts/sim-safari-ready.py +896 -0
  975. package/scripts/sim-transport.c +93 -0
  976. package/scripts/slice-inputs.ts +31 -0
  977. package/scripts/smoke-timings.py +34 -0
  978. package/scripts/snapshot-admission-proof.mjs +55 -0
  979. package/scripts/soak/boundary.mjs +110 -0
  980. package/scripts/soak/inspector.d.mts +18 -0
  981. package/scripts/soak/inspector.mjs +74 -0
  982. package/scripts/soak/memory-categories.d.mts +12 -0
  983. package/scripts/soak/memory-categories.mjs +28 -0
  984. package/scripts/socket-smoke.mjs +20 -0
  985. package/scripts/sort-sides.d.mts +33 -0
  986. package/scripts/sort-sides.mjs +919 -0
  987. package/scripts/source-generation-outputs.json +11 -0
  988. package/scripts/source-generators.d.mts +11 -0
  989. package/scripts/source-generators.mjs +59 -0
  990. package/scripts/source-input-proof.d.mts +12 -0
  991. package/scripts/source-input-proof.mjs +106 -0
  992. package/scripts/source-table-cache.d.mts +2 -0
  993. package/scripts/source-table-cache.mjs +102 -0
  994. package/scripts/sp-tools.py +150 -0
  995. package/scripts/sp-tools.sh +6 -0
  996. package/scripts/split-repair-data-shard.mjs +98 -0
  997. package/scripts/split-repair-guardian.mjs +26 -0
  998. package/scripts/split-repair-hare.mjs +54 -0
  999. package/scripts/split-repair-held-melee.mjs +41 -0
  1000. package/scripts/split-repair-horse-panic.mjs +45 -0
  1001. package/scripts/split-repair-movers.mjs +92 -0
  1002. package/scripts/split-repair-nalati-signals.mjs +94 -0
  1003. package/scripts/split-repair-perks.mjs +73 -0
  1004. package/scripts/split-repair-pine-writes.mjs +76 -0
  1005. package/scripts/split-repair-proof.mjs +24 -0
  1006. package/scripts/split-repair-sky-trails.mjs +110 -0
  1007. package/scripts/split-repair-stun.mjs +37 -0
  1008. package/scripts/split-repair-wake-loss.mjs +35 -0
  1009. package/scripts/split-repair-whip.mjs +44 -0
  1010. package/scripts/staging-proof-lines.d.mts +8 -0
  1011. package/scripts/staging-proof-lines.mjs +85 -0
  1012. package/scripts/standalone-smoke.mjs +116 -0
  1013. package/scripts/storage-policy.json +89 -0
  1014. package/scripts/temp-janitor.d.mts +6 -0
  1015. package/scripts/temp-janitor.mjs +40 -0
  1016. package/scripts/template-format-proof.mjs +44 -0
  1017. package/scripts/test-amber.d.mts +11 -0
  1018. package/scripts/test-amber.mjs +90 -0
  1019. package/scripts/test-build-tools.ts +24 -0
  1020. package/scripts/test-facade-instancing.mjs +53 -0
  1021. package/scripts/test-ios-memory-watchdog.py +107 -0
  1022. package/scripts/test-products.json +389 -0
  1023. package/scripts/test-quarantine.d.mts +6 -0
  1024. package/scripts/test-quarantine.mjs +132 -0
  1025. package/scripts/test-shard-plan.ts +66 -0
  1026. package/scripts/test-timings.d.mts +14 -0
  1027. package/scripts/test-timings.mjs +174 -0
  1028. package/scripts/test_agent_time.py +155 -0
  1029. package/scripts/test_browser_lane.py +239 -0
  1030. package/scripts/test_lease_order.py +142 -0
  1031. package/scripts/test_partition.py +23 -0
  1032. package/scripts/test_prebuilt_output.py +258 -0
  1033. package/scripts/test_products.py +20 -0
  1034. package/scripts/test_serve_ports.py +645 -0
  1035. package/scripts/test_sim_lane.py +1661 -0
  1036. package/scripts/test_sim_quiet.py +140 -0
  1037. package/scripts/texture-inputs.d.mts +4 -0
  1038. package/scripts/texture-inputs.mjs +16 -0
  1039. package/scripts/tile-bake-policy.d.mts +4 -0
  1040. package/scripts/tile-bake-policy.mjs +43 -0
  1041. package/scripts/tile-bake-report.d.mts +17 -0
  1042. package/scripts/tile-bake-report.mjs +161 -0
  1043. package/scripts/tile-bakes.d.mts +13 -0
  1044. package/scripts/tile-bakes.mjs +100 -0
  1045. package/scripts/timelapse.sh +44 -0
  1046. package/scripts/title-assets.d.mts +6 -0
  1047. package/scripts/title-assets.generated.json +9 -0
  1048. package/scripts/title-assets.mjs +46 -0
  1049. package/scripts/title-exit-proof.mjs +132 -0
  1050. package/scripts/tsconfig.json +576 -0
  1051. package/scripts/typecheck-lint.sh +21 -0
  1052. package/scripts/typecheck-root.d.mts +2 -0
  1053. package/scripts/typecheck-root.mjs +18 -0
  1054. package/scripts/types/wildshard-probe.d.ts +29 -0
  1055. package/scripts/types/worker-page.d.ts +55 -0
  1056. package/scripts/uncatalogued-shard-proof.mjs +48 -0
  1057. package/scripts/vite-tmp.d.mts +23 -0
  1058. package/scripts/vite-tmp.mjs +157 -0
  1059. package/scripts/vitest-bench.py +800 -0
  1060. package/scripts/vitest-ci-files.ts +90 -0
  1061. package/scripts/vitest-ci.config.ts +15 -0
  1062. package/scripts/vitest-cpu.ts +46 -0
  1063. package/scripts/vitest-environments.ts +41 -0
  1064. package/scripts/vitest-fixture-snapshots.config.ts +8 -0
  1065. package/scripts/vitest-lane.ts +53 -0
  1066. package/scripts/vitest-module-cache.ts +49 -0
  1067. package/scripts/vitest-native-escape.config.ts +9 -0
  1068. package/scripts/vitest-plan.ts +94 -0
  1069. package/scripts/vitest-push-guards.config.ts +13 -0
  1070. package/scripts/vitest-push.config.ts +19 -0
  1071. package/scripts/vitest-shard.ts +109 -0
  1072. package/scripts/vitest-timings.ts +32 -0
  1073. package/scripts/vitest-tmp.ts +83 -0
  1074. package/scripts/vitest.sh +5 -0
  1075. package/scripts/vps/dump.sh +50 -0
  1076. package/scripts/vps/harden-apply.sh +490 -0
  1077. package/scripts/vps/harden-caddy.sh +215 -0
  1078. package/scripts/vps/harden.sh +358 -0
  1079. package/scripts/vps/health-stub.mjs +11 -0
  1080. package/scripts/vps/pull.mjs +156 -0
  1081. package/scripts/vps/rebuild.sh +531 -0
  1082. package/scripts/vps/restore-check.sh +35 -0
  1083. package/scripts/vps/setup-state.mjs +121 -0
  1084. package/scripts/vps/setup.sh +442 -0
  1085. package/scripts/vps/uptime.sh +26 -0
  1086. package/scripts/vps/wildshard-agent.pub +1 -0
  1087. package/scripts/vps/wildshard-apply.mjs +127 -0
  1088. package/scripts/vps/wildshard-config +211 -0
  1089. package/scripts/vps-harden-proof.sh +117 -0
  1090. package/scripts/vps-rebuild-proof.sh +170 -0
  1091. package/scripts/warm-native-chrome.d.mts +6 -0
  1092. package/scripts/warm-native-chrome.mjs +75 -0
  1093. package/scripts/webkit-mem-reading.mjs +157 -0
  1094. package/scripts/webkit-render-smoke.mjs +145 -0
  1095. package/scripts/worker-bootstrap-proof.mjs +79 -0
  1096. package/scripts/worker-client-death-return.mjs +97 -0
  1097. package/scripts/worker-client-death.mjs +67 -0
  1098. package/scripts/worker-client-fights.mjs +1438 -0
  1099. package/scripts/worker-client-grid-entry.mjs +239 -0
  1100. package/scripts/worker-client-hurt.mjs +92 -0
  1101. package/scripts/worker-client-moments.mjs +340 -0
  1102. package/scripts/worker-client-partner.mjs +93 -0
  1103. package/scripts/worker-client-pine-durable.mjs +102 -0
  1104. package/scripts/worker-client-pine-grid.mjs +77 -0
  1105. package/scripts/worker-client-pine-import.mjs +93 -0
  1106. package/scripts/worker-client-pine.mjs +114 -0
  1107. package/scripts/worker-client-play.mjs +572 -0
  1108. package/scripts/worker-client-proof.mjs +201 -0
  1109. package/scripts/worker-client-repairs.mjs +108 -0
  1110. package/scripts/worker-client-returns.mjs +51 -0
  1111. package/scripts/worker-client-saves.mjs +146 -0
  1112. package/scripts/worker-client-windup.mjs +50 -0
  1113. package/scripts/worktree-ignore.d.mts +4 -0
  1114. package/scripts/worktree-ignore.mjs +36 -0
  1115. package/scripts/worktree-reap.mjs +214 -0
  1116. package/scripts/worktree.mjs +339 -0
  1117. package/src/.oxfmtrc.json +48 -0
  1118. package/src/.oxlintrc.json +190 -0
  1119. package/src/cli/main.ts +112 -0
  1120. package/src/cli/version.ts +13 -0
  1121. package/src/client/app/assetTables.ts +68 -0
  1122. package/src/client/app/bootDownloads.ts +43 -0
  1123. package/src/client/app/bootRoute.ts +27 -0
  1124. package/src/client/app/calibrate.ts +9 -0
  1125. package/src/client/app/dropModal.ts +99 -0
  1126. package/src/client/app/entry.ts +439 -0
  1127. package/src/client/app/failScreens.ts +561 -0
  1128. package/src/client/app/identity.ts +10 -0
  1129. package/src/client/app/main.ts +3 -0
  1130. package/src/client/app/pageServices.ts +20 -0
  1131. package/src/client/app/selectedManifests.ts +31 -0
  1132. package/src/client/app/shardSelection.ts +46 -0
  1133. package/src/client/app/titleSettings.ts +15 -0
  1134. package/src/client/app.tsx +53 -0
  1135. package/src/client/engine/ai/view/eliteController.ts +148 -0
  1136. package/src/client/engine/ai/view/eliteEntry.ts +464 -0
  1137. package/src/client/engine/aliasFixture.webp +0 -0
  1138. package/src/client/engine/anim/channel.ts +58 -0
  1139. package/src/client/engine/anim/machine.ts +77 -0
  1140. package/src/client/engine/anim/rig.ts +150 -0
  1141. package/src/client/engine/anim/rigAtlas.ts +73 -0
  1142. package/src/client/engine/anim/rigParser.ts +59 -0
  1143. package/src/client/engine/app/app.ts +262 -0
  1144. package/src/client/engine/app/assets.ts +122 -0
  1145. package/src/client/engine/app/cachedAssets.ts +116 -0
  1146. package/src/client/engine/app/disposalCache.ts +30 -0
  1147. package/src/client/engine/app/runtime.ts +16 -0
  1148. package/src/client/engine/app/sceneOwnership.ts +317 -0
  1149. package/src/client/engine/app/services.ts +20 -0
  1150. package/src/client/engine/app/systems.ts +71 -0
  1151. package/src/client/engine/app/ui.ts +33 -0
  1152. package/src/client/engine/app/view/frameScheduler.ts +65 -0
  1153. package/src/client/engine/app/view/pageActivity.ts +12 -0
  1154. package/src/client/engine/app/view/presentation.ts +41 -0
  1155. package/src/client/engine/app/view/presentationLoop.ts +56 -0
  1156. package/src/client/engine/app/view/scopeEnvironment.ts +39 -0
  1157. package/src/client/engine/app/workerScope.js +20 -0
  1158. package/src/client/engine/audio/AmbienceBeds.ts +197 -0
  1159. package/src/client/engine/audio/Audio.ts +634 -0
  1160. package/src/client/engine/audio/Cues.ts +153 -0
  1161. package/src/client/engine/audio/Music.ts +958 -0
  1162. package/src/client/engine/audio/SetScore.ts +297 -0
  1163. package/src/client/engine/audio/Stems.ts +277 -0
  1164. package/src/client/engine/audio/Voices.ts +299 -0
  1165. package/src/client/engine/audio/aacNative.ts +46 -0
  1166. package/src/client/engine/audio/aacPull.ts +166 -0
  1167. package/src/client/engine/audio/aacSource.ts +122 -0
  1168. package/src/client/engine/audio/aacTrack.ts +115 -0
  1169. package/src/client/engine/audio/aacWindows.ts +66 -0
  1170. package/src/client/engine/audio/activity.ts +70 -0
  1171. package/src/client/engine/audio/activityTimers.ts +37 -0
  1172. package/src/client/engine/audio/ambience.ts +549 -0
  1173. package/src/client/engine/audio/audioLog.ts +22 -0
  1174. package/src/client/engine/audio/codecs.merge.d.ts +9 -0
  1175. package/src/client/engine/audio/credits.ts +48 -0
  1176. package/src/client/engine/audio/cueRouting.ts +93 -0
  1177. package/src/client/engine/audio/declared.ts +95 -0
  1178. package/src/client/engine/audio/declaredAmbience.ts +113 -0
  1179. package/src/client/engine/audio/declaredBank.ts +104 -0
  1180. package/src/client/engine/audio/declaredGameplay.ts +82 -0
  1181. package/src/client/engine/audio/dsp.ts +164 -0
  1182. package/src/client/engine/audio/gen.ts +538 -0
  1183. package/src/client/engine/audio/interactSfx.ts +95 -0
  1184. package/src/client/engine/audio/levelAudio.ts +131 -0
  1185. package/src/client/engine/audio/loopWindow.ts +24 -0
  1186. package/src/client/engine/audio/ownership.ts +16 -0
  1187. package/src/client/engine/audio/playerVoices.ts +278 -0
  1188. package/src/client/engine/audio/preload.ts +166 -0
  1189. package/src/client/engine/audio/score/score.ts +60 -0
  1190. package/src/client/engine/audio/scoreSelection.ts +19 -0
  1191. package/src/client/engine/audio/surface.ts +71 -0
  1192. package/src/client/engine/audio/synth.ts +301 -0
  1193. package/src/client/engine/audio/unlock.ts +104 -0
  1194. package/src/client/engine/audio/util.ts +95 -0
  1195. package/src/client/engine/blocks.ts +6 -0
  1196. package/src/client/engine/boot/audioFiles.ts +9 -0
  1197. package/src/client/engine/boot/audioInventory.ts +34 -0
  1198. package/src/client/engine/boot/audioPack.ts +54 -0
  1199. package/src/client/engine/boot/bakedApi.ts +46 -0
  1200. package/src/client/engine/boot/bakedTextures.ts +114 -0
  1201. package/src/client/engine/boot/bootCache.ts +16 -0
  1202. package/src/client/engine/boot/bootTrace.ts +362 -0
  1203. package/src/client/engine/boot/browserChunkRecovery.ts +136 -0
  1204. package/src/client/engine/boot/bytes.ts +272 -0
  1205. package/src/client/engine/boot/catalog.ts +35 -0
  1206. package/src/client/engine/boot/chunkRecovery.ts +41 -0
  1207. package/src/client/engine/boot/clearDownloads.ts +128 -0
  1208. package/src/client/engine/boot/contentBase.ts +77 -0
  1209. package/src/client/engine/boot/contentRead.ts +151 -0
  1210. package/src/client/engine/boot/diagnostics.ts +195 -0
  1211. package/src/client/engine/boot/download.ts +112 -0
  1212. package/src/client/engine/boot/dropNotice.ts +260 -0
  1213. package/src/client/engine/boot/earlyPrograms.ts +123 -0
  1214. package/src/client/engine/boot/extras.ts +324 -0
  1215. package/src/client/engine/boot/filePolicy.ts +126 -0
  1216. package/src/client/engine/boot/firstPlayMark.ts +43 -0
  1217. package/src/client/engine/boot/gpuFiles.ts +176 -0
  1218. package/src/client/engine/boot/gpuTrace.ts +42 -0
  1219. package/src/client/engine/boot/idle.ts +52 -0
  1220. package/src/client/engine/boot/imageDecode.ts +95 -0
  1221. package/src/client/engine/boot/imageDecode.worker.ts +69 -0
  1222. package/src/client/engine/boot/ktx2.generated.ts +157 -0
  1223. package/src/client/engine/boot/lastEnd.ts +312 -0
  1224. package/src/client/engine/boot/leaveAfterPaint.ts +16 -0
  1225. package/src/client/engine/boot/liveJsonParser.ts +124 -0
  1226. package/src/client/engine/boot/liveJsonParser.worker.ts +22 -0
  1227. package/src/client/engine/boot/loadingDownloadText.ts +54 -0
  1228. package/src/client/engine/boot/loadingPacks.ts +18 -0
  1229. package/src/client/engine/boot/lowPower.ts +96 -0
  1230. package/src/client/engine/boot/manifest.ts +12 -0
  1231. package/src/client/engine/boot/pack.ts +180 -0
  1232. package/src/client/engine/boot/parsedPages.ts +115 -0
  1233. package/src/client/engine/boot/perflog.ts +15 -0
  1234. package/src/client/engine/boot/plan.ts +256 -0
  1235. package/src/client/engine/boot/prefetch.ts +188 -0
  1236. package/src/client/engine/boot/prefetchQuota.ts +84 -0
  1237. package/src/client/engine/boot/readContentResponse.ts +17 -0
  1238. package/src/client/engine/boot/retry.ts +14 -0
  1239. package/src/client/engine/boot/runtime.ts +21 -0
  1240. package/src/client/engine/boot/shardPrefetch.ts +278 -0
  1241. package/src/client/engine/boot/shell.ts +135 -0
  1242. package/src/client/engine/boot/stuck.ts +106 -0
  1243. package/src/client/engine/boot/stuckStep.ts +99 -0
  1244. package/src/client/engine/boot/sw.ts +385 -0
  1245. package/src/client/engine/boot/swGlobal.d.ts +9 -0
  1246. package/src/client/engine/boot/texturePack.ts +182 -0
  1247. package/src/client/engine/boot/timeLeft.ts +106 -0
  1248. package/src/client/engine/boot/titleArrival.ts +101 -0
  1249. package/src/client/engine/boot/weights.ts +21 -0
  1250. package/src/client/engine/boot.ts +51 -0
  1251. package/src/client/engine/build.d.ts +2 -0
  1252. package/src/client/engine/calibrate/entry.ts +29 -0
  1253. package/src/client/engine/calibrate/js.ts +39 -0
  1254. package/src/client/engine/calibrate/math.ts +23 -0
  1255. package/src/client/engine/calibrate/run.ts +93 -0
  1256. package/src/client/engine/calibrate/wasm.ts +154 -0
  1257. package/src/client/engine/combat/EquipmentService.ts +412 -0
  1258. package/src/client/engine/combat/cues.ts +46 -0
  1259. package/src/client/engine/combat/types.ts +21 -0
  1260. package/src/client/engine/combat/view/Bow.ts +462 -0
  1261. package/src/client/engine/combat/view/DropArc.ts +64 -0
  1262. package/src/client/engine/combat/view/EquipmentHost.ts +15 -0
  1263. package/src/client/engine/combat/view/SweptMelee.ts +691 -0
  1264. package/src/client/engine/combat/view/bowProfile.ts +182 -0
  1265. package/src/client/engine/combat/view/brass.ts +65 -0
  1266. package/src/client/engine/combat/view/firearmFx.ts +25 -0
  1267. package/src/client/engine/combat/view/hitscan.ts +29 -0
  1268. package/src/client/engine/combat/view/melee.ts +67 -0
  1269. package/src/client/engine/combat/view/projectedTrail.ts +42 -0
  1270. package/src/client/engine/combat/view/projectile.ts +315 -0
  1271. package/src/client/engine/combat/view/ranged.ts +460 -0
  1272. package/src/client/engine/combat/view/rangedFeel.ts +39 -0
  1273. package/src/client/engine/combat/view/slashTrail.ts +151 -0
  1274. package/src/client/engine/core/Game.ts +1833 -0
  1275. package/src/client/engine/core/GpuRecovery.ts +200 -0
  1276. package/src/client/engine/core/Grade.ts +109 -0
  1277. package/src/client/engine/core/KeepAlive.ts +32 -0
  1278. package/src/client/engine/core/Tour.ts +46 -0
  1279. package/src/client/engine/core/Volumetrics.ts +260 -0
  1280. package/src/client/engine/core/apiOrigin.ts +12 -0
  1281. package/src/client/engine/core/assets.ts +292 -0
  1282. package/src/client/engine/core/bootstrap.ts +175 -0
  1283. package/src/client/engine/core/crashFlag.ts +32 -0
  1284. package/src/client/engine/core/crossroads.ts +4 -0
  1285. package/src/client/engine/core/deflate.ts +110 -0
  1286. package/src/client/engine/core/devMode.ts +49 -0
  1287. package/src/client/engine/core/devPixels.ts +62 -0
  1288. package/src/client/engine/core/drawBudget.ts +48 -0
  1289. package/src/client/engine/core/errorReport.ts +248 -0
  1290. package/src/client/engine/core/gpuOnly.ts +139 -0
  1291. package/src/client/engine/core/graphicsMode.ts +62 -0
  1292. package/src/client/engine/core/graphicsQuality.ts +117 -0
  1293. package/src/client/engine/core/heldTiming.ts +24 -0
  1294. package/src/client/engine/core/ktx2.ts +511 -0
  1295. package/src/client/engine/core/ktx2Sources.ts +22 -0
  1296. package/src/client/engine/core/ktx2Zstd.ts +151 -0
  1297. package/src/client/engine/core/ktx2Zstd.worker.ts +31 -0
  1298. package/src/client/engine/core/practiceRoom.ts +16 -0
  1299. package/src/client/engine/core/reloadGuard.ts +21 -0
  1300. package/src/client/engine/core/scopedCpu.ts +49 -0
  1301. package/src/client/engine/core/scopedWorkerPool.ts +55 -0
  1302. package/src/client/engine/core/shadowLayer.ts +8 -0
  1303. package/src/client/engine/core/slowGpuPacing.ts +118 -0
  1304. package/src/client/engine/core/sustainedFrames.ts +73 -0
  1305. package/src/client/engine/core/tier.ts +126 -0
  1306. package/src/client/engine/core/viewport.ts +130 -0
  1307. package/src/client/engine/core/webglStartup.ts +50 -0
  1308. package/src/client/engine/core/worldDepth.ts +183 -0
  1309. package/src/client/engine/core/zstdFrame.ts +38 -0
  1310. package/src/client/engine/debug/probe.ts +560 -0
  1311. package/src/client/engine/debug/timerBaseline.ts +14 -0
  1312. package/src/client/engine/entities/AnimalFactory.ts +766 -0
  1313. package/src/client/engine/entities/AnimalHerdView.ts +413 -0
  1314. package/src/client/engine/entities/AnimalView.ts +583 -0
  1315. package/src/client/engine/entities/RowBodies.ts +276 -0
  1316. package/src/client/engine/entities/animalMatrices.ts +179 -0
  1317. package/src/client/engine/entities/animalShadow.ts +58 -0
  1318. package/src/client/engine/entities/animalShells.ts +14 -0
  1319. package/src/client/engine/entities/farHerd.ts +469 -0
  1320. package/src/client/engine/entities/lowpoly.ts +155 -0
  1321. package/src/client/engine/entities/species/loft.ts +253 -0
  1322. package/src/client/engine/entities/species/look.ts +122 -0
  1323. package/src/client/engine/events/maps.ts +58 -0
  1324. package/src/client/engine/explore/Compare.ts +126 -0
  1325. package/src/client/engine/explore/Explore.ts +648 -0
  1326. package/src/client/engine/explore/FreeCam.ts +280 -0
  1327. package/src/client/engine/explore/MiniMap.ts +283 -0
  1328. package/src/client/engine/explore/ModelExplorer.ts +1155 -0
  1329. package/src/client/engine/explore/Select.ts +176 -0
  1330. package/src/client/engine/explore/SetExplorer.ts +553 -0
  1331. package/src/client/engine/explore/TouchFly.ts +236 -0
  1332. package/src/client/engine/explore/catalog.ts +159 -0
  1333. package/src/client/engine/explore/diorama.ts +245 -0
  1334. package/src/client/engine/explore/fatLines.ts +47 -0
  1335. package/src/client/engine/explore/img/mockups/nalati-camp-live.jpg +0 -0
  1336. package/src/client/engine/explore/img/mockups/nalati-camp-target.jpg +0 -0
  1337. package/src/client/engine/explore/img/mockups/nalati-gully-live.jpg +0 -0
  1338. package/src/client/engine/explore/img/mockups/nalati-gully-target.jpg +0 -0
  1339. package/src/client/engine/explore/img/mockups/nalati-rail-live.jpg +0 -0
  1340. package/src/client/engine/explore/img/mockups/nalati-rail-target.jpg +0 -0
  1341. package/src/client/engine/explore/img/mockups/nine-gate-live.jpg +0 -0
  1342. package/src/client/engine/explore/img/mockups/nine-gate-target.jpg +0 -0
  1343. package/src/client/engine/explore/img/mockups/nine-stair-live.jpg +0 -0
  1344. package/src/client/engine/explore/img/mockups/nine-stair-target.jpg +0 -0
  1345. package/src/client/engine/explore/pick.ts +120 -0
  1346. package/src/client/engine/explore/registry.ts +16 -0
  1347. package/src/client/engine/explore/setView.ts +222 -0
  1348. package/src/client/engine/explore/tiers.ts +27 -0
  1349. package/src/client/engine/explore/viewPoint.ts +100 -0
  1350. package/src/client/engine/fx/Impacts.ts +154 -0
  1351. package/src/client/engine/fx/LightPool.ts +188 -0
  1352. package/src/client/engine/fx/ParticlePool.ts +76 -0
  1353. package/src/client/engine/fx/SiteLights.ts +119 -0
  1354. package/src/client/engine/fx/effectField.ts +91 -0
  1355. package/src/client/engine/fx/groundFx.ts +144 -0
  1356. package/src/client/engine/fx/groundTell.ts +101 -0
  1357. package/src/client/engine/fx/lightEmitters.ts +35 -0
  1358. package/src/client/engine/input/ControlsPanel.ts +108 -0
  1359. package/src/client/engine/input/InputService.ts +394 -0
  1360. package/src/client/engine/input/bindingTable.ts +124 -0
  1361. package/src/client/engine/input/bindings.ts +101 -0
  1362. package/src/client/engine/input/dom.ts +62 -0
  1363. package/src/client/engine/input/equipmentInput.ts +4 -0
  1364. package/src/client/engine/input/gameplay.ts +36 -0
  1365. package/src/client/engine/input/keycap.ts +25 -0
  1366. package/src/client/engine/input/menuInput.ts +7 -0
  1367. package/src/client/engine/input/platform.ts +36 -0
  1368. package/src/client/engine/input/weaponActions.ts +8 -0
  1369. package/src/client/engine/level/frame.ts +95 -0
  1370. package/src/client/engine/level/installation.ts +107 -0
  1371. package/src/client/engine/level/load.ts +97 -0
  1372. package/src/client/engine/level/registrations.ts +59 -0
  1373. package/src/client/engine/math/color.ts +6 -0
  1374. package/src/client/engine/models/animalGeometry.ts +29 -0
  1375. package/src/client/engine/models/castawayBody.ts +257 -0
  1376. package/src/client/engine/models/colliders.ts +186 -0
  1377. package/src/client/engine/models/creature.ts +66 -0
  1378. package/src/client/engine/models/cull.ts +953 -0
  1379. package/src/client/engine/models/gear.ts +87 -0
  1380. package/src/client/engine/models/geometryPack.ts +14 -0
  1381. package/src/client/engine/models/hoverboard.ts +29 -0
  1382. package/src/client/engine/models/instancedBatch.ts +324 -0
  1383. package/src/client/engine/models/interact.ts +26 -0
  1384. package/src/client/engine/models/live.ts +174 -0
  1385. package/src/client/engine/models/model.ts +449 -0
  1386. package/src/client/engine/models/modelPose.ts +14 -0
  1387. package/src/client/engine/models/nativeGeometry.ts +114 -0
  1388. package/src/client/engine/models/ownedGeometry.ts +294 -0
  1389. package/src/client/engine/models/place.ts +1476 -0
  1390. package/src/client/engine/models/roster.ts +44 -0
  1391. package/src/client/engine/models/sets.ts +74 -0
  1392. package/src/client/engine/models/slots.ts +69 -0
  1393. package/src/client/engine/models/staticSets.ts +119 -0
  1394. package/src/client/engine/models/swimHands.ts +44 -0
  1395. package/src/client/engine/models/trainingDummy.ts +46 -0
  1396. package/src/client/engine/models/trainingDummyFigure.ts +16 -0
  1397. package/src/client/engine/models/weld.ts +260 -0
  1398. package/src/client/engine/net/attackPrediction.ts +38 -0
  1399. package/src/client/engine/net/client.ts +314 -0
  1400. package/src/client/engine/net/heldOnOthers.ts +167 -0
  1401. package/src/client/engine/net/hurtOther.ts +12 -0
  1402. package/src/client/engine/net/interpolator.ts +179 -0
  1403. package/src/client/engine/net/nameTag.ts +88 -0
  1404. package/src/client/engine/net/netClock.ts +90 -0
  1405. package/src/client/engine/net/netPlayer.ts +265 -0
  1406. package/src/client/engine/net/netRecord.ts +43 -0
  1407. package/src/client/engine/net/onRep.ts +75 -0
  1408. package/src/client/engine/net/otherPlayers.ts +239 -0
  1409. package/src/client/engine/net/othersOnMap.ts +80 -0
  1410. package/src/client/engine/net/predictionWorld.ts +100 -0
  1411. package/src/client/engine/net/predictor.ts +233 -0
  1412. package/src/client/engine/net/redial.ts +179 -0
  1413. package/src/client/engine/net/remoteAir.ts +134 -0
  1414. package/src/client/engine/net/remoteBoard.ts +128 -0
  1415. package/src/client/engine/net/remoteDeath.ts +140 -0
  1416. package/src/client/engine/net/remoteGait.ts +114 -0
  1417. package/src/client/engine/net/remoteHurt.ts +123 -0
  1418. package/src/client/engine/net/remoteStrike.ts +160 -0
  1419. package/src/client/engine/net/voiceNear.ts +55 -0
  1420. package/src/client/engine/net/webSocketTransport.ts +91 -0
  1421. package/src/client/engine/physics/active.ts +15 -0
  1422. package/src/client/engine/physics/boxFrame.ts +15 -0
  1423. package/src/client/engine/physics/calibration.ts +31 -0
  1424. package/src/client/engine/physics/debug.ts +68 -0
  1425. package/src/client/engine/physics/navmeshLoad.ts +86 -0
  1426. package/src/client/engine/physics/ragdoll.ts +513 -0
  1427. package/src/client/engine/physics/ropeDeck.ts +112 -0
  1428. package/src/client/engine/player/AimAssist.ts +183 -0
  1429. package/src/client/engine/player/AimTargets.ts +55 -0
  1430. package/src/client/engine/player/CameraFX.ts +89 -0
  1431. package/src/client/engine/player/Hands.ts +216 -0
  1432. package/src/client/engine/player/LockOnTarget.ts +395 -0
  1433. package/src/client/engine/player/Player.ts +678 -0
  1434. package/src/client/engine/player/Skins.ts +109 -0
  1435. package/src/client/engine/player/TouchControls.ts +564 -0
  1436. package/src/client/engine/player/WaterLine.ts +94 -0
  1437. package/src/client/engine/player/WeaponPickup.ts +465 -0
  1438. package/src/client/engine/player/bladeGlow.ts +120 -0
  1439. package/src/client/engine/player/firstPersonArms.ts +384 -0
  1440. package/src/client/engine/player/heldHandParts.ts +91 -0
  1441. package/src/client/engine/player/viewmodelSources.ts +25 -0
  1442. package/src/client/engine/player/viewmodelTextures.ts +261 -0
  1443. package/src/client/engine/player/viewmodelTextures.worker.ts +28 -0
  1444. package/src/client/engine/practice/DummyClips.ts +100 -0
  1445. package/src/client/engine/practice/DummyMotion.ts +287 -0
  1446. package/src/client/engine/practice/DummyStudio.ts +137 -0
  1447. package/src/client/engine/practice/TrainingArena.ts +463 -0
  1448. package/src/client/engine/practice/TrainingDummy.ts +160 -0
  1449. package/src/client/engine/practice/TrainingDummyAssets.ts +80 -0
  1450. package/src/client/engine/practice/arena.css +20 -0
  1451. package/src/client/engine/practice/dummyMetadata.ts +12 -0
  1452. package/src/client/engine/practice/lineup.ts +17 -0
  1453. package/src/client/engine/practice/playground/Playground.ts +52 -0
  1454. package/src/client/engine/practice/playground/catalog.ts +44 -0
  1455. package/src/client/engine/practice/playground/devGrid.ts +173 -0
  1456. package/src/client/engine/practice/playground/hud.ts +80 -0
  1457. package/src/client/engine/practice/playground/load.ts +24 -0
  1458. package/src/client/engine/practice/practiceLoan.ts +52 -0
  1459. package/src/client/engine/practice/targets.ts +15 -0
  1460. package/src/client/engine/pwa/cacheNames.ts +2 -0
  1461. package/src/client/engine/pwa/sw.js +401 -0
  1462. package/src/client/engine/quest/view/replica.ts +88 -0
  1463. package/src/client/engine/quest/view/ui.ts +221 -0
  1464. package/src/client/engine/quest/view.ts +209 -0
  1465. package/src/client/engine/render/allocationBytes.ts +16 -0
  1466. package/src/client/engine/render/allocationJournal.ts +125 -0
  1467. package/src/client/engine/render/aoTransparency.ts +225 -0
  1468. package/src/client/engine/render/budgetReport.ts +53 -0
  1469. package/src/client/engine/render/budgets.ts +72 -0
  1470. package/src/client/engine/render/calibration.ts +32 -0
  1471. package/src/client/engine/render/calibrationGpu.ts +84 -0
  1472. package/src/client/engine/render/changedTextureUploads.ts +118 -0
  1473. package/src/client/engine/render/compileLights.ts +75 -0
  1474. package/src/client/engine/render/compileShadows.ts +29 -0
  1475. package/src/client/engine/render/composerDepth.ts +26 -0
  1476. package/src/client/engine/render/compressedMipmaps.ts +59 -0
  1477. package/src/client/engine/render/compressedTextureRetirement.ts +71 -0
  1478. package/src/client/engine/render/compressedUpload.ts +107 -0
  1479. package/src/client/engine/render/contextErrors.ts +14 -0
  1480. package/src/client/engine/render/dataLook.ts +691 -0
  1481. package/src/client/engine/render/desktopReference.ts +5 -0
  1482. package/src/client/engine/render/diagnosticJournal.ts +23 -0
  1483. package/src/client/engine/render/displayColour.ts +55 -0
  1484. package/src/client/engine/render/doubleElements.ts +33 -0
  1485. package/src/client/engine/render/drawGuards.ts +47 -0
  1486. package/src/client/engine/render/drawHooks.ts +265 -0
  1487. package/src/client/engine/render/drawNeutral.ts +19 -0
  1488. package/src/client/engine/render/drawnEnvironment.ts +35 -0
  1489. package/src/client/engine/render/entryWarmupBound.ts +19 -0
  1490. package/src/client/engine/render/families/emissive.ts +224 -0
  1491. package/src/client/engine/render/families/ground.ts +291 -0
  1492. package/src/client/engine/render/families/measure.ts +191 -0
  1493. package/src/client/engine/render/families/paintedTerrain.ts +388 -0
  1494. package/src/client/engine/render/families/painterly.ts +288 -0
  1495. package/src/client/engine/render/families/pbr.ts +67 -0
  1496. package/src/client/engine/render/families/registry.ts +140 -0
  1497. package/src/client/engine/render/families/toon.ts +193 -0
  1498. package/src/client/engine/render/fencedUnits.ts +115 -0
  1499. package/src/client/engine/render/firstFrameParts.ts +95 -0
  1500. package/src/client/engine/render/fogPatches.ts +56 -0
  1501. package/src/client/engine/render/frameCounter.ts +47 -0
  1502. package/src/client/engine/render/frameDrawRange.ts +120 -0
  1503. package/src/client/engine/render/gltfMaterialOrder.ts +83 -0
  1504. package/src/client/engine/render/gpuClasses.ts +29 -0
  1505. package/src/client/engine/render/gpuLabels.ts +437 -0
  1506. package/src/client/engine/render/graph/colourFunction.ts +83 -0
  1507. package/src/client/engine/render/graph/glsl.ts +1056 -0
  1508. package/src/client/engine/render/graph/glslCodec.ts +48 -0
  1509. package/src/client/engine/render/graph/glslMaterial.ts +463 -0
  1510. package/src/client/engine/render/graph/glslPost.ts +79 -0
  1511. package/src/client/engine/render/graph/glslProgram.ts +698 -0
  1512. package/src/client/engine/render/graph/presets.ts +812 -0
  1513. package/src/client/engine/render/graph/viewRay.ts +28 -0
  1514. package/src/client/engine/render/graphBackend.ts +176 -0
  1515. package/src/client/engine/render/hoverboardGeometry.ts +54 -0
  1516. package/src/client/engine/render/instancedGeometry.ts +28 -0
  1517. package/src/client/engine/render/instancedTwin.ts +40 -0
  1518. package/src/client/engine/render/ktx2Probe.ts +299 -0
  1519. package/src/client/engine/render/layeredMaps.ts +64 -0
  1520. package/src/client/engine/render/lightUniforms.ts +22 -0
  1521. package/src/client/engine/render/lighterTargets.ts +47 -0
  1522. package/src/client/engine/render/lightmaps.ts +36 -0
  1523. package/src/client/engine/render/look.ts +406 -0
  1524. package/src/client/engine/render/lookLight.ts +107 -0
  1525. package/src/client/engine/render/lut.ts +23 -0
  1526. package/src/client/engine/render/memoryImages.ts +31 -0
  1527. package/src/client/engine/render/memorySaver.ts +262 -0
  1528. package/src/client/engine/render/offscreenBuild.ts +184 -0
  1529. package/src/client/engine/render/offscreenPreparation.ts +41 -0
  1530. package/src/client/engine/render/parkedDraws.ts +920 -0
  1531. package/src/client/engine/render/pmremSize.ts +21 -0
  1532. package/src/client/engine/render/postPreparation.ts +67 -0
  1533. package/src/client/engine/render/precompile.ts +1833 -0
  1534. package/src/client/engine/render/programRetention.ts +125 -0
  1535. package/src/client/engine/render/readbackPreparation.ts +23 -0
  1536. package/src/client/engine/render/regionCinematic.ts +212 -0
  1537. package/src/client/engine/render/regionLook.ts +301 -0
  1538. package/src/client/engine/render/releasedArrays.ts +13 -0
  1539. package/src/client/engine/render/renderer.ts +68 -0
  1540. package/src/client/engine/render/scatterInstances.ts +139 -0
  1541. package/src/client/engine/render/scenePreparation.ts +27 -0
  1542. package/src/client/engine/render/shaderPatches.ts +303 -0
  1543. package/src/client/engine/render/shaderText.ts +95 -0
  1544. package/src/client/engine/render/shadowDepthVariants.ts +35 -0
  1545. package/src/client/engine/render/shadowMaterialOwnership.ts +120 -0
  1546. package/src/client/engine/render/skinnedSpheres.ts +30 -0
  1547. package/src/client/engine/render/skyEnvironment.ts +222 -0
  1548. package/src/client/engine/render/staticMatrices.ts +88 -0
  1549. package/src/client/engine/render/streamedInstances.ts +184 -0
  1550. package/src/client/engine/render/textureBytes.ts +185 -0
  1551. package/src/client/engine/render/textureUploadEvents.ts +60 -0
  1552. package/src/client/engine/render/tierBenchmark.ts +54 -0
  1553. package/src/client/engine/render/tierBoot.ts +50 -0
  1554. package/src/client/engine/render/tierSelect.ts +27 -0
  1555. package/src/client/engine/render/tiers.ts +78 -0
  1556. package/src/client/engine/render/uniformCaches.ts +143 -0
  1557. package/src/client/engine/render/uploadOwnership.ts +335 -0
  1558. package/src/client/engine/render/viewmodel.ts +114 -0
  1559. package/src/client/engine/render/viewmodelFeel.ts +374 -0
  1560. package/src/client/engine/saves/indexed.ts +250 -0
  1561. package/src/client/engine/saves/slots.ts +42 -0
  1562. package/src/client/engine/saves/view/storage.ts +11 -0
  1563. package/src/client/engine/script/client.ts +240 -0
  1564. package/src/client/engine/telemetry/bootInbox.ts +18 -0
  1565. package/src/client/engine/telemetry/browserErrors.ts +173 -0
  1566. package/src/client/engine/telemetry/crossroads.ts +26 -0
  1567. package/src/client/engine/telemetry/health.ts +40 -0
  1568. package/src/client/engine/telemetry/model.ts +36 -0
  1569. package/src/client/engine/telemetry/runtime.ts +62 -0
  1570. package/src/client/engine/types/meshopt-simplifier.d.ts +10 -0
  1571. package/src/client/engine/types/n8ao.d.ts +52 -0
  1572. package/src/client/engine/ui/BootSettings.ts +97 -0
  1573. package/src/client/engine/ui/BossBar.ts +141 -0
  1574. package/src/client/engine/ui/Combat.ts +299 -0
  1575. package/src/client/engine/ui/DeathFade.ts +104 -0
  1576. package/src/client/engine/ui/DebugMenu.ts +199 -0
  1577. package/src/client/engine/ui/EliteBar.ts +219 -0
  1578. package/src/client/engine/ui/ErrorModal.ts +309 -0
  1579. package/src/client/engine/ui/Feedback.ts +346 -0
  1580. package/src/client/engine/ui/FirstHints.ts +279 -0
  1581. package/src/client/engine/ui/HUD.ts +714 -0
  1582. package/src/client/engine/ui/HurtArc.ts +102 -0
  1583. package/src/client/engine/ui/ItemCard.ts +95 -0
  1584. package/src/client/engine/ui/KeyHelp.ts +59 -0
  1585. package/src/client/engine/ui/Loading.ts +851 -0
  1586. package/src/client/engine/ui/LockOn.ts +131 -0
  1587. package/src/client/engine/ui/Map.ts +280 -0
  1588. package/src/client/engine/ui/Menu.ts +438 -0
  1589. package/src/client/engine/ui/Minimap.ts +840 -0
  1590. package/src/client/engine/ui/Perf.ts +356 -0
  1591. package/src/client/engine/ui/ReloadPrompt.ts +42 -0
  1592. package/src/client/engine/ui/RotateGate.ts +40 -0
  1593. package/src/client/engine/ui/SavePanel.ts +62 -0
  1594. package/src/client/engine/ui/Settings.ts +277 -0
  1595. package/src/client/engine/ui/SpeedLines.ts +46 -0
  1596. package/src/client/engine/ui/StartTitle.ts +39 -0
  1597. package/src/client/engine/ui/ToastStack.ts +90 -0
  1598. package/src/client/engine/ui/Update.ts +116 -0
  1599. package/src/client/engine/ui/WeaponStrip.ts +272 -0
  1600. package/src/client/engine/ui/WindupWarn.ts +116 -0
  1601. package/src/client/engine/ui/authoredDebugRows.ts +3 -0
  1602. package/src/client/engine/ui/buildCheck.ts +72 -0
  1603. package/src/client/engine/ui/buildRow.ts +71 -0
  1604. package/src/client/engine/ui/cards.ts +41 -0
  1605. package/src/client/engine/ui/debugOptions.ts +230 -0
  1606. package/src/client/engine/ui/declared.ts +89 -0
  1607. package/src/client/engine/ui/devSwitch.ts +48 -0
  1608. package/src/client/engine/ui/developerBanner.ts +32 -0
  1609. package/src/client/engine/ui/diagnosticsCopy.ts +20 -0
  1610. package/src/client/engine/ui/drawBudgetCounter.ts +10 -0
  1611. package/src/client/engine/ui/errorScreen.ts +109 -0
  1612. package/src/client/engine/ui/frameWindow.ts +50 -0
  1613. package/src/client/engine/ui/graphicsBlock.ts +156 -0
  1614. package/src/client/engine/ui/graphicsControls.ts +47 -0
  1615. package/src/client/engine/ui/haptics.ts +28 -0
  1616. package/src/client/engine/ui/hoverBoost.ts +61 -0
  1617. package/src/client/engine/ui/hudAdapters.ts +61 -0
  1618. package/src/client/engine/ui/hudSlots.ts +130 -0
  1619. package/src/client/engine/ui/icons.ts +62 -0
  1620. package/src/client/engine/ui/layers.ts +134 -0
  1621. package/src/client/engine/ui/leaveGuard.ts +64 -0
  1622. package/src/client/engine/ui/loadProgress.ts +67 -0
  1623. package/src/client/engine/ui/loading.css +125 -0
  1624. package/src/client/engine/ui/lookLightOption.ts +22 -0
  1625. package/src/client/engine/ui/mapLabel.ts +18 -0
  1626. package/src/client/engine/ui/mapPainter.ts +395 -0
  1627. package/src/client/engine/ui/menuSettings.ts +188 -0
  1628. package/src/client/engine/ui/namePrompt.ts +138 -0
  1629. package/src/client/engine/ui/offlineDownload.ts +83 -0
  1630. package/src/client/engine/ui/ownership.ts +14 -0
  1631. package/src/client/engine/ui/panel.ts +166 -0
  1632. package/src/client/engine/ui/perf.css +93 -0
  1633. package/src/client/engine/ui/perfDock.ts +61 -0
  1634. package/src/client/engine/ui/perfHud.ts +332 -0
  1635. package/src/client/engine/ui/perfLap.ts +206 -0
  1636. package/src/client/engine/ui/perfLapSummary.ts +92 -0
  1637. package/src/client/engine/ui/perfProbe.ts +280 -0
  1638. package/src/client/engine/ui/pinKeepOut.ts +59 -0
  1639. package/src/client/engine/ui/playerDeath.ts +16 -0
  1640. package/src/client/engine/ui/playerHurt.ts +70 -0
  1641. package/src/client/engine/ui/playerReload.ts +55 -0
  1642. package/src/client/engine/ui/reloadChip.ts +24 -0
  1643. package/src/client/engine/ui/reloadCover.ts +110 -0
  1644. package/src/client/engine/ui/review.ts +158 -0
  1645. package/src/client/engine/ui/roomMap.ts +109 -0
  1646. package/src/client/engine/ui/saveStrings.ts +9 -0
  1647. package/src/client/engine/ui/settingsTabs.ts +249 -0
  1648. package/src/client/engine/ui/styles/base.css +92 -0
  1649. package/src/client/engine/ui/styles/boss.css +97 -0
  1650. package/src/client/engine/ui/styles/combat.css +100 -0
  1651. package/src/client/engine/ui/styles/debug.css +22 -0
  1652. package/src/client/engine/ui/styles/elite.css +87 -0
  1653. package/src/client/engine/ui/styles/explore.css +435 -0
  1654. package/src/client/engine/ui/styles/feedback.css +63 -0
  1655. package/src/client/engine/ui/styles/game.css +290 -0
  1656. package/src/client/engine/ui/styles/gmenu.css +407 -0
  1657. package/src/client/engine/ui/styles/hints.css +26 -0
  1658. package/src/client/engine/ui/styles/itemcard.css +38 -0
  1659. package/src/client/engine/ui/styles/menu.css +129 -0
  1660. package/src/client/engine/ui/styles/minimap.css +87 -0
  1661. package/src/client/engine/ui/styles/namePrompt.css +27 -0
  1662. package/src/client/engine/ui/styles/playgrounds.css +18 -0
  1663. package/src/client/engine/ui/styles/quest.css +65 -0
  1664. package/src/client/engine/ui/styles/rotate.css +55 -0
  1665. package/src/client/engine/ui/styles/touch.css +303 -0
  1666. package/src/client/engine/ui/styles/update.css +27 -0
  1667. package/src/client/engine/ui/tabs.ts +27 -0
  1668. package/src/client/engine/ui/unstuck.ts +38 -0
  1669. package/src/client/engine/ui/voiceSettings.ts +135 -0
  1670. package/src/client/engine/world/Atmosphere.ts +333 -0
  1671. package/src/client/engine/world/BakedSky.ts +155 -0
  1672. package/src/client/engine/world/Boundary.ts +234 -0
  1673. package/src/client/engine/world/Grass.ts +664 -0
  1674. package/src/client/engine/world/Horizon.ts +237 -0
  1675. package/src/client/engine/world/HorizonMatte.ts +399 -0
  1676. package/src/client/engine/world/Terrain.ts +560 -0
  1677. package/src/client/engine/world/TreeFactory.ts +128 -0
  1678. package/src/client/engine/world/backdropLayer.ts +580 -0
  1679. package/src/client/engine/world/blenderArea.ts +23 -0
  1680. package/src/client/engine/world/bounds.ts +57 -0
  1681. package/src/client/engine/world/cascadeCull.ts +251 -0
  1682. package/src/client/engine/world/cascadeLights.ts +29 -0
  1683. package/src/client/engine/world/cloudField.ts +29 -0
  1684. package/src/client/engine/world/coarseTileMask.ts +100 -0
  1685. package/src/client/engine/world/csmLightBlock.ts +23 -0
  1686. package/src/client/engine/world/declaredProps.ts +226 -0
  1687. package/src/client/engine/world/forest/Forest.ts +378 -0
  1688. package/src/client/engine/world/forest/treeSet.ts +140 -0
  1689. package/src/client/engine/world/forest/treeSpecies.ts +17 -0
  1690. package/src/client/engine/world/frameCamera.ts +58 -0
  1691. package/src/client/engine/world/geometryBake.ts +272 -0
  1692. package/src/client/engine/world/geometryBounds.ts +77 -0
  1693. package/src/client/engine/world/geometryKit.ts +163 -0
  1694. package/src/client/engine/world/hiddenFaces.ts +153 -0
  1695. package/src/client/engine/world/interact/Interactables.ts +690 -0
  1696. package/src/client/engine/world/interact/kit.ts +6 -0
  1697. package/src/client/engine/world/lookFlags.ts +15 -0
  1698. package/src/client/engine/world/lowpolyKit.ts +270 -0
  1699. package/src/client/engine/world/lut.ts +45 -0
  1700. package/src/client/engine/world/painterly.ts +109 -0
  1701. package/src/client/engine/world/pointLightSkip.ts +31 -0
  1702. package/src/client/engine/world/pond.ts +184 -0
  1703. package/src/client/engine/world/pondGrid.ts +5 -0
  1704. package/src/client/engine/world/registry.ts +348 -0
  1705. package/src/client/engine/world/shadowCadence.ts +14 -0
  1706. package/src/client/engine/world/shadowChunks.ts +193 -0
  1707. package/src/client/engine/world/shadowFade.ts +190 -0
  1708. package/src/client/engine/world/shadowFilter.ts +117 -0
  1709. package/src/client/engine/world/shadowVariants.ts +115 -0
  1710. package/src/client/engine/world/skyBackdrop.ts +526 -0
  1711. package/src/client/engine/world/skyRig.ts +577 -0
  1712. package/src/client/engine/world/skyTextures.ts +103 -0
  1713. package/src/client/engine/world/terrainTileView.ts +164 -0
  1714. package/src/client/engine/world/tileStreamer.ts +823 -0
  1715. package/src/client/engine/world/voxelAO.ts +338 -0
  1716. package/src/client/engine/world/water/ripplePixels.ts +51 -0
  1717. package/src/client/engine/world/water/ripples.ts +102 -0
  1718. package/src/client/engine/world/weakShaderMap.ts +58 -0
  1719. package/src/client/engine/world/wind.ts +112 -0
  1720. package/src/client/game/Boss.ts +354 -0
  1721. package/src/client/game/Elite.ts +529 -0
  1722. package/src/client/game/Inventory.ts +123 -0
  1723. package/src/client/game/Progress.ts +166 -0
  1724. package/src/client/game/ambient/ambientFlock.ts +71 -0
  1725. package/src/client/game/ambient/crowdDraw.ts +85 -0
  1726. package/src/client/game/ambient/foragerDraw.ts +56 -0
  1727. package/src/client/game/ambient/pageCrowds.ts +81 -0
  1728. package/src/client/game/ambient/wingField.ts +46 -0
  1729. package/src/client/game/animation/limbCollision.ts +46 -0
  1730. package/src/client/game/animation/limbQueryPose.ts +141 -0
  1731. package/src/client/game/animation/limbQueryView.ts +53 -0
  1732. package/src/client/game/animation/limbView.ts +28 -0
  1733. package/src/client/game/audio/cueDirector.ts +157 -0
  1734. package/src/client/game/audio/forestPage.ts +30 -0
  1735. package/src/client/game/audio/sceneDirector.ts +239 -0
  1736. package/src/client/game/audio/sceneEvents.merge.d.ts +9 -0
  1737. package/src/client/game/audio/theme.ts +229 -0
  1738. package/src/client/game/audio/voicePatches.ts +108 -0
  1739. package/src/client/game/bag/BagButton.ts +85 -0
  1740. package/src/client/game/bag/bag.ts +239 -0
  1741. package/src/client/game/bag/equipment.ts +18 -0
  1742. package/src/client/game/bag/tabs.ts +194 -0
  1743. package/src/client/game/boot/audio.generated.ts +9258 -0
  1744. package/src/client/game/boot/bytes.generated.ts +1643 -0
  1745. package/src/client/game/boot/loadingPaths.ts +121 -0
  1746. package/src/client/game/boot/packs.generated.ts +5 -0
  1747. package/src/client/game/boot/spawnDownload.ts +999 -0
  1748. package/src/client/game/boot/versions.generated.ts +868 -0
  1749. package/src/client/game/boss/arenaFire.ts +135 -0
  1750. package/src/client/game/boss/arenaRoom.ts +715 -0
  1751. package/src/client/game/boss/arenaRoomView.ts +530 -0
  1752. package/src/client/game/boss/barFeed.ts +253 -0
  1753. package/src/client/game/boss/encounterView.ts +463 -0
  1754. package/src/client/game/boss/presentation.ts +18 -0
  1755. package/src/client/game/boss/roamingProjection.ts +255 -0
  1756. package/src/client/game/boss/slotRowsView.ts +95 -0
  1757. package/src/client/game/boss/socketRig.ts +129 -0
  1758. package/src/client/game/boss/timedEncounters.ts +83 -0
  1759. package/src/client/game/combat/roamingSession.ts +107 -0
  1760. package/src/client/game/compendium/Journal.ts +85 -0
  1761. package/src/client/game/compendium/compendium.css +135 -0
  1762. package/src/client/game/compendium/install.ts +181 -0
  1763. package/src/client/game/compendium/journalView.ts +224 -0
  1764. package/src/client/game/compendium/keepsakes.ts +169 -0
  1765. package/src/client/game/compendium/keepsakesView.ts +70 -0
  1766. package/src/client/game/complete/ShardComplete.ts +148 -0
  1767. package/src/client/game/complete/complete.css +71 -0
  1768. package/src/client/game/complete/declared.ts +111 -0
  1769. package/src/client/game/cosmetics/bodyShadow.ts +148 -0
  1770. package/src/client/game/cosmetics/cosmetics.ts +119 -0
  1771. package/src/client/game/cosmetics/locker.ts +88 -0
  1772. package/src/client/game/data/pickupCatalogue.json +1008 -0
  1773. package/src/client/game/debug/browser.d.ts +10 -0
  1774. package/src/client/game/draftTitles.ts +26 -0
  1775. package/src/client/game/eliteView.ts +246 -0
  1776. package/src/client/game/engineStrings.ts +12 -0
  1777. package/src/client/game/equipmentTypes.merge.d.ts +10 -0
  1778. package/src/client/game/firstPlay.css +18 -0
  1779. package/src/client/game/firstPlay.ts +94 -0
  1780. package/src/client/game/generators/pickups.ts +92 -0
  1781. package/src/client/game/grapple/fontPreparation.ts +31 -0
  1782. package/src/client/game/grapple/netClaw.ts +61 -0
  1783. package/src/client/game/grapple/ribbon.ts +159 -0
  1784. package/src/client/game/grapple/tool.ts +478 -0
  1785. package/src/client/game/grid/admissionPriority.ts +41 -0
  1786. package/src/client/game/grid/admissionYield.ts +37 -0
  1787. package/src/client/game/grid/approachProductInputs.ts +72 -0
  1788. package/src/client/game/grid/assetResidency.ts +188 -0
  1789. package/src/client/game/grid/borderShimmer.ts +185 -0
  1790. package/src/client/game/grid/budgetOverlay.css +40 -0
  1791. package/src/client/game/grid/budgetOverlay.ts +238 -0
  1792. package/src/client/game/grid/budgetPoints.ts +184 -0
  1793. package/src/client/game/grid/cellChanges.ts +106 -0
  1794. package/src/client/game/grid/cellClip.ts +611 -0
  1795. package/src/client/game/grid/cellCover.ts +58 -0
  1796. package/src/client/game/grid/cellLoading.ts +89 -0
  1797. package/src/client/game/grid/cellPresence.ts +28 -0
  1798. package/src/client/game/grid/cellScreens.ts +83 -0
  1799. package/src/client/game/grid/copyIdentity.ts +98 -0
  1800. package/src/client/game/grid/copyLayout.ts +153 -0
  1801. package/src/client/game/grid/copyPrompts.ts +31 -0
  1802. package/src/client/game/grid/edgeSources.ts +120 -0
  1803. package/src/client/game/grid/enteredEquipment.ts +65 -0
  1804. package/src/client/game/grid/enteredInteract.ts +43 -0
  1805. package/src/client/game/grid/entryDownloads.ts +45 -0
  1806. package/src/client/game/grid/entryReadPrefetch.ts +64 -0
  1807. package/src/client/game/grid/farImpostorDecodeWorker.ts +32 -0
  1808. package/src/client/game/grid/farImpostorPack.ts +18 -0
  1809. package/src/client/game/grid/farImpostorView.ts +130 -0
  1810. package/src/client/game/grid/farView.ts +235 -0
  1811. package/src/client/game/grid/frame.ts +845 -0
  1812. package/src/client/game/grid/frameLook.ts +215 -0
  1813. package/src/client/game/grid/frameModel.ts +126 -0
  1814. package/src/client/game/grid/gridHud.css +47 -0
  1815. package/src/client/game/grid/gridHud.ts +126 -0
  1816. package/src/client/game/grid/hazeBand.ts +77 -0
  1817. package/src/client/game/grid/homeCheckpoint.ts +11 -0
  1818. package/src/client/game/grid/homeMetadata.ts +40 -0
  1819. package/src/client/game/grid/intent.ts +65 -0
  1820. package/src/client/game/grid/live.ts +787 -0
  1821. package/src/client/game/grid/liveSession.ts +969 -0
  1822. package/src/client/game/grid/loadingRings.ts +49 -0
  1823. package/src/client/game/grid/mapAtlas.build.d.ts +4 -0
  1824. package/src/client/game/grid/mapAtlas.ts +33 -0
  1825. package/src/client/game/grid/mapFrame.ts +81 -0
  1826. package/src/client/game/grid/memoryRows.ts +32 -0
  1827. package/src/client/game/grid/memoryWarning.css +11 -0
  1828. package/src/client/game/grid/memoryWarning.ts +81 -0
  1829. package/src/client/game/grid/menu.ts +49 -0
  1830. package/src/client/game/grid/minimapBlend.ts +185 -0
  1831. package/src/client/game/grid/nearGrain.ts +40 -0
  1832. package/src/client/game/grid/nearPlaceholderPlan.ts +60 -0
  1833. package/src/client/game/grid/nearPlaceholderView.ts +182 -0
  1834. package/src/client/game/grid/neighbourLife.ts +151 -0
  1835. package/src/client/game/grid/neighbourPanels.ts +84 -0
  1836. package/src/client/game/grid/neighbourRows.ts +32 -0
  1837. package/src/client/game/grid/oneWayIn.ts +114 -0
  1838. package/src/client/game/grid/pageEntry.ts +234 -0
  1839. package/src/client/game/grid/pageResidency.ts +216 -0
  1840. package/src/client/game/grid/pageShell.ts +67 -0
  1841. package/src/client/game/grid/prefetch.ts +344 -0
  1842. package/src/client/game/grid/prefetchIndex.ts +28 -0
  1843. package/src/client/game/grid/prefetchIndexCore.ts +41 -0
  1844. package/src/client/game/grid/prelinkViews.ts +31 -0
  1845. package/src/client/game/grid/preparationAdmission.ts +34 -0
  1846. package/src/client/game/grid/productInputs.ts +98 -0
  1847. package/src/client/game/grid/productLeases.ts +76 -0
  1848. package/src/client/game/grid/products.ts +350 -0
  1849. package/src/client/game/grid/refusal.ts +73 -0
  1850. package/src/client/game/grid/regionLight.ts +102 -0
  1851. package/src/client/game/grid/regionShell.ts +58 -0
  1852. package/src/client/game/grid/regionSky.ts +104 -0
  1853. package/src/client/game/grid/regionalBuildCheckpoint.ts +19 -0
  1854. package/src/client/game/grid/regionalInputs.ts +34 -0
  1855. package/src/client/game/grid/regionalRuntime.ts +518 -0
  1856. package/src/client/game/grid/regionalView.ts +205 -0
  1857. package/src/client/game/grid/regionalWorld.ts +609 -0
  1858. package/src/client/game/grid/renderResidency.ts +95 -0
  1859. package/src/client/game/grid/reveal.ts +163 -0
  1860. package/src/client/game/grid/roadCull.ts +473 -0
  1861. package/src/client/game/grid/roadGrain.ts +32 -0
  1862. package/src/client/game/grid/roadGrain.worker.ts +20 -0
  1863. package/src/client/game/grid/roadGrainPreparation.ts +45 -0
  1864. package/src/client/game/grid/roadLook.ts +487 -0
  1865. package/src/client/game/grid/roadLookPlatform.ts +196 -0
  1866. package/src/client/game/grid/roadResources.ts +15 -0
  1867. package/src/client/game/grid/roadSign.worker.ts +30 -0
  1868. package/src/client/game/grid/roadSignPaint.ts +38 -0
  1869. package/src/client/game/grid/roadSignPixels.ts +22 -0
  1870. package/src/client/game/grid/roadSignPreparation.ts +45 -0
  1871. package/src/client/game/grid/roadSky.ts +219 -0
  1872. package/src/client/game/grid/roadSolid.ts +227 -0
  1873. package/src/client/game/grid/roadTileArchive.ts +239 -0
  1874. package/src/client/game/grid/roadTileBacking.ts +327 -0
  1875. package/src/client/game/grid/roadTileCapture.worker.ts +14 -0
  1876. package/src/client/game/grid/roadTileCaptureJob.ts +37 -0
  1877. package/src/client/game/grid/roadTileCaptureWorker.ts +104 -0
  1878. package/src/client/game/grid/roadTileCoarse.ts +28 -0
  1879. package/src/client/game/grid/roadTileGeometry.ts +77 -0
  1880. package/src/client/game/grid/roadTilePool.ts +157 -0
  1881. package/src/client/game/grid/roadTileStream.ts +69 -0
  1882. package/src/client/game/grid/roadTileWrite.worker.ts +24 -0
  1883. package/src/client/game/grid/roadTileWriter.ts +67 -0
  1884. package/src/client/game/grid/runtimeCost.ts +44 -0
  1885. package/src/client/game/grid/seamLook.ts +177 -0
  1886. package/src/client/game/grid/session.ts +1235 -0
  1887. package/src/client/game/grid/shardfileFar.ts +88 -0
  1888. package/src/client/game/grid/skinEnvelope.ts +135 -0
  1889. package/src/client/game/grid/softWallLook.ts +116 -0
  1890. package/src/client/game/grid/tileDecodeWorker.ts +24 -0
  1891. package/src/client/game/grid/tileDecoder.ts +102 -0
  1892. package/src/client/game/grid/titleOrder.ts +8 -0
  1893. package/src/client/game/grid/titlePrefetchChoice.ts +35 -0
  1894. package/src/client/game/grid/viewAdmissions.ts +36 -0
  1895. package/src/client/game/grid/voidLook.ts +181 -0
  1896. package/src/client/game/icons.merge.d.ts +49 -0
  1897. package/src/client/game/icons.ts +240 -0
  1898. package/src/client/game/identity.ts +28 -0
  1899. package/src/client/game/inputContexts.ts +33 -0
  1900. package/src/client/game/keyBindings.ts +37 -0
  1901. package/src/client/game/loadout/actors.ts +15 -0
  1902. package/src/client/game/loadout/claims.ts +728 -0
  1903. package/src/client/game/loadout/cosmeticFinishes.ts +217 -0
  1904. package/src/client/game/loadout/effects.ts +97 -0
  1905. package/src/client/game/loadout/finishes.ts +60 -0
  1906. package/src/client/game/loadout/held.ts +207 -0
  1907. package/src/client/game/loadout/rangedPage.ts +142 -0
  1908. package/src/client/game/looks/coverAppearance.ts +101 -0
  1909. package/src/client/game/looks/daySky.ts +110 -0
  1910. package/src/client/game/looks/forestGround.ts +49 -0
  1911. package/src/client/game/looks/forestGroundInputs.ts +27 -0
  1912. package/src/client/game/looks/forestRoofMask.ts +15 -0
  1913. package/src/client/game/looks/forestWeather.ts +26 -0
  1914. package/src/client/game/looks/graphDaySky.ts +245 -0
  1915. package/src/client/game/looks/grassPresentation.ts +334 -0
  1916. package/src/client/game/looks/keyedSky.ts +500 -0
  1917. package/src/client/game/looks/lettering.ts +14 -0
  1918. package/src/client/game/looks/overcast.ts +61 -0
  1919. package/src/client/game/looks/paintedGroundMerge.ts +12 -0
  1920. package/src/client/game/looks/paintedLook.ts +197 -0
  1921. package/src/client/game/looks/painterlyLook.ts +259 -0
  1922. package/src/client/game/looks/posedBufferPool.ts +67 -0
  1923. package/src/client/game/looks/posedInstances.ts +199 -0
  1924. package/src/client/game/looks/postGraphLook.ts +455 -0
  1925. package/src/client/game/looks/riggedHulls.ts +451 -0
  1926. package/src/client/game/looks/scaledPost.ts +236 -0
  1927. package/src/client/game/looks/speciesBook.ts +224 -0
  1928. package/src/client/game/looks/staticCapture.ts +225 -0
  1929. package/src/client/game/looks/streamedCover.ts +330 -0
  1930. package/src/client/game/looks/toonLighting.ts +28 -0
  1931. package/src/client/game/looks/toonLook.ts +69 -0
  1932. package/src/client/game/looks/toonSky.ts +60 -0
  1933. package/src/client/game/looks/vertexWear.ts +49 -0
  1934. package/src/client/game/loot/CoinBurst.ts +19 -0
  1935. package/src/client/game/loot/CoinMotion.ts +169 -0
  1936. package/src/client/game/loot/coinModel.ts +11 -0
  1937. package/src/client/game/loot/coins.ts +21 -0
  1938. package/src/client/game/loot/feed.ts +23 -0
  1939. package/src/client/game/loot/loot.css +19 -0
  1940. package/src/client/game/loot/runtime.ts +243 -0
  1941. package/src/client/game/loot/tables.ts +30 -0
  1942. package/src/client/game/loot/ui/CoinChip.ts +70 -0
  1943. package/src/client/game/loot/ui/ShopPanel.ts +211 -0
  1944. package/src/client/game/loot/ui/shop.css +42 -0
  1945. package/src/client/game/mainMenu.css +177 -0
  1946. package/src/client/game/mainMenu.ts +268 -0
  1947. package/src/client/game/models/binarySource.ts +78 -0
  1948. package/src/client/game/models/collectionDisplay.ts +133 -0
  1949. package/src/client/game/models/collectionWall.ts +236 -0
  1950. package/src/client/game/models/explorerCatalogue.ts +176 -0
  1951. package/src/client/game/models/figureCatalogue.ts +172 -0
  1952. package/src/client/game/models/fixedDraws.ts +178 -0
  1953. package/src/client/game/models/heldGear.ts +76 -0
  1954. package/src/client/game/models/interact.ts +107 -0
  1955. package/src/client/game/models/islandLibrary.ts +179 -0
  1956. package/src/client/game/models/kitFigureCard.ts +77 -0
  1957. package/src/client/game/models/libraryModel.ts +67 -0
  1958. package/src/client/game/models/mountedSpecimen.ts +45 -0
  1959. package/src/client/game/models/pickupRows.ts +12 -0
  1960. package/src/client/game/models/ropeDeckSite.ts +114 -0
  1961. package/src/client/game/models/scenePartSpecimen.ts +102 -0
  1962. package/src/client/game/models/sceneSpecimens.ts +103 -0
  1963. package/src/client/game/models/socketRigCreature.ts +65 -0
  1964. package/src/client/game/models/specimenCatalogue.ts +540 -0
  1965. package/src/client/game/models/treeSet.ts +149 -0
  1966. package/src/client/game/models/worldSceneCatalogue.ts +310 -0
  1967. package/src/client/game/nativeItems.merge.d.ts +6 -0
  1968. package/src/client/game/pageSaveKeys.ts +13 -0
  1969. package/src/client/game/plugin/audio.ts +277 -0
  1970. package/src/client/game/plugin/bakedGeometry.ts +103 -0
  1971. package/src/client/game/plugin/bladeMoves.ts +117 -0
  1972. package/src/client/game/plugin/bossStorm.ts +40 -0
  1973. package/src/client/game/plugin/clientChannelView.ts +135 -0
  1974. package/src/client/game/plugin/context.ts +198 -0
  1975. package/src/client/game/plugin/followedMovers.ts +184 -0
  1976. package/src/client/game/plugin/geometry.ts +2083 -0
  1977. package/src/client/game/plugin/headless.ts +127 -0
  1978. package/src/client/game/plugin/heldEquipment.ts +208 -0
  1979. package/src/client/game/plugin/heldFirearm.ts +395 -0
  1980. package/src/client/game/plugin/heldRecipe.ts +43 -0
  1981. package/src/client/game/plugin/heldTool.ts +166 -0
  1982. package/src/client/game/plugin/moverEvents.merge.d.ts +6 -0
  1983. package/src/client/game/plugin/moverViews.ts +114 -0
  1984. package/src/client/game/plugin/placeholderGeometry.ts +40 -0
  1985. package/src/client/game/plugin/scene.ts +290 -0
  1986. package/src/client/game/plugin/shaderFamily.ts +225 -0
  1987. package/src/client/game/plugin/ui.ts +1511 -0
  1988. package/src/client/game/plugin/weaponFamily.ts +779 -0
  1989. package/src/client/game/population/netCounts.ts +12 -0
  1990. package/src/client/game/population/pageAir.ts +37 -0
  1991. package/src/client/game/population/pageLife.ts +289 -0
  1992. package/src/client/game/population/pageReturns.ts +17 -0
  1993. package/src/client/game/population/productCreatures.ts +71 -0
  1994. package/src/client/game/population/projection.ts +227 -0
  1995. package/src/client/game/population/rowSpecies.ts +15 -0
  1996. package/src/client/game/population/signals.ts +24 -0
  1997. package/src/client/game/population/speciesViewSlots.ts +55 -0
  1998. package/src/client/game/population/wildlifeFeature.ts +208 -0
  1999. package/src/client/game/population.merge.d.ts +9 -0
  2000. package/src/client/game/practice/course.ts +154 -0
  2001. package/src/client/game/practice/numericCourse.ts +35 -0
  2002. package/src/client/game/practice/registration.ts +17 -0
  2003. package/src/client/game/practice/scene.ts +47 -0
  2004. package/src/client/game/quest/carriedProp.ts +113 -0
  2005. package/src/client/game/quest/chapter.ts +355 -0
  2006. package/src/client/game/quest/chapterDirector.ts +255 -0
  2007. package/src/client/game/quest/chapterView.ts +165 -0
  2008. package/src/client/game/quest/continuation.ts +53 -0
  2009. package/src/client/game/quest/contractBoardPage.ts +85 -0
  2010. package/src/client/game/quest/declaredPage.ts +199 -0
  2011. package/src/client/game/quest/elitePage.ts +115 -0
  2012. package/src/client/game/quest/figureOrbit.ts +32 -0
  2013. package/src/client/game/quest/figures.ts +259 -0
  2014. package/src/client/game/quest/finishedAfterSeen.ts +20 -0
  2015. package/src/client/game/quest/hints.ts +90 -0
  2016. package/src/client/game/quest/pageComposition.ts +331 -0
  2017. package/src/client/game/quest/pageDoors.ts +25 -0
  2018. package/src/client/game/quest/pageFacets.ts +76 -0
  2019. package/src/client/game/quest/pageReference.ts +17 -0
  2020. package/src/client/game/quest/presentation.css +4 -0
  2021. package/src/client/game/quest/questPageViews.ts +168 -0
  2022. package/src/client/game/quest/reward.ts +48 -0
  2023. package/src/client/game/quest/story.ts +161 -0
  2024. package/src/client/game/quest/trader.ts +176 -0
  2025. package/src/client/game/riding/client.ts +373 -0
  2026. package/src/client/game/riding/hud.ts +255 -0
  2027. package/src/client/game/riding/mount.ts +317 -0
  2028. package/src/client/game/riding/reins.ts +177 -0
  2029. package/src/client/game/riding/ride.css +70 -0
  2030. package/src/client/game/riding/seatedFigure.ts +78 -0
  2031. package/src/client/game/saves.css +34 -0
  2032. package/src/client/game/savesSettings.ts +189 -0
  2033. package/src/client/game/session/clockSettings.ts +66 -0
  2034. package/src/client/game/session/context.ts +61 -0
  2035. package/src/client/game/session/crashResume.ts +36 -0
  2036. package/src/client/game/session/data.ts +101 -0
  2037. package/src/client/game/session/entryReadiness.ts +13 -0
  2038. package/src/client/game/session/exitToTitle.ts +19 -0
  2039. package/src/client/game/session/finish.ts +414 -0
  2040. package/src/client/game/session/hudAccent.ts +30 -0
  2041. package/src/client/game/session/loadout.ts +176 -0
  2042. package/src/client/game/session/play.ts +824 -0
  2043. package/src/client/game/session/positions.ts +8 -0
  2044. package/src/client/game/session/readyFrame.ts +10 -0
  2045. package/src/client/game/session/session.ts +193 -0
  2046. package/src/client/game/session/settlePrograms.ts +29 -0
  2047. package/src/client/game/session/titlePreparation.ts +43 -0
  2048. package/src/client/game/session/world.ts +168 -0
  2049. package/src/client/game/shard/declaredEntry.ts +44 -0
  2050. package/src/client/game/shard/declaredPlumbing.ts +80 -0
  2051. package/src/client/game/shard/declaredTargets.ts +64 -0
  2052. package/src/client/game/shard/declaredUi.ts +23 -0
  2053. package/src/client/game/shard/discovery.ts +80 -0
  2054. package/src/client/game/shard/list.ts +26 -0
  2055. package/src/client/game/shard/load.ts +94 -0
  2056. package/src/client/game/shard/manifest.ts +910 -0
  2057. package/src/client/game/shard/pageBoot.ts +52 -0
  2058. package/src/client/game/shard/pagePolicy.ts +17 -0
  2059. package/src/client/game/shard/registry.ts +74 -0
  2060. package/src/client/game/shard/retainedHooks.ts +204 -0
  2061. package/src/client/game/shard/scopedRuntime.ts +68 -0
  2062. package/src/client/game/shard/spec.ts +69 -0
  2063. package/src/client/game/shard/titleList.ts +86 -0
  2064. package/src/client/game/shardfile/accent.ts +5 -0
  2065. package/src/client/game/shardfile/assetCache.ts +46 -0
  2066. package/src/client/game/shardfile/audioCatalogue.ts +16 -0
  2067. package/src/client/game/shardfile/bakedKinds.ts +313 -0
  2068. package/src/client/game/shardfile/bakedTiles.ts +253 -0
  2069. package/src/client/game/shardfile/buildingCloud.ts +27 -0
  2070. package/src/client/game/shardfile/calibrationScripts.ts +30 -0
  2071. package/src/client/game/shardfile/caveInterior.ts +162 -0
  2072. package/src/client/game/shardfile/client.ts +671 -0
  2073. package/src/client/game/shardfile/clientAmbientLife.ts +31 -0
  2074. package/src/client/game/shardfile/clientAssets.ts +163 -0
  2075. package/src/client/game/shardfile/clientBossFight.ts +39 -0
  2076. package/src/client/game/shardfile/clientBossTelegraph.ts +43 -0
  2077. package/src/client/game/shardfile/clientCatalogue.ts +44 -0
  2078. package/src/client/game/shardfile/clientCosmeticFinishes.ts +37 -0
  2079. package/src/client/game/shardfile/clientCues.ts +22 -0
  2080. package/src/client/game/shardfile/clientEliteConstruction.ts +44 -0
  2081. package/src/client/game/shardfile/clientEliteEntry.ts +33 -0
  2082. package/src/client/game/shardfile/clientEntryBinds.ts +32 -0
  2083. package/src/client/game/shardfile/clientFinds.ts +20 -0
  2084. package/src/client/game/shardfile/clientForestPage.ts +144 -0
  2085. package/src/client/game/shardfile/clientGraphs.ts +319 -0
  2086. package/src/client/game/shardfile/clientHeldMelee.ts +82 -0
  2087. package/src/client/game/shardfile/clientItems.ts +25 -0
  2088. package/src/client/game/shardfile/clientLibrary.ts +71 -0
  2089. package/src/client/game/shardfile/clientMaterials.ts +296 -0
  2090. package/src/client/game/shardfile/clientMeadow.ts +30 -0
  2091. package/src/client/game/shardfile/clientModules.ts +24 -0
  2092. package/src/client/game/shardfile/clientMoverOwners.ts +80 -0
  2093. package/src/client/game/shardfile/clientNativeBook.ts +38 -0
  2094. package/src/client/game/shardfile/clientPlaceSets.ts +74 -0
  2095. package/src/client/game/shardfile/clientPlan.ts +529 -0
  2096. package/src/client/game/shardfile/clientPlayerEnter.ts +22 -0
  2097. package/src/client/game/shardfile/clientPopulation.ts +49 -0
  2098. package/src/client/game/shardfile/clientPopulationProjection.ts +28 -0
  2099. package/src/client/game/shardfile/clientPost.ts +94 -0
  2100. package/src/client/game/shardfile/clientPropMaterials.ts +100 -0
  2101. package/src/client/game/shardfile/clientQuestComposition.ts +87 -0
  2102. package/src/client/game/shardfile/clientQuestPage.ts +98 -0
  2103. package/src/client/game/shardfile/clientRecipes.ts +76 -0
  2104. package/src/client/game/shardfile/clientResidency.ts +29 -0
  2105. package/src/client/game/shardfile/clientReturnModules.ts +25 -0
  2106. package/src/client/game/shardfile/clientRuntimeHooks.ts +66 -0
  2107. package/src/client/game/shardfile/clientSceneHandles.ts +19 -0
  2108. package/src/client/game/shardfile/clientScripts.ts +100 -0
  2109. package/src/client/game/shardfile/clientSkins.ts +183 -0
  2110. package/src/client/game/shardfile/clientSource.ts +221 -0
  2111. package/src/client/game/shardfile/clientSpeciesProgram.ts +45 -0
  2112. package/src/client/game/shardfile/clientSplatTerrain.ts +99 -0
  2113. package/src/client/game/shardfile/clientStealthEntry.ts +72 -0
  2114. package/src/client/game/shardfile/clientTargets.ts +73 -0
  2115. package/src/client/game/shardfile/clientTimedEncounters.ts +42 -0
  2116. package/src/client/game/shardfile/clientTrails.ts +42 -0
  2117. package/src/client/game/shardfile/clientViewProgram.ts +101 -0
  2118. package/src/client/game/shardfile/clientViews.ts +211 -0
  2119. package/src/client/game/shardfile/clientWater.ts +108 -0
  2120. package/src/client/game/shardfile/clientWaterSurfaces.ts +88 -0
  2121. package/src/client/game/shardfile/clientWorker.ts +621 -0
  2122. package/src/client/game/shardfile/clientWorldAssembly.ts +129 -0
  2123. package/src/client/game/shardfile/constructionCheckpoint.ts +31 -0
  2124. package/src/client/game/shardfile/controlFiles.ts +41 -0
  2125. package/src/client/game/shardfile/controlRefinement.ts +229 -0
  2126. package/src/client/game/shardfile/declaredTalks.ts +114 -0
  2127. package/src/client/game/shardfile/emptyEquipment.ts +19 -0
  2128. package/src/client/game/shardfile/emptyLook.ts +26 -0
  2129. package/src/client/game/shardfile/enteredTileReadout.ts +27 -0
  2130. package/src/client/game/shardfile/entryTransport.ts +222 -0
  2131. package/src/client/game/shardfile/farStandIn.ts +79 -0
  2132. package/src/client/game/shardfile/forestPage.ts +289 -0
  2133. package/src/client/game/shardfile/groundMerge.ts +232 -0
  2134. package/src/client/game/shardfile/heldClaimsEntry.ts +34 -0
  2135. package/src/client/game/shardfile/homeBuildCache.ts +114 -0
  2136. package/src/client/game/shardfile/homeGeometrySnapshot.ts +92 -0
  2137. package/src/client/game/shardfile/hybrid.ts +537 -0
  2138. package/src/client/game/shardfile/hybridPresentation.ts +16 -0
  2139. package/src/client/game/shardfile/islandBook.ts +87 -0
  2140. package/src/client/game/shardfile/itemModels.ts +78 -0
  2141. package/src/client/game/shardfile/legacyAsset.ts +30 -0
  2142. package/src/client/game/shardfile/lentLooks.ts +210 -0
  2143. package/src/client/game/shardfile/lightEmitters.ts +100 -0
  2144. package/src/client/game/shardfile/livingBuildings.ts +202 -0
  2145. package/src/client/game/shardfile/look.ts +23 -0
  2146. package/src/client/game/shardfile/mapImage.ts +49 -0
  2147. package/src/client/game/shardfile/pageItems.ts +57 -0
  2148. package/src/client/game/shardfile/pagePreparation.ts +40 -0
  2149. package/src/client/game/shardfile/pageWater.ts +29 -0
  2150. package/src/client/game/shardfile/paintedWorldStages.ts +132 -0
  2151. package/src/client/game/shardfile/portalRideBinding.ts +62 -0
  2152. package/src/client/game/shardfile/preparationReads.ts +61 -0
  2153. package/src/client/game/shardfile/preparationTiming.ts +115 -0
  2154. package/src/client/game/shardfile/presentation.ts +36 -0
  2155. package/src/client/game/shardfile/product.ts +718 -0
  2156. package/src/client/game/shardfile/productCacheCompletion.ts +53 -0
  2157. package/src/client/game/shardfile/productChecks.ts +40 -0
  2158. package/src/client/game/shardfile/productCost.ts +422 -0
  2159. package/src/client/game/shardfile/productGround.ts +60 -0
  2160. package/src/client/game/shardfile/productNavigation.ts +18 -0
  2161. package/src/client/game/shardfile/productPreflight.ts +12 -0
  2162. package/src/client/game/shardfile/questWorld.ts +17 -0
  2163. package/src/client/game/shardfile/readAsset.ts +44 -0
  2164. package/src/client/game/shardfile/reusableWholeLibrary.ts +102 -0
  2165. package/src/client/game/shardfile/runtimeProduct.ts +396 -0
  2166. package/src/client/game/shardfile/sceneBakeFiles.ts +22 -0
  2167. package/src/client/game/shardfile/sceneBuffers.ts +207 -0
  2168. package/src/client/game/shardfile/sceneDraws.ts +90 -0
  2169. package/src/client/game/shardfile/sceneDressing.ts +456 -0
  2170. package/src/client/game/shardfile/sceneHandles.ts +170 -0
  2171. package/src/client/game/shardfile/sceneInputs.ts +21 -0
  2172. package/src/client/game/shardfile/sceneInstances.ts +67 -0
  2173. package/src/client/game/shardfile/sceneMotion.ts +161 -0
  2174. package/src/client/game/shardfile/scenePools.ts +40 -0
  2175. package/src/client/game/shardfile/sceneProfile.ts +12 -0
  2176. package/src/client/game/shardfile/sceneRigFiles.ts +30 -0
  2177. package/src/client/game/shardfile/sceneScatterPages.ts +47 -0
  2178. package/src/client/game/shardfile/sceneSources.ts +153 -0
  2179. package/src/client/game/shardfile/serverRoute.ts +38 -0
  2180. package/src/client/game/shardfile/skinLayerPlayback.ts +67 -0
  2181. package/src/client/game/shardfile/skinPlayback.ts +138 -0
  2182. package/src/client/game/shardfile/slabLibrary.ts +203 -0
  2183. package/src/client/game/shardfile/stillImage.ts +19 -0
  2184. package/src/client/game/shardfile/streamingView.ts +78 -0
  2185. package/src/client/game/shardfile/tileBufferedDraws.ts +49 -0
  2186. package/src/client/game/shardfile/tileContent.ts +564 -0
  2187. package/src/client/game/shardfile/tileDriver.ts +462 -0
  2188. package/src/client/game/shardfile/tileEntry.ts +18 -0
  2189. package/src/client/game/shardfile/tiledMesh.ts +146 -0
  2190. package/src/client/game/shardfile/water.ts +8 -0
  2191. package/src/client/game/shardfile/weatherFields.ts +31 -0
  2192. package/src/client/game/shardfile/wholeGeometryPieces.ts +101 -0
  2193. package/src/client/game/shardfile/wholeLibrary.ts +47 -0
  2194. package/src/client/game/shardfile/wholeRefinementCover.ts +78 -0
  2195. package/src/client/game/shardfile/wirePage.ts +260 -0
  2196. package/src/client/game/shardfile/worldAssembly.ts +531 -0
  2197. package/src/client/game/shardfile/worldBuildYield.ts +10 -0
  2198. package/src/client/game/shardfile/worldEntry.ts +117 -0
  2199. package/src/client/game/shardfile/worldSceneBatch.ts +105 -0
  2200. package/src/client/game/shardfile/worldSceneGeometry.ts +171 -0
  2201. package/src/client/game/shardfile/worldSceneMaterials.ts +90 -0
  2202. package/src/client/game/shardfile/worldScenePlacement.ts +364 -0
  2203. package/src/client/game/shardfile/worldScenePlacementPages.ts +61 -0
  2204. package/src/client/game/shardfile/worldSceneReads.ts +83 -0
  2205. package/src/client/game/shardfile/worldSceneStepSources.ts +69 -0
  2206. package/src/client/game/shardfile/worldSceneSurface.ts +108 -0
  2207. package/src/client/game/shardfile/worldSceneTextures.ts +134 -0
  2208. package/src/client/game/shardfile/worldSceneUniforms.ts +17 -0
  2209. package/src/client/game/shardfile/worldSceneWeld.ts +339 -0
  2210. package/src/client/game/shardfile/worldScenes.ts +760 -0
  2211. package/src/client/game/shardfile/worldUpdates.ts +149 -0
  2212. package/src/client/game/stealth/controller.ts +115 -0
  2213. package/src/client/game/stealth/stealth.css +70 -0
  2214. package/src/client/game/summary.css +8 -0
  2215. package/src/client/game/summary.ts +67 -0
  2216. package/src/client/game/systems/audio/crossbowSounds.ts +71 -0
  2217. package/src/client/game/systems/audio/firearmSounds.ts +43 -0
  2218. package/src/client/game/systems/audio/meleeSounds.ts +40 -0
  2219. package/src/client/game/systems/audio/silentScore.ts +6 -0
  2220. package/src/client/game/systems/effects/starter.generated.ts +2 -0
  2221. package/src/client/game/systems/effects/status.css +3 -0
  2222. package/src/client/game/systems/effects/view.ts +35 -0
  2223. package/src/client/game/systems/items/declaredSword.ts +149 -0
  2224. package/src/client/game/systems/looks/fogProgram.ts +18 -0
  2225. package/src/client/game/systems/looks/particles.ts +407 -0
  2226. package/src/client/game/systems/looks/rainCurtain.ts +50 -0
  2227. package/src/client/game/systems/looks/surfaceLooks.ts +138 -0
  2228. package/src/client/game/systems/looks/trample.ts +139 -0
  2229. package/src/client/game/systems/looks/waterSurface.ts +179 -0
  2230. package/src/client/game/systems/npc/figureRows.ts +169 -0
  2231. package/src/client/game/systems/npc/figureSkins.ts +130 -0
  2232. package/src/client/game/systems/npc/kitFigure.ts +127 -0
  2233. package/src/client/game/systems/npc/npcRig.ts +217 -0
  2234. package/src/client/game/systems/npc/standingFigure.ts +111 -0
  2235. package/src/client/game/systems/props/interact.ts +236 -0
  2236. package/src/client/game/systems/species/bear.ts +30 -0
  2237. package/src/client/game/systems/species/boar.ts +28 -0
  2238. package/src/client/game/systems/species/install.ts +18 -0
  2239. package/src/client/game/systems/species/view/bear.ts +246 -0
  2240. package/src/client/game/systems/species/view/boar.ts +249 -0
  2241. package/src/client/game/systems/tools/hoverboard.ts +107 -0
  2242. package/src/client/game/systems/viewmodel/armAliases.json +24 -0
  2243. package/src/client/game/systems/viewmodel/armClips.ts +8 -0
  2244. package/src/client/game/systems/viewmodel/armRig.ts +293 -0
  2245. package/src/client/game/systems/viewmodel/clips.generated.ts +2 -0
  2246. package/src/client/game/systems/viewmodel/heldView.ts +458 -0
  2247. package/src/client/game/systems/viewmodel/rigArms.ts +280 -0
  2248. package/src/client/game/titleAssets.ts +9 -0
  2249. package/src/client/game/titleDeck.ts +381 -0
  2250. package/src/client/game/travel/travel.ts +99 -0
  2251. package/src/client/game/ui/dataPanels.ts +95 -0
  2252. package/src/client/game/ui/panelTemplates.ts +71 -0
  2253. package/src/client/game/ui/panels.ts +109 -0
  2254. package/src/client/game/upgrade.css +12 -0
  2255. package/src/client/game/weapons/Bow.ts +14 -0
  2256. package/src/client/game/weapons/Sword.ts +30 -0
  2257. package/src/client/game/weapons/arcPower.ts +203 -0
  2258. package/src/client/game/weapons/heldLauncher.ts +452 -0
  2259. package/src/client/game/weapons/heldPolearm.ts +491 -0
  2260. package/src/client/game/weapons/mountedBlade.ts +122 -0
  2261. package/src/client/game/weather/forest.ts +281 -0
  2262. package/src/client/game/weather/netClimate.ts +88 -0
  2263. package/src/client/game/weather/pageSky.ts +31 -0
  2264. package/src/client/game/weather/rainPresentation.ts +246 -0
  2265. package/src/client/game/weather/weatherEvents.merge.d.ts +8 -0
  2266. package/src/client/game/whatsNew.ts +31 -0
  2267. package/src/client/game/whatsNewBanner.ts +125 -0
  2268. package/src/client/host/online/chatCorner.ts +46 -0
  2269. package/src/client/host/online/chatLines.ts +213 -0
  2270. package/src/client/host/online/doctor.ts +321 -0
  2271. package/src/client/host/online/doctorPage.ts +26 -0
  2272. package/src/client/host/online/doctorView.ts +144 -0
  2273. package/src/client/host/online/linkScreens.ts +300 -0
  2274. package/src/client/host/online/reconnectStrip.ts +26 -0
  2275. package/src/client/host/online/release.ts +28 -0
  2276. package/src/client/host/online/shell.ts +312 -0
  2277. package/src/client/host/online/voice.ts +468 -0
  2278. package/src/client/host/online/voiceUi.ts +186 -0
  2279. package/src/client/host/standalone/shell.ts +169 -0
  2280. package/src/client/index.html +12 -0
  2281. package/src/client/main.tsx +10 -0
  2282. package/src/client/side.ts +2 -0
  2283. package/src/client/tsconfig.json +13 -0
  2284. package/src/cook/game/brotliSizeCache.d.mts +5 -0
  2285. package/src/cook/game/brotliSizeCache.mjs +59 -0
  2286. package/src/cook/game/contentNamed.ts +6 -0
  2287. package/src/cook/game/cookJob.ts +103 -0
  2288. package/src/cook/game/cookWorker.ts +413 -0
  2289. package/src/cook/game/encodedBytes.ts +51 -0
  2290. package/src/cook/game/engineHalf.ts +47 -0
  2291. package/src/cook/game/entryDownloads.ts +36 -0
  2292. package/src/cook/game/entryReadSet.ts +67 -0
  2293. package/src/cook/game/entryTotals.ts +320 -0
  2294. package/src/cook/game/fenceReads.ts +218 -0
  2295. package/src/cook/game/gridCollision.ts +53 -0
  2296. package/src/cook/game/gridEntryDownloads.ts +33 -0
  2297. package/src/cook/game/gridStripPages.ts +239 -0
  2298. package/src/cook/game/installedRuntimeReads.ts +48 -0
  2299. package/src/cook/game/packStore.ts +120 -0
  2300. package/src/cook/game/portableEncode.ts +7 -0
  2301. package/src/cook/game/productTarball.ts +18 -0
  2302. package/src/cook/game/shardCook.ts +350 -0
  2303. package/src/cook/game/spawnParts.ts +294 -0
  2304. package/src/cook/game/stripPack.ts +31 -0
  2305. package/src/cook/side.ts +2 -0
  2306. package/src/e2e/playwright.config.ts +60 -0
  2307. package/src/e2e/smoke/game.ts +217 -0
  2308. package/src/e2e/smoke/page-globals.d.ts +37 -0
  2309. package/src/e2e/smoke/template2.spec.ts +146 -0
  2310. package/src/e2e/status.spec.ts +13 -0
  2311. package/src/scripts/ask-new.sh +29 -0
  2312. package/src/scripts/asks.mjs +142 -0
  2313. package/src/scripts/check-sides.mjs +70 -0
  2314. package/src/scripts/herdr-prompt.sh +34 -0
  2315. package/src/scripts/herdr-question-open.sh +67 -0
  2316. package/src/scripts/md-wrap.mjs +229 -0
  2317. package/src/server/app.ts +19 -0
  2318. package/src/server/engine/ai/CreatureBrain.ts +23 -0
  2319. package/src/server/engine/ai/bossContenders.ts +101 -0
  2320. package/src/server/engine/ai/burstFlyer.ts +31 -0
  2321. package/src/server/engine/ai/challengeGrazer.ts +31 -0
  2322. package/src/server/engine/ai/eliteContinuation.ts +141 -0
  2323. package/src/server/engine/ai/eliteKernels.ts +187 -0
  2324. package/src/server/engine/ai/eliteLifecycle.ts +126 -0
  2325. package/src/server/engine/ai/eliteRoster.ts +357 -0
  2326. package/src/server/engine/ai/grazer.ts +1360 -0
  2327. package/src/server/engine/ai/guardian.ts +20 -0
  2328. package/src/server/engine/ai/guardianPolicy.ts +264 -0
  2329. package/src/server/engine/ai/herd.ts +17 -0
  2330. package/src/server/engine/ai/hunt.ts +46 -0
  2331. package/src/server/engine/ai/moves.ts +202 -0
  2332. package/src/server/engine/ai/orbitDiver.ts +33 -0
  2333. package/src/server/engine/ai/pack.ts +29 -0
  2334. package/src/server/engine/ai/patrolDiver.ts +31 -0
  2335. package/src/server/engine/ai/perchHunter.ts +20 -0
  2336. package/src/server/engine/ai/phases.ts +121 -0
  2337. package/src/server/engine/ai/platform.ts +140 -0
  2338. package/src/server/engine/ai/ramGrazer.ts +31 -0
  2339. package/src/server/engine/ai/scriptBrain.ts +147 -0
  2340. package/src/server/engine/ai/skirmisher.ts +20 -0
  2341. package/src/server/engine/ai/species.ts +33 -0
  2342. package/src/server/engine/combat/EquipmentPickup.ts +28 -0
  2343. package/src/server/engine/combat/contactWeapon.ts +251 -0
  2344. package/src/server/engine/combat/damageBook.ts +45 -0
  2345. package/src/server/engine/combat/rewind.ts +7 -0
  2346. package/src/server/engine/entities/AnimalManager.ts +752 -0
  2347. package/src/server/engine/entities/bodyClear.ts +47 -0
  2348. package/src/server/engine/entities/creatureRefill.ts +119 -0
  2349. package/src/server/engine/entities/killHeight.ts +18 -0
  2350. package/src/server/engine/level/context.ts +111 -0
  2351. package/src/server/engine/net/chat.ts +97 -0
  2352. package/src/server/engine/net/combatWire.ts +49 -0
  2353. package/src/server/engine/net/commandQueue.ts +95 -0
  2354. package/src/server/engine/net/handles.ts +74 -0
  2355. package/src/server/engine/net/hitHistory.ts +114 -0
  2356. package/src/server/engine/net/ledgerBook.ts +65 -0
  2357. package/src/server/engine/net/room.ts +560 -0
  2358. package/src/server/engine/net/serverClock.ts +43 -0
  2359. package/src/server/engine/net/simWorld.ts +131 -0
  2360. package/src/server/engine/net/tiers.ts +14 -0
  2361. package/src/server/engine/physics/edgeEntries.ts +40 -0
  2362. package/src/server/engine/physics/rapierBindings.ts +4 -0
  2363. package/src/server/engine/saves/forwardedStorage.ts +43 -0
  2364. package/src/server/engine/script/composition.ts +219 -0
  2365. package/src/server/engine/script/decision.ts +573 -0
  2366. package/src/server/engine/script/inputInboxV2.ts +116 -0
  2367. package/src/server/engine/script/lane.ts +185 -0
  2368. package/src/server/engine/script/ownedSimBatchV2.ts +205 -0
  2369. package/src/server/engine/script/queries.ts +37 -0
  2370. package/src/server/engine/script/queriesV2.ts +149 -0
  2371. package/src/server/engine/script/simBatchV2.ts +125 -0
  2372. package/src/server/engine/sim/playerSim.ts +443 -0
  2373. package/src/server/engine/sim/respawn.ts +74 -0
  2374. package/src/server/engine/sim/restore.ts +37 -0
  2375. package/src/server/engine/sim.ts +711 -0
  2376. package/src/server/game/animation/limbPopulation.ts +138 -0
  2377. package/src/server/game/bake/entryways.ts +186 -0
  2378. package/src/server/game/boss/arenaRoomEntry.ts +97 -0
  2379. package/src/server/game/boss/arenaRoomFight.ts +103 -0
  2380. package/src/server/game/boss/arenaRoomNative.ts +142 -0
  2381. package/src/server/game/boss/arenaWords.ts +46 -0
  2382. package/src/server/game/boss/bounty.ts +37 -0
  2383. package/src/server/game/boss/captainNative.ts +122 -0
  2384. package/src/server/game/boss/continuation.ts +37 -0
  2385. package/src/server/game/boss/headlessArenaPose.ts +40 -0
  2386. package/src/server/game/boss/headlessArenaViews.ts +54 -0
  2387. package/src/server/game/boss/headlessCloudBody.ts +93 -0
  2388. package/src/server/game/boss/native.ts +220 -0
  2389. package/src/server/game/boss/nativeArenaSand.ts +93 -0
  2390. package/src/server/game/boss/nativeArenaSeal.ts +26 -0
  2391. package/src/server/game/boss/nativeWake.ts +50 -0
  2392. package/src/server/game/boss/openArenaNative.ts +200 -0
  2393. package/src/server/game/boss/openArenaRoom.ts +69 -0
  2394. package/src/server/game/boss/openArenaState.ts +25 -0
  2395. package/src/server/game/boss/patrolNative.ts +286 -0
  2396. package/src/server/game/boss/roaming.ts +77 -0
  2397. package/src/server/game/boss/slotHeights.ts +103 -0
  2398. package/src/server/game/boss/slotsNative.ts +175 -0
  2399. package/src/server/game/boss/windEliteNative.ts +139 -0
  2400. package/src/server/game/grapple/native.ts +181 -0
  2401. package/src/server/game/grid/durability.ts +166 -0
  2402. package/src/server/game/grid/room.ts +53 -0
  2403. package/src/server/game/grid/roomNet.ts +85 -0
  2404. package/src/server/game/grid/simulation.ts +345 -0
  2405. package/src/server/game/items.merge.d.ts +7 -0
  2406. package/src/server/game/loadout/nativeAmmunition.ts +139 -0
  2407. package/src/server/game/loadout/ownedEffects.ts +68 -0
  2408. package/src/server/game/loot/harvest.ts +43 -0
  2409. package/src/server/game/loot/personal.ts +70 -0
  2410. package/src/server/game/loot/playerOwned.ts +235 -0
  2411. package/src/server/game/plugin/bossPhase.ts +904 -0
  2412. package/src/server/game/plugin/brain.ts +1325 -0
  2413. package/src/server/game/plugin/mover.ts +601 -0
  2414. package/src/server/game/plugin/nativeItems.ts +437 -0
  2415. package/src/server/game/plugin/nativeRewind.ts +37 -0
  2416. package/src/server/game/plugin/nativeSwept.ts +249 -0
  2417. package/src/server/game/plugin/playerSeats.ts +62 -0
  2418. package/src/server/game/plugin/scriptSeats.ts +89 -0
  2419. package/src/server/game/plugin/simulation.ts +1623 -0
  2420. package/src/server/game/population/actorProjectionV2.ts +276 -0
  2421. package/src/server/game/population/actors.ts +136 -0
  2422. package/src/server/game/population/directedLaw.ts +69 -0
  2423. package/src/server/game/population/encounterBook.ts +78 -0
  2424. package/src/server/game/population/encounterIntake.ts +78 -0
  2425. package/src/server/game/population/environment.ts +86 -0
  2426. package/src/server/game/population/mixedRoster.ts +353 -0
  2427. package/src/server/game/population/nativeBake.ts +202 -0
  2428. package/src/server/game/population/nativeManager.ts +426 -0
  2429. package/src/server/game/population/nativeReturns.ts +99 -0
  2430. package/src/server/game/population/perchBody.ts +97 -0
  2431. package/src/server/game/population/projectedSites.ts +41 -0
  2432. package/src/server/game/population/relations.ts +45 -0
  2433. package/src/server/game/population/roster.ts +259 -0
  2434. package/src/server/game/population/scriptStrikes.ts +67 -0
  2435. package/src/server/game/population/shelter.ts +193 -0
  2436. package/src/server/game/population/signals.ts +9 -0
  2437. package/src/server/game/population/spawnScript.ts +797 -0
  2438. package/src/server/game/population/specCatalogue.ts +11 -0
  2439. package/src/server/game/quest/bodyOps.ts +253 -0
  2440. package/src/server/game/quest/chapterRecords.ts +97 -0
  2441. package/src/server/game/quest/eliteDrops.ts +36 -0
  2442. package/src/server/game/quest/eliteFeature.ts +141 -0
  2443. package/src/server/game/quest/killSteps.ts +34 -0
  2444. package/src/server/game/quest/nativeBodyScripts.ts +29 -0
  2445. package/src/server/game/quest/nativeChapter.ts +80 -0
  2446. package/src/server/game/quest/nativeComposition.ts +548 -0
  2447. package/src/server/game/quest/nativeEntry.ts +128 -0
  2448. package/src/server/game/quest/nativeInputs.ts +29 -0
  2449. package/src/server/game/quest/nativeSecret.ts +80 -0
  2450. package/src/server/game/quest/serverChapters.ts +192 -0
  2451. package/src/server/game/quest/serverDoors.ts +89 -0
  2452. package/src/server/game/quest/serverPlaces.ts +32 -0
  2453. package/src/server/game/riding/native.ts +362 -0
  2454. package/src/server/game/riding/nativePopulation.ts +384 -0
  2455. package/src/server/game/riding/nativeTaming.ts +331 -0
  2456. package/src/server/game/riding/pastureController.ts +131 -0
  2457. package/src/server/game/riding/roster.ts +108 -0
  2458. package/src/server/game/riding/wildRefill.ts +37 -0
  2459. package/src/server/game/roomRespawn.ts +60 -0
  2460. package/src/server/game/shard/declaredEncounters.ts +22 -0
  2461. package/src/server/game/shard/manifest-closure.generated.json +683 -0
  2462. package/src/server/game/shard/portShares.generated.ts +2 -0
  2463. package/src/server/game/shard/world.ts +5 -0
  2464. package/src/server/game/shardfile/borrowedDecisions.ts +281 -0
  2465. package/src/server/game/shardfile/bossRow.ts +236 -0
  2466. package/src/server/game/shardfile/brainRuntime.ts +162 -0
  2467. package/src/server/game/shardfile/decisions.ts +597 -0
  2468. package/src/server/game/shardfile/declaredClimate.ts +22 -0
  2469. package/src/server/game/shardfile/declaredKitItems.ts +243 -0
  2470. package/src/server/game/shardfile/declaredTalks.ts +52 -0
  2471. package/src/server/game/shardfile/groupRuntime.ts +302 -0
  2472. package/src/server/game/shardfile/homeKeeper.ts +565 -0
  2473. package/src/server/game/shardfile/nativeAssembly.ts +102 -0
  2474. package/src/server/game/shardfile/nativeAssemblyHosts.ts +301 -0
  2475. package/src/server/game/shardfile/nativeAssemblyInput.ts +68 -0
  2476. package/src/server/game/shardfile/nativePlan.ts +28 -0
  2477. package/src/server/game/shardfile/nativeRuntimeLoans.ts +52 -0
  2478. package/src/server/game/shardfile/phasedBossRoaming.ts +427 -0
  2479. package/src/server/game/shardfile/portalLinkProof.ts +66 -0
  2480. package/src/server/game/shardfile/scriptComposition.ts +57 -0
  2481. package/src/server/game/shardfile/scripts.ts +56 -0
  2482. package/src/server/game/shardfile/statusEffects.ts +68 -0
  2483. package/src/server/game/stealth/nativeStealth.ts +74 -0
  2484. package/src/server/game/weapons/nativeHeld.ts +333 -0
  2485. package/src/server/game/weather/continuation.ts +97 -0
  2486. package/src/server/game/weather/reactions.ts +219 -0
  2487. package/src/server/game/weather/wire.ts +42 -0
  2488. package/src/server/host/bake/headlessWorker.ts +132 -0
  2489. package/src/server/host/dedicated/cellHost.ts +171 -0
  2490. package/src/server/host/dedicated/cellProtocol.ts +64 -0
  2491. package/src/server/host/dedicated/cellWorker.ts +33 -0
  2492. package/src/server/host/dedicated/crossing.ts +44 -0
  2493. package/src/server/host/dedicated/dedicatedRoom.ts +419 -0
  2494. package/src/server/host/dedicated/doorTrust.ts +55 -0
  2495. package/src/server/host/dedicated/gridCells.ts +53 -0
  2496. package/src/server/host/dedicated/main.ts +134 -0
  2497. package/src/server/host/dedicated/packReader.ts +68 -0
  2498. package/src/server/host/dedicated/playerDoc.ts +96 -0
  2499. package/src/server/host/dedicated/playerSaves.ts +62 -0
  2500. package/src/server/host/dedicated/playerStore.ts +82 -0
  2501. package/src/server/host/dedicated/playtest.ts +41 -0
  2502. package/src/server/host/dedicated/releaseFile.ts +71 -0
  2503. package/src/server/host/dedicated/roadRoom.ts +151 -0
  2504. package/src/server/host/dedicated/saves/database.ts +15 -0
  2505. package/src/server/host/dedicated/saves/migrate.ts +26 -0
  2506. package/src/server/host/dedicated/saves/migrations/0001-saves.sql +48 -0
  2507. package/src/server/host/dedicated/saves/migrations/0002-report-delivery.sql +3 -0
  2508. package/src/server/host/dedicated/saves/migrations/0003-place.sql +11 -0
  2509. package/src/server/host/dedicated/saves/migrations/0004-names.sql +4 -0
  2510. package/src/server/host/dedicated/saves/migrations/0005-profile.sql +41 -0
  2511. package/src/server/host/dedicated/saves/names.ts +56 -0
  2512. package/src/server/host/dedicated/saves/pgDatabase.ts +43 -0
  2513. package/src/server/host/dedicated/saves/profile.ts +44 -0
  2514. package/src/server/host/dedicated/saves/reportQueue.ts +49 -0
  2515. package/src/server/host/dedicated/saves/saveStore.ts +117 -0
  2516. package/src/server/host/dedicated/saves/writeQueue.ts +94 -0
  2517. package/src/server/host/dedicated/seats.ts +12 -0
  2518. package/src/server/host/dedicated/serverReports.ts +81 -0
  2519. package/src/server/host/dedicated/serverSentry.ts +124 -0
  2520. package/src/server/host/dedicated/shopGate.ts +36 -0
  2521. package/src/server/host/dedicated/socketPump.ts +74 -0
  2522. package/src/server/host/dedicated/socketTransport.ts +123 -0
  2523. package/src/server/host/dedicated/voiceRelay.ts +138 -0
  2524. package/src/server/host/dedicated/workerTable.ts +29 -0
  2525. package/src/server/host/dedicated/world.ts +428 -0
  2526. package/src/server/host/headless.ts +280 -0
  2527. package/src/server/host/headlessProduct.ts +52 -0
  2528. package/src/server/host/headlessRuntime.ts +354 -0
  2529. package/src/server/host/ropeDecks.ts +69 -0
  2530. package/src/server/host/standalone/cellWorld.ts +188 -0
  2531. package/src/server/host/standalone/continuation.ts +58 -0
  2532. package/src/server/host/standalone/fallFloor.ts +83 -0
  2533. package/src/server/host/standalone/gridServer.ts +282 -0
  2534. package/src/server/host/standalone/ledgerFilings.ts +33 -0
  2535. package/src/server/host/standalone/progressWatch.ts +90 -0
  2536. package/src/server/host/standalone/roadWorld.ts +49 -0
  2537. package/src/server/host/standalone/serverHost.ts +132 -0
  2538. package/src/server/host/standalone/serverProduct.ts +149 -0
  2539. package/src/server/host/standalone/serverRuntime.ts +43 -0
  2540. package/src/server/host/standalone/serverWorker.ts +22 -0
  2541. package/src/server/host/tickWorkerHost.ts +250 -0
  2542. package/src/server/host/tickWorkerLoop.ts +123 -0
  2543. package/src/server/serve.ts +49 -0
  2544. package/src/server/side.ts +2 -0
  2545. package/src/shared/engine/ai/BossBrain.ts +287 -0
  2546. package/src/shared/engine/ai/GroupBrain.ts +152 -0
  2547. package/src/shared/engine/ai/ambientFlight.ts +60 -0
  2548. package/src/shared/engine/ai/ambientFlock.ts +297 -0
  2549. package/src/shared/engine/ai/ambientForager.ts +289 -0
  2550. package/src/shared/engine/ai/bossScale.ts +8 -0
  2551. package/src/shared/engine/ai/director.ts +94 -0
  2552. package/src/shared/engine/ai/diver.ts +540 -0
  2553. package/src/shared/engine/ai/eliteScript.ts +85 -0
  2554. package/src/shared/engine/ai/encounters.ts +124 -0
  2555. package/src/shared/engine/ai/flight.ts +69 -0
  2556. package/src/shared/engine/ai/flock.ts +334 -0
  2557. package/src/shared/engine/ai/hfsm.ts +51 -0
  2558. package/src/shared/engine/ai/huntPattern.ts +987 -0
  2559. package/src/shared/engine/ai/inspect.ts +6 -0
  2560. package/src/shared/engine/ai/pinning.ts +13 -0
  2561. package/src/shared/engine/ai/reach.ts +19 -0
  2562. package/src/shared/engine/ai/stalker.ts +1502 -0
  2563. package/src/shared/engine/ai/strikeRows.ts +17 -0
  2564. package/src/shared/engine/ai/strikeState.ts +19 -0
  2565. package/src/shared/engine/ai/strikes.ts +199 -0
  2566. package/src/shared/engine/ai/weighted.ts +27 -0
  2567. package/src/shared/engine/app/identity.ts +66 -0
  2568. package/src/shared/engine/app/ownership.ts +155 -0
  2569. package/src/shared/engine/app/pageSeat.ts +12 -0
  2570. package/src/shared/engine/app/resources.ts +7 -0
  2571. package/src/shared/engine/app/scheduler.ts +162 -0
  2572. package/src/shared/engine/app/scope.ts +557 -0
  2573. package/src/shared/engine/app/scopeEnvironment.ts +27 -0
  2574. package/src/shared/engine/app/scopedProperty.ts +38 -0
  2575. package/src/shared/engine/audio/audioProfiles.ts +161 -0
  2576. package/src/shared/engine/audio/bootAudio.ts +316 -0
  2577. package/src/shared/engine/boot/loadingWaits.ts +62 -0
  2578. package/src/shared/engine/boot/serverProgress.ts +27 -0
  2579. package/src/shared/engine/boot/steps.ts +63 -0
  2580. package/src/shared/engine/boot/tables.ts +48 -0
  2581. package/src/shared/engine/boot/timeline.ts +189 -0
  2582. package/src/shared/engine/boot/timing.ts +96 -0
  2583. package/src/shared/engine/boot/waits.ts +114 -0
  2584. package/src/shared/engine/boot/workerTiming.ts +74 -0
  2585. package/src/shared/engine/combat/Equipment.ts +66 -0
  2586. package/src/shared/engine/combat/Firearm.ts +200 -0
  2587. package/src/shared/engine/combat/Melee.ts +46 -0
  2588. package/src/shared/engine/combat/Tool.ts +8 -0
  2589. package/src/shared/engine/combat/Weapon.ts +133 -0
  2590. package/src/shared/engine/combat/ammo.ts +17 -0
  2591. package/src/shared/engine/combat/blocks/ads.ts +5 -0
  2592. package/src/shared/engine/combat/blocks/melee.ts +19 -0
  2593. package/src/shared/engine/combat/bowDraw.ts +140 -0
  2594. package/src/shared/engine/combat/bowLaw.ts +54 -0
  2595. package/src/shared/engine/combat/effects/EffectService.ts +216 -0
  2596. package/src/shared/engine/combat/effects/types.ts +47 -0
  2597. package/src/shared/engine/combat/health.ts +92 -0
  2598. package/src/shared/engine/combat/impact.ts +8 -0
  2599. package/src/shared/engine/combat/itemFamilies.ts +34 -0
  2600. package/src/shared/engine/combat/items.ts +147 -0
  2601. package/src/shared/engine/combat/lungeTarget.ts +42 -0
  2602. package/src/shared/engine/combat/meleeProfile.ts +48 -0
  2603. package/src/shared/engine/combat/pipeline.ts +157 -0
  2604. package/src/shared/engine/combat/projectileContact.ts +275 -0
  2605. package/src/shared/engine/combat/projectileFlight.ts +89 -0
  2606. package/src/shared/engine/combat/projectileLaw.ts +148 -0
  2607. package/src/shared/engine/combat/shotSpread.ts +38 -0
  2608. package/src/shared/engine/combat/sweptBasePose.ts +75 -0
  2609. package/src/shared/engine/combat/sweptBlade.ts +108 -0
  2610. package/src/shared/engine/combat/sweptMeleeCore.ts +223 -0
  2611. package/src/shared/engine/combat/targets.ts +20 -0
  2612. package/src/shared/engine/core/clock.ts +57 -0
  2613. package/src/shared/engine/core/config.ts +66 -0
  2614. package/src/shared/engine/core/faults.ts +129 -0
  2615. package/src/shared/engine/core/fixedStep.ts +5 -0
  2616. package/src/shared/engine/core/frameCost.ts +227 -0
  2617. package/src/shared/engine/core/framePacing.ts +179 -0
  2618. package/src/shared/engine/core/harnessTap.ts +15 -0
  2619. package/src/shared/engine/core/memoryAttribution.ts +137 -0
  2620. package/src/shared/engine/core/memoryResources.ts +20 -0
  2621. package/src/shared/engine/core/noise.ts +53 -0
  2622. package/src/shared/engine/core/perfLap.ts +37 -0
  2623. package/src/shared/engine/core/portableMath.ts +204 -0
  2624. package/src/shared/engine/core/portableMathFirst.ts +4 -0
  2625. package/src/shared/engine/core/practiceRoomState.ts +3 -0
  2626. package/src/shared/engine/core/rng.ts +101 -0
  2627. package/src/shared/engine/core/time.ts +8 -0
  2628. package/src/shared/engine/core/workSlice.ts +111 -0
  2629. package/src/shared/engine/entities/AnimalSim.ts +390 -0
  2630. package/src/shared/engine/entities/animalPose.ts +401 -0
  2631. package/src/shared/engine/entities/animalRig.ts +76 -0
  2632. package/src/shared/engine/entities/animalStates.ts +2 -0
  2633. package/src/shared/engine/entities/creatureFloor.ts +13 -0
  2634. package/src/shared/engine/entities/eliteBrain.ts +36 -0
  2635. package/src/shared/engine/entities/fightRules.ts +80 -0
  2636. package/src/shared/engine/entities/ids.ts +18 -0
  2637. package/src/shared/engine/entities/poseCadence.ts +9 -0
  2638. package/src/shared/engine/entities/species/registry.ts +382 -0
  2639. package/src/shared/engine/entities/species/rigs.ts +53 -0
  2640. package/src/shared/engine/events/events.ts +107 -0
  2641. package/src/shared/engine/input/commands.ts +34 -0
  2642. package/src/shared/engine/input/netButtons.ts +4 -0
  2643. package/src/shared/engine/level/data.ts +163 -0
  2644. package/src/shared/engine/level/selection.ts +44 -0
  2645. package/src/shared/engine/level/spec.ts +132 -0
  2646. package/src/shared/engine/net/acts.ts +48 -0
  2647. package/src/shared/engine/net/animalNet.ts +43 -0
  2648. package/src/shared/engine/net/bits.ts +104 -0
  2649. package/src/shared/engine/net/chatFilter.ts +40 -0
  2650. package/src/shared/engine/net/chatWire.ts +18 -0
  2651. package/src/shared/engine/net/chatWords.ts +7 -0
  2652. package/src/shared/engine/net/command.ts +96 -0
  2653. package/src/shared/engine/net/encounterNet.ts +32 -0
  2654. package/src/shared/engine/net/frame.ts +159 -0
  2655. package/src/shared/engine/net/identity.ts +40 -0
  2656. package/src/shared/engine/net/ledgerWire.ts +24 -0
  2657. package/src/shared/engine/net/measurements.ts +14 -0
  2658. package/src/shared/engine/net/messages.ts +213 -0
  2659. package/src/shared/engine/net/netSchemas.ts +38 -0
  2660. package/src/shared/engine/net/playerNet.ts +80 -0
  2661. package/src/shared/engine/net/schema.ts +157 -0
  2662. package/src/shared/engine/net/shardNet.ts +25 -0
  2663. package/src/shared/engine/net/socketFrames.ts +84 -0
  2664. package/src/shared/engine/net/transport.ts +19 -0
  2665. package/src/shared/engine/net/wireFrames.ts +123 -0
  2666. package/src/shared/engine/net/wireMessages.ts +115 -0
  2667. package/src/shared/engine/net/wireValues.ts +142 -0
  2668. package/src/shared/engine/physics/CharacterMotor.ts +429 -0
  2669. package/src/shared/engine/physics/Physics.ts +211 -0
  2670. package/src/shared/engine/physics/bodies.ts +600 -0
  2671. package/src/shared/engine/physics/box.ts +42 -0
  2672. package/src/shared/engine/physics/creatures.ts +188 -0
  2673. package/src/shared/engine/physics/declaredProps.ts +26 -0
  2674. package/src/shared/engine/physics/entrySockets.ts +44 -0
  2675. package/src/shared/engine/physics/frame.ts +39 -0
  2676. package/src/shared/engine/physics/gridBorders.ts +38 -0
  2677. package/src/shared/engine/physics/groups.ts +64 -0
  2678. package/src/shared/engine/physics/heightPatch.ts +49 -0
  2679. package/src/shared/engine/physics/meshCollision.ts +84 -0
  2680. package/src/shared/engine/physics/mover.ts +60 -0
  2681. package/src/shared/engine/physics/navmesh.ts +206 -0
  2682. package/src/shared/engine/physics/navmeshUrl.ts +8 -0
  2683. package/src/shared/engine/physics/nearColliders.ts +55 -0
  2684. package/src/shared/engine/physics/overlap.ts +26 -0
  2685. package/src/shared/engine/physics/paths.ts +135 -0
  2686. package/src/shared/engine/physics/pieces.ts +139 -0
  2687. package/src/shared/engine/physics/query.ts +161 -0
  2688. package/src/shared/engine/physics/queryBatchV2.ts +118 -0
  2689. package/src/shared/engine/physics/rapier-bg.d.ts +5 -0
  2690. package/src/shared/engine/physics/rapier.ts +34 -0
  2691. package/src/shared/engine/physics/readinessWalls.ts +49 -0
  2692. package/src/shared/engine/physics/ropeChain.ts +128 -0
  2693. package/src/shared/engine/physics/stripColliders.ts +21 -0
  2694. package/src/shared/engine/physics/surface.ts +31 -0
  2695. package/src/shared/engine/physics/terrain.ts +155 -0
  2696. package/src/shared/engine/physics/terrainTiles.ts +20 -0
  2697. package/src/shared/engine/physics/trainingTargets.ts +51 -0
  2698. package/src/shared/engine/physics/transferWalls.ts +84 -0
  2699. package/src/shared/engine/physics/wasmUrl.ts +3 -0
  2700. package/src/shared/engine/player/MeleeSweep.ts +50 -0
  2701. package/src/shared/engine/player/board.ts +129 -0
  2702. package/src/shared/engine/player/combatMotion.ts +5 -0
  2703. package/src/shared/engine/player/dash.ts +60 -0
  2704. package/src/shared/engine/player/dodge.ts +14 -0
  2705. package/src/shared/engine/player/fall.ts +29 -0
  2706. package/src/shared/engine/player/hoverSpeed.ts +22 -0
  2707. package/src/shared/engine/player/impulse.ts +30 -0
  2708. package/src/shared/engine/player/jump.ts +30 -0
  2709. package/src/shared/engine/player/lockOrbit.ts +72 -0
  2710. package/src/shared/engine/player/modes.ts +239 -0
  2711. package/src/shared/engine/player/motion.ts +391 -0
  2712. package/src/shared/engine/player/motionState.ts +84 -0
  2713. package/src/shared/engine/player/shove.ts +27 -0
  2714. package/src/shared/engine/player/swim.ts +196 -0
  2715. package/src/shared/engine/player/walk.ts +25 -0
  2716. package/src/shared/engine/quest/core.ts +174 -0
  2717. package/src/shared/engine/quest/dialogueClock.ts +191 -0
  2718. package/src/shared/engine/quest/discovery.ts +42 -0
  2719. package/src/shared/engine/quest/lastPlace.ts +80 -0
  2720. package/src/shared/engine/quest/players.ts +162 -0
  2721. package/src/shared/engine/quest/progress.ts +25 -0
  2722. package/src/shared/engine/quest/viewPort.ts +22 -0
  2723. package/src/shared/engine/saves/environment.ts +13 -0
  2724. package/src/shared/engine/saves/legacy.ts +65 -0
  2725. package/src/shared/engine/saves/runtime.ts +28 -0
  2726. package/src/shared/engine/saves/saves.lock.json +551 -0
  2727. package/src/shared/engine/saves/shape.ts +157 -0
  2728. package/src/shared/engine/saves/store.ts +423 -0
  2729. package/src/shared/engine/script/checkpointBytes.ts +18 -0
  2730. package/src/shared/engine/script/decisionModule.ts +158 -0
  2731. package/src/shared/engine/script/effects.ts +111 -0
  2732. package/src/shared/engine/script/fixedMemory.ts +92 -0
  2733. package/src/shared/engine/script/groupBankV2.ts +376 -0
  2734. package/src/shared/engine/script/groupStepV2.ts +987 -0
  2735. package/src/shared/engine/script/host.ts +443 -0
  2736. package/src/shared/engine/script/moduleV2.ts +160 -0
  2737. package/src/shared/engine/script/observationColumnsV2.ts +431 -0
  2738. package/src/shared/engine/script/observationsV2.ts +139 -0
  2739. package/src/shared/engine/script/state.ts +183 -0
  2740. package/src/shared/engine/script/strings.ts +5 -0
  2741. package/src/shared/engine/script/viewLane.ts +335 -0
  2742. package/src/shared/engine/script/viewProgram.ts +315 -0
  2743. package/src/shared/engine/sim/actRoutes.ts +72 -0
  2744. package/src/shared/engine/sim/apiVersion.ts +2 -0
  2745. package/src/shared/engine/sim/bands.ts +174 -0
  2746. package/src/shared/engine/sim/cableTraversal.ts +356 -0
  2747. package/src/shared/engine/sim/dayClock.ts +76 -0
  2748. package/src/shared/engine/sim/edgeProfiles.ts +123 -0
  2749. package/src/shared/engine/sim/encounterRows.ts +49 -0
  2750. package/src/shared/engine/sim/leadPlayer.ts +16 -0
  2751. package/src/shared/engine/sim/moverLifecycle.ts +80 -0
  2752. package/src/shared/engine/sim/moverMotion.ts +130 -0
  2753. package/src/shared/engine/sim/nearPlayer.ts +21 -0
  2754. package/src/shared/engine/sim/netMotion.ts +17 -0
  2755. package/src/shared/engine/sim/readiness.ts +77 -0
  2756. package/src/shared/engine/sim/seamError.ts +100 -0
  2757. package/src/shared/engine/sim/seamGeometry.ts +365 -0
  2758. package/src/shared/engine/sim/seamLattice.ts +127 -0
  2759. package/src/shared/engine/sim/shardRows.ts +106 -0
  2760. package/src/shared/engine/sim/shore.ts +14 -0
  2761. package/src/shared/engine/sim/snapshot.ts +482 -0
  2762. package/src/shared/engine/sim/snapshotBase64.ts +25 -0
  2763. package/src/shared/engine/sim/snapshotData.ts +460 -0
  2764. package/src/shared/engine/sim/snapshotPhysics.ts +163 -0
  2765. package/src/shared/engine/sim/snapshotReferenceMemo.ts +271 -0
  2766. package/src/shared/engine/sim/strips.ts +134 -0
  2767. package/src/shared/engine/strings.ts +751 -0
  2768. package/src/shared/engine/world/BakedTerrain.ts +131 -0
  2769. package/src/shared/engine/world/Heightfield.ts +129 -0
  2770. package/src/shared/engine/world/bakedTerrainField.ts +85 -0
  2771. package/src/shared/engine/world/dayCycle.ts +198 -0
  2772. package/src/shared/engine/world/easedFields.ts +32 -0
  2773. package/src/shared/engine/world/forest/placement.ts +391 -0
  2774. package/src/shared/engine/world/forest/treeSpec.ts +15 -0
  2775. package/src/shared/engine/world/groundField.ts +21 -0
  2776. package/src/shared/engine/world/interact/barrel.ts +114 -0
  2777. package/src/shared/engine/world/interact/flags.ts +229 -0
  2778. package/src/shared/engine/world/interact/pickup.ts +22 -0
  2779. package/src/shared/engine/world/interact/prompts.ts +47 -0
  2780. package/src/shared/engine/world/interact/types.ts +327 -0
  2781. package/src/shared/engine/world/interact/validate.ts +67 -0
  2782. package/src/shared/engine/world/scalarChannel.ts +146 -0
  2783. package/src/shared/engine/world/steppeWind.ts +193 -0
  2784. package/src/shared/engine/world/terrainField.ts +217 -0
  2785. package/src/shared/engine/world/terrainHeight.ts +19 -0
  2786. package/src/shared/engine/world/water/body.ts +88 -0
  2787. package/src/shared/engine/world/water/declared.ts +106 -0
  2788. package/src/shared/engine/world/waves.ts +57 -0
  2789. package/src/shared/engine/world/weather.ts +166 -0
  2790. package/src/shared/engine/world/weatherContinuation.ts +121 -0
  2791. package/src/shared/engine/world/windField.ts +49 -0
  2792. package/src/shared/engine/world/windStrength.ts +6 -0
  2793. package/src/shared/engine/world/yawFrame.ts +38 -0
  2794. package/src/shared/game/achievements.ts +140 -0
  2795. package/src/shared/game/ambient/flock.ts +374 -0
  2796. package/src/shared/game/animation/limbBlend.ts +70 -0
  2797. package/src/shared/game/animation/limbRig.ts +208 -0
  2798. package/src/shared/game/bag/findsCatalogue.ts +58 -0
  2799. package/src/shared/game/bag/itemCatalog.ts +18 -0
  2800. package/src/shared/game/bag/items.ts +5 -0
  2801. package/src/shared/game/bag/starter.generated.ts +3 -0
  2802. package/src/shared/game/bag/starterItems.json +62 -0
  2803. package/src/shared/game/boss/arenaAnswers.ts +49 -0
  2804. package/src/shared/game/boss/arenaCollision.ts +16 -0
  2805. package/src/shared/game/boss/arenaGround.ts +121 -0
  2806. package/src/shared/game/boss/arenaPortal.ts +63 -0
  2807. package/src/shared/game/boss/arenaRoomRows.ts +403 -0
  2808. package/src/shared/game/boss/arenaWhirls.ts +88 -0
  2809. package/src/shared/game/boss/jointTargets.ts +41 -0
  2810. package/src/shared/game/boss/lane.ts +62 -0
  2811. package/src/shared/game/boss/openArenaFight.ts +644 -0
  2812. package/src/shared/game/boss/patrolLaw.ts +136 -0
  2813. package/src/shared/game/boss/slotLaw.ts +173 -0
  2814. package/src/shared/game/boss/wake.ts +60 -0
  2815. package/src/shared/game/compendium/finds.ts +49 -0
  2816. package/src/shared/game/compendium/registry.ts +28 -0
  2817. package/src/shared/game/compendium/rules.ts +136 -0
  2818. package/src/shared/game/compendium/state.ts +23 -0
  2819. package/src/shared/game/compendium/tracker.ts +138 -0
  2820. package/src/shared/game/compendium/types.ts +115 -0
  2821. package/src/shared/game/eliteSystem.ts +349 -0
  2822. package/src/shared/game/grapple/course.ts +14 -0
  2823. package/src/shared/game/grapple/feed.ts +27 -0
  2824. package/src/shared/game/grapple/sim.ts +352 -0
  2825. package/src/shared/game/grid/allocator.ts +479 -0
  2826. package/src/shared/game/grid/assembly.ts +73 -0
  2827. package/src/shared/game/grid/catalogue.ts +197 -0
  2828. package/src/shared/game/grid/catalogueDocument.ts +6 -0
  2829. package/src/shared/game/grid/catalogueSlot.ts +53 -0
  2830. package/src/shared/game/grid/cellEvents.ts +37 -0
  2831. package/src/shared/game/grid/collisionStrips.ts +18 -0
  2832. package/src/shared/game/grid/compiledStrips.ts +282 -0
  2833. package/src/shared/game/grid/continuations.ts +43 -0
  2834. package/src/shared/game/grid/crossing.ts +143 -0
  2835. package/src/shared/game/grid/edgeProfiles.ts +31 -0
  2836. package/src/shared/game/grid/farProxy.ts +302 -0
  2837. package/src/shared/game/grid/ghosts.ts +42 -0
  2838. package/src/shared/game/grid/gridAssetBytes.ts +59 -0
  2839. package/src/shared/game/grid/gridCollision.ts +37 -0
  2840. package/src/shared/game/grid/instances.ts +9 -0
  2841. package/src/shared/game/grid/pageMode.ts +32 -0
  2842. package/src/shared/game/grid/platformInputs.ts +11 -0
  2843. package/src/shared/game/grid/postPairs.ts +40 -0
  2844. package/src/shared/game/grid/readinessEdges.ts +13 -0
  2845. package/src/shared/game/grid/recovery.ts +221 -0
  2846. package/src/shared/game/grid/roadLayout.ts +169 -0
  2847. package/src/shared/game/grid/roadRecovery.ts +99 -0
  2848. package/src/shared/game/grid/rules.ts +45 -0
  2849. package/src/shared/game/grid/runtimeCheckpoint.ts +58 -0
  2850. package/src/shared/game/grid/seamData.ts +74 -0
  2851. package/src/shared/game/grid/seamGeometry.ts +219 -0
  2852. package/src/shared/game/grid/singleplayer.json +701 -0
  2853. package/src/shared/game/grid/travellerCombat.ts +34 -0
  2854. package/src/shared/game/grid/wallet.ts +104 -0
  2855. package/src/shared/game/harvest.ts +16 -0
  2856. package/src/shared/game/instanceSaves.ts +14 -0
  2857. package/src/shared/game/inventoryLaw.ts +131 -0
  2858. package/src/shared/game/ledger.ts +188 -0
  2859. package/src/shared/game/loadout/itemCatalogue.ts +44 -0
  2860. package/src/shared/game/loadout/persistence.ts +20 -0
  2861. package/src/shared/game/loadout/pouch.ts +46 -0
  2862. package/src/shared/game/localSaveKeys.ts +9 -0
  2863. package/src/shared/game/looks/dayClock.ts +112 -0
  2864. package/src/shared/game/looks/dayLookPresets.ts +75 -0
  2865. package/src/shared/game/looks/keyedSkyClock.ts +15 -0
  2866. package/src/shared/game/loot/Bounty.ts +49 -0
  2867. package/src/shared/game/loot/Owned.ts +112 -0
  2868. package/src/shared/game/loot/Purse.ts +94 -0
  2869. package/src/shared/game/loot/coinAmounts.ts +17 -0
  2870. package/src/shared/game/loot/coinBurstState.ts +23 -0
  2871. package/src/shared/game/loot/deaths.ts +14 -0
  2872. package/src/shared/game/loot/exchange.ts +71 -0
  2873. package/src/shared/game/loot/ownedRows.ts +24 -0
  2874. package/src/shared/game/loot/tableRows.ts +11 -0
  2875. package/src/shared/game/newGame.ts +56 -0
  2876. package/src/shared/game/plugin/animation.ts +618 -0
  2877. package/src/shared/game/plugin/bodyBoss.ts +119 -0
  2878. package/src/shared/game/plugin/borrowed.ts +62 -0
  2879. package/src/shared/game/plugin/bossRecord.ts +28 -0
  2880. package/src/shared/game/plugin/channelPrograms.ts +307 -0
  2881. package/src/shared/game/plugin/channels.ts +355 -0
  2882. package/src/shared/game/plugin/creatureFrame.ts +46 -0
  2883. package/src/shared/game/plugin/director.ts +435 -0
  2884. package/src/shared/game/plugin/moduleHash.ts +49 -0
  2885. package/src/shared/game/plugin/quests.ts +450 -0
  2886. package/src/shared/game/plugin/runtimeRows.ts +288 -0
  2887. package/src/shared/game/population/census.ts +67 -0
  2888. package/src/shared/game/population/groupNotices.ts +34 -0
  2889. package/src/shared/game/population/pageHomes.ts +125 -0
  2890. package/src/shared/game/population/pageRows.ts +20 -0
  2891. package/src/shared/game/population/perchRoot.ts +17 -0
  2892. package/src/shared/game/population/respawn.ts +89 -0
  2893. package/src/shared/game/population/returnProgram.ts +448 -0
  2894. package/src/shared/game/population/returnProjectionV2.ts +203 -0
  2895. package/src/shared/game/population/wildlifeOwner.ts +20 -0
  2896. package/src/shared/game/quest/boundState.ts +55 -0
  2897. package/src/shared/game/quest/carriedRound.ts +59 -0
  2898. package/src/shared/game/quest/chapterBindings.ts +64 -0
  2899. package/src/shared/game/quest/chapterClock.ts +56 -0
  2900. package/src/shared/game/quest/chapterDecision.ts +31 -0
  2901. package/src/shared/game/quest/chapterFlow.ts +54 -0
  2902. package/src/shared/game/quest/chapterLeads.ts +10 -0
  2903. package/src/shared/game/quest/contractBoard.ts +108 -0
  2904. package/src/shared/game/quest/contracts.ts +145 -0
  2905. package/src/shared/game/quest/declared.ts +152 -0
  2906. package/src/shared/game/quest/effectPresentation.ts +23 -0
  2907. package/src/shared/game/quest/effects.ts +61 -0
  2908. package/src/shared/game/quest/eliteDecisions.ts +123 -0
  2909. package/src/shared/game/quest/eliteStreams.ts +7 -0
  2910. package/src/shared/game/quest/featCounters.ts +41 -0
  2911. package/src/shared/game/quest/flagGates.ts +103 -0
  2912. package/src/shared/game/quest/interactionRows.ts +214 -0
  2913. package/src/shared/game/quest/ledger.ts +23 -0
  2914. package/src/shared/game/quest/legacyRecords.ts +17 -0
  2915. package/src/shared/game/quest/nativeProps.ts +117 -0
  2916. package/src/shared/game/quest/pagePersistence.ts +91 -0
  2917. package/src/shared/game/quest/pageReads.ts +39 -0
  2918. package/src/shared/game/quest/pageResources.ts +19 -0
  2919. package/src/shared/game/quest/pageState.ts +66 -0
  2920. package/src/shared/game/quest/persistence.ts +110 -0
  2921. package/src/shared/game/quest/questObservation.ts +50 -0
  2922. package/src/shared/game/quest/steps.ts +116 -0
  2923. package/src/shared/game/quest/storyLaw.ts +17 -0
  2924. package/src/shared/game/riding/bindingTypes.ts +43 -0
  2925. package/src/shared/game/riding/companions.ts +135 -0
  2926. package/src/shared/game/riding/entered.ts +21 -0
  2927. package/src/shared/game/riding/pagePopulation.ts +28 -0
  2928. package/src/shared/game/riding/pastureCues.ts +24 -0
  2929. package/src/shared/game/riding/physics.ts +691 -0
  2930. package/src/shared/game/riding/presentation.ts +27 -0
  2931. package/src/shared/game/riding/taming.ts +164 -0
  2932. package/src/shared/game/rng.merge.d.ts +10 -0
  2933. package/src/shared/game/saves.ts +90 -0
  2934. package/src/shared/game/shard/api.ts +2 -0
  2935. package/src/shared/game/shard/declaredRows.ts +121 -0
  2936. package/src/shared/game/shard/enteredServices.ts +14 -0
  2937. package/src/shared/game/shard/runtime.ts +90 -0
  2938. package/src/shared/game/shard/slug.ts +9 -0
  2939. package/src/shared/game/shard/terrainBake.ts +12 -0
  2940. package/src/shared/game/shardfile/aimTargetFilter.ts +12 -0
  2941. package/src/shared/game/shardfile/bakedPlacementPoses.ts +25 -0
  2942. package/src/shared/game/shardfile/buildingDoor.ts +52 -0
  2943. package/src/shared/game/shardfile/clientGround.ts +86 -0
  2944. package/src/shared/game/shardfile/clientState.ts +133 -0
  2945. package/src/shared/game/shardfile/collisionBindings.ts +31 -0
  2946. package/src/shared/game/shardfile/contentHash.ts +7 -0
  2947. package/src/shared/game/shardfile/crowdRuntime.ts +254 -0
  2948. package/src/shared/game/shardfile/customSchema.ts +57 -0
  2949. package/src/shared/game/shardfile/dataCreaturePorts.ts +239 -0
  2950. package/src/shared/game/shardfile/entryOwners.ts +153 -0
  2951. package/src/shared/game/shardfile/fileInputs.ts +21 -0
  2952. package/src/shared/game/shardfile/identity.ts +18 -0
  2953. package/src/shared/game/shardfile/items.ts +180 -0
  2954. package/src/shared/game/shardfile/ktx2Targets.ts +62 -0
  2955. package/src/shared/game/shardfile/ladder.ts +137 -0
  2956. package/src/shared/game/shardfile/liftRider.ts +62 -0
  2957. package/src/shared/game/shardfile/logicalState.ts +57 -0
  2958. package/src/shared/game/shardfile/movers.ts +14 -0
  2959. package/src/shared/game/shardfile/namedJsonChecks.ts +12 -0
  2960. package/src/shared/game/shardfile/outputChecksNode.ts +11 -0
  2961. package/src/shared/game/shardfile/outputDescriptor.ts +317 -0
  2962. package/src/shared/game/shardfile/outputIndexChecks.ts +8 -0
  2963. package/src/shared/game/shardfile/packReads.ts +93 -0
  2964. package/src/shared/game/shardfile/playArea.ts +42 -0
  2965. package/src/shared/game/shardfile/portalRide.ts +170 -0
  2966. package/src/shared/game/shardfile/portalTraversal.ts +49 -0
  2967. package/src/shared/game/shardfile/productData.ts +22 -0
  2968. package/src/shared/game/shardfile/props.ts +11 -0
  2969. package/src/shared/game/shardfile/resourceRole.ts +14 -0
  2970. package/src/shared/game/shardfile/runtimeState.ts +69 -0
  2971. package/src/shared/game/shardfile/schemaReferences.ts +33 -0
  2972. package/src/shared/game/shardfile/scriptNotice.ts +38 -0
  2973. package/src/shared/game/shardfile/serverPack.ts +23 -0
  2974. package/src/shared/game/shardfile/shardProduct.ts +206 -0
  2975. package/src/shared/game/shardfile/spawnManifest.ts +126 -0
  2976. package/src/shared/game/shardfile/talks.ts +22 -0
  2977. package/src/shared/game/shardfile/targets.ts +11 -0
  2978. package/src/shared/game/shardfile/tileOrder.ts +64 -0
  2979. package/src/shared/game/shardfile/walkInPortalRide.ts +160 -0
  2980. package/src/shared/game/shardfile/wholeInputs.ts +18 -0
  2981. package/src/shared/game/shardfile/wirePrompts.ts +35 -0
  2982. package/src/shared/game/shardfile/worldActionsV2.ts +113 -0
  2983. package/src/shared/game/shardfile/worldTargets.ts +71 -0
  2984. package/src/shared/game/stealth/stealthLaw.ts +120 -0
  2985. package/src/shared/game/strings.ts +88 -0
  2986. package/src/shared/game/systems/cellField.ts +144 -0
  2987. package/src/shared/game/systems/effects/starterEffects.ts +20 -0
  2988. package/src/shared/game/systems/effects/starterRows.json +98 -0
  2989. package/src/shared/game/systems/looks/grassField.ts +249 -0
  2990. package/src/shared/game/systems/looks/trampleField.ts +263 -0
  2991. package/src/shared/game/weapons/heldBowBase.ts +15 -0
  2992. package/src/shared/game/weapons/heldDecision.ts +20 -0
  2993. package/src/shared/game/weapons/javelinFlight.ts +139 -0
  2994. package/src/shared/game/weapons/launcherSpring.ts +11 -0
  2995. package/src/shared/game/weapons/mountedPass.ts +70 -0
  2996. package/src/shared/game/weapons/polearmContact.ts +73 -0
  2997. package/src/shared/game/weapons/polearmDecision.ts +152 -0
  2998. package/src/shared/game/weapons/starter.generated.ts +2 -0
  2999. package/src/shared/game/weapons/starterBow.json +21 -0
  3000. package/src/shared/game/weapons/starterBowProfile.ts +17 -0
  3001. package/src/shared/game/weapons/starterCombat.ts +19 -0
  3002. package/src/shared/game/weapons/starterGlyphs.ts +9 -0
  3003. package/src/shared/game/weapons/starterMeleeProfile.ts +67 -0
  3004. package/src/shared/game/weapons/starterMoves.ts +101 -0
  3005. package/src/shared/game/weather/feed.ts +57 -0
  3006. package/src/shared/health.ts +10 -0
  3007. package/src/shared/host/author.ts +14 -0
  3008. package/src/shared/host/formatJsonSchema.ts +1114 -0
  3009. package/src/shared/host/headlessJourney.ts +152 -0
  3010. package/src/shared/host/headlessObservation.ts +16 -0
  3011. package/src/shared/host/headlessSections.ts +18 -0
  3012. package/src/shared/host/headlessTape.ts +99 -0
  3013. package/src/shared/host/headlessTapeParts.ts +35 -0
  3014. package/src/shared/host/immutable.ts +14 -0
  3015. package/src/shared/host/releaseRows.ts +23 -0
  3016. package/src/shared/host/shardfile.ts +23 -0
  3017. package/src/shared/host/standalone/harnessPlace.ts +23 -0
  3018. package/src/shared/host/standalone/heldReads.ts +45 -0
  3019. package/src/shared/host/standalone/netInput.ts +112 -0
  3020. package/src/shared/host/standalone/workerLoopback.ts +51 -0
  3021. package/src/shared/host/tickProtocol.ts +246 -0
  3022. package/src/shared/side.ts +2 -0
  3023. package/src/test/engine/FakeGame.ts +123 -0
  3024. package/src/test/engine/creatureStride.ts +29 -0
  3025. package/src/test/engine/declarationConsumer.ts +24 -0
  3026. package/src/test/engine/linkedGl.ts +7 -0
  3027. package/src/test/engine/manager.ts +58 -0
  3028. package/src/test/engine/nativeBytes.ts +5 -0
  3029. package/src/test/engine/netLoopback.ts +64 -0
  3030. package/src/test/engine/realGc.ts +34 -0
  3031. package/src/test/engine/terrain.ts +32 -0
  3032. package/src/test/engine/textureUploadRenderer.ts +34 -0
  3033. package/src/test/engine/weaponParity.ts +119 -0
  3034. package/src/test/engine/world.ts +48 -0
  3035. package/src/test/game/creatureRecipe.ts +11 -0
  3036. package/src/test/helpers/git.ts +94 -0
  3037. package/src/test/tsconfig.app.json +28 -0
  3038. package/src/test/tsconfig.engine.json +27 -0
  3039. package/src/test/tsconfig.game.json +28 -0
  3040. package/src/test/tsconfig.host.json +27 -0
  3041. package/src/tools/build-web.ts +58 -0
  3042. package/src/tsconfig.json +39 -0
  3043. package/tsconfig.app.json +32 -0
  3044. package/tsconfig.engine.json +22 -0
  3045. package/tsconfig.game.json +34 -0
  3046. package/tsconfig.host.json +33 -0
  3047. package/tsconfig.json +54 -0
  3048. package/tsconfig.layers.json +35 -0
  3049. package/types/format-standards.d.ts +19 -0
  3050. package/vite/rapier.ts +35 -0
  3051. package/README.md +0 -6
@@ -0,0 +1,1502 @@
1
+ import * as v from 'valibot';
2
+ import { Vector3, MathUtils } from 'three';
3
+ import type { AnimalSim } from '../entities/AnimalSim';
4
+ import { HuntingStalkerCore, type HuntConfig, type HuntPorts } from './huntPattern';
5
+ import type { AggressionDirector } from './director';
6
+ import type { Rng } from '../core/rng';
7
+ import { emitFault } from '../core/faults';
8
+ import type { SimValue } from '../../../server/engine/sim';
9
+ import { isJsonData } from '@wildshard/format/json';
10
+ import type { Scope } from '../app/scope';
11
+ import type { GroupGuestBindingsV2, GroupGuestFrameV2, GroupGuestProjectionV2, GroupGuestPublicationV2 } from './GroupBrain';
12
+ import { GroupBankV2 } from '../script/groupBankV2';
13
+ import type { GroupStepNativeResultV2, GroupStepReferenceV2 } from '../script/groupStepV2';
14
+ import type { V2ColumnOwners } from '../script/observationColumnsV2';
15
+ import type { GroupBankValueV2 } from '@wildshard/format/scriptGroupBankV2';
16
+ import { GroupGuestBindingSchema, type GroupGuestBindingRows } from '@wildshard/format/groupBrains';
17
+
18
+
19
+ const packGuestReset=Object.freeze({pc:0,ret:0,try:0,candX:0,candZ:0,hit:0,spotX:0,spotZ:0,claim:0});
20
+ const packGuestResetFields=Object.freeze(Object.keys(packGuestReset));
21
+ interface PackMemberColumns<A extends AnimalSim> {
22
+ readonly scope:Scope;
23
+ readonly self:{readonly group:string;readonly slot:number;identity:string;actor:A|null};
24
+ player:V2ColumnOwners<A>['player'];observed:V2ColumnOwners<A>['observed'];
25
+ t:number;dt:number;context:NonNullable<V2ColumnOwners<A>['context']>;
26
+ environment:NonNullable<V2ColumnOwners<A>['environment']>;references:NonNullable<V2ColumnOwners<A>['references']>;
27
+ results:NonNullable<V2ColumnOwners<A>['results']>;
28
+ }
29
+
30
+ const packEmptyPlayer=Object.freeze({position:Object.freeze({x:0,z:0})});
31
+ const packEmptyObserved:ReadonlyMap<number,AnimalSim>=new Map();
32
+ const packEmptyReferences:NonNullable<V2ColumnOwners['references']>=new Map();
33
+ const packEmptyContext=Object.freeze({calm:true,playerSpeed:0}),packEmptyResults=Object.freeze({});
34
+ const packEmptyEnvironment:NonNullable<V2ColumnOwners['environment']>=Object.freeze({
35
+ playerCrouched:false,playerFwdX:0,playerFwdZ:0,playerMounted:false,playerHealth01:0,light:0,storm:false,
36
+ wind:Object.freeze({x:0,z:0,strength:0}),grassHeightAt:()=>{throw new Error('Inactive pack observation');},
37
+ });
38
+ function releasePackMembers<A extends AnimalSim>(members:readonly PackMemberColumns<A>[]):void{
39
+ for(let index=0;index<members.length;index++){
40
+ const member=members[index];if(member===undefined)continue;
41
+ member.self.actor=null;member.self.identity='';member.player=packEmptyPlayer;member.observed=packEmptyObserved;
42
+ member.context=packEmptyContext;member.environment=packEmptyEnvironment;member.references=packEmptyReferences;member.results=packEmptyResults;
43
+ }
44
+ }
45
+
46
+ /** The real pack controller is owned and snapshotted by its group host, not copied into the elite. */
47
+ export type HowlerPack<A extends AnimalSim> = Pick<StalkerBrain<A>, 'homeX' | 'homeZ' | 'phase' | 'awareness' | 'scare'>;
48
+ /** Native pack, shared AI stream, path and environment authority; presentation only answers named events. */
49
+ export interface HowlerPorts<A extends AnimalSim> {
50
+ readonly player: { readonly position: Vector3 }; readonly lair: { readonly x: number; readonly z: number };
51
+ readonly phase2: () => boolean; readonly pack: () => HowlerPack<A> | null;
52
+ readonly environment: () => { readonly playerCrouched: boolean; readonly playerFwdX: number; readonly playerFwdZ: number; readonly grassHeightAt: (x: number, z: number) => number };
53
+ readonly random: () => number;
54
+ readonly rings: { readonly setTime: (t: number) => void; readonly ring: (x: number, z: number, r: number, strength: number) => void; readonly hide: () => void };
55
+ readonly hurt: (a: A, amount: number) => void;
56
+ readonly regrouped: () => void; readonly interrupted: () => void; readonly closed: () => void;
57
+ readonly howl: (at: Vector3) => void; readonly signature: () => void;
58
+ }
59
+ const howlerScalar = v.pipe(v.number(), v.finite(), v.minValue(0), v.maxValue(600));
60
+ const howlerPositive = v.pipe(howlerScalar, v.minValue(Number.MIN_VALUE));
61
+ const speedValue = v.pipe(howlerScalar, v.maxValue(40)), turn = v.pipe(howlerScalar, v.maxValue(30));
62
+ const fraction = v.pipe(howlerScalar, v.maxValue(1));
63
+ const howlerField = v.pipe(v.string(), v.regex(/^[a-z][a-z0-9._:-]{0,127}$/u));
64
+ const HowlerSpecSchema: v.GenericSchema<BoundedHowlerSpecInput, BoundedHowlerSpec> = v.pipe(v.strictObject({
65
+ initialHowl: howlerScalar, engagedHowl: howlerScalar, phaseCooldown: howlerScalar, interruptedHowl: howlerScalar,
66
+ nextHowl: howlerScalar, randomHowl: howlerScalar, pathSeconds: howlerPositive, pathNear: howlerScalar, homePathSeconds: howlerPositive,
67
+ homeStop: howlerPositive, homeReset: howlerPositive, meleeRadius: howlerPositive, grassHeight: howlerScalar, hiddenDamage: howlerScalar,
68
+ fields: v.strictObject({ howl: howlerField, low: howlerField, snarl: howlerField }),
69
+ speeds: v.strictObject({ home: speedValue, watched: speedValue, hold: speedValue, hunt: speedValue, bite: speedValue }),
70
+ turns: v.strictObject({ home: turn, den: turn, hold: turn, howl: turn, hunt: turn, bite: turn }),
71
+ hold: v.strictObject({ watchedDot: fraction, minRadius: howlerPositive, maxRadius: howlerPositive, sidestep: howlerScalar, arrival: howlerPositive, watchedLow: fraction, low: fraction }),
72
+ hunt: v.strictObject({ snarlDistance: howlerScalar, attackDistance: howlerPositive, moveDistance: howlerScalar }),
73
+ bite: v.strictObject({ seconds: howlerPositive, phase: fraction, range: howlerPositive, damage: howlerScalar, cooldown: howlerScalar }),
74
+ howl: v.strictObject({ growSeconds: howlerPositive, seconds: howlerPositive, radius: howlerScalar, speed: howlerPositive, span: howlerPositive, strength: howlerScalar, stagger: howlerScalar, scare: howlerScalar }),
75
+ }), v.check(s => s.hold.minRadius <= s.hold.maxRadius && new Set(Object.values(s.fields)).size === 3,
76
+ 'Ordered hold radii and distinct pose fields'));
77
+ /** Strict declared pack-leader circling, howl and melee tuning. */
78
+ export type HowlerSpec = v.InferOutput<typeof HowlerSpecSchema>;
79
+ /** Validate and copy all tuning before a body or shared pack can be mutated. */
80
+ export function readHowlerSpec(value: unknown): HowlerSpec { return v.parse(HowlerSpecSchema, value); }
81
+
82
+ const howlerFinite = v.pipe(v.number(), v.finite());
83
+ const HowlerSaved: v.GenericSchema<BoundedHowlerSaveInput, BoundedHowlerSave> = v.strictObject({ st: v.picklist(['den', 'hold', 'howl', 'hunt', 'home']), howlT: howlerFinite, stT: howlerFinite,
84
+ howlHit: v.union([howlerFinite, v.literal(-Infinity)]), cd: howlerFinite, bit: v.boolean() });
85
+
86
+ /** One solid ledge observed by the native world; at most six are admitted per pouncer. */
87
+ export interface PouncerLedge { readonly x: number; readonly y: number; readonly z: number; readonly r: number }
88
+ /** The decision cadence and authoritative path query, separate from the fixed frame clock. */
89
+ export interface PouncerContext<A> { readonly dt: number; readonly player: Vector3; readonly pathYaw: (a: A, x: number, z: number, every: number) => number }
90
+ /** Explicit runtime/environment authority and presentation events; the controller never imports a world or view. */
91
+ export interface PouncerPorts<A> {
92
+ readonly player: { readonly position: Vector3 }; readonly lair: { readonly x: number; readonly z: number };
93
+ readonly ledges: readonly PouncerLedge[]; readonly heightAt: (x: number, z: number) => number; readonly phase2: () => boolean; readonly awareRadius: number;
94
+ readonly isHead: (a: A, point: Vector3) => boolean;
95
+ readonly ring: { readonly setTime: (t: number) => void; readonly ring: (x: number, z: number, radius: number, strength: number) => void; readonly hide: () => void };
96
+ readonly hurt: (a: A, amount: number) => void; readonly knock: (dx: number, dz: number) => void;
97
+ readonly opened: () => void; readonly growl: (at: Vector3) => void; readonly signature: () => void;
98
+ }
99
+ const pouncerScalar = v.pipe(v.number(), v.finite(), v.minValue(0), v.maxValue(600));
100
+ const pouncerPositive = v.pipe(pouncerScalar, v.minValue(Number.MIN_VALUE));
101
+ const pouncerField = v.pipe(v.string(), v.regex(/^[a-z][a-z0-9._:-]{0,127}$/u));
102
+ const PouncerSpecSchema: v.GenericSchema<BoundedPouncerSpecInput, BoundedPouncerSpec> = v.pipe(v.strictObject({
103
+ initialCooldown: pouncerScalar, awareCooldown: pouncerScalar, lookIdle: pouncerScalar, homeRadius: pouncerPositive, pathSeconds: pouncerPositive,
104
+ ledgeMargin: pouncerScalar, standRate: pouncerPositive, openSeconds: pouncerPositive, openCooldown: pouncerScalar,
105
+ fields: v.strictObject({ low: pouncerField, leap: pouncerField, snarl: pouncerField }),
106
+ pose: v.strictObject({ stalk: pouncerScalar, perch: pouncerScalar, open: pouncerScalar, leapSwing: pouncerScalar, leapBase: pouncerScalar }),
107
+ speeds: v.strictObject({ home: pouncerScalar, perch: pouncerScalar, stalk: pouncerScalar, back: v.pipe(v.number(), v.finite(), v.minValue(-15), v.maxValue(0)) }),
108
+ turns: v.strictObject({ home: pouncerScalar, idle: pouncerScalar, swipeStart: pouncerScalar, perch: pouncerScalar, stalk: pouncerScalar, tell: pouncerScalar, open: pouncerScalar, swipe: pouncerScalar }),
109
+ stalk: v.strictObject({ far: pouncerPositive, near: pouncerPositive }),
110
+ perch: v.strictObject({ minHeight: pouncerScalar, maxHeight: pouncerScalar, minDistance: pouncerScalar, maxDistance: pouncerScalar, arrival: pouncerPositive,
111
+ retreatHeight: pouncerScalar, retreatDistance: pouncerPositive, cooldown: pouncerScalar, waitSeconds: pouncerScalar }),
112
+ damage: v.strictObject({ airborne: pouncerScalar, openHead: pouncerScalar, perched: pouncerScalar }),
113
+ swipe: v.strictObject({ from: pouncerPositive, seconds: pouncerPositive, first: pouncerScalar, second: pouncerScalar, range: pouncerPositive, damage: pouncerScalar, cooldown: pouncerScalar }),
114
+ pounce: v.strictObject({ minDistance: pouncerScalar, maxDistance: pouncerScalar, seconds: pouncerPositive, arcHeight: pouncerScalar, range: pouncerPositive, damage: pouncerScalar, cooldown: pouncerScalar }),
115
+ tell: v.strictObject({ radius: pouncerPositive, strength: pouncerScalar, growth: pouncerScalar, growSeconds: pouncerPositive, seconds: pouncerPositive }),
116
+ }), v.check(s => s.stalk.near <= s.stalk.far && s.perch.minHeight <= s.perch.maxHeight
117
+ && s.perch.minDistance <= s.perch.maxDistance && s.pounce.minDistance <= s.pounce.maxDistance
118
+ && s.swipe.first < s.swipe.second && s.swipe.second <= 1 && new Set(Object.values(s.fields)).size === 3,
119
+ 'Ordered pounce ranges, strike fractions and distinct pose fields'));
120
+ /** Finite, strictly admitted pounce/swipe/ledge tuning; views and collision authority are supplied separately. */
121
+ export type PouncerSpec = v.InferOutput<typeof PouncerSpecSchema>;
122
+ /** Copy and validate all tuning before a controller, native body or callback can be mutated. */
123
+ export function readPouncerSpec(value: unknown): PouncerSpec { return v.parse(PouncerSpecSchema, value); }
124
+
125
+ const pouncerFinite = v.pipe(v.number(), v.finite()), pouncerTriple = v.tuple([pouncerFinite, pouncerFinite, pouncerFinite]);
126
+ const PouncerSaved: v.GenericSchema<BoundedPouncerSaveInput, BoundedPouncerSave> = v.strictObject({ st: v.picklist(['lurk', 'stalk', 'tell', 'leap', 'open', 'swipe', 'perch', 'home']), stT: pouncerFinite, cd: pouncerFinite,
127
+ from: pouncerTriple, to: pouncerTriple, goal: v.nullable(v.strictObject({ x: pouncerFinite, z: pouncerFinite, y: pouncerFinite })), hitDone: v.picklist([0, 1, 2]) });
128
+
129
+ /** Parameters for a circling melee archetype with idle wandering and subordinate scattering. */
130
+ export interface SkirmisherSpec {
131
+ awareRadius: number; shyRadius: number; disengageRadius: number; holdRadius: number; attackRadius: number;
132
+ attackDuration: number; attackCooldown: number; alertCooldown: number; fleeSpeed: number;
133
+ subordinateVariant: string; leaderVariant: string; noticeCue: string;
134
+ }
135
+ /** Host-owned perception, navigation and attack-token authority; no rendering or application singleton. */
136
+ export interface SkirmisherPorts<A extends AnimalSim> {
137
+ dt: number; player: { x: number; y: number; z: number }; calm: boolean;
138
+ rng: Pick<Rng, 'next' | 'range'>;
139
+ herd: readonly { variant: string; alive: boolean }[] | null;
140
+ sound: (cue: string) => void;
141
+ steer: (actor: A, yaw: number, speed: number, turnRate: number) => void;
142
+ confine: (actor: A) => void; claim: (actor: A) => boolean; mayAttack: (actor: A) => boolean;
143
+ }
144
+ interface SkirmisherMemory extends Record<string, number> {
145
+ init: number; hx: number; hz: number; st: number; tm: number; sd: number; cd: number; hitT: number; shy: number; scat: number;
146
+ wander: number; tx: number; tz: number; hit: number;
147
+ }
148
+ const ST_IDLE = 0, ST_ENGAGE = 1, ST_ATTACK = 2, ST_FLEE = 3;
149
+
150
+ /** Shared predator hunt phases; one decision clock serves every member. */
151
+ export type CirclingPackPhase = 'roam' | 'shadow' | 'encircle' | 'regroup' | 'break';
152
+ /** Host-owned prey identity, pose and damage recipe; no guest code chooses its target binding. */
153
+ export interface CirclingPackPrey {
154
+ readonly position: Vector3; readonly yaw: number; readonly alive: boolean;
155
+ readonly applyDamage: (amount: number, hitPoint: Vector3, dir: Vector3) => boolean;
156
+ }
157
+ /** Declared circling-pack tuning, independent of a shard, species rig or combat recipe. */
158
+ export interface CirclingPackSpec {
159
+ trotSpeed: number; runSpeed: number; shadowMinRadius: number; shadowMaxRadius: number;
160
+ ringMinRadius: number; ringMaxRadius: number; biteRadius: number;
161
+ sightRadius: number; coneAngle: number; smellRadius: number; hearing: readonly [number, number, number, number];
162
+ telegraphSeconds: number; dashSeconds: number; breakoffSeconds: number; attackSeconds: number;
163
+ leaderVariant: string; yipCue: string; howlCue: string; snarlCue: string; biteCue: string;
164
+ }
165
+ /** Caller-owned AI or body tick; motion, pathfinding and attack-token authority stay with the host. */
166
+ export interface CirclingPackContext<A extends AnimalSim> {
167
+ dt: number; t: number; player: Vector3; playerSpeed: number; calm: boolean; rng: Rng;
168
+ sound: (cue: string) => void; claim: (actor: A) => boolean;
169
+ steer: (actor: A, yaw: number, speed: number, turnRate: number) => void;
170
+ pathYaw: (actor: A, x: number, z: number, every?: number) => number;
171
+ }
172
+ /** Trusted shared observations, terrain, token registration and strike recipe. */
173
+ export interface CirclingPackPorts<A extends AnimalSim> {
174
+ sharedRng: () => Rng;
175
+ environment: () => { playerFwdX: number; playerFwdZ: number; playerMounted: boolean; playerHealth01: number; grassHeightAt: (x: number, z: number) => number };
176
+ visibility: (x: number, z: number, player: Vector3, speed: number, time: number) => number;
177
+ hearing: (radii: readonly [number, number, number, number], player: Vector3, speed: number) => number;
178
+ downwind: (x: number, z: number, player: Vector3) => boolean;
179
+ inBounds: (x: number, z: number, margin: number) => boolean; normalY: (x: number, z: number) => number;
180
+ register: (actor: A, director: AggressionDirector<A>) => void;
181
+ bite: (actor: A, context: CirclingPackContext<A>, radius: number) => void;
182
+ onEvent?: (event: string, x: number, z: number) => void;
183
+ preyIdentity?: (prey: CirclingPackPrey) => string;
184
+ resolvePrey?: (id: string) => CirclingPackPrey | null;
185
+ }
186
+ const packFinite = v.pipe(v.number(), v.finite());
187
+ const packContinuation = v.strictObject({ contract: v.string(), group: v.string(), alpha: v.nullable(v.string()),
188
+ prey: v.nullable(v.string()), pendingPrey: v.nullable(v.string()),
189
+ state: v.strictObject({ initialized: v.boolean(), phase: v.picklist(['roam', 'shadow', 'encircle', 'regroup', 'break']), awareness: packFinite,
190
+ homeX: packFinite, homeZ: packFinite, phaseT: packFinite, roamX: packFinite, roamZ: packFinite, roamT: packFinite, nextTokenT: packFinite,
191
+ boldT: packFinite, calmT: packFinite, hpStart: packFinite, halfDone: v.boolean(), deadSeen: packFinite,
192
+ shadowDur: packFinite, howled: v.boolean(), bites: packFinite, scared: v.boolean() }) });
193
+ const ROLE_ALPHA = 0, ROLE_FLANK = 1, ROLE_SCOUT = 2;
194
+ const _t = new Vector3();
195
+ const ease = (cur: number, to: number, k: number): number => cur + (to - cur) * Math.min(1, k);
196
+ const angDiff = (a: number, b: number): number => Math.atan2(Math.sin(a - b), Math.cos(a - b));
197
+ function validatePack(spec: CirclingPackSpec): CirclingPackSpec {
198
+ const numbers = [spec.trotSpeed, spec.runSpeed, spec.shadowMinRadius, spec.shadowMaxRadius, spec.ringMinRadius, spec.ringMaxRadius,
199
+ spec.biteRadius, spec.sightRadius, spec.coneAngle, spec.smellRadius, ...spec.hearing, spec.telegraphSeconds, spec.dashSeconds, spec.breakoffSeconds, spec.attackSeconds];
200
+ if (numbers.some(value => !Number.isFinite(value) || value < 0 || value > 600) || spec.runSpeed > 15 || spec.trotSpeed > spec.runSpeed
201
+ || spec.shadowMinRadius > spec.shadowMaxRadius || spec.ringMinRadius > spec.ringMaxRadius || spec.coneAngle > Math.PI
202
+ || Math.min(spec.telegraphSeconds, spec.dashSeconds, spec.breakoffSeconds, spec.attackSeconds) <= 0
203
+ || [spec.leaderVariant, spec.yipCue, spec.howlCue, spec.snarlCue, spec.biteCue].some(value => value.length === 0 || value.length > 128)) throw new Error('Invalid pack parameters');
204
+ return { ...spec, hearing: [...spec.hearing] };
205
+ }
206
+
207
+ /** Circling melee, pack-leader howl or ledge pounce; native encounter and body authority remain explicit ports. */
208
+ export type StalkerProfile<A extends AnimalSim> =
209
+ | { pattern: 'hunt'; config: HuntConfig; ports: HuntPorts<A>; player: Vector3; sampleTerrain: (actor: A) => void }
210
+ | { pattern: 'pack'; spec: CirclingPackSpec; ports: CirclingPackPorts<A>; members: A[]; home: { x: number; z: number } }
211
+ | { pattern: 'skirmish'; spec: SkirmisherSpec }
212
+ | { pattern: 'howler'; spec: HowlerSpec; ports: HowlerPorts<A> }
213
+ | { pattern: 'pouncer'; spec: PouncerSpec; ports: PouncerPorts<A> };
214
+ /** Caller-scheduled perception; phase/body updates retain the original separately scheduled frame methods. */
215
+ export type StalkerObservation<A extends AnimalSim> =
216
+ | (SkirmisherPorts<A> & { pattern: 'skirmish' })
217
+ | (PouncerContext<A> & { pattern: 'howler' | 'pouncer' });
218
+ function admitProfile<A extends AnimalSim>(profile: StalkerProfile<A>): StalkerProfile<A> {
219
+ if (profile.pattern === 'hunt') return profile;
220
+ if (profile.pattern === 'pack') return { ...profile, spec: validatePack(profile.spec) };
221
+ if (profile.pattern === 'howler') return { ...profile, spec: readHowlerSpec(profile.spec) };
222
+ if (profile.pattern === 'pouncer') {
223
+ const spec = readPouncerSpec(profile.spec);
224
+ if (profile.ports.ledges.length > 6) throw new RangeError('Pouncer ledge bound exceeded');
225
+ return { ...profile, spec };
226
+ }
227
+ const { spec } = profile;
228
+ const numbers = [spec.awareRadius, spec.shyRadius, spec.disengageRadius, spec.holdRadius, spec.attackRadius, spec.attackDuration, spec.attackCooldown, spec.alertCooldown, spec.fleeSpeed];
229
+ if (numbers.some(n => !Number.isFinite(n) || n < 0 || n > 600) || spec.shyRadius > spec.awareRadius || spec.awareRadius > spec.disengageRadius || spec.attackRadius > spec.awareRadius || spec.attackDuration <= 0 || spec.fleeSpeed > 15
230
+ || [spec.subordinateVariant, spec.leaderVariant, spec.noticeCue].some(value => value.length === 0 || value.length > 128)) throw new Error('Invalid skirmisher parameters');
231
+ return { pattern: 'skirmish', spec: { ...spec } };
232
+ }
233
+ /** One parametric stalker decision/clock owner, preserving native presets and their exact continuation shapes. */
234
+ export class StalkerBrain<A extends AnimalSim> extends HuntingStalkerCore<A> {
235
+ private readonly profile: StalkerProfile<A>;
236
+ private readonly contract: string;
237
+ private reportedSkirmishStep = false;
238
+ private st: v.InferOutput<typeof HowlerSaved>['st'] | v.InferOutput<typeof PouncerSaved>['st'] = 'den';
239
+ private stT = 0; private cd = 0; private howlT = 0; private howlHit = -1; private bit = false; private hitDone = 0;
240
+ private readonly back = new Vector3();
241
+ private readonly from = new Vector3(); private readonly to = new Vector3();
242
+ private goal: { x: number; z: number; y: number } | null = null;
243
+ private readonly goalPoint = { x: 0, z: 0, y: 0 };
244
+ private readonly playerDelta = { d: 0, yaw: 0 };
245
+ constructor(profile: StalkerProfile<A>) {
246
+ super(profile.pattern === 'pack' ? profile.members : [], profile.pattern === 'hunt' ? profile : undefined);
247
+ this.profile = admitProfile(profile);
248
+ this.contract = this.profile.pattern === 'hunt' ? '' : this.profile.pattern === 'pack' ? JSON.stringify(this.profile.spec) : JSON.stringify({ version: 1, spec: this.profile.spec });
249
+ if (this.profile.pattern === 'pack') {
250
+ const members = this.members, homeX = this.profile.home.x, homeZ = this.profile.home.z;
251
+ if (members.length === 0 || members.length > 128 || new Set(members.map(actor => actor.entityId)).size !== members.length
252
+ || !Number.isFinite(homeX) || !Number.isFinite(homeZ)) throw new Error('Invalid pack roster');
253
+ this.homeX = this.roamX = homeX; this.homeZ = this.roamZ = homeZ;
254
+ // roles: the alpha variant (else the biggest) leads; the smallest of a 4–5 pack scouts
255
+ let big: A | null = null;
256
+ for (const w of members) {
257
+ if (w.variant === this.packSpec.leaderVariant || big === null || (big.variant !== this.packSpec.leaderVariant && w.scale > big.scale)) big = w;
258
+ }
259
+ this.alpha = big;
260
+ for (const w of members) this.hpStart += w.maxHp;
261
+ return;
262
+ }
263
+ if (this.profile.pattern === 'howler') this.howlT = this.profile.spec.initialHowl;
264
+ else if (this.profile.pattern === 'pouncer') { this.st = 'lurk'; this.cd = this.profile.spec.initialCooldown; }
265
+ }
266
+ /** Borrow the roster's noise/sight continuation and scheduler. Combined wakes
267
+ * request one urgent decision; interrupt wakes precede the ordinary decision.
268
+ * A policy with state:'owned' keeps its own dead/stunned checks. Its sample
269
+ * runs only before a due normal decision, never on an interrupt wake.
270
+ * Both callbacks receive the original roster actor, allowing one policy
271
+ * to serve newly joined bodies without constructing their observations.
272
+ * This driver owns no save state, actor, clock, body step or random stream.
273
+ */
274
+ bindRoster<B>(ports: {
275
+ readonly limit: number; readonly order: 'combined' | 'interrupt';
276
+ readonly at: (index: number) => B | null | undefined;
277
+ readonly actor: (body: B) => A | null; readonly id: (body: B) => string;
278
+ readonly player: Vector3; readonly sight: (boolean | null | undefined)[];
279
+ readonly noise: { seen: boolean; prev: Vector3; speed: number };
280
+ readonly reach: (actor: A, player: Vector3) => boolean;
281
+ readonly brainDt: (id: string, urgent?: boolean) => number;
282
+ readonly policy?: (body: B) => { readonly decide: (dt: number, actor: A) => void; readonly state?: 'owned'; readonly sample?: (actor: A) => void } | null;
283
+ readonly herd?: (body: B) => number;
284
+ readonly beforeDecisions?: () => void;
285
+ }): {
286
+ readonly observe: (dt: number) => void; readonly decide: () => void;
287
+ readonly wake: (body: B | null | undefined) => void;
288
+ readonly damaged: (target: unknown, killed: boolean) => void;
289
+ } {
290
+ if (!Number.isInteger(ports.limit) || ports.limit < 1 || ports.limit > 512
291
+ || !['combined', 'interrupt'].includes(ports.order)) throw new RangeError('Invalid hunt roster cadence');
292
+ const { player, noise, sight } = ports;
293
+ const reported = new WeakSet<A>();
294
+ const refused = (actor: A, error: unknown): void => {
295
+ if (!reported.has(actor)) { reported.add(actor); emitFault({system: 'ai.roster', error, verdict: 'retry'}); }
296
+ };
297
+ const run = (body: B, actor: A, dt: number): void => {
298
+ const policy = ports.policy?.(body) ?? null;
299
+ if (policy === null) { this.think(actor, dt, player, false, noise.speed); return; }
300
+ if (policy.state === 'owned') { policy.decide(dt, actor); return; }
301
+ if (!actor.alive) { actor.lookWeight = 0; return; }
302
+ if (actor.stunned) { actor.setMotion(actor.yaw, 0, 1); actor.setStrafe(0); actor.lookTarget.copy(player); actor.lookWeight = 1; return; }
303
+ policy.decide(dt, actor);
304
+ const index = ports.herd?.(body), herd = index === undefined ? undefined : this.herds[index];
305
+ if (herd !== undefined) this.updateHerd(herd);
306
+ };
307
+ const wakeFrame = (body: B | null | undefined): boolean => {
308
+ if (body === undefined || body === null) return true;
309
+ const actor = ports.actor(body); if (actor === null || !actor.alive) return true;
310
+ try {
311
+ const dt = ports.brainDt(ports.id(body), true);
312
+ if (ports.order === 'interrupt' || dt > 0) run(body, actor, dt);
313
+ return true;
314
+ } catch (error) { refused(actor, error); return false; }
315
+ };
316
+ const wake = (body: B | null | undefined): void => { wakeFrame(body); };
317
+ return {
318
+ observe: dt => {
319
+ if (!Number.isFinite(dt) || dt <= 0) throw new RangeError('Invalid hunt noise step');
320
+ if (!noise.seen) { noise.prev.copy(player); noise.seen = true; }
321
+ const moved = Math.hypot(player.x - noise.prev.x, player.z - noise.prev.z);
322
+ noise.prev.copy(player);
323
+ // oxlint-disable-next-line prefer-exponentiation-operator -- `**` never reaches the portable Math (test/portable-math.test.ts).
324
+ noise.speed += (Math.min(moved / dt, 9) - noise.speed) * (1 - Math.pow(0.5, dt * 10));
325
+ },
326
+ decide: () => {
327
+ this.resetRepaths();
328
+ ports.beforeDecisions?.();
329
+ for (let i = 0; i < ports.limit; i++) {
330
+ const body = ports.at(i); if (body === undefined || body === null) continue;
331
+ const actor = ports.actor(body); if (actor === null) continue;
332
+ try {
333
+ let urgent = false;
334
+ if (actor.alive && actor.aggressive && (actor.state === 'charge' || actor.state === 'stalk' || actor.state === 'alert')) {
335
+ const clear = ports.reach(actor, player); urgent = sight[i] === true && !clear;
336
+ if (ports.order === 'interrupt' && urgent && !wakeFrame(body)) continue;
337
+ sight[i] = clear;
338
+ }
339
+ const dt = ports.brainDt(ports.id(body), ports.order === 'combined' ? urgent : undefined);
340
+ if (dt > 0) { ports.policy?.(body)?.sample?.(actor); run(body, actor, dt); }
341
+ } catch (error) { refused(actor, error); }
342
+ }
343
+ },
344
+ wake,
345
+ damaged: (target, killed) => {
346
+ for (let i = 0; i < ports.limit; i++) {
347
+ const body = ports.at(i); if (body === undefined || body === null || (ports.policy?.(body) ?? null) !== null) continue;
348
+ const actor = ports.actor(body); if (actor === null || actor.combatActor() !== target) continue;
349
+ if (killed) this.died(actor); else { this.hurt(actor); wake(body); }
350
+ return;
351
+ }
352
+ },
353
+ };
354
+ }
355
+ private get howlerSpec(): HowlerSpec { const p = this.profile; if (p.pattern !== 'howler') throw new Error('Incompatible stalker pattern'); return p.spec; }
356
+ private get howlerPorts(): HowlerPorts<A> { const p = this.profile; if (p.pattern !== 'howler') throw new Error('Incompatible stalker pattern'); return p.ports; }
357
+ private get pouncerSpec(): PouncerSpec { const p = this.profile; if (p.pattern !== 'pouncer') throw new Error('Incompatible stalker pattern'); return p.spec; }
358
+ private get pouncerPorts(): PouncerPorts<A> { const p = this.profile; if (p.pattern !== 'pouncer') throw new Error('Incompatible stalker pattern'); return p.ports; }
359
+ private get skirmishSpec(): SkirmisherSpec { const p = this.profile; if (p.pattern !== 'skirmish') throw new Error('Incompatible stalker pattern'); return p.spec; }
360
+ /** Native phase, with skirmish phases held separately in the actor memory snapshot. */
361
+ get state(): string { if (this.profile.pattern === 'hunt') throw new Error('Hunt phases remain actor-owned'); if (this.profile.pattern === 'pack') return this.phase; if (this.profile.pattern === 'skirmish') throw new Error('Skirmish phase remains actor-owned'); return this.st; }
362
+ /** Preserve the legacy contract/object shape; no observation, body callback or RNG is read. */
363
+ snapshot(): SimValue { if (this.profile.pattern === 'hunt') throw new Error('Hunt continuation remains roster-owned'); if (this.profile.pattern === 'pack') return this.snapshotPack(); return this.profile.pattern === 'skirmish' ? this.contract : this.profile.pattern === 'howler' ? this.howlerSnapshot() : this.pouncerSnapshot(); }
364
+ /** Validate a full pattern continuation before mutation, never replaying gameplay. */
365
+ restore(saved: unknown): void {
366
+ if (this.profile.pattern === 'hunt') throw new Error('Hunt continuation remains roster-owned');
367
+ if (this.profile.pattern === 'pack') { if (typeof saved !== 'string') throw new Error('Invalid pack continuation'); this.restorePack(saved); return; }
368
+ if (this.profile.pattern === 'howler') this.howlerRestore(saved);
369
+ else if (this.profile.pattern === 'pouncer') this.pouncerRestore(saved);
370
+ else if (saved !== this.contract) throw new Error('Incompatible skirmisher continuation');
371
+ }
372
+ /** Admit the complete native continuation without allocation, callbacks or mutation.
373
+ * Commit only after the surrounding owner has admitted its whole save bank. */
374
+ prepareRestore(saved: unknown): () => void {
375
+ if (this.profile.pattern === 'howler') { const state = v.parse(HowlerSaved, saved); return () => { this.howlerRestore(state); }; }
376
+ if (this.profile.pattern === 'pouncer') { const state = v.parse(PouncerSaved, saved); return () => { this.pouncerRestore(state); }; }
377
+ throw new Error('Pattern continuation is not owned by the native encounter');
378
+ }
379
+ /** Observe on the original native manager cadence; mismatched ports refuse before effects. */
380
+ think(a: A, c: StalkerObservation<A>): void;
381
+ think(a: A, dt: number, player: Vector3, sprinting: boolean, playerSpeed: number): void;
382
+ think(a: A, c: StalkerObservation<A> | number, player?: Vector3, sprinting?: boolean, playerSpeed?: number): void {
383
+ if (typeof c === 'number') {
384
+ if (this.profile.pattern !== 'hunt' || player === undefined || sprinting === undefined || playerSpeed === undefined) throw new Error('Incompatible stalker hunt observation');
385
+ this.decideHunt(a, c, player, sprinting, playerSpeed); return;
386
+ }
387
+ if (c.pattern !== this.profile.pattern) throw new Error('Incompatible stalker observation');
388
+ if (c.pattern === 'skirmish') this.skirmishThink(a, c);
389
+ else if (c.pattern === 'howler') this.howlerThink(a, c);
390
+ else this.pouncerThink(a, c);
391
+ }
392
+ /** Allocation-free native skirmish perception on the existing manager cadence. */
393
+ decideSkirmisher(a: A, c: SkirmisherPorts<A>): void { if (this.profile.pattern !== 'skirmish') throw new Error('Incompatible stalker observation'); this.skirmishThink(a, c); }
394
+ /** Allocation-free native howl perception on the existing manager cadence. */
395
+ decideHowler(a: A, c: PouncerContext<A>): void { if (this.profile.pattern !== 'howler') throw new Error('Incompatible stalker observation'); this.howlerThink(a, c); }
396
+ /** Allocation-free native pounce perception on the existing manager cadence. */
397
+ decidePouncer(a: A, c: PouncerContext<A>): void { if (this.profile.pattern !== 'pouncer') throw new Error('Incompatible stalker observation'); this.pouncerThink(a, c); }
398
+ /** Deliver the committed melee/swipe contacts on the native body attack phase. */
399
+ act(a: A): void { if (this.profile.pattern === 'howler') this.howlerAct(a); else if (this.profile.pattern === 'pouncer') this.pouncerAct(a); else throw new Error('Skirmish contacts remain body-owned'); }
400
+ /** Advance the existing encounter-frame law without changing callback or shared-RNG order. */
401
+ advance(a: A | null, dt: number, t: number, engaged: boolean, leashing: boolean): void {
402
+ if (this.profile.pattern === 'howler') this.howlerTick(a, dt, t, engaged, leashing);
403
+ else if (this.profile.pattern === 'pouncer') this.pouncerTick(a, dt, t, engaged, leashing);
404
+ else throw new Error('Skirmish body remains host-owned');
405
+ }
406
+ /** Reset the original deferred-spawn state; retain all other clocks exactly as the preset does. */
407
+ spawned(a?: A): void {
408
+ if (this.profile.pattern === 'pouncer') this.pouncerSpawned();
409
+ else if (this.profile.pattern === 'howler' && a !== undefined) this.howlerSpawned(a);
410
+ else throw new Error('Missing stalker spawn authority');
411
+ }
412
+ /** Leash to the native home and clear only the preset's transient tell/pose fields. */
413
+ reset(a: A | null): void { if (this.profile.pattern === 'howler') this.howlerReset(a); else if (this.profile.pattern === 'pouncer') this.pouncerReset(a); else throw new Error('Skirmish state remains actor-owned'); }
414
+ /** Hide the current entered tell without discarding native continuation. */
415
+ disposeTell(): void { if (this.profile.pattern === 'howler') this.howlerDisposeTell(); else if (this.profile.pattern === 'pouncer') this.pouncerDisposeTell(); }
416
+ /** Original authoritative-contact weak-point law. */
417
+ damage(a: A, point: Vector3): number { if (this.profile.pattern === 'howler') return this.howlerDamage(a, point); if (this.profile.pattern === 'pouncer') return this.pouncerDamage(a, point); throw new Error('Skirmish damage remains body-owned'); }
418
+ /** Regroup the already owned pack and enter the native melee phase. */
419
+ enterPhase2(a: A | null): void { if (this.profile.pattern !== 'howler') throw new Error('Incompatible stalker phase transition'); this.howlerEnterPhase2(a); }
420
+ private howlerState(): v.InferOutput<typeof HowlerSaved>['st'] {
421
+ const state = this.st;
422
+ if (state === 'den' || state === 'hold' || state === 'howl' || state === 'hunt' || state === 'home') return state;
423
+ throw new Error('Incompatible howler phase');
424
+ }
425
+ private pouncerPhase(): v.InferOutput<typeof PouncerSaved>['st'] {
426
+ const state = this.st;
427
+ if (state === 'lurk' || state === 'stalk' || state === 'tell' || state === 'leap' || state === 'open' || state === 'swipe' || state === 'perch' || state === 'home') return state;
428
+ throw new Error('Incompatible pouncer phase');
429
+ }
430
+ private get howlerP2(): boolean { return this.howlerPorts.phase2(); }
431
+ private get howlerPack(): HowlerPack<A> | null { return this.howlerPorts.pack(); }
432
+ /** Initialize the existing deferred-spawn howl clock. */
433
+ private howlerSpawned(a: A): void { a.mem[this.howlerSpec.fields.howl] = 0; this.st = 'den'; this.howlT = this.howlerSpec.initialHowl; }
434
+ /** Return home and hide the transient tell without resetting retained clocks. */
435
+ private howlerReset(a: A | null): void { this.st = 'home'; this.howlerPorts.rings.hide(); if (a !== null) a.mem[this.howlerSpec.fields.howl] = 0; }
436
+ /** Hide entered presentation without discarding the pack continuation. */
437
+ private howlerDisposeTell(): void { this.howlerPorts.rings.hide(); }
438
+ private howlerToPlayer(a: A): { d: number; yaw: number } {
439
+ const p = this.howlerPorts.player.position;
440
+ this.playerDelta.d = Math.hypot(p.x - a.position.x, p.z - a.position.z);
441
+ this.playerDelta.yaw = Math.atan2(p.x - a.position.x, p.z - a.position.z); return this.playerDelta;
442
+ }
443
+ private howlerGoHome(a: A, c: PouncerContext<A>, speed: number): void {
444
+ const L = this.howlerPorts.lair; a.setMotion(c.pathYaw(a, L.x, L.z, this.howlerSpec.homePathSeconds), Math.hypot(L.x - a.position.x, L.z - a.position.z) > this.howlerSpec.homeStop ? speed : 0, this.howlerSpec.turns.home);
445
+ }
446
+ private howlerChase(a: A, c: PouncerContext<A>, d: number, yaw: number): number { return d > this.howlerSpec.pathNear ? c.pathYaw(a, c.player.x, c.player.z, this.howlerSpec.pathSeconds) : yaw; }
447
+ private howlerMelee(p: Vector3): boolean { const pl = this.howlerPorts.player.position; return Math.hypot(p.x - pl.x, p.z - pl.z) < this.howlerSpec.meleeRadius; }
448
+ /** Regroup the real pack at its leader and begin the melee phase. */
449
+ private howlerEnterPhase2(a: A | null): void {
450
+ if (this.howlerPack && a) { this.howlerPack.homeX = a.position.x; this.howlerPack.homeZ = a.position.z; this.howlerPack.phase = 'regroup'; }
451
+ this.st = 'hunt'; this.cd = this.howlerSpec.phaseCooldown;
452
+ this.howlerPorts.regrouped();
453
+ }
454
+ /** Compute the hidden ranged weak point from authoritative player/grass queries. */
455
+ private howlerDamage(a: A, p: Vector3): number {
456
+ const wildEnv = this.howlerPorts.environment();
457
+ // the weak point: an arrow from HIDDEN (crouched in tall grass) — and she is never soft in the howl
458
+ const pl = this.howlerPorts.player.position;
459
+ const hidden = wildEnv.playerCrouched && wildEnv.grassHeightAt(pl.x, pl.z) > this.howlerSpec.grassHeight;
460
+ void a;
461
+ return !this.howlerMelee(p) && hidden ? this.howlerSpec.hiddenDamage : 1;
462
+ }
463
+ /** Decide on the native manager cadence with actual path and gaze authority. */
464
+ private howlerThink(a: A, c: PouncerContext<A>): void {
465
+ const wildEnv = this.howlerPorts.environment();
466
+ const tp = this.howlerToPlayer(a);
467
+ a.lookTarget.copy(c.player); a.lookWeight = 1;
468
+ this.cd -= c.dt;
469
+ switch (this.howlerState()) {
470
+ case 'den': a.setMotion(tp.yaw, 0, this.howlerSpec.turns.den); break;
471
+ case 'home': this.howlerGoHome(a, c, this.howlerSpec.speeds.home); if (Math.hypot(a.position.x - this.howlerPorts.lair.x, a.position.z - this.howlerPorts.lair.z) < this.howlerSpec.homeReset) this.st = 'den'; break;
472
+ case 'hold': {
473
+ // 24–32 m out (close enough to read her over the grass), sliding round you — and off your line of sight when you look at her
474
+ const lookX = wildEnv.playerFwdX, lookZ = wildEnv.playerFwdZ;
475
+ const ux = (a.position.x - c.player.x) / Math.max(1, tp.d), uz = (a.position.z - c.player.z) / Math.max(1, tp.d);
476
+ const watched = lookX * ux + lookZ * uz > this.howlerSpec.hold.watchedDot;
477
+ const side = watched ? 1 : 0;
478
+ const r = MathUtils.clamp(tp.d, this.howlerSpec.hold.minRadius, this.howlerSpec.hold.maxRadius);
479
+ const ang = Math.atan2(ux, uz) + side * this.howlerSpec.hold.sidestep;
480
+ const gx = c.player.x + Math.sin(ang) * r, gz = c.player.z + Math.cos(ang) * r;
481
+ const gd = Math.hypot(gx - a.position.x, gz - a.position.z);
482
+ a.setMotion(gd > this.howlerSpec.hold.arrival ? Math.atan2(gx - a.position.x, gz - a.position.z) : tp.yaw, gd > this.howlerSpec.hold.arrival ? (watched ? this.howlerSpec.speeds.watched : this.howlerSpec.speeds.hold) : 0, this.howlerSpec.turns.hold);
483
+ a.mem[this.howlerSpec.fields.low] = watched ? this.howlerSpec.hold.watchedLow : this.howlerSpec.hold.low;
484
+ break;
485
+ }
486
+ case 'howl': a.setMotion(a.yaw, 0, this.howlerSpec.turns.howl); break;
487
+ case 'hunt': {
488
+ a.mem[this.howlerSpec.fields.low] = 0; a.mem[this.howlerSpec.fields.snarl] = tp.d < this.howlerSpec.hunt.snarlDistance ? 1 : 0;
489
+ if (a.attackPhase >= 0) break;
490
+ if (tp.d < this.howlerSpec.hunt.attackDistance && this.cd <= 0) { this.bit = false; a.startAttack(this.howlerSpec.bite.seconds); break; }
491
+ a.setMotion(this.howlerChase(a, c, tp.d, tp.yaw), tp.d > this.howlerSpec.hunt.moveDistance ? this.howlerSpec.speeds.hunt : 0, this.howlerSpec.turns.hunt);
492
+ break;
493
+ }
494
+ default: break;
495
+ }
496
+ }
497
+ /** Deliver the committed bite on the actual body attack phase, once. */
498
+ private howlerAct(a: A): void {
499
+ if (this.st !== 'hunt' || a.attackPhase < 0) return;
500
+ const tp = this.howlerToPlayer(a);
501
+
502
+ a.setMotion(tp.yaw, this.howlerSpec.speeds.bite, this.howlerSpec.turns.bite);
503
+ if (a.attackPhase >= this.howlerSpec.bite.phase && !this.bit) { this.bit = true; if (tp.d < this.howlerSpec.bite.range) this.howlerPorts.hurt(a, this.howlerSpec.bite.damage); }
504
+ if (a.attackPhase >= 1) { a.cancelAttack(); this.cd = this.howlerSpec.bite.cooldown; }
505
+ }
506
+ /** Advance the encounter frame law and consume shared RNG only when a howl completes. */
507
+ private howlerTick(a: A | null, dt: number, t: number, engaged: boolean, leashing: boolean): void {
508
+ if (a === null) return;
509
+ this.howlerPorts.rings.setTime(t);
510
+ if (leashing && this.st !== 'home') this.st = 'home';
511
+ if (engaged && (this.st === 'den' || this.st === 'home')) { this.st = this.howlerP2 ? 'hunt' : 'hold'; this.howlT = this.howlerSpec.engagedHowl; }
512
+ this.stT += dt;
513
+ if (this.st === 'hold' && !this.howlerP2) {
514
+ this.howlT -= dt;
515
+ if (this.howlT <= 0) { this.st = 'howl'; this.stT = 0; this.howlHit = a.lastHitT; this.howlerPorts.signature(); this.howlerPorts.howl(a.position); }
516
+ }
517
+ if (this.st === 'howl') {
518
+ a.mem[this.howlerSpec.fields.howl] = Math.min(1, this.stT / this.howlerSpec.howl.growSeconds);
519
+ // pale rings ripple out from her
520
+ this.howlerPorts.rings.ring(a.position.x, a.position.z, this.howlerSpec.howl.radius + ((this.stT * this.howlerSpec.howl.speed) % this.howlerSpec.howl.span), this.howlerSpec.howl.strength * (1 - ((this.stT * this.howlerSpec.howl.speed) % this.howlerSpec.howl.span) / this.howlerSpec.howl.span));
521
+ if (a.lastHitT > this.howlHit) {
522
+ // hit mid-howl: it breaks — she staggers, the pack scatters
523
+ a.mem[this.howlerSpec.fields.howl] = 0; this.howlerPorts.rings.hide();
524
+ this.back.set(Math.sin(a.yaw), 0, Math.cos(a.yaw)).negate(); a.stagger(this.back, this.howlerSpec.howl.stagger);
525
+ this.howlerPack?.scare(a.position.x, a.position.z, this.howlerSpec.howl.scare);
526
+ this.howlerPorts.interrupted();
527
+ this.st = 'hold'; this.howlT = this.howlerSpec.interruptedHowl;
528
+ } else if (this.stT > this.howlerSpec.howl.seconds) {
529
+ a.mem[this.howlerSpec.fields.howl] = 0; this.howlerPorts.rings.hide();
530
+ if (this.howlerPack) { this.howlerPack.awareness = 1; this.howlerPack.phase = 'encircle'; }
531
+ this.howlerPorts.closed();
532
+ this.st = 'hold'; this.howlT = this.howlerSpec.nextHowl + this.howlerPorts.random() * this.howlerSpec.randomHowl;
533
+ }
534
+ } else if (a.mem[this.howlerSpec.fields.howl] !== 0) a.mem[this.howlerSpec.fields.howl] = 0;
535
+ }
536
+ /** Capture every custom clock without drawing RNG or emitting events. */
537
+ howlerSnapshot(): v.InferOutput<typeof HowlerSaved> { if (this.profile.pattern !== 'howler') throw new Error('Incompatible stalker snapshot'); return { st: this.howlerState(), howlT: this.howlT, stT: this.stT, howlHit: this.howlHit, cd: this.cd, bit: this.bit }; }
538
+ /** Strictly validate the full continuation before any mutation. */
539
+ private howlerRestore(input: unknown): void { const s = v.parse(HowlerSaved, input); this.st = s.st; this.howlT = s.howlT; this.stT = s.stT; this.howlHit = s.howlHit; this.cd = s.cd; this.bit = s.bit; }
540
+ /** Current stalking, tell, leap, swipe, retreat or home phase. */
541
+ private get pouncerP2(): boolean { return this.pouncerPorts.phase2(); }
542
+ /** Reset the shipping spawn state; other clocks remain retained as on the page. */
543
+ private pouncerSpawned(): void { this.st = 'lurk'; this.cd = this.pouncerSpec.initialCooldown; }
544
+ /** Leash home and clear the transient tell and pose fields. */
545
+ private pouncerReset(a: A | null): void { this.st = 'home'; this.pouncerPorts.ring.hide(); if (a !== null) { a.mem[this.pouncerSpec.fields.leap] = 0; a.mem[this.pouncerSpec.fields.low] = 0; } }
546
+ /** Hide the transient tell without discarding the retained controller. */
547
+ private pouncerDisposeTell(): void { this.pouncerPorts.ring.hide(); }
548
+ private pouncerToPlayer(a: A): { d: number; yaw: number } {
549
+ const p = this.pouncerPorts.player.position, dx = p.x - a.position.x, dz = p.z - a.position.z;
550
+ this.playerDelta.d = Math.hypot(dx, dz); this.playerDelta.yaw = Math.atan2(dx, dz); return this.playerDelta;
551
+ }
552
+ private pouncerGoHome(a: A, c: PouncerContext<A>, speed: number): void {
553
+ const L = this.pouncerPorts.lair, dx = L.x - a.position.x, dz = L.z - a.position.z;
554
+ a.setMotion(c.pathYaw(a, L.x, L.z, 2), Math.hypot(dx, dz) > this.pouncerSpec.homeRadius ? speed : 0, this.pouncerSpec.turns.home);
555
+ }
556
+ private pouncerChase(a: A, c: PouncerContext<A>, d: number, yaw: number, near: number): number { return d > near ? c.pathYaw(a, c.player.x, c.player.z, this.pouncerSpec.pathSeconds) : yaw; }
557
+ private pouncerStandY(x: number, z: number): number {
558
+ let y = this.pouncerPorts.heightAt(x, z);
559
+ for (let i = 0; i < 6; i++) { const l = this.pouncerPorts.ledges[i]; if (l === undefined) break; if (Math.hypot(x - l.x, z - l.z) < l.r + this.pouncerSpec.ledgeMargin) y = Math.max(y, l.y); }
560
+ return y;
561
+ }
562
+ /** Weak-point multiplier at an authoritative contact point. */
563
+ private pouncerDamage(a: A, p: Vector3): number {
564
+ if (this.st === 'leap') return this.pouncerSpec.damage.airborne; // the weak point: its airborne body
565
+ if (this.st === 'open') return this.pouncerPorts.isHead(a, p) ? this.pouncerSpec.damage.openHead : 1; // The opened head multiplier composes with the native contact multiplier.
566
+ if (this.pouncerP2 && this.st === 'perch') return this.pouncerSpec.damage.perched; // up on its ledge in phase 2
567
+ return 1;
568
+ }
569
+ private pouncerPerchFor(px: number, pz: number, py: number): PouncerLedge | null {
570
+ let best: PouncerLedge | null = null, bd = Infinity;
571
+ for (let i = 0; i < 6; i++) { const l = this.pouncerPorts.ledges[i]; if (l === undefined) break;
572
+ const up = l.y - py, d = Math.hypot(l.x - px, l.z - pz);
573
+ if (up < this.pouncerSpec.perch.minHeight || up > this.pouncerSpec.perch.maxHeight || d < this.pouncerSpec.perch.minDistance || d > this.pouncerSpec.perch.maxDistance) continue;
574
+ if (d < bd) { bd = d; best = l; }
575
+ }
576
+ return best;
577
+ }
578
+ /** Decide on the manager cadence using the same row and native path authority. */
579
+ private pouncerThink(a: A, c: PouncerContext<A>): void {
580
+ const pl = c.player, tp = this.pouncerToPlayer(a);
581
+ this.cd -= c.dt;
582
+ a.lookTarget.copy(pl); a.lookWeight = this.st === 'lurk' ? this.pouncerSpec.lookIdle : 1;
583
+ switch (this.pouncerPhase()) {
584
+ case 'lurk': a.setMotion(a.yaw, 0, this.pouncerSpec.turns.idle); break;
585
+ case 'home': this.pouncerGoHome(a, c, this.pouncerSpec.speeds.home); if (Math.hypot(a.position.x - this.pouncerPorts.lair.x, a.position.z - this.pouncerPorts.lair.z) < this.pouncerSpec.homeRadius) this.st = 'lurk'; break;
586
+ case 'stalk': case 'perch': {
587
+ a.mem[this.pouncerSpec.fields.low] = this.st === 'stalk' ? this.pouncerSpec.pose.stalk : this.pouncerSpec.pose.perch;
588
+ if (tp.d < this.pouncerSpec.swipe.from && this.cd <= 0) { this.st = 'swipe'; this.hitDone = 0; a.startAttack(this.pouncerSpec.swipe.seconds); a.setMotion(tp.yaw, 0, this.pouncerSpec.turns.swipeStart); break; }
589
+ const perch = this.pouncerPerchFor(pl.x, pl.z, pl.y);
590
+ if (perch !== null && this.cd <= 0) {
591
+ const dp = Math.hypot(perch.x - a.position.x, perch.z - a.position.z);
592
+ if (dp < this.pouncerSpec.perch.arrival) { this.pouncerStartTell(a, pl); break; }
593
+ a.setMotion(Math.atan2(perch.x - a.position.x, perch.z - a.position.z), this.pouncerSpec.speeds.perch, this.pouncerSpec.turns.perch);
594
+ } else if (tp.d > this.pouncerSpec.pounce.minDistance && tp.d < this.pouncerSpec.pounce.maxDistance && this.cd <= 0) this.pouncerStartTell(a, pl); // no ledge: a run-up pounce on open ground
595
+ else a.setMotion(tp.d > this.pouncerSpec.stalk.far ? this.pouncerChase(a, c, tp.d, tp.yaw, this.pouncerSpec.stalk.far) : tp.yaw, tp.d > this.pouncerSpec.stalk.far ? this.pouncerSpec.speeds.stalk : tp.d < this.pouncerSpec.stalk.near ? this.pouncerSpec.speeds.back : 0, this.pouncerSpec.turns.stalk);
596
+ break;
597
+ }
598
+ case 'tell': a.setMotion(Math.atan2(this.to.x - a.position.x, this.to.z - a.position.z), 0, this.pouncerSpec.turns.tell); break;
599
+ case 'leap': case 'open': a.setMotion(a.yaw, 0, this.pouncerSpec.turns.open); break;
600
+ case 'swipe': break;
601
+ default: break;
602
+ }
603
+ }
604
+ /** Deliver each swipe contact exactly once on the body attack phase. */
605
+ private pouncerAct(a: A): void {
606
+ if (this.st !== 'swipe') return;
607
+ const tp = this.pouncerToPlayer(a);
608
+
609
+ a.setMotion(tp.yaw, 0, this.pouncerSpec.turns.swipe);
610
+ const k = a.attackPhase;
611
+ if (k >= this.pouncerSpec.swipe.first && this.hitDone === 0) { this.hitDone = 1; if (tp.d < this.pouncerSpec.swipe.range) this.pouncerPorts.hurt(a, this.pouncerSpec.swipe.damage); }
612
+ if (k >= this.pouncerSpec.swipe.second && this.hitDone === 1) { this.hitDone = 2; if (tp.d < this.pouncerSpec.swipe.range) this.pouncerPorts.hurt(a, this.pouncerSpec.swipe.damage); }
613
+ if (k >= 1 || k < 0) { a.cancelAttack(); this.st = this.pouncerP2 ? 'perch' : 'stalk'; this.cd = this.pouncerSpec.swipe.cooldown; if (this.pouncerP2) this.pouncerRetreat(a); }
614
+ }
615
+ private pouncerStartTell(a: A, pl: Vector3): void {
616
+ this.st = 'tell'; this.stT = 0;
617
+ this.from.copy(a.position);
618
+ this.to.set(pl.x, 0, pl.z); this.to.y = this.pouncerPorts.heightAt(pl.x, pl.z);
619
+ a.mem[this.pouncerSpec.fields.low] = 1; a.mem[this.pouncerSpec.fields.snarl] = 1;
620
+ this.pouncerPorts.signature();
621
+ this.pouncerPorts.growl(a.position);
622
+ }
623
+ private pouncerRetreat(a: A): void {
624
+ let best: PouncerLedge | null = null, bd = -1;
625
+ for (let i = 0; i < 6; i++) { const l = this.pouncerPorts.ledges[i]; if (l === undefined) break; const up = l.y - this.pouncerPorts.heightAt(l.x, l.z); const d = Math.hypot(l.x - a.position.x, l.z - a.position.z); if (up > this.pouncerSpec.perch.retreatHeight && d < this.pouncerSpec.perch.retreatDistance && d > bd) { bd = d; best = l; } }
626
+ if (best !== null) { this.from.copy(a.position); this.to.set(best.x, best.y, best.z); this.st = 'leap'; this.stT = 0; this.goalPoint.x = best.x; this.goalPoint.z = best.z; this.goalPoint.y = best.y; this.goal = this.goalPoint; }
627
+ }
628
+ /** Advance engagement, tell, ballistic motion and retreat on the fixed frame clock. */
629
+ private pouncerTick(a: A | null, dt: number, t: number, engaged: boolean, leashing: boolean): void {
630
+ if (a === null) return;
631
+ this.pouncerPorts.ring.setTime(t);
632
+ if (leashing && this.st !== 'home') this.st = 'home';
633
+ if ((this.st === 'lurk' || (this.st === 'home' && !leashing)) && (engaged || a.position.distanceTo(this.pouncerPorts.player.position) < this.pouncerPorts.awareRadius)) { this.st = 'stalk'; this.cd = this.pouncerSpec.awareCooldown; }
634
+ this.stT += dt;
635
+ // Stand on the declared solid ledge, whose top need not be the terrain height.
636
+ if (this.st !== 'leap') a.yOffset += ((this.pouncerStandY(a.position.x, a.position.z) - this.pouncerPorts.heightAt(a.position.x, a.position.z)) - a.yOffset) * Math.min(1, dt * this.pouncerSpec.standRate);
637
+ if (this.st === 'tell') {
638
+ this.pouncerPorts.ring.ring(this.to.x, this.to.z, this.pouncerSpec.tell.radius, this.pouncerSpec.tell.strength + this.pouncerSpec.tell.growth * Math.min(1, this.stT / this.pouncerSpec.tell.growSeconds));
639
+ if (this.stT > this.pouncerSpec.tell.seconds) { this.st = 'leap'; this.stT = 0; this.goal = null; this.from.copy(a.position); this.from.y = this.pouncerStandY(a.position.x, a.position.z); }
640
+ } else if (this.st !== 'leap') this.pouncerPorts.ring.hide();
641
+ if (this.st === 'leap') {
642
+ // a ballistic arc from the perch to the ring (or up to a retreat ledge)
643
+ const T = this.pouncerSpec.pounce.seconds, k = Math.min(1, this.stT / T);
644
+ const x = MathUtils.lerp(this.from.x, this.to.x, k), z = MathUtils.lerp(this.from.z, this.to.z, k);
645
+ const y = MathUtils.lerp(this.from.y, this.to.y, k) + Math.sin(k * Math.PI) * this.pouncerSpec.pounce.arcHeight;
646
+ a.position.x = x; a.position.z = z; a.yOffset = y - this.pouncerPorts.heightAt(x, z);
647
+ a.yaw = a.desiredYaw = Math.atan2(this.to.x - this.from.x, this.to.z - this.from.z);
648
+ a.mem[this.pouncerSpec.fields.leap] = Math.sin(k * Math.PI) * this.pouncerSpec.pose.leapSwing + this.pouncerSpec.pose.leapBase; a.mem[this.pouncerSpec.fields.low] = 0;
649
+ if (k >= 1) {
650
+ a.mem[this.pouncerSpec.fields.leap] = 0; a.mem[this.pouncerSpec.fields.snarl] = 0;
651
+ this.pouncerPorts.ring.hide();
652
+ if (this.goal !== null) { this.st = 'perch'; this.cd = this.pouncerSpec.perch.cooldown; return; }
653
+ const p = this.pouncerPorts.player.position;
654
+ if (Math.hypot(p.x - this.to.x, p.z - this.to.z) < this.pouncerSpec.pounce.range) {
655
+ this.pouncerPorts.hurt(a, this.pouncerSpec.pounce.damage); this.pouncerPorts.knock(p.x - this.from.x, p.z - this.from.z);
656
+ this.st = this.pouncerP2 ? 'perch' : 'stalk'; this.cd = this.pouncerSpec.pounce.cooldown; if (this.pouncerP2) this.pouncerRetreat(a);
657
+ } else { this.st = 'open'; this.stT = 0; this.pouncerPorts.opened(); }
658
+ }
659
+ }
660
+ if (this.st === 'open') { a.mem[this.pouncerSpec.fields.low] = this.pouncerSpec.pose.open; if (this.stT > this.pouncerSpec.openSeconds) { this.st = 'stalk'; this.cd = this.pouncerSpec.openCooldown; } }
661
+ if (this.st === 'perch' && this.pouncerP2 && this.stT > this.pouncerSpec.perch.waitSeconds && this.cd <= 0) this.st = 'stalk';
662
+ }
663
+ /** Exact continuation, preserving the prior keeper field shape and number order. */
664
+ pouncerSnapshot(): v.InferOutput<typeof PouncerSaved> { if (this.profile.pattern !== 'pouncer') throw new Error('Incompatible stalker snapshot'); return v.parse(PouncerSaved, { st: this.st, stT: this.stT, cd: this.cd, hitDone: this.hitDone, from: this.from.toArray(), to: this.to.toArray(), goal: this.goal }); }
665
+ /** Validate the complete continuation before replacing any live state. */
666
+ private pouncerRestore(input: unknown): void { const s = v.parse(PouncerSaved, input); this.st = s.st; this.stT = s.stT; this.cd = s.cd; this.hitDone = s.hitDone; this.from.fromArray(s.from); this.to.fromArray(s.to); if (s.goal === null) this.goal = null; else { Object.assign(this.goalPoint, s.goal); this.goal = this.goalPoint; } }
667
+ private skirmishThink(a: A, c: SkirmisherPorts<A>): void {
668
+ // dt 0 is an interrupt's wake in the frame it already decided (the manager's 'decide now', whatever the clock)
669
+ if (!Number.isFinite(c.dt) || c.dt < 0 || c.dt > 1) {
670
+ if (!this.reportedSkirmishStep) {
671
+ this.reportedSkirmishStep = true;
672
+ emitFault({system: 'ai.skirmisher', error: new Error('Invalid skirmisher step'), verdict: 'retry'});
673
+ }
674
+ return;
675
+ }
676
+ const m = a.mem as SkirmisherMemory, rng = c.rng;
677
+ if (!m.init) { m.init = 1; m.hx = a.position.x; m.hz = a.position.z; m.st = ST_IDLE; m.tm = rng.range(1, 3); m.sd = rng.next() < 0.5 ? -1 : 1; m.cd = 0; m.hitT = 0; m.shy = 0; m.scat = 0; }
678
+ const dx = c.player.x - a.position.x, dz = c.player.z - a.position.z, d = Math.hypot(dx, dz);
679
+ const toPlayer = Math.atan2(dx, dz);
680
+ m.cd = Math.max(0, m.cd - c.dt);
681
+ // a blow interrupts whatever it was doing: it turns on you
682
+ if (a.lastHitT > m.hitT) { m.hitT = a.lastHitT; a.cancelAttack(); if (m.st !== ST_FLEE) { m.st = ST_ENGAGE; m.cd = Math.max(m.cd, this.skirmishSpec.alertCooldown); } }
683
+ // A dead leader makes its subordinate variants scatter and remain shy.
684
+ if (a.variant === this.skirmishSpec.subordinateVariant && !m.scat && c.herd?.some((h) => h.variant === this.skirmishSpec.leaderVariant && !h.alive)) { m.scat = 1; m.shy = 1; m.st = ST_FLEE; m.tm = rng.range(5, 7); a.cancelAttack(); c.sound(this.skirmishSpec.noticeCue); }
685
+ const engageR = m.shy ? this.skirmishSpec.shyRadius : this.skirmishSpec.awareRadius;
686
+ switch (m.st) {
687
+ case ST_IDLE: {
688
+ a.state = 'idle';
689
+ if (!c.calm && d < engageR) { m.st = ST_ENGAGE; m.tm = rng.range(1, 2.5); c.sound(this.skirmishSpec.noticeCue); break; }
690
+ m.tm -= c.dt;
691
+ if (m.tm <= 0) {
692
+ // Alternate resting and a short wander around the remembered home.
693
+ if (m.wander) { m.wander = 0; m.tm = rng.range(2, 6); a.setMotion(a.desiredYaw, 0, 2); a.setStrafe(0); }
694
+ else { m.wander = 1; m.tm = rng.range(1.5, 3); const ang = rng.range(0, Math.PI * 2); m.tx = m.hx + Math.cos(ang) * 3; m.tz = m.hz + Math.sin(ang) * 3; }
695
+ }
696
+ if (m.wander) {
697
+ const wx = m.tx - a.position.x, wz = m.tz - a.position.z;
698
+ if (Math.hypot(wx, wz) < 0.5) { m.wander = 0; m.tm = rng.range(2, 6); a.setMotion(a.desiredYaw, 0, 2); }
699
+ else { const yaw = Math.atan2(wx, wz); a.setMotion(yaw, 0, 3); a.setStrafe(Math.sin(yaw - a.yaw) > 0 ? 0.55 : -0.55); if (Math.abs(Math.sin(yaw - a.yaw)) < 0.3) { a.setStrafe(0); a.setMotion(yaw, 0.5, 3); } }
700
+ }
701
+ a.lookWeight = d < 14 ? 0.5 : 0; a.lookTarget.copy(c.player);
702
+ break;
703
+ }
704
+ case ST_ENGAGE: {
705
+ a.state = 'sidestep';
706
+ a.lookTarget.copy(c.player); a.lookWeight = 1;
707
+ if (c.calm || d > this.skirmishSpec.disengageRadius) { m.st = ST_IDLE; m.tm = 2; a.setStrafe(0); a.setMotion(a.yaw, 0, 2); break; }
708
+ m.tm -= c.dt;
709
+ if (m.tm <= 0) { m.sd = -m.sd; m.tm = rng.range(1.0, 2.5); }
710
+ // An authoritative attack token holds waiting actors outside strike range.
711
+ const wait = !c.mayAttack(a), far = wait ? this.skirmishSpec.holdRadius + 0.6 : 2.6, near = wait ? this.skirmishSpec.holdRadius - 0.6 : 1.4;
712
+ if (d > far) { a.setMotion(toPlayer, 1.7, 5); a.setStrafe(m.sd * 0.5); }
713
+ else if (!wait && m.cd <= 0 && d > 1.75) { a.setMotion(toPlayer, 1.2, 5); a.setStrafe(m.sd * 0.3); } // Its turn: close to strike range.
714
+ else if (d < near) { a.setMotion(toPlayer, wait ? -1.1 : -0.6, 5); a.setStrafe(m.sd * 1.3); } // too close: back off a step while circling
715
+ else { a.setMotion(toPlayer, 0, 5); a.setStrafe(m.sd * 1.3); }
716
+ if (!wait && d < this.skirmishSpec.attackRadius && m.cd <= 0 && c.claim(a)) { m.st = ST_ATTACK; m.hit = 0; a.startAttack(this.skirmishSpec.attackDuration); a.setStrafe(0); a.setMotion(toPlayer, 0, 6); c.sound(this.skirmishSpec.noticeCue); }
717
+ break;
718
+ }
719
+ case ST_ATTACK: {
720
+ a.state = 'attack';
721
+ a.setMotion(toPlayer, 0, 6); a.setStrafe(0);
722
+ const p = a.attackPhase;
723
+ if (p >= 1 || p < 0) { m.st = ST_ENGAGE; m.cd = this.skirmishSpec.attackCooldown; m.tm = rng.range(0.6, 1.6); a.cancelAttack(); }
724
+ break;
725
+ }
726
+ case ST_FLEE: {
727
+ a.state = 'flee';
728
+ m.tm -= c.dt;
729
+ c.steer(a, Math.atan2(-dx, -dz), this.skirmishSpec.fleeSpeed, 4); a.setStrafe(0);
730
+ a.lookWeight = 0;
731
+ if (m.tm <= 0) { m.st = ST_IDLE; m.tm = 2; m.hx = a.position.x; m.hz = a.position.z; a.setMotion(a.yaw, 0, 2); }
732
+ break;
733
+ }
734
+ default: break;
735
+ }
736
+ c.confine(a);
737
+ }
738
+ private requirePack(): void { if (this.profile.pattern !== 'pack') throw new Error('Incompatible pack stalker pattern'); }
739
+ private get packSpec(): CirclingPackSpec { const p = this.profile; if (p.pattern !== 'pack') throw new Error('Incompatible pack stalker pattern'); return p.spec; }
740
+ private get packPorts(): CirclingPackPorts<A> { const p = this.profile; if (p.pattern !== 'pack') throw new Error('Incompatible pack stalker pattern'); return p.ports; }
741
+ /** The original guarded native authorities lent to a prepared group step. */
742
+ get groupPorts(): CirclingPackPorts<A> { return this.packPorts; }
743
+ private initialized = false;
744
+ alpha: A | null = null;
745
+ phase: CirclingPackPhase = 'roam';
746
+ /** 0..1: how sure the pack is of the player (the max over its wolves' senses) */
747
+ awareness = 0;
748
+ /** the den / home range centre */
749
+ homeX = 0; homeZ = 0;
750
+ /** a foal (or a raided sheep, any CirclingPackPrey) the pack is hunting instead of the player */
751
+ prey: CirclingPackPrey | null = null;
752
+ /** B1: a raid's prey, taken at the next tick while roaming (`raid`) */
753
+ private pendingPrey: CirclingPackPrey | null = null;
754
+ findPrey?: ((x: number, z: number, r: number) => A | null) | undefined;
755
+ onPhase?: ((phase: CirclingPackPhase, pack: StalkerBrain<A>) => void) | undefined;
756
+
757
+ private phaseT = 0;
758
+ private roamX = 0; private roamZ = 0; private roamT = 0;
759
+ private nextTokenT = 0; private boldT = 0; private calmT = 0;
760
+ private hpStart = 0; private halfDone = false; private deadSeen = 0;
761
+ private shadowDur = 12;
762
+ private howled = false;
763
+ private bites = 0;
764
+ private scared = false;
765
+
766
+ // ── R10b: the pack's law as the owner's group program on GroupBrain's shared loop. A bound pack runs every original call
767
+ // (initialize on the shared stream, tick at the group's slot, drive at each wolf's on the context stream) as segments of
768
+ // its profile; its own fields stay the truth (captured into the bank per call, the candidate committed back). ──
769
+ private packGuest: {
770
+ readonly program: GroupGuestProjectionV2; readonly prepare: GroupGuestProjectionV2['prepareGroup']; readonly bindings: GroupGuestBindingsV2;
771
+ readonly scope: Scope; readonly group: string; readonly handle: number; readonly rows: GroupGuestBindingRows; readonly codec: GroupBankV2;
772
+ readonly results: readonly string[]; readonly roster: () => readonly A[];
773
+ readonly buffers:{readonly bank:Float64Array;readonly captured:Record<string,GroupBankValueV2>;readonly values:Record<string,GroupBankValueV2>;readonly changes:Record<string,GroupBankValueV2>;readonly results:Record<string,number>[];readonly members:PackMemberColumns<A>[]}[];
774
+ } | undefined;
775
+ private packCall: { readonly signal: string; readonly context: CirclingPackContext<A>; readonly bank: Float64Array;
776
+ readonly references: GroupStepReferenceV2<A>[]; readonly random: Rng;readonly captured:Record<string,GroupBankValueV2>;readonly values:Record<string,GroupBankValueV2>;readonly changes:Record<string,GroupBankValueV2>;readonly results:Record<string,number>[];readonly members:PackMemberColumns<A>[];readonly slot:number|undefined } | undefined;
777
+ private packDepth=0;
778
+ /** Select the pack profile (the binding rows: profile, resume) on the SAME admitted programme; `roster` lends the bodies
779
+ * findPrey picks from (the nearest request's roster). Scope, bodies and random streams stay the original owners'. */
780
+ bindGuest(program: GroupGuestProjectionV2, input: unknown, loans: { readonly scope: Scope; readonly group: string; readonly handle: number;
781
+ readonly roster: () => readonly A[] }): void { this.requirePack();
782
+ if(!isJsonData(input))throw new Error('Pack guest binding requires JSON rows');
783
+ const bindings = program.groupBindings, rows = v.parse(GroupGuestBindingSchema, structuredClone(input));
784
+ if (this.packGuest !== undefined || this.initialized || loans.scope.disposed || loans.scope.disposing || loans.group.length === 0
785
+ || !Number.isSafeInteger(loans.handle) || loans.handle < 1 || bindings === undefined || typeof program.prepareGroup !== 'function') throw new Error('Invalid pack guest binding');
786
+ const shape = rows.profile === 'main' ? bindings : bindings.profiles?.find(row => row.id === rows.profile);
787
+ if(Object.keys(rows.parameters).length!==1||!Number.isFinite(rows.parameters['boundsHalf'])||(rows.parameters['boundsHalf']??0)<=0)throw new Error('Missing pack bounds parameter');
788
+ const signals = ['init', 'tick', ...this.members.map((_, slot) => `drive.${slot}`), ...this.members.map((_, slot) => `body.${slot}`)];
789
+ if (shape === undefined || this.members.length > shape.members || signals.some(name => !shape.signals.includes(name))
790
+ || !shape.bank.some(row => row.name === rows.resume.field && row.kind === 'number')) throw new Error('Incompatible pack guest profile');
791
+ if(rows.capture!==undefined&&(rows.capture.slots.length>0||rows.capture.references.length>0||new Set(rows.capture.common).size!==rows.capture.common.length||rows.capture.common.some(name=>!shape.columns.some(column=>column.name===name))))throw new Error('Invalid pack capture declaration');
792
+ const results = shape.columns.flatMap(row => row.source.kind === 'result' ? [row.source.channel] : []);
793
+ Object.freeze(rows.resume.values);Object.freeze(rows.resume);
794
+ const guest:NonNullable<StalkerBrain<A>['packGuest']> = { program, prepare: program.prepareGroup, bindings, scope: loans.scope, group: loans.group, handle: loans.handle,
795
+ rows, codec: new GroupBankV2(shape.bank), results, roster: loans.roster, buffers:[] };
796
+ const references=this.packReferences(guest),native=this.packValues(guest,references),values={...native,...packGuestReset};
797
+ guest.buffers.push({bank:guest.codec.encode(values,guest.group,references),captured:values,values:native,changes:{},results:this.members.map(()=>Object.fromEntries(results.map(channel=>[channel,0]))),members:[]});this.packGuest=guest;
798
+ }
799
+ private siblings=0;
800
+ protected bindSibling(next:StalkerBrain<A>):void{
801
+ const guest=this.packGuest;if(guest===undefined)return;
802
+ this.siblings++;
803
+ next.bindGuest(guest.program,guest.rows,{scope:guest.scope,group:`${guest.group}.${this.siblings}`,handle:guest.handle*100+this.siblings,roster:guest.roster});
804
+ }
805
+ /** Run one original call on the bound program; false when unbound (the TS law runs). */
806
+ private packValues(guest:NonNullable<StalkerBrain<A>['packGuest']>,references:readonly GroupStepReferenceV2<A>[],output?:Record<string,GroupBankValueV2>):Record<string,GroupBankValueV2>{
807
+ const wire = (prey: CirclingPackPrey | null): string | null => prey === null ? null : references.find(row => row.body === prey)?.wire ?? null;
808
+ const values=output??{};
809
+ Object.assign(values,guest.rows.parameters);
810
+ values['initialized']=this.initialized;values['time']=this.groupTime===-Infinity?null:this.groupTime;
811
+ values['phase']=this.phase;values['awareness']=this.awareness;values['homeX']=this.homeX;values['homeZ']=this.homeZ;
812
+ values['phaseT']=this.phaseT;values['roamX']=this.roamX;values['roamZ']=this.roamZ;values['roamT']=this.roamT;
813
+ values['nextTokenT']=this.nextTokenT;values['boldT']=this.boldT;values['calmT']=this.calmT;values['hpStart']=this.hpStart;
814
+ values['halfDone']=this.halfDone;values['deadSeen']=this.deadSeen;values['shadowDur']=this.shadowDur;
815
+ values['howled']=this.howled;values['bites']=this.bites;values['scared']=this.scared;
816
+ values['alpha']=this.alpha===null?0:this.members.indexOf(this.alpha)+1;
817
+ values['prey']=wire(this.prey);values['pendingPrey']=wire(this.pendingPrey);return values;
818
+ }
819
+ private syncPackCall(call:NonNullable<StalkerBrain<A>['packCall']>,guest:NonNullable<StalkerBrain<A>['packGuest']>):void{
820
+ const references=this.packReferences(guest);call.references.splice(0,call.references.length,...references);
821
+ const values=this.packValues(guest,references,call.values),changed=call.changes;
822
+ for(const key of Object.keys(changed))delete changed[key];
823
+ for(const key of Object.keys(values)){const value=values[key];if(value===undefined)throw new Error('Missing pack capture value');if(key==='prey'||key==='pendingPrey'||!Object.is(value,call.captured[key]))changed[key]=value;}
824
+ guest.codec.update(call.bank,changed,guest.group,references);Object.assign(call.captured,values);
825
+ }
826
+ private runPack(signal:string,context:CirclingPackContext<A>,random:Rng,slot?:number):boolean{
827
+ const guest=this.packGuest;if(guest===undefined)return false;
828
+ if(guest.scope.disposed||guest.scope.disposing||guest.program.prepareGroup!==guest.prepare||guest.program.groupBindings!==guest.bindings)throw new Error('Replaced pack guest binding');
829
+ // Reserve the depth before roster/scalar getters can reenter, including preparation failures.
830
+ const previous=this.packCall,depth=this.packDepth++;
831
+ let members:PackMemberColumns<A>[]|undefined;
832
+ try{
833
+ const references=this.packReferences(guest);
834
+ let buffer=guest.buffers[depth];
835
+ const values=this.packValues(guest,references,buffer?.values);
836
+ if(buffer===undefined){const initial={...values,...packGuestReset};buffer={bank:guest.codec.encode(initial,guest.group,references),captured:initial,values,changes:{},results:this.members.map(()=>Object.fromEntries(guest.results.map(channel=>[channel,0]))),members:[]};guest.buffers[depth]=buffer;}
837
+ else{
838
+ const changed=buffer.changes;for(const key of Object.keys(changed))delete changed[key];
839
+ for(const key of Object.keys(values)){const value=values[key];if(value===undefined)throw new Error('Missing pack capture value');if(key==='prey'||key==='pendingPrey'||!Object.is(value,buffer.captured[key]))changed[key]=value;}
840
+ for(let index=0;index<packGuestResetFields.length;index++){
841
+ const name=packGuestResetFields[index];if(name===undefined)throw new Error('Missing pack reset field');
842
+ if(!Object.is(buffer.captured[name],0))changed[name]=0;
843
+ }
844
+ guest.codec.update(buffer.bank,changed,guest.group,references);Object.assign(buffer.captured,values,packGuestReset);
845
+ }
846
+ members=buffer.members;
847
+ this.packCall={signal,context,bank:buffer.bank,captured:buffer.captured,values:buffer.values,changes:buffer.changes,results:buffer.results,members:buffer.members,references,random,slot};
848
+ this.runGuest(guest.program);
849
+ }finally{try{if(members!==undefined)releasePackMembers(members);}finally{this.packDepth=depth;this.packCall=previous;}}
850
+ return true;
851
+ }
852
+ /** members 1..n, then the roster's bodies, then the prey and pending prey when outside it (crowd prey by pose) */
853
+ private packReferences(guest: NonNullable<StalkerBrain<A>['packGuest']>): GroupStepReferenceV2<A>[] {
854
+ const rows: GroupStepReferenceV2<A>[] = this.members.map((body, slot) => ({ group: guest.group, slot, identity: body.entityId, wire: body.entityId, handle: slot + 1, body }));
855
+ for (const body of guest.roster()) if (!this.members.includes(body)) rows.push({ group: `${guest.group}:prey`, slot: rows.length, identity: body.entityId, wire: body.entityId, handle: rows.length + 1, body });
856
+ for (const prey of [this.prey, this.pendingPrey]) if (prey !== null && !rows.some(row => row.body === prey)) {
857
+ const identity = this.packPorts.preyIdentity?.(prey); if (identity === undefined) throw new Error('Missing pack prey identity');
858
+ rows.push({ group: `${guest.group}:prey`, slot: rows.length, identity, wire: identity, handle: rows.length + 1, body: prey, pose: true });
859
+ }
860
+ return rows;
861
+ }
862
+ protected override captureGuest(replies: readonly GroupStepNativeResultV2[]): GroupGuestFrameV2<A> {
863
+ const call = this.packCall, guest = this.packGuest;
864
+ if (call === undefined || guest === undefined) throw new Error('Missing pack guest call');
865
+ if(guest.scope.disposed||guest.scope.disposing||guest.program.prepareGroup!==guest.prepare||guest.program.groupBindings!==guest.bindings)throw new Error('Replaced pack guest owner');
866
+ // the environment's grass is a method of its owner: lent bound
867
+ this.syncPackCall(call,guest);
868
+ const { context, references } = call, env = this.packPorts.environment(), grass = (x: number, z: number): number => env.grassHeightAt(x, z);
869
+ const results = call.results;
870
+ while(results.length<this.members.length)results.push(Object.fromEntries(guest.results.map(channel=>[channel,0])));
871
+ results.length=this.members.length;
872
+ for(const row of results)for(const channel of Object.keys(row))row[channel]=0;
873
+ for (const reply of replies) for (const [slot, row] of results.entries()) if (reply.member === undefined || reply.member.slot === slot) row[reply.channel] = reply.value;
874
+ const ref = (prey: CirclingPackPrey | null): { identity: string; handle: number; body: CirclingPackPrey } | null => {
875
+ const row = prey === null ? undefined : references.find(value => value.body === prey); return row === undefined ? null : { identity: row.identity, handle: row.handle, body: row.body };
876
+ };
877
+ const lent = new Map([['prey', ref(this.prey)], ['pending', ref(this.pendingPrey)]]);
878
+ const player = { position: context.player }, observed = new Map<number,A>();
879
+ const environment = { playerCrouched: false, playerFwdX: env.playerFwdX, playerFwdZ: env.playerFwdZ, playerMounted: env.playerMounted,
880
+ playerHealth01: env.playerHealth01, light: 1, storm: false, wind: { x: 0, z: 0, strength: 0 }, grassHeightAt: grass };
881
+ // The call depth is reserved before any live owner getter. Reuse only
882
+ // private wrappers at that depth; every borrowed field is refreshed here.
883
+ const members=call.members;members.length=this.members.length;
884
+ for(let slot=0,count=this.members.length;slot<count;slot++){
885
+ const actor=this.members[slot];if(actor===undefined)throw new Error('Missing pack member');
886
+ let member=members[slot];
887
+ if(member===undefined){
888
+ member={scope:guest.scope,self:{group:guest.group,slot,identity:actor.entityId,actor},
889
+ player,observed,t:context.t,dt:context.dt,context,environment,references:lent,results:results[slot]??{}};
890
+ members[slot]=member;
891
+ }else{
892
+ member.self.identity=actor.entityId;member.self.actor=actor;member.player=player;member.observed=observed;
893
+ member.t=context.t;member.dt=context.dt;member.context=context;member.environment=environment;member.references=lent;member.results=results[slot]??{};
894
+ }
895
+ }
896
+ const roster = references.filter(row => row.group === `${guest.group}:prey` && row.pose !== true);
897
+ return { input: { group: guest.group, handle: guest.handle, profile: guest.rows.profile, signal: call.signal, tick: 0, state: call.bank, members, references, random: call.random,
898
+ ...(guest.rows.capture===undefined||call.slot===undefined?{}:{capture:{common:guest.rows.capture.common,slots:[...new Set([0,call.slot])]}}) },
899
+ native: { scope: guest.scope, members, references, rosters: new Map([['foals', roster]]), group: { kind: 'pack', owner: this },
900
+ contexts: members.map(() => context), ground: { normalY: (x, z) => this.packPorts.normalY(x, z) }, grass: { grassHeightAt: grass } },
901
+ resume: guest.rows.resume };
902
+ }
903
+ protected override prepareGuestCommit(frame: GroupGuestFrameV2<A>, values: Readonly<Record<string, GroupBankValueV2>>): GroupGuestPublicationV2 {
904
+ const call = this.packCall;
905
+ if (call === undefined || frame.input.state !== call.bank) throw new Error('Foreign pack guest publication');
906
+ const body = (value: GroupBankValueV2 | undefined): CirclingPackPrey | null => {
907
+ if (value === null || value === undefined) return null;
908
+ const row = call.references.find(reference => reference.wire === value); if (row === undefined) throw new Error('Unresolved pack guest prey'); return row.body;
909
+ };
910
+ const number = (name: string): number => { const value = values[name]; if (typeof value !== 'number' || !Number.isFinite(value)) throw new Error(`Invalid pack guest ${name}`); return value; };
911
+ const flag = (name: string): boolean => { const value = values[name]; if (typeof value !== 'boolean') throw new Error(`Invalid pack guest ${name}`); return value; };
912
+ const phase = values['phase'], time = values['time'], alpha = number('alpha');
913
+ if (typeof phase !== 'string' || !(['roam', 'shadow', 'encircle', 'regroup', 'break'] as const).some(name => name === phase)
914
+ || (time !== null && typeof time !== 'number') || !Number.isInteger(alpha) || alpha < 0 || alpha > this.members.length) throw new Error('Invalid pack guest state');
915
+ const next = { initialized: flag('initialized'), awareness: number('awareness'), homeX: number('homeX'), homeZ: number('homeZ'), phaseT: number('phaseT'),
916
+ roamX: number('roamX'), roamZ: number('roamZ'), roamT: number('roamT'), nextTokenT: number('nextTokenT'), boldT: number('boldT'), calmT: number('calmT'),
917
+ hpStart: number('hpStart'), halfDone: flag('halfDone'), deadSeen: number('deadSeen'), shadowDur: number('shadowDur'), howled: flag('howled'),
918
+ bites: number('bites'), scared: flag('scared') };
919
+ const prey = body(values['prey']), pendingPrey = body(values['pendingPrey']), leader = alpha === 0 ? null : this.members[alpha - 1] ?? null;
920
+ const validate = (): void => { if (this.packCall !== call) throw new Error('Replaced pack guest call'); };
921
+ return { validate, commit: () => {
922
+ validate();
923
+ this.phase = phase === 'roam' || phase === 'shadow' || phase === 'encircle' || phase === 'regroup' ? phase : 'break';
924
+ Object.assign(this, next); this.groupTime = time ?? -Infinity; this.prey = prey; this.pendingPrey = pendingPrey; this.alpha = leader;
925
+ Object.assign(call.captured,values);
926
+ } };
927
+ }
928
+
929
+
930
+ /** Perform the shipping setup draws exactly once after every group/controller preflight succeeds; never run a decision or body. */
931
+ initialize(): void { this.requirePack();
932
+ if (this.initialized) throw new Error('Pack already initialized');
933
+ if (this.packGuest !== undefined) {
934
+ const rng = this.packPorts.sharedRng(), zero = new Vector3();
935
+ this.runPack('init', { dt: 0, t: 0, player: zero, playerSpeed: 0, calm: true, rng, sound: () => undefined, claim: () => false,
936
+ steer: () => undefined, pathYaw: () => 0 }, rng);
937
+ return;
938
+ }
939
+ let small: A | null = null;
940
+ for (const actor of this.members) if (small === null || actor.scale < small.scale) small = actor;
941
+ for (const w of this.members) {
942
+ w.mem['role'] = w === this.alpha ? ROLE_ALPHA : this.members.length >= 4 && w === small ? ROLE_SCOUT : ROLE_FLANK;
943
+ w.mem['ox'] = (this.packPorts.sharedRng().next() - 0.5) * 8; w.mem['oz'] = (this.packPorts.sharedRng().next() - 0.5) * 8;
944
+ w.mem['hitT'] = w.lastHitT;
945
+ w.mem['ring'] = this.packSpec.ringMinRadius + this.packPorts.sharedRng().next() * (this.packSpec.ringMaxRadius - this.packSpec.ringMinRadius);
946
+ }
947
+ this.initialized = true;
948
+ }
949
+
950
+ /** Group continuation stores timers, tokens and trusted prey references; actors and shared RNG are snapshotted by their owner. */
951
+ snapshotPack(): string { this.requirePack();
952
+ const preyId = (prey: CirclingPackPrey | null): string | null => {
953
+ if (prey === null) return null;
954
+ if (this.packPorts.preyIdentity === undefined) throw new Error('Missing prey snapshot port');
955
+ return this.packPorts.preyIdentity(prey);
956
+ };
957
+ return JSON.stringify({ contract: this.contract, group: this.snapshotGroup(actor => actor.entityId), alpha: this.alpha?.entityId ?? null,
958
+ prey: preyId(this.prey), pendingPrey: preyId(this.pendingPrey), state: {
959
+ initialized: this.initialized, phase: this.phase, awareness: this.awareness, homeX: this.homeX, homeZ: this.homeZ, phaseT: this.phaseT,
960
+ roamX: this.roamX, roamZ: this.roamZ, roamT: this.roamT, nextTokenT: this.nextTokenT, boldT: this.boldT,
961
+ calmT: this.calmT, hpStart: this.hpStart, halfDone: this.halfDone, deadSeen: this.deadSeen,
962
+ shadowDur: this.shadowDur, howled: this.howled, bites: this.bites, scared: this.scared } });
963
+ }
964
+ /** Reject changed tuning, missing prey or forged members before applying any continuation; restore never runs a body or RNG. */
965
+ private restorePack(saved: string): void {
966
+ const data = v.parse(packContinuation, JSON.parse(saved));
967
+ if (data.contract !== this.contract) throw new Error('Incompatible pack continuation');
968
+ const alpha = data.alpha === null ? null : this.members.find(actor => actor.entityId === data.alpha);
969
+ if (alpha === undefined) throw new Error('Unresolved pack leader');
970
+ const resolve = (id: string | null): CirclingPackPrey | null => {
971
+ if (id === null) return null;
972
+ const prey = this.packPorts.resolvePrey?.(id);
973
+ if (prey === undefined || prey === null || this.packPorts.preyIdentity?.(prey) !== id) throw new Error('Unresolved pack prey');
974
+ return prey;
975
+ };
976
+ const prey = resolve(data.prey), pendingPrey = resolve(data.pendingPrey);
977
+ this.restoreGroup(data.group, actor => actor.entityId);
978
+ this.alpha = alpha; this.prey = prey; this.pendingPrey = pendingPrey;
979
+ Object.assign(this, data.state);
980
+ }
981
+
982
+ /** a stampede / lightning / anything terrifying at (x, z): the pack breaks if a wolf is within `r` m */
983
+ scare(x: number, z: number, r = 20): void { this.requirePack();
984
+ for (const w of this.members) if (w.alive && Math.hypot(w.position.x - x, w.position.z - z) < r) { this.scared = true; return; }
985
+ }
986
+
987
+ get alive(): number { let n = 0; for (const w of this.members) if (w.alive) n++; return n; }
988
+
989
+ /** B1: send a roaming pack after `p` (a raid on the flock) — false if it is busy (hunting, ringing you, fleeing) or dead */
990
+ raid(p: CirclingPackPrey): boolean { this.requirePack();
991
+ if (this.phase !== 'roam' || this.alive === 0 || !p.alive) return false;
992
+ this.pendingPrey = p;
993
+ return true;
994
+ }
995
+
996
+ private setPhase(p: CirclingPackPhase, c: CirclingPackContext<A>): void {
997
+ if (p === this.phase) return;
998
+ this.phase = p; this.phaseT = 0;
999
+ if (p === 'shadow') {
1000
+ this.shadowDur = c.rng.range(9, 16);
1001
+ // the scout gives the pack away with a yip
1002
+ for (const w of this.members) if (w.alive && w.mem['role'] === ROLE_SCOUT) { this.sound(c, w, this.packSpec.yipCue); break; }
1003
+ }
1004
+ if (p === 'regroup') this.howled = false;
1005
+ if (p === 'break') { for (const w of this.members) { w.mem['lunge'] = 0; w.cancelAttack(); } this.packPorts.onEvent?.('pack-break', this.cx(), this.cz()); }
1006
+ if (p === 'roam') { this.prey = null; this.pickRoam(c); }
1007
+ this.onPhase?.(p, this);
1008
+ }
1009
+
1010
+ private cx(): number { let x = 0, n = 0; for (const w of this.members) if (w.alive) { x += w.position.x; n++; } return n > 0 ? x / n : this.homeX; }
1011
+ private cz(): number { let z = 0, n = 0; for (const w of this.members) if (w.alive) { z += w.position.z; n++; } return n > 0 ? z / n : this.homeZ; }
1012
+
1013
+ private sound(c: CirclingPackContext<A>, _w: A, name: string): void { c.sound(name); }
1014
+
1015
+ private pickRoam(c: CirclingPackContext<A>): void {
1016
+ for (let i = 0; i < 16; i++) {
1017
+ const ang = c.rng.range(0, Math.PI * 2), r = c.rng.range(40, 90);
1018
+ const x = this.homeX + Math.cos(ang) * r, z = this.homeZ + Math.sin(ang) * r;
1019
+ if (!this.packPorts.inBounds(x, z, 30) || this.packPorts.normalY(x, z) < 0.8) continue;
1020
+ this.roamX = x; this.roamZ = z; break;
1021
+ }
1022
+ this.roamT = c.rng.range(60, 120);
1023
+ }
1024
+
1025
+ /** where the hunt is aimed (the player, or the prey) */
1026
+ private target(c: CirclingPackContext<A>): Vector3 { return this.prey !== null ? this.prey.position : c.player; }
1027
+ /** the direction the target faces, as a yaw (animal convention: atan2(x, z)) */
1028
+ private targetFacing(): number { return this.prey !== null ? this.prey.yaw : Math.atan2(this.packPorts.environment().playerFwdX, this.packPorts.environment().playerFwdZ); }
1029
+
1030
+ /** the pack-level tick: senses, phase changes, the attack token (once per AI tick, whichever wolf thinks first) */
1031
+ tick(c: CirclingPackContext<A>): void {
1032
+ try{ this.requirePack();
1033
+ if (!this.initialized) throw new Error('Pack is not initialized');
1034
+ if(this.packGuest!==undefined&&Math.abs(c.t-this.groupTime)<1e-8)return;
1035
+ if (this.runPack('tick', c, c.rng)) return;
1036
+ const dt = this.groupDelta(c.t, c.dt);
1037
+ if (dt <= 0) return;
1038
+ this.phaseT += dt; this.boldT = Math.max(0, this.boldT - dt); this.calmT = Math.max(0, this.calmT - dt);
1039
+ let living = 0, hp = 0, dead = 0;
1040
+ for (const w of this.members) { if (w.alive) { living++; hp += w.hp; } else dead++; }
1041
+ if (living === 0) return;
1042
+ if (this.prey !== null && !this.prey.alive) {
1043
+ this.packPorts.onEvent?.('prey-killed', this.prey.position.x, this.prey.position.z);
1044
+ this.prey = null; this.setPhase('roam', c); this.calmT = 40;
1045
+ }
1046
+
1047
+ // ── senses → pack awareness ──
1048
+ let rate = 0;
1049
+ let hit = false;
1050
+ for (const w of this.members) {
1051
+ if (!w.alive) continue;
1052
+ if (w.lastHitT > (w.mem['hitT'] ?? -Infinity)) { w.mem['hitT'] = w.lastHitT; hit = true; }
1053
+ if (c.calm || this.calmT > 0) continue;
1054
+ const dx = c.player.x - w.position.x, dz = c.player.z - w.position.z, d = Math.hypot(dx, dz);
1055
+ const V = this.packPorts.visibility(w.position.x, w.position.z, c.player, c.playerSpeed, c.t);
1056
+ const sight = this.packSpec.sightRadius * V;
1057
+ if (d < sight && Math.abs(angDiff(Math.atan2(dx, dz), w.yaw)) < this.packSpec.coneAngle) rate = Math.max(rate, 0.5 * (2 - d / sight));
1058
+ const hear = this.packPorts.hearing(this.packSpec.hearing, c.player, c.playerSpeed);
1059
+ if (d < hear) rate = Math.max(rate, 0.6 * (2 - d / hear));
1060
+ if (d < this.packSpec.smellRadius && this.packPorts.downwind(w.position.x, w.position.z, c.player)) rate = Math.max(rate, 0.35 * (2 - d / this.packSpec.smellRadius));
1061
+ }
1062
+ if (hit && this.calmT <= 0) { this.awareness = 1; if (this.prey !== null) { this.prey = null; } }
1063
+ this.awareness = rate > 0 ? Math.min(1, this.awareness + rate * dt) : Math.max(0, this.awareness - 0.1 * dt);
1064
+
1065
+ // ── break conditions ──
1066
+ const alphaDead = this.alpha !== null && !this.alpha.alive;
1067
+ const lastOne = this.members.length > 1 && living <= 1;
1068
+ if (this.phase !== 'break' && (alphaDead || lastOne || this.scared)) { this.scared = false; this.setPhase('break', c); }
1069
+ this.scared = false;
1070
+
1071
+ const tgt = this.target(c);
1072
+ const al = this.alpha;
1073
+ const dAlpha = al?.alive === true ? al.position.distanceTo(tgt) : Math.hypot(this.cx() - tgt.x, this.cz() - tgt.z);
1074
+ switch (this.phase) {
1075
+ case 'roam': {
1076
+ // B1: a raid — the pack goes after the flock's sheep, whatever it had of you
1077
+ if (this.pendingPrey !== null) {
1078
+ const p = this.pendingPrey;
1079
+ this.pendingPrey = null;
1080
+ if (p.alive) { this.prey = p; this.awareness = 0; this.calmT = 0; this.setPhase('shadow', c); break; }
1081
+ }
1082
+ this.roamT -= dt;
1083
+ if (this.roamT <= 0 || (Math.hypot(this.cx() - this.roamX, this.cz() - this.roamZ) < 6 && c.rng.next() < 0.05)) this.pickRoam(c);
1084
+ if (this.awareness >= 0.35) { this.setPhase(hit ? 'encircle' : 'shadow', c); break; }
1085
+ // a foal nearby: hunt it (only when the pack has not found you)
1086
+ if (this.findPrey !== undefined && this.calmT <= 0 && this.awareness < 0.1 && c.rng.next() < 0.01) {
1087
+ const p = this.findPrey(this.cx(), this.cz(), 70);
1088
+ if (p !== null) { this.prey = p; this.setPhase('shadow', c); }
1089
+ }
1090
+ break;
1091
+ }
1092
+ case 'shadow':
1093
+ if (hit) { this.setPhase('encircle', c); break; }
1094
+ if (this.prey === null && this.awareness < 0.15) { this.setPhase('roam', c); break; }
1095
+ if (dAlpha < 22 || this.phaseT > this.shadowDur || (this.prey !== null && this.phaseT > 6)) this.setPhase('encircle', c);
1096
+ break;
1097
+ case 'encircle': {
1098
+ if (dead > this.deadSeen || (!this.halfDone && hp < this.hpStart * 0.5)) {
1099
+ if (hp < this.hpStart * 0.5) this.halfDone = true;
1100
+ this.deadSeen = dead;
1101
+ if (this.alpha?.alive === true) { this.setPhase('regroup', c); break; }
1102
+ }
1103
+ if (this.prey === null && this.awareness < 0.08 && dAlpha > 50) { this.setPhase('roam', c); break; }
1104
+ this.assignToken(c);
1105
+ break;
1106
+ }
1107
+ case 'regroup':
1108
+ // the alpha howls (2.2 s), the others answer; all pull back to 30 m; then in again, bolder
1109
+ if (!this.howled && this.alpha !== null) { this.howled = true; this.sound(c, this.alpha, this.packSpec.howlCue); this.packPorts.onEvent?.('howl', this.alpha.position.x, this.alpha.position.z); }
1110
+ if (this.phaseT > 3.6) { this.boldT = 10; this.nextTokenT = c.t + 0.6; this.setPhase('encircle', c); }
1111
+ break;
1112
+ case 'break': {
1113
+ let far = true;
1114
+ for (const w of this.members) if (w.alive && w.position.distanceTo(c.player) < 70) far = false;
1115
+ if (far || this.phaseT > 14) { this.calmT = 120; this.awareness = 0; this.setPhase('roam', c); }
1116
+ break;
1117
+ }
1118
+ // no default
1119
+ }
1120
+ }catch(error){if(this.packGuest===undefined)throw error;this.skipGuestFrame(error);}
1121
+ }
1122
+
1123
+ /** hand the attack token(s) to the wolves best placed behind the target */
1124
+ private assignToken(c: CirclingPackContext<A>): void {
1125
+ const tgt = this.target(c);
1126
+ let lungers = 0, living = 0;
1127
+ for (const w of this.members) if (w.alive) { living++; const l = w.mem['lunge'] ?? 0; if (l === 1 || l === 2) lungers++; }
1128
+ const tokens = (this.packPorts.environment().playerMounted && this.prey === null ? 2 : 1) + (this.boldT > 0 ? 1 : 0);
1129
+ if (lungers >= tokens || c.t < this.nextTokenT) return;
1130
+ const facing = this.targetFacing();
1131
+ let best: A | null = null, bestScore = -Infinity;
1132
+ for (const w of this.members) {
1133
+ if (!w.alive || w.stunned || (w.mem['lunge'] ?? 0) !== 0) continue;
1134
+ const d = w.position.distanceTo(tgt);
1135
+ if (d > 24) continue;
1136
+ const role = w.mem['role'] ?? ROLE_FLANK;
1137
+ if (role === ROLE_ALPHA && living > 1 && this.packPorts.environment().playerHealth01 >= 0.6 && this.bites < 3) continue; // the alpha holds back
1138
+ const behind = Math.abs(angDiff(Math.atan2(w.position.x - tgt.x, w.position.z - tgt.z), facing)); // π = straight behind
1139
+ const score = behind - d * 0.03 + (role === ROLE_SCOUT && this.bites === 0 ? 1.5 : 0);
1140
+ if (score > bestScore) { bestScore = score; best = w; }
1141
+ }
1142
+ if (best === null) return;
1143
+ const director = this.groupDirector(tokens, (actor) => actor.alive && ((actor.mem['lunge'] ?? 0) === 1 || (actor.mem['lunge'] ?? 0) === 2));
1144
+ this.packPorts.register(best, director);
1145
+ if (!c.claim(best)) return;
1146
+ best.mem['lhit'] = best.lastHitT; best.mem['lunge'] = 1; best.mem['lt'] = this.packSpec.telegraphSeconds; best.mem['bit'] = 0;
1147
+ this.sound(c, best, this.packSpec.snarlCue);
1148
+ this.nextTokenT = c.t + (this.boldT > 0 ? c.rng.range(1.2, 2.0) : c.rng.range(2.5, 4.0));
1149
+ }
1150
+
1151
+ /** steer one wolf for this tick (after `tick`) */
1152
+ drive(a: A, c: CirclingPackContext<A>, body = false): void {
1153
+ try{ this.requirePack();
1154
+ if (!this.initialized) throw new Error('Pack is not initialized');
1155
+ if(this.packGuest!==undefined&&body!==(this.phase==='encircle'&&(a.mem['lunge']??0)!==0))return;
1156
+ if (this.runPack(`${body ? 'body' : 'drive'}.${this.members.indexOf(a)}`, c, c.rng,this.members.indexOf(a))) return;
1157
+ const m = a.mem;
1158
+ const committed = this.phase === 'encircle' && (m['lunge'] ?? 0) !== 0;
1159
+ if (body !== committed) return;
1160
+ const dt = c.dt;
1161
+ const tgt = this.target(c);
1162
+ const dx = tgt.x - a.position.x, dz = tgt.z - a.position.z, d = Math.hypot(dx, dz);
1163
+ const toTgt = Math.atan2(dx, dz);
1164
+ const role = m['role'] ?? ROLE_FLANK;
1165
+ let low = 0, snarl = 0, howl = 0;
1166
+ a.lookTarget.copy(tgt); a.lookWeight = this.phase === 'roam' ? 0 : 0.8;
1167
+ // a hit mid-lunge staggers it and breaks the lunge off
1168
+ const lunge = m['lunge'] ?? 0;
1169
+ if ((lunge === 1 || lunge === 2) && a.lastHitT > (m['lhit'] ?? -Infinity)) {
1170
+ _t.set(-dx, 0, -dz).normalize();
1171
+ a.stagger(_t, 0.7); a.cancelAttack();
1172
+ m['lunge'] = 3; m['lt'] = this.packSpec.breakoffSeconds + 0.5;
1173
+ }
1174
+ m['lhit'] = a.lastHitT;
1175
+
1176
+ switch (this.phase) {
1177
+ case 'roam': {
1178
+ const tx = this.roamX + (m['ox'] ?? 0), tz = this.roamZ + (m['oz'] ?? 0);
1179
+ const td = Math.hypot(tx - a.position.x, tz - a.position.z);
1180
+ if (td > 3) this.steerSep(a, c, c.pathYaw(a, tx, tz, 2), td > 25 ? this.packSpec.trotSpeed : 1.6, 2.5);
1181
+ else { a.setMotion(a.yaw, 0, 1.5); a.state = 'graze'; } // sniffing the ground
1182
+ if (td > 3) a.state = 'wander';
1183
+ break;
1184
+ }
1185
+ case 'shadow': {
1186
+ a.state = 'stalk'; low = 1;
1187
+ // stay 30–40 m out on our side of the target, in the tallest grass we can find
1188
+ m['st'] = (m['st'] ?? 0) - dt;
1189
+ if (m['st'] <= 0 || m['sx'] === undefined) {
1190
+ m['st'] = 1.5;
1191
+ const bearing = Math.atan2(a.position.x - tgt.x, a.position.z - tgt.z);
1192
+ const r = this.packSpec.shadowMinRadius + (a.seed % 1) * (this.packSpec.shadowMaxRadius - this.packSpec.shadowMinRadius);
1193
+ let bestG = -1, bx = a.position.x, bz = a.position.z;
1194
+ for (let k = -2; k <= 2; k++) {
1195
+ const ang = bearing + k * 0.3;
1196
+ const x = tgt.x + Math.sin(ang) * r, z = tgt.z + Math.cos(ang) * r;
1197
+ if (!this.packPorts.inBounds(x, z, 24)) continue;
1198
+ const g = this.packPorts.environment().grassHeightAt(x, z) - Math.abs(k) * 0.05;
1199
+ if (g > bestG) { bestG = g; bx = x; bz = z; }
1200
+ }
1201
+ m['sx'] = bx; m['sz'] = bz;
1202
+ }
1203
+ const sx = m['sx'] ?? a.position.x, sz = m['sz'] ?? a.position.z;
1204
+ const sd = Math.hypot(sx - a.position.x, sz - a.position.z);
1205
+ const speed = d > 55 ? this.packSpec.runSpeed * 0.8 : sd > 4 ? this.packSpec.trotSpeed : sd > 1.5 ? 1.4 : 0;
1206
+ if (speed > 0) this.steerSep(a, c, c.pathYaw(a, sx, sz, 1.5), speed, 3);
1207
+ else a.setMotion(toTgt, 0, 2);
1208
+ break;
1209
+ }
1210
+ case 'encircle': {
1211
+ a.state = 'stalk';
1212
+ if (lunge === 1) {
1213
+ // the telegraph: stop, face, crouch, snarl
1214
+ a.state = 'attack'; low = 1; snarl = 1;
1215
+ a.setMotion(toTgt, 0, 6);
1216
+ m['lt'] = (m['lt'] ?? 0) - dt;
1217
+ if ((m['lt'] ?? 0) <= 0) { m['lunge'] = 2; m['lt'] = this.packSpec.dashSeconds; }
1218
+ break;
1219
+ }
1220
+ if (lunge === 2) {
1221
+ a.state = 'charge'; snarl = 1;
1222
+ c.steer(a, toTgt, this.packSpec.runSpeed * a.mods.speed, 7);
1223
+ if (d < 2.6 && a.attackPhase < 0) a.startAttack(this.packSpec.attackSeconds);
1224
+ m['lt'] = (m['lt'] ?? 0) - dt;
1225
+ if (d < this.packSpec.biteRadius * Math.max(1, a.scale) + 0.25 && (m['bit'] ?? 0) === 0) {
1226
+ m['bit'] = 1; this.bites++;
1227
+ this.sound(c, a, this.packSpec.biteCue);
1228
+ if (this.prey !== null) { _t.set(dx, 0, dz).normalize(); this.prey.applyDamage(role === ROLE_ALPHA ? 22 : 15, this.prey.position, _t); }
1229
+ else { this.packPorts.bite(a, c, this.packSpec.biteRadius * Math.max(1, a.scale) + 0.25); if (this.packPorts.environment().playerMounted) this.packPorts.onEvent?.('rider-bitten', a.position.x, a.position.z); } // B1: the horse panics
1230
+ m['lunge'] = 3; m['lt'] = this.packSpec.breakoffSeconds;
1231
+ } else if ((m['lt'] ?? 0) <= 0) { m['lunge'] = 3; m['lt'] = this.packSpec.breakoffSeconds * 0.6; }
1232
+ break;
1233
+ }
1234
+ if (lunge === 3) {
1235
+ // hard break-off: out and round, back toward the ring
1236
+ a.state = 'flee';
1237
+ m['lt'] = (m['lt'] ?? 0) - dt;
1238
+ const out = Math.atan2(-dx, -dz) + ((a.seed * 10) % 2 < 1 ? 0.6 : -0.6);
1239
+ c.steer(a, out, 8, 5);
1240
+ if ((m['lt'] ?? 0) <= 0) { m['lunge'] = 0; a.cancelAttack(); }
1241
+ break;
1242
+ }
1243
+ // on the ring: take the slot, drift with the target's turning, never cut through it
1244
+ const slot = this.slotFor(a, c);
1245
+ const R = (m['ring'] ?? 14) + (role === ROLE_ALPHA ? 5 : 0);
1246
+ const bearing = Math.atan2(a.position.x - tgt.x, a.position.z - tgt.z);
1247
+ const step = MathUtils.clamp(angDiff(slot, bearing), -0.7, 0.7);
1248
+ const ang = bearing + step;
1249
+ const px = tgt.x + Math.sin(ang) * R, pz = tgt.z + Math.cos(ang) * R;
1250
+ const pd = Math.hypot(px - a.position.x, pz - a.position.z);
1251
+ low = 0.25; // on the ring: slinking, head still over the grass
1252
+ if (pd > 1.2) this.steerSep(a, c, pd > 6 ? c.pathYaw(a, px, pz, 0.8) : Math.atan2(px - a.position.x, pz - a.position.z), pd > 10 ? this.packSpec.runSpeed * 0.85 : pd > 3 ? this.packSpec.trotSpeed * 1.2 : 2.2, 4);
1253
+ else a.setMotion(toTgt, 0, 3);
1254
+ break;
1255
+ }
1256
+ case 'regroup': {
1257
+ a.state = 'alert';
1258
+ if (a === this.alpha) {
1259
+ a.setMotion(toTgt, 0, 2);
1260
+ howl = this.phaseT < 2.6 ? 1 : 0;
1261
+ a.lookWeight = 0;
1262
+ } else if (d < 29) {
1263
+ this.steerSep(a, c, Math.atan2(-dx, -dz), this.packSpec.runSpeed * 0.8, 4); // pull back to 30 m…
1264
+ } else {
1265
+ a.setMotion(toTgt, 0, 2); howl = this.phaseT > 0.8 && this.phaseT < 2.8 && (a.seed * 7) % 1 > 0.35 ? 1 : 0; // …and answer the howl
1266
+ }
1267
+ m['lunge'] = 0;
1268
+ break;
1269
+ }
1270
+ case 'break':
1271
+ a.state = 'flee';
1272
+ this.steerSep(a, c, Math.atan2(-dx, -dz), this.packSpec.runSpeed * a.mods.speed, 3.5);
1273
+ break;
1274
+ // no default
1275
+ }
1276
+ // pose knobs (postPose eases toward them)
1277
+ m['low'] = ease(m['low'] ?? 0, low, dt * 5);
1278
+ m['snarl'] = ease(m['snarl'] ?? 0, snarl, dt * 8);
1279
+ m['howl'] = ease(m['howl'] ?? 0, howl, dt * 4);
1280
+ // stealth: still in tall grass and more than 10 m out → hidden (off the minimap, out of aim assist)
1281
+ m['hidden'] = a.speed < 0.5 && d > 10 && this.packPorts.environment().grassHeightAt(a.position.x, a.position.z) >= 0.8 ? 1 : 0;
1282
+ }catch(error){if(this.packGuest===undefined)throw error;this.skipGuestFrame(error);}
1283
+ }
1284
+
1285
+ /** the ring angle (bearing from the target) this wolf should hold: slots spread round the back, out of the view cone */
1286
+ private slotFor(a: A, c: CirclingPackContext<A>): number {
1287
+ const tgt = this.target(c);
1288
+ const behind = this.targetFacing() + Math.PI;
1289
+ // ring members in bearing order (relative to "behind"); a tiny n, so a sort of a small scratch array is fine
1290
+ const ring = this.ringScratch; ring.length = 0;
1291
+ for (const w of this.members) if (w.alive && (w.mem['lunge'] ?? 0) === 0) ring.push(w);
1292
+ const n = ring.length;
1293
+ if (n <= 1) return behind;
1294
+ const rel = (w: A): number => angDiff(Math.atan2(w.position.x - tgt.x, w.position.z - tgt.z), behind);
1295
+ ring.sort((p, q) => rel(p) - rel(q));
1296
+ const spacing = Math.min((Math.PI * 2) / n, (Math.PI * 1.5) / (n - 1));
1297
+ const k = ring.indexOf(a);
1298
+ return behind + (k - (n - 1) / 2) * spacing;
1299
+ }
1300
+ private ringScratch: A[] = [];
1301
+
1302
+ /** steer with a little separation from pack-mates so they don't stack */
1303
+ private steerSep(a: A, c: CirclingPackContext<A>, yaw: number, speed: number, turnRate: number): void {
1304
+ let vx = Math.sin(yaw), vz = Math.cos(yaw);
1305
+ for (const w of this.members) {
1306
+ if (w === a || !w.alive) continue;
1307
+ const ox = a.position.x - w.position.x, oz = a.position.z - w.position.z, d = Math.hypot(ox, oz);
1308
+ if (d < 2.2 && d > 1e-3) { const f = (1 - d / 2.2) * 1.2; vx += (ox / d) * f; vz += (oz / d) * f; }
1309
+ }
1310
+ c.steer(a, Math.atan2(vx, vz), speed, turnRate);
1311
+ }
1312
+ }
1313
+
1314
+ /** Complete admitted data, independent of validator implementation metadata. */
1315
+ type BoundedHowlerSpecInput = BoundedHowlerSpec;
1316
+ interface BoundedHowlerSpecFields {
1317
+ initialHowl: number;
1318
+ engagedHowl: number;
1319
+ phaseCooldown: number;
1320
+ interruptedHowl: number;
1321
+ nextHowl: number;
1322
+ randomHowl: number;
1323
+ pathSeconds: number;
1324
+ pathNear: number;
1325
+ homePathSeconds: number;
1326
+ homeStop: number;
1327
+ homeReset: number;
1328
+ meleeRadius: number;
1329
+ grassHeight: number;
1330
+ hiddenDamage: number;
1331
+ fields: {
1332
+ howl: string;
1333
+ low: string;
1334
+ snarl: string;
1335
+ };
1336
+ speeds: {
1337
+ home: number;
1338
+ watched: number;
1339
+ hold: number;
1340
+ hunt: number;
1341
+ bite: number;
1342
+ };
1343
+ turns: {
1344
+ home: number;
1345
+ den: number;
1346
+ hold: number;
1347
+ howl: number;
1348
+ hunt: number;
1349
+ bite: number;
1350
+ };
1351
+ hold: {
1352
+ watchedDot: number;
1353
+ minRadius: number;
1354
+ maxRadius: number;
1355
+ sidestep: number;
1356
+ arrival: number;
1357
+ watchedLow: number;
1358
+ low: number;
1359
+ };
1360
+ hunt: {
1361
+ snarlDistance: number;
1362
+ attackDistance: number;
1363
+ moveDistance: number;
1364
+ };
1365
+ bite: {
1366
+ seconds: number;
1367
+ phase: number;
1368
+ range: number;
1369
+ damage: number;
1370
+ cooldown: number;
1371
+ };
1372
+ howl: {
1373
+ growSeconds: number;
1374
+ seconds: number;
1375
+ radius: number;
1376
+ speed: number;
1377
+ span: number;
1378
+ strength: number;
1379
+ stagger: number;
1380
+ scare: number;
1381
+ };
1382
+ }
1383
+ type BoundedHowlerSpec = { [Key in keyof BoundedHowlerSpecFields]: BoundedHowlerSpecFields[Key] };
1384
+ type BoundedHowlerSaveInput = BoundedHowlerSave;
1385
+ interface BoundedHowlerSaveFields {
1386
+ st: "howl" | "home" | "hold" | "hunt" | "den";
1387
+ howlT: number;
1388
+ stT: number;
1389
+ howlHit: number;
1390
+ cd: number;
1391
+ bit: boolean;
1392
+ }
1393
+ type BoundedHowlerSave = { [Key in keyof BoundedHowlerSaveFields]: BoundedHowlerSaveFields[Key] };
1394
+ type BoundedPouncerSpecInput = BoundedPouncerSpec;
1395
+ interface BoundedPouncerSpecFields {
1396
+ initialCooldown: number;
1397
+ awareCooldown: number;
1398
+ lookIdle: number;
1399
+ homeRadius: number;
1400
+ pathSeconds: number;
1401
+ ledgeMargin: number;
1402
+ standRate: number;
1403
+ openSeconds: number;
1404
+ openCooldown: number;
1405
+ fields: {
1406
+ low: string;
1407
+ leap: string;
1408
+ snarl: string;
1409
+ };
1410
+ pose: {
1411
+ stalk: number;
1412
+ perch: number;
1413
+ open: number;
1414
+ leapSwing: number;
1415
+ leapBase: number;
1416
+ };
1417
+ speeds: {
1418
+ home: number;
1419
+ perch: number;
1420
+ stalk: number;
1421
+ back: number;
1422
+ };
1423
+ turns: {
1424
+ home: number;
1425
+ idle: number;
1426
+ swipeStart: number;
1427
+ perch: number;
1428
+ stalk: number;
1429
+ tell: number;
1430
+ open: number;
1431
+ swipe: number;
1432
+ };
1433
+ stalk: {
1434
+ far: number;
1435
+ near: number;
1436
+ };
1437
+ perch: {
1438
+ minHeight: number;
1439
+ maxHeight: number;
1440
+ minDistance: number;
1441
+ maxDistance: number;
1442
+ arrival: number;
1443
+ retreatHeight: number;
1444
+ retreatDistance: number;
1445
+ cooldown: number;
1446
+ waitSeconds: number;
1447
+ };
1448
+ damage: {
1449
+ airborne: number;
1450
+ openHead: number;
1451
+ perched: number;
1452
+ };
1453
+ swipe: {
1454
+ from: number;
1455
+ seconds: number;
1456
+ first: number;
1457
+ second: number;
1458
+ range: number;
1459
+ damage: number;
1460
+ cooldown: number;
1461
+ };
1462
+ pounce: {
1463
+ minDistance: number;
1464
+ maxDistance: number;
1465
+ seconds: number;
1466
+ arcHeight: number;
1467
+ range: number;
1468
+ damage: number;
1469
+ cooldown: number;
1470
+ };
1471
+ tell: {
1472
+ radius: number;
1473
+ strength: number;
1474
+ growth: number;
1475
+ growSeconds: number;
1476
+ seconds: number;
1477
+ };
1478
+ }
1479
+ type BoundedPouncerSpec = { [Key in keyof BoundedPouncerSpecFields]: BoundedPouncerSpecFields[Key] };
1480
+ type BoundedPouncerSaveInput = BoundedPouncerSave;
1481
+ interface BoundedPouncerSaveFields {
1482
+ st: "home" | "leap" | "stalk" | "perch" | "open" | "tell" | "swipe" | "lurk";
1483
+ stT: number;
1484
+ cd: number;
1485
+ from: [
1486
+ number,
1487
+ number,
1488
+ number
1489
+ ];
1490
+ to: [
1491
+ number,
1492
+ number,
1493
+ number
1494
+ ];
1495
+ goal: {
1496
+ x: number;
1497
+ z: number;
1498
+ y: number;
1499
+ } | null;
1500
+ hitDone: 0 | 1 | 2;
1501
+ }
1502
+ type BoundedPouncerSave = { [Key in keyof BoundedPouncerSaveFields]: BoundedPouncerSaveFields[Key] };