disable custom content installation temporarily

This commit is contained in:
Brian Madison 2025-12-10 19:11:18 +09:00
parent a2d01813f0
commit 45a97b070a
1 changed files with 101 additions and 96 deletions

View File

@ -810,103 +810,108 @@ class UI {
*/ */
async promptCustomContentLocation() { async promptCustomContentLocation() {
try { try {
CLIUtils.displaySection('Custom Content', 'Optional: Add custom agents, workflows, and modules'); // Skip custom content installation - always return false
const { hasCustomContent } = await inquirer.prompt([
{
type: 'list',
name: 'hasCustomContent',
message: 'Do you have custom content to install?',
choices: [
{ name: 'No (skip custom content)', value: 'none' },
{ name: 'Enter a directory path', value: 'directory' },
{ name: 'Enter a URL', value: 'url' },
],
default: 'none',
},
]);
if (hasCustomContent === 'none') {
return { hasCustomContent: false }; return { hasCustomContent: false };
}
if (hasCustomContent === 'url') { // TODO: Custom content installation temporarily disabled
console.log(chalk.yellow('\nURL-based custom content installation is coming soon!')); // CLIUtils.displaySection('Custom Content', 'Optional: Add custom agents, workflows, and modules');
console.log(chalk.cyan('For now, please download your custom content and choose "Enter a directory path".\n'));
return { hasCustomContent: false };
}
if (hasCustomContent === 'directory') { // const { hasCustomContent } = await inquirer.prompt([
let customPath; // {
while (!customPath) { // type: 'list',
let expandedPath; // name: 'hasCustomContent',
const { directory } = await inquirer.prompt([ // message: 'Do you have custom content to install?',
{ // choices: [
type: 'input', // { name: 'No (skip custom content)', value: 'none' },
name: 'directory', // { name: 'Enter a directory path', value: 'directory' },
message: 'Enter directory to search for custom content (will scan subfolders):', // { name: 'Enter a URL', value: 'url' },
default: process.cwd(), // Use actual current working directory // ],
validate: async (input) => { // default: 'none',
if (!input || input.trim() === '') { // },
return 'Please enter a directory path'; // ]);
}
try { // if (hasCustomContent === 'none') {
expandedPath = this.expandUserPath(input.trim()); // return { hasCustomContent: false };
} catch (error) { // }
return error.message;
}
// Check if the path exists // TODO: Custom content installation temporarily disabled
const pathExists = await fs.pathExists(expandedPath); // if (hasCustomContent === 'url') {
if (!pathExists) { // console.log(chalk.yellow('\nURL-based custom content installation is coming soon!'));
return 'Directory does not exist'; // console.log(chalk.cyan('For now, please download your custom content and choose "Enter a directory path".\n'));
} // return { hasCustomContent: false };
// }
return true; // if (hasCustomContent === 'directory') {
}, // let customPath;
}, // while (!customPath) {
]); // let expandedPath;
// const { directory } = await inquirer.prompt([
// {
// type: 'input',
// name: 'directory',
// message: 'Enter directory to search for custom content (will scan subfolders):',
// default: process.cwd(), // Use actual current working directory
// validate: async (input) => {
// if (!input || input.trim() === '') {
// return 'Please enter a directory path';
// }
// Now expand the path for use after the prompt // try {
expandedPath = this.expandUserPath(directory.trim()); // expandedPath = this.expandUserPath(input.trim());
// } catch (error) {
// return error.message;
// }
// Check if directory has custom content // // Check if the path exists
const customHandler = new CustomHandler(); // const pathExists = await fs.pathExists(expandedPath);
const customFiles = await customHandler.findCustomContent(expandedPath); // if (!pathExists) {
// return 'Directory does not exist';
// }
if (customFiles.length === 0) { // return true;
console.log(chalk.yellow(`\nNo custom content found in ${expandedPath}`)); // },
// },
// ]);
const { tryAgain } = await inquirer.prompt([ // // Now expand the path for use after the prompt
{ // expandedPath = this.expandUserPath(directory.trim());
type: 'confirm',
name: 'tryAgain',
message: 'Try a different directory?',
default: true,
},
]);
if (tryAgain) { // // Check if directory has custom content
continue; // const customHandler = new CustomHandler();
} else { // const customFiles = await customHandler.findCustomContent(expandedPath);
return { hasCustomContent: false };
}
}
customPath = expandedPath; // if (customFiles.length === 0) {
console.log(chalk.green(`\n✓ Found ${customFiles.length} custom content item(s):`)); // console.log(chalk.yellow(`\nNo custom content found in ${expandedPath}`));
for (const file of customFiles) {
const relativePath = path.relative(expandedPath, path.dirname(file));
const folderName = path.dirname(file).split(path.sep).pop();
console.log(chalk.dim(`${folderName} ${chalk.gray(`(${relativePath})`)}`));
}
}
return { hasCustomContent: true, customPath }; // const { tryAgain } = await inquirer.prompt([
} // {
// type: 'confirm',
// name: 'tryAgain',
// message: 'Try a different directory?',
// default: true,
// },
// ]);
return { hasCustomContent: false }; // if (tryAgain) {
// continue;
// } else {
// return { hasCustomContent: false };
// }
// }
// customPath = expandedPath;
// console.log(chalk.green(`\n✓ Found ${customFiles.length} custom content item(s):`));
// for (const file of customFiles) {
// const relativePath = path.relative(expandedPath, path.dirname(file));
// const folderName = path.dirname(file).split(path.sep).pop();
// console.log(chalk.dim(` • ${folderName} ${chalk.gray(`(${relativePath})`)}`));
// }
// }
// return { hasCustomContent: true, customPath };
// }
// return { hasCustomContent: false };
} catch (error) { } catch (error) {
console.error(chalk.red('Error in custom content prompt:'), error); console.error(chalk.red('Error in custom content prompt:'), error);
return { hasCustomContent: false }; return { hasCustomContent: false };