@@ -199,14 +199,18 @@ export function makeTargetedProviderUpdateAction(
199199export function makeManualOnlyProviderMaintenanceCapabilities ( input : {
200200 readonly provider : ProviderDriverKind ;
201201 readonly packageName : string | null ;
202+ readonly installPath ?: string ;
202203} ) : ProviderMaintenanceCapabilities {
203- return makeProviderMaintenanceCapabilities ( {
204- provider : input . provider ,
205- packageName : input . packageName ,
206- updateExecutable : null ,
207- updateArgs : [ ] ,
208- updateLockKey : null ,
209- } ) ;
204+ return {
205+ ...makeProviderMaintenanceCapabilities ( {
206+ provider : input . provider ,
207+ packageName : input . packageName ,
208+ updateExecutable : null ,
209+ updateArgs : [ ] ,
210+ updateLockKey : null ,
211+ } ) ,
212+ ...( input . installPath ? { installPath : input . installPath } : { } ) ,
213+ } ;
210214}
211215
212216export function normalizeCommandPath ( commandPath : string ) : string {
@@ -376,13 +380,17 @@ export const resolvePackageManagedProviderMaintenance = Effect.fn(
376380 definition : PackageManagedProviderMaintenanceDefinition ,
377381 context : ProviderMaintenanceResolutionContext | null ,
378382) {
383+ if ( ! context ) {
384+ return makeManualOnlyProviderMaintenanceCapabilities ( {
385+ provider : definition . provider ,
386+ packageName : definition . npmPackageName ,
387+ } ) ;
388+ }
379389 const manual = makeManualOnlyProviderMaintenanceCapabilities ( {
380390 provider : definition . provider ,
381391 packageName : definition . npmPackageName ,
392+ installPath : context . realCommandPath ,
382393 } ) ;
383- if ( ! context ) {
384- return manual ;
385- }
386394 const commandPaths = [ context . resolvedCommandPath , context . realCommandPath ] ;
387395 const packageName = definition . npmPackageName ;
388396
@@ -690,10 +698,20 @@ export const makeCachedProviderMaintenanceResolution = Effect.fn(
690698 options ?. fresh ? Cache . invalidate ( cache , undefined ) . pipe ( Effect . andThen ( cached ) ) : cached ;
691699} ) ;
692700
701+ /**
702+ * An install T3 Code cannot update gets no Update button or command, so its
703+ * message names the version and the executable instead.
704+ */
705+ function manualUpdateMessage ( latestVersion : string , installPath : string | undefined ) : string {
706+ return installPath
707+ ? `Version ${ latestVersion } is out. T3 Code runs ${ installPath } ; update it with the app or tool that installed it.`
708+ : `Version ${ latestVersion } is out. Update it with the app or tool that installed it.` ;
709+ }
710+
693711function deriveVersionAdvisory ( input : {
694712 readonly currentVersion : string | null ;
695713 readonly latestVersion : string | null ;
696- readonly compareVersions ?: ( current : string , latest : string ) => number ;
714+ readonly capabilities : ProviderMaintenanceCapabilities ;
697715} ) : Pick < ServerProviderVersionAdvisory , "status" | "message" > {
698716 if ( ! input . currentVersion ) {
699717 return { status : "unknown" , message : null } ;
@@ -702,11 +720,17 @@ function deriveVersionAdvisory(input: {
702720 return { status : "unknown" , message : null } ;
703721 }
704722 if (
705- ( input . compareVersions ?? compareSemverVersions ) ( input . currentVersion , input . latestVersion ) < 0
723+ ( input . capabilities . compareVersions ?? compareSemverVersions ) (
724+ input . currentVersion ,
725+ input . latestVersion ,
726+ ) < 0
706727 ) {
707728 return {
708729 status : "behind_latest" ,
709- message : PROVIDER_UPDATE_ACTION_TOAST_MESSAGE ,
730+ message :
731+ input . capabilities . update === null
732+ ? manualUpdateMessage ( input . latestVersion , input . capabilities . installPath )
733+ : PROVIDER_UPDATE_ACTION_TOAST_MESSAGE ,
710734 } ;
711735 }
712736 return { status : "current" , message : null } ;
@@ -725,7 +749,7 @@ export function createProviderVersionAdvisory(input: {
725749 const advisory = deriveVersionAdvisory ( {
726750 currentVersion : input . currentVersion ,
727751 latestVersion,
728- ... ( capabilities . compareVersions ? { compareVersions : capabilities . compareVersions } : { } ) ,
752+ capabilities,
729753 } ) ;
730754
731755 return {
0 commit comments