diff --git a/src/lib/helpers/types.js b/src/lib/helpers/types.js index ce26278b..66834093 100644 --- a/src/lib/helpers/types.js +++ b/src/lib/helpers/types.js @@ -131,7 +131,7 @@ */ /** - * @typedef {Object} AgentTaskViewModel + * @typedef {Object} AgentTaskModel * @property {string} id - Task id. * @property {string} name - Task name. * @property {string} description - Description. @@ -141,6 +141,7 @@ * @property {Date} updated_datetime * @property {string} agent_id - Description. * @property {string} agent_name - Task detail. + * @property {string} direct_agent_id - Run task directly in this agent. */ diff --git a/src/lib/services/api-endpoints.js b/src/lib/services/api-endpoints.js index 0974cd9a..f4f1f128 100644 --- a/src/lib/services/api-endpoints.js +++ b/src/lib/services/api-endpoints.js @@ -25,6 +25,7 @@ export const endpoints = { // agent task agentTaskListUrl: `${host}/agent/tasks`, + agentTaskDetailUrl: `${host}/agent/{agentId}/task/{taskId}`, // agent instruct instructCompletionUrl: `${host}/instruct/{agentId}`, diff --git a/src/lib/services/task-service.js b/src/lib/services/task-service.js index a852a3eb..32c91adc 100644 --- a/src/lib/services/task-service.js +++ b/src/lib/services/task-service.js @@ -15,4 +15,16 @@ export async function getAgentTasks(filter) { } }); return response.data; +} + +/** + * Get task detail + * @param {string} agentId + * @param {string} taskid + * @returns {Promise} + */ +export async function getAgentTaskDetail(agentId, taskid) { + const url = replaceUrl(endpoints.agentTaskDetailUrl, { agentId: agentId, taskId: taskid }); + var response = await axios.get(url); + return response.data; } \ No newline at end of file diff --git a/src/routes/page/agent/[agentId]/task/+page.svelte b/src/routes/page/agent/[agentId]/task/+page.svelte deleted file mode 100644 index ab65c4e8..00000000 --- a/src/routes/page/agent/[agentId]/task/+page.svelte +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - {#if agent} - - - handleUserNodeSelected()}/> - - - {/if} - - \ No newline at end of file diff --git a/src/routes/page/agent/[agentId]/task/[template]/+page.svelte b/src/routes/page/agent/[agentId]/task/[template]/+page.svelte deleted file mode 100644 index 90ccf585..00000000 --- a/src/routes/page/agent/[agentId]/task/[template]/+page.svelte +++ /dev/null @@ -1,21 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/routes/page/agent/[agentId]/task/task-flow.svelte b/src/routes/page/agent/[agentId]/task/task-flow.svelte deleted file mode 100644 index 4ed11106..00000000 --- a/src/routes/page/agent/[agentId]/task/task-flow.svelte +++ /dev/null @@ -1,165 +0,0 @@ - - -
- {#if selectedNode && selectedNode.data.is_agent} - - {/if} - -
- -
-
\ No newline at end of file diff --git a/src/routes/page/task/+page.svelte b/src/routes/page/task/+page.svelte index fd3780ba..7ef17126 100644 --- a/src/routes/page/task/+page.svelte +++ b/src/routes/page/task/+page.svelte @@ -28,7 +28,7 @@ const firstPage = 1; const pageSize = 10; - /** @type {import('$types').PagedItems} */ + /** @type {import('$types').PagedItems} */ let tasks = { count: 0, items: [] }; /** @type {import('$types').AgentTaskFilter} */ @@ -198,7 +198,7 @@ Name Description Agent - Content + Details Updated Date Status Action @@ -217,6 +217,11 @@ {task.enabled ? "Enabled" : "Disabled"}
    +
  • + + + +
  • + {#if task?.direct_agent_id} + + {/if} + + +
    +
    \ No newline at end of file diff --git a/svelte.config.js b/svelte.config.js index 1419b8be..a8b50a3d 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -46,6 +46,8 @@ const config = { "/page/agent/[agentId]/train", "/page/conversation", "/page/conversation/[conversationId]", + "/page/task", + "/page/task/[taskId]", "/page/knowledge-base", "/page/plugin", "/page/plugin/[pluginId]",