@yawlabs/mcp 0.75.1 → 0.75.4
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 +40 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4817,7 +4817,7 @@ async function runUpgrade(opts = {}) {
|
|
|
4817
4817
|
return { exitCode: 3, lines };
|
|
4818
4818
|
}
|
|
4819
4819
|
function readCurrentVersion() {
|
|
4820
|
-
return true ? "0.75.
|
|
4820
|
+
return true ? "0.75.4" : "dev";
|
|
4821
4821
|
}
|
|
4822
4822
|
|
|
4823
4823
|
// src/learning.ts
|
|
@@ -5051,7 +5051,7 @@ function foldBundleWarnings(warnings, probe) {
|
|
|
5051
5051
|
const prefix = `${probe.path}:`;
|
|
5052
5052
|
return warnings.filter((w) => !w.startsWith(prefix));
|
|
5053
5053
|
}
|
|
5054
|
-
var VERSION = true ? "0.75.
|
|
5054
|
+
var VERSION = true ? "0.75.4" : "dev";
|
|
5055
5055
|
async function runDoctor(opts = {}) {
|
|
5056
5056
|
if (opts.json) return runDoctorJson(opts);
|
|
5057
5057
|
const lines = [];
|
|
@@ -8571,7 +8571,7 @@ function defaultSpawn2(cmd, args) {
|
|
|
8571
8571
|
async function maybeAutoUpgrade(deps = {}) {
|
|
8572
8572
|
const optOut = process.env.YAW_MCP_AUTO_UPGRADE;
|
|
8573
8573
|
if (optOut === "0" || optOut?.toLowerCase() === "false") return;
|
|
8574
|
-
const current = deps.currentVersion ?? (true ? "0.75.
|
|
8574
|
+
const current = deps.currentVersion ?? (true ? "0.75.4" : "dev");
|
|
8575
8575
|
if (current === "dev") return;
|
|
8576
8576
|
const method = (deps.isSeaImpl ? await deps.isSeaImpl() : await detectSea()) ? "binary" : detectInstallMethod(deps.argvPath ?? process.argv[1]);
|
|
8577
8577
|
const latest = await (deps.fetchLatestImpl ?? fetchLatestVersion)();
|
|
@@ -10915,7 +10915,7 @@ async function connectToUpstream(config, onDisconnect, onListChanged) {
|
|
|
10915
10915
|
}
|
|
10916
10916
|
async function connectToUpstreamOnce(config, onDisconnect, onListChanged, attempt, disableOamRewrite) {
|
|
10917
10917
|
const client = new Client(
|
|
10918
|
-
{ name: "yaw-mcp", version: true ? "0.75.
|
|
10918
|
+
{ name: "yaw-mcp", version: true ? "0.75.4" : "dev" },
|
|
10919
10919
|
{ capabilities: {} }
|
|
10920
10920
|
);
|
|
10921
10921
|
let transport;
|
|
@@ -11484,7 +11484,7 @@ var ConnectServer = class _ConnectServer {
|
|
|
11484
11484
|
static SHUTDOWN_DRAIN_MS = 2e3;
|
|
11485
11485
|
constructor() {
|
|
11486
11486
|
this.server = new Server(
|
|
11487
|
-
{ name: "yaw-mcp", version: true ? "0.75.
|
|
11487
|
+
{ name: "yaw-mcp", version: true ? "0.75.4" : "dev" },
|
|
11488
11488
|
{
|
|
11489
11489
|
capabilities: {
|
|
11490
11490
|
tools: { listChanged: true },
|
|
@@ -11591,10 +11591,17 @@ var ConnectServer = class _ConnectServer {
|
|
|
11591
11591
|
// Active servers, narrowed by the project profile if one is loaded.
|
|
11592
11592
|
// Centralizing this here means discover/dispatch/auto-warm all see the
|
|
11593
11593
|
// same set — no accidental bypass of the profile via a second code path.
|
|
11594
|
+
// The merge in mergeToolCache feeds the in-memory toolCache (hydrated
|
|
11595
|
+
// from state.json at startup, updated as servers activate) into each
|
|
11596
|
+
// server so callers like formatShadowLine can see learned tools.
|
|
11597
|
+
// bundles.json doesn't carry toolCache (validateEntry's fixed whitelist
|
|
11598
|
+
// drops it), and without this merge the tool-prefix heuristic in
|
|
11599
|
+
// resolveShadowedClis is inert on a real run — see the KNOWN_CLI_PREFIXES
|
|
11600
|
+
// comment in cli-shadows.ts.
|
|
11594
11601
|
getProfiledActiveServers() {
|
|
11595
11602
|
const all = (this.config?.servers ?? []).filter((s) => s.isActive);
|
|
11596
|
-
|
|
11597
|
-
return
|
|
11603
|
+
const profiled = this.profile ? all.filter((s) => profileAllows(this.profile, s.namespace)) : all;
|
|
11604
|
+
return profiled.map((server) => this.mergeToolCache(server));
|
|
11598
11605
|
}
|
|
11599
11606
|
// Configured-but-not-currently-connected servers that have a persisted
|
|
11600
11607
|
// toolCache. Fed into buildToolList/buildToolRoutes so the LLM can see
|
|
@@ -11607,13 +11614,34 @@ var ConnectServer = class _ConnectServer {
|
|
|
11607
11614
|
const out = [];
|
|
11608
11615
|
for (const server of this.getProfiledActiveServers()) {
|
|
11609
11616
|
if (this.connections.has(server.namespace)) continue;
|
|
11610
|
-
|
|
11611
|
-
|
|
11612
|
-
if (!cache || cache.length === 0) continue;
|
|
11613
|
-
out.push(cache === server.toolCache ? server : { ...server, toolCache: cache });
|
|
11617
|
+
if (!server.toolCache || server.toolCache.length === 0) continue;
|
|
11618
|
+
out.push(server);
|
|
11614
11619
|
}
|
|
11615
11620
|
return out;
|
|
11616
11621
|
}
|
|
11622
|
+
// Return `server` with its in-memory toolCache applied. The in-memory
|
|
11623
|
+
// entry (this.toolCache) wins over server.toolCache when both exist —
|
|
11624
|
+
// the persisted copy can be stale relative to a fresh activation, and
|
|
11625
|
+
// the in-memory map is what tools/list and formatShadowLine should
|
|
11626
|
+
// actually see.
|
|
11627
|
+
//
|
|
11628
|
+
// Identity preservation: when both sides resolve to the same array
|
|
11629
|
+
// reference — which in practice means BOTH are undefined (server.ts
|
|
11630
|
+
// has no toolCache and this.toolCache has no entry for this namespace)
|
|
11631
|
+
// — we return `server` unchanged. The `===` guard pins that, so
|
|
11632
|
+
// downstream consumers keyed on reference equality (the identity-
|
|
11633
|
+
// preservation tests in server.test.ts) keep working. In production,
|
|
11634
|
+
// server.toolCache is almost always undefined: bundles.json validation
|
|
11635
|
+
// drops the field (local-bundles.ts), and hydrateToolCache (below)
|
|
11636
|
+
// writes the persisted array into this.toolCache rather than back into
|
|
11637
|
+
// server.toolCache. So the commonly-fired path is the
|
|
11638
|
+
// "spread a clone" branch — the identity guard mostly catches the
|
|
11639
|
+
// dormant-namespace case.
|
|
11640
|
+
mergeToolCache(server) {
|
|
11641
|
+
const sessionCache = this.toolCache.get(server.namespace);
|
|
11642
|
+
const cache = sessionCache && sessionCache.length > 0 ? sessionCache : server.toolCache;
|
|
11643
|
+
return cache === server.toolCache ? server : { ...server, toolCache: cache };
|
|
11644
|
+
}
|
|
11617
11645
|
// Does this server's tool list already exist somewhere we trust — the
|
|
11618
11646
|
// toolCache shipped in bundles.json, or the one we learned in a previous
|
|
11619
11647
|
// session and hydrated from state.json? Gates pre-warm: a `false` here
|
|
@@ -13890,7 +13918,7 @@ if (subcommand === "compliance") {
|
|
|
13890
13918
|
`);
|
|
13891
13919
|
process.exitCode = 0;
|
|
13892
13920
|
} else if (subcommand === "--version" || subcommand === "-V") {
|
|
13893
|
-
process.stdout.write(`yaw-mcp ${true ? "0.75.
|
|
13921
|
+
process.stdout.write(`yaw-mcp ${true ? "0.75.4" : "dev"}
|
|
13894
13922
|
`);
|
|
13895
13923
|
process.exitCode = 0;
|
|
13896
13924
|
} else if (subcommand && !subcommand.startsWith("-")) {
|
package/package.json
CHANGED