@ttsc/unplugin 0.38.1 → 0.38.3

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
@@ -3,12 +3,24 @@ import path from "node:path";
3
3
  import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTransform";
4
4
  import { envelopeDerivation } from "../envelope/envelopeDerivation";
5
5
  import { selectWatchInputs } from "../envelope/selectWatchInputs";
6
+ import type { TtscProjectMutationTracker } from "../tracker/TtscProjectMutationTracker";
6
7
  import { notificationsProveMembership } from "../tracker/notificationsProveMembership";
7
8
  import { reportsMembershipChange } from "../tracker/reportsMembershipChange";
9
+ import { generationWatchInputs } from "../watch/generationWatchInputs";
8
10
  import type { TtscGenerationProof } from "./TtscGenerationProof";
9
11
  import { matchesProvenInput } from "./matchesProvenInput";
10
12
  import { matchesUniversalHostInputs } from "./matchesUniversalHostInputs";
11
13
 
14
+ const uncoveredInputs = new WeakMap<
15
+ TtscCachedProjectTransform,
16
+ {
17
+ project: ReadonlySet<string> | undefined;
18
+ host: ReadonlySet<string> | undefined;
19
+ candidate: ReadonlySet<string> | undefined;
20
+ complete: boolean;
21
+ }
22
+ >();
23
+
12
24
  /**
13
25
  * Validate one graph-bearing cached output against only the inputs that can
14
26
  * affect that file. The delivery validator establishes its complete baseline
@@ -39,8 +51,11 @@ import { matchesUniversalHostInputs } from "./matchesUniversalHostInputs";
39
51
  * @evidence contracts/performance.md#reuse-equivalent-work
40
52
  * Immutable envelope selections, universal manifests and currently qualified
41
53
  * per-input signatures serve sibling deliveries. Universal validation is
42
- * invoked on each call; covered lexical spellings skip only the second input
43
- * proof, and memoized dependency lists do not themselves prove fresh content.
54
+ * invoked on each call. Quiet authoritative scopes let sibling deliveries
55
+ * share the exact coverage decision. A candidate watcher only proves a
56
+ * recorded file-unavailability predicate. The native gate has already
57
+ * replayed direct external inputs. Other unproven inputs need the module's
58
+ * own selection.
44
59
  */
45
60
  export function matchesNarrowPersistentInputs(
46
61
  /**
@@ -66,6 +81,52 @@ export function matchesNarrowPersistentInputs(
66
81
  if (!matchesUniversalHostInputs(cached, hostValidation, proof)) {
67
82
  return false;
68
83
  }
84
+ const verified =
85
+ proof?.cached === cached &&
86
+ proof.groupedWatchInputs === true &&
87
+ proof.locations !== undefined;
88
+ const project = verified
89
+ ? quietCoverage(cached.projectMutationTracker)
90
+ : undefined;
91
+ const host = verified
92
+ ? quietCoverage(cached.hostInputMutationTracker)
93
+ : undefined;
94
+ const candidate = verified
95
+ ? quietCoverage(cached.candidateMutationTracker)
96
+ : undefined;
97
+ if (project !== undefined || host !== undefined || candidate !== undefined) {
98
+ let uncovered = uncoveredInputs.get(cached);
99
+ if (
100
+ uncovered === undefined ||
101
+ uncovered.project !== project ||
102
+ uncovered.host !== host ||
103
+ uncovered.candidate !== candidate
104
+ ) {
105
+ const direct = new Set(cached.directExternalInputs);
106
+ uncovered = {
107
+ project,
108
+ host,
109
+ candidate,
110
+ complete: generationWatchInputs(cached).every(({ file }) => {
111
+ if (
112
+ hostValidation.covered.has(file) ||
113
+ project?.has(file) ||
114
+ host?.has(file) ||
115
+ direct.has(file)
116
+ )
117
+ return true;
118
+ const observation = cached.externalInputObservations?.[file];
119
+ return (
120
+ candidate?.has(file) === true &&
121
+ observation?.fileExists === false &&
122
+ Object.keys(observation).length === 1
123
+ );
124
+ }),
125
+ };
126
+ uncoveredInputs.set(cached, uncovered);
127
+ }
128
+ if (uncovered.complete) return true;
129
+ }
69
130
  const inputs = selectWatchInputs({
70
131
  file,
71
132
  projectRoot: cached.projectRoot,
@@ -86,3 +147,21 @@ export function matchesNarrowPersistentInputs(
86
147
  }
87
148
  return true;
88
149
  }
150
+
151
+ /**
152
+ * Covered spellings can stand for the whole quiet scope after its current
153
+ * location and notification checks.
154
+ */
155
+ function quietCoverage(
156
+ tracker: TtscProjectMutationTracker | undefined,
157
+ ): ReadonlySet<string> | undefined {
158
+ return tracker?.contentAuthoritative === true &&
159
+ !tracker.failed &&
160
+ !tracker.unverified &&
161
+ !tracker.changesOmitted &&
162
+ !tracker.membershipChanged &&
163
+ tracker.changes.size === 0 &&
164
+ (tracker.unproven?.size ?? 0) === 0
165
+ ? tracker.covered
166
+ : undefined;
167
+ }
@@ -1,11 +1,13 @@
1
1
  import path from "node:path";
2
2
  import type { ITtscCompilerTransformation } from "ttsc";
3
+ import { PluginBuildEnvironmentWitness } from "ttsc/plugin-source";
3
4
 
4
5
  import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTransform";
5
6
  import { resultFilesystem } from "../cache/resultFilesystem";
6
7
  import { envelopeDerivation } from "../envelope/envelopeDerivation";
7
8
  import { nativeInputPredicateMatches } from "../inputs/nativeInputPredicateMatches";
8
9
  import type { TtscGenerationProof } from "./TtscGenerationProof";
10
+ import { matchesRecordedInput } from "./matchesRecordedInput";
9
11
 
10
12
  // Weakly owned by immutable observation membership, never by current verdict.
11
13
  // Keeping this separate from native path derivation also preserves the empty
@@ -16,17 +18,18 @@ const predicateInputs = new WeakMap<
16
18
  >();
17
19
 
18
20
  /**
19
- * Validate every generation-owned native config predicate before cache reuse.
20
- * This check also applies when notification/epoch shortcuts admit other inputs.
21
- * A generation with no native predicates requires no native replay context;
22
- * existing non-native proof owners still perform their own validation.
21
+ * Validate generation-owned native config predicates and directly observed
22
+ * external names before cache reuse. This check also applies when
23
+ * notification/epoch shortcuts admit other inputs. A generation with neither
24
+ * source of input requires no native replay context. Other proof owners still
25
+ * perform their own validation.
23
26
  *
24
- * @evidence contracts/common.md#principled-implementation Every recorded native predicate must match through the generation's original filesystem view. An empty native predicate population contributes no native constraint, without admitting other proof domains or converting an exception into reuse.
27
+ * @evidence contracts/common.md#principled-implementation Every recorded native predicate and each external name deliberately left to direct validation must match through the generation's filesystem view before reuse.
25
28
  * @evidence contracts/common.md#clear-and-simple-design One gate is shared by source, complete-snapshot and universal-input admission; the typed replay owns encodings and native errors.
26
29
  * @evidence contracts/common.md#prohibited-implementation-shortcuts Metadata and notification shortcuts cannot omit typed config predicates or repair an unstable producer witness.
27
30
  * @evidence contracts/common.md#meaningful-documentation The comment identifies generation ownership and the admission shortcuts that must retain this gate.
28
31
  * @evidence contracts/portability.md#os-neutral-implementation Relative names are resolved against the recorded project with the filesystem view's path dialect; native identity and encoding belong to the replay operation.
29
- * @evidence contracts/performance.md#efficient-algorithms Immutable observation membership is indexed once, including an empty population. Each new synchronous admission replays only indexed native predicates and stops at the first refusal; nested validators share its verdict without another scan or native query. Empty populations require no native replay context.
32
+ * @evidence contracts/performance.md#efficient-algorithms Immutable observation membership is indexed once, including an empty population. Each synchronous admission replays the selected external names and indexed native predicates, stopping at the first refusal. Nested validators share its verdict without another scan or native query.
30
33
  * @evidence contracts/performance.md#reuse-equivalent-work A weak observation index shares immutable membership. Current verdicts belong only to an exact-owner synchronous transaction, never the next delivery or an await.
31
34
  * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The weak index follows immutable observation lifetime; synchronous verdicts and native queries acquire no handle or history.
32
35
  */
@@ -44,6 +47,12 @@ export function nativeInputPredicatesHold(
44
47
  if (proof?.cached === cached) proof.nativePredicates = matches;
45
48
  return matches;
46
49
  };
50
+ for (const file of cached.directExternalInputs ?? []) {
51
+ if (!matchesRecordedInput(cached, file)) return finish(false);
52
+ }
53
+ for (const state of Object.values(cached.result.workspaceInputs ?? {}))
54
+ if (!PluginBuildEnvironmentWitness.holds(state.entries))
55
+ return finish(false);
47
56
  const observations = cached.result.graph?.inputObservations;
48
57
  if (observations === undefined) return finish(true);
49
58
  let inputs = predicateInputs.get(observations);
@@ -0,0 +1,12 @@
1
+ import type { TtscWatchInput } from "./TtscWatchInput";
2
+
3
+ /**
4
+ * The internal recovery condition attached to a watcher registration.
5
+ *
6
+ * A missing attachment is undefined. A null digest records an unavailable
7
+ * target. The weak key releases the digest with its registration.
8
+ */
9
+ export const RECOVERY_TREE_DIGEST = new WeakMap<
10
+ TtscWatchInput,
11
+ string | null
12
+ >();
@@ -1,3 +1,4 @@
1
+ import { MANAGED_PROJECT_RECORDS } from "../../bridge/MANAGED_PROJECT_RECORDS";
1
2
  import type { TtscWatchInput } from "./TtscWatchInput";
2
3
 
3
4
  /**
@@ -24,6 +25,9 @@ import type { TtscWatchInput } from "./TtscWatchInput";
24
25
  * retained state at runtime.
25
26
  */
26
27
  export interface TtscProjectRegistration {
28
+ /** The adapter selected a generated managed record. */
29
+ [MANAGED_PROJECT_RECORDS]?: true;
30
+
27
31
  /**
28
32
  * The digest of snapshot bytes this process wrote or found identical in
29
33
  * {@link record} for the delivery's revision (`projectRecordDigest`), or
@@ -1,3 +1,4 @@
1
+ import { MANAGED_PROJECT_RECORDS } from "../../bridge/MANAGED_PROJECT_RECORDS";
1
2
  import type { TtscProjectRegistration } from "./TtscProjectRegistration";
2
3
  import type { TtscWatchInput } from "./TtscWatchInput";
3
4
  import type { TtscWatchInputEvidence } from "./TtscWatchInputEvidence";
@@ -30,6 +31,27 @@ import type { TtscWatchInputEvidence } from "./TtscWatchInputEvidence";
30
31
  * state at runtime.
31
32
  */
32
33
  export interface TtscTransformHooks {
34
+ /**
35
+ * Join a shared compiler generation with this module's routing and membership
36
+ * inputs. The callback can use `affected` to decide if changed paths reach
37
+ * the module. Returning false requests ordinary per-module registration.
38
+ *
39
+ * @evidence contracts/common.md#principled-implementation The callback receives the generation owner and its input set, the module's input set, and the module's own invalidation predicate.
40
+ * @evidence contracts/common.md#clear-and-simple-design The callback separates group registration from module dependency selection and reports whether it accepted the handoff.
41
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Refusal keeps the flat dependency handoff. Joining a group still supplies module-local inputs and the affected predicate.
42
+ * @evidence contracts/common.md#meaningful-documentation The comment explains the two input sets, the predicate and the return value.
43
+ * @evidence contracts/portability.md#os-neutral-implementation Both input sets carry native watch spellings, and the predicate receives native spellings reported by the observer.
44
+ * @evidenceExclude contracts/performance.md#efficient-algorithms The declaration supplies a callback shape. Its implementation owns registration costs.
45
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work The host decides whether its generation registrations can be shared.
46
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The declaration retains no input set or native watcher.
47
+ */
48
+ watchGeneration?: (
49
+ owner: string,
50
+ inputs: readonly TtscWatchInput[],
51
+ local: readonly TtscWatchInput[],
52
+ affected: (changed: ReadonlySet<string>) => boolean,
53
+ ) => boolean;
54
+
33
55
  /**
34
56
  * Native config already selected by the host for this delivered module.
35
57
  *
@@ -57,13 +79,13 @@ export interface TtscTransformHooks {
57
79
  addWatchFile?: TtscAddWatchFile;
58
80
 
59
81
  /**
60
- * Batched form of {@link addWatchFile}. When supplied, the transform calls it
61
- * once per delivered module and does not call `addWatchFile` for that module.
62
- * `failed` marks a recovery batch: a failed compiler can omit inputs from its
63
- * previous successful result, so replacing hosts should retain those
64
- * spellings until the next successful delivery. The third argument carries
65
- * the generation's environment reads for hosts that include non-file inputs
66
- * in their persistent keys.
82
+ * Batched form of {@link addWatchFile}. For a flat delivery, this callback
83
+ * receives one batch in place of individual calls to `addWatchFile`. `failed`
84
+ * marks a recovery batch: a failed compiler can omit inputs from its previous
85
+ * successful result, so replacing hosts should retain those spellings until
86
+ * the next successful delivery. The third argument carries the generation's
87
+ * environment reads for hosts that include non-file inputs in their
88
+ * persistent keys.
67
89
  */
68
90
  addWatchFiles?: TtscAddWatchFiles;
69
91
 
@@ -105,6 +127,8 @@ export interface TtscTransformHooks {
105
127
  * watching session's bridge (`registerProjectRecord`).
106
128
  */
107
129
  project?: {
130
+ /** The directory generated under private storage by the built-in adapter. */
131
+ [MANAGED_PROJECT_RECORDS]?: "toolDirectory" | "fallbackToolDirectory";
108
132
  /** Called once per delivery, failed deliveries included. */
109
133
  register: TtscRegisterWatchProject;
110
134
 
@@ -133,13 +157,17 @@ export interface TtscTransformHooks {
133
157
  * snapshot of the module represents: the plugin declared the transformed file
134
158
  * volatile (the envelope's `volatile` list), or the module was handed over
135
159
  * without a complete host-observation closure, or without the project's
136
- * record, which could not be written. Adapters should mark the module
137
- * uncacheable where the bundler exposes that control (e.g. a webpack loader
138
- * context's `cacheable(false)`), or answer the bundler's cache for it where
139
- * the bundler asks instead (Rollup's `shouldTransformCachedModule`, through
140
- * the module's `meta`).
160
+ * record, which could not be written. An opaque cache can also opt in to this
161
+ * callback for a generated workspace that must be resolved again. Adapters
162
+ * should mark the module uncacheable where the bundler exposes that control
163
+ * (e.g. a webpack loader context's `cacheable(false)`), or answer the
164
+ * bundler's cache for it where the bundler asks instead (Rollup's
165
+ * `shouldTransformCachedModule`, through the module's `meta`).
141
166
  */
142
167
  markVolatile?: TtscMarkVolatile;
168
+
169
+ /** Use markVolatile for workspace replay when the host has no restore hook. */
170
+ workspaceReplayUsesVolatility?: true;
143
171
  }
144
172
 
145
173
  /**
@@ -1,4 +1,5 @@
1
1
  import type { TtscWatchInputState } from "./TtscWatchInputState";
2
+ import type { TtscWorkspaceWatchEvidence } from "./TtscWorkspaceWatchEvidence";
2
3
 
3
4
  /**
4
5
  * What the generation already knows about one derived watch input, handed to
@@ -29,6 +30,8 @@ import type { TtscWatchInputState } from "./TtscWatchInputState";
29
30
  * retained state at runtime.
30
31
  */
31
32
  export interface TtscWatchInputEvidence {
33
+ /** Independent workspace metadata sharing the same watch spelling. */
34
+ workspace?: TtscWorkspaceWatchEvidence;
32
35
  /** Memoized filesystem identity of the input. */
33
36
  identity: string;
34
37
 
@@ -0,0 +1,17 @@
1
+ import type { ITtscCompilerTransformation } from "ttsc";
2
+
3
+ /**
4
+ * Native workspace evidence attached independently of a compiler input codec.
5
+ *
6
+ * @evidence contracts/common.md#principled-implementation Preserves the producer's metadata and delivery requirements at a usable watch spelling.
7
+ * @evidence contracts/common.md#clear-and-simple-design Attaches workspace observations to a path independently of its compiler state.
8
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts A workspace witness cannot masquerade as a compiler file, tree or predicate codec.
9
+ * @evidence contracts/common.md#meaningful-documentation Describes how this evidence coexists with the input codec.
10
+ * @evidence contracts/portability.md#os-neutral-implementation Witness keys keep the original native spelling, including encoded POSIX bytes.
11
+ * @evidenceExclude contracts/performance.md#efficient-algorithms The type declares a carrier with no runtime computation.
12
+ * @evidenceExclude contracts/performance.md#reuse-equivalent-work The observer owns condition reuse.
13
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The type allocates no resource.
14
+ */
15
+ export type TtscWorkspaceWatchEvidence = NonNullable<
16
+ ITtscCompilerTransformation.ISuccess["workspaceInputs"]
17
+ >[string];
@@ -0,0 +1,58 @@
1
+ import {
2
+ pluginSourceDigest,
3
+ provenPluginSourceDigest,
4
+ } from "ttsc/plugin-source";
5
+
6
+ import { DEFAULT_FILESYSTEM_OPERATIONS } from "../filesystem/DEFAULT_FILESYSTEM_OPERATIONS";
7
+ import type { TtscTransformFilesystemOperations } from "../filesystem/TtscTransformFilesystemOperations";
8
+ import { hostInputRealpath } from "../inputs/hostInputRealpath";
9
+ import { hashText } from "../utils/hashText";
10
+
11
+ /**
12
+ * Observe the directory and the sources a failed compiler can recover from.
13
+ *
14
+ * A missing or non-directory target has no digest. A directory whose source
15
+ * cannot be read still records its physical target, so making its source
16
+ * readable changes the recovery observation.
17
+ *
18
+ * Capture before compilation can use the compiler's content store under its
19
+ * effective environment. The store owns its clock probes and reuses a digest
20
+ * only while its source metadata qualifies. A cold or unproven reading requires
21
+ * the selected source bytes.
22
+ *
23
+ * @evidence contracts/common.md#principled-implementation The native target and shared source digest distinguish directory appearance, retargeting, and changes to selected files. No Go environment or successful compiler state is inferred.
24
+ * @evidence contracts/common.md#clear-and-simple-design One source observation serves failed delivery, the live observer and detached records.
25
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Directory availability is checked independently because the build's source digest treats a missing directory like an empty one.
26
+ * @evidence contracts/common.md#meaningful-documentation Native prose explains unavailable targets and unreadable sources, with a blank line before the tags.
27
+ * @evidence contracts/portability.md#os-neutral-implementation Native stat follows directory links, and physical target witnesses retain POSIX bytes. The shared source selector reads native files, so the supplied view must describe the same paths.
28
+ * @evidence contracts/performance.md#efficient-algorithms Unavailable targets cost one stat attempt or a stat and realpath. Available directories pay for the source selector. With a store this includes opening its cache and probing source metadata, with content read on a miss. Direct replay reads selected bytes. Both paths hash the target and source digest text.
29
+ * @evidence contracts/performance.md#reuse-equivalent-work The caller's exact project and effective environment select the existing compiler content store. Store-owned separable source signatures qualify a warm digest; other calls read current bytes.
30
+ * @evidence contracts/performance.md#bound-retention-and-release-resources The digest and filesystem observations are call-local. The existing content store releases its clock probes and owns the retention of persisted identities.
31
+ */
32
+ export function captureRecoveryTreeDigest(
33
+ file: string,
34
+ filesystem: TtscTransformFilesystemOperations = DEFAULT_FILESYSTEM_OPERATIONS,
35
+ compiler?: { projectRoot: string; environment: NodeJS.ProcessEnv },
36
+ ): string | null {
37
+ try {
38
+ if (!filesystem.stat(file).isDirectory()) return null;
39
+ } catch {
40
+ return null;
41
+ }
42
+ const target = hostInputRealpath(file, filesystem);
43
+ if (target === null) return null;
44
+ let source: string | null = null;
45
+ try {
46
+ source =
47
+ compiler === undefined
48
+ ? pluginSourceDigest(file)
49
+ : provenPluginSourceDigest(
50
+ file,
51
+ compiler.projectRoot,
52
+ compiler.environment,
53
+ );
54
+ } catch {
55
+ // Repairing an unreadable source changes the recovery state.
56
+ }
57
+ return hashText(JSON.stringify([target, source]));
58
+ }
@@ -45,6 +45,11 @@ export function evidencedWatchInput(
45
45
  const external = cached.externalInputHashes ?? {};
46
46
  const identity = derivationIdentity(state, input);
47
47
  const spelling = path.resolve(input);
48
+ const workspace =
49
+ cached.result.type === "exception"
50
+ ? undefined
51
+ : cached.result.workspaceInputs?.[spelling];
52
+ const workspaceEvidence = workspace === undefined ? {} : { workspace };
48
53
  // A plugin's source directory is proven by the state its binary was built
49
54
  // from, whatever else observed the path (samchon/ttsc#1487).
50
55
  const digest = selectPluginSourceInputs(cached.result).get(spelling);
@@ -52,6 +57,7 @@ export function evidencedWatchInput(
52
57
  return {
53
58
  file: spell(input),
54
59
  evidence: {
60
+ ...workspaceEvidence,
55
61
  identity,
56
62
  missing: false,
57
63
  state: { codec: "tree", digest },
@@ -100,6 +106,7 @@ export function evidencedWatchInput(
100
106
  return {
101
107
  file: spell(input),
102
108
  evidence: {
109
+ ...workspaceEvidence,
103
110
  identity,
104
111
  missing,
105
112
  ...(stateEvidence === undefined ? {} : { state: stateEvidence }),
@@ -1,3 +1,4 @@
1
+ import { RECOVERY_TREE_DIGEST } from "./RECOVERY_TREE_DIGEST";
1
2
  import type { TtscTransformHooks } from "./TtscTransformHooks";
2
3
  import type { TtscWatchInput } from "./TtscWatchInput";
3
4
 
@@ -27,13 +28,13 @@ import type { TtscWatchInput } from "./TtscWatchInput";
27
28
  * @param failed Whether they are a failed generation's, for a batching host.
28
29
  * @param environmentInputs Generation-time environment reads for a batching
29
30
  * host's persistent key, including recorded absences.
30
- * @evidence contracts/common.md#principled-implementation Exact registration spellings are deduplicated with membership preferred over ordinary evidence and evidence over a recovery-only path; equal-ranked entries retain the first observation.
31
+ * @evidence contracts/common.md#principled-implementation Exact registration spellings are deduplicated with membership preferred over ordinary evidence and evidence over a recovery-only path; equal-ranked entries retain the first observation. The private source recovery digest accompanies the selected input so it can coexist with membership.
31
32
  * @evidence contracts/common.md#clear-and-simple-design One precedence pass feeds either the batch callback or individual callbacks, leaving evidence derivation and bundler policy with their owners.
32
- * @evidence contracts/common.md#prohibited-implementation-shortcuts Contract-defined precedence keeps the strongest available input meaning without inventing facts, and batch preference follows the supported callback contract.
33
+ * @evidence contracts/common.md#prohibited-implementation-shortcuts Contract-defined precedence keeps the strongest available input meaning without inventing facts, and batch preference follows the supported callback contract. Undefined recovery means no attachment; null preserves a registered but unavailable source.
33
34
  * @evidence contracts/common.md#meaningful-documentation Native prose explains callback preference, deduplication and precedence, with separated tags following documentation guidance.
34
- * @evidence contracts/performance.md#efficient-algorithms One pass performs N keyed selection operations with fixed rank checks, followed by a U-entry array copy, avoiding pairwise duplicate searches. Map hashing/comparison pays exact spelling text costs, and temporary storage retains U entries/keys. One batch or U individual callback effects add their host-owned work; no-hook delivery returns before selection/allocation.
35
+ * @evidence contracts/performance.md#efficient-algorithms One pass performs N keyed selection operations with fixed rank checks, followed by a U-entry array copy, avoiding pairwise duplicate searches. Duplicate registrations query the weak attachment and copy the selected input only to carry over a missing recovery digest. Map hashing/comparison pays exact spelling text costs, and temporary storage retains U entries/keys. One batch or U individual callback effects add their host-owned work; no-hook delivery returns before selection/allocation.
35
36
  * @evidenceExclude contracts/performance.md#reuse-equivalent-work Callback delivery is an effect for each module; matching input values do not authorize suppressing another host notification.
36
- * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The chosen map and batch are call-local; host callbacks own any retained watcher state after delivery.
37
+ * @evidenceExclude contracts/performance.md#bound-retention-and-release-resources The chosen map and batch are call-local; the weak attachment follows its input's lifetime, and host callbacks own retained registrations after delivery.
37
38
  * @evidenceExclude contracts/portability.md#os-neutral-implementation Deduplicates inputs by their exact spelling and hands them to host callbacks; no path is parsed.
38
39
  */
39
40
  export function handWatchInputs(
@@ -48,9 +49,24 @@ export function handWatchInputs(
48
49
  const chosen = new Map<string, TtscWatchInput>();
49
50
  for (const input of inputs) {
50
51
  const kept = chosen.get(input.file);
51
- if (kept === undefined || rank(input) > rank(kept)) {
52
+ if (kept === undefined) {
52
53
  chosen.set(input.file, input);
54
+ continue;
53
55
  }
56
+ const winner = rank(input) > rank(kept) ? input : kept;
57
+ const other = winner === input ? kept : input;
58
+ const recovery = RECOVERY_TREE_DIGEST.get(other);
59
+ const workspace = winner.evidence?.workspace ?? other.evidence?.workspace;
60
+ const combined =
61
+ workspace !== undefined && winner.evidence?.workspace === undefined
62
+ ? { ...winner, evidence: { ...winner.evidence!, workspace } }
63
+ : recovery !== undefined && !RECOVERY_TREE_DIGEST.has(winner)
64
+ ? { ...winner }
65
+ : winner;
66
+ const retainedRecovery = RECOVERY_TREE_DIGEST.get(winner) ?? recovery;
67
+ if (retainedRecovery !== undefined && combined !== winner)
68
+ RECOVERY_TREE_DIGEST.set(combined, retainedRecovery);
69
+ chosen.set(input.file, combined);
54
70
  }
55
71
  const distinct = [...chosen.values()];
56
72
  if (addWatchFiles !== undefined) {
@@ -4,10 +4,13 @@ import type { TtscCachedProjectTransform } from "../cache/TtscCachedProjectTrans
4
4
  import { formatUnknownError } from "../diagnostics/formatUnknownError";
5
5
  import { envelopeDerivation } from "../envelope/envelopeDerivation";
6
6
  import { hostSpelling } from "../envelope/hostSpelling";
7
+ import type { TtscFailedGenerationValidation } from "../generation/TtscFailedGenerationValidation";
7
8
  import { isTransformScratchInput } from "../tsconfig/isTransformScratchInput";
9
+ import { RECOVERY_TREE_DIGEST } from "./RECOVERY_TREE_DIGEST";
8
10
  import type { TtscTransformHooks } from "./TtscTransformHooks";
9
11
  import type { TtscWatchInput } from "./TtscWatchInput";
10
12
  import type { TtscWatchSelection } from "./TtscWatchSelection";
13
+ import { captureRecoveryTreeDigest } from "./captureRecoveryTreeDigest";
11
14
  import { evidencedWatchInput } from "./evidencedWatchInput";
12
15
  import { handWatchInputs } from "./handWatchInputs";
13
16
  import { notifyProjectRecord } from "./notifyProjectRecord";
@@ -34,6 +37,12 @@ import { selectionInputs } from "./selectionInputs";
34
37
  * is paid only on a failure, and only until the next compile succeeds and
35
38
  * narrows the set back to the derived inputs.
36
39
  *
40
+ * An exception also retains the declared compiler source's filesystem state.
41
+ * The observer and project record can detect repairs anywhere in that source. A
42
+ * rejected success supplies its refreshed workspace baseline. Ordinary evidence
43
+ * at the same path is observed again for recovery instead of reusing the
44
+ * rejected generation's state. A shared plugin source keeps its current tree.
45
+ *
37
46
  * @param file The delivered module, as the host spelled it, which decides the
38
47
  * spelling every input is handed under (`hostSpelling`).
39
48
  * @param selection The configs that routed the file to its project, handed
@@ -52,6 +61,7 @@ export function notifyFailedGenerationInputs(
52
61
  cached: TtscCachedProjectTransform,
53
62
  file: string,
54
63
  selection: TtscWatchSelection,
64
+ workspaceBaseline?: TtscFailedGenerationValidation["workspaceInputs"],
55
65
  ): void {
56
66
  if (
57
67
  hooks === undefined ||
@@ -64,10 +74,15 @@ export function notifyFailedGenerationInputs(
64
74
  const state = envelopeDerivation(cached);
65
75
  const spell = hostSpelling(state.project, file);
66
76
  const inputs: TtscWatchInput[] = [];
67
- // The same paths as the compiler spelled them, for the record: what the
68
- // failed generation did record of each, its walk hash or external state, is
69
- // what the record holds, read again only where it recorded nothing.
77
+ const compilerSource = cached.failedCompilerSource;
78
+ const result = cached.result;
79
+ const workspaceInputs =
80
+ workspaceBaseline ??
81
+ (result.type === "exception" ? undefined : result.workspaceInputs);
82
+ // Keep the compiler's spellings for the record and use its retained state
83
+ // where available.
70
84
  const recorded: string[] = [];
85
+ const workspaceRecovery = new Map<string, TtscWatchInput>();
71
86
  const seen = new Set<string>();
72
87
  const append = (input: string): void => {
73
88
  const spelling = path.resolve(input);
@@ -78,10 +93,45 @@ export function notifyFailedGenerationInputs(
78
93
  return;
79
94
  }
80
95
  seen.add(spelling);
81
- // No evidence, deliberately. A failed generation is replayed for the rest
82
- // of its pass without re-proving its inputs, so the adapter must observe
83
- // the current availability itself.
84
- inputs.push({ file: spell(spelling) });
96
+ const workspace = workspaceInputs?.[spelling];
97
+ let watched: TtscWatchInput = { file: spell(spelling) };
98
+ if (workspace !== undefined) {
99
+ const retired = evidencedWatchInput(
100
+ cached,
101
+ state,
102
+ spelling,
103
+ (file) => file,
104
+ ).evidence!;
105
+ const codec = retired.state?.codec;
106
+ const recovery =
107
+ codec !== undefined && codec !== "tree"
108
+ ? selectionInputs(
109
+ [spelling],
110
+ selection.filesystem,
111
+ (file) => file,
112
+ )[0]!
113
+ : {
114
+ file: spelling,
115
+ evidence: { identity: retired.identity, missing: false },
116
+ };
117
+ const current: TtscWatchInput = {
118
+ ...recovery,
119
+ evidence: { ...recovery.evidence!, workspace },
120
+ };
121
+ workspaceRecovery.set(spelling, current);
122
+ watched = { ...current, file: watched.file };
123
+ if (codec === "tree") {
124
+ const digest = captureRecoveryTreeDigest(
125
+ spelling,
126
+ selection.filesystem,
127
+ );
128
+ RECOVERY_TREE_DIGEST.set(current, digest);
129
+ RECOVERY_TREE_DIGEST.set(watched, digest);
130
+ }
131
+ }
132
+ if (spelling === compilerSource?.file)
133
+ RECOVERY_TREE_DIGEST.set(watched, compilerSource.digest);
134
+ inputs.push(watched);
85
135
  recorded.push(spelling);
86
136
  };
87
137
  for (const key of Object.keys(cached.inputHashes)) {
@@ -94,6 +144,7 @@ export function notifyFailedGenerationInputs(
94
144
  for (const input of cached.externalInputPaths ?? []) {
95
145
  append(input);
96
146
  }
147
+ for (const input of Object.keys(workspaceInputs ?? {})) append(input);
97
148
  if (cached.result.type === "failure") {
98
149
  for (const diagnostic of cached.result.diagnostics) {
99
150
  if (typeof diagnostic.file === "string" && diagnostic.file.length !== 0) {
@@ -128,9 +179,14 @@ export function notifyFailedGenerationInputs(
128
179
  cached,
129
180
  true,
130
181
  () =>
131
- recorded.map((input) =>
132
- evidencedWatchInput(cached, state, input, (spelling) => spelling),
133
- ),
182
+ recorded.map((input) => {
183
+ const watched =
184
+ workspaceRecovery.get(input) ??
185
+ evidencedWatchInput(cached, state, input, (spelling) => spelling);
186
+ if (input === compilerSource?.file)
187
+ RECOVERY_TREE_DIGEST.set(watched, compilerSource.digest);
188
+ return watched;
189
+ }),
134
190
  routedInputs,
135
191
  )
136
192
  ) {