@@ -23,6 +23,7 @@ import {
2323import type { KeyEvent } from "@opentui/core" ;
2424
2525import { focusOwner } from "./focus/index.js" ;
26+ import { BUNDLED_PLUGIN_MARKER as BUNDLED_MARKER } from "../plugins/origin-marker.js" ;
2627import { withTestRenderer , type Harness } from "./harness" ;
2728import { projectPluginsRoot , userPluginsRoot } from "../plugins/uninstall.js" ;
2829import { createAppShell } from "./shell/index" ;
@@ -109,7 +110,7 @@ describe("surface labels", () => {
109110 credentialValues : { } ,
110111 origin : "project" ,
111112 } ;
112- expect ( pluginRowLabel ( entry ) ) . toBe ( "linear — untrusted" ) ;
113+ expect ( pluginRowLabel ( entry ) ) . toBe ( "linear — untrusted [project] " ) ;
113114 expect (
114115 pluginRowLabel ( {
115116 id : "b" ,
@@ -119,7 +120,7 @@ describe("surface labels", () => {
119120 credentialValues : { } ,
120121 origin : "user" ,
121122 } ) ,
122- ) . toBe ( "exa — enabled" ) ;
123+ ) . toBe ( "exa — enabled [user] " ) ;
123124 } ) ;
124125
125126 test ( "mcp label reports disabled without a tool count" , ( ) => {
@@ -141,7 +142,24 @@ describe("surface labels", () => {
141142 'agent a: skill "style" referenced but not found in skill search path' ,
142143 ] ,
143144 } ) ,
144- ) . toBe ( "agents — enabled — has warnings" ) ;
145+ ) . toBe ( "agents — enabled — has warnings [user]" ) ;
146+ } ) ;
147+
148+ test ( "plugin label marks bundled and non-bundled origins differently" , ( ) => {
149+ const entry = ( origin : PluginEntry [ "origin" ] , name = "repo-plugin" ) =>
150+ pluginRowLabel ( {
151+ id : name ,
152+ name,
153+ enabled : true ,
154+ credentials : [ ] ,
155+ credentialValues : { } ,
156+ origin,
157+ } ) ;
158+ expect ( entry ( "repo" ) ) . toBe ( `repo-plugin — enabled ${ BUNDLED_MARKER } ` ) ;
159+ expect ( entry ( "user" , "market-plugin" ) ) . toBe (
160+ "market-plugin — enabled [user]" ,
161+ ) ;
162+ expect ( entry ( "path" , "local-plugin" ) ) . toBe ( "local-plugin — enabled [path]" ) ;
145163 } ) ;
146164} ) ;
147165
@@ -413,6 +431,39 @@ describe("plugins surface", () => {
413431 expect ( shell . overlayItems [ 0 ] ) . toBe ( "linear — enabled" ) ;
414432 } ) ;
415433 } ) ;
434+
435+ test ( "marks bundled rows with the mountain and other origins by label" , async ( ) => {
436+ await withShell ( async ( shell ) => {
437+ const deps : CommandSurfaceDeps = {
438+ notify : ( ) => undefined ,
439+ plugins : {
440+ list : ( ) => [
441+ {
442+ id : "bundled" ,
443+ name : "bundled" ,
444+ enabled : true ,
445+ credentials : [ ] ,
446+ credentialValues : { } ,
447+ origin : "repo" ,
448+ } ,
449+ {
450+ id : "market" ,
451+ name : "market" ,
452+ enabled : true ,
453+ credentials : [ ] ,
454+ credentialValues : { } ,
455+ origin : "user" ,
456+ } ,
457+ ] ,
458+ } as unknown as PluginsSurfaceDeps ,
459+ } ;
460+ openCommandSurface ( shell , "plugins" , deps ) ;
461+ expect ( shell . overlayItems . slice ( 0 , 2 ) ) . toEqual ( [
462+ `bundled — enabled ${ BUNDLED_MARKER } ` ,
463+ "market — enabled [user]" ,
464+ ] ) ;
465+ } ) ;
466+ } ) ;
416467} ) ;
417468
418469function key ( name : string ) : KeyEvent {
0 commit comments