@prefecthq/fastmcp-ts 1.1.0 → 1.2.0
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/cli/index.cjs +46 -19
- package/dist/cli/index.cjs.map +1 -1
- package/dist/client.d.ts +123 -111
- package/dist/client.js +36 -16
- package/dist/client.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.cjs
CHANGED
|
@@ -1172,7 +1172,7 @@ var init_version = __esm({
|
|
|
1172
1172
|
async run({ args }) {
|
|
1173
1173
|
if (args.json) setJsonMode(true);
|
|
1174
1174
|
const data = {
|
|
1175
|
-
fastmcp: "1.
|
|
1175
|
+
fastmcp: "1.2.0",
|
|
1176
1176
|
"mcp-sdk": "2.0.0",
|
|
1177
1177
|
node: process.version,
|
|
1178
1178
|
platform: `${process.platform} ${process.arch}`
|
|
@@ -28348,6 +28348,33 @@ var init_auth = __esm({
|
|
|
28348
28348
|
}
|
|
28349
28349
|
});
|
|
28350
28350
|
|
|
28351
|
+
// src/client/capabilities.ts
|
|
28352
|
+
function buildClientCapabilities(supplied, inferred) {
|
|
28353
|
+
const capabilities = { ...supplied };
|
|
28354
|
+
if (inferred.sampling) {
|
|
28355
|
+
capabilities.sampling = {
|
|
28356
|
+
...supplied?.sampling,
|
|
28357
|
+
tools: supplied?.sampling?.tools ?? {}
|
|
28358
|
+
};
|
|
28359
|
+
}
|
|
28360
|
+
if (inferred.elicitation) {
|
|
28361
|
+
const elicitation = supplied?.elicitation;
|
|
28362
|
+
capabilities.elicitation = elicitation ? { ...elicitation, form: elicitation.form ?? {} } : {};
|
|
28363
|
+
}
|
|
28364
|
+
if (inferred.rootsListChanged !== void 0) {
|
|
28365
|
+
capabilities.roots = {
|
|
28366
|
+
...supplied?.roots,
|
|
28367
|
+
listChanged: inferred.rootsListChanged
|
|
28368
|
+
};
|
|
28369
|
+
}
|
|
28370
|
+
return capabilities;
|
|
28371
|
+
}
|
|
28372
|
+
var init_capabilities = __esm({
|
|
28373
|
+
"src/client/capabilities.ts"() {
|
|
28374
|
+
"use strict";
|
|
28375
|
+
}
|
|
28376
|
+
});
|
|
28377
|
+
|
|
28351
28378
|
// src/client/handlers.ts
|
|
28352
28379
|
function defaultLogHandler(message) {
|
|
28353
28380
|
const prefix = message.logger ? `[${message.logger}]` : "[server]";
|
|
@@ -29288,6 +29315,7 @@ var init_multi_server = __esm({
|
|
|
29288
29315
|
"src/client/multi-server.ts"() {
|
|
29289
29316
|
"use strict";
|
|
29290
29317
|
init_dist4();
|
|
29318
|
+
init_capabilities();
|
|
29291
29319
|
init_handlers();
|
|
29292
29320
|
init_transports();
|
|
29293
29321
|
init_client();
|
|
@@ -29300,6 +29328,7 @@ var init_multi_server = __esm({
|
|
|
29300
29328
|
_config;
|
|
29301
29329
|
_handlers;
|
|
29302
29330
|
_roots;
|
|
29331
|
+
_capabilities;
|
|
29303
29332
|
_defaultOptions;
|
|
29304
29333
|
_versionNegotiation;
|
|
29305
29334
|
_resourceSubscriptions = /* @__PURE__ */ new Map();
|
|
@@ -29323,6 +29352,11 @@ var init_multi_server = __esm({
|
|
|
29323
29352
|
};
|
|
29324
29353
|
this._versionNegotiation = options?.versionNegotiation ?? { mode: "auto" };
|
|
29325
29354
|
this._roots = options?.roots;
|
|
29355
|
+
this._capabilities = buildClientCapabilities(options?.capabilities, {
|
|
29356
|
+
sampling: this._handlers.sampling !== void 0,
|
|
29357
|
+
elicitation: this._handlers.elicitation !== void 0,
|
|
29358
|
+
rootsListChanged: this._roots === void 0 ? void 0 : false
|
|
29359
|
+
});
|
|
29326
29360
|
this._defaultOptions = options?.defaultOptions ?? {};
|
|
29327
29361
|
}
|
|
29328
29362
|
// -------------------------------------------------------------------------
|
|
@@ -29734,18 +29768,11 @@ ${errors.map(String).join("\n")}`);
|
|
|
29734
29768
|
return new Client(
|
|
29735
29769
|
{ name: "fastmcp-ts", version: "1.0.0" },
|
|
29736
29770
|
{
|
|
29737
|
-
capabilities: this.
|
|
29771
|
+
capabilities: this._capabilities,
|
|
29738
29772
|
versionNegotiation: this._versionNegotiation
|
|
29739
29773
|
}
|
|
29740
29774
|
);
|
|
29741
29775
|
}
|
|
29742
|
-
_buildCapabilities() {
|
|
29743
|
-
return {
|
|
29744
|
-
...this._handlers.sampling ? { sampling: { tools: {} } } : {},
|
|
29745
|
-
...this._handlers.elicitation ? { elicitation: {} } : {},
|
|
29746
|
-
...this._roots ? { roots: { listChanged: false } } : {}
|
|
29747
|
-
};
|
|
29748
|
-
}
|
|
29749
29776
|
_registerHandlers(sdk) {
|
|
29750
29777
|
sdk.setNotificationHandler("notifications/message", (notification) => {
|
|
29751
29778
|
void this._handlers.log({
|
|
@@ -29831,6 +29858,7 @@ var init_client = __esm({
|
|
|
29831
29858
|
"use strict";
|
|
29832
29859
|
init_dist4();
|
|
29833
29860
|
init_auth();
|
|
29861
|
+
init_capabilities();
|
|
29834
29862
|
init_handlers();
|
|
29835
29863
|
init_transports();
|
|
29836
29864
|
init_multi_server();
|
|
@@ -29869,6 +29897,7 @@ var init_client = __esm({
|
|
|
29869
29897
|
_auth;
|
|
29870
29898
|
_handlers;
|
|
29871
29899
|
_roots;
|
|
29900
|
+
_capabilities;
|
|
29872
29901
|
_autoInitialize;
|
|
29873
29902
|
_versionNegotiation;
|
|
29874
29903
|
_prior;
|
|
@@ -29896,6 +29925,11 @@ var init_client = __esm({
|
|
|
29896
29925
|
onPromptsListChanged: options?.handlers?.onPromptsListChanged
|
|
29897
29926
|
};
|
|
29898
29927
|
this._roots = options?.roots ? normalizeRootsOption(options.roots) : void 0;
|
|
29928
|
+
this._capabilities = buildClientCapabilities(options?.capabilities, {
|
|
29929
|
+
sampling: this._handlers.sampling !== void 0,
|
|
29930
|
+
elicitation: this._handlers.elicitation !== void 0,
|
|
29931
|
+
rootsListChanged: this._roots === void 0 ? void 0 : true
|
|
29932
|
+
});
|
|
29899
29933
|
this._autoInitialize = options?.autoInitialize ?? true;
|
|
29900
29934
|
this._versionNegotiation = options?.versionNegotiation ?? { mode: "auto" };
|
|
29901
29935
|
this._prior = options?.prior;
|
|
@@ -29930,7 +29964,7 @@ var init_client = __esm({
|
|
|
29930
29964
|
const sdkClient = new Client(
|
|
29931
29965
|
{ name: "fastmcp-ts", version: "1.0.0" },
|
|
29932
29966
|
{
|
|
29933
|
-
capabilities: this.
|
|
29967
|
+
capabilities: this._capabilities,
|
|
29934
29968
|
listChanged: this._buildListChangedConfig(),
|
|
29935
29969
|
versionNegotiation: this._versionNegotiation,
|
|
29936
29970
|
...this._inputRequired ? { inputRequired: this._inputRequired } : {},
|
|
@@ -30402,13 +30436,6 @@ var init_client = __esm({
|
|
|
30402
30436
|
}
|
|
30403
30437
|
return sdkOptions;
|
|
30404
30438
|
}
|
|
30405
|
-
_buildCapabilities() {
|
|
30406
|
-
return {
|
|
30407
|
-
...this._handlers.sampling ? { sampling: { tools: {} } } : {},
|
|
30408
|
-
...this._handlers.elicitation ? { elicitation: {} } : {},
|
|
30409
|
-
...this._roots ? { roots: { listChanged: true } } : {}
|
|
30410
|
-
};
|
|
30411
|
-
}
|
|
30412
30439
|
_buildListChangedConfig() {
|
|
30413
30440
|
const { onToolsListChanged, onResourcesListChanged, onPromptsListChanged } = this._handlers;
|
|
30414
30441
|
if (!onToolsListChanged && !onResourcesListChanged && !onPromptsListChanged) return void 0;
|
|
@@ -33369,7 +33396,7 @@ var init_inspect = __esm({
|
|
|
33369
33396
|
// only case Python's inspect supports); over --url/--command the
|
|
33370
33397
|
// generation is unknowable from the wire.
|
|
33371
33398
|
generation: mode.kind === "inprocess" ? 2 : null,
|
|
33372
|
-
fastmcpVersion: "1.
|
|
33399
|
+
fastmcpVersion: "1.2.0",
|
|
33373
33400
|
mcpVersion: "2.0.0",
|
|
33374
33401
|
tools: tools2,
|
|
33375
33402
|
prompts: prompts2,
|
|
@@ -46873,7 +46900,7 @@ init_format();
|
|
|
46873
46900
|
var main = defineCommand({
|
|
46874
46901
|
meta: {
|
|
46875
46902
|
name: "fastmcp",
|
|
46876
|
-
version: "1.
|
|
46903
|
+
version: "1.2.0",
|
|
46877
46904
|
description: "FastMCP CLI \u2014 build, run, and manage MCP servers"
|
|
46878
46905
|
},
|
|
46879
46906
|
args: {
|