threenative-engine-mcp 0.2.15 → 0.2.16

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -12
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1002,21 +1002,21 @@ function searchMechanics(situation, manifest, scope) {
1002
1002
  const limit = scope === "request" ? MAX_COMPLETE_REQUEST_RESULTS : MAX_SITUATION_RESULTS;
1003
1003
  const { weights, nameWeights } = manifestWeights(manifest.entries);
1004
1004
  const notOwned = notOwnedMatch(manifest, query);
1005
- if (notOwned !== void 0 && isSpecificNotOwnedMatch(query, notOwned.matchedSituation)) {
1006
- return {
1007
- guidance: notOwned.entry.guidance,
1008
- results: [],
1009
- verdict: "none"
1010
- };
1005
+ const specific = notOwned !== void 0 && isSpecificNotOwnedMatch(query, notOwned.matchedSituation);
1006
+ const optionalPackage = specific ? `@threenative/${notOwned.entry.id}` : void 0;
1007
+ const candidates = optionalPackage === void 0 ? manifest.entries : manifest.entries.filter(
1008
+ (entry) => entry.importPath === optionalPackage || entry.importPath.startsWith(`${optionalPackage}/`)
1009
+ );
1010
+ if (specific && candidates.length === 0) {
1011
+ return { guidance: notOwned.entry.guidance, results: [], verdict: "none" };
1011
1012
  }
1012
- const results = manifest.entries.map((entry) => ({ entry, ...capabilityScore(query, entry, weights, nameWeights, situation) })).filter(
1013
- ({ matchedSituation, score }) => matchedSituation.length > 0 && score >= RELEVANCE_FLOOR
1014
- ).sort(
1013
+ const floor = optionalPackage === void 0 ? RELEVANCE_FLOOR : Number.MIN_VALUE;
1014
+ const results = candidates.map((entry) => ({ entry, ...capabilityScore(query, entry, weights, nameWeights, situation) })).filter(({ matchedSituation, score }) => matchedSituation.length > 0 && score >= floor).sort(
1015
1015
  (left, right) => right.score - left.score || right.specificity - left.specificity || `${left.entry.importPath}:${left.entry.symbol}`.localeCompare(
1016
1016
  `${right.entry.importPath}:${right.entry.symbol}`
1017
1017
  )
1018
1018
  ).filter(
1019
- (candidate, index, candidates) => candidates.findIndex(
1019
+ (candidate, index, candidates2) => candidates2.findIndex(
1020
1020
  (other) => capabilitySearchKey(other.entry) === capabilitySearchKey(candidate.entry)
1021
1021
  ) === index
1022
1022
  ).slice(0, limit).map(({ entry, matchedSituation, score }) => ({
@@ -1032,7 +1032,8 @@ function searchMechanics(situation, manifest, scope) {
1032
1032
  summary: entry.summary,
1033
1033
  symbol: entry.symbol
1034
1034
  }));
1035
- if (results.length > 0) return { guidance: "", results, verdict: "matched" };
1035
+ if (results.length > 0)
1036
+ return { guidance: specific ? notOwned.entry.guidance : "", results, verdict: "matched" };
1036
1037
  return {
1037
1038
  guidance: notOwned?.entry.guidance ?? GENERIC_GUIDANCE,
1038
1039
  results: [],
@@ -1385,7 +1386,7 @@ async function handleLine(line2, manifestFile) {
1385
1386
  capabilities: { tools: { listChanged: false } },
1386
1387
  instructions: AUTHORING_INSTRUCTIONS,
1387
1388
  protocolVersion: "2025-06-18",
1388
- serverInfo: { name: "threenative-engine-mcp", version: "0.2.15" }
1389
+ serverInfo: { name: "threenative-engine-mcp", version: "0.2.16" }
1389
1390
  });
1390
1391
  }
1391
1392
  if (request.method === "tools/list") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "threenative-engine-mcp",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "license": "MIT",
5
5
  "description": "Offline MCP capability discovery for ThreeNative authoring agents.",
6
6
  "keywords": [