@elisym/mcp 0.15.8 → 0.15.9
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/dist/index.js +16 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2257,7 +2257,8 @@ function paymentCardForCapability(provider, dTag) {
|
|
|
2257
2257
|
const candidates = dTag ? cards.filter(
|
|
2258
2258
|
(card) => toDTag(card.name) === dTag || card.capabilities?.some((capability) => toDTag(capability) === dTag)
|
|
2259
2259
|
) : cards;
|
|
2260
|
-
|
|
2260
|
+
const pool = dTag !== void 0 ? candidates : cards;
|
|
2261
|
+
for (const card of pool) {
|
|
2261
2262
|
if (card.payment?.chain === "solana" && card.payment?.address) {
|
|
2262
2263
|
return card;
|
|
2263
2264
|
}
|
|
@@ -3527,6 +3528,7 @@ async function removeContact(agentDir, pubkey) {
|
|
|
3527
3528
|
|
|
3528
3529
|
// src/tools/discovery.ts
|
|
3529
3530
|
var SEARCH_PING_TIMEOUT_MS = 3e3;
|
|
3531
|
+
var MAX_SEARCH_CANDIDATES = 100;
|
|
3530
3532
|
var STOP_WORDS = /* @__PURE__ */ new Set([
|
|
3531
3533
|
"a",
|
|
3532
3534
|
"an",
|
|
@@ -3657,7 +3659,7 @@ var STOP_WORDS = /* @__PURE__ */ new Set([
|
|
|
3657
3659
|
"provides"
|
|
3658
3660
|
]);
|
|
3659
3661
|
var SearchAgentsSchema = z.object({
|
|
3660
|
-
capabilities: z.array(z.string()).min(1).describe("OR-matched substring filter on agent names, descriptions, and capability tags."),
|
|
3662
|
+
capabilities: z.array(z.string().min(1)).min(1).describe("OR-matched substring filter on agent names, descriptions, and capability tags."),
|
|
3661
3663
|
query: z.string().optional().describe("Optional secondary scoring for re-ranking. Omit when you have precise tokens."),
|
|
3662
3664
|
max_price_lamports: z.number().int().optional(),
|
|
3663
3665
|
include_offline: z.boolean().default(false).describe(
|
|
@@ -3715,6 +3717,11 @@ var discoveryTools = [
|
|
|
3715
3717
|
)
|
|
3716
3718
|
);
|
|
3717
3719
|
}
|
|
3720
|
+
const matchedCount = filtered.length;
|
|
3721
|
+
const truncated = matchedCount > MAX_SEARCH_CANDIDATES;
|
|
3722
|
+
if (truncated) {
|
|
3723
|
+
filtered = filtered.slice(0, MAX_SEARCH_CANDIDATES);
|
|
3724
|
+
}
|
|
3718
3725
|
if (!include_offline && filtered.length > 0) {
|
|
3719
3726
|
const probes = await Promise.allSettled(
|
|
3720
3727
|
filtered.map(
|
|
@@ -3834,6 +3841,13 @@ var discoveryTools = [
|
|
|
3834
3841
|
};
|
|
3835
3842
|
});
|
|
3836
3843
|
const { text } = sanitizeUntrusted(JSON.stringify(results, null, 2), "structured");
|
|
3844
|
+
if (truncated) {
|
|
3845
|
+
return textResult(
|
|
3846
|
+
`Matched ${matchedCount} agents; only the first ${MAX_SEARCH_CANDIDATES} were probed for availability (online-ping cap). Use more specific \`capabilities\` tokens for full coverage.
|
|
3847
|
+
|
|
3848
|
+
` + text
|
|
3849
|
+
);
|
|
3850
|
+
}
|
|
3837
3851
|
return textResult(text);
|
|
3838
3852
|
}
|
|
3839
3853
|
}),
|