@@ -65,6 +65,12 @@ export interface ProviderMaintenanceCapabilities {
6565 * installer was asked and did not know.
6666 */
6767 readonly latestVersion ?: string | null ;
68+ /**
69+ * The executable T3 Code runs, symlinks followed, when no update command is
70+ * proven for it. The version advisory names it so the user knows which
71+ * install to update.
72+ */
73+ readonly installPath ?: string ;
6874}
6975
7076export interface ProviderMaintenanceCommandAction {
@@ -216,14 +222,18 @@ export function makeTargetedProviderUpdateAction(
216222export function makeManualOnlyProviderMaintenanceCapabilities ( input : {
217223 readonly provider : ProviderDriverKind ;
218224 readonly packageName : string | null ;
225+ readonly installPath ?: string ;
219226} ) : ProviderMaintenanceCapabilities {
220- return makeProviderMaintenanceCapabilities ( {
221- provider : input . provider ,
222- packageName : input . packageName ,
223- updateExecutable : null ,
224- updateArgs : [ ] ,
225- updateLockKey : null ,
226- } ) ;
227+ return {
228+ ...makeProviderMaintenanceCapabilities ( {
229+ provider : input . provider ,
230+ packageName : input . packageName ,
231+ updateExecutable : null ,
232+ updateArgs : [ ] ,
233+ updateLockKey : null ,
234+ } ) ,
235+ ...( input . installPath ? { installPath : input . installPath } : { } ) ,
236+ } ;
227237}
228238
229239export function normalizeCommandPath ( commandPath : string ) : string {
@@ -381,13 +391,17 @@ export const resolvePackageManagedProviderMaintenance = Effect.fn(
381391 definition : PackageManagedProviderMaintenanceDefinition ,
382392 context : ProviderMaintenanceResolutionContext | null ,
383393) {
394+ if ( ! context ) {
395+ return makeManualOnlyProviderMaintenanceCapabilities ( {
396+ provider : definition . provider ,
397+ packageName : definition . npmPackageName ,
398+ } ) ;
399+ }
384400 const manual = makeManualOnlyProviderMaintenanceCapabilities ( {
385401 provider : definition . provider ,
386402 packageName : definition . npmPackageName ,
403+ installPath : context . realCommandPath ,
387404 } ) ;
388- if ( ! context ) {
389- return manual ;
390- }
391405 const commandPaths = [ context . resolvedCommandPath , context . realCommandPath ] ;
392406 const packageName = definition . npmPackageName ;
393407
@@ -614,9 +628,20 @@ export const makeCachedProviderMaintenanceResolution = Effect.fn(
614628 options ?. fresh ? invalidate . pipe ( Effect . andThen ( cached ) ) : cached ;
615629} ) ;
616630
631+ /**
632+ * An install T3 Code cannot update gets no Update button or command, so its
633+ * message names the version and the executable instead.
634+ */
635+ function manualUpdateMessage ( latestVersion : string , installPath : string | undefined ) : string {
636+ return installPath
637+ ? `Version ${ latestVersion } is out. T3 Code runs ${ installPath } ; update it with the app or tool that installed it.`
638+ : `Version ${ latestVersion } is out. Update it with the app or tool that installed it.` ;
639+ }
640+
617641function deriveVersionAdvisory ( input : {
618642 readonly currentVersion : string | null ;
619643 readonly latestVersion : string | null ;
644+ readonly capabilities : ProviderMaintenanceCapabilities ;
620645} ) : Pick < ServerProviderVersionAdvisory , "status" | "message" > {
621646 if ( ! input . currentVersion ) {
622647 return { status : "unknown" , message : null } ;
@@ -627,7 +652,10 @@ function deriveVersionAdvisory(input: {
627652 if ( compareSemverVersions ( input . currentVersion , input . latestVersion ) < 0 ) {
628653 return {
629654 status : "behind_latest" ,
630- message : PROVIDER_UPDATE_ACTION_TOAST_MESSAGE ,
655+ message :
656+ input . capabilities . update === null
657+ ? manualUpdateMessage ( input . latestVersion , input . capabilities . installPath )
658+ : PROVIDER_UPDATE_ACTION_TOAST_MESSAGE ,
631659 } ;
632660 }
633661 return { status : "current" , message : null } ;
@@ -646,6 +674,7 @@ export function createProviderVersionAdvisory(input: {
646674 const advisory = deriveVersionAdvisory ( {
647675 currentVersion : input . currentVersion ,
648676 latestVersion,
677+ capabilities,
649678 } ) ;
650679
651680 return {
0 commit comments