@e4779/pi-fabric 0.105.0-fork.18 → 0.105.0-fork.22
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/chunks/{chunk-6VXPACGC.js → chunk-EXWS4ZS3.js} +1 -1
- package/dist/extension-bootstrap.js +1 -1
- package/dist/fabric-runtime-state.js +29 -7
- package/dist/fabric-runtime-state.js.map +2 -2
- package/dist/index.js +1 -1
- package/dist/providers/pi-native-mcp.d.ts.map +1 -1
- package/package.json +1 -1
- /package/dist/chunks/{chunk-6VXPACGC.js.map → chunk-EXWS4ZS3.js.map} +0 -0
|
@@ -10235,7 +10235,11 @@ var PiNativeMcpTools = class {
|
|
|
10235
10235
|
return this.#tools(server).map((entry) => this.#descriptor(entry)).filter((entry) => !query || `${entry.name} ${entry.description}`.toLowerCase().includes(query));
|
|
10236
10236
|
}
|
|
10237
10237
|
serverInfo() {
|
|
10238
|
-
|
|
10238
|
+
let tools = this.#tools();
|
|
10239
|
+
const indexed = new Set(tools.map((tool) => tool.server));
|
|
10240
|
+
if (this.servers.some((name) => !indexed.has(name)) && this.#pollLiveRegistrations()) {
|
|
10241
|
+
tools = this.#tools();
|
|
10242
|
+
}
|
|
10239
10243
|
return this.servers.map((name) => {
|
|
10240
10244
|
const selected = tools.filter((tool) => tool.server === name);
|
|
10241
10245
|
return {
|
|
@@ -10248,17 +10252,35 @@ var PiNativeMcpTools = class {
|
|
|
10248
10252
|
});
|
|
10249
10253
|
}
|
|
10250
10254
|
#resolve(server, requested) {
|
|
10251
|
-
|
|
10252
|
-
|
|
10253
|
-
|
|
10254
|
-
|
|
10255
|
-
|
|
10256
|
-
|
|
10255
|
+
const attempt = () => {
|
|
10256
|
+
this.#refreshIndex();
|
|
10257
|
+
const visible = this.#visibility();
|
|
10258
|
+
const index = this.#indexes.get(server);
|
|
10259
|
+
if (index) this.#checkMetadata(index, visible);
|
|
10260
|
+
const candidates = index?.exact.get(requested) ?? index?.aliases.get(requested) ?? [];
|
|
10261
|
+
return candidates.filter((entry) => visible(entry.registered));
|
|
10262
|
+
};
|
|
10263
|
+
let matches = attempt();
|
|
10264
|
+
if (matches.length !== 1 && this.#pollLiveRegistrations()) matches = attempt();
|
|
10257
10265
|
if (matches.length !== 1) {
|
|
10258
10266
|
throw new Error(`Unknown or ambiguous Pi MCP tool: ${server}.${requested}. Check /mcp and the tool exposure; no mcporter fallback was attempted.`);
|
|
10259
10267
|
}
|
|
10260
10268
|
return matches[0];
|
|
10261
10269
|
}
|
|
10270
|
+
// Mirrors Pi's "waits for the servers it names" semantics inside the borrow
|
|
10271
|
+
// layer: never polls on a timer, only once per failed lookup, and reports
|
|
10272
|
+
// change only when the capture catalog actually moved.
|
|
10273
|
+
#pollLiveRegistrations() {
|
|
10274
|
+
const runner = this.catalog.runner;
|
|
10275
|
+
if (typeof runner?.getAllRegisteredTools !== "function") return false;
|
|
10276
|
+
const before = this.catalog.registeredTools();
|
|
10277
|
+
try {
|
|
10278
|
+
runner.getAllRegisteredTools();
|
|
10279
|
+
} catch {
|
|
10280
|
+
return false;
|
|
10281
|
+
}
|
|
10282
|
+
return this.catalog.registeredTools() !== before;
|
|
10283
|
+
}
|
|
10262
10284
|
describe(server, tool) {
|
|
10263
10285
|
return this.#descriptor(this.#resolve(server, tool));
|
|
10264
10286
|
}
|