@ttsc/unplugin 0.38.1 → 0.38.2

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 (608) hide show
  1. package/README.md +1 -1
  2. package/lib/core/bridge/HostWatchBridge.d.cts +1 -1
  3. package/lib/core/bridge/HostWatchBridge.d.mts +1 -1
  4. package/lib/core/bridge/HostWatchBridge.d.ts +1 -1
  5. package/lib/core/bridge/MANAGED_PROJECT_RECORDS.d.cts +2 -0
  6. package/lib/core/bridge/MANAGED_PROJECT_RECORDS.d.mts +2 -0
  7. package/lib/core/bridge/MANAGED_PROJECT_RECORDS.d.ts +2 -0
  8. package/lib/core/bridge/MANAGED_PROJECT_RECORDS.js +7 -0
  9. package/lib/core/bridge/MANAGED_PROJECT_RECORDS.js.map +1 -0
  10. package/lib/core/bridge/MANAGED_PROJECT_RECORDS.mjs +5 -0
  11. package/lib/core/bridge/MANAGED_PROJECT_RECORDS.mjs.map +1 -0
  12. package/lib/core/bridge/TtscProjectRecord.d.cts +9 -0
  13. package/lib/core/bridge/TtscProjectRecord.d.mts +9 -0
  14. package/lib/core/bridge/TtscProjectRecord.d.ts +9 -0
  15. package/lib/core/bridge/fallbackRecordStorage.d.cts +33 -0
  16. package/lib/core/bridge/fallbackRecordStorage.d.mts +33 -0
  17. package/lib/core/bridge/fallbackRecordStorage.d.ts +33 -0
  18. package/lib/core/bridge/fallbackRecordStorage.js +96 -0
  19. package/lib/core/bridge/fallbackRecordStorage.js.map +1 -0
  20. package/lib/core/bridge/fallbackRecordStorage.mjs +94 -0
  21. package/lib/core/bridge/fallbackRecordStorage.mjs.map +1 -0
  22. package/lib/core/bridge/fallbackToolDirectory.d.cts +11 -15
  23. package/lib/core/bridge/fallbackToolDirectory.d.mts +11 -15
  24. package/lib/core/bridge/fallbackToolDirectory.d.ts +11 -15
  25. package/lib/core/bridge/fallbackToolDirectory.js +19 -30
  26. package/lib/core/bridge/fallbackToolDirectory.js.map +1 -1
  27. package/lib/core/bridge/fallbackToolDirectory.mjs +19 -30
  28. package/lib/core/bridge/fallbackToolDirectory.mjs.map +1 -1
  29. package/lib/core/bridge/fallbackToolDirectoryLocation.d.cts +14 -0
  30. package/lib/core/bridge/fallbackToolDirectoryLocation.d.mts +14 -0
  31. package/lib/core/bridge/fallbackToolDirectoryLocation.d.ts +14 -0
  32. package/lib/core/bridge/fallbackToolDirectoryLocation.js +38 -0
  33. package/lib/core/bridge/fallbackToolDirectoryLocation.js.map +1 -0
  34. package/lib/core/bridge/fallbackToolDirectoryLocation.mjs +36 -0
  35. package/lib/core/bridge/fallbackToolDirectoryLocation.mjs.map +1 -0
  36. package/lib/core/bridge/hostToolDirectory.d.cts +13 -46
  37. package/lib/core/bridge/hostToolDirectory.d.mts +13 -46
  38. package/lib/core/bridge/hostToolDirectory.d.ts +13 -46
  39. package/lib/core/bridge/hostToolDirectory.js +14 -47
  40. package/lib/core/bridge/hostToolDirectory.js.map +1 -1
  41. package/lib/core/bridge/hostToolDirectory.mjs +14 -47
  42. package/lib/core/bridge/hostToolDirectory.mjs.map +1 -1
  43. package/lib/core/bridge/openHostWatchBridge.d.cts +11 -1
  44. package/lib/core/bridge/openHostWatchBridge.d.mts +11 -1
  45. package/lib/core/bridge/openHostWatchBridge.d.ts +11 -1
  46. package/lib/core/bridge/openHostWatchBridge.js +28 -6
  47. package/lib/core/bridge/openHostWatchBridge.js.map +1 -1
  48. package/lib/core/bridge/openHostWatchBridge.mjs +28 -6
  49. package/lib/core/bridge/openHostWatchBridge.mjs.map +1 -1
  50. package/lib/core/bridge/prepareProjectRecordDirectory.d.cts +41 -0
  51. package/lib/core/bridge/prepareProjectRecordDirectory.d.mts +41 -0
  52. package/lib/core/bridge/prepareProjectRecordDirectory.d.ts +41 -0
  53. package/lib/core/bridge/prepareProjectRecordDirectory.js +127 -0
  54. package/lib/core/bridge/prepareProjectRecordDirectory.js.map +1 -0
  55. package/lib/core/bridge/prepareProjectRecordDirectory.mjs +125 -0
  56. package/lib/core/bridge/prepareProjectRecordDirectory.mjs.map +1 -0
  57. package/lib/core/bridge/privateProjectRecordAvailable.d.cts +13 -0
  58. package/lib/core/bridge/privateProjectRecordAvailable.d.mts +13 -0
  59. package/lib/core/bridge/privateProjectRecordAvailable.d.ts +13 -0
  60. package/lib/core/bridge/privateProjectRecordAvailable.js +31 -0
  61. package/lib/core/bridge/privateProjectRecordAvailable.js.map +1 -0
  62. package/lib/core/bridge/privateProjectRecordAvailable.mjs +29 -0
  63. package/lib/core/bridge/privateProjectRecordAvailable.mjs.map +1 -0
  64. package/lib/core/bridge/projectRecordMoved.js +5 -0
  65. package/lib/core/bridge/projectRecordMoved.js.map +1 -1
  66. package/lib/core/bridge/projectRecordMoved.mjs +5 -0
  67. package/lib/core/bridge/projectRecordMoved.mjs.map +1 -1
  68. package/lib/core/bridge/projectRecordWatchInputs.js +6 -0
  69. package/lib/core/bridge/projectRecordWatchInputs.js.map +1 -1
  70. package/lib/core/bridge/projectRecordWatchInputs.mjs +6 -0
  71. package/lib/core/bridge/projectRecordWatchInputs.mjs.map +1 -1
  72. package/lib/core/bridge/readProjectRecordFile.js +23 -1
  73. package/lib/core/bridge/readProjectRecordFile.js.map +1 -1
  74. package/lib/core/bridge/readProjectRecordFile.mjs +23 -1
  75. package/lib/core/bridge/readProjectRecordFile.mjs.map +1 -1
  76. package/lib/core/bridge/refreshProjectRecordFile.d.cts +7 -2
  77. package/lib/core/bridge/refreshProjectRecordFile.d.mts +7 -2
  78. package/lib/core/bridge/refreshProjectRecordFile.d.ts +7 -2
  79. package/lib/core/bridge/refreshProjectRecordFile.js +24 -7
  80. package/lib/core/bridge/refreshProjectRecordFile.js.map +1 -1
  81. package/lib/core/bridge/refreshProjectRecordFile.mjs +24 -7
  82. package/lib/core/bridge/refreshProjectRecordFile.mjs.map +1 -1
  83. package/lib/core/bridge/refreshProjectRecordFiles.d.cts +7 -4
  84. package/lib/core/bridge/refreshProjectRecordFiles.d.mts +7 -4
  85. package/lib/core/bridge/refreshProjectRecordFiles.d.ts +7 -4
  86. package/lib/core/bridge/refreshProjectRecordFiles.js +30 -8
  87. package/lib/core/bridge/refreshProjectRecordFiles.js.map +1 -1
  88. package/lib/core/bridge/refreshProjectRecordFiles.mjs +30 -8
  89. package/lib/core/bridge/refreshProjectRecordFiles.mjs.map +1 -1
  90. package/lib/core/bridge/registerProjectRecord.js +3 -1
  91. package/lib/core/bridge/registerProjectRecord.js.map +1 -1
  92. package/lib/core/bridge/registerProjectRecord.mjs +3 -1
  93. package/lib/core/bridge/registerProjectRecord.mjs.map +1 -1
  94. package/lib/core/bridge/signalProjectRecordFile.d.cts +7 -2
  95. package/lib/core/bridge/signalProjectRecordFile.d.mts +7 -2
  96. package/lib/core/bridge/signalProjectRecordFile.d.ts +7 -2
  97. package/lib/core/bridge/signalProjectRecordFile.js +18 -5
  98. package/lib/core/bridge/signalProjectRecordFile.js.map +1 -1
  99. package/lib/core/bridge/signalProjectRecordFile.mjs +18 -5
  100. package/lib/core/bridge/signalProjectRecordFile.mjs.map +1 -1
  101. package/lib/core/bridge/writeProjectRecordFile.js +7 -3
  102. package/lib/core/bridge/writeProjectRecordFile.js.map +1 -1
  103. package/lib/core/bridge/writeProjectRecordFile.mjs +7 -3
  104. package/lib/core/bridge/writeProjectRecordFile.mjs.map +1 -1
  105. package/lib/core/esbuild/createEsbuildOptions.js +9 -7
  106. package/lib/core/esbuild/createEsbuildOptions.js.map +1 -1
  107. package/lib/core/esbuild/createEsbuildOptions.mjs +9 -7
  108. package/lib/core/esbuild/createEsbuildOptions.mjs.map +1 -1
  109. package/lib/core/farm/createFarmRecordUpdates.d.cts +63 -0
  110. package/lib/core/farm/createFarmRecordUpdates.d.mts +63 -0
  111. package/lib/core/farm/createFarmRecordUpdates.d.ts +63 -0
  112. package/lib/core/farm/createFarmRecordUpdates.js +129 -0
  113. package/lib/core/farm/createFarmRecordUpdates.js.map +1 -0
  114. package/lib/core/farm/createFarmRecordUpdates.mjs +127 -0
  115. package/lib/core/farm/createFarmRecordUpdates.mjs.map +1 -0
  116. package/lib/core/farm/farmPersistentCacheWithoutRecords.d.cts +15 -40
  117. package/lib/core/farm/farmPersistentCacheWithoutRecords.d.mts +15 -40
  118. package/lib/core/farm/farmPersistentCacheWithoutRecords.d.ts +15 -40
  119. package/lib/core/farm/farmPersistentCacheWithoutRecords.js +23 -56
  120. package/lib/core/farm/farmPersistentCacheWithoutRecords.js.map +1 -1
  121. package/lib/core/farm/farmPersistentCacheWithoutRecords.mjs +23 -56
  122. package/lib/core/farm/farmPersistentCacheWithoutRecords.mjs.map +1 -1
  123. package/lib/core/farm/farmRecordFallback.d.cts +15 -15
  124. package/lib/core/farm/farmRecordFallback.d.mts +15 -15
  125. package/lib/core/farm/farmRecordFallback.d.ts +15 -15
  126. package/lib/core/farm/farmRecordFallback.js +22 -20
  127. package/lib/core/farm/farmRecordFallback.js.map +1 -1
  128. package/lib/core/farm/farmRecordFallback.mjs +22 -20
  129. package/lib/core/farm/farmRecordFallback.mjs.map +1 -1
  130. package/lib/core/next/next.js +5 -4
  131. package/lib/core/next/next.js.map +1 -1
  132. package/lib/core/next/next.mjs +5 -4
  133. package/lib/core/next/next.mjs.map +1 -1
  134. package/lib/core/observer/InputCondition.d.cts +5 -0
  135. package/lib/core/observer/InputCondition.d.mts +5 -0
  136. package/lib/core/observer/InputCondition.d.ts +5 -0
  137. package/lib/core/observer/InputObserverChange.d.cts +2 -0
  138. package/lib/core/observer/InputObserverChange.d.mts +2 -0
  139. package/lib/core/observer/InputObserverChange.d.ts +2 -0
  140. package/lib/core/observer/createInputObserver.d.cts +3 -1
  141. package/lib/core/observer/createInputObserver.d.mts +3 -1
  142. package/lib/core/observer/createInputObserver.d.ts +3 -1
  143. package/lib/core/observer/createInputObserver.js +179 -26
  144. package/lib/core/observer/createInputObserver.js.map +1 -1
  145. package/lib/core/observer/createInputObserver.mjs +180 -27
  146. package/lib/core/observer/createInputObserver.mjs.map +1 -1
  147. package/lib/core/observer/ttscWriteDirectories.d.cts +31 -0
  148. package/lib/core/observer/ttscWriteDirectories.d.mts +31 -0
  149. package/lib/core/observer/ttscWriteDirectories.d.ts +31 -0
  150. package/lib/core/observer/ttscWriteDirectories.js +59 -0
  151. package/lib/core/observer/ttscWriteDirectories.js.map +1 -0
  152. package/lib/core/observer/ttscWriteDirectories.mjs +57 -0
  153. package/lib/core/observer/ttscWriteDirectories.mjs.map +1 -0
  154. package/lib/core/rollup/TtscRollupDelivery.d.cts +2 -0
  155. package/lib/core/rollup/TtscRollupDelivery.d.mts +2 -0
  156. package/lib/core/rollup/TtscRollupDelivery.d.ts +2 -0
  157. package/lib/core/rollup/createRollupCachedModuleProof.d.cts +15 -11
  158. package/lib/core/rollup/createRollupCachedModuleProof.d.mts +15 -11
  159. package/lib/core/rollup/createRollupCachedModuleProof.d.ts +15 -11
  160. package/lib/core/rollup/createRollupCachedModuleProof.js +62 -33
  161. package/lib/core/rollup/createRollupCachedModuleProof.js.map +1 -1
  162. package/lib/core/rollup/createRollupCachedModuleProof.mjs +62 -33
  163. package/lib/core/rollup/createRollupCachedModuleProof.mjs.map +1 -1
  164. package/lib/core/rollup/rollupDeliveryOptions.d.cts +6 -4
  165. package/lib/core/rollup/rollupDeliveryOptions.d.mts +6 -4
  166. package/lib/core/rollup/rollupDeliveryOptions.d.ts +6 -4
  167. package/lib/core/rollup/rollupDeliveryOptions.js +7 -4
  168. package/lib/core/rollup/rollupDeliveryOptions.js.map +1 -1
  169. package/lib/core/rollup/rollupDeliveryOptions.mjs +7 -4
  170. package/lib/core/rollup/rollupDeliveryOptions.mjs.map +1 -1
  171. package/lib/core/transform/cache/TtscCachedProjectTransform.d.cts +7 -0
  172. package/lib/core/transform/cache/TtscCachedProjectTransform.d.mts +7 -0
  173. package/lib/core/transform/cache/TtscCachedProjectTransform.d.ts +7 -0
  174. package/lib/core/transform/cache/selectCachedGenerationAction.d.cts +3 -1
  175. package/lib/core/transform/cache/selectCachedGenerationAction.d.mts +3 -1
  176. package/lib/core/transform/cache/selectCachedGenerationAction.d.ts +3 -1
  177. package/lib/core/transform/cache/selectCachedGenerationAction.js +7 -4
  178. package/lib/core/transform/cache/selectCachedGenerationAction.js.map +1 -1
  179. package/lib/core/transform/cache/selectCachedGenerationAction.mjs +7 -4
  180. package/lib/core/transform/cache/selectCachedGenerationAction.mjs.map +1 -1
  181. package/lib/core/transform/deliverCachedTransform.js +1 -0
  182. package/lib/core/transform/deliverCachedTransform.js.map +1 -1
  183. package/lib/core/transform/deliverCachedTransform.mjs +1 -0
  184. package/lib/core/transform/deliverCachedTransform.mjs.map +1 -1
  185. package/lib/core/transform/envelope/TtscEnvelopeDerivation.d.cts +6 -15
  186. package/lib/core/transform/envelope/TtscEnvelopeDerivation.d.mts +6 -15
  187. package/lib/core/transform/envelope/TtscEnvelopeDerivation.d.ts +6 -15
  188. package/lib/core/transform/envelope/collectDeclaredIdentities.d.cts +1 -1
  189. package/lib/core/transform/envelope/collectDeclaredIdentities.d.mts +1 -1
  190. package/lib/core/transform/envelope/collectDeclaredIdentities.d.ts +1 -1
  191. package/lib/core/transform/envelope/collectDeclaredIdentities.js.map +1 -1
  192. package/lib/core/transform/envelope/collectDeclaredIdentities.mjs.map +1 -1
  193. package/lib/core/transform/envelope/createEnvelopeKeyIndex.d.cts +1 -1
  194. package/lib/core/transform/envelope/createEnvelopeKeyIndex.d.mts +1 -1
  195. package/lib/core/transform/envelope/createEnvelopeKeyIndex.d.ts +1 -1
  196. package/lib/core/transform/envelope/createEnvelopeKeyIndex.js.map +1 -1
  197. package/lib/core/transform/envelope/createEnvelopeKeyIndex.mjs.map +1 -1
  198. package/lib/core/transform/envelope/declaresCompleteDependencies.d.cts +2 -2
  199. package/lib/core/transform/envelope/declaresCompleteDependencies.d.mts +2 -2
  200. package/lib/core/transform/envelope/declaresCompleteDependencies.d.ts +2 -2
  201. package/lib/core/transform/envelope/declaresCompleteDependencies.js +2 -1
  202. package/lib/core/transform/envelope/declaresCompleteDependencies.js.map +1 -1
  203. package/lib/core/transform/envelope/declaresCompleteDependencies.mjs +2 -1
  204. package/lib/core/transform/envelope/declaresCompleteDependencies.mjs.map +1 -1
  205. package/lib/core/transform/envelope/derivationIdentity.d.cts +1 -1
  206. package/lib/core/transform/envelope/derivationIdentity.d.mts +1 -1
  207. package/lib/core/transform/envelope/derivationIdentity.d.ts +1 -1
  208. package/lib/core/transform/envelope/derivationIdentity.js.map +1 -1
  209. package/lib/core/transform/envelope/derivationIdentity.mjs.map +1 -1
  210. package/lib/core/transform/envelope/deriveWatchInputs.js +4 -64
  211. package/lib/core/transform/envelope/deriveWatchInputs.js.map +1 -1
  212. package/lib/core/transform/envelope/deriveWatchInputs.mjs +4 -64
  213. package/lib/core/transform/envelope/deriveWatchInputs.mjs.map +1 -1
  214. package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.d.cts +24 -0
  215. package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.d.mts +24 -0
  216. package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.d.ts +24 -0
  217. package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.js +84 -0
  218. package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.js.map +1 -0
  219. package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.mjs +82 -0
  220. package/lib/core/transform/envelope/deriveWatchInputsFromIndexes.mjs.map +1 -0
  221. package/lib/core/transform/envelope/envelopeDerivation.js +1 -0
  222. package/lib/core/transform/envelope/envelopeDerivation.js.map +1 -1
  223. package/lib/core/transform/envelope/envelopeDerivation.mjs +1 -0
  224. package/lib/core/transform/envelope/envelopeDerivation.mjs.map +1 -1
  225. package/lib/core/transform/envelope/envelopeGraphIndexes.d.cts +2 -1
  226. package/lib/core/transform/envelope/envelopeGraphIndexes.d.mts +2 -1
  227. package/lib/core/transform/envelope/envelopeGraphIndexes.d.ts +2 -1
  228. package/lib/core/transform/envelope/envelopeGraphIndexes.js +2 -1
  229. package/lib/core/transform/envelope/envelopeGraphIndexes.js.map +1 -1
  230. package/lib/core/transform/envelope/envelopeGraphIndexes.mjs +2 -1
  231. package/lib/core/transform/envelope/envelopeGraphIndexes.mjs.map +1 -1
  232. package/lib/core/transform/envelope/isVolatileFile.d.cts +2 -2
  233. package/lib/core/transform/envelope/isVolatileFile.d.mts +2 -2
  234. package/lib/core/transform/envelope/isVolatileFile.d.ts +2 -2
  235. package/lib/core/transform/envelope/isVolatileFile.js +1 -1
  236. package/lib/core/transform/envelope/isVolatileFile.js.map +1 -1
  237. package/lib/core/transform/envelope/isVolatileFile.mjs +1 -1
  238. package/lib/core/transform/envelope/isVolatileFile.mjs.map +1 -1
  239. package/lib/core/transform/envelope/selectFileDependencies.d.cts +4 -5
  240. package/lib/core/transform/envelope/selectFileDependencies.d.mts +4 -5
  241. package/lib/core/transform/envelope/selectFileDependencies.d.ts +4 -5
  242. package/lib/core/transform/envelope/selectFileDependencies.js +3 -10
  243. package/lib/core/transform/envelope/selectFileDependencies.js.map +1 -1
  244. package/lib/core/transform/envelope/selectFileDependencies.mjs +3 -10
  245. package/lib/core/transform/envelope/selectFileDependencies.mjs.map +1 -1
  246. package/lib/core/transform/envelope/selectGraphInputs.d.cts +2 -5
  247. package/lib/core/transform/envelope/selectGraphInputs.d.mts +2 -5
  248. package/lib/core/transform/envelope/selectGraphInputs.d.ts +2 -5
  249. package/lib/core/transform/envelope/selectGraphInputs.js +5 -4
  250. package/lib/core/transform/envelope/selectGraphInputs.js.map +1 -1
  251. package/lib/core/transform/envelope/selectGraphInputs.mjs +5 -4
  252. package/lib/core/transform/envelope/selectGraphInputs.mjs.map +1 -1
  253. package/lib/core/transform/envelope/selectHostInputs.d.cts +1 -1
  254. package/lib/core/transform/envelope/selectHostInputs.d.mts +1 -1
  255. package/lib/core/transform/envelope/selectHostInputs.d.ts +1 -1
  256. package/lib/core/transform/envelope/selectHostInputs.js +4 -1
  257. package/lib/core/transform/envelope/selectHostInputs.js.map +1 -1
  258. package/lib/core/transform/envelope/selectHostInputs.mjs +4 -1
  259. package/lib/core/transform/envelope/selectHostInputs.mjs.map +1 -1
  260. package/lib/core/transform/envelope/selectNotifiableAbsentInputs.d.cts +8 -7
  261. package/lib/core/transform/envelope/selectNotifiableAbsentInputs.d.mts +8 -7
  262. package/lib/core/transform/envelope/selectNotifiableAbsentInputs.d.ts +8 -7
  263. package/lib/core/transform/envelope/selectNotifiableAbsentInputs.js +11 -8
  264. package/lib/core/transform/envelope/selectNotifiableAbsentInputs.js.map +1 -1
  265. package/lib/core/transform/envelope/selectNotifiableAbsentInputs.mjs +11 -8
  266. package/lib/core/transform/envelope/selectNotifiableAbsentInputs.mjs.map +1 -1
  267. package/lib/core/transform/envelope/selectReachableEdges.d.cts +1 -1
  268. package/lib/core/transform/envelope/selectReachableEdges.d.mts +1 -1
  269. package/lib/core/transform/envelope/selectReachableEdges.d.ts +1 -1
  270. package/lib/core/transform/envelope/selectReachableEdges.js.map +1 -1
  271. package/lib/core/transform/envelope/selectReachableEdges.mjs.map +1 -1
  272. package/lib/core/transform/envelope/selectReachableSources.d.cts +1 -1
  273. package/lib/core/transform/envelope/selectReachableSources.d.mts +1 -1
  274. package/lib/core/transform/envelope/selectReachableSources.d.ts +1 -1
  275. package/lib/core/transform/envelope/selectReachableSources.js.map +1 -1
  276. package/lib/core/transform/envelope/selectReachableSources.mjs.map +1 -1
  277. package/lib/core/transform/envelope/selectResolutionCandidateInputs.d.cts +1 -6
  278. package/lib/core/transform/envelope/selectResolutionCandidateInputs.d.mts +1 -6
  279. package/lib/core/transform/envelope/selectResolutionCandidateInputs.d.ts +1 -6
  280. package/lib/core/transform/envelope/selectResolutionCandidateInputs.js +3 -6
  281. package/lib/core/transform/envelope/selectResolutionCandidateInputs.js.map +1 -1
  282. package/lib/core/transform/envelope/selectResolutionCandidateInputs.mjs +3 -6
  283. package/lib/core/transform/envelope/selectResolutionCandidateInputs.mjs.map +1 -1
  284. package/lib/core/transform/filesystem/userStateDirectory.d.cts +22 -4
  285. package/lib/core/transform/filesystem/userStateDirectory.d.mts +22 -4
  286. package/lib/core/transform/filesystem/userStateDirectory.d.ts +22 -4
  287. package/lib/core/transform/filesystem/userStateDirectory.js +37 -12
  288. package/lib/core/transform/filesystem/userStateDirectory.js.map +1 -1
  289. package/lib/core/transform/filesystem/userStateDirectory.mjs +37 -12
  290. package/lib/core/transform/filesystem/userStateDirectory.mjs.map +1 -1
  291. package/lib/core/transform/generation/TtscFailedGenerationValidation.d.cts +3 -0
  292. package/lib/core/transform/generation/TtscFailedGenerationValidation.d.mts +3 -0
  293. package/lib/core/transform/generation/TtscFailedGenerationValidation.d.ts +3 -0
  294. package/lib/core/transform/generation/captureTransformGeneration.js +51 -13
  295. package/lib/core/transform/generation/captureTransformGeneration.js.map +1 -1
  296. package/lib/core/transform/generation/captureTransformGeneration.mjs +51 -13
  297. package/lib/core/transform/generation/captureTransformGeneration.mjs.map +1 -1
  298. package/lib/core/transform/generation/createUnstableGenerationError.d.cts +5 -3
  299. package/lib/core/transform/generation/createUnstableGenerationError.d.mts +5 -3
  300. package/lib/core/transform/generation/createUnstableGenerationError.d.ts +5 -3
  301. package/lib/core/transform/generation/createUnstableGenerationError.js +21 -4
  302. package/lib/core/transform/generation/createUnstableGenerationError.js.map +1 -1
  303. package/lib/core/transform/generation/createUnstableGenerationError.mjs +21 -4
  304. package/lib/core/transform/generation/createUnstableGenerationError.mjs.map +1 -1
  305. package/lib/core/transform/generation/failedGenerationEnvironmentChanged.d.cts +5 -1
  306. package/lib/core/transform/generation/failedGenerationEnvironmentChanged.d.mts +5 -1
  307. package/lib/core/transform/generation/failedGenerationEnvironmentChanged.d.ts +5 -1
  308. package/lib/core/transform/generation/failedGenerationEnvironmentChanged.js +13 -1
  309. package/lib/core/transform/generation/failedGenerationEnvironmentChanged.js.map +1 -1
  310. package/lib/core/transform/generation/failedGenerationEnvironmentChanged.mjs +14 -2
  311. package/lib/core/transform/generation/failedGenerationEnvironmentChanged.mjs.map +1 -1
  312. package/lib/core/transform/inputs/hostInputRealpath.d.cts +9 -8
  313. package/lib/core/transform/inputs/hostInputRealpath.d.mts +9 -8
  314. package/lib/core/transform/inputs/hostInputRealpath.d.ts +9 -8
  315. package/lib/core/transform/inputs/hostInputRealpath.js +12 -8
  316. package/lib/core/transform/inputs/hostInputRealpath.js.map +1 -1
  317. package/lib/core/transform/inputs/hostInputRealpath.mjs +12 -8
  318. package/lib/core/transform/inputs/hostInputRealpath.mjs.map +1 -1
  319. package/lib/core/transform/inputs/sameHostInputRealpath.d.cts +3 -2
  320. package/lib/core/transform/inputs/sameHostInputRealpath.d.mts +3 -2
  321. package/lib/core/transform/inputs/sameHostInputRealpath.d.ts +3 -2
  322. package/lib/core/transform/inputs/sameHostInputRealpath.js +5 -2
  323. package/lib/core/transform/inputs/sameHostInputRealpath.js.map +1 -1
  324. package/lib/core/transform/inputs/sameHostInputRealpath.mjs +5 -2
  325. package/lib/core/transform/inputs/sameHostInputRealpath.mjs.map +1 -1
  326. package/lib/core/transform/session/claimSharedCompile.js +2 -0
  327. package/lib/core/transform/session/claimSharedCompile.js.map +1 -1
  328. package/lib/core/transform/session/claimSharedCompile.mjs +2 -0
  329. package/lib/core/transform/session/claimSharedCompile.mjs.map +1 -1
  330. package/lib/core/transform/transformTtsc.d.cts +1 -1
  331. package/lib/core/transform/transformTtsc.d.mts +1 -1
  332. package/lib/core/transform/transformTtsc.d.ts +1 -1
  333. package/lib/core/transform/transformTtsc.js +26 -8
  334. package/lib/core/transform/transformTtsc.js.map +1 -1
  335. package/lib/core/transform/transformTtsc.mjs +26 -8
  336. package/lib/core/transform/transformTtsc.mjs.map +1 -1
  337. package/lib/core/transform/tsconfig/createTransformScratchDirectory.d.cts +11 -9
  338. package/lib/core/transform/tsconfig/createTransformScratchDirectory.d.mts +11 -9
  339. package/lib/core/transform/tsconfig/createTransformScratchDirectory.d.ts +11 -9
  340. package/lib/core/transform/tsconfig/createTransformScratchDirectory.js +31 -32
  341. package/lib/core/transform/tsconfig/createTransformScratchDirectory.js.map +1 -1
  342. package/lib/core/transform/tsconfig/createTransformScratchDirectory.mjs +31 -32
  343. package/lib/core/transform/tsconfig/createTransformScratchDirectory.mjs.map +1 -1
  344. package/lib/core/transform/validation/TtscGenerationProof.d.cts +19 -2
  345. package/lib/core/transform/validation/TtscGenerationProof.d.mts +19 -2
  346. package/lib/core/transform/validation/TtscGenerationProof.d.ts +19 -2
  347. package/lib/core/transform/validation/TtscGenerationProof.js +41 -2
  348. package/lib/core/transform/validation/TtscGenerationProof.js.map +1 -1
  349. package/lib/core/transform/validation/TtscGenerationProof.mjs +42 -3
  350. package/lib/core/transform/validation/TtscGenerationProof.mjs.map +1 -1
  351. package/lib/core/transform/validation/captureUniversalHostInputValidation.js +9 -0
  352. package/lib/core/transform/validation/captureUniversalHostInputValidation.js.map +1 -1
  353. package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs +10 -1
  354. package/lib/core/transform/validation/captureUniversalHostInputValidation.mjs.map +1 -1
  355. package/lib/core/transform/validation/matchesCachedExternalInputs.d.cts +6 -2
  356. package/lib/core/transform/validation/matchesCachedExternalInputs.d.mts +6 -2
  357. package/lib/core/transform/validation/matchesCachedExternalInputs.d.ts +6 -2
  358. package/lib/core/transform/validation/matchesCachedExternalInputs.js +8 -2
  359. package/lib/core/transform/validation/matchesCachedExternalInputs.js.map +1 -1
  360. package/lib/core/transform/validation/matchesCachedExternalInputs.mjs +8 -2
  361. package/lib/core/transform/validation/matchesCachedExternalInputs.mjs.map +1 -1
  362. package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.cts +8 -7
  363. package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.mts +8 -7
  364. package/lib/core/transform/validation/matchesCompleteInputSnapshot.d.ts +8 -7
  365. package/lib/core/transform/validation/matchesCompleteInputSnapshot.js +19 -9
  366. package/lib/core/transform/validation/matchesCompleteInputSnapshot.js.map +1 -1
  367. package/lib/core/transform/validation/matchesCompleteInputSnapshot.mjs +19 -9
  368. package/lib/core/transform/validation/matchesCompleteInputSnapshot.mjs.map +1 -1
  369. package/lib/core/transform/validation/matchesExternalInputRealpaths.d.cts +7 -4
  370. package/lib/core/transform/validation/matchesExternalInputRealpaths.d.mts +7 -4
  371. package/lib/core/transform/validation/matchesExternalInputRealpaths.d.ts +7 -4
  372. package/lib/core/transform/validation/matchesExternalInputRealpaths.js +9 -4
  373. package/lib/core/transform/validation/matchesExternalInputRealpaths.js.map +1 -1
  374. package/lib/core/transform/validation/matchesExternalInputRealpaths.mjs +9 -4
  375. package/lib/core/transform/validation/matchesExternalInputRealpaths.mjs.map +1 -1
  376. package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.cts +5 -2
  377. package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.mts +5 -2
  378. package/lib/core/transform/validation/matchesNarrowPersistentInputs.d.ts +5 -2
  379. package/lib/core/transform/validation/matchesNarrowPersistentInputs.js +62 -2
  380. package/lib/core/transform/validation/matchesNarrowPersistentInputs.js.map +1 -1
  381. package/lib/core/transform/validation/matchesNarrowPersistentInputs.mjs +62 -2
  382. package/lib/core/transform/validation/matchesNarrowPersistentInputs.mjs.map +1 -1
  383. package/lib/core/transform/validation/nativeInputPredicatesHold.d.cts +7 -6
  384. package/lib/core/transform/validation/nativeInputPredicatesHold.d.mts +7 -6
  385. package/lib/core/transform/validation/nativeInputPredicatesHold.d.ts +7 -6
  386. package/lib/core/transform/validation/nativeInputPredicatesHold.js +16 -6
  387. package/lib/core/transform/validation/nativeInputPredicatesHold.js.map +1 -1
  388. package/lib/core/transform/validation/nativeInputPredicatesHold.mjs +16 -6
  389. package/lib/core/transform/validation/nativeInputPredicatesHold.mjs.map +1 -1
  390. package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.d.cts +8 -0
  391. package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.d.mts +8 -0
  392. package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.d.ts +8 -0
  393. package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.js +12 -0
  394. package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.js.map +1 -0
  395. package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.mjs +10 -0
  396. package/lib/core/transform/watch/RECOVERY_TREE_DIGEST.mjs.map +1 -0
  397. package/lib/core/transform/watch/TtscProjectRegistration.d.cts +3 -0
  398. package/lib/core/transform/watch/TtscProjectRegistration.d.mts +3 -0
  399. package/lib/core/transform/watch/TtscProjectRegistration.d.ts +3 -0
  400. package/lib/core/transform/watch/TtscProjectRegistration.js +3 -0
  401. package/lib/core/transform/watch/TtscProjectRegistration.js.map +1 -0
  402. package/lib/core/transform/watch/TtscProjectRegistration.mjs +2 -0
  403. package/lib/core/transform/watch/TtscProjectRegistration.mjs.map +1 -0
  404. package/lib/core/transform/watch/TtscTransformHooks.d.cts +33 -12
  405. package/lib/core/transform/watch/TtscTransformHooks.d.mts +33 -12
  406. package/lib/core/transform/watch/TtscTransformHooks.d.ts +33 -12
  407. package/lib/core/transform/watch/TtscTransformHooks.js +3 -0
  408. package/lib/core/transform/watch/TtscTransformHooks.js.map +1 -0
  409. package/lib/core/transform/watch/TtscTransformHooks.mjs +2 -0
  410. package/lib/core/transform/watch/TtscTransformHooks.mjs.map +1 -0
  411. package/lib/core/transform/watch/TtscWatchInputEvidence.d.cts +3 -0
  412. package/lib/core/transform/watch/TtscWatchInputEvidence.d.mts +3 -0
  413. package/lib/core/transform/watch/TtscWatchInputEvidence.d.ts +3 -0
  414. package/lib/core/transform/watch/TtscWorkspaceWatchEvidence.d.cts +14 -0
  415. package/lib/core/transform/watch/TtscWorkspaceWatchEvidence.d.mts +14 -0
  416. package/lib/core/transform/watch/TtscWorkspaceWatchEvidence.d.ts +14 -0
  417. package/lib/core/transform/watch/captureRecoveryTreeDigest.d.cts +26 -0
  418. package/lib/core/transform/watch/captureRecoveryTreeDigest.d.mts +26 -0
  419. package/lib/core/transform/watch/captureRecoveryTreeDigest.d.ts +26 -0
  420. package/lib/core/transform/watch/captureRecoveryTreeDigest.js +54 -0
  421. package/lib/core/transform/watch/captureRecoveryTreeDigest.js.map +1 -0
  422. package/lib/core/transform/watch/captureRecoveryTreeDigest.mjs +52 -0
  423. package/lib/core/transform/watch/captureRecoveryTreeDigest.mjs.map +1 -0
  424. package/lib/core/transform/watch/evidencedWatchInput.js +6 -0
  425. package/lib/core/transform/watch/evidencedWatchInput.js.map +1 -1
  426. package/lib/core/transform/watch/evidencedWatchInput.mjs +6 -0
  427. package/lib/core/transform/watch/evidencedWatchInput.mjs.map +1 -1
  428. package/lib/core/transform/watch/handWatchInputs.d.cts +4 -4
  429. package/lib/core/transform/watch/handWatchInputs.d.mts +4 -4
  430. package/lib/core/transform/watch/handWatchInputs.d.ts +4 -4
  431. package/lib/core/transform/watch/handWatchInputs.js +21 -5
  432. package/lib/core/transform/watch/handWatchInputs.js.map +1 -1
  433. package/lib/core/transform/watch/handWatchInputs.mjs +21 -5
  434. package/lib/core/transform/watch/handWatchInputs.mjs.map +1 -1
  435. package/lib/core/transform/watch/notifyFailedGenerationInputs.d.cts +8 -1
  436. package/lib/core/transform/watch/notifyFailedGenerationInputs.d.mts +8 -1
  437. package/lib/core/transform/watch/notifyFailedGenerationInputs.d.ts +8 -1
  438. package/lib/core/transform/watch/notifyFailedGenerationInputs.js +51 -9
  439. package/lib/core/transform/watch/notifyFailedGenerationInputs.js.map +1 -1
  440. package/lib/core/transform/watch/notifyFailedGenerationInputs.mjs +51 -9
  441. package/lib/core/transform/watch/notifyFailedGenerationInputs.mjs.map +1 -1
  442. package/lib/core/transform/watch/notifyProjectRecord.js +55 -20
  443. package/lib/core/transform/watch/notifyProjectRecord.js.map +1 -1
  444. package/lib/core/transform/watch/notifyProjectRecord.mjs +55 -20
  445. package/lib/core/transform/watch/notifyProjectRecord.mjs.map +1 -1
  446. package/lib/core/transform/watch/notifyRejectedGenerationInputs.js +20 -10
  447. package/lib/core/transform/watch/notifyRejectedGenerationInputs.js.map +1 -1
  448. package/lib/core/transform/watch/notifyRejectedGenerationInputs.mjs +20 -10
  449. package/lib/core/transform/watch/notifyRejectedGenerationInputs.mjs.map +1 -1
  450. package/lib/core/transform/watch/notifyVolatileDelivery.d.cts +4 -6
  451. package/lib/core/transform/watch/notifyVolatileDelivery.d.mts +4 -6
  452. package/lib/core/transform/watch/notifyVolatileDelivery.d.ts +4 -6
  453. package/lib/core/transform/watch/notifyVolatileDelivery.js +12 -11
  454. package/lib/core/transform/watch/notifyVolatileDelivery.js.map +1 -1
  455. package/lib/core/transform/watch/notifyVolatileDelivery.mjs +12 -11
  456. package/lib/core/transform/watch/notifyVolatileDelivery.mjs.map +1 -1
  457. package/lib/core/transform/watch/notifyWatchInputs.d.cts +6 -3
  458. package/lib/core/transform/watch/notifyWatchInputs.d.mts +6 -3
  459. package/lib/core/transform/watch/notifyWatchInputs.d.ts +6 -3
  460. package/lib/core/transform/watch/notifyWatchInputs.js +66 -14
  461. package/lib/core/transform/watch/notifyWatchInputs.js.map +1 -1
  462. package/lib/core/transform/watch/notifyWatchInputs.mjs +66 -14
  463. package/lib/core/transform/watch/notifyWatchInputs.mjs.map +1 -1
  464. package/lib/core/transform/watch/prepareProjectRecordDirectories.d.cts +4 -5
  465. package/lib/core/transform/watch/prepareProjectRecordDirectories.d.mts +4 -5
  466. package/lib/core/transform/watch/prepareProjectRecordDirectories.d.ts +4 -5
  467. package/lib/core/transform/watch/prepareProjectRecordDirectories.js +9 -16
  468. package/lib/core/transform/watch/prepareProjectRecordDirectories.js.map +1 -1
  469. package/lib/core/transform/watch/prepareProjectRecordDirectories.mjs +9 -16
  470. package/lib/core/transform/watch/prepareProjectRecordDirectories.mjs.map +1 -1
  471. package/lib/core/transform/watch/projectRecordDirectories.d.cts +18 -0
  472. package/lib/core/transform/watch/projectRecordDirectories.d.mts +18 -0
  473. package/lib/core/transform/watch/projectRecordDirectories.d.ts +18 -0
  474. package/lib/core/transform/watch/projectRecordDirectories.js +34 -0
  475. package/lib/core/transform/watch/projectRecordDirectories.js.map +1 -0
  476. package/lib/core/transform/watch/projectRecordDirectories.mjs +32 -0
  477. package/lib/core/transform/watch/projectRecordDirectories.mjs.map +1 -0
  478. package/lib/core/transform/watch/recordedDependencyWitnesses.js +7 -7
  479. package/lib/core/transform/watch/recordedDependencyWitnesses.js.map +1 -1
  480. package/lib/core/transform/watch/recordedDependencyWitnesses.mjs +7 -7
  481. package/lib/core/transform/watch/recordedDependencyWitnesses.mjs.map +1 -1
  482. package/lib/core/transform/watch/watchInputEvidenceMatchesBaseline.js +2 -1
  483. package/lib/core/transform/watch/watchInputEvidenceMatchesBaseline.js.map +1 -1
  484. package/lib/core/transform/watch/watchInputEvidenceMatchesBaseline.mjs +2 -1
  485. package/lib/core/transform/watch/watchInputEvidenceMatchesBaseline.mjs.map +1 -1
  486. package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.js +7 -0
  487. package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.js.map +1 -1
  488. package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.mjs +7 -0
  489. package/lib/core/transform/watch/watchInputEvidenceMatchesDisk.mjs.map +1 -1
  490. package/lib/core/unplugin.js +43 -27
  491. package/lib/core/unplugin.js.map +1 -1
  492. package/lib/core/unplugin.mjs +43 -27
  493. package/lib/core/unplugin.mjs.map +1 -1
  494. package/lib/core/vite/ViteServeInputWatch.d.cts +17 -0
  495. package/lib/core/vite/ViteServeInputWatch.d.mts +17 -0
  496. package/lib/core/vite/ViteServeInputWatch.d.ts +17 -0
  497. package/lib/core/vite/createViteServeInputWatch.d.cts +5 -0
  498. package/lib/core/vite/createViteServeInputWatch.d.mts +5 -0
  499. package/lib/core/vite/createViteServeInputWatch.d.ts +5 -0
  500. package/lib/core/vite/createViteServeInputWatch.js +86 -10
  501. package/lib/core/vite/createViteServeInputWatch.js.map +1 -1
  502. package/lib/core/vite/createViteServeInputWatch.mjs +86 -10
  503. package/lib/core/vite/createViteServeInputWatch.mjs.map +1 -1
  504. package/lib/core/vite/createViteServeWatchHooks.d.cts +6 -5
  505. package/lib/core/vite/createViteServeWatchHooks.d.mts +6 -5
  506. package/lib/core/vite/createViteServeWatchHooks.d.ts +6 -5
  507. package/lib/core/vite/createViteServeWatchHooks.js +10 -4
  508. package/lib/core/vite/createViteServeWatchHooks.js.map +1 -1
  509. package/lib/core/vite/createViteServeWatchHooks.mjs +10 -4
  510. package/lib/core/vite/createViteServeWatchHooks.mjs.map +1 -1
  511. package/package.json +3 -3
  512. package/src/core/bridge/HostWatchBridge.ts +2 -0
  513. package/src/core/bridge/MANAGED_PROJECT_RECORDS.ts +2 -0
  514. package/src/core/bridge/TtscProjectRecord.ts +9 -0
  515. package/src/core/bridge/fallbackRecordStorage.ts +104 -0
  516. package/src/core/bridge/fallbackToolDirectory.ts +22 -38
  517. package/src/core/bridge/fallbackToolDirectoryLocation.ts +40 -0
  518. package/src/core/bridge/hostToolDirectory.ts +14 -47
  519. package/src/core/bridge/openHostWatchBridge.ts +48 -6
  520. package/src/core/bridge/prepareProjectRecordDirectory.ts +134 -0
  521. package/src/core/bridge/privateProjectRecordAvailable.ts +25 -0
  522. package/src/core/bridge/projectRecordMoved.ts +7 -0
  523. package/src/core/bridge/projectRecordWatchInputs.ts +6 -0
  524. package/src/core/bridge/readProjectRecordFile.ts +28 -1
  525. package/src/core/bridge/refreshProjectRecordFile.ts +40 -7
  526. package/src/core/bridge/refreshProjectRecordFiles.ts +44 -12
  527. package/src/core/bridge/registerProjectRecord.ts +2 -0
  528. package/src/core/bridge/signalProjectRecordFile.ts +25 -5
  529. package/src/core/bridge/writeProjectRecordFile.ts +10 -3
  530. package/src/core/esbuild/createEsbuildOptions.ts +9 -10
  531. package/src/core/farm/createFarmRecordUpdates.ts +167 -0
  532. package/src/core/farm/farmPersistentCacheWithoutRecords.ts +25 -55
  533. package/src/core/farm/farmRecordFallback.ts +25 -20
  534. package/src/core/next/next.ts +5 -3
  535. package/src/core/observer/InputCondition.ts +7 -0
  536. package/src/core/observer/InputObserverChange.ts +3 -0
  537. package/src/core/observer/createInputObserver.ts +186 -25
  538. package/src/core/observer/ttscWriteDirectories.ts +56 -0
  539. package/src/core/rollup/TtscRollupDelivery.ts +2 -0
  540. package/src/core/rollup/createRollupCachedModuleProof.ts +65 -33
  541. package/src/core/rollup/rollupDeliveryOptions.ts +7 -4
  542. package/src/core/transform/cache/TtscCachedProjectTransform.ts +6 -0
  543. package/src/core/transform/cache/selectCachedGenerationAction.ts +9 -4
  544. package/src/core/transform/deliverCachedTransform.ts +1 -0
  545. package/src/core/transform/envelope/TtscEnvelopeDerivation.ts +6 -17
  546. package/src/core/transform/envelope/collectDeclaredIdentities.ts +1 -1
  547. package/src/core/transform/envelope/createEnvelopeKeyIndex.ts +1 -1
  548. package/src/core/transform/envelope/declaresCompleteDependencies.ts +17 -7
  549. package/src/core/transform/envelope/derivationIdentity.ts +1 -1
  550. package/src/core/transform/envelope/deriveWatchInputs.ts +10 -64
  551. package/src/core/transform/envelope/deriveWatchInputsFromIndexes.ts +117 -0
  552. package/src/core/transform/envelope/envelopeDerivation.ts +1 -0
  553. package/src/core/transform/envelope/envelopeGraphIndexes.ts +2 -1
  554. package/src/core/transform/envelope/isVolatileFile.ts +12 -3
  555. package/src/core/transform/envelope/selectFileDependencies.ts +11 -14
  556. package/src/core/transform/envelope/selectGraphInputs.ts +13 -10
  557. package/src/core/transform/envelope/selectHostInputs.ts +11 -2
  558. package/src/core/transform/envelope/selectNotifiableAbsentInputs.ts +13 -8
  559. package/src/core/transform/envelope/selectReachableEdges.ts +2 -2
  560. package/src/core/transform/envelope/selectReachableSources.ts +2 -2
  561. package/src/core/transform/envelope/selectResolutionCandidateInputs.ts +9 -15
  562. package/src/core/transform/filesystem/userStateDirectory.ts +46 -15
  563. package/src/core/transform/generation/TtscFailedGenerationValidation.ts +5 -0
  564. package/src/core/transform/generation/captureTransformGeneration.ts +64 -22
  565. package/src/core/transform/generation/createUnstableGenerationError.ts +24 -4
  566. package/src/core/transform/generation/failedGenerationEnvironmentChanged.ts +18 -2
  567. package/src/core/transform/inputs/hostInputRealpath.ts +13 -8
  568. package/src/core/transform/inputs/sameHostInputRealpath.ts +4 -2
  569. package/src/core/transform/session/claimSharedCompile.ts +2 -0
  570. package/src/core/transform/transformTtsc.ts +28 -7
  571. package/src/core/transform/tsconfig/createTransformScratchDirectory.ts +36 -31
  572. package/src/core/transform/validation/TtscGenerationProof.ts +57 -2
  573. package/src/core/transform/validation/captureUniversalHostInputValidation.ts +12 -0
  574. package/src/core/transform/validation/matchesCachedExternalInputs.ts +6 -1
  575. package/src/core/transform/validation/matchesCompleteInputSnapshot.ts +23 -9
  576. package/src/core/transform/validation/matchesExternalInputRealpaths.ts +7 -3
  577. package/src/core/transform/validation/matchesNarrowPersistentInputs.ts +81 -2
  578. package/src/core/transform/validation/nativeInputPredicatesHold.ts +15 -6
  579. package/src/core/transform/watch/RECOVERY_TREE_DIGEST.ts +12 -0
  580. package/src/core/transform/watch/TtscProjectRegistration.ts +4 -0
  581. package/src/core/transform/watch/TtscTransformHooks.ts +40 -12
  582. package/src/core/transform/watch/TtscWatchInputEvidence.ts +3 -0
  583. package/src/core/transform/watch/TtscWorkspaceWatchEvidence.ts +17 -0
  584. package/src/core/transform/watch/captureRecoveryTreeDigest.ts +58 -0
  585. package/src/core/transform/watch/evidencedWatchInput.ts +7 -0
  586. package/src/core/transform/watch/handWatchInputs.ts +21 -5
  587. package/src/core/transform/watch/notifyFailedGenerationInputs.ts +66 -10
  588. package/src/core/transform/watch/notifyProjectRecord.ts +68 -25
  589. package/src/core/transform/watch/notifyRejectedGenerationInputs.ts +22 -9
  590. package/src/core/transform/watch/notifyVolatileDelivery.ts +7 -6
  591. package/src/core/transform/watch/notifyWatchInputs.ts +112 -14
  592. package/src/core/transform/watch/prepareProjectRecordDirectories.ts +14 -16
  593. package/src/core/transform/watch/projectRecordDirectories.ts +33 -0
  594. package/src/core/transform/watch/recordedDependencyWitnesses.ts +8 -9
  595. package/src/core/transform/watch/watchInputEvidenceMatchesBaseline.ts +2 -1
  596. package/src/core/transform/watch/watchInputEvidenceMatchesDisk.ts +7 -0
  597. package/src/core/unplugin.ts +72 -42
  598. package/src/core/vite/ViteServeInputWatch.ts +24 -0
  599. package/src/core/vite/createViteServeInputWatch.ts +98 -9
  600. package/src/core/vite/createViteServeWatchHooks.ts +15 -6
  601. package/lib/core/bridge/projectRecordDirectoryWritable.d.cts +0 -36
  602. package/lib/core/bridge/projectRecordDirectoryWritable.d.mts +0 -36
  603. package/lib/core/bridge/projectRecordDirectoryWritable.d.ts +0 -36
  604. package/lib/core/bridge/projectRecordDirectoryWritable.js +0 -65
  605. package/lib/core/bridge/projectRecordDirectoryWritable.js.map +0 -1
  606. package/lib/core/bridge/projectRecordDirectoryWritable.mjs +0 -63
  607. package/lib/core/bridge/projectRecordDirectoryWritable.mjs.map +0 -1
  608. package/src/core/bridge/projectRecordDirectoryWritable.ts +0 -61
@@ -1,18 +1,19 @@
1
- import crypto from "node:crypto";
2
1
  import path from "node:path";
3
2
 
4
- import { userStateDirectory } from "../transform/filesystem/userStateDirectory";
3
+ import { PROJECT_RECORD_DIRECTORY } from "./PROJECT_RECORD_DIRECTORY";
4
+ import { fallbackRecordStorage } from "./fallbackRecordStorage";
5
+ import { fallbackToolDirectoryLocation } from "./fallbackToolDirectoryLocation";
5
6
 
6
7
  /**
7
8
  * Where a host's project records live when its own tool directory
8
- * (`hostToolDirectory`) cannot be written, or `undefined` when this user has no
9
- * such place either (samchon/ttsc#1480).
9
+ * (`hostToolDirectory`) cannot be written, or `undefined` when private native
10
+ * storage is unavailable (samchon/ttsc#1480).
10
11
  *
11
12
  * A module handed to a build host without its project's record depends on its
12
13
  * own bytes alone: a watching session cannot tell the host that a type the
13
14
  * module's output consulted changed, and a persistent cache restores it
14
15
  * whatever its types did. A read-only checkout, a restricted sandbox, or a file
15
- * standing where `.ttsc` would be leaves the root unwritable, so the record
16
+ * occupying an ignored cache path can leave the root unwritable, so the record
16
17
  * then lives below this user's own directory under the system temporary
17
18
  * directory (`userStateDirectory`), one directory per host root.
18
19
  *
@@ -22,15 +23,15 @@ import { userStateDirectory } from "../transform/filesystem/userStateDirectory";
22
23
  * below the root. It is spelled in its long form, which webpack and Rspack
23
24
  * require of a watched directory on Windows. A host that accepts no record
24
25
  * outside its root, Turbopack, or none it cannot relate to its root, Farm on
25
- * another drive, does not take it (`hostToolDirectory`).
26
+ * another drive, does not take it (`hostToolDirectory`). The returned spelling
27
+ * has passed the private storage probe.
26
28
  *
27
29
  * @param root The host's root, as `hostToolDirectory` names it.
28
30
  * @evidence contracts/common.md#principled-implementation
29
- * A resolved-root digest gives each host a stable directory beneath the
30
- * validated user state root; absence remains explicit when no safe root exists.
31
+ * A stable directory under private native state is returned only after probing
32
+ * its managed ancestry and available access.
31
33
  * @evidence contracts/common.md#clear-and-simple-design
32
- * This helper owns root-to-fallback naming while userStateDirectory owns
33
- * directory trust and hosts decide whether outside-root dependencies are allowed.
34
+ * The location helper owns naming and the shared storage probe owns qualification.
34
35
  * @evidence contracts/common.md#prohibited-implementation-shortcuts
35
36
  * The fallback handles actual unwritable roots using a product-owned user
36
37
  * directory, not an arbitrary globally writable or fixture-specific location.
@@ -39,34 +40,17 @@ import { userStateDirectory } from "../transform/filesystem/userStateDirectory";
39
40
  * that cannot accept the fallback, following documentation guidance.
40
41
  * @evidence contracts/portability.md#os-neutral-implementation The validated user state boundary obtains a private native directory and long Windows spelling; native root resolution determines naming, while adapters separately reject fallback locations their host cannot watch.
41
42
  * @evidence contracts/performance.md#efficient-algorithms
42
- * Every call resolves and hashes the root's map key text. A cold name also
43
- * obtains the native temporary-root realpath, recursive state-directory
44
- * creation and directory-kind/available-uid checks, then hashes and joins
45
- * the fallback spelling. A warm name avoids those delegated checks and the
46
- * naming digest, not root resolution or map-key work.
47
- * @evidence contracts/performance.md#reuse-equivalent-work A resolved host root shares its stable fallback naming within the process; actual write capability is checked by writers rather than certified by the cached name, and an unavailable initial user root remains unavailable here.
48
- * @evidence contracts/performance.md#bound-retention-and-release-resources The module map retains one optional naming result per distinct resolved root for the process lifetime, without an eviction bound; no native handle is retained, and record-directory persistence belongs to the host cache protocol.
43
+ * A stable name lookup precedes a bounded native path and permission walk.
44
+ * @evidence contracts/performance.md#reuse-equivalent-work The naming helper reuses a cached address while the qualification observes current storage on every call.
45
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The probe retains no observation or native handle; the naming helper owns its address memo.
49
46
  */
50
47
  export function fallbackToolDirectory(root: string): string | undefined {
51
- const key = path.resolve(root);
52
- if (!FALLBACKS.has(key)) {
53
- // The provider checks directory kind and available uid/mode authority;
54
- // other platforms rely on native temporary-directory access policy.
55
- // The directories below are created by the first write.
56
- const state = userStateDirectory();
57
- FALLBACKS.set(
58
- key,
59
- state === undefined
60
- ? undefined
61
- : path.join(
62
- state,
63
- "hosts",
64
- crypto.createHash("sha256").update(key).digest("hex").slice(0, 32),
65
- ),
66
- );
67
- }
68
- return FALLBACKS.get(key);
48
+ const directory = fallbackToolDirectoryLocation(root);
49
+ return directory !== undefined &&
50
+ fallbackRecordStorage(
51
+ path.join(directory, PROJECT_RECORD_DIRECTORY),
52
+ false,
53
+ ) === true
54
+ ? directory
55
+ : undefined;
69
56
  }
70
-
71
- /** Each host root's fallback, established once per process. */
72
- const FALLBACKS = new Map<string, string | undefined>();
@@ -0,0 +1,40 @@
1
+ import crypto from "node:crypto";
2
+ import path from "node:path";
3
+
4
+ import { userStateDirectory } from "../transform/filesystem/userStateDirectory";
5
+
6
+ /**
7
+ * Name a host's private record directory so startup can identify its inventory
8
+ * even when the storage lost qualification after a previous delivery.
9
+ *
10
+ * @evidence contracts/common.md#principled-implementation The native temporary selector, current uid and resolved host root determine the same spelling used by fallbackToolDirectory.
11
+ * @evidence contracts/common.md#clear-and-simple-design The startup address is obtained separately from qualification for writing or replay.
12
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts A name neither creates the directory nor certifies that its contents may be accessed.
13
+ * @evidence contracts/common.md#meaningful-documentation The comment explains why cache inventory needs the address independent of access.
14
+ * @evidence contracts/portability.md#os-neutral-implementation The temporary selector supplies long physical spelling and native joins preserve the host volume.
15
+ * @evidence contracts/performance.md#efficient-algorithms Resolving the host root precedes a memo lookup. A miss selects the native temporary parent, hashes the resolved root text and joins the managed path.
16
+ * @evidence contracts/performance.md#reuse-equivalent-work Names are shared for the same resolved root within a process. Consumers separately recheck native storage qualification.
17
+ * @evidence contracts/performance.md#bound-retention-and-release-resources One optional name per distinct resolved root is retained for the process lifetime. No handles are acquired.
18
+ */
19
+ export function fallbackToolDirectoryLocation(
20
+ root: string,
21
+ ): string | undefined {
22
+ const key = path.resolve(root);
23
+ if (!FALLBACKS.has(key)) {
24
+ let directory: string | undefined;
25
+ try {
26
+ directory = path.join(
27
+ userStateDirectory.location(key),
28
+ "hosts",
29
+ crypto.createHash("sha256").update(key).digest("hex").slice(0, 32),
30
+ );
31
+ } catch {
32
+ // No system temporary directory outside this host's project.
33
+ }
34
+ FALLBACKS.set(key, directory);
35
+ }
36
+ return FALLBACKS.get(key);
37
+ }
38
+
39
+ /** Each host root's fallback name, established once per process. */
40
+ const FALLBACKS = new Map<string, string | undefined>();
@@ -1,54 +1,21 @@
1
1
  import path from "node:path";
2
2
 
3
3
  /**
4
- * The directory below a host's root where the adapter keeps the files it asks
5
- * the host to watch: the project records (samchon/ttsc#1457).
4
+ * Name the ignored cache that owns a build host's persistent project records.
5
+ * The path remains below the selected host root for hosts that constrain file
6
+ * dependencies to it. Farm keeps its records here too, and is told of each move
7
+ * its watcher cannot observe below `node_modules` (`createFarmRecordUpdates`).
6
8
  *
7
- * Every host constrains where such a file may live, and `<root>/.ttsc` is the
8
- * one place that satisfies all of them, measured on each:
9
- *
10
- * - Turbopack fails a module whose dependency leaves its project filesystem root,
11
- * so the file must be inside the root Turbopack resolved.
12
- * - Farm computes every watch file's path relative to its root and fails on one
13
- * it cannot relate, such as a file on another Windows drive; its watcher
14
- * ignores `node_modules` inside the root and refuses an extra file below any
15
- * `node_modules`, so the file must be on the root's drive and outside them,
16
- * and it lives below Farm's configured root rather than the directory Farm
17
- * runs in, which a configuration can place on another drive.
18
- * - Webpack and Rspack watch a dependency's directory through `fs.watch`, and
19
- * libuv's Windows backend aborts the host on a directory spelled with a short
20
- * name, which the system temporary directory routinely is
21
- * (`C:\Users\RUNNER~1\...`), so the file must be spelled as the host's root
22
- * is.
23
- *
24
- * The system temporary directory, the previous default, met none of the three
25
- * on Windows. `.ttsc` is ttsc's own project-local directory, already excluded
26
- * from project discovery. The adapter keeps the project records there alone
27
- * (`PROJECT_RECORD_DIRECTORY`), under a stable name, since a host's persistent
28
- * cache records them as dependencies and they outlive every process.
29
- *
30
- * @param root The host's root: the directory the host runs in for the unplugin
31
- * adapters and the Next wrapper, Farm's configured root for Farm,
32
- * `absWorkingDir` for esbuild, and the root Turbopack resolved
33
- * (`rootContext`) for its loader.
34
- * @evidence contracts/common.md#principled-implementation
35
- * Native join locates the package-owned .ttsc directory under the actual host
36
- * root, satisfying dependency-root restrictions without relocating watched paths.
37
- * @evidence contracts/common.md#clear-and-simple-design
38
- * One helper owns the project-local directory convention shared by host adapters.
39
- * @evidence contracts/common.md#prohibited-implementation-shortcuts
40
- * .ttsc is the product's directory convention; host-specific roots implement
41
- * actual dependency acceptance rules rather than consumer path exceptions.
42
- * @evidence contracts/common.md#meaningful-documentation
43
- * Native paragraphs explain native watched-directory constraints and root
44
- * meaning for each adapter, with tag separation per documentation guidance.
45
- * @evidence contracts/portability.md#os-neutral-implementation Node's native join preserves the actual host root's volume and spelling; records stay under that root to satisfy filesystem-root, same-drive and Windows watched-directory constraints.
46
- * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Naming the directory acquires and retains no handle, task or state.
47
- * @evidence contracts/performance.md#efficient-algorithms
48
- * Native join scans and normalizes the supplied root's text and creates the
49
- * returned spelling. It performs no filesystem access or directory walk.
50
- * @evidenceExclude contracts/performance.md#reuse-equivalent-work The directory is joined from its argument on every call; no computation is shared.
9
+ * @param root The build host's effective filesystem root.
10
+ * @evidence contracts/common.md#principled-implementation The path remains below the supplied host root and places the record protocol under its node_modules cache.
11
+ * @evidence contracts/common.md#clear-and-simple-design One naming function serves every host that accepts the default record path; filesystem admission belongs to the record writer.
12
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts The automatic record path cannot target a regular project directory.
13
+ * @evidence contracts/common.md#meaningful-documentation The native comment states the placement rule and how Farm learns of moves its watcher ignores.
14
+ * @evidence contracts/portability.md#os-neutral-implementation Native join preserves root spelling and volume before host dependency registration.
15
+ * @evidence contracts/performance.md#efficient-algorithms One native join processes the supplied path text without touching the filesystem.
16
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work Naming a path coordinates no completed work.
17
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The selector creates no directory or retained state.
51
18
  */
52
19
  export function hostToolDirectory(root: string): string {
53
- return path.join(root, ".ttsc");
20
+ return path.join(root, "node_modules", ".cache", "ttsc", "unplugin");
54
21
  }
@@ -53,11 +53,21 @@ import { signalProjectRecordFile } from "./signalProjectRecordFile";
53
53
  * recorded it as a dependency of every module, and a build start proves it
54
54
  * against the disk (`refreshProjectRecordFiles`).
55
55
  *
56
+ * A host whose watcher cannot observe the record holds it as a dependency all
57
+ * the same, and is told of each move instead (`announce`): Farm's watcher
58
+ * ignores every path below `node_modules`, where the record lives, so the
59
+ * adapter asks Farm itself to update the record's dependents
60
+ * (`createFarmRecordUpdates`, samchon/ttsc#1942). Every move is told, the first
61
+ * and each later one, since a move a host heard while it was compiling may land
62
+ * in that compile rather than after it.
63
+ *
56
64
  * @param root The directory whose pinned scope observes the project.
57
65
  * @param operations Observer watch/poll/case capabilities, which do not replace
58
66
  * native record writes or the filesystem used to recheck input conditions.
59
67
  * @param polling The current host's polling declaration, including its active
60
68
  * watch-session option. Standalone callers retain the environment default.
69
+ * @param announce Told the absolute record path after each move that landed,
70
+ * for a host whose watcher does not observe the record.
61
71
  * @evidence contracts/common.md#principled-implementation
62
72
  * Each record owns generation input evidence. A change remains owed until a
63
73
  * registration replaces that evidence; replacement immediately signals again
@@ -122,13 +132,18 @@ export function openHostWatchBridge(
122
132
  root: string,
123
133
  operations: Partial<InputObserverOperations> = {},
124
134
  polling: boolean = hostDeclaresPolling(process.env),
135
+ announce?: (record: string) => void,
125
136
  ): HostWatchBridge {
126
137
  // Every map below is keyed by the record's absolute spelling, the one the
127
138
  // observer reports its owners under.
128
139
  // What each record was last registered with.
129
140
  const registered = new Map<
130
141
  string,
131
- { inputs: readonly TtscWatchInput[]; startedAt: number | undefined }
142
+ {
143
+ inputs: readonly TtscWatchInput[];
144
+ startedAt: number | undefined;
145
+ privateStorage: boolean;
146
+ }
132
147
  >();
133
148
  // The records signalled since they last registered.
134
149
  const owed = new Set<string>();
@@ -148,6 +163,7 @@ export function openHostWatchBridge(
148
163
  // The records the host's last compile did not depend on, which its watcher
149
164
  // does not observe, reported by a host that reports it (`compiled`).
150
165
  const unwatched = new Set<string>();
166
+ let requiredSignalRecord: string | undefined;
151
167
  const settle = (record: string): void => {
152
168
  owed.delete(record);
153
169
  clearTimeout(pending.get(record));
@@ -158,7 +174,14 @@ export function openHostWatchBridge(
158
174
  // A signal already owed keeps its schedule, which still lands a move
159
175
  // after whatever baseline the host takes next.
160
176
  if (pending.has(record)) return;
161
- signalProjectRecordFile(record);
177
+ if (
178
+ signalProjectRecordFile(
179
+ record,
180
+ registered.get(record)?.privateStorage,
181
+ requiredSignalRecord === record,
182
+ )
183
+ )
184
+ announce?.(record);
162
185
  // The later moves defend a watcher's baseline, and no watcher of this host
163
186
  // observes the record: a compile that comes to depend on it reads this
164
187
  // move through its cache's snapshot, and `compiled` resumes the schedule
@@ -167,7 +190,13 @@ export function openHostWatchBridge(
167
190
  const moveAfter = (delay: number): void => {
168
191
  const timer = setTimeout(() => {
169
192
  if (pending.get(record) !== timer) return;
170
- signalProjectRecordFile(record);
193
+ if (
194
+ signalProjectRecordFile(
195
+ record,
196
+ registered.get(record)?.privateStorage,
197
+ )
198
+ )
199
+ announce?.(record);
171
200
  moveAfter(Math.min(delay * 4, MAX_TIMER_DELAY_MS));
172
201
  }, delay).unref();
173
202
  pending.set(record, timer);
@@ -209,7 +238,14 @@ export function openHostWatchBridge(
209
238
  owes: (record) =>
210
239
  (answeredIn !== undefined && pass <= answeredIn + 1) ||
211
240
  (record === undefined ? owed.size !== 0 : owed.has(path.resolve(record))),
212
- register(file, inputs, failed, startedAt) {
241
+ register(
242
+ file,
243
+ inputs,
244
+ failed,
245
+ startedAt,
246
+ privateStorage = false,
247
+ requiredSignal = false,
248
+ ) {
213
249
  const record = path.resolve(file);
214
250
  // Deliveries with the same immutable input population and pass reuse
215
251
  // the established observation. A generation whose later module adds
@@ -220,11 +256,12 @@ export function openHostWatchBridge(
220
256
  last !== undefined &&
221
257
  last.inputs === inputs &&
222
258
  last.startedAt === startedAt &&
259
+ last.privateStorage === privateStorage &&
223
260
  failed !== true
224
261
  ) {
225
262
  return;
226
263
  }
227
- registered.set(record, { inputs, startedAt });
264
+ registered.set(record, { inputs, startedAt, privateStorage });
228
265
  if (
229
266
  owed.has(record) &&
230
267
  startedAt !== undefined &&
@@ -236,7 +273,12 @@ export function openHostWatchBridge(
236
273
  // read a state a change since `startedAt` has left, the replacement
237
274
  // finds that at once and signals again.
238
275
  settle(record);
239
- observer.replace(record, inputs, failed, startedAt);
276
+ if (requiredSignal) requiredSignalRecord = record;
277
+ try {
278
+ observer.replace(record, inputs, failed, startedAt);
279
+ } finally {
280
+ if (requiredSignal) requiredSignalRecord = undefined;
281
+ }
240
282
  },
241
283
  };
242
284
  }
@@ -0,0 +1,134 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+
4
+ import { PROJECT_RECORD_DIRECTORY } from "./PROJECT_RECORD_DIRECTORY";
5
+ import { fallbackRecordStorage } from "./fallbackRecordStorage";
6
+ import { hostToolDirectory } from "./hostToolDirectory";
7
+
8
+ /**
9
+ * Create the record directory under the current physical installation.
10
+ * Automatic cache components are checked one at a time before descending into
11
+ * them. Explicit record owners and the same-volume fallback supply an already
12
+ * selected parent. The result is the spelling the publisher writes through.
13
+ *
14
+ * @evidence contracts/common.md#principled-implementation Native realpath and lstat keep every automatic cache component under an ordinary physical node_modules installation before the record writer accesses it.
15
+ * @evidence contracts/common.md#clear-and-simple-design One owner handles the default cache policy for both directory preparation and record publication.
16
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts An alias at a default cache child refuses writes before recursion can reach its destination.
17
+ * @evidence contracts/common.md#meaningful-documentation The prose explains physical placement, explicit ownership and the returned address.
18
+ * @evidence contracts/portability.md#os-neutral-implementation Native fs and path primitives check directory kinds and preserve the root volume and native spelling.
19
+ * @evidence contracts/performance.md#efficient-algorithms The default layout performs a bounded sequence of direct child checks. Explicit paths retain their recursive parent creation cost.
20
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work Each preparation observes current filesystem topology.
21
+ * @evidence contracts/performance.md#bound-retention-and-release-resources Created directories belong to the persistent record protocol. No additional scratch or open handle survives preparation.
22
+ */
23
+ export function prepareProjectRecordDirectory(
24
+ directory: string,
25
+ privateStorage = false,
26
+ ): string {
27
+ if (privateStorage) {
28
+ if (fallbackRecordStorage(directory, true) === true) return directory;
29
+ throw new Error(
30
+ `@ttsc/unplugin: unsafe private project record directory: ${directory}`,
31
+ );
32
+ }
33
+ const tool = path.dirname(directory);
34
+ const workspace = path.resolve(tool, "../../../..");
35
+ if (
36
+ path.basename(directory) !== PROJECT_RECORD_DIRECTORY ||
37
+ path.resolve(tool) !== hostToolDirectory(workspace)
38
+ ) {
39
+ fs.mkdirSync(directory, { recursive: true, mode: 0o700 });
40
+ return directory;
41
+ }
42
+ return installationRecords(workspace, true);
43
+ }
44
+
45
+ /**
46
+ * Probe the default record layout without creating it (samchon/ttsc#1942).
47
+ *
48
+ * @evidence contracts/common.md#principled-implementation The probe walks the components creation walks, with the same physical-installation and ordinary-directory checks, and asks the OS for the access creation needs.
49
+ * @evidence contracts/common.md#clear-and-simple-design Probing and creation share one walk, so the two cannot disagree on the layout.
50
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Nothing is created, and a link or file at a component refuses the location instead of being followed.
51
+ * @evidence contracts/common.md#meaningful-documentation The member comment states what qualifies and which caller decides on it.
52
+ * @evidence contracts/portability.md#os-neutral-implementation Native realpath, lstat and access report links, kinds and permissions on every platform.
53
+ * @evidence contracts/performance.md#efficient-algorithms At most two realpath calls, five lstat calls and one access check.
54
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work The installation can change between configuration passes.
55
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources Probing creates and retains nothing.
56
+ */
57
+ export namespace prepareProjectRecordDirectory {
58
+ /**
59
+ * Whether the default record directory below a host root can hold records,
60
+ * observed without creating anything: every present component passes the
61
+ * checks creation applies, and the first missing one has a parent the current
62
+ * user can create in and traverse. A host with no per-module cache control
63
+ * decides on this before any record is written
64
+ * (`farmPersistentCacheWithoutRecords`).
65
+ *
66
+ * @param root The build host's effective filesystem root.
67
+ */
68
+ export function available(root: string): boolean {
69
+ try {
70
+ installationRecords(root, false);
71
+ return true;
72
+ } catch {
73
+ return false;
74
+ }
75
+ }
76
+ }
77
+
78
+ /**
79
+ * Walk `node_modules/.cache/ttsc/unplugin/records` below a host root's physical
80
+ * installation, creating each missing component, or, without `create`, stopping
81
+ * at the first missing one once its parent admits creation. Returns the
82
+ * physical record directory, or the directory a probe stopped at. Throws when a
83
+ * component is unsafe or inaccessible.
84
+ */
85
+ function installationRecords(workspace: string, create: boolean): string {
86
+ const root = fs.realpathSync.native(workspace);
87
+ const lexicalModules = path.join(root, "node_modules");
88
+ if (fs.lstatSync(lexicalModules, { throwIfNoEntry: false }) === undefined) {
89
+ if (!create) {
90
+ fs.accessSync(root, fs.constants.W_OK | fs.constants.X_OK);
91
+ return root;
92
+ }
93
+ try {
94
+ fs.mkdirSync(lexicalModules);
95
+ } catch (error) {
96
+ if ((error as NodeJS.ErrnoException).code !== "EEXIST") throw error;
97
+ }
98
+ }
99
+ let physical = fs.realpathSync.native(lexicalModules);
100
+ if (
101
+ path.basename(physical) !== "node_modules" ||
102
+ !fs.lstatSync(physical).isDirectory()
103
+ )
104
+ throw new Error(
105
+ `@ttsc/unplugin: unsafe record installation: ${lexicalModules}`,
106
+ );
107
+ for (const name of [".cache", "ttsc", "unplugin", PROJECT_RECORD_DIRECTORY]) {
108
+ const parent = physical;
109
+ physical = path.join(physical, name);
110
+ let entry = fs.lstatSync(physical, { throwIfNoEntry: false });
111
+ if (entry === undefined) {
112
+ if (!create) {
113
+ fs.accessSync(parent, fs.constants.W_OK | fs.constants.X_OK);
114
+ return parent;
115
+ }
116
+ try {
117
+ fs.mkdirSync(physical);
118
+ } catch (error) {
119
+ if ((error as NodeJS.ErrnoException).code !== "EEXIST") throw error;
120
+ }
121
+ entry = fs.lstatSync(physical);
122
+ }
123
+ if (!entry.isDirectory())
124
+ throw new Error(
125
+ `@ttsc/unplugin: unsafe project record directory: ${physical}`,
126
+ );
127
+ }
128
+ if (!create)
129
+ fs.accessSync(
130
+ physical,
131
+ fs.constants.R_OK | fs.constants.W_OK | fs.constants.X_OK,
132
+ );
133
+ return physical;
134
+ }
@@ -0,0 +1,25 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+
4
+ import { fallbackRecordStorage } from "./fallbackRecordStorage";
5
+
6
+ /**
7
+ * Check whether a record is a regular file in qualified managed storage.
8
+ *
9
+ * @evidence contracts/common.md#principled-implementation Directory qualification precedes the record file kind check.
10
+ * @evidence contracts/common.md#clear-and-simple-design Readers share the same managed record eligibility check.
11
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts A linked record does not qualify even when its target is a regular file.
12
+ * @evidence contracts/common.md#meaningful-documentation The comment names both requirements for eligibility.
13
+ * @evidence contracts/portability.md#os-neutral-implementation Native lstat rejects linked files and delegates available ownership checks to the directory validator.
14
+ * @evidence contracts/performance.md#efficient-algorithms A bounded directory traversal precedes one native file-kind lookup.
15
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work Every call observes current storage topology.
16
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources No file handle or verdict is retained.
17
+ */
18
+ export function privateProjectRecordAvailable(file: string): boolean {
19
+ if (fallbackRecordStorage(path.dirname(file), false) !== true) return false;
20
+ try {
21
+ return fs.lstatSync(file, { throwIfNoEntry: false })?.isFile() === true;
22
+ } catch {
23
+ return false;
24
+ }
25
+ }
@@ -2,6 +2,7 @@ import { refreshProcessClockReference } from "../transform/clock/refreshProcessC
2
2
  import { DEFAULT_FILESYSTEM_OPERATIONS } from "../transform/filesystem/DEFAULT_FILESYSTEM_OPERATIONS";
3
3
  import type { TtscTransformFilesystemOperations } from "../transform/filesystem/TtscTransformFilesystemOperations";
4
4
  import { walkProjectInputs } from "../transform/project/walkProjectInputs";
5
+ import { captureRecoveryTreeDigest } from "../transform/watch/captureRecoveryTreeDigest";
5
6
  import { watchInputEvidenceMatchesDisk } from "../transform/watch/watchInputEvidenceMatchesDisk";
6
7
  import type { TtscProjectRecord } from "./TtscProjectRecord";
7
8
  import { membershipRecordDigest } from "./membershipRecordDigest";
@@ -65,6 +66,12 @@ export function projectRecordMoved(
65
66
  if (!projectRecordArgumentsMatch(record, compilerArgumentsIdentity))
66
67
  return record.root;
67
68
  refreshProcessClockReference(record.root, filesystem);
69
+ if (
70
+ record.recoveryTree !== undefined &&
71
+ captureRecoveryTreeDigest(record.recoveryTree.file, filesystem) !==
72
+ record.recoveryTree.digest
73
+ )
74
+ return record.recoveryTree.file;
68
75
  for (const [input, evidence] of Object.entries(record.inputs)) {
69
76
  if (evidence === null || typeof evidence !== "object") return input;
70
77
  if (
@@ -1,5 +1,6 @@
1
1
  import { createHostPathIdentityContext } from "../transform/filesystem/createHostPathIdentityContext";
2
2
  import { pathIdentityKey } from "../transform/filesystem/pathIdentityKey";
3
+ import { RECOVERY_TREE_DIGEST } from "../transform/watch/RECOVERY_TREE_DIGEST";
3
4
  import type { TtscWatchInput } from "../transform/watch/TtscWatchInput";
4
5
  import type { TtscProjectRecord } from "./TtscProjectRecord";
5
6
 
@@ -59,5 +60,10 @@ export function projectRecordWatchInputs(
59
60
  file: record.root,
60
61
  });
61
62
  }
63
+ if (record.recoveryTree !== undefined) {
64
+ const input = { file: record.recoveryTree.file };
65
+ RECOVERY_TREE_DIGEST.set(input, record.recoveryTree.digest);
66
+ inputs.push(input);
67
+ }
62
68
  return inputs;
63
69
  }
@@ -1,4 +1,5 @@
1
1
  import fs from "node:fs";
2
+ import path from "node:path";
2
3
 
3
4
  import { normalizeGraphInputObservation } from "../transform/envelope/normalizeGraphInputObservation";
4
5
  import { isEnvironmentInputs } from "../transform/validation/isEnvironmentInputs";
@@ -55,7 +56,11 @@ export function readProjectRecordFile(
55
56
  (candidate.dependencies !== undefined &&
56
57
  !isStrings(candidate.dependencies)) ||
57
58
  (candidate.environmentInputs !== undefined &&
58
- !isEnvironmentInputs(candidate.environmentInputs))
59
+ !isEnvironmentInputs(candidate.environmentInputs)) ||
60
+ (candidate.recoveryTree !== undefined &&
61
+ !isRecoveryTree(candidate.recoveryTree)) ||
62
+ (candidate.workspaceReplayRequired !== undefined &&
63
+ candidate.workspaceReplayRequired !== true)
59
64
  ) {
60
65
  return undefined;
61
66
  }
@@ -71,12 +76,34 @@ export function readProjectRecordFile(
71
76
  : { environmentInputs: candidate.environmentInputs }),
72
77
  inputs: candidate.inputs,
73
78
  membership: candidate.membership,
79
+ ...(candidate.privateStorage === true
80
+ ? { privateStorage: true as const }
81
+ : {}),
82
+ ...(candidate.recoveryTree === undefined
83
+ ? {}
84
+ : { recoveryTree: candidate.recoveryTree }),
85
+ ...(candidate.workspaceReplayRequired === true
86
+ ? { workspaceReplayRequired: true as const }
87
+ : {}),
74
88
  root: candidate.root,
75
89
  signal: candidate.signal,
76
90
  tsconfig: candidate.tsconfig,
77
91
  };
78
92
  }
79
93
 
94
+ /** The adapter's optional failed compiler source observation. */
95
+ function isRecoveryTree(
96
+ value: unknown,
97
+ ): value is NonNullable<TtscProjectRecord["recoveryTree"]> {
98
+ return (
99
+ isRecord(value) &&
100
+ typeof value.file === "string" &&
101
+ path.isAbsolute(value.file) &&
102
+ (value.digest === null ||
103
+ (typeof value.digest === "string" && /^[0-9a-f]{64}$/.test(value.digest)))
104
+ );
105
+ }
106
+
80
107
  /** A JSON dictionary, excluding arrays and null. */
81
108
  function isRecord(value: unknown): value is Record<string, unknown> {
82
109
  return typeof value === "object" && value !== null && !Array.isArray(value);