mio-agent-runtime 0.5.13 → 0.5.14
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.
package/package.json
CHANGED
|
@@ -1674,8 +1674,17 @@ function handleIdeaGenerate(args = {}) {
|
|
|
1674
1674
|
.filter(r => r.archived !== true)
|
|
1675
1675
|
.filter(r => {
|
|
1676
1676
|
const text = (r.content || '').toLowerCase()
|
|
1677
|
-
const
|
|
1678
|
-
|
|
1677
|
+
const goalLower = goal.toLowerCase()
|
|
1678
|
+
// Support both space-separated (English) and continuous (Chinese) matching
|
|
1679
|
+
const goalWords = goalLower.split(/\s+/).filter(w => w.length > 2)
|
|
1680
|
+
// For Chinese: extract 2-char n-grams as search tokens
|
|
1681
|
+
const ngrams = []
|
|
1682
|
+
for (let i = 0; i < goalLower.length - 1; i++) {
|
|
1683
|
+
const ng = goalLower.slice(i, i + 2)
|
|
1684
|
+
if (ng.trim().length === 2) ngrams.push(ng)
|
|
1685
|
+
}
|
|
1686
|
+
const allTokens = [...new Set([...goalWords, ...ngrams])]
|
|
1687
|
+
return allTokens.some(t => text.includes(t))
|
|
1679
1688
|
})
|
|
1680
1689
|
.slice(0, 8)
|
|
1681
1690
|
|