@@ -42,16 +42,9 @@ export interface CatalogueEntry {
4242 // macOS-only fallback: when the CLI shim is missing, look for an app
4343 // bundle by name and launch it via `open -a "<name>"`. Lets us list
4444 // Xcode / Qoder / Antigravity / Warp / IntelliJ without forcing users
45- // to also install their CLI shim. `preferMacOpenBundle` flips it from
46- // fallback to first choice.
45+ // to also install their CLI shim.
4746 macOpenBundle ?: string | readonly string [ ] ;
4847 macOpenArgs ?: ( bundleName : string , resolvedDir : string ) => string [ ] ;
49- // On darwin, try `macOpenBundle` before the `$PATH` shim. For tools whose
50- // bare shim is not a deterministic entry point, the app bundle is: it goes
51- // through LaunchServices and lands on exactly one app. `command` stays as
52- // the fallback so the entry still reports available when the bundle is
53- // missing, and win32/linux resolution order is untouched.
54- preferMacOpenBundle ?: boolean ;
5548 platforms ?: RealPlatform [ ] ;
5649 excludedPlatforms ?: RealPlatform [ ] ;
5750}
@@ -65,18 +58,17 @@ export const CATALOGUE: ReadonlyArray<CatalogueEntry> = [
6558 { id : 'cursor' , label : 'Cursor' , icon : 'sparkles' , command : 'cursor' , macOpenBundle : 'Cursor' } ,
6659 { id : 'vscode' , label : 'VS Code' , icon : 'file-code' , command : 'code' , macOpenBundle : 'Visual Studio Code' } ,
6760 { id : 'windsurf' , label : 'Windsurf' , icon : 'sparkles' , command : 'windsurf' , macOpenBundle : 'Windsurf' } ,
68- // darwin-only: bare `kiro` is not a deterministic IDE entry point. Once the
69- // opt-in command router is installed (v1.26.0+) `kiro` routes to whatever
70- // the user set as their default, so `kiro set-default cli` would make this
71- // tile open the terminal agent — see "Kiro Command Router" in
61+ // darwin-only: bare `kiro` is not a deterministic IDE entry point. The
62+ // opt-in command router (v1.26.0+) makes `kiro` follow whatever the user set
63+ // as their default, so `kiro set-default cli` would point this editor tile at
64+ // the terminal agent — see "Kiro Command Router" in
7265 // https://kiro.dev/docs/cli/reference/cli-commands/. `kiro ide <dir>` is not
73- // the fix: with the router absent, `kiro` is a Code-OSS-style launcher that
74- // treats `ide` as a path and opens a spurious `ide` entry. darwin is
75- // deterministic because it resolves /Applications/Kiro.app first, which
76- // reaches the IDE through LaunchServices in every router state; `command`
77- // stays as the fallback when that bundle is missing. win32/linux stay
66+ // an alternative: with the router absent, `kiro` treats `ide` as a path and
67+ // opens a spurious `ide` entry. So this entry deliberately carries no
68+ // `command` shim — availability requires Kiro.app, which reaches the IDE
69+ // through LaunchServices in every router state. win32/linux stay
7870 // unadvertised until they have a verified deterministic launch path. (#6313)
79- { id : 'kiro' , label : 'Kiro' , icon : 'sparkles' , command : 'kiro' , macOpenBundle : 'Kiro' , preferMacOpenBundle : true , platforms : [ 'darwin' ] } ,
71+ { id : 'kiro' , label : 'Kiro' , icon : 'sparkles' , macOpenBundle : 'Kiro' , platforms : [ 'darwin' ] } ,
8072 { id : 'zed' , label : 'Zed' , icon : 'edit' , command : 'zed' , macOpenBundle : 'Zed' } ,
8173 { id : 'qoder' , label : 'Qoder' , icon : 'sparkles' , command : 'qoder' , macOpenBundle : [ 'Qoder' , 'QoderWork' ] } ,
8274 { id : 'antigravity' , label : 'Antigravity' , icon : 'orbit' , command : 'antigravity' , macOpenBundle : [ 'Antigravity' , 'Google Antigravity' ] } ,
@@ -180,47 +172,35 @@ async function probeMacBundle(name: string | readonly string[]): Promise<{ name:
180172 return null ;
181173}
182174
183- interface ResolvedEntry {
175+ async function resolveEntry ( entry : CatalogueEntry ) : Promise < {
184176 available : boolean ;
185177 resolvedPath ?: string ;
186178 launch ?: { command : string ; argsForDir : ( resolvedDir : string ) => string [ ] } ;
187- }
188-
189- async function resolveViaPathShim ( entry : CatalogueEntry ) : Promise < ResolvedEntry | null > {
190- if ( ! entry . command ) return null ;
191- const resolved = await probeCommandOnPath ( entry . command ) ;
192- if ( ! resolved ) return null ;
193- return {
194- available : true ,
195- resolvedPath : resolved ,
196- launch : { command : resolved , argsForDir : entry . commandArgs ?? ( ( resolvedDir ) => [ resolvedDir ] ) } ,
197- } ;
198- }
199-
200- async function resolveViaMacBundle ( entry : CatalogueEntry ) : Promise < ResolvedEntry | null > {
201- if ( ! entry . macOpenBundle || process . platform !== 'darwin' ) return null ;
202- const bundle = await probeMacBundle ( entry . macOpenBundle ) ;
203- if ( ! bundle ) return null ;
204- return {
205- available : true ,
206- resolvedPath : bundle . path ,
207- launch : {
208- command : await resolveMacOpenCommand ( ) ,
209- argsForDir : entry . macOpenArgs
210- ? ( ( resolvedDir ) => entry . macOpenArgs ?.( bundle . name , resolvedDir ) ?? [ '-a' , bundle . name , resolvedDir ] )
211- : ( ( resolvedDir ) => [ '-a' , bundle . name , resolvedDir ] ) ,
212- } ,
213- } ;
214- }
215-
216- async function resolveEntry ( entry : CatalogueEntry ) : Promise < ResolvedEntry > {
217- const order =
218- entry . preferMacOpenBundle === true && process . platform === 'darwin'
219- ? [ resolveViaMacBundle , resolveViaPathShim ]
220- : [ resolveViaPathShim , resolveViaMacBundle ] ;
221- for ( const resolve of order ) {
222- const resolved = await resolve ( entry ) ;
223- if ( resolved ) return resolved ;
179+ } > {
180+ if ( entry . command ) {
181+ const resolved = await probeCommandOnPath ( entry . command ) ;
182+ if ( resolved ) {
183+ return {
184+ available : true ,
185+ resolvedPath : resolved ,
186+ launch : { command : resolved , argsForDir : entry . commandArgs ?? ( ( resolvedDir ) => [ resolvedDir ] ) } ,
187+ } ;
188+ }
189+ }
190+ if ( entry . macOpenBundle && process . platform === 'darwin' ) {
191+ const bundle = await probeMacBundle ( entry . macOpenBundle ) ;
192+ if ( bundle ) {
193+ return {
194+ available : true ,
195+ resolvedPath : bundle . path ,
196+ launch : {
197+ command : await resolveMacOpenCommand ( ) ,
198+ argsForDir : entry . macOpenArgs
199+ ? ( ( resolvedDir ) => entry . macOpenArgs ?.( bundle . name , resolvedDir ) ?? [ '-a' , bundle . name , resolvedDir ] )
200+ : ( ( resolvedDir ) => [ '-a' , bundle . name , resolvedDir ] ) ,
201+ } ,
202+ } ;
203+ }
224204 }
225205 return { available : false } ;
226206}
0 commit comments