feat(prompt): expand wildcards at runtime (#895)

This commit is contained in:
Will Miao
2026-04-15 20:42:27 +08:00
parent 6d0d9600a7
commit 62247bdd87
15 changed files with 831 additions and 31 deletions

View File

@@ -0,0 +1,20 @@
export const WILDCARD_COMMANDS = {
'/wild': { type: 'wildcard', label: 'Wildcards' },
'/wildcard': { type: 'wildcard', label: 'Wildcards' },
};
export function isWildcardCommand(command) {
return command?.type === 'wildcard';
}
export function getWildcardSearchEndpoint() {
return '/lm/wildcards/search';
}
export function getWildcardInsertText(relativePath = '') {
const trimmed = typeof relativePath === 'string' ? relativePath.trim() : '';
if (!trimmed) {
return '';
}
return `__${trimmed}__`;
}