MCPcopy
hub / github.com/e-p-armstrong/augmentoolkit / fetchTaskParameters

Function fetchTaskParameters

atk-interface/src/api.js:321–334  ·  view source on GitHub ↗
(taskId)

Source from the content-addressed store, hash-verified

319 * @returns {Promise<object>} - Object containing { task_id, parameters }.
320 */
321export const fetchTaskParameters = async (taskId) => {
322 if (!taskId) throw new Error('Task ID is required for fetchTaskParameters');
323 const url = getApiUrl(`/tasks/${encodeURIComponent(taskId)}/parameters`);
324 const response = await fetch(url);
325 // Handle 404 specifically for parameters, as it might just mean they weren't stored/expired
326 if (response.status === 404) {
327 console.warn(`Parameters not found for task ${taskId}. They might not have been stored or may have expired.`);
328 return { task_id: taskId, parameters: null }; // Return null for parameters
329 }
330 if (!response.ok) {
331 await handleApiError(response, `fetch task parameters for ${taskId}`);
332 }
333 return response.json();
334};
335
336/**
337 * Interrupts a running task or revokes a pending one.

Callers

nothing calls this directly

Calls 2

getApiUrlFunction · 0.90
handleApiErrorFunction · 0.90

Tested by

no test coverage detected