fix: ulw keyword word boundary and skill_mcp parseArguments object handling

- Add word boundary to ulw/ultrawork regex to prevent false matches on substrings like 'StatefulWidget' (fixes #779)
- Handle object type in parseArguments to prevent [object Object] JSON parse error (fixes #747)
- Add test cases for word boundary behavior
This commit is contained in:
popododo0720
2026-01-14 21:36:32 +09:00
parent c009e29612
commit 4b524b072b
3 changed files with 103 additions and 2 deletions
+7 -1
View File
@@ -69,8 +69,14 @@ function formatAvailableMcps(skills: LoadedSkill[]): string {
return mcps.length > 0 ? mcps.join("\n") : " (none found)"
}
function parseArguments(argsJson: string | undefined): Record<string, unknown> {
function parseArguments(argsJson: string | Record<string, unknown> | undefined): Record<string, unknown> {
if (!argsJson) return {}
// Handle case when argsJson is already an object (from tool calling pipeline)
if (typeof argsJson === "object" && argsJson !== null) {
return argsJson
}
try {
const parsed = JSON.parse(argsJson)
if (typeof parsed !== "object" || parsed === null) {