pi-cc-extensions 0.8.6 → 0.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -88,7 +88,7 @@ export function createAgentAutocompleteProvider(
|
|
|
88
88
|
const [baseSuggestions, matches] = await Promise.all([
|
|
89
89
|
current.getSuggestions(lines, cursorLine, cursorCol, options),
|
|
90
90
|
Promise.resolve(query.trim()
|
|
91
|
-
? fuzzyFilter(agents, query, (a) =>
|
|
91
|
+
? fuzzyFilter(agents, query, (a) => a.name)
|
|
92
92
|
: agents),
|
|
93
93
|
]);
|
|
94
94
|
if (options.signal.aborted) return null;
|
|
@@ -101,8 +101,10 @@ export function createAgentAutocompleteProvider(
|
|
|
101
101
|
description: agent.description
|
|
102
102
|
+ (agent.model ? ` · ${agent.model}` : ""),
|
|
103
103
|
}));
|
|
104
|
-
const
|
|
105
|
-
|
|
104
|
+
const hasCompatibleBaseSuggestions = baseSuggestions?.prefix === `@${query}`;
|
|
105
|
+
const agentValues = new Set(agents.map((agent) => `@${agent.name}`));
|
|
106
|
+
const baseItems = hasCompatibleBaseSuggestions
|
|
107
|
+
? baseSuggestions.items.filter((item) => !agentValues.has(item.value))
|
|
106
108
|
: [];
|
|
107
109
|
const seen = new Set<string>();
|
|
108
110
|
const items = [...agentItems, ...baseItems].filter((item) => {
|
|
@@ -112,7 +114,7 @@ export function createAgentAutocompleteProvider(
|
|
|
112
114
|
return true;
|
|
113
115
|
});
|
|
114
116
|
|
|
115
|
-
if (items.length === 0) return baseSuggestions;
|
|
117
|
+
if (items.length === 0 && !hasCompatibleBaseSuggestions) return baseSuggestions;
|
|
116
118
|
return { items, prefix: `@${query}` };
|
|
117
119
|
},
|
|
118
120
|
|