[SEP-2663] refactor!: remove 2025-11 experimental tasks (#2128)
This commit is contained in:
parent
600ba75f34
commit
c8d7401b46
2 changed files with 423 additions and 18280 deletions
|
|
@ -1,33 +0,0 @@
|
|||
import type { Task } from '@modelcontextprotocol/core';
|
||||
|
||||
/**
|
||||
* Polls the provided getTask function until the task reaches the desired status or times out.
|
||||
*/
|
||||
export async function waitForTaskStatus(
|
||||
getTask: (taskId: string) => Promise<Task | null | undefined>,
|
||||
taskId: string,
|
||||
desiredStatus: Task['status'],
|
||||
{
|
||||
intervalMs = 100,
|
||||
timeoutMs = 10_000
|
||||
}: {
|
||||
intervalMs?: number;
|
||||
timeoutMs?: number;
|
||||
} = {}
|
||||
): Promise<Task> {
|
||||
const start = Date.now();
|
||||
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
const task = await getTask(taskId);
|
||||
if (task && task.status === desiredStatus) {
|
||||
return task;
|
||||
}
|
||||
|
||||
if (Date.now() - start > timeoutMs) {
|
||||
throw new Error(`Timed out waiting for task ${taskId} to reach status ${desiredStatus}`);
|
||||
}
|
||||
|
||||
await new Promise(resolve => setTimeout(resolve, intervalMs));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,3 +1,2 @@
|
|||
export * from './helpers/http.js';
|
||||
export * from './helpers/oauth.js';
|
||||
export * from './helpers/tasks.js';
|
||||
|
|
|
|||
Loading…
Reference in a new issue