@elqnt/agents 2.1.0 → 3.0.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/agent-models-BdtFKjV3.d.mts +2398 -0
- package/dist/agent-models-BdtFKjV3.d.ts +2398 -0
- package/dist/api/index.d.mts +60 -2
- package/dist/api/index.d.ts +60 -2
- package/dist/api/index.js +38 -2
- package/dist/api/index.js.map +1 -1
- package/dist/api/index.mjs +37 -1
- package/dist/api/server.d.mts +146 -0
- package/dist/api/server.d.ts +146 -0
- package/dist/api/server.js +226 -0
- package/dist/api/server.js.map +1 -0
- package/dist/api/server.mjs +226 -0
- package/dist/api/server.mjs.map +1 -0
- package/dist/chunk-44A5L2IY.js +491 -0
- package/dist/chunk-44A5L2IY.js.map +1 -0
- package/dist/{chunk-YYXYKVF4.js → chunk-ADOBVUUS.js} +104 -2
- package/dist/chunk-ADOBVUUS.js.map +1 -0
- package/dist/{chunk-IDBBO3QJ.mjs → chunk-EUELXX27.mjs} +136 -2
- package/dist/chunk-EUELXX27.mjs.map +1 -0
- package/dist/{chunk-LRVOTC2M.mjs → chunk-O3FM26FT.mjs} +104 -2
- package/dist/chunk-O3FM26FT.mjs.map +1 -0
- package/dist/chunk-RTUQ7WKT.mjs +434 -0
- package/dist/chunk-RTUQ7WKT.mjs.map +1 -0
- package/dist/chunk-VVYOTEM2.js +434 -0
- package/dist/chunk-VVYOTEM2.js.map +1 -0
- package/dist/hooks/index.d.mts +134 -5
- package/dist/hooks/index.d.ts +134 -5
- package/dist/hooks/index.js +15 -3
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +16 -4
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +180 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +181 -5
- package/dist/models/index.d.mts +713 -1995
- package/dist/models/index.d.ts +713 -1995
- package/dist/models/index.js +130 -2
- package/dist/models/index.js.map +1 -1
- package/dist/models/index.mjs +129 -1
- package/package.json +11 -6
- package/dist/chunk-EQBMH6T6.mjs +0 -398
- package/dist/chunk-EQBMH6T6.mjs.map +0 -1
- package/dist/chunk-IDBBO3QJ.mjs.map +0 -1
- package/dist/chunk-LRVOTC2M.mjs.map +0 -1
- package/dist/chunk-O77IWBPZ.js +0 -357
- package/dist/chunk-O77IWBPZ.js.map +0 -1
- package/dist/chunk-WL5S56WV.js +0 -398
- package/dist/chunk-WL5S56WV.js.map +0 -1
- package/dist/chunk-YYXYKVF4.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../api/index.ts"],"sourcesContent":["/**\n * Agents API functions\n *\n * Browser-side API client for agent operations.\n * Uses @elqnt/api-client for HTTP requests with automatic token management.\n */\n\nimport { browserApiRequest } from \"@elqnt/api-client/browser\";\nimport type { ApiResponse, ApiClientOptions } from \"@elqnt/api-client\";\nimport type { ResponseMetadata } from \"@elqnt/types\";\nimport type {\n Agent,\n AgentSummary,\n AgentResponse,\n ListAgentsResponse,\n ListAgentsSummaryResponse,\n Skill,\n SkillResponse,\n SkillsListResponse,\n GetSkillsByIDsResponse,\n SubAgent,\n SubAgentResponse,\n SubAgentsListResponse,\n AgentWidget,\n AgentWidgetResponse,\n ListAgentWidgetsResponse,\n SkillUserConfig,\n SkillUserConfigResponse,\n SkillUserConfigListResponse,\n ResolveSkillConfigResponse,\n ToolDefinition,\n ToolDefinitionResponse,\n ToolDefinitionsListResponse,\n GetToolDefinitionsByIDsResponse,\n AgentJob,\n AgentJobResponse,\n AgentJobsListResponse,\n} from \"../models\";\n\n// =============================================================================\n// AGENTS\n// =============================================================================\n\nexport async function listAgentsApi(options: ApiClientOptions): Promise<ApiResponse<ListAgentsResponse>> {\n return browserApiRequest(\"/api/v1/agents\", { method: \"GET\", ...options });\n}\n\nexport async function listAgentsSummaryApi(options: ApiClientOptions): Promise<ApiResponse<ListAgentsSummaryResponse>> {\n return browserApiRequest(\"/api/v1/agents/summary\", { method: \"GET\", ...options });\n}\n\nexport async function getAgentApi(agentId: string, options: ApiClientOptions): Promise<ApiResponse<AgentResponse>> {\n return browserApiRequest(`/api/v1/agents/${agentId}`, { method: \"GET\", ...options });\n}\n\nexport async function createAgentApi(agent: Partial<Agent>, options: ApiClientOptions): Promise<ApiResponse<AgentResponse>> {\n return browserApiRequest(\"/api/v1/agents\", { method: \"POST\", body: agent, ...options });\n}\n\nexport async function updateAgentApi(agentId: string, agent: Partial<Agent>, options: ApiClientOptions): Promise<ApiResponse<AgentResponse>> {\n return browserApiRequest(`/api/v1/agents/${agentId}`, { method: \"PUT\", body: agent, ...options });\n}\n\nexport async function deleteAgentApi(agentId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/agents/${agentId}`, { method: \"DELETE\", ...options });\n}\n\nexport async function getDefaultAgentApi(options: ApiClientOptions): Promise<ApiResponse<AgentResponse>> {\n return browserApiRequest(\"/api/v1/agents/default\", { method: \"GET\", ...options });\n}\n\n// =============================================================================\n// SKILLS\n// =============================================================================\n\nexport async function listSkillsApi(options: ApiClientOptions): Promise<ApiResponse<SkillsListResponse>> {\n return browserApiRequest(\"/api/v1/skills\", { method: \"GET\", ...options });\n}\n\nexport async function getSkillApi(skillId: string, options: ApiClientOptions): Promise<ApiResponse<SkillResponse>> {\n return browserApiRequest(`/api/v1/skills/${skillId}`, { method: \"GET\", ...options });\n}\n\nexport async function getSkillsByIdsApi(ids: string[], options: ApiClientOptions): Promise<ApiResponse<GetSkillsByIDsResponse>> {\n return browserApiRequest(\"/api/v1/skills/by-ids\", { method: \"POST\", body: { ids }, ...options });\n}\n\nexport async function createSkillApi(skill: Partial<Skill>, options: ApiClientOptions): Promise<ApiResponse<SkillResponse>> {\n return browserApiRequest(\"/api/v1/skills\", { method: \"POST\", body: skill, ...options });\n}\n\nexport async function updateSkillApi(skillId: string, skill: Partial<Skill>, options: ApiClientOptions): Promise<ApiResponse<SkillResponse>> {\n return browserApiRequest(`/api/v1/skills/${skillId}`, { method: \"PUT\", body: skill, ...options });\n}\n\nexport async function deleteSkillApi(skillId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/skills/${skillId}`, { method: \"DELETE\", ...options });\n}\n\nexport async function searchSkillsApi(\n query: string,\n options: ApiClientOptions & { category?: string; limit?: number }\n): Promise<ApiResponse<SkillsListResponse>> {\n const params = new URLSearchParams();\n params.set(\"q\", query);\n if (options.category) params.set(\"category\", options.category);\n if (options.limit) params.set(\"limit\", String(options.limit));\n return browserApiRequest(`/api/v1/skills/search?${params.toString()}`, { method: \"GET\", ...options });\n}\n\n// =============================================================================\n// SKILL USER CONFIG\n// =============================================================================\n\nexport async function getSkillUserConfigApi(\n skillId: string,\n options: ApiClientOptions & { agentId?: string }\n): Promise<ApiResponse<SkillUserConfigResponse>> {\n const params = new URLSearchParams();\n if (options.agentId) params.set(\"agentId\", options.agentId);\n const query = params.toString();\n return browserApiRequest(`/api/v1/skills/${skillId}/user-config${query ? `?${query}` : \"\"}`, {\n method: \"GET\",\n ...options,\n });\n}\n\nexport async function updateSkillUserConfigApi(\n skillId: string,\n data: {\n enabled?: boolean;\n displayOrder?: number;\n config?: Record<string, unknown>;\n agentId?: string;\n },\n options: ApiClientOptions\n): Promise<ApiResponse<SkillUserConfigResponse>> {\n return browserApiRequest(`/api/v1/skills/${skillId}/user-config`, {\n method: \"PUT\",\n body: data,\n ...options,\n });\n}\n\nexport async function deleteSkillUserConfigApi(\n skillId: string,\n options: ApiClientOptions & { agentId?: string }\n): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n const params = new URLSearchParams();\n if (options.agentId) params.set(\"agentId\", options.agentId);\n const query = params.toString();\n return browserApiRequest(`/api/v1/skills/${skillId}/user-config${query ? `?${query}` : \"\"}`, {\n method: \"DELETE\",\n ...options,\n });\n}\n\nexport async function listSkillUserConfigsApi(\n options: ApiClientOptions & { agentId?: string; limit?: number; offset?: number }\n): Promise<ApiResponse<SkillUserConfigListResponse>> {\n const params = new URLSearchParams();\n if (options.agentId) params.set(\"agentId\", options.agentId);\n if (options.limit) params.set(\"limit\", String(options.limit));\n if (options.offset) params.set(\"offset\", String(options.offset));\n const query = params.toString();\n return browserApiRequest(`/api/v1/skills/user-configs${query ? `?${query}` : \"\"}`, {\n method: \"GET\",\n ...options,\n });\n}\n\nexport async function resolveSkillConfigApi(\n skillId: string,\n agentId: string,\n options: ApiClientOptions\n): Promise<ApiResponse<ResolveSkillConfigResponse>> {\n return browserApiRequest(`/api/v1/skills/${skillId}/resolve-config?agentId=${agentId}`, {\n method: \"GET\",\n ...options,\n });\n}\n\n// =============================================================================\n// SUB-AGENTS\n// =============================================================================\n\nexport async function listSubAgentsApi(\n options: ApiClientOptions & { onlySystem?: boolean; enabled?: boolean }\n): Promise<ApiResponse<SubAgentsListResponse>> {\n const params = new URLSearchParams();\n if (options.onlySystem !== undefined) params.set(\"onlySystem\", String(options.onlySystem));\n if (options.enabled !== undefined) params.set(\"enabled\", String(options.enabled));\n const queryString = params.toString();\n return browserApiRequest(`/api/v1/subagents${queryString ? `?${queryString}` : \"\"}`, { method: \"GET\", ...options });\n}\n\nexport async function getSubAgentApi(subAgentId: string, options: ApiClientOptions): Promise<ApiResponse<SubAgentResponse>> {\n return browserApiRequest(`/api/v1/subagents/${subAgentId}`, { method: \"GET\", ...options });\n}\n\nexport async function createSubAgentApi(subAgent: Partial<SubAgent>, options: ApiClientOptions): Promise<ApiResponse<SubAgentResponse>> {\n return browserApiRequest(\"/api/v1/subagents\", { method: \"POST\", body: { subAgent }, ...options });\n}\n\nexport async function updateSubAgentApi(subAgentId: string, subAgent: Partial<SubAgent>, options: ApiClientOptions): Promise<ApiResponse<SubAgentResponse>> {\n return browserApiRequest(`/api/v1/subagents/${subAgentId}`, { method: \"PUT\", body: { subAgent }, ...options });\n}\n\nexport async function deleteSubAgentApi(subAgentId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/subagents/${subAgentId}`, { method: \"DELETE\", ...options });\n}\n\n// =============================================================================\n// WIDGETS\n// =============================================================================\n\nexport async function listWidgetsApi(agentId: string, options: ApiClientOptions): Promise<ApiResponse<ListAgentWidgetsResponse>> {\n return browserApiRequest(`/api/v1/agents/${agentId}/widgets`, { method: \"GET\", ...options });\n}\n\nexport async function getDefaultWidgetApi(agentId: string, options: ApiClientOptions): Promise<ApiResponse<AgentWidgetResponse>> {\n return browserApiRequest(`/api/v1/agents/${agentId}/widgets/default`, { method: \"GET\", ...options });\n}\n\nexport async function createWidgetApi(agentId: string, widget: Partial<AgentWidget>, options: ApiClientOptions): Promise<ApiResponse<AgentWidgetResponse>> {\n return browserApiRequest(`/api/v1/agents/${agentId}/widgets`, { method: \"POST\", body: { widget }, ...options });\n}\n\nexport async function getWidgetApi(widgetId: string, options: ApiClientOptions): Promise<ApiResponse<AgentWidgetResponse>> {\n return browserApiRequest(`/api/v1/widgets/${widgetId}`, { method: \"GET\", ...options });\n}\n\nexport async function getWidgetByWidgetIdApi(widgetId: string, baseUrl: string): Promise<ApiResponse<AgentWidgetResponse>> {\n return browserApiRequest(`/api/v1/widgets/by-widget-id/${widgetId}`, { method: \"GET\", baseUrl, orgId: \"\" });\n}\n\nexport async function updateWidgetApi(widgetId: string, widget: Partial<AgentWidget>, options: ApiClientOptions): Promise<ApiResponse<AgentWidgetResponse>> {\n return browserApiRequest(`/api/v1/widgets/${widgetId}`, { method: \"PUT\", body: { widget }, ...options });\n}\n\nexport async function deleteWidgetApi(widgetId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/widgets/${widgetId}`, { method: \"DELETE\", ...options });\n}\n\nexport async function setDefaultWidgetApi(widgetId: string, agentId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/widgets/${widgetId}/default`, { method: \"POST\", body: { agentId }, ...options });\n}\n\n// =============================================================================\n// ANALYTICS\n// =============================================================================\n\nexport interface DateFilter {\n from?: string;\n to?: string;\n}\n\nexport interface AnalyticsDataResponse {\n data: unknown[];\n metadata: ResponseMetadata;\n}\n\nexport async function getAgentChatsAnalyticsApi(\n params: { date_filter: DateFilter; agent_id?: string },\n options: ApiClientOptions\n): Promise<ApiResponse<AnalyticsDataResponse>> {\n return browserApiRequest(\"/api/v1/analytics/agents/chats\", {\n method: \"POST\",\n body: params,\n ...options,\n });\n}\n\nexport async function getAgentCSATAnalyticsApi(\n params: { date_filter: DateFilter; agent_id?: string },\n options: ApiClientOptions\n): Promise<ApiResponse<AnalyticsDataResponse>> {\n return browserApiRequest(\"/api/v1/analytics/agents/csat\", {\n method: \"POST\",\n body: params,\n ...options,\n });\n}\n\nexport async function getAgentListAnalyticsApi(\n options: ApiClientOptions\n): Promise<ApiResponse<AnalyticsDataResponse>> {\n return browserApiRequest(\"/api/v1/analytics/agents\", {\n method: \"GET\",\n ...options,\n });\n}\n\nexport async function getTaskOutcomesApi(\n params: { date_filter: DateFilter },\n options: ApiClientOptions\n): Promise<ApiResponse<AnalyticsDataResponse>> {\n return browserApiRequest(\"/api/v1/analytics/tasks\", {\n method: \"POST\",\n body: params,\n ...options,\n });\n}\n\n// =============================================================================\n// TOOL DEFINITIONS\n// =============================================================================\n\nexport async function listToolDefinitionsApi(\n options: ApiClientOptions & { onlySystem?: boolean; enabled?: boolean; limit?: number; offset?: number }\n): Promise<ApiResponse<ToolDefinitionsListResponse>> {\n const params = new URLSearchParams();\n if (options.onlySystem !== undefined) params.set(\"onlySystem\", String(options.onlySystem));\n if (options.enabled !== undefined) params.set(\"enabled\", String(options.enabled));\n if (options.limit !== undefined) params.set(\"limit\", String(options.limit));\n if (options.offset !== undefined) params.set(\"offset\", String(options.offset));\n const queryString = params.toString();\n return browserApiRequest(`/api/v1/tool-definitions${queryString ? `?${queryString}` : \"\"}`, { method: \"GET\", ...options });\n}\n\nexport async function getToolDefinitionApi(toolDefId: string, options: ApiClientOptions): Promise<ApiResponse<ToolDefinitionResponse>> {\n return browserApiRequest(`/api/v1/tool-definitions/${toolDefId}`, { method: \"GET\", ...options });\n}\n\nexport async function getToolDefinitionsByIdsApi(ids: string[], options: ApiClientOptions): Promise<ApiResponse<GetToolDefinitionsByIDsResponse>> {\n return browserApiRequest(\"/api/v1/tool-definitions/by-ids\", { method: \"POST\", body: { ids }, ...options });\n}\n\nexport async function createToolDefinitionApi(toolDefinition: Partial<ToolDefinition>, options: ApiClientOptions): Promise<ApiResponse<ToolDefinitionResponse>> {\n return browserApiRequest(\"/api/v1/tool-definitions\", { method: \"POST\", body: { toolDefinition }, ...options });\n}\n\nexport async function updateToolDefinitionApi(toolDefId: string, toolDefinition: Partial<ToolDefinition>, options: ApiClientOptions): Promise<ApiResponse<ToolDefinitionResponse>> {\n return browserApiRequest(`/api/v1/tool-definitions/${toolDefId}`, { method: \"PUT\", body: { toolDefinition }, ...options });\n}\n\nexport async function deleteToolDefinitionApi(toolDefId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/tool-definitions/${toolDefId}`, { method: \"DELETE\", ...options });\n}\n\n// =============================================================================\n// AGENT JOBS\n// =============================================================================\n\nexport async function listAgentJobsApi(\n options: ApiClientOptions & {\n agentId?: string;\n ownerId?: string;\n scope?: string;\n status?: string;\n frequency?: string;\n limit?: number;\n offset?: number;\n }\n): Promise<ApiResponse<AgentJobsListResponse>> {\n const params = new URLSearchParams();\n if (options.agentId) params.set(\"agentId\", options.agentId);\n if (options.ownerId) params.set(\"ownerId\", options.ownerId);\n if (options.scope) params.set(\"scope\", options.scope);\n if (options.status) params.set(\"status\", options.status);\n if (options.frequency) params.set(\"frequency\", options.frequency);\n if (options.limit !== undefined) params.set(\"limit\", String(options.limit));\n if (options.offset !== undefined) params.set(\"offset\", String(options.offset));\n const queryString = params.toString();\n return browserApiRequest(`/api/v1/agent-jobs${queryString ? `?${queryString}` : \"\"}`, { method: \"GET\", ...options });\n}\n\nexport async function getAgentJobApi(jobId: string, options: ApiClientOptions): Promise<ApiResponse<AgentJobResponse>> {\n return browserApiRequest(`/api/v1/agent-jobs/${jobId}`, { method: \"GET\", ...options });\n}\n\nexport async function createAgentJobApi(job: Partial<AgentJob>, options: ApiClientOptions): Promise<ApiResponse<AgentJobResponse>> {\n return browserApiRequest(\"/api/v1/agent-jobs\", { method: \"POST\", body: { job }, ...options });\n}\n\nexport async function updateAgentJobApi(jobId: string, job: Partial<AgentJob>, options: ApiClientOptions): Promise<ApiResponse<AgentJobResponse>> {\n return browserApiRequest(`/api/v1/agent-jobs/${jobId}`, { method: \"PUT\", body: { job }, ...options });\n}\n\nexport async function deleteAgentJobApi(jobId: string, options: ApiClientOptions): Promise<ApiResponse<{ success: boolean; metadata: ResponseMetadata }>> {\n return browserApiRequest(`/api/v1/agent-jobs/${jobId}`, { method: \"DELETE\", ...options });\n}\n\nexport async function pauseAgentJobApi(jobId: string, options: ApiClientOptions): Promise<ApiResponse<AgentJobResponse>> {\n return browserApiRequest(`/api/v1/agent-jobs/${jobId}/pause`, { method: \"POST\", ...options });\n}\n\nexport async function resumeAgentJobApi(jobId: string, options: ApiClientOptions): Promise<ApiResponse<AgentJobResponse>> {\n return browserApiRequest(`/api/v1/agent-jobs/${jobId}/resume`, { method: \"POST\", ...options });\n}\n\n// =============================================================================\n// SKILL CATEGORIES\n// =============================================================================\n\nexport interface SkillCategoriesResponse {\n categories: string[];\n metadata: ResponseMetadata;\n}\n\nexport async function getSkillCategoriesApi(options: ApiClientOptions): Promise<ApiResponse<SkillCategoriesResponse>> {\n return browserApiRequest(\"/api/v1/skills/categories\", { method: \"GET\", ...options });\n}\n\n// Re-export types from models\nexport type {\n Agent,\n AgentSummary,\n Skill,\n SubAgent,\n AgentWidget,\n SkillUserConfig,\n SkillUserConfigResponse,\n SkillUserConfigListResponse,\n ResolveSkillConfigResponse,\n ToolDefinition,\n ToolDefinitionResponse,\n ToolDefinitionsListResponse,\n GetToolDefinitionsByIDsResponse,\n AgentJob,\n AgentJobResponse,\n AgentJobsListResponse,\n} from \"../models\";\n"],"mappings":";;;AAOA,SAAS,yBAAyB;AAoClC,eAAsB,cAAc,SAAqE;AACvG,SAAO,kBAAkB,kBAAkB,EAAE,QAAQ,OAAO,GAAG,QAAQ,CAAC;AAC1E;AAEA,eAAsB,qBAAqB,SAA4E;AACrH,SAAO,kBAAkB,0BAA0B,EAAE,QAAQ,OAAO,GAAG,QAAQ,CAAC;AAClF;AAEA,eAAsB,YAAY,SAAiB,SAAgE;AACjH,SAAO,kBAAkB,kBAAkB,OAAO,IAAI,EAAE,QAAQ,OAAO,GAAG,QAAQ,CAAC;AACrF;AAEA,eAAsB,eAAe,OAAuB,SAAgE;AAC1H,SAAO,kBAAkB,kBAAkB,EAAE,QAAQ,QAAQ,MAAM,OAAO,GAAG,QAAQ,CAAC;AACxF;AAEA,eAAsB,eAAe,SAAiB,OAAuB,SAAgE;AAC3I,SAAO,kBAAkB,kBAAkB,OAAO,IAAI,EAAE,QAAQ,OAAO,MAAM,OAAO,GAAG,QAAQ,CAAC;AAClG;AAEA,eAAsB,eAAe,SAAiB,SAAmG;AACvJ,SAAO,kBAAkB,kBAAkB,OAAO,IAAI,EAAE,QAAQ,UAAU,GAAG,QAAQ,CAAC;AACxF;AAEA,eAAsB,mBAAmB,SAAgE;AACvG,SAAO,kBAAkB,0BAA0B,EAAE,QAAQ,OAAO,GAAG,QAAQ,CAAC;AAClF;AAMA,eAAsB,cAAc,SAAqE;AACvG,SAAO,kBAAkB,kBAAkB,EAAE,QAAQ,OAAO,GAAG,QAAQ,CAAC;AAC1E;AAEA,eAAsB,YAAY,SAAiB,SAAgE;AACjH,SAAO,kBAAkB,kBAAkB,OAAO,IAAI,EAAE,QAAQ,OAAO,GAAG,QAAQ,CAAC;AACrF;AAEA,eAAsB,kBAA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
|
+
createAgentApi,
|
|
4
|
+
createAgentJobApi,
|
|
5
|
+
createSkillApi,
|
|
6
|
+
createSubAgentApi,
|
|
7
|
+
createToolDefinitionApi,
|
|
8
|
+
createWidgetApi,
|
|
9
|
+
deleteAgentApi,
|
|
10
|
+
deleteAgentJobApi,
|
|
11
|
+
deleteSkillApi,
|
|
12
|
+
deleteSubAgentApi,
|
|
13
|
+
deleteToolDefinitionApi,
|
|
14
|
+
deleteWidgetApi,
|
|
15
|
+
getAgentApi,
|
|
16
|
+
getAgentJobApi,
|
|
17
|
+
getDefaultAgentApi,
|
|
18
|
+
getDefaultWidgetApi,
|
|
19
|
+
getSkillApi,
|
|
20
|
+
getSkillCategoriesApi,
|
|
21
|
+
getSubAgentApi,
|
|
22
|
+
getToolDefinitionApi,
|
|
23
|
+
getToolDefinitionsByIdsApi,
|
|
24
|
+
getWidgetApi,
|
|
25
|
+
listAgentJobsApi,
|
|
26
|
+
listAgentsApi,
|
|
27
|
+
listAgentsSummaryApi,
|
|
28
|
+
listSkillsApi,
|
|
29
|
+
listSubAgentsApi,
|
|
30
|
+
listToolDefinitionsApi,
|
|
31
|
+
listWidgetsApi,
|
|
32
|
+
pauseAgentJobApi,
|
|
33
|
+
resumeAgentJobApi,
|
|
34
|
+
setDefaultWidgetApi,
|
|
35
|
+
updateAgentApi,
|
|
36
|
+
updateAgentJobApi,
|
|
37
|
+
updateSkillApi,
|
|
38
|
+
updateSubAgentApi,
|
|
39
|
+
updateToolDefinitionApi,
|
|
40
|
+
updateWidgetApi
|
|
41
|
+
} from "./chunk-O3FM26FT.mjs";
|
|
42
|
+
|
|
43
|
+
// hooks/index.ts
|
|
44
|
+
import { useMemo } from "react";
|
|
45
|
+
|
|
46
|
+
// hooks/use-async.ts
|
|
47
|
+
import { useState, useCallback, useRef } from "react";
|
|
48
|
+
function useAsync(asyncFn, options) {
|
|
49
|
+
const [error, setError] = useState(null);
|
|
50
|
+
const requestCountRef = useRef(0);
|
|
51
|
+
const [loading, setLoading] = useState(false);
|
|
52
|
+
const execute = useCallback(
|
|
53
|
+
async (...args) => {
|
|
54
|
+
requestCountRef.current += 1;
|
|
55
|
+
setLoading(true);
|
|
56
|
+
setError(null);
|
|
57
|
+
try {
|
|
58
|
+
return await asyncFn(...args);
|
|
59
|
+
} catch (err) {
|
|
60
|
+
const message = err instanceof Error ? err.message : "An error occurred";
|
|
61
|
+
setError(message);
|
|
62
|
+
options?.onError?.(message);
|
|
63
|
+
throw err;
|
|
64
|
+
} finally {
|
|
65
|
+
requestCountRef.current -= 1;
|
|
66
|
+
if (requestCountRef.current === 0) {
|
|
67
|
+
setLoading(false);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
[asyncFn, options]
|
|
72
|
+
);
|
|
73
|
+
const clearError = useCallback(() => setError(null), []);
|
|
74
|
+
return { execute, loading, error, clearError };
|
|
75
|
+
}
|
|
76
|
+
function useApiAsync(asyncFn, extractor, defaultValue, options) {
|
|
77
|
+
const [error, setError] = useState(null);
|
|
78
|
+
const requestCountRef = useRef(0);
|
|
79
|
+
const [loading, setLoading] = useState(false);
|
|
80
|
+
const execute = useCallback(
|
|
81
|
+
async (...args) => {
|
|
82
|
+
requestCountRef.current += 1;
|
|
83
|
+
setLoading(true);
|
|
84
|
+
setError(null);
|
|
85
|
+
try {
|
|
86
|
+
const response = await asyncFn(...args);
|
|
87
|
+
if (response.error) {
|
|
88
|
+
setError(response.error);
|
|
89
|
+
options?.onError?.(response.error);
|
|
90
|
+
return defaultValue;
|
|
91
|
+
}
|
|
92
|
+
return response.data ? extractor(response.data) : defaultValue;
|
|
93
|
+
} catch (err) {
|
|
94
|
+
const message = err instanceof Error ? err.message : "An error occurred";
|
|
95
|
+
setError(message);
|
|
96
|
+
options?.onError?.(message);
|
|
97
|
+
return defaultValue;
|
|
98
|
+
} finally {
|
|
99
|
+
requestCountRef.current -= 1;
|
|
100
|
+
if (requestCountRef.current === 0) {
|
|
101
|
+
setLoading(false);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
[asyncFn, extractor, defaultValue, options]
|
|
106
|
+
);
|
|
107
|
+
const clearError = useCallback(() => setError(null), []);
|
|
108
|
+
return { execute, loading, error, clearError };
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// hooks/use-options-ref.ts
|
|
112
|
+
import { useRef as useRef2, useEffect } from "react";
|
|
113
|
+
function useOptionsRef(options) {
|
|
114
|
+
const optionsRef = useRef2(options);
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
optionsRef.current = options;
|
|
117
|
+
}, [options]);
|
|
118
|
+
return optionsRef;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// hooks/index.ts
|
|
122
|
+
function useAgents(options) {
|
|
123
|
+
const optionsRef = useOptionsRef(options);
|
|
124
|
+
const { execute: listAgents, loading: listLoading, error: listError } = useApiAsync(
|
|
125
|
+
() => listAgentsApi(optionsRef.current),
|
|
126
|
+
(data) => data.agents,
|
|
127
|
+
[]
|
|
128
|
+
);
|
|
129
|
+
const { execute: listAgentSummaries, loading: listSummaryLoading, error: listSummaryError } = useApiAsync(
|
|
130
|
+
() => listAgentsSummaryApi(optionsRef.current),
|
|
131
|
+
(data) => data.agents,
|
|
132
|
+
[]
|
|
133
|
+
);
|
|
134
|
+
const { execute: getAgent, loading: getLoading, error: getError } = useApiAsync(
|
|
135
|
+
(agentId) => getAgentApi(agentId, optionsRef.current),
|
|
136
|
+
(data) => data.agent || null,
|
|
137
|
+
null
|
|
138
|
+
);
|
|
139
|
+
const { execute: createAgent, loading: createLoading, error: createError } = useApiAsync(
|
|
140
|
+
(agent) => createAgentApi(agent, optionsRef.current),
|
|
141
|
+
(data) => data.agent || null,
|
|
142
|
+
null
|
|
143
|
+
);
|
|
144
|
+
const { execute: updateAgent, loading: updateLoading, error: updateError } = useApiAsync(
|
|
145
|
+
(agentId, agent) => updateAgentApi(agentId, agent, optionsRef.current),
|
|
146
|
+
(data) => data.agent || null,
|
|
147
|
+
null
|
|
148
|
+
);
|
|
149
|
+
const { execute: deleteAgent, loading: deleteLoading, error: deleteError } = useApiAsync(
|
|
150
|
+
(agentId) => deleteAgentApi(agentId, optionsRef.current),
|
|
151
|
+
() => true,
|
|
152
|
+
false
|
|
153
|
+
);
|
|
154
|
+
const { execute: getDefaultAgent, loading: defaultLoading, error: defaultError } = useApiAsync(
|
|
155
|
+
() => getDefaultAgentApi(optionsRef.current),
|
|
156
|
+
(data) => data.agent || null,
|
|
157
|
+
null
|
|
158
|
+
);
|
|
159
|
+
const loading = listLoading || listSummaryLoading || getLoading || createLoading || updateLoading || deleteLoading || defaultLoading;
|
|
160
|
+
const error = listError || listSummaryError || getError || createError || updateError || deleteError || defaultError;
|
|
161
|
+
return useMemo(
|
|
162
|
+
() => ({
|
|
163
|
+
loading,
|
|
164
|
+
error,
|
|
165
|
+
listAgents,
|
|
166
|
+
listAgentSummaries,
|
|
167
|
+
getAgent,
|
|
168
|
+
createAgent,
|
|
169
|
+
updateAgent,
|
|
170
|
+
deleteAgent,
|
|
171
|
+
getDefaultAgent
|
|
172
|
+
}),
|
|
173
|
+
[loading, error, listAgents, listAgentSummaries, getAgent, createAgent, updateAgent, deleteAgent, getDefaultAgent]
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
function useSkills(options) {
|
|
177
|
+
const optionsRef = useOptionsRef(options);
|
|
178
|
+
const { execute: listSkills, loading: listLoading, error: listError } = useApiAsync(
|
|
179
|
+
() => listSkillsApi(optionsRef.current),
|
|
180
|
+
(data) => data.skills,
|
|
181
|
+
[]
|
|
182
|
+
);
|
|
183
|
+
const { execute: getSkill, loading: getLoading, error: getError } = useApiAsync(
|
|
184
|
+
(skillId) => getSkillApi(skillId, optionsRef.current),
|
|
185
|
+
(data) => data.skill || null,
|
|
186
|
+
null
|
|
187
|
+
);
|
|
188
|
+
const { execute: createSkill, loading: createLoading, error: createError } = useApiAsync(
|
|
189
|
+
(skill) => createSkillApi(skill, optionsRef.current),
|
|
190
|
+
(data) => data.skill || null,
|
|
191
|
+
null
|
|
192
|
+
);
|
|
193
|
+
const { execute: updateSkill, loading: updateLoading, error: updateError } = useApiAsync(
|
|
194
|
+
(skillId, skill) => updateSkillApi(skillId, skill, optionsRef.current),
|
|
195
|
+
(data) => data.skill || null,
|
|
196
|
+
null
|
|
197
|
+
);
|
|
198
|
+
const { execute: deleteSkill, loading: deleteLoading, error: deleteError } = useApiAsync(
|
|
199
|
+
(skillId) => deleteSkillApi(skillId, optionsRef.current),
|
|
200
|
+
() => true,
|
|
201
|
+
false
|
|
202
|
+
);
|
|
203
|
+
const { execute: getCategories, loading: categoriesLoading, error: categoriesError } = useApiAsync(
|
|
204
|
+
() => getSkillCategoriesApi(optionsRef.current),
|
|
205
|
+
(data) => data.categories,
|
|
206
|
+
[]
|
|
207
|
+
);
|
|
208
|
+
const loading = listLoading || getLoading || createLoading || updateLoading || deleteLoading || categoriesLoading;
|
|
209
|
+
const error = listError || getError || createError || updateError || deleteError || categoriesError;
|
|
210
|
+
return useMemo(
|
|
211
|
+
() => ({
|
|
212
|
+
loading,
|
|
213
|
+
error,
|
|
214
|
+
listSkills,
|
|
215
|
+
getSkill,
|
|
216
|
+
createSkill,
|
|
217
|
+
updateSkill,
|
|
218
|
+
deleteSkill,
|
|
219
|
+
getCategories
|
|
220
|
+
}),
|
|
221
|
+
[loading, error, listSkills, getSkill, createSkill, updateSkill, deleteSkill, getCategories]
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
function useSubAgents(options) {
|
|
225
|
+
const optionsRef = useOptionsRef(options);
|
|
226
|
+
const { execute: listSubAgents, loading: listLoading, error: listError } = useApiAsync(
|
|
227
|
+
() => listSubAgentsApi(optionsRef.current),
|
|
228
|
+
(data) => data.subAgents,
|
|
229
|
+
[]
|
|
230
|
+
);
|
|
231
|
+
const { execute: getSubAgent, loading: getLoading, error: getError } = useApiAsync(
|
|
232
|
+
(subAgentId) => getSubAgentApi(subAgentId, optionsRef.current),
|
|
233
|
+
(data) => data.subAgent || null,
|
|
234
|
+
null
|
|
235
|
+
);
|
|
236
|
+
const { execute: createSubAgent, loading: createLoading, error: createError } = useApiAsync(
|
|
237
|
+
(subAgent) => createSubAgentApi(subAgent, optionsRef.current),
|
|
238
|
+
(data) => data.subAgent || null,
|
|
239
|
+
null
|
|
240
|
+
);
|
|
241
|
+
const { execute: updateSubAgent, loading: updateLoading, error: updateError } = useApiAsync(
|
|
242
|
+
(subAgentId, subAgent) => updateSubAgentApi(subAgentId, subAgent, optionsRef.current),
|
|
243
|
+
(data) => data.subAgent || null,
|
|
244
|
+
null
|
|
245
|
+
);
|
|
246
|
+
const { execute: deleteSubAgent, loading: deleteLoading, error: deleteError } = useApiAsync(
|
|
247
|
+
(subAgentId) => deleteSubAgentApi(subAgentId, optionsRef.current),
|
|
248
|
+
() => true,
|
|
249
|
+
false
|
|
250
|
+
);
|
|
251
|
+
const loading = listLoading || getLoading || createLoading || updateLoading || deleteLoading;
|
|
252
|
+
const error = listError || getError || createError || updateError || deleteError;
|
|
253
|
+
return useMemo(
|
|
254
|
+
() => ({
|
|
255
|
+
loading,
|
|
256
|
+
error,
|
|
257
|
+
listSubAgents,
|
|
258
|
+
getSubAgent,
|
|
259
|
+
createSubAgent,
|
|
260
|
+
updateSubAgent,
|
|
261
|
+
deleteSubAgent
|
|
262
|
+
}),
|
|
263
|
+
[loading, error, listSubAgents, getSubAgent, createSubAgent, updateSubAgent, deleteSubAgent]
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
function useToolDefinitions(options) {
|
|
267
|
+
const optionsRef = useOptionsRef(options);
|
|
268
|
+
const { execute: listToolDefinitions, loading: listLoading, error: listError } = useApiAsync(
|
|
269
|
+
() => listToolDefinitionsApi(optionsRef.current),
|
|
270
|
+
(data) => data.toolDefinitions,
|
|
271
|
+
[]
|
|
272
|
+
);
|
|
273
|
+
const { execute: getToolDefinition, loading: getLoading, error: getError } = useApiAsync(
|
|
274
|
+
(toolDefId) => getToolDefinitionApi(toolDefId, optionsRef.current),
|
|
275
|
+
(data) => data.toolDefinition || null,
|
|
276
|
+
null
|
|
277
|
+
);
|
|
278
|
+
const { execute: getToolDefinitionsByIds, loading: getByIdsLoading, error: getByIdsError } = useApiAsync(
|
|
279
|
+
(ids) => getToolDefinitionsByIdsApi(ids, optionsRef.current),
|
|
280
|
+
(data) => data.toolDefinitions,
|
|
281
|
+
[]
|
|
282
|
+
);
|
|
283
|
+
const { execute: createToolDefinition, loading: createLoading, error: createError } = useApiAsync(
|
|
284
|
+
(toolDefinition) => createToolDefinitionApi(toolDefinition, optionsRef.current),
|
|
285
|
+
(data) => data.toolDefinition || null,
|
|
286
|
+
null
|
|
287
|
+
);
|
|
288
|
+
const { execute: updateToolDefinition, loading: updateLoading, error: updateError } = useApiAsync(
|
|
289
|
+
(toolDefId, toolDefinition) => updateToolDefinitionApi(toolDefId, toolDefinition, optionsRef.current),
|
|
290
|
+
(data) => data.toolDefinition || null,
|
|
291
|
+
null
|
|
292
|
+
);
|
|
293
|
+
const { execute: deleteToolDefinition, loading: deleteLoading, error: deleteError } = useApiAsync(
|
|
294
|
+
(toolDefId) => deleteToolDefinitionApi(toolDefId, optionsRef.current),
|
|
295
|
+
() => true,
|
|
296
|
+
false
|
|
297
|
+
);
|
|
298
|
+
const loading = listLoading || getLoading || getByIdsLoading || createLoading || updateLoading || deleteLoading;
|
|
299
|
+
const error = listError || getError || getByIdsError || createError || updateError || deleteError;
|
|
300
|
+
return useMemo(
|
|
301
|
+
() => ({
|
|
302
|
+
loading,
|
|
303
|
+
error,
|
|
304
|
+
listToolDefinitions,
|
|
305
|
+
getToolDefinition,
|
|
306
|
+
getToolDefinitionsByIds,
|
|
307
|
+
createToolDefinition,
|
|
308
|
+
updateToolDefinition,
|
|
309
|
+
deleteToolDefinition
|
|
310
|
+
}),
|
|
311
|
+
[loading, error, listToolDefinitions, getToolDefinition, getToolDefinitionsByIds, createToolDefinition, updateToolDefinition, deleteToolDefinition]
|
|
312
|
+
);
|
|
313
|
+
}
|
|
314
|
+
function useAgentJobs(options) {
|
|
315
|
+
const optionsRef = useOptionsRef(options);
|
|
316
|
+
const { execute: listAgentJobs, loading: listLoading, error: listError } = useApiAsync(
|
|
317
|
+
() => listAgentJobsApi(optionsRef.current),
|
|
318
|
+
(data) => data.jobs,
|
|
319
|
+
[]
|
|
320
|
+
);
|
|
321
|
+
const { execute: getAgentJob, loading: getLoading, error: getError } = useApiAsync(
|
|
322
|
+
(jobId) => getAgentJobApi(jobId, optionsRef.current),
|
|
323
|
+
(data) => data.job || null,
|
|
324
|
+
null
|
|
325
|
+
);
|
|
326
|
+
const { execute: createAgentJob, loading: createLoading, error: createError } = useApiAsync(
|
|
327
|
+
(job) => createAgentJobApi(job, optionsRef.current),
|
|
328
|
+
(data) => data.job || null,
|
|
329
|
+
null
|
|
330
|
+
);
|
|
331
|
+
const { execute: updateAgentJob, loading: updateLoading, error: updateError } = useApiAsync(
|
|
332
|
+
(jobId, job) => updateAgentJobApi(jobId, job, optionsRef.current),
|
|
333
|
+
(data) => data.job || null,
|
|
334
|
+
null
|
|
335
|
+
);
|
|
336
|
+
const { execute: deleteAgentJob, loading: deleteLoading, error: deleteError } = useApiAsync(
|
|
337
|
+
(jobId) => deleteAgentJobApi(jobId, optionsRef.current),
|
|
338
|
+
() => true,
|
|
339
|
+
false
|
|
340
|
+
);
|
|
341
|
+
const { execute: pauseAgentJob, loading: pauseLoading, error: pauseError } = useApiAsync(
|
|
342
|
+
(jobId) => pauseAgentJobApi(jobId, optionsRef.current),
|
|
343
|
+
(data) => data.job || null,
|
|
344
|
+
null
|
|
345
|
+
);
|
|
346
|
+
const { execute: resumeAgentJob, loading: resumeLoading, error: resumeError } = useApiAsync(
|
|
347
|
+
(jobId) => resumeAgentJobApi(jobId, optionsRef.current),
|
|
348
|
+
(data) => data.job || null,
|
|
349
|
+
null
|
|
350
|
+
);
|
|
351
|
+
const loading = listLoading || getLoading || createLoading || updateLoading || deleteLoading || pauseLoading || resumeLoading;
|
|
352
|
+
const error = listError || getError || createError || updateError || deleteError || pauseError || resumeError;
|
|
353
|
+
return useMemo(
|
|
354
|
+
() => ({
|
|
355
|
+
loading,
|
|
356
|
+
error,
|
|
357
|
+
listAgentJobs,
|
|
358
|
+
getAgentJob,
|
|
359
|
+
createAgentJob,
|
|
360
|
+
updateAgentJob,
|
|
361
|
+
deleteAgentJob,
|
|
362
|
+
pauseAgentJob,
|
|
363
|
+
resumeAgentJob
|
|
364
|
+
}),
|
|
365
|
+
[loading, error, listAgentJobs, getAgentJob, createAgentJob, updateAgentJob, deleteAgentJob, pauseAgentJob, resumeAgentJob]
|
|
366
|
+
);
|
|
367
|
+
}
|
|
368
|
+
function useWidgets(options) {
|
|
369
|
+
const optionsRef = useOptionsRef(options);
|
|
370
|
+
const { execute: listWidgets, loading: listLoading, error: listError } = useApiAsync(
|
|
371
|
+
() => listWidgetsApi(optionsRef.current.agentId, optionsRef.current),
|
|
372
|
+
(data) => data.widgets,
|
|
373
|
+
[]
|
|
374
|
+
);
|
|
375
|
+
const { execute: getWidget, loading: getLoading, error: getError } = useApiAsync(
|
|
376
|
+
(widgetId) => getWidgetApi(widgetId, optionsRef.current),
|
|
377
|
+
(data) => data.widget || null,
|
|
378
|
+
null
|
|
379
|
+
);
|
|
380
|
+
const { execute: getDefaultWidget, loading: defaultLoading, error: defaultError } = useApiAsync(
|
|
381
|
+
() => getDefaultWidgetApi(optionsRef.current.agentId, optionsRef.current),
|
|
382
|
+
(data) => data.widget || null,
|
|
383
|
+
null
|
|
384
|
+
);
|
|
385
|
+
const { execute: createWidget, loading: createLoading, error: createError } = useApiAsync(
|
|
386
|
+
(widget) => createWidgetApi(optionsRef.current.agentId, widget, optionsRef.current),
|
|
387
|
+
(data) => data.widget || null,
|
|
388
|
+
null
|
|
389
|
+
);
|
|
390
|
+
const { execute: updateWidget, loading: updateLoading, error: updateError } = useApiAsync(
|
|
391
|
+
(widgetId, widget) => updateWidgetApi(widgetId, widget, optionsRef.current),
|
|
392
|
+
(data) => data.widget || null,
|
|
393
|
+
null
|
|
394
|
+
);
|
|
395
|
+
const { execute: deleteWidget, loading: deleteLoading, error: deleteError } = useApiAsync(
|
|
396
|
+
(widgetId) => deleteWidgetApi(widgetId, optionsRef.current),
|
|
397
|
+
() => true,
|
|
398
|
+
false
|
|
399
|
+
);
|
|
400
|
+
const { execute: setDefaultWidget, loading: setDefaultLoading, error: setDefaultError } = useApiAsync(
|
|
401
|
+
(widgetId) => setDefaultWidgetApi(widgetId, optionsRef.current.agentId, optionsRef.current),
|
|
402
|
+
() => true,
|
|
403
|
+
false
|
|
404
|
+
);
|
|
405
|
+
const loading = listLoading || getLoading || defaultLoading || createLoading || updateLoading || deleteLoading || setDefaultLoading;
|
|
406
|
+
const error = listError || getError || defaultError || createError || updateError || deleteError || setDefaultError;
|
|
407
|
+
return useMemo(
|
|
408
|
+
() => ({
|
|
409
|
+
loading,
|
|
410
|
+
error,
|
|
411
|
+
listWidgets,
|
|
412
|
+
getWidget,
|
|
413
|
+
getDefaultWidget,
|
|
414
|
+
createWidget,
|
|
415
|
+
updateWidget,
|
|
416
|
+
deleteWidget,
|
|
417
|
+
setDefaultWidget
|
|
418
|
+
}),
|
|
419
|
+
[loading, error, listWidgets, getWidget, getDefaultWidget, createWidget, updateWidget, deleteWidget, setDefaultWidget]
|
|
420
|
+
);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export {
|
|
424
|
+
useAsync,
|
|
425
|
+
useApiAsync,
|
|
426
|
+
useOptionsRef,
|
|
427
|
+
useAgents,
|
|
428
|
+
useSkills,
|
|
429
|
+
useSubAgents,
|
|
430
|
+
useToolDefinitions,
|
|
431
|
+
useAgentJobs,
|
|
432
|
+
useWidgets
|
|
433
|
+
};
|
|
434
|
+
//# sourceMappingURL=chunk-RTUQ7WKT.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../hooks/index.ts","../hooks/use-async.ts","../hooks/use-options-ref.ts"],"sourcesContent":["\"use client\";\n\n/**\n * Agent hooks for React applications\n *\n * Provides React hooks for agent CRUD operations with loading/error states.\n *\n * @packageDocumentation\n */\n\nimport { useMemo } from \"react\";\nimport type { ApiClientOptions } from \"@elqnt/api-client\";\nimport type { Agent, AgentSummary, Skill, SubAgent, ToolDefinition, AgentJob, AgentWidget } from \"../models\";\nimport {\n // Agents\n listAgentsApi,\n listAgentsSummaryApi,\n getAgentApi,\n createAgentApi,\n updateAgentApi,\n deleteAgentApi,\n getDefaultAgentApi,\n // Skills\n listSkillsApi,\n getSkillApi,\n createSkillApi,\n updateSkillApi,\n deleteSkillApi,\n getSkillCategoriesApi,\n // Sub-Agents\n listSubAgentsApi,\n getSubAgentApi,\n createSubAgentApi,\n updateSubAgentApi,\n deleteSubAgentApi,\n // Tool Definitions\n listToolDefinitionsApi,\n getToolDefinitionApi,\n createToolDefinitionApi,\n updateToolDefinitionApi,\n deleteToolDefinitionApi,\n getToolDefinitionsByIdsApi,\n // Agent Jobs\n listAgentJobsApi,\n getAgentJobApi,\n createAgentJobApi,\n updateAgentJobApi,\n deleteAgentJobApi,\n pauseAgentJobApi,\n resumeAgentJobApi,\n // Widgets\n listWidgetsApi,\n getWidgetApi,\n createWidgetApi,\n updateWidgetApi,\n deleteWidgetApi,\n getDefaultWidgetApi,\n setDefaultWidgetApi,\n} from \"../api\";\nimport { useApiAsync } from \"./use-async\";\nimport { useOptionsRef } from \"./use-options-ref\";\n\n// =============================================================================\n// TYPES\n// =============================================================================\n\nexport type UseAgentsOptions = ApiClientOptions;\n\n// =============================================================================\n// USE AGENTS HOOK\n// =============================================================================\n\n/**\n * Hook for agent CRUD operations\n *\n * @example\n * ```tsx\n * const { loading, error, listAgents, createAgent } = useAgents({\n * baseUrl: apiGatewayUrl,\n * orgId: selectedOrgId,\n * });\n *\n * const agents = await listAgents();\n * ```\n */\nexport function useAgents(options: UseAgentsOptions) {\n const optionsRef = useOptionsRef(options);\n\n const { execute: listAgents, loading: listLoading, error: listError } = useApiAsync(\n () => listAgentsApi(optionsRef.current),\n (data) => data.agents,\n [] as Agent[]\n );\n\n const { execute: listAgentSummaries, loading: listSummaryLoading, error: listSummaryError } = useApiAsync(\n () => listAgentsSummaryApi(optionsRef.current),\n (data) => data.agents,\n [] as AgentSummary[]\n );\n\n const { execute: getAgent, loading: getLoading, error: getError } = useApiAsync(\n (agentId: string) => getAgentApi(agentId, optionsRef.current),\n (data) => data.agent || null,\n null as Agent | null\n );\n\n const { execute: createAgent, loading: createLoading, error: createError } = useApiAsync(\n (agent: Partial<Agent>) => createAgentApi(agent, optionsRef.current),\n (data) => data.agent || null,\n null as Agent | null\n );\n\n const { execute: updateAgent, loading: updateLoading, error: updateError } = useApiAsync(\n (agentId: string, agent: Partial<Agent>) => updateAgentApi(agentId, agent, optionsRef.current),\n (data) => data.agent || null,\n null as Agent | null\n );\n\n const { execute: deleteAgent, loading: deleteLoading, error: deleteError } = useApiAsync(\n (agentId: string) => deleteAgentApi(agentId, optionsRef.current),\n () => true,\n false\n );\n\n const { execute: getDefaultAgent, loading: defaultLoading, error: defaultError } = useApiAsync(\n () => getDefaultAgentApi(optionsRef.current),\n (data) => data.agent || null,\n null as Agent | null\n );\n\n const loading = listLoading || listSummaryLoading || getLoading || createLoading || updateLoading || deleteLoading || defaultLoading;\n const error = listError || listSummaryError || getError || createError || updateError || deleteError || defaultError;\n\n return useMemo(\n () => ({\n loading,\n error,\n listAgents,\n listAgentSummaries,\n getAgent,\n createAgent,\n updateAgent,\n deleteAgent,\n getDefaultAgent,\n }),\n [loading, error, listAgents, listAgentSummaries, getAgent, createAgent, updateAgent, deleteAgent, getDefaultAgent]\n );\n}\n\n// =============================================================================\n// USE SKILLS HOOK\n// =============================================================================\n\n/**\n * Hook for skill CRUD operations\n */\nexport function useSkills(options: UseAgentsOptions) {\n const optionsRef = useOptionsRef(options);\n\n const { execute: listSkills, loading: listLoading, error: listError } = useApiAsync(\n () => listSkillsApi(optionsRef.current),\n (data) => data.skills,\n [] as Skill[]\n );\n\n const { execute: getSkill, loading: getLoading, error: getError } = useApiAsync(\n (skillId: string) => getSkillApi(skillId, optionsRef.current),\n (data) => data.skill || null,\n null as Skill | null\n );\n\n const { execute: createSkill, loading: createLoading, error: createError } = useApiAsync(\n (skill: Partial<Skill>) => createSkillApi(skill, optionsRef.current),\n (data) => data.skill || null,\n null as Skill | null\n );\n\n const { execute: updateSkill, loading: updateLoading, error: updateError } = useApiAsync(\n (skillId: string, skill: Partial<Skill>) => updateSkillApi(skillId, skill, optionsRef.current),\n (data) => data.skill || null,\n null as Skill | null\n );\n\n const { execute: deleteSkill, loading: deleteLoading, error: deleteError } = useApiAsync(\n (skillId: string) => deleteSkillApi(skillId, optionsRef.current),\n () => true,\n false\n );\n\n const { execute: getCategories, loading: categoriesLoading, error: categoriesError } = useApiAsync(\n () => getSkillCategoriesApi(optionsRef.current),\n (data) => data.categories,\n [] as string[]\n );\n\n const loading = listLoading || getLoading || createLoading || updateLoading || deleteLoading || categoriesLoading;\n const error = listError || getError || createError || updateError || deleteError || categoriesError;\n\n return useMemo(\n () => ({\n loading,\n error,\n listSkills,\n getSkill,\n createSkill,\n updateSkill,\n deleteSkill,\n getCategories,\n }),\n [loading, error, listSkills, getSkill, createSkill, updateSkill, deleteSkill, getCategories]\n );\n}\n\n// =============================================================================\n// USE SUB-AGENTS HOOK\n// =============================================================================\n\n/**\n * Hook for sub-agent CRUD operations\n */\nexport function useSubAgents(options: UseAgentsOptions) {\n const optionsRef = useOptionsRef(options);\n\n const { execute: listSubAgents, loading: listLoading, error: listError } = useApiAsync(\n () => listSubAgentsApi(optionsRef.current),\n (data) => data.subAgents,\n [] as SubAgent[]\n );\n\n const { execute: getSubAgent, loading: getLoading, error: getError } = useApiAsync(\n (subAgentId: string) => getSubAgentApi(subAgentId, optionsRef.current),\n (data) => data.subAgent || null,\n null as SubAgent | null\n );\n\n const { execute: createSubAgent, loading: createLoading, error: createError } = useApiAsync(\n (subAgent: Partial<SubAgent>) => createSubAgentApi(subAgent, optionsRef.current),\n (data) => data.subAgent || null,\n null as SubAgent | null\n );\n\n const { execute: updateSubAgent, loading: updateLoading, error: updateError } = useApiAsync(\n (subAgentId: string, subAgent: Partial<SubAgent>) => updateSubAgentApi(subAgentId, subAgent, optionsRef.current),\n (data) => data.subAgent || null,\n null as SubAgent | null\n );\n\n const { execute: deleteSubAgent, loading: deleteLoading, error: deleteError } = useApiAsync(\n (subAgentId: string) => deleteSubAgentApi(subAgentId, optionsRef.current),\n () => true,\n false\n );\n\n const loading = listLoading || getLoading || createLoading || updateLoading || deleteLoading;\n const error = listError || getError || createError || updateError || deleteError;\n\n return useMemo(\n () => ({\n loading,\n error,\n listSubAgents,\n getSubAgent,\n createSubAgent,\n updateSubAgent,\n deleteSubAgent,\n }),\n [loading, error, listSubAgents, getSubAgent, createSubAgent, updateSubAgent, deleteSubAgent]\n );\n}\n\n// =============================================================================\n// USE TOOL DEFINITIONS HOOK\n// =============================================================================\n\n/**\n * Hook for tool definition CRUD operations\n *\n * @example\n * ```tsx\n * const { loading, error, listToolDefinitions, createToolDefinition } = useToolDefinitions({\n * baseUrl: apiGatewayUrl,\n * orgId: selectedOrgId,\n * });\n *\n * const toolDefs = await listToolDefinitions();\n * ```\n */\nexport function useToolDefinitions(options: UseAgentsOptions) {\n const optionsRef = useOptionsRef(options);\n\n const { execute: listToolDefinitions, loading: listLoading, error: listError } = useApiAsync(\n () => listToolDefinitionsApi(optionsRef.current),\n (data) => data.toolDefinitions,\n [] as ToolDefinition[]\n );\n\n const { execute: getToolDefinition, loading: getLoading, error: getError } = useApiAsync(\n (toolDefId: string) => getToolDefinitionApi(toolDefId, optionsRef.current),\n (data) => data.toolDefinition || null,\n null as ToolDefinition | null\n );\n\n const { execute: getToolDefinitionsByIds, loading: getByIdsLoading, error: getByIdsError } = useApiAsync(\n (ids: string[]) => getToolDefinitionsByIdsApi(ids, optionsRef.current),\n (data) => data.toolDefinitions,\n [] as ToolDefinition[]\n );\n\n const { execute: createToolDefinition, loading: createLoading, error: createError } = useApiAsync(\n (toolDefinition: Partial<ToolDefinition>) => createToolDefinitionApi(toolDefinition, optionsRef.current),\n (data) => data.toolDefinition || null,\n null as ToolDefinition | null\n );\n\n const { execute: updateToolDefinition, loading: updateLoading, error: updateError } = useApiAsync(\n (toolDefId: string, toolDefinition: Partial<ToolDefinition>) => updateToolDefinitionApi(toolDefId, toolDefinition, optionsRef.current),\n (data) => data.toolDefinition || null,\n null as ToolDefinition | null\n );\n\n const { execute: deleteToolDefinition, loading: deleteLoading, error: deleteError } = useApiAsync(\n (toolDefId: string) => deleteToolDefinitionApi(toolDefId, optionsRef.current),\n () => true,\n false\n );\n\n const loading = listLoading || getLoading || getByIdsLoading || createLoading || updateLoading || deleteLoading;\n const error = listError || getError || getByIdsError || createError || updateError || deleteError;\n\n return useMemo(\n () => ({\n loading,\n error,\n listToolDefinitions,\n getToolDefinition,\n getToolDefinitionsByIds,\n createToolDefinition,\n updateToolDefinition,\n deleteToolDefinition,\n }),\n [loading, error, listToolDefinitions, getToolDefinition, getToolDefinitionsByIds, createToolDefinition, updateToolDefinition, deleteToolDefinition]\n );\n}\n\n// =============================================================================\n// USE AGENT JOBS HOOK\n// =============================================================================\n\n/**\n * Hook for agent job CRUD operations\n *\n * @example\n * ```tsx\n * const { loading, error, listAgentJobs, createAgentJob, pauseAgentJob } = useAgentJobs({\n * baseUrl: apiGatewayUrl,\n * orgId: selectedOrgId,\n * });\n *\n * const jobs = await listAgentJobs();\n * await pauseAgentJob(jobId);\n * ```\n */\nexport function useAgentJobs(options: UseAgentsOptions) {\n const optionsRef = useOptionsRef(options);\n\n const { execute: listAgentJobs, loading: listLoading, error: listError } = useApiAsync(\n () => listAgentJobsApi(optionsRef.current),\n (data) => data.jobs,\n [] as AgentJob[]\n );\n\n const { execute: getAgentJob, loading: getLoading, error: getError } = useApiAsync(\n (jobId: string) => getAgentJobApi(jobId, optionsRef.current),\n (data) => data.job || null,\n null as AgentJob | null\n );\n\n const { execute: createAgentJob, loading: createLoading, error: createError } = useApiAsync(\n (job: Partial<AgentJob>) => createAgentJobApi(job, optionsRef.current),\n (data) => data.job || null,\n null as AgentJob | null\n );\n\n const { execute: updateAgentJob, loading: updateLoading, error: updateError } = useApiAsync(\n (jobId: string, job: Partial<AgentJob>) => updateAgentJobApi(jobId, job, optionsRef.current),\n (data) => data.job || null,\n null as AgentJob | null\n );\n\n const { execute: deleteAgentJob, loading: deleteLoading, error: deleteError } = useApiAsync(\n (jobId: string) => deleteAgentJobApi(jobId, optionsRef.current),\n () => true,\n false\n );\n\n const { execute: pauseAgentJob, loading: pauseLoading, error: pauseError } = useApiAsync(\n (jobId: string) => pauseAgentJobApi(jobId, optionsRef.current),\n (data) => data.job || null,\n null as AgentJob | null\n );\n\n const { execute: resumeAgentJob, loading: resumeLoading, error: resumeError } = useApiAsync(\n (jobId: string) => resumeAgentJobApi(jobId, optionsRef.current),\n (data) => data.job || null,\n null as AgentJob | null\n );\n\n const loading = listLoading || getLoading || createLoading || updateLoading || deleteLoading || pauseLoading || resumeLoading;\n const error = listError || getError || createError || updateError || deleteError || pauseError || resumeError;\n\n return useMemo(\n () => ({\n loading,\n error,\n listAgentJobs,\n getAgentJob,\n createAgentJob,\n updateAgentJob,\n deleteAgentJob,\n pauseAgentJob,\n resumeAgentJob,\n }),\n [loading, error, listAgentJobs, getAgentJob, createAgentJob, updateAgentJob, deleteAgentJob, pauseAgentJob, resumeAgentJob]\n );\n}\n\n// =============================================================================\n// USE WIDGETS HOOK\n// =============================================================================\n\nexport interface UseWidgetsOptions extends UseAgentsOptions {\n agentId: string;\n}\n\n/**\n * Hook for widget CRUD operations\n *\n * @example\n * ```tsx\n * const { loading, error, listWidgets, createWidget } = useWidgets({\n * baseUrl: apiGatewayUrl,\n * orgId: selectedOrgId,\n * agentId: selectedAgentId,\n * });\n *\n * const widgets = await listWidgets();\n * ```\n */\nexport function useWidgets(options: UseWidgetsOptions) {\n const optionsRef = useOptionsRef(options);\n\n const { execute: listWidgets, loading: listLoading, error: listError } = useApiAsync(\n () => listWidgetsApi(optionsRef.current.agentId, optionsRef.current),\n (data) => data.widgets,\n [] as AgentWidget[]\n );\n\n const { execute: getWidget, loading: getLoading, error: getError } = useApiAsync(\n (widgetId: string) => getWidgetApi(widgetId, optionsRef.current),\n (data) => data.widget || null,\n null as AgentWidget | null\n );\n\n const { execute: getDefaultWidget, loading: defaultLoading, error: defaultError } = useApiAsync(\n () => getDefaultWidgetApi(optionsRef.current.agentId, optionsRef.current),\n (data) => data.widget || null,\n null as AgentWidget | null\n );\n\n const { execute: createWidget, loading: createLoading, error: createError } = useApiAsync(\n (widget: Partial<AgentWidget>) => createWidgetApi(optionsRef.current.agentId, widget, optionsRef.current),\n (data) => data.widget || null,\n null as AgentWidget | null\n );\n\n const { execute: updateWidget, loading: updateLoading, error: updateError } = useApiAsync(\n (widgetId: string, widget: Partial<AgentWidget>) => updateWidgetApi(widgetId, widget, optionsRef.current),\n (data) => data.widget || null,\n null as AgentWidget | null\n );\n\n const { execute: deleteWidget, loading: deleteLoading, error: deleteError } = useApiAsync(\n (widgetId: string) => deleteWidgetApi(widgetId, optionsRef.current),\n () => true,\n false\n );\n\n const { execute: setDefaultWidget, loading: setDefaultLoading, error: setDefaultError } = useApiAsync(\n (widgetId: string) => setDefaultWidgetApi(widgetId, optionsRef.current.agentId, optionsRef.current),\n () => true,\n false\n );\n\n const loading = listLoading || getLoading || defaultLoading || createLoading || updateLoading || deleteLoading || setDefaultLoading;\n const error = listError || getError || defaultError || createError || updateError || deleteError || setDefaultError;\n\n return useMemo(\n () => ({\n loading,\n error,\n listWidgets,\n getWidget,\n getDefaultWidget,\n createWidget,\n updateWidget,\n deleteWidget,\n setDefaultWidget,\n }),\n [loading, error, listWidgets, getWidget, getDefaultWidget, createWidget, updateWidget, deleteWidget, setDefaultWidget]\n );\n}\n\n// =============================================================================\n// EXPORTS\n// =============================================================================\n\n// Re-export hook utilities for advanced usage\nexport { useApiAsync, useAsync } from \"./use-async\";\nexport { useOptionsRef } from \"./use-options-ref\";\nexport type { UseAsyncOptions, UseAsyncReturn } from \"./use-async\";\n","\"use client\";\n\n/**\n * Async operation utilities for React hooks\n *\n * Provides a generic pattern for handling async operations with loading/error states.\n * Uses a request counter for accurate concurrent loading state.\n */\n\nimport { useState, useCallback, useRef } from \"react\";\nimport type { ApiResponse } from \"@elqnt/api-client\";\n\nexport interface UseAsyncOptions {\n onError?: (error: string) => void;\n}\n\nexport interface UseAsyncReturn<TResult, TArgs extends unknown[] = []> {\n execute: (...args: TArgs) => Promise<TResult>;\n loading: boolean;\n error: string | null;\n clearError: () => void;\n}\n\n/**\n * Generic async hook for any promise-returning function.\n * Uses a request counter to properly track concurrent requests.\n */\nexport function useAsync<TResult, TArgs extends unknown[] = []>(\n asyncFn: (...args: TArgs) => Promise<TResult>,\n options?: UseAsyncOptions\n): UseAsyncReturn<TResult, TArgs> {\n const [error, setError] = useState<string | null>(null);\n const requestCountRef = useRef(0);\n const [loading, setLoading] = useState(false);\n\n const execute = useCallback(\n async (...args: TArgs): Promise<TResult> => {\n requestCountRef.current += 1;\n setLoading(true);\n setError(null);\n\n try {\n return await asyncFn(...args);\n } catch (err) {\n const message = err instanceof Error ? err.message : \"An error occurred\";\n setError(message);\n options?.onError?.(message);\n throw err;\n } finally {\n requestCountRef.current -= 1;\n if (requestCountRef.current === 0) {\n setLoading(false);\n }\n }\n },\n [asyncFn, options]\n );\n\n const clearError = useCallback(() => setError(null), []);\n\n return { execute, loading, error, clearError };\n}\n\n/**\n * Specialized async hook for API operations that return ApiResponse.\n * Automatically extracts data and handles API errors.\n *\n * @param asyncFn - Function that returns ApiResponse<TResponse>\n * @param extractor - Function to extract the desired result from response data\n * @param defaultValue - Default value to return on error\n * @param options - Optional configuration\n *\n * @example\n * ```tsx\n * const { execute: listAgents, loading, error } = useApiAsync(\n * () => listAgentsApi(optionsRef.current),\n * (data) => data.agents,\n * []\n * );\n * ```\n */\nexport function useApiAsync<TResponse, TResult, TArgs extends unknown[] = []>(\n asyncFn: (...args: TArgs) => Promise<ApiResponse<TResponse>>,\n extractor: (data: TResponse) => TResult,\n defaultValue: TResult,\n options?: UseAsyncOptions\n): UseAsyncReturn<TResult, TArgs> {\n const [error, setError] = useState<string | null>(null);\n const requestCountRef = useRef(0);\n const [loading, setLoading] = useState(false);\n\n const execute = useCallback(\n async (...args: TArgs): Promise<TResult> => {\n requestCountRef.current += 1;\n setLoading(true);\n setError(null);\n\n try {\n const response = await asyncFn(...args);\n if (response.error) {\n setError(response.error);\n options?.onError?.(response.error);\n return defaultValue;\n }\n return response.data ? extractor(response.data) : defaultValue;\n } catch (err) {\n const message = err instanceof Error ? err.message : \"An error occurred\";\n setError(message);\n options?.onError?.(message);\n return defaultValue;\n } finally {\n requestCountRef.current -= 1;\n if (requestCountRef.current === 0) {\n setLoading(false);\n }\n }\n },\n [asyncFn, extractor, defaultValue, options]\n );\n\n const clearError = useCallback(() => setError(null), []);\n\n return { execute, loading, error, clearError };\n}\n","\"use client\";\n\n/**\n * Options reference utility for React hooks\n *\n * Keeps a mutable ref synchronized with options to avoid\n * stale closures in callbacks while preventing unnecessary re-renders.\n */\n\nimport { useRef, useEffect } from \"react\";\n\n/**\n * Creates a ref that stays synchronized with the provided options.\n * Useful for accessing current options values in callbacks without\n * causing re-renders or stale closure issues.\n *\n * @param options - The options object to track\n * @returns A ref that always contains the latest options\n *\n * @example\n * ```tsx\n * const optionsRef = useOptionsRef(options);\n *\n * const fetchData = useCallback(async () => {\n * // Always has the latest options, no stale closure\n * const result = await api.fetch(optionsRef.current);\n * }, []); // No need to include options in deps\n * ```\n */\nexport function useOptionsRef<T>(options: T): React.MutableRefObject<T> {\n const optionsRef = useRef(options);\n\n useEffect(() => {\n optionsRef.current = options;\n }, [options]);\n\n return optionsRef;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,eAAe;;;ACDxB,SAAS,UAAU,aAAa,cAAc;AAkBvC,SAAS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