@webjsdev/mcp 0.1.6 → 0.1.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.
- package/package.json +1 -1
- package/resources/AGENTS.md +94 -13
- package/resources/agent-docs/advanced.md +97 -14
- package/resources/agent-docs/built-ins.md +17 -7
- package/resources/agent-docs/components-shadowing.md +87 -0
- package/resources/agent-docs/components.md +35 -13
- package/resources/agent-docs/configuration.md +1 -1
- package/resources/agent-docs/framework-dev.md +8 -0
- package/resources/agent-docs/orm.md +198 -0
- package/resources/agent-docs/recipes.md +136 -0
- package/resources/agent-docs/runtime.md +1 -1
- package/resources/agent-docs/service-worker.md +5 -1
- package/resources/agent-docs/testing.md +47 -6
- package/resources/agent-docs/types-and-mutations.md +171 -0
- package/src/mcp-source.js +11 -1
package/src/mcp-source.js
CHANGED
|
@@ -153,6 +153,13 @@ export function listSources(deps, pkgFilter) {
|
|
|
153
153
|
export async function grepSources(deps, query) {
|
|
154
154
|
const q = String(query).toLowerCase();
|
|
155
155
|
if (!q) return 'Provide a non-empty `query`.';
|
|
156
|
+
// No resolvable packages means NOTHING was searched. Returning "no matches"
|
|
157
|
+
// here would read as authoritative absence when the search never ran, which
|
|
158
|
+
// is the #837 dogfood failure: an odd/shimmed node_modules layout resolved
|
|
159
|
+
// zero roots, so a real symbol looked missing and the agent lost trust.
|
|
160
|
+
if (!deps.roots.length) {
|
|
161
|
+
return 'No @webjsdev/* source is resolvable here, so NOTHING was searched (run inside a webjs app or the monorepo). This is not the same as "not found".';
|
|
162
|
+
}
|
|
156
163
|
/** @type {string[]} */
|
|
157
164
|
const hits = [];
|
|
158
165
|
let capped = false;
|
|
@@ -170,7 +177,10 @@ export async function grepSources(deps, query) {
|
|
|
170
177
|
}
|
|
171
178
|
}
|
|
172
179
|
}
|
|
173
|
-
|
|
180
|
+
// Disclose the SEARCHED scope on a no-match, so "no matches" reads as a
|
|
181
|
+
// comprehensive-search result the agent can trust, not a silent gap (#837).
|
|
182
|
+
const searched = deps.roots.map((r) => r.pkg).join(', ');
|
|
183
|
+
if (!hits.length) return `No matches for "${query}" in the searched @webjsdev/* source (${searched}).`;
|
|
174
184
|
if (capped) hits.push(`... (truncated at ${MAX_HITS} matches; narrow the query or read a file with \`path\`)`);
|
|
175
185
|
return hits.join('\n');
|
|
176
186
|
}
|