@modelcontextprotocol/inspector 0.18.0 → 0.19.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/LICENSE +196 -1
- package/README.md +6 -1
- package/client/dist/assets/{OAuthCallback-CXY8DEIM.js → OAuthCallback-C7u-W3fG.js} +1 -1
- package/client/dist/assets/{OAuthDebugCallback-zr6INHin.js → OAuthDebugCallback-CJZOHlWo.js} +1 -1
- package/client/dist/assets/{index-Dw52pmVD.js → index-3HVc23AL.js} +849 -125
- package/client/dist/assets/{index-DoQUGvvr.css → index-6PUMPh30.css} +39 -0
- package/client/dist/index.html +2 -2
- package/package.json +7 -7
- package/server/build/mcpProxy.js +3 -1
|
@@ -16404,7 +16404,7 @@ object({
|
|
|
16404
16404
|
token_type_hint: string().optional()
|
|
16405
16405
|
}).strip();
|
|
16406
16406
|
const name = "@modelcontextprotocol/inspector-client";
|
|
16407
|
-
const version$1 = "0.
|
|
16407
|
+
const version$1 = "0.19.0";
|
|
16408
16408
|
const packageJson = {
|
|
16409
16409
|
name,
|
|
16410
16410
|
version: version$1
|
|
@@ -16460,6 +16460,12 @@ const DEFAULT_INSPECTOR_CONFIG = {
|
|
|
16460
16460
|
description: "Session token for authenticating with the MCP Proxy Server (displayed in proxy console on startup)",
|
|
16461
16461
|
value: "",
|
|
16462
16462
|
is_session_item: true
|
|
16463
|
+
},
|
|
16464
|
+
MCP_TASK_TTL: {
|
|
16465
|
+
label: "Task TTL",
|
|
16466
|
+
description: "Default Time-to-Live (TTL) in milliseconds for newly created tasks",
|
|
16467
|
+
value: 6e4,
|
|
16468
|
+
is_session_item: false
|
|
16463
16469
|
}
|
|
16464
16470
|
};
|
|
16465
16471
|
const META_PREFIX_LABEL_REGEX = /^[a-z](?:[a-z\d-]*[a-z\d])?$/i;
|
|
@@ -17344,15 +17350,18 @@ class InspectorOAuthClientProvider {
|
|
|
17344
17350
|
return [.../* @__PURE__ */ new Set([this.redirectUrl, this.debugRedirectUrl])];
|
|
17345
17351
|
}
|
|
17346
17352
|
get clientMetadata() {
|
|
17347
|
-
|
|
17353
|
+
const metadata2 = {
|
|
17348
17354
|
redirect_uris: this.redirect_uris,
|
|
17349
17355
|
token_endpoint_auth_method: "none",
|
|
17350
17356
|
grant_types: ["authorization_code", "refresh_token"],
|
|
17351
17357
|
response_types: ["code"],
|
|
17352
17358
|
client_name: "MCP Inspector",
|
|
17353
|
-
client_uri: "https://github.com/modelcontextprotocol/inspector"
|
|
17354
|
-
scope: this.scope ?? ""
|
|
17359
|
+
client_uri: "https://github.com/modelcontextprotocol/inspector"
|
|
17355
17360
|
};
|
|
17361
|
+
if (this.scope) {
|
|
17362
|
+
metadata2.scope = this.scope;
|
|
17363
|
+
}
|
|
17364
|
+
return metadata2;
|
|
17356
17365
|
}
|
|
17357
17366
|
state() {
|
|
17358
17367
|
return generateOAuthState();
|
|
@@ -41010,7 +41019,9 @@ class Client extends Protocol {
|
|
|
41010
41019
|
}
|
|
41011
41020
|
return taskValidationResult.data;
|
|
41012
41021
|
}
|
|
41013
|
-
const
|
|
41022
|
+
const hasTools = params.tools || params.toolChoice;
|
|
41023
|
+
const resultSchema = hasTools ? CreateMessageResultWithToolsSchema : CreateMessageResultSchema;
|
|
41024
|
+
const validationResult = safeParse(resultSchema, result);
|
|
41014
41025
|
if (!validationResult.success) {
|
|
41015
41026
|
const errorMessage = validationResult.error instanceof Error ? validationResult.error.message : String(validationResult.error);
|
|
41016
41027
|
throw new McpError(ErrorCode.InvalidParams, `Invalid sampling result: ${errorMessage}`);
|
|
@@ -42350,6 +42361,9 @@ const getMCPProxyAuthToken = (config2) => {
|
|
|
42350
42361
|
header: "X-MCP-Proxy-Auth"
|
|
42351
42362
|
};
|
|
42352
42363
|
};
|
|
42364
|
+
const getMCPTaskTtl = (config2) => {
|
|
42365
|
+
return config2.MCP_TASK_TTL.value;
|
|
42366
|
+
};
|
|
42353
42367
|
const getInitialTransportType = () => {
|
|
42354
42368
|
const param = getSearchParam("transport");
|
|
42355
42369
|
if (param === "stdio" || param === "sse" || param === "streamable-http") {
|
|
@@ -42467,6 +42481,7 @@ function useConnection({
|
|
|
42467
42481
|
null
|
|
42468
42482
|
);
|
|
42469
42483
|
const [serverImplementation, setServerImplementation] = reactExports.useState(null);
|
|
42484
|
+
const receiverTasksRef = reactExports.useRef(/* @__PURE__ */ new Map());
|
|
42470
42485
|
reactExports.useEffect(() => {
|
|
42471
42486
|
if (!oauthClientId) {
|
|
42472
42487
|
clearClientInformationFromSessionStorage({
|
|
@@ -42641,7 +42656,7 @@ function useConnection({
|
|
|
42641
42656
|
}
|
|
42642
42657
|
};
|
|
42643
42658
|
const is401Error = (error) => {
|
|
42644
|
-
return error instanceof SseError && error.code === 401 || error instanceof Error && error.message.includes("401") || error instanceof Error && error.message.includes("Unauthorized");
|
|
42659
|
+
return error instanceof SseError && error.code === 401 || error instanceof StreamableHTTPError && error.code === 401 || error instanceof Error && error.message.includes("401") || error instanceof Error && error.message.includes("Unauthorized") || error instanceof Error && error.message.includes("Missing Authorization header");
|
|
42645
42660
|
};
|
|
42646
42661
|
const isProxyAuthError = (error) => {
|
|
42647
42662
|
return error instanceof Error && error.message.includes("Authentication required. Use the session token");
|
|
@@ -42661,11 +42676,20 @@ function useConnection({
|
|
|
42661
42676
|
}
|
|
42662
42677
|
saveScopeToSessionStorage(sseUrl, scope2);
|
|
42663
42678
|
const serverAuthProvider = new InspectorOAuthClientProvider(sseUrl);
|
|
42664
|
-
|
|
42665
|
-
|
|
42666
|
-
|
|
42667
|
-
|
|
42668
|
-
|
|
42679
|
+
try {
|
|
42680
|
+
const result = await auth(serverAuthProvider, {
|
|
42681
|
+
serverUrl: sseUrl,
|
|
42682
|
+
scope: scope2
|
|
42683
|
+
});
|
|
42684
|
+
return result === "AUTHORIZED";
|
|
42685
|
+
} catch (authError) {
|
|
42686
|
+
toast2({
|
|
42687
|
+
title: "OAuth Authentication Failed",
|
|
42688
|
+
description: authError instanceof Error ? authError.message : String(authError),
|
|
42689
|
+
variant: "destructive"
|
|
42690
|
+
});
|
|
42691
|
+
return false;
|
|
42692
|
+
}
|
|
42669
42693
|
}
|
|
42670
42694
|
return false;
|
|
42671
42695
|
};
|
|
@@ -42686,6 +42710,16 @@ function useConnection({
|
|
|
42686
42710
|
elicitation: {},
|
|
42687
42711
|
roots: {
|
|
42688
42712
|
listChanged: true
|
|
42713
|
+
},
|
|
42714
|
+
tasks: {
|
|
42715
|
+
list: {},
|
|
42716
|
+
cancel: {},
|
|
42717
|
+
...onPendingRequest || onElicitationRequest ? {
|
|
42718
|
+
requests: {
|
|
42719
|
+
...onPendingRequest ? { sampling: { createMessage: {} } } : void 0,
|
|
42720
|
+
...onElicitationRequest ? { elicitation: { create: {} } } : void 0
|
|
42721
|
+
}
|
|
42722
|
+
} : void 0
|
|
42689
42723
|
}
|
|
42690
42724
|
}
|
|
42691
42725
|
};
|
|
@@ -42761,6 +42795,7 @@ function useConnection({
|
|
|
42761
42795
|
requestHeaders["Accept"] = "text/event-stream";
|
|
42762
42796
|
requestHeaders["content-type"] = "application/json";
|
|
42763
42797
|
transportOptions = {
|
|
42798
|
+
authProvider: serverAuthProvider,
|
|
42764
42799
|
fetch: async (url2, init) => {
|
|
42765
42800
|
const response = await fetch(url2, {
|
|
42766
42801
|
...init,
|
|
@@ -42776,6 +42811,7 @@ function useConnection({
|
|
|
42776
42811
|
break;
|
|
42777
42812
|
case "streamable-http":
|
|
42778
42813
|
transportOptions = {
|
|
42814
|
+
authProvider: serverAuthProvider,
|
|
42779
42815
|
fetch: async (url2, init) => {
|
|
42780
42816
|
requestHeaders["Accept"] = "text/event-stream, application/json";
|
|
42781
42817
|
requestHeaders["Content-Type"] = "application/json";
|
|
@@ -42844,6 +42880,7 @@ function useConnection({
|
|
|
42844
42880
|
);
|
|
42845
42881
|
}
|
|
42846
42882
|
transportOptions = {
|
|
42883
|
+
authProvider: serverAuthProvider,
|
|
42847
42884
|
eventSourceInit: {
|
|
42848
42885
|
fetch: (url2, init) => fetch(url2, {
|
|
42849
42886
|
...init,
|
|
@@ -42860,6 +42897,7 @@ function useConnection({
|
|
|
42860
42897
|
mcpProxyServerUrl = new URL(`${getMCPProxyAddress(config2)}/mcp`);
|
|
42861
42898
|
mcpProxyServerUrl.searchParams.append("url", sseUrl);
|
|
42862
42899
|
transportOptions = {
|
|
42900
|
+
authProvider: serverAuthProvider,
|
|
42863
42901
|
eventSourceInit: {
|
|
42864
42902
|
fetch: (url2, init) => fetch(url2, {
|
|
42865
42903
|
...init,
|
|
@@ -42889,7 +42927,8 @@ function useConnection({
|
|
|
42889
42927
|
ResourceUpdatedNotificationSchema,
|
|
42890
42928
|
ResourceListChangedNotificationSchema,
|
|
42891
42929
|
ToolListChangedNotificationSchema,
|
|
42892
|
-
PromptListChangedNotificationSchema
|
|
42930
|
+
PromptListChangedNotificationSchema,
|
|
42931
|
+
TaskStatusNotificationSchema
|
|
42893
42932
|
].forEach((notificationSchema) => {
|
|
42894
42933
|
client2.setNotificationHandler(notificationSchema, onNotification);
|
|
42895
42934
|
});
|
|
@@ -42949,11 +42988,170 @@ function useConnection({
|
|
|
42949
42988
|
}
|
|
42950
42989
|
setServerCapabilities(capabilities ?? null);
|
|
42951
42990
|
setCompletionsSupported(capabilities?.completions !== void 0);
|
|
42991
|
+
const nowIso = () => (/* @__PURE__ */ new Date()).toISOString();
|
|
42992
|
+
const makeTaskId = () => {
|
|
42993
|
+
const cryptoAny = globalThis.crypto;
|
|
42994
|
+
return cryptoAny?.randomUUID?.() ?? `task_${Date.now()}_${Math.random().toString(16).slice(2)}`;
|
|
42995
|
+
};
|
|
42996
|
+
const emitTaskStatus = async (task) => {
|
|
42997
|
+
try {
|
|
42998
|
+
const notification = {
|
|
42999
|
+
method: "notifications/tasks/status",
|
|
43000
|
+
params: task
|
|
43001
|
+
};
|
|
43002
|
+
await client2.notification(notification);
|
|
43003
|
+
pushHistory(notification);
|
|
43004
|
+
} catch (e) {
|
|
43005
|
+
console.warn("Failed to send notifications/tasks/status", e);
|
|
43006
|
+
}
|
|
43007
|
+
};
|
|
43008
|
+
const upsertReceiverTask = async (task) => {
|
|
43009
|
+
const record2 = receiverTasksRef.current.get(task.taskId);
|
|
43010
|
+
if (record2) {
|
|
43011
|
+
receiverTasksRef.current.set(task.taskId, { ...record2, task });
|
|
43012
|
+
}
|
|
43013
|
+
await emitTaskStatus(task);
|
|
43014
|
+
};
|
|
43015
|
+
const createReceiverTask = (opts) => {
|
|
43016
|
+
const taskId = makeTaskId();
|
|
43017
|
+
const createdAt = nowIso();
|
|
43018
|
+
const ttl = opts.ttl ?? getMCPTaskTtl(config2);
|
|
43019
|
+
let resolvePayload = () => void 0;
|
|
43020
|
+
let rejectPayload = () => void 0;
|
|
43021
|
+
const payloadPromise = new Promise((resolve2, reject) => {
|
|
43022
|
+
resolvePayload = resolve2;
|
|
43023
|
+
rejectPayload = reject;
|
|
43024
|
+
});
|
|
43025
|
+
const task = {
|
|
43026
|
+
taskId,
|
|
43027
|
+
status: opts.initialStatus,
|
|
43028
|
+
ttl,
|
|
43029
|
+
createdAt,
|
|
43030
|
+
lastUpdatedAt: createdAt,
|
|
43031
|
+
...opts.pollInterval !== void 0 ? { pollInterval: opts.pollInterval } : void 0,
|
|
43032
|
+
...opts.statusMessage ? { statusMessage: opts.statusMessage } : {}
|
|
43033
|
+
};
|
|
43034
|
+
const record2 = {
|
|
43035
|
+
task,
|
|
43036
|
+
payloadPromise,
|
|
43037
|
+
resolvePayload,
|
|
43038
|
+
rejectPayload
|
|
43039
|
+
};
|
|
43040
|
+
if (ttl !== null && ttl > 0) {
|
|
43041
|
+
record2.cleanupTimeoutId = setTimeout(() => {
|
|
43042
|
+
receiverTasksRef.current.delete(taskId);
|
|
43043
|
+
}, ttl);
|
|
43044
|
+
}
|
|
43045
|
+
receiverTasksRef.current.set(taskId, record2);
|
|
43046
|
+
void emitTaskStatus(task);
|
|
43047
|
+
return record2;
|
|
43048
|
+
};
|
|
43049
|
+
client2.setRequestHandler(ListTasksRequestSchema, async () => {
|
|
43050
|
+
return {
|
|
43051
|
+
tasks: Array.from(receiverTasksRef.current.values()).map(
|
|
43052
|
+
(r2) => r2.task
|
|
43053
|
+
)
|
|
43054
|
+
};
|
|
43055
|
+
});
|
|
43056
|
+
client2.setRequestHandler(GetTaskRequestSchema, async (request) => {
|
|
43057
|
+
const record2 = receiverTasksRef.current.get(request.params.taskId);
|
|
43058
|
+
if (!record2) {
|
|
43059
|
+
throw new McpError(
|
|
43060
|
+
ErrorCode.InvalidParams,
|
|
43061
|
+
`Unknown taskId: ${request.params.taskId}`
|
|
43062
|
+
);
|
|
43063
|
+
}
|
|
43064
|
+
return record2.task;
|
|
43065
|
+
});
|
|
43066
|
+
client2.setRequestHandler(GetTaskPayloadRequestSchema, async (request) => {
|
|
43067
|
+
const record2 = receiverTasksRef.current.get(request.params.taskId);
|
|
43068
|
+
if (!record2) {
|
|
43069
|
+
throw new McpError(
|
|
43070
|
+
ErrorCode.InvalidParams,
|
|
43071
|
+
`Unknown taskId: ${request.params.taskId}`
|
|
43072
|
+
);
|
|
43073
|
+
}
|
|
43074
|
+
return await record2.payloadPromise;
|
|
43075
|
+
});
|
|
43076
|
+
client2.setRequestHandler(CancelTaskRequestSchema, async (request) => {
|
|
43077
|
+
const record2 = receiverTasksRef.current.get(request.params.taskId);
|
|
43078
|
+
if (!record2) {
|
|
43079
|
+
throw new McpError(
|
|
43080
|
+
ErrorCode.InvalidParams,
|
|
43081
|
+
`Unknown taskId: ${request.params.taskId}`
|
|
43082
|
+
);
|
|
43083
|
+
}
|
|
43084
|
+
const terminalStatuses = [
|
|
43085
|
+
"completed",
|
|
43086
|
+
"failed",
|
|
43087
|
+
"cancelled"
|
|
43088
|
+
];
|
|
43089
|
+
if (!terminalStatuses.includes(record2.task.status)) {
|
|
43090
|
+
const updated = {
|
|
43091
|
+
...record2.task,
|
|
43092
|
+
status: "cancelled",
|
|
43093
|
+
lastUpdatedAt: nowIso(),
|
|
43094
|
+
statusMessage: "Cancelled"
|
|
43095
|
+
};
|
|
43096
|
+
receiverTasksRef.current.set(request.params.taskId, {
|
|
43097
|
+
...record2,
|
|
43098
|
+
task: updated
|
|
43099
|
+
});
|
|
43100
|
+
record2.rejectPayload(
|
|
43101
|
+
new McpError(ErrorCode.InternalError, "Task was cancelled")
|
|
43102
|
+
);
|
|
43103
|
+
await emitTaskStatus(updated);
|
|
43104
|
+
}
|
|
43105
|
+
return receiverTasksRef.current.get(request.params.taskId).task;
|
|
43106
|
+
});
|
|
42952
43107
|
if (onPendingRequest) {
|
|
42953
43108
|
client2.setRequestHandler(CreateMessageRequestSchema, (request) => {
|
|
42954
|
-
|
|
42955
|
-
|
|
43109
|
+
const taskSpec = request.params?.task;
|
|
43110
|
+
if (!taskSpec) {
|
|
43111
|
+
return new Promise((resolve2, reject) => {
|
|
43112
|
+
onPendingRequest(request, resolve2, reject);
|
|
43113
|
+
});
|
|
43114
|
+
}
|
|
43115
|
+
const record2 = createReceiverTask({
|
|
43116
|
+
ttl: taskSpec.ttl,
|
|
43117
|
+
initialStatus: "input_required",
|
|
43118
|
+
statusMessage: "Awaiting user input"
|
|
42956
43119
|
});
|
|
43120
|
+
void (async () => {
|
|
43121
|
+
try {
|
|
43122
|
+
const payload = await new Promise((resolve2, reject) => {
|
|
43123
|
+
onPendingRequest(request, resolve2, reject);
|
|
43124
|
+
});
|
|
43125
|
+
record2.resolvePayload(payload);
|
|
43126
|
+
const updated = {
|
|
43127
|
+
...record2.task,
|
|
43128
|
+
status: "completed",
|
|
43129
|
+
lastUpdatedAt: nowIso()
|
|
43130
|
+
};
|
|
43131
|
+
receiverTasksRef.current.set(record2.task.taskId, {
|
|
43132
|
+
...record2,
|
|
43133
|
+
task: updated
|
|
43134
|
+
});
|
|
43135
|
+
await upsertReceiverTask(updated);
|
|
43136
|
+
} catch (e) {
|
|
43137
|
+
record2.rejectPayload(e);
|
|
43138
|
+
const updated = {
|
|
43139
|
+
...record2.task,
|
|
43140
|
+
status: "failed",
|
|
43141
|
+
lastUpdatedAt: nowIso(),
|
|
43142
|
+
statusMessage: e instanceof Error ? e.message : "Task failed"
|
|
43143
|
+
};
|
|
43144
|
+
receiverTasksRef.current.set(record2.task.taskId, {
|
|
43145
|
+
...record2,
|
|
43146
|
+
task: updated
|
|
43147
|
+
});
|
|
43148
|
+
await upsertReceiverTask(updated);
|
|
43149
|
+
}
|
|
43150
|
+
})();
|
|
43151
|
+
const createTaskResult = {
|
|
43152
|
+
task: record2.task
|
|
43153
|
+
};
|
|
43154
|
+
return createTaskResult;
|
|
42957
43155
|
});
|
|
42958
43156
|
}
|
|
42959
43157
|
if (getRoots) {
|
|
@@ -42961,6 +43159,56 @@ function useConnection({
|
|
|
42961
43159
|
return { roots: getRoots() };
|
|
42962
43160
|
});
|
|
42963
43161
|
}
|
|
43162
|
+
if (onElicitationRequest) {
|
|
43163
|
+
client2.setRequestHandler(ElicitRequestSchema, (request) => {
|
|
43164
|
+
const taskSpec = request.params?.task;
|
|
43165
|
+
if (!taskSpec) {
|
|
43166
|
+
return new Promise((resolve2) => {
|
|
43167
|
+
onElicitationRequest(request, resolve2);
|
|
43168
|
+
});
|
|
43169
|
+
}
|
|
43170
|
+
const record2 = createReceiverTask({
|
|
43171
|
+
ttl: taskSpec.ttl,
|
|
43172
|
+
initialStatus: "input_required",
|
|
43173
|
+
statusMessage: "Awaiting user input"
|
|
43174
|
+
});
|
|
43175
|
+
void (async () => {
|
|
43176
|
+
try {
|
|
43177
|
+
const payload = await new Promise((resolve2) => {
|
|
43178
|
+
onElicitationRequest(request, resolve2);
|
|
43179
|
+
});
|
|
43180
|
+
record2.resolvePayload(payload);
|
|
43181
|
+
const updated = {
|
|
43182
|
+
...record2.task,
|
|
43183
|
+
status: "completed",
|
|
43184
|
+
lastUpdatedAt: nowIso()
|
|
43185
|
+
};
|
|
43186
|
+
receiverTasksRef.current.set(record2.task.taskId, {
|
|
43187
|
+
...record2,
|
|
43188
|
+
task: updated
|
|
43189
|
+
});
|
|
43190
|
+
await upsertReceiverTask(updated);
|
|
43191
|
+
} catch (e) {
|
|
43192
|
+
record2.rejectPayload(e);
|
|
43193
|
+
const updated = {
|
|
43194
|
+
...record2.task,
|
|
43195
|
+
status: "failed",
|
|
43196
|
+
lastUpdatedAt: nowIso(),
|
|
43197
|
+
statusMessage: e instanceof Error ? e.message : "Task failed"
|
|
43198
|
+
};
|
|
43199
|
+
receiverTasksRef.current.set(record2.task.taskId, {
|
|
43200
|
+
...record2,
|
|
43201
|
+
task: updated
|
|
43202
|
+
});
|
|
43203
|
+
await upsertReceiverTask(updated);
|
|
43204
|
+
}
|
|
43205
|
+
})();
|
|
43206
|
+
const createTaskResult = {
|
|
43207
|
+
task: record2.task
|
|
43208
|
+
};
|
|
43209
|
+
return createTaskResult;
|
|
43210
|
+
});
|
|
43211
|
+
}
|
|
42964
43212
|
if (capabilities?.logging && defaultLoggingLevel) {
|
|
42965
43213
|
lastRequest = "logging/setLevel";
|
|
42966
43214
|
await client2.setLoggingLevel(defaultLoggingLevel);
|
|
@@ -42975,13 +43223,6 @@ function useConnection({
|
|
|
42975
43223
|
);
|
|
42976
43224
|
lastRequest = "";
|
|
42977
43225
|
}
|
|
42978
|
-
if (onElicitationRequest) {
|
|
42979
|
-
client2.setRequestHandler(ElicitRequestSchema, async (request) => {
|
|
42980
|
-
return new Promise((resolve2) => {
|
|
42981
|
-
onElicitationRequest(request, resolve2);
|
|
42982
|
-
});
|
|
42983
|
-
});
|
|
42984
|
-
}
|
|
42985
43226
|
setMcpClient(client2);
|
|
42986
43227
|
setConnectionStatus("connected");
|
|
42987
43228
|
} catch (e) {
|
|
@@ -42991,12 +43232,42 @@ function useConnection({
|
|
|
42991
43232
|
description: `Server declares logging capability but doesn't implement method: "${lastRequest}"`,
|
|
42992
43233
|
variant: "destructive"
|
|
42993
43234
|
});
|
|
43235
|
+
} else {
|
|
43236
|
+
toast2({
|
|
43237
|
+
title: "Connection error",
|
|
43238
|
+
description: `Connection failed: "${e}"`,
|
|
43239
|
+
variant: "destructive"
|
|
43240
|
+
});
|
|
42994
43241
|
}
|
|
42995
43242
|
console.error(e);
|
|
42996
43243
|
setConnectionStatus("error");
|
|
42997
43244
|
}
|
|
42998
43245
|
};
|
|
43246
|
+
const cancelTask = async (taskId) => {
|
|
43247
|
+
return makeRequest(
|
|
43248
|
+
{
|
|
43249
|
+
method: "tasks/cancel",
|
|
43250
|
+
params: { taskId }
|
|
43251
|
+
},
|
|
43252
|
+
CancelTaskResultSchema
|
|
43253
|
+
);
|
|
43254
|
+
};
|
|
43255
|
+
const listTasks = async (cursor) => {
|
|
43256
|
+
return makeRequest(
|
|
43257
|
+
{
|
|
43258
|
+
method: "tasks/list",
|
|
43259
|
+
params: { cursor }
|
|
43260
|
+
},
|
|
43261
|
+
ListTasksResultSchema
|
|
43262
|
+
);
|
|
43263
|
+
};
|
|
42999
43264
|
const disconnect = async () => {
|
|
43265
|
+
receiverTasksRef.current.forEach((record2) => {
|
|
43266
|
+
if (record2.cleanupTimeoutId) {
|
|
43267
|
+
clearTimeout(record2.cleanupTimeoutId);
|
|
43268
|
+
}
|
|
43269
|
+
});
|
|
43270
|
+
receiverTasksRef.current.clear();
|
|
43000
43271
|
if (transportType === "streamable-http")
|
|
43001
43272
|
await clientTransport.terminateSession();
|
|
43002
43273
|
await mcpClient?.close();
|
|
@@ -43022,6 +43293,8 @@ function useConnection({
|
|
|
43022
43293
|
requestHistory,
|
|
43023
43294
|
clearRequestHistory,
|
|
43024
43295
|
makeRequest,
|
|
43296
|
+
cancelTask,
|
|
43297
|
+
listTasks,
|
|
43025
43298
|
sendNotification,
|
|
43026
43299
|
handleCompletion,
|
|
43027
43300
|
completionsSupported,
|
|
@@ -43766,7 +44039,7 @@ const createLucideIcon = (iconName, iconNode) => {
|
|
|
43766
44039
|
Component.displayName = toPascalCase(iconName);
|
|
43767
44040
|
return Component;
|
|
43768
44041
|
};
|
|
43769
|
-
const __iconNode$
|
|
44042
|
+
const __iconNode$F = [
|
|
43770
44043
|
["path", { d: "M10.268 21a2 2 0 0 0 3.464 0", key: "vwvbt9" }],
|
|
43771
44044
|
[
|
|
43772
44045
|
"path",
|
|
@@ -43776,8 +44049,8 @@ const __iconNode$A = [
|
|
|
43776
44049
|
}
|
|
43777
44050
|
]
|
|
43778
44051
|
];
|
|
43779
|
-
const Bell = createLucideIcon("bell", __iconNode$
|
|
43780
|
-
const __iconNode$
|
|
44052
|
+
const Bell = createLucideIcon("bell", __iconNode$F);
|
|
44053
|
+
const __iconNode$E = [
|
|
43781
44054
|
["path", { d: "m8 2 1.88 1.88", key: "fmnt4t" }],
|
|
43782
44055
|
["path", { d: "M14.12 3.88 16 2", key: "qol33r" }],
|
|
43783
44056
|
["path", { d: "M9 7.13v-1a3.003 3.003 0 1 1 6 0v1", key: "d7y7pr" }],
|
|
@@ -43796,56 +44069,72 @@ const __iconNode$z = [
|
|
|
43796
44069
|
["path", { d: "M22 13h-4", key: "1jl80f" }],
|
|
43797
44070
|
["path", { d: "M17.2 17c2.1.1 3.8 1.9 3.8 4", key: "k3fwyw" }]
|
|
43798
44071
|
];
|
|
43799
|
-
const Bug = createLucideIcon("bug", __iconNode$
|
|
43800
|
-
const __iconNode$
|
|
44072
|
+
const Bug = createLucideIcon("bug", __iconNode$E);
|
|
44073
|
+
const __iconNode$D = [
|
|
43801
44074
|
["path", { d: "M18 6 7 17l-5-5", key: "116fxf" }],
|
|
43802
44075
|
["path", { d: "m22 10-7.5 7.5L13 16", key: "ke71qq" }]
|
|
43803
44076
|
];
|
|
43804
|
-
const CheckCheck = createLucideIcon("check-check", __iconNode$
|
|
43805
|
-
const __iconNode$
|
|
43806
|
-
const Check = createLucideIcon("check", __iconNode$
|
|
43807
|
-
const __iconNode$
|
|
43808
|
-
const ChevronDown = createLucideIcon("chevron-down", __iconNode$
|
|
43809
|
-
const __iconNode$
|
|
43810
|
-
const ChevronRight = createLucideIcon("chevron-right", __iconNode$
|
|
43811
|
-
const __iconNode$
|
|
43812
|
-
const ChevronUp = createLucideIcon("chevron-up", __iconNode$
|
|
43813
|
-
const __iconNode$
|
|
44077
|
+
const CheckCheck = createLucideIcon("check-check", __iconNode$D);
|
|
44078
|
+
const __iconNode$C = [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]];
|
|
44079
|
+
const Check = createLucideIcon("check", __iconNode$C);
|
|
44080
|
+
const __iconNode$B = [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]];
|
|
44081
|
+
const ChevronDown = createLucideIcon("chevron-down", __iconNode$B);
|
|
44082
|
+
const __iconNode$A = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]];
|
|
44083
|
+
const ChevronRight = createLucideIcon("chevron-right", __iconNode$A);
|
|
44084
|
+
const __iconNode$z = [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]];
|
|
44085
|
+
const ChevronUp = createLucideIcon("chevron-up", __iconNode$z);
|
|
44086
|
+
const __iconNode$y = [
|
|
43814
44087
|
["path", { d: "m7 15 5 5 5-5", key: "1hf1tw" }],
|
|
43815
44088
|
["path", { d: "m7 9 5-5 5 5", key: "sgt6xg" }]
|
|
43816
44089
|
];
|
|
43817
|
-
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$
|
|
43818
|
-
const __iconNode$
|
|
44090
|
+
const ChevronsUpDown = createLucideIcon("chevrons-up-down", __iconNode$y);
|
|
44091
|
+
const __iconNode$x = [
|
|
43819
44092
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
43820
44093
|
["line", { x1: "12", x2: "12", y1: "8", y2: "12", key: "1pkeuh" }],
|
|
43821
44094
|
["line", { x1: "12", x2: "12.01", y1: "16", y2: "16", key: "4dfq90" }]
|
|
43822
44095
|
];
|
|
43823
|
-
const CircleAlert = createLucideIcon("circle-alert", __iconNode$
|
|
43824
|
-
const __iconNode$
|
|
44096
|
+
const CircleAlert = createLucideIcon("circle-alert", __iconNode$x);
|
|
44097
|
+
const __iconNode$w = [
|
|
43825
44098
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
43826
44099
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
43827
44100
|
];
|
|
43828
|
-
const CircleCheck = createLucideIcon("circle-check", __iconNode$
|
|
43829
|
-
const __iconNode$
|
|
44101
|
+
const CircleCheck = createLucideIcon("circle-check", __iconNode$w);
|
|
44102
|
+
const __iconNode$v = [
|
|
44103
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
44104
|
+
["polygon", { points: "10 8 16 12 10 16 10 8", key: "1cimsy" }]
|
|
44105
|
+
];
|
|
44106
|
+
const CirclePlay = createLucideIcon("circle-play", __iconNode$v);
|
|
44107
|
+
const __iconNode$u = [
|
|
43830
44108
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
43831
44109
|
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
|
43832
44110
|
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
43833
44111
|
];
|
|
43834
|
-
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$
|
|
43835
|
-
const __iconNode$
|
|
43836
|
-
|
|
43837
|
-
|
|
44112
|
+
const CircleQuestionMark = createLucideIcon("circle-question-mark", __iconNode$u);
|
|
44113
|
+
const __iconNode$t = [
|
|
44114
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
44115
|
+
["path", { d: "m15 9-6 6", key: "1uzhvr" }],
|
|
44116
|
+
["path", { d: "m9 9 6 6", key: "z0biqf" }]
|
|
44117
|
+
];
|
|
44118
|
+
const CircleX = createLucideIcon("circle-x", __iconNode$t);
|
|
44119
|
+
const __iconNode$s = [["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]];
|
|
44120
|
+
const Circle = createLucideIcon("circle", __iconNode$s);
|
|
44121
|
+
const __iconNode$r = [
|
|
44122
|
+
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
44123
|
+
["polyline", { points: "12 6 12 12 16 14", key: "68esgv" }]
|
|
44124
|
+
];
|
|
44125
|
+
const Clock = createLucideIcon("clock", __iconNode$r);
|
|
44126
|
+
const __iconNode$q = [
|
|
43838
44127
|
["rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2", key: "17jyea" }],
|
|
43839
44128
|
["path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2", key: "zix9uf" }]
|
|
43840
44129
|
];
|
|
43841
|
-
const Copy = createLucideIcon("copy", __iconNode$
|
|
43842
|
-
const __iconNode$
|
|
44130
|
+
const Copy = createLucideIcon("copy", __iconNode$q);
|
|
44131
|
+
const __iconNode$p = [
|
|
43843
44132
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
43844
44133
|
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
43845
44134
|
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
43846
44135
|
];
|
|
43847
|
-
const ExternalLink = createLucideIcon("external-link", __iconNode$
|
|
43848
|
-
const __iconNode$
|
|
44136
|
+
const ExternalLink = createLucideIcon("external-link", __iconNode$p);
|
|
44137
|
+
const __iconNode$o = [
|
|
43849
44138
|
[
|
|
43850
44139
|
"path",
|
|
43851
44140
|
{
|
|
@@ -43863,8 +44152,8 @@ const __iconNode$m = [
|
|
|
43863
44152
|
],
|
|
43864
44153
|
["path", { d: "m2 2 20 20", key: "1ooewy" }]
|
|
43865
44154
|
];
|
|
43866
|
-
const EyeOff = createLucideIcon("eye-off", __iconNode$
|
|
43867
|
-
const __iconNode$
|
|
44155
|
+
const EyeOff = createLucideIcon("eye-off", __iconNode$o);
|
|
44156
|
+
const __iconNode$n = [
|
|
43868
44157
|
[
|
|
43869
44158
|
"path",
|
|
43870
44159
|
{
|
|
@@ -43874,22 +44163,22 @@ const __iconNode$l = [
|
|
|
43874
44163
|
],
|
|
43875
44164
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
43876
44165
|
];
|
|
43877
|
-
const Eye = createLucideIcon("eye", __iconNode$
|
|
43878
|
-
const __iconNode$
|
|
44166
|
+
const Eye = createLucideIcon("eye", __iconNode$n);
|
|
44167
|
+
const __iconNode$m = [
|
|
43879
44168
|
["path", { d: "M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z", key: "1rqfz7" }],
|
|
43880
44169
|
["path", { d: "M14 2v4a2 2 0 0 0 2 2h4", key: "tnqrlb" }],
|
|
43881
44170
|
["path", { d: "M10 9H8", key: "b1mrlr" }],
|
|
43882
44171
|
["path", { d: "M16 13H8", key: "t4e002" }],
|
|
43883
44172
|
["path", { d: "M16 17H8", key: "z1uh3a" }]
|
|
43884
44173
|
];
|
|
43885
|
-
const FileText = createLucideIcon("file-text", __iconNode$
|
|
43886
|
-
const __iconNode$
|
|
44174
|
+
const FileText = createLucideIcon("file-text", __iconNode$m);
|
|
44175
|
+
const __iconNode$l = [
|
|
43887
44176
|
["path", { d: "M20 7h-3a2 2 0 0 1-2-2V2", key: "x099mo" }],
|
|
43888
44177
|
["path", { d: "M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z", key: "18t6ie" }],
|
|
43889
44178
|
["path", { d: "M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8", key: "1nja0z" }]
|
|
43890
44179
|
];
|
|
43891
|
-
const Files = createLucideIcon("files", __iconNode$
|
|
43892
|
-
const __iconNode$
|
|
44180
|
+
const Files = createLucideIcon("files", __iconNode$l);
|
|
44181
|
+
const __iconNode$k = [
|
|
43893
44182
|
[
|
|
43894
44183
|
"path",
|
|
43895
44184
|
{
|
|
@@ -43907,8 +44196,8 @@ const __iconNode$i = [
|
|
|
43907
44196
|
["path", { d: "M3 5a2 2 0 0 0 2 2h3", key: "f2jnh7" }],
|
|
43908
44197
|
["path", { d: "M3 3v13a2 2 0 0 0 2 2h3", key: "k8epm1" }]
|
|
43909
44198
|
];
|
|
43910
|
-
const FolderTree = createLucideIcon("folder-tree", __iconNode$
|
|
43911
|
-
const __iconNode$
|
|
44199
|
+
const FolderTree = createLucideIcon("folder-tree", __iconNode$k);
|
|
44200
|
+
const __iconNode$j = [
|
|
43912
44201
|
[
|
|
43913
44202
|
"path",
|
|
43914
44203
|
{
|
|
@@ -43918,8 +44207,8 @@ const __iconNode$h = [
|
|
|
43918
44207
|
],
|
|
43919
44208
|
["path", { d: "M9 18c-4.51 2-5-2-7-2", key: "9comsn" }]
|
|
43920
44209
|
];
|
|
43921
|
-
const Github = createLucideIcon("github", __iconNode$
|
|
43922
|
-
const __iconNode$
|
|
44210
|
+
const Github = createLucideIcon("github", __iconNode$j);
|
|
44211
|
+
const __iconNode$i = [
|
|
43923
44212
|
["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
|
|
43924
44213
|
["path", { d: "m18 15 4-4", key: "16gjal" }],
|
|
43925
44214
|
[
|
|
@@ -43930,36 +44219,44 @@ const __iconNode$g = [
|
|
|
43930
44219
|
}
|
|
43931
44220
|
]
|
|
43932
44221
|
];
|
|
43933
|
-
const Hammer = createLucideIcon("hammer", __iconNode$
|
|
43934
|
-
const __iconNode$
|
|
44222
|
+
const Hammer = createLucideIcon("hammer", __iconNode$i);
|
|
44223
|
+
const __iconNode$h = [
|
|
43935
44224
|
["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
|
|
43936
44225
|
["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
|
|
43937
44226
|
["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
|
|
43938
44227
|
["line", { x1: "16", x2: "14", y1: "3", y2: "21", key: "weycgp" }]
|
|
43939
44228
|
];
|
|
43940
|
-
const Hash = createLucideIcon("hash", __iconNode$
|
|
43941
|
-
const __iconNode$
|
|
44229
|
+
const Hash = createLucideIcon("hash", __iconNode$h);
|
|
44230
|
+
const __iconNode$g = [
|
|
43942
44231
|
["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
|
|
43943
44232
|
["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
|
|
43944
44233
|
["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
|
|
43945
44234
|
];
|
|
43946
|
-
const Key = createLucideIcon("key", __iconNode$
|
|
43947
|
-
const __iconNode$
|
|
43948
|
-
|
|
43949
|
-
|
|
44235
|
+
const Key = createLucideIcon("key", __iconNode$g);
|
|
44236
|
+
const __iconNode$f = [
|
|
44237
|
+
["rect", { x: "3", y: "5", width: "6", height: "6", rx: "1", key: "1defrl" }],
|
|
44238
|
+
["path", { d: "m3 17 2 2 4-4", key: "1jhpwq" }],
|
|
44239
|
+
["path", { d: "M13 6h8", key: "15sg57" }],
|
|
44240
|
+
["path", { d: "M13 12h8", key: "h98zly" }],
|
|
44241
|
+
["path", { d: "M13 18h8", key: "oe0vm4" }]
|
|
44242
|
+
];
|
|
44243
|
+
const ListTodo = createLucideIcon("list-todo", __iconNode$f);
|
|
44244
|
+
const __iconNode$e = [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]];
|
|
44245
|
+
const LoaderCircle = createLucideIcon("loader-circle", __iconNode$e);
|
|
44246
|
+
const __iconNode$d = [
|
|
43950
44247
|
["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }]
|
|
43951
44248
|
];
|
|
43952
|
-
const MessageSquare = createLucideIcon("message-square", __iconNode$
|
|
43953
|
-
const __iconNode$
|
|
43954
|
-
const Minus = createLucideIcon("minus", __iconNode$
|
|
43955
|
-
const __iconNode$
|
|
43956
|
-
const Play = createLucideIcon("play", __iconNode$
|
|
43957
|
-
const __iconNode$
|
|
44249
|
+
const MessageSquare = createLucideIcon("message-square", __iconNode$d);
|
|
44250
|
+
const __iconNode$c = [["path", { d: "M5 12h14", key: "1ays0h" }]];
|
|
44251
|
+
const Minus = createLucideIcon("minus", __iconNode$c);
|
|
44252
|
+
const __iconNode$b = [["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]];
|
|
44253
|
+
const Play = createLucideIcon("play", __iconNode$b);
|
|
44254
|
+
const __iconNode$a = [
|
|
43958
44255
|
["path", { d: "M5 12h14", key: "1ays0h" }],
|
|
43959
44256
|
["path", { d: "M12 5v14", key: "s699le" }]
|
|
43960
44257
|
];
|
|
43961
|
-
const Plus = createLucideIcon("plus", __iconNode$
|
|
43962
|
-
const __iconNode$
|
|
44258
|
+
const Plus = createLucideIcon("plus", __iconNode$a);
|
|
44259
|
+
const __iconNode$9 = [
|
|
43963
44260
|
["path", { d: "M21 8L18.74 5.74A9.75 9.75 0 0 0 12 3C11 3 10.03 3.16 9.13 3.47", key: "1krf6h" }],
|
|
43964
44261
|
["path", { d: "M8 16H3v5", key: "1cv678" }],
|
|
43965
44262
|
["path", { d: "M3 12C3 9.51 4 7.26 5.64 5.64", key: "ruvoct" }],
|
|
@@ -43968,20 +44265,20 @@ const __iconNode$8 = [
|
|
|
43968
44265
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
43969
44266
|
["path", { d: "M22 22 2 2", key: "1r8tn9" }]
|
|
43970
44267
|
];
|
|
43971
|
-
const RefreshCwOff = createLucideIcon("refresh-cw-off", __iconNode$
|
|
43972
|
-
const __iconNode$
|
|
44268
|
+
const RefreshCwOff = createLucideIcon("refresh-cw-off", __iconNode$9);
|
|
44269
|
+
const __iconNode$8 = [
|
|
43973
44270
|
["path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8", key: "v9h5vc" }],
|
|
43974
44271
|
["path", { d: "M21 3v5h-5", key: "1q7to0" }],
|
|
43975
44272
|
["path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16", key: "3uifl3" }],
|
|
43976
44273
|
["path", { d: "M8 16H3v5", key: "1cv678" }]
|
|
43977
44274
|
];
|
|
43978
|
-
const RefreshCw = createLucideIcon("refresh-cw", __iconNode$
|
|
43979
|
-
const __iconNode$
|
|
44275
|
+
const RefreshCw = createLucideIcon("refresh-cw", __iconNode$8);
|
|
44276
|
+
const __iconNode$7 = [
|
|
43980
44277
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8", key: "1357e3" }],
|
|
43981
44278
|
["path", { d: "M3 3v5h5", key: "1xhq8a" }]
|
|
43982
44279
|
];
|
|
43983
|
-
const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$
|
|
43984
|
-
const __iconNode$
|
|
44280
|
+
const RotateCcw = createLucideIcon("rotate-ccw", __iconNode$7);
|
|
44281
|
+
const __iconNode$6 = [
|
|
43985
44282
|
[
|
|
43986
44283
|
"path",
|
|
43987
44284
|
{
|
|
@@ -43992,13 +44289,13 @@ const __iconNode$5 = [
|
|
|
43992
44289
|
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
43993
44290
|
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
43994
44291
|
];
|
|
43995
|
-
const Save = createLucideIcon("save", __iconNode$
|
|
43996
|
-
const __iconNode$
|
|
44292
|
+
const Save = createLucideIcon("save", __iconNode$6);
|
|
44293
|
+
const __iconNode$5 = [
|
|
43997
44294
|
["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
|
|
43998
44295
|
["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
|
|
43999
44296
|
];
|
|
44000
|
-
const Search = createLucideIcon("search", __iconNode$
|
|
44001
|
-
const __iconNode$
|
|
44297
|
+
const Search = createLucideIcon("search", __iconNode$5);
|
|
44298
|
+
const __iconNode$4 = [
|
|
44002
44299
|
[
|
|
44003
44300
|
"path",
|
|
44004
44301
|
{
|
|
@@ -44008,15 +44305,15 @@ const __iconNode$3 = [
|
|
|
44008
44305
|
],
|
|
44009
44306
|
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
44010
44307
|
];
|
|
44011
|
-
const Send = createLucideIcon("send", __iconNode$
|
|
44012
|
-
const __iconNode$
|
|
44308
|
+
const Send = createLucideIcon("send", __iconNode$4);
|
|
44309
|
+
const __iconNode$3 = [
|
|
44013
44310
|
["rect", { width: "20", height: "8", x: "2", y: "2", rx: "2", ry: "2", key: "ngkwjq" }],
|
|
44014
44311
|
["rect", { width: "20", height: "8", x: "2", y: "14", rx: "2", ry: "2", key: "iecqi9" }],
|
|
44015
44312
|
["line", { x1: "6", x2: "6.01", y1: "6", y2: "6", key: "16zg32" }],
|
|
44016
44313
|
["line", { x1: "6", x2: "6.01", y1: "18", y2: "18", key: "nzw8ys" }]
|
|
44017
44314
|
];
|
|
44018
|
-
const Server = createLucideIcon("server", __iconNode$
|
|
44019
|
-
const __iconNode$
|
|
44315
|
+
const Server = createLucideIcon("server", __iconNode$3);
|
|
44316
|
+
const __iconNode$2 = [
|
|
44020
44317
|
[
|
|
44021
44318
|
"path",
|
|
44022
44319
|
{
|
|
@@ -44026,15 +44323,27 @@ const __iconNode$1 = [
|
|
|
44026
44323
|
],
|
|
44027
44324
|
["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
|
|
44028
44325
|
];
|
|
44029
|
-
const Settings = createLucideIcon("settings", __iconNode$
|
|
44030
|
-
const __iconNode = [
|
|
44326
|
+
const Settings = createLucideIcon("settings", __iconNode$2);
|
|
44327
|
+
const __iconNode$1 = [
|
|
44031
44328
|
["path", { d: "M3 6h18", key: "d0wm0j" }],
|
|
44032
44329
|
["path", { d: "M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6", key: "4alrt4" }],
|
|
44033
44330
|
["path", { d: "M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2", key: "v07s0e" }],
|
|
44034
44331
|
["line", { x1: "10", x2: "10", y1: "11", y2: "17", key: "1uufr5" }],
|
|
44035
44332
|
["line", { x1: "14", x2: "14", y1: "11", y2: "17", key: "xtxkd" }]
|
|
44036
44333
|
];
|
|
44037
|
-
const Trash2 = createLucideIcon("trash-2", __iconNode);
|
|
44334
|
+
const Trash2 = createLucideIcon("trash-2", __iconNode$1);
|
|
44335
|
+
const __iconNode = [
|
|
44336
|
+
[
|
|
44337
|
+
"path",
|
|
44338
|
+
{
|
|
44339
|
+
d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
|
|
44340
|
+
key: "wmoenq"
|
|
44341
|
+
}
|
|
44342
|
+
],
|
|
44343
|
+
["path", { d: "M12 9v4", key: "juzpu7" }],
|
|
44344
|
+
["path", { d: "M12 17h.01", key: "p32p05" }]
|
|
44345
|
+
];
|
|
44346
|
+
const TriangleAlert = createLucideIcon("triangle-alert", __iconNode);
|
|
44038
44347
|
const OAuthStepDetails = ({
|
|
44039
44348
|
label,
|
|
44040
44349
|
isComplete,
|
|
@@ -50193,7 +50502,7 @@ class UriTemplate {
|
|
|
50193
50502
|
const name2 = part.name;
|
|
50194
50503
|
switch (part.operator) {
|
|
50195
50504
|
case "":
|
|
50196
|
-
pattern2 = part.exploded ? "([
|
|
50505
|
+
pattern2 = part.exploded ? "([^/,]+(?:,[^/,]+)*)" : "([^/,]+)";
|
|
50197
50506
|
break;
|
|
50198
50507
|
case "+":
|
|
50199
50508
|
case "#":
|
|
@@ -50203,7 +50512,7 @@ class UriTemplate {
|
|
|
50203
50512
|
pattern2 = "\\.([^/,]+)";
|
|
50204
50513
|
break;
|
|
50205
50514
|
case "/":
|
|
50206
|
-
pattern2 = "/" + (part.exploded ? "([
|
|
50515
|
+
pattern2 = "/" + (part.exploded ? "([^/,]+(?:,[^/,]+)*)" : "([^/,]+)");
|
|
50207
50516
|
break;
|
|
50208
50517
|
default:
|
|
50209
50518
|
pattern2 = "([^/]+)";
|
|
@@ -52388,7 +52697,8 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
52388
52697
|
const JsonEditor = ({
|
|
52389
52698
|
value,
|
|
52390
52699
|
onChange,
|
|
52391
|
-
error: externalError
|
|
52700
|
+
error: externalError,
|
|
52701
|
+
placeholder
|
|
52392
52702
|
}) => {
|
|
52393
52703
|
const [editorContent, setEditorContent] = reactExports.useState(value || "");
|
|
52394
52704
|
const [internalError, setInternalError] = reactExports.useState(
|
|
@@ -52415,6 +52725,7 @@ const JsonEditor = ({
|
|
|
52415
52725
|
onValueChange: handleEditorChange,
|
|
52416
52726
|
highlight: (code2) => Prism$1.highlight(code2, Prism$1.languages.json, "json"),
|
|
52417
52727
|
padding: 10,
|
|
52728
|
+
placeholder,
|
|
52418
52729
|
style: {
|
|
52419
52730
|
fontFamily: '"Fira code", "Fira Mono", monospace',
|
|
52420
52731
|
fontSize: 14,
|
|
@@ -52999,7 +53310,8 @@ const DynamicJsonForm = reactExports.forwardRef(
|
|
|
52999
53310
|
setRawJsonValue(newValue);
|
|
53000
53311
|
debouncedUpdateParent(newValue);
|
|
53001
53312
|
},
|
|
53002
|
-
error: jsonError
|
|
53313
|
+
error: jsonError,
|
|
53314
|
+
placeholder: schema.description
|
|
53003
53315
|
}
|
|
53004
53316
|
) : (
|
|
53005
53317
|
// If schema type is object but value is not an object or is empty, and we have actual JSON data,
|
|
@@ -54535,7 +54847,7 @@ const useTheme = () => {
|
|
|
54535
54847
|
[theme, setThemeWithSideEffect]
|
|
54536
54848
|
);
|
|
54537
54849
|
};
|
|
54538
|
-
const version = "0.
|
|
54850
|
+
const version = "0.19.0";
|
|
54539
54851
|
var SLOTTABLE_IDENTIFIER = /* @__PURE__ */ Symbol("radix.slottable");
|
|
54540
54852
|
// @__NO_SIDE_EFFECTS__
|
|
54541
54853
|
function createSlottable(ownerName) {
|
|
@@ -56544,7 +56856,8 @@ const ToolResults = ({
|
|
|
56544
56856
|
toolResult,
|
|
56545
56857
|
selectedTool,
|
|
56546
56858
|
resourceContent,
|
|
56547
|
-
onReadResource
|
|
56859
|
+
onReadResource,
|
|
56860
|
+
isPollingTask
|
|
56548
56861
|
}) => {
|
|
56549
56862
|
if (!toolResult) return null;
|
|
56550
56863
|
if ("content" in toolResult) {
|
|
@@ -56559,6 +56872,10 @@ const ToolResults = ({
|
|
|
56559
56872
|
}
|
|
56560
56873
|
const structuredResult = parsedResult.data;
|
|
56561
56874
|
const isError = structuredResult.isError ?? false;
|
|
56875
|
+
const relatedTask = structuredResult._meta?.["io.modelcontextprotocol/related-task"];
|
|
56876
|
+
const isTaskRunning = isPollingTask || !!relatedTask && structuredResult.content.some(
|
|
56877
|
+
(c) => c.type === "text" && (c.text?.includes("Polling") || c.text?.includes("Task status"))
|
|
56878
|
+
);
|
|
56562
56879
|
let validationResult = null;
|
|
56563
56880
|
const toolHasOutputSchema = selectedTool && hasOutputSchema(selectedTool.name);
|
|
56564
56881
|
if (toolHasOutputSchema) {
|
|
@@ -56585,7 +56902,7 @@ const ToolResults = ({
|
|
|
56585
56902
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("h4", { className: "font-semibold mb-2", children: [
|
|
56586
56903
|
"Tool Result:",
|
|
56587
56904
|
" ",
|
|
56588
|
-
isError ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-600 font-semibold", children: "Error" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600 font-semibold", children: "Success" })
|
|
56905
|
+
isError ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-red-600 font-semibold", children: "Error" }) : isTaskRunning ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-yellow-600 font-semibold", children: "Task Running" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-green-600 font-semibold", children: "Success" })
|
|
56589
56906
|
] }),
|
|
56590
56907
|
structuredResult.structuredContent && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-4", children: [
|
|
56591
56908
|
/* @__PURE__ */ jsxRuntimeExports.jsx("h5", { className: "font-semibold mb-2 text-sm", children: "Structured Content:" }),
|
|
@@ -56676,12 +56993,14 @@ const ToolsTab = ({
|
|
|
56676
56993
|
selectedTool,
|
|
56677
56994
|
setSelectedTool,
|
|
56678
56995
|
toolResult,
|
|
56996
|
+
isPollingTask,
|
|
56679
56997
|
nextCursor,
|
|
56680
56998
|
error,
|
|
56681
56999
|
resourceContent,
|
|
56682
57000
|
onReadResource
|
|
56683
57001
|
}) => {
|
|
56684
57002
|
const [params, setParams] = reactExports.useState({});
|
|
57003
|
+
const [runAsTask, setRunAsTask] = reactExports.useState(false);
|
|
56685
57004
|
const [isToolRunning, setIsToolRunning] = reactExports.useState(false);
|
|
56686
57005
|
const [isOutputSchemaExpanded, setIsOutputSchemaExpanded] = reactExports.useState(false);
|
|
56687
57006
|
const [isMetadataExpanded, setIsMetadataExpanded] = reactExports.useState(false);
|
|
@@ -56715,6 +57034,7 @@ const ToolsTab = ({
|
|
|
56715
57034
|
];
|
|
56716
57035
|
});
|
|
56717
57036
|
setParams(Object.fromEntries(params2));
|
|
57037
|
+
setRunAsTask(false);
|
|
56718
57038
|
setHasValidationErrors(false);
|
|
56719
57039
|
formRefs.current = {};
|
|
56720
57040
|
}, [selectedTool]);
|
|
@@ -56739,6 +57059,7 @@ const ToolsTab = ({
|
|
|
56739
57059
|
clearItems: () => {
|
|
56740
57060
|
clearTools();
|
|
56741
57061
|
setSelectedTool(null);
|
|
57062
|
+
setRunAsTask(false);
|
|
56742
57063
|
},
|
|
56743
57064
|
setSelectedItem: setSelectedTool,
|
|
56744
57065
|
renderItem: (tool) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start w-full gap-2", children: [
|
|
@@ -57128,6 +57449,24 @@ const ToolsTab = ({
|
|
|
57128
57449
|
}
|
|
57129
57450
|
)
|
|
57130
57451
|
] }),
|
|
57452
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
57453
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57454
|
+
Checkbox,
|
|
57455
|
+
{
|
|
57456
|
+
id: "run-as-task",
|
|
57457
|
+
checked: runAsTask,
|
|
57458
|
+
onCheckedChange: (checked) => setRunAsTask(checked)
|
|
57459
|
+
}
|
|
57460
|
+
),
|
|
57461
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57462
|
+
Label$1,
|
|
57463
|
+
{
|
|
57464
|
+
htmlFor: "run-as-task",
|
|
57465
|
+
className: "text-sm font-medium text-gray-700 dark:text-gray-300 cursor-pointer",
|
|
57466
|
+
children: "Run as task"
|
|
57467
|
+
}
|
|
57468
|
+
)
|
|
57469
|
+
] }),
|
|
57131
57470
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57132
57471
|
Button,
|
|
57133
57472
|
{
|
|
@@ -57145,16 +57484,17 @@ const ToolsTab = ({
|
|
|
57145
57484
|
await callTool(
|
|
57146
57485
|
selectedTool.name,
|
|
57147
57486
|
params,
|
|
57148
|
-
Object.keys(metadata2).length ? metadata2 : void 0
|
|
57487
|
+
Object.keys(metadata2).length ? metadata2 : void 0,
|
|
57488
|
+
runAsTask
|
|
57149
57489
|
);
|
|
57150
57490
|
} finally {
|
|
57151
57491
|
setIsToolRunning(false);
|
|
57152
57492
|
}
|
|
57153
57493
|
},
|
|
57154
|
-
disabled: isToolRunning || hasValidationErrors || hasReservedMetadataEntry || hasInvalidMetaPrefixEntry || hasInvalidMetaNameEntry,
|
|
57155
|
-
children: isToolRunning ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
57494
|
+
disabled: isToolRunning || isPollingTask || hasValidationErrors || hasReservedMetadataEntry || hasInvalidMetaPrefixEntry || hasInvalidMetaNameEntry,
|
|
57495
|
+
children: isToolRunning || isPollingTask ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
57156
57496
|
/* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-4 h-4 mr-2 animate-spin" }),
|
|
57157
|
-
"Running..."
|
|
57497
|
+
isPollingTask ? "Polling Task..." : "Running..."
|
|
57158
57498
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
57159
57499
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "w-4 h-4 mr-2" }),
|
|
57160
57500
|
"Run Tool"
|
|
@@ -57190,13 +57530,168 @@ const ToolsTab = ({
|
|
|
57190
57530
|
toolResult,
|
|
57191
57531
|
selectedTool,
|
|
57192
57532
|
resourceContent,
|
|
57193
|
-
onReadResource
|
|
57533
|
+
onReadResource,
|
|
57534
|
+
isPollingTask
|
|
57194
57535
|
}
|
|
57195
57536
|
)
|
|
57196
57537
|
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Alert, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: "Select a tool from the list to view its details and run it" }) }) })
|
|
57197
57538
|
] })
|
|
57198
57539
|
] }) });
|
|
57199
57540
|
};
|
|
57541
|
+
const TaskStatusIcon = ({ status }) => {
|
|
57542
|
+
switch (status) {
|
|
57543
|
+
case "working":
|
|
57544
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(Clock, { className: "h-4 w-4 animate-pulse text-blue-500" });
|
|
57545
|
+
case "input_required":
|
|
57546
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TriangleAlert, { className: "h-4 w-4 text-yellow-500" });
|
|
57547
|
+
case "completed":
|
|
57548
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(CircleCheck, { className: "h-4 w-4 text-green-500" });
|
|
57549
|
+
case "failed":
|
|
57550
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(CircleX, { className: "h-4 w-4 text-red-500" });
|
|
57551
|
+
case "cancelled":
|
|
57552
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(CircleX, { className: "h-4 w-4 text-gray-500" });
|
|
57553
|
+
default:
|
|
57554
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(CirclePlay, { className: "h-4 w-4" });
|
|
57555
|
+
}
|
|
57556
|
+
};
|
|
57557
|
+
const TasksTab = ({
|
|
57558
|
+
tasks,
|
|
57559
|
+
listTasks,
|
|
57560
|
+
clearTasks,
|
|
57561
|
+
cancelTask,
|
|
57562
|
+
selectedTask,
|
|
57563
|
+
setSelectedTask,
|
|
57564
|
+
error,
|
|
57565
|
+
nextCursor
|
|
57566
|
+
}) => {
|
|
57567
|
+
const [isCancelling, setIsCancelling] = reactExports.useState(null);
|
|
57568
|
+
const displayedTask = selectedTask ? tasks.find((t) => t.taskId === selectedTask.taskId) || selectedTask : null;
|
|
57569
|
+
const handleCancel = async (taskId) => {
|
|
57570
|
+
setIsCancelling(taskId);
|
|
57571
|
+
try {
|
|
57572
|
+
await cancelTask(taskId);
|
|
57573
|
+
} finally {
|
|
57574
|
+
setIsCancelling(null);
|
|
57575
|
+
}
|
|
57576
|
+
};
|
|
57577
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(TabsContent, { value: "tasks", className: "flex-1 overflow-hidden p-0 m-0", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex h-full overflow-hidden p-4 gap-4", children: [
|
|
57578
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-1/3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57579
|
+
ListPane,
|
|
57580
|
+
{
|
|
57581
|
+
title: "Tasks",
|
|
57582
|
+
items: tasks,
|
|
57583
|
+
setSelectedItem: setSelectedTask,
|
|
57584
|
+
listItems: listTasks,
|
|
57585
|
+
clearItems: clearTasks,
|
|
57586
|
+
buttonText: nextCursor ? "List More Tasks" : "List Tasks",
|
|
57587
|
+
isButtonDisabled: !nextCursor && tasks.length > 0,
|
|
57588
|
+
renderItem: (task) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 overflow-hidden w-full", children: [
|
|
57589
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TaskStatusIcon, { status: task.status }),
|
|
57590
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col overflow-hidden", children: [
|
|
57591
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate font-medium", children: task.taskId }),
|
|
57592
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "truncate text-xs text-muted-foreground", children: [
|
|
57593
|
+
task.status,
|
|
57594
|
+
" -",
|
|
57595
|
+
" ",
|
|
57596
|
+
new Date(task.lastUpdatedAt).toLocaleString()
|
|
57597
|
+
] })
|
|
57598
|
+
] })
|
|
57599
|
+
] })
|
|
57600
|
+
}
|
|
57601
|
+
) }),
|
|
57602
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1 overflow-y-auto p-4 bg-background border border-border rounded-lg", children: [
|
|
57603
|
+
error && /* @__PURE__ */ jsxRuntimeExports.jsxs(Alert, { variant: "destructive", className: "mb-4", children: [
|
|
57604
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CircleAlert, { className: "h-4 w-4" }),
|
|
57605
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertTitle, { children: "Error" }),
|
|
57606
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(AlertDescription, { children: error })
|
|
57607
|
+
] }),
|
|
57608
|
+
displayedTask ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-6", children: [
|
|
57609
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between border-b pb-4", children: [
|
|
57610
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
57611
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-2xl font-bold tracking-tight", children: "Task Details" }),
|
|
57612
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-muted-foreground", children: [
|
|
57613
|
+
"ID: ",
|
|
57614
|
+
displayedTask.taskId
|
|
57615
|
+
] })
|
|
57616
|
+
] }),
|
|
57617
|
+
(displayedTask.status === "working" || displayedTask.status === "input_required") && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
57618
|
+
Button,
|
|
57619
|
+
{
|
|
57620
|
+
variant: "destructive",
|
|
57621
|
+
size: "sm",
|
|
57622
|
+
"aria-label": `Cancel task ${displayedTask.taskId}`,
|
|
57623
|
+
onClick: () => handleCancel(displayedTask.taskId),
|
|
57624
|
+
disabled: isCancelling === displayedTask.taskId,
|
|
57625
|
+
children: [
|
|
57626
|
+
isCancelling === displayedTask.taskId ? /* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "mr-2 h-4 w-4 animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(CircleX, { className: "mr-2 h-4 w-4" }),
|
|
57627
|
+
"Cancel Task"
|
|
57628
|
+
]
|
|
57629
|
+
}
|
|
57630
|
+
)
|
|
57631
|
+
] }),
|
|
57632
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
|
|
57633
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg border p-3", children: [
|
|
57634
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: "Status" }),
|
|
57635
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1 flex items-center gap-2", children: [
|
|
57636
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TaskStatusIcon, { status: displayedTask.status }),
|
|
57637
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
57638
|
+
"span",
|
|
57639
|
+
{
|
|
57640
|
+
className: cn(
|
|
57641
|
+
"font-semibold capitalize",
|
|
57642
|
+
displayedTask.status === "working" && "text-blue-500",
|
|
57643
|
+
displayedTask.status === "completed" && "text-green-500",
|
|
57644
|
+
displayedTask.status === "failed" && "text-red-500",
|
|
57645
|
+
displayedTask.status === "cancelled" && "text-gray-500",
|
|
57646
|
+
displayedTask.status === "input_required" && "text-yellow-500"
|
|
57647
|
+
),
|
|
57648
|
+
children: displayedTask.status.replace("_", " ")
|
|
57649
|
+
}
|
|
57650
|
+
)
|
|
57651
|
+
] })
|
|
57652
|
+
] }),
|
|
57653
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg border p-3", children: [
|
|
57654
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: "Last Updated" }),
|
|
57655
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 font-medium", children: new Date(displayedTask.lastUpdatedAt).toLocaleString() })
|
|
57656
|
+
] }),
|
|
57657
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg border p-3", children: [
|
|
57658
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: "Created At" }),
|
|
57659
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 font-medium", children: new Date(displayedTask.createdAt).toLocaleString() })
|
|
57660
|
+
] }),
|
|
57661
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg border p-3", children: [
|
|
57662
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: "TTL" }),
|
|
57663
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 font-medium", children: displayedTask.ttl === null ? "Infinite" : `${displayedTask.ttl}ms` })
|
|
57664
|
+
] })
|
|
57665
|
+
] }),
|
|
57666
|
+
displayedTask.statusMessage && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg border p-3", children: [
|
|
57667
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium text-muted-foreground", children: "Status Message" }),
|
|
57668
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-1 whitespace-pre-wrap", children: displayedTask.statusMessage })
|
|
57669
|
+
] }),
|
|
57670
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
57671
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-semibold", children: "Full Task Object" }),
|
|
57672
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-md border", children: /* @__PURE__ */ jsxRuntimeExports.jsx(JsonView, { data: displayedTask }) })
|
|
57673
|
+
] })
|
|
57674
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex h-full items-center justify-center text-muted-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
|
|
57675
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Clock, { className: "mx-auto mb-4 h-12 w-12 opacity-20" }),
|
|
57676
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-medium", children: "No Task Selected" }),
|
|
57677
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Select a task from the list to view its details." }),
|
|
57678
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
57679
|
+
Button,
|
|
57680
|
+
{
|
|
57681
|
+
variant: "outline",
|
|
57682
|
+
size: "sm",
|
|
57683
|
+
className: "mt-4",
|
|
57684
|
+
onClick: listTasks,
|
|
57685
|
+
children: [
|
|
57686
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "mr-2 h-4 w-4" }),
|
|
57687
|
+
"Refresh Tasks"
|
|
57688
|
+
]
|
|
57689
|
+
}
|
|
57690
|
+
)
|
|
57691
|
+
] }) })
|
|
57692
|
+
] })
|
|
57693
|
+
] }) });
|
|
57694
|
+
};
|
|
57200
57695
|
const ElicitationRequest = ({
|
|
57201
57696
|
request,
|
|
57202
57697
|
onResolve
|
|
@@ -57449,11 +57944,13 @@ const App = () => {
|
|
|
57449
57944
|
const [prompts, setPrompts] = reactExports.useState([]);
|
|
57450
57945
|
const [promptContent, setPromptContent] = reactExports.useState("");
|
|
57451
57946
|
const [tools, setTools] = reactExports.useState([]);
|
|
57947
|
+
const [tasks, setTasks] = reactExports.useState([]);
|
|
57452
57948
|
const [toolResult, setToolResult] = reactExports.useState(null);
|
|
57453
57949
|
const [errors2, setErrors] = reactExports.useState({
|
|
57454
57950
|
resources: null,
|
|
57455
57951
|
prompts: null,
|
|
57456
|
-
tools: null
|
|
57952
|
+
tools: null,
|
|
57953
|
+
tasks: null
|
|
57457
57954
|
});
|
|
57458
57955
|
const [command, setCommand] = reactExports.useState(getInitialCommand);
|
|
57459
57956
|
const [args, setArgs] = reactExports.useState(getInitialArgs);
|
|
@@ -57545,10 +58042,13 @@ const App = () => {
|
|
|
57545
58042
|
const [resourceSubscriptions, setResourceSubscriptions] = reactExports.useState(/* @__PURE__ */ new Set());
|
|
57546
58043
|
const [selectedPrompt, setSelectedPrompt] = reactExports.useState(null);
|
|
57547
58044
|
const [selectedTool, setSelectedTool] = reactExports.useState(null);
|
|
58045
|
+
const [selectedTask, setSelectedTask] = reactExports.useState(null);
|
|
58046
|
+
const [isPollingTask, setIsPollingTask] = reactExports.useState(false);
|
|
57548
58047
|
const [nextResourceCursor, setNextResourceCursor] = reactExports.useState();
|
|
57549
58048
|
const [nextResourceTemplateCursor, setNextResourceTemplateCursor] = reactExports.useState();
|
|
57550
58049
|
const [nextPromptCursor, setNextPromptCursor] = reactExports.useState();
|
|
57551
58050
|
const [nextToolCursor, setNextToolCursor] = reactExports.useState();
|
|
58051
|
+
const [nextTaskCursor, setNextTaskCursor] = reactExports.useState();
|
|
57552
58052
|
const progressTokenRef = reactExports.useRef(0);
|
|
57553
58053
|
const [activeTab, setActiveTab] = reactExports.useState(() => {
|
|
57554
58054
|
const hash = window.location.hash.slice(1);
|
|
@@ -57560,12 +58060,37 @@ const App = () => {
|
|
|
57560
58060
|
reactExports.useEffect(() => {
|
|
57561
58061
|
currentTabRef.current = activeTab;
|
|
57562
58062
|
}, [activeTab]);
|
|
58063
|
+
const navigateToOriginatingTab = (originatingTab) => {
|
|
58064
|
+
if (!originatingTab) return;
|
|
58065
|
+
const validTabs = [
|
|
58066
|
+
...serverCapabilities?.resources ? ["resources"] : [],
|
|
58067
|
+
...serverCapabilities?.prompts ? ["prompts"] : [],
|
|
58068
|
+
...serverCapabilities?.tools ? ["tools"] : [],
|
|
58069
|
+
...serverCapabilities?.tasks ? ["tasks"] : [],
|
|
58070
|
+
"ping",
|
|
58071
|
+
"sampling",
|
|
58072
|
+
"elicitations",
|
|
58073
|
+
"roots",
|
|
58074
|
+
"auth"
|
|
58075
|
+
];
|
|
58076
|
+
if (!validTabs.includes(originatingTab)) return;
|
|
58077
|
+
setActiveTab(originatingTab);
|
|
58078
|
+
window.location.hash = originatingTab;
|
|
58079
|
+
setTimeout(() => {
|
|
58080
|
+
setActiveTab(originatingTab);
|
|
58081
|
+
window.location.hash = originatingTab;
|
|
58082
|
+
}, 100);
|
|
58083
|
+
};
|
|
57563
58084
|
const { height: historyPaneHeight, handleDragStart } = useDraggablePane(300);
|
|
57564
58085
|
const {
|
|
57565
58086
|
width: sidebarWidth,
|
|
57566
58087
|
isDragging: isSidebarDragging,
|
|
57567
58088
|
handleDragStart: handleSidebarDragStart
|
|
57568
58089
|
} = useDraggableSidebar(320);
|
|
58090
|
+
const selectedTaskRef = reactExports.useRef(null);
|
|
58091
|
+
reactExports.useEffect(() => {
|
|
58092
|
+
selectedTaskRef.current = selectedTask;
|
|
58093
|
+
}, [selectedTask]);
|
|
57569
58094
|
const {
|
|
57570
58095
|
connectionStatus,
|
|
57571
58096
|
serverCapabilities,
|
|
@@ -57574,6 +58099,8 @@ const App = () => {
|
|
|
57574
58099
|
requestHistory,
|
|
57575
58100
|
clearRequestHistory,
|
|
57576
58101
|
makeRequest,
|
|
58102
|
+
cancelTask: cancelMcpTask,
|
|
58103
|
+
listTasks: listMcpTasks,
|
|
57577
58104
|
sendNotification,
|
|
57578
58105
|
handleCompletion,
|
|
57579
58106
|
completionsSupported,
|
|
@@ -57593,12 +58120,38 @@ const App = () => {
|
|
|
57593
58120
|
connectionType,
|
|
57594
58121
|
onNotification: (notification) => {
|
|
57595
58122
|
setNotifications((prev) => [...prev, notification]);
|
|
58123
|
+
if (notification.method === "notifications/tasks/list_changed") {
|
|
58124
|
+
void listTasks();
|
|
58125
|
+
}
|
|
58126
|
+
if (notification.method === "notifications/tasks/status") {
|
|
58127
|
+
const task = notification.params;
|
|
58128
|
+
setTasks((prev) => {
|
|
58129
|
+
const exists = prev.some((t) => t.taskId === task.taskId);
|
|
58130
|
+
if (exists) {
|
|
58131
|
+
return prev.map((t) => t.taskId === task.taskId ? task : t);
|
|
58132
|
+
} else {
|
|
58133
|
+
return [task, ...prev];
|
|
58134
|
+
}
|
|
58135
|
+
});
|
|
58136
|
+
if (selectedTaskRef.current?.taskId === task.taskId) {
|
|
58137
|
+
setSelectedTask(task);
|
|
58138
|
+
}
|
|
58139
|
+
}
|
|
57596
58140
|
},
|
|
57597
58141
|
onPendingRequest: (request, resolve2, reject) => {
|
|
58142
|
+
const currentTab = lastToolCallOriginTabRef.current;
|
|
57598
58143
|
setPendingSampleRequests((prev) => [
|
|
57599
58144
|
...prev,
|
|
57600
|
-
{
|
|
58145
|
+
{
|
|
58146
|
+
id: nextRequestId.current++,
|
|
58147
|
+
request,
|
|
58148
|
+
originatingTab: currentTab,
|
|
58149
|
+
resolve: resolve2,
|
|
58150
|
+
reject
|
|
58151
|
+
}
|
|
57601
58152
|
]);
|
|
58153
|
+
setActiveTab("sampling");
|
|
58154
|
+
window.location.hash = "sampling";
|
|
57602
58155
|
},
|
|
57603
58156
|
onElicitationRequest: (request, resolve2) => {
|
|
57604
58157
|
const currentTab = lastToolCallOriginTabRef.current;
|
|
@@ -57632,6 +58185,7 @@ const App = () => {
|
|
|
57632
58185
|
...serverCapabilities?.resources ? ["resources"] : [],
|
|
57633
58186
|
...serverCapabilities?.prompts ? ["prompts"] : [],
|
|
57634
58187
|
...serverCapabilities?.tools ? ["tools"] : [],
|
|
58188
|
+
...serverCapabilities?.tasks ? ["tasks"] : [],
|
|
57635
58189
|
"ping",
|
|
57636
58190
|
"sampling",
|
|
57637
58191
|
"elicitations",
|
|
@@ -57640,12 +58194,17 @@ const App = () => {
|
|
|
57640
58194
|
];
|
|
57641
58195
|
const isValidTab = validTabs.includes(hash);
|
|
57642
58196
|
if (!isValidTab) {
|
|
57643
|
-
const defaultTab = serverCapabilities?.resources ? "resources" : serverCapabilities?.prompts ? "prompts" : serverCapabilities?.tools ? "tools" : "ping";
|
|
58197
|
+
const defaultTab = serverCapabilities?.resources ? "resources" : serverCapabilities?.prompts ? "prompts" : serverCapabilities?.tools ? "tools" : serverCapabilities?.tasks ? "tasks" : "ping";
|
|
57644
58198
|
setActiveTab(defaultTab);
|
|
57645
58199
|
window.location.hash = defaultTab;
|
|
57646
58200
|
}
|
|
57647
58201
|
}
|
|
57648
58202
|
}, [serverCapabilities]);
|
|
58203
|
+
reactExports.useEffect(() => {
|
|
58204
|
+
if (mcpClient && activeTab === "tasks") {
|
|
58205
|
+
void listTasks();
|
|
58206
|
+
}
|
|
58207
|
+
}, [mcpClient, activeTab]);
|
|
57649
58208
|
reactExports.useEffect(() => {
|
|
57650
58209
|
localStorage.setItem("lastCommand", command);
|
|
57651
58210
|
}, [command]);
|
|
@@ -57820,7 +58379,7 @@ const App = () => {
|
|
|
57820
58379
|
}, [roots]);
|
|
57821
58380
|
reactExports.useEffect(() => {
|
|
57822
58381
|
if (mcpClient && !window.location.hash) {
|
|
57823
|
-
const defaultTab = serverCapabilities?.resources ? "resources" : serverCapabilities?.prompts ? "prompts" : serverCapabilities?.tools ? "tools" : "ping";
|
|
58382
|
+
const defaultTab = serverCapabilities?.resources ? "resources" : serverCapabilities?.prompts ? "prompts" : serverCapabilities?.tools ? "tools" : serverCapabilities?.tasks ? "tasks" : "ping";
|
|
57824
58383
|
window.location.hash = defaultTab;
|
|
57825
58384
|
} else if (!mcpClient && window.location.hash) {
|
|
57826
58385
|
window.history.replaceState(
|
|
@@ -57844,6 +58403,7 @@ const App = () => {
|
|
|
57844
58403
|
setPendingSampleRequests((prev) => {
|
|
57845
58404
|
const request = prev.find((r2) => r2.id === id2);
|
|
57846
58405
|
request?.resolve(result);
|
|
58406
|
+
navigateToOriginatingTab(request?.originatingTab);
|
|
57847
58407
|
return prev.filter((r2) => r2.id !== id2);
|
|
57848
58408
|
});
|
|
57849
58409
|
};
|
|
@@ -57851,6 +58411,7 @@ const App = () => {
|
|
|
57851
58411
|
setPendingSampleRequests((prev) => {
|
|
57852
58412
|
const request = prev.find((r2) => r2.id === id2);
|
|
57853
58413
|
request?.reject(new Error("Sampling request rejected"));
|
|
58414
|
+
navigateToOriginatingTab(request?.originatingTab);
|
|
57854
58415
|
return prev.filter((r2) => r2.id !== id2);
|
|
57855
58416
|
});
|
|
57856
58417
|
};
|
|
@@ -57865,6 +58426,7 @@ const App = () => {
|
|
|
57865
58426
|
...serverCapabilities?.resources ? ["resources"] : [],
|
|
57866
58427
|
...serverCapabilities?.prompts ? ["prompts"] : [],
|
|
57867
58428
|
...serverCapabilities?.tools ? ["tools"] : [],
|
|
58429
|
+
...serverCapabilities?.tasks ? ["tasks"] : [],
|
|
57868
58430
|
"ping",
|
|
57869
58431
|
"sampling",
|
|
57870
58432
|
"elicitations",
|
|
@@ -58015,7 +58577,7 @@ const App = () => {
|
|
|
58015
58577
|
setNextToolCursor(response.nextCursor);
|
|
58016
58578
|
cacheToolOutputSchemas(response.tools);
|
|
58017
58579
|
};
|
|
58018
|
-
const callTool = async (name2, params, toolMetadata) => {
|
|
58580
|
+
const callTool = async (name2, params, toolMetadata, runAsTask) => {
|
|
58019
58581
|
lastToolCallOriginTabRef.current = currentTabRef.current;
|
|
58020
58582
|
try {
|
|
58021
58583
|
const tool = tools.find((t) => t.name === name2);
|
|
@@ -58027,19 +58589,119 @@ const App = () => {
|
|
|
58027
58589
|
...toolMetadata
|
|
58028
58590
|
// Tool-specific metadata
|
|
58029
58591
|
};
|
|
58030
|
-
const
|
|
58031
|
-
|
|
58032
|
-
|
|
58033
|
-
|
|
58034
|
-
|
|
58035
|
-
|
|
58036
|
-
|
|
58592
|
+
const request = {
|
|
58593
|
+
method: "tools/call",
|
|
58594
|
+
params: {
|
|
58595
|
+
name: name2,
|
|
58596
|
+
arguments: cleanedParams,
|
|
58597
|
+
_meta: mergedMetadata
|
|
58598
|
+
}
|
|
58599
|
+
};
|
|
58600
|
+
if (runAsTask) {
|
|
58601
|
+
request.params = {
|
|
58602
|
+
...request.params,
|
|
58603
|
+
task: {
|
|
58604
|
+
ttl: getMCPTaskTtl(config2)
|
|
58037
58605
|
}
|
|
58038
|
-
}
|
|
58606
|
+
};
|
|
58607
|
+
}
|
|
58608
|
+
const response = await sendMCPRequest(
|
|
58609
|
+
request,
|
|
58039
58610
|
CompatibilityCallToolResultSchema,
|
|
58040
58611
|
"tools"
|
|
58041
58612
|
);
|
|
58042
|
-
|
|
58613
|
+
const isTaskResult = (res) => !!res && typeof res === "object" && "task" in res && !!res.task && typeof res.task === "object" && "taskId" in res.task;
|
|
58614
|
+
if (runAsTask && isTaskResult(response)) {
|
|
58615
|
+
const taskId = response.task.taskId;
|
|
58616
|
+
const pollInterval = response.task.pollInterval;
|
|
58617
|
+
setIsPollingTask(true);
|
|
58618
|
+
const initialResponseMeta = response && typeof response === "object" && "_meta" in response ? response._meta ?? {} : void 0;
|
|
58619
|
+
setToolResult({
|
|
58620
|
+
content: [
|
|
58621
|
+
{
|
|
58622
|
+
type: "text",
|
|
58623
|
+
text: `Task created: ${taskId}. Polling for status...`
|
|
58624
|
+
}
|
|
58625
|
+
],
|
|
58626
|
+
_meta: {
|
|
58627
|
+
...initialResponseMeta || {},
|
|
58628
|
+
"io.modelcontextprotocol/related-task": { taskId }
|
|
58629
|
+
}
|
|
58630
|
+
});
|
|
58631
|
+
let taskCompleted = false;
|
|
58632
|
+
while (!taskCompleted) {
|
|
58633
|
+
try {
|
|
58634
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
|
|
58635
|
+
const taskStatus = await sendMCPRequest(
|
|
58636
|
+
{
|
|
58637
|
+
method: "tasks/get",
|
|
58638
|
+
params: { taskId }
|
|
58639
|
+
},
|
|
58640
|
+
GetTaskResultSchema
|
|
58641
|
+
);
|
|
58642
|
+
if (taskStatus.status === "completed" || taskStatus.status === "failed" || taskStatus.status === "cancelled") {
|
|
58643
|
+
taskCompleted = true;
|
|
58644
|
+
console.log(
|
|
58645
|
+
`Polling complete for task ${taskId}: ${taskStatus.status}`
|
|
58646
|
+
);
|
|
58647
|
+
if (taskStatus.status === "completed") {
|
|
58648
|
+
console.log(`Fetching result for task ${taskId}`);
|
|
58649
|
+
const result = await sendMCPRequest(
|
|
58650
|
+
{
|
|
58651
|
+
method: "tasks/result",
|
|
58652
|
+
params: { taskId }
|
|
58653
|
+
},
|
|
58654
|
+
CompatibilityCallToolResultSchema
|
|
58655
|
+
);
|
|
58656
|
+
console.log(`Result received for task ${taskId}:`, result);
|
|
58657
|
+
setToolResult(result);
|
|
58658
|
+
void listTasks();
|
|
58659
|
+
} else {
|
|
58660
|
+
setToolResult({
|
|
58661
|
+
content: [
|
|
58662
|
+
{
|
|
58663
|
+
type: "text",
|
|
58664
|
+
text: `Task ${taskStatus.status}: ${taskStatus.statusMessage || "No additional information"}`
|
|
58665
|
+
}
|
|
58666
|
+
],
|
|
58667
|
+
isError: true
|
|
58668
|
+
});
|
|
58669
|
+
void listTasks();
|
|
58670
|
+
}
|
|
58671
|
+
} else {
|
|
58672
|
+
const pollingResponseMeta = response && typeof response === "object" && "_meta" in response ? response._meta ?? {} : void 0;
|
|
58673
|
+
setToolResult({
|
|
58674
|
+
content: [
|
|
58675
|
+
{
|
|
58676
|
+
type: "text",
|
|
58677
|
+
text: `Task status: ${taskStatus.status}${taskStatus.statusMessage ? ` - ${taskStatus.statusMessage}` : ""}. Polling...`
|
|
58678
|
+
}
|
|
58679
|
+
],
|
|
58680
|
+
_meta: {
|
|
58681
|
+
...pollingResponseMeta || {},
|
|
58682
|
+
"io.modelcontextprotocol/related-task": { taskId }
|
|
58683
|
+
}
|
|
58684
|
+
});
|
|
58685
|
+
void listTasks();
|
|
58686
|
+
}
|
|
58687
|
+
} catch (pollingError) {
|
|
58688
|
+
console.error("Error polling task status:", pollingError);
|
|
58689
|
+
setToolResult({
|
|
58690
|
+
content: [
|
|
58691
|
+
{
|
|
58692
|
+
type: "text",
|
|
58693
|
+
text: `Error polling task status: ${pollingError instanceof Error ? pollingError.message : String(pollingError)}`
|
|
58694
|
+
}
|
|
58695
|
+
],
|
|
58696
|
+
isError: true
|
|
58697
|
+
});
|
|
58698
|
+
taskCompleted = true;
|
|
58699
|
+
}
|
|
58700
|
+
}
|
|
58701
|
+
setIsPollingTask(false);
|
|
58702
|
+
} else {
|
|
58703
|
+
setToolResult(response);
|
|
58704
|
+
}
|
|
58043
58705
|
setErrors((prev) => ({ ...prev, tools: null }));
|
|
58044
58706
|
} catch (e) {
|
|
58045
58707
|
const toolResult2 = {
|
|
@@ -58055,6 +58717,34 @@ const App = () => {
|
|
|
58055
58717
|
setErrors((prev) => ({ ...prev, tools: null }));
|
|
58056
58718
|
}
|
|
58057
58719
|
};
|
|
58720
|
+
const listTasks = reactExports.useCallback(async () => {
|
|
58721
|
+
try {
|
|
58722
|
+
const response = await listMcpTasks(nextTaskCursor);
|
|
58723
|
+
setTasks(response.tasks);
|
|
58724
|
+
setNextTaskCursor(response.nextCursor);
|
|
58725
|
+
setErrors((prev) => ({ ...prev, tasks: null }));
|
|
58726
|
+
} catch (e) {
|
|
58727
|
+
setErrors((prev) => ({
|
|
58728
|
+
...prev,
|
|
58729
|
+
tasks: e.message ?? String(e)
|
|
58730
|
+
}));
|
|
58731
|
+
}
|
|
58732
|
+
}, [listMcpTasks, nextTaskCursor]);
|
|
58733
|
+
const cancelTask = async (taskId) => {
|
|
58734
|
+
try {
|
|
58735
|
+
const response = await cancelMcpTask(taskId);
|
|
58736
|
+
setTasks((prev) => prev.map((t) => t.taskId === taskId ? response : t));
|
|
58737
|
+
if (selectedTask?.taskId === taskId) {
|
|
58738
|
+
setSelectedTask(response);
|
|
58739
|
+
}
|
|
58740
|
+
clearError("tasks");
|
|
58741
|
+
} catch (e) {
|
|
58742
|
+
setErrors((prev) => ({
|
|
58743
|
+
...prev,
|
|
58744
|
+
tasks: e.message ?? String(e)
|
|
58745
|
+
}));
|
|
58746
|
+
}
|
|
58747
|
+
};
|
|
58058
58748
|
const handleRootsChange = async () => {
|
|
58059
58749
|
await sendNotification({ method: "notifications/roots/list_changed" });
|
|
58060
58750
|
};
|
|
@@ -58082,13 +58772,13 @@ const App = () => {
|
|
|
58082
58772
|
) });
|
|
58083
58773
|
if (window.location.pathname === "/oauth/callback") {
|
|
58084
58774
|
const OAuthCallback = React.lazy(
|
|
58085
|
-
() => __vitePreload(() => import("./OAuthCallback-
|
|
58775
|
+
() => __vitePreload(() => import("./OAuthCallback-C7u-W3fG.js"), true ? [] : void 0)
|
|
58086
58776
|
);
|
|
58087
58777
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthCallback, { onConnect: onOAuthConnect }) });
|
|
58088
58778
|
}
|
|
58089
58779
|
if (window.location.pathname === "/oauth/callback/debug") {
|
|
58090
58780
|
const OAuthDebugCallback = React.lazy(
|
|
58091
|
-
() => __vitePreload(() => import("./OAuthDebugCallback-
|
|
58781
|
+
() => __vitePreload(() => import("./OAuthDebugCallback-CJZOHlWo.js"), true ? [] : void 0)
|
|
58092
58782
|
);
|
|
58093
58783
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Loading..." }), children: /* @__PURE__ */ jsxRuntimeExports.jsx(OAuthDebugCallback, { onConnect: onOAuthDebugConnect }) });
|
|
58094
58784
|
}
|
|
@@ -58204,6 +58894,17 @@ const App = () => {
|
|
|
58204
58894
|
]
|
|
58205
58895
|
}
|
|
58206
58896
|
),
|
|
58897
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
58898
|
+
TabsTrigger,
|
|
58899
|
+
{
|
|
58900
|
+
value: "tasks",
|
|
58901
|
+
disabled: !serverCapabilities?.tasks,
|
|
58902
|
+
children: [
|
|
58903
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ListTodo, { className: "w-4 h-4 mr-2" }),
|
|
58904
|
+
"Tasks"
|
|
58905
|
+
]
|
|
58906
|
+
}
|
|
58907
|
+
),
|
|
58207
58908
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(TabsTrigger, { value: "ping", children: [
|
|
58208
58909
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Bell, { className: "w-4 h-4 mr-2" }),
|
|
58209
58910
|
"Ping"
|
|
@@ -58337,10 +59038,10 @@ const App = () => {
|
|
|
58337
59038
|
setNextToolCursor(void 0);
|
|
58338
59039
|
cacheToolOutputSchemas([]);
|
|
58339
59040
|
},
|
|
58340
|
-
callTool: async (name2, params, metadata22) => {
|
|
59041
|
+
callTool: async (name2, params, metadata22, runAsTask) => {
|
|
58341
59042
|
clearError("tools");
|
|
58342
59043
|
setToolResult(null);
|
|
58343
|
-
await callTool(name2, params, metadata22);
|
|
59044
|
+
await callTool(name2, params, metadata22, runAsTask);
|
|
58344
59045
|
},
|
|
58345
59046
|
selectedTool,
|
|
58346
59047
|
setSelectedTool: (tool) => {
|
|
@@ -58349,6 +59050,7 @@ const App = () => {
|
|
|
58349
59050
|
setToolResult(null);
|
|
58350
59051
|
},
|
|
58351
59052
|
toolResult,
|
|
59053
|
+
isPollingTask,
|
|
58352
59054
|
nextCursor: nextToolCursor,
|
|
58353
59055
|
error: errors2.tools,
|
|
58354
59056
|
resourceContent: resourceContentMap,
|
|
@@ -58358,6 +59060,28 @@ const App = () => {
|
|
|
58358
59060
|
}
|
|
58359
59061
|
}
|
|
58360
59062
|
),
|
|
59063
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
59064
|
+
TasksTab,
|
|
59065
|
+
{
|
|
59066
|
+
tasks,
|
|
59067
|
+
listTasks: () => {
|
|
59068
|
+
clearError("tasks");
|
|
59069
|
+
listTasks();
|
|
59070
|
+
},
|
|
59071
|
+
clearTasks: () => {
|
|
59072
|
+
setTasks([]);
|
|
59073
|
+
setNextTaskCursor(void 0);
|
|
59074
|
+
},
|
|
59075
|
+
cancelTask,
|
|
59076
|
+
selectedTask,
|
|
59077
|
+
setSelectedTask: (task) => {
|
|
59078
|
+
clearError("tasks");
|
|
59079
|
+
setSelectedTask(task);
|
|
59080
|
+
},
|
|
59081
|
+
error: errors2.tasks,
|
|
59082
|
+
nextCursor: nextTaskCursor
|
|
59083
|
+
}
|
|
59084
|
+
),
|
|
58361
59085
|
/* @__PURE__ */ jsxRuntimeExports.jsx(ConsoleTab, {}),
|
|
58362
59086
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
58363
59087
|
PingTab,
|