11import * as vscode from 'vscode' ;
22import * as path from 'path' ;
3- import * as os from 'os' ;
43import { ConfigManager } from './configManager' ;
54import { StatusBarManager , SyncStatus } from './statusBarManager' ;
65import { Logger } from './utils/logger' ;
@@ -811,7 +810,7 @@ export class SyncManager {
811810 this . logger . debug ( `Attempting to create symlink...` ) ;
812811 // On Windows, use 'file' type; on Unix, type parameter is optional but 'file' works
813812 await fs . symlink ( sourcePath , targetPath , 'file' ) ;
814- this . logger . info ( `✅ Created symlink: ${ sourcePath } -> ${ targetPath } ` ) ;
813+ this . logger . debug ( `✅ Created symlink: ${ sourcePath } -> ${ targetPath } ` ) ;
815814 } catch ( symlinkError : any ) {
816815 this . logger . debug ( `Symlink creation failed with code: ${ symlinkError ?. code } ` ) ;
817816 // Symlink creation failed (likely Windows without admin/dev mode)
@@ -855,11 +854,11 @@ export class SyncManager {
855854
856855 if ( stats . isSymbolicLink ( ) ) {
857856 await vscode . workspace . fs . delete ( vscode . Uri . file ( targetPath ) ) ;
858- this . logger . info ( `✅ Removed symlink: ${ targetPath } ` ) ;
857+ this . logger . debug ( `✅ Removed symlink: ${ targetPath } ` ) ;
859858 } else if ( process . platform === 'win32' ) {
860859 // On Windows, we may have copied files instead of symlinks
861860 await vscode . workspace . fs . delete ( vscode . Uri . file ( targetPath ) ) ;
862- this . logger . info ( `✅ Removed file copy (Windows fallback): ${ targetPath } ` ) ;
861+ this . logger . debug ( `✅ Removed file copy (Windows fallback): ${ targetPath } ` ) ;
863862 } else {
864863 this . logger . warn ( `File exists but is not a symlink: ${ targetPath } ` ) ;
865864 }
@@ -972,7 +971,7 @@ export class SyncManager {
972971 await fs . unlink ( fullPath ) ;
973972 await this . createPromptSymlink ( newSourcePath , fullPath ) ;
974973 fixedCount ++ ;
975- this . logger . info ( `Fixed broken symlink: ${ entry . name } ` ) ;
974+ this . logger . debug ( `Fixed broken symlink: ${ entry . name } ` ) ;
976975 } else {
977976 this . logger . warn ( `Cannot fix broken symlink ${ entry . name } : source file not found at ${ newSourcePath } ` ) ;
978977 }
@@ -1079,13 +1078,13 @@ export class SyncManager {
10791078
10801079 try {
10811080 const repoPath = this . getRepositoryPath ( repositoryUrl ) ;
1082- this . logger . info ( `Repository storage path: ${ repoPath } ` ) ;
1081+ this . logger . debug ( `Repository storage path: ${ repoPath } ` ) ;
10831082
10841083 const sourcePath = this . fileSystem . joinPath ( repoPath , promptPath ) ;
1085- this . logger . info ( `Source file path: ${ sourcePath } ` ) ;
1084+ this . logger . debug ( `Source file path: ${ sourcePath } ` ) ;
10861085
10871086 const sourceExists = await this . fileSystem . fileExists ( sourcePath ) ;
1088- this . logger . info ( `Source file exists: ${ sourceExists } ` ) ;
1087+ this . logger . debug ( `Source file exists: ${ sourceExists } ` ) ;
10891088
10901089 if ( ! sourceExists ) {
10911090 const errorMsg = `Source file does not exist: ${ sourcePath } ` ;
@@ -1095,13 +1094,13 @@ export class SyncManager {
10951094
10961095 // Generate unique workspace name if there are conflicts
10971096 const workspaceName = await this . getUniqueWorkspaceName ( promptPath , repositoryUrl ) ;
1098- this . logger . info ( `Workspace name: ${ workspaceName } ` ) ;
1097+ this . logger . debug ( `Workspace name: ${ workspaceName } ` ) ;
10991098
11001099 // Create target path directly in User/prompts/ (no subdirectories)
11011100 const promptsDir = this . config . getPromptsDirectory ( ) ;
1102- this . logger . info ( `Prompts directory: ${ promptsDir } ` ) ;
1101+ this . logger . debug ( `Prompts directory: ${ promptsDir } ` ) ;
11031102 const targetPath = this . fileSystem . joinPath ( promptsDir , workspaceName ) ;
1104- this . logger . info ( `Target path: ${ targetPath } ` ) ;
1103+ this . logger . debug ( `Target path: ${ targetPath } ` ) ;
11051104
11061105 await this . createPromptSymlink ( sourcePath , targetPath ) ;
11071106 this . logger . info ( `✅ Successfully activated prompt: ${ promptPath } as ${ workspaceName } ` ) ;
@@ -1120,24 +1119,6 @@ export class SyncManager {
11201119 }
11211120 }
11221121
1123- /**
1124- * Determine prompt type from filename
1125- */
1126- private determinePromptType ( fileName : string ) : 'agents' | 'instructions' | 'prompts' {
1127- const lowerName = fileName . toLowerCase ( ) ;
1128-
1129- // Support both 'agents' and legacy 'chatmode' naming
1130- if ( lowerName . includes ( 'agent' ) || lowerName . includes ( 'chatmode' ) || lowerName . includes ( 'chat-mode' ) ) {
1131- return 'agents' ;
1132- }
1133-
1134- if ( lowerName . includes ( 'instruction' ) || lowerName . includes ( 'guide' ) ) {
1135- return 'instructions' ;
1136- }
1137-
1138- return 'prompts' ;
1139- }
1140-
11411122 /**
11421123 * Deactivate a prompt by removing its symlink
11431124 * @param promptPath The workspace filename (may include repository identifier)
@@ -1154,7 +1135,9 @@ export class SyncManager {
11541135 this . logger . error ( `Failed to deactivate prompt: ${ promptPath } ` , error instanceof Error ? error : undefined ) ;
11551136 throw error ;
11561137 }
1157- } /**
1138+ }
1139+
1140+ /**
11581141 * Clean up orphaned regular files in prompts directory that should be symlinks
11591142 * Regular files that exist in repository storage should be removed from workspace
11601143 */
@@ -1211,7 +1194,10 @@ export class SyncManager {
12111194 // On Windows, check if this is actually an active prompt (even if not a symlink)
12121195 if ( process . platform === 'win32' && this . treeProvider ) {
12131196 const allPrompts = this . treeProvider . getAllPrompts ( ) ;
1214- const isActive = allPrompts . some ( p => p . name === entry . name && p . active ) ;
1197+ // Check both p.name and p.workspaceName to handle disambiguated files (e.g., prompt@org-repo.md)
1198+ const isActive = allPrompts . some ( p =>
1199+ ( p . name === entry . name || p . workspaceName === entry . name ) && p . active
1200+ ) ;
12151201 if ( isActive ) {
12161202 this . logger . debug ( `Keeping active Windows file copy: ${ entry . name } ` ) ;
12171203 continue ;
0 commit comments