@@ -18,6 +18,7 @@ import { geminiAdapter } from '../../../src/core/command-generation/adapters/gem
1818import { githubCopilotAdapter } from '../../../src/core/command-generation/adapters/github-copilot.js' ;
1919import { iflowAdapter } from '../../../src/core/command-generation/adapters/iflow.js' ;
2020import { kilocodeAdapter } from '../../../src/core/command-generation/adapters/kilocode.js' ;
21+ import { ohMyPiAdapter } from '../../../src/core/command-generation/adapters/oh-my-pi.js' ;
2122import { opencodeAdapter } from '../../../src/core/command-generation/adapters/opencode.js' ;
2223import { piAdapter } from '../../../src/core/command-generation/adapters/pi.js' ;
2324import { qoderAdapter } from '../../../src/core/command-generation/adapters/qoder.js' ;
@@ -653,6 +654,56 @@ describe('command-generation/adapters', () => {
653654 expect ( output ) . toContain ( 'description: "Line 1\\nLine 2"' ) ;
654655 } ) ;
655656 } ) ;
657+ describe ( 'ohMyPiAdapter' , ( ) => {
658+ it ( 'should have correct toolId' , ( ) => {
659+ expect ( ohMyPiAdapter . toolId ) . toBe ( 'oh-my-pi' ) ;
660+ } ) ;
661+
662+ it ( 'should generate correct file path' , ( ) => {
663+ const filePath = ohMyPiAdapter . getFilePath ( 'explore' ) ;
664+ expect ( filePath ) . toBe ( path . join ( '.omp' , 'commands' , 'opsx-explore.md' ) ) ;
665+ } ) ;
666+
667+ it ( 'should generate correct file paths for different commands' , ( ) => {
668+ expect ( ohMyPiAdapter . getFilePath ( 'new' ) ) . toBe ( path . join ( '.omp' , 'commands' , 'opsx-new.md' ) ) ;
669+ expect ( ohMyPiAdapter . getFilePath ( 'bulk-archive' ) ) . toBe ( path . join ( '.omp' , 'commands' , 'opsx-bulk-archive.md' ) ) ;
670+ } ) ;
671+
672+ it ( 'should format file with description frontmatter' , ( ) => {
673+ const output = ohMyPiAdapter . formatFile ( sampleContent ) ;
674+ expect ( output ) . toContain ( '---\n' ) ;
675+ expect ( output ) . toContain ( 'description: Enter explore mode for thinking' ) ;
676+ expect ( output ) . toContain ( '---\n\n' ) ;
677+ expect ( output ) . toContain ( 'This is the command body.' ) ;
678+ } ) ;
679+
680+ it ( 'should transform command references from colon to hyphen format' , ( ) => {
681+ const contentWithRefs : CommandContent = {
682+ ...sampleContent ,
683+ body : 'Run /opsx:apply to implement. Then /opsx:archive when done.' ,
684+ } ;
685+
686+ const output = ohMyPiAdapter . formatFile ( contentWithRefs ) ;
687+ expect ( output ) . toContain ( '/opsx-apply' ) ;
688+ expect ( output ) . toContain ( '/opsx-archive' ) ;
689+ expect ( output ) . not . toContain ( '/opsx:apply' ) ;
690+ } ) ;
691+
692+ it ( 'should handle multiple command references in body' , ( ) => {
693+ const contentWithMultipleCommands : CommandContent = {
694+ ...sampleContent ,
695+ body : `/opsx:explore for ideas
696+ /opsx:new to create
697+ /opsx:continue to proceed
698+ /opsx:apply to implement` ,
699+ } ;
700+ const output = ohMyPiAdapter . formatFile ( contentWithMultipleCommands ) ;
701+ expect ( output ) . toContain ( '/opsx-explore' ) ;
702+ expect ( output ) . toContain ( '/opsx-new' ) ;
703+ expect ( output ) . toContain ( '/opsx-continue' ) ;
704+ expect ( output ) . toContain ( '/opsx-apply' ) ;
705+ } ) ;
706+ } ) ;
656707
657708 describe ( 'roocodeAdapter' , ( ) => {
658709 it ( 'should have correct toolId' , ( ) => {
@@ -697,7 +748,7 @@ describe('command-generation/adapters', () => {
697748 amazonQAdapter , antigravityAdapter , auggieAdapter , bobAdapter , clineAdapter ,
698749 codexAdapter , codebuddyAdapter , continueAdapter , costrictAdapter ,
699750 crushAdapter , factoryAdapter , geminiAdapter , githubCopilotAdapter ,
700- iflowAdapter , kilocodeAdapter , opencodeAdapter , piAdapter , qoderAdapter ,
751+ iflowAdapter , kilocodeAdapter , ohMyPiAdapter , opencodeAdapter , piAdapter , qoderAdapter ,
701752 qwenAdapter , roocodeAdapter
702753 ] ;
703754 for ( const adapter of adapters ) {
0 commit comments