@elqnt/agents 2.0.5 → 2.1.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/api/index.d.mts +82 -0
- package/dist/api/index.d.ts +82 -0
- package/dist/api/index.js +70 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/index.mjs +70 -0
- package/dist/api/index.mjs.map +1 -0
- package/dist/chunk-EQBMH6T6.mjs +398 -0
- package/dist/chunk-EQBMH6T6.mjs.map +1 -0
- package/dist/chunk-IDBBO3QJ.mjs +357 -0
- package/dist/chunk-IDBBO3QJ.mjs.map +1 -0
- package/dist/chunk-LRVOTC2M.mjs +171 -0
- package/dist/chunk-LRVOTC2M.mjs.map +1 -0
- package/dist/chunk-O77IWBPZ.js +357 -0
- package/dist/chunk-O77IWBPZ.js.map +1 -0
- package/dist/chunk-WL5S56WV.js +398 -0
- package/dist/chunk-WL5S56WV.js.map +1 -0
- package/dist/chunk-YYXYKVF4.js +171 -0
- package/dist/chunk-YYXYKVF4.js.map +1 -0
- package/dist/hooks/index.d.mts +57 -0
- package/dist/hooks/index.d.ts +57 -0
- package/dist/hooks/index.js +14 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +14 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index.d.mts +5 -2257
- package/dist/index.d.ts +5 -2257
- package/dist/index.js +429 -554
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +253 -177
- package/dist/index.mjs.map +1 -1
- package/dist/models/index.d.mts +2257 -0
- package/dist/models/index.d.ts +2257 -0
- package/dist/models/index.js +356 -0
- package/dist/models/index.js.map +1 -0
- package/dist/models/index.mjs +356 -0
- package/dist/models/index.mjs.map +1 -0
- package/package.json +23 -8
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
|
|
3
|
+
// api/index.ts
|
|
4
|
+
var _browser = require('@elqnt/api-client/browser');
|
|
5
|
+
async function listAgentsApi(options) {
|
|
6
|
+
return _browser.browserApiRequest.call(void 0, "/api/v1/agents", { method: "GET", ...options });
|
|
7
|
+
}
|
|
8
|
+
async function listAgentsSummaryApi(options) {
|
|
9
|
+
return _browser.browserApiRequest.call(void 0, "/api/v1/agents/summary", { method: "GET", ...options });
|
|
10
|
+
}
|
|
11
|
+
async function getAgentApi(agentId, options) {
|
|
12
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/agents/${agentId}`, { method: "GET", ...options });
|
|
13
|
+
}
|
|
14
|
+
async function createAgentApi(agent, options) {
|
|
15
|
+
return _browser.browserApiRequest.call(void 0, "/api/v1/agents", { method: "POST", body: agent, ...options });
|
|
16
|
+
}
|
|
17
|
+
async function updateAgentApi(agentId, agent, options) {
|
|
18
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/agents/${agentId}`, { method: "PUT", body: agent, ...options });
|
|
19
|
+
}
|
|
20
|
+
async function deleteAgentApi(agentId, options) {
|
|
21
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/agents/${agentId}`, { method: "DELETE", ...options });
|
|
22
|
+
}
|
|
23
|
+
async function getDefaultAgentApi(options) {
|
|
24
|
+
return _browser.browserApiRequest.call(void 0, "/api/v1/agents/default", { method: "GET", ...options });
|
|
25
|
+
}
|
|
26
|
+
async function listSkillsApi(options) {
|
|
27
|
+
return _browser.browserApiRequest.call(void 0, "/api/v1/skills", { method: "GET", ...options });
|
|
28
|
+
}
|
|
29
|
+
async function getSkillApi(skillId, options) {
|
|
30
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/skills/${skillId}`, { method: "GET", ...options });
|
|
31
|
+
}
|
|
32
|
+
async function getSkillsByIdsApi(ids, options) {
|
|
33
|
+
return _browser.browserApiRequest.call(void 0, "/api/v1/skills/by-ids", { method: "POST", body: { ids }, ...options });
|
|
34
|
+
}
|
|
35
|
+
async function createSkillApi(skill, options) {
|
|
36
|
+
return _browser.browserApiRequest.call(void 0, "/api/v1/skills", { method: "POST", body: skill, ...options });
|
|
37
|
+
}
|
|
38
|
+
async function updateSkillApi(skillId, skill, options) {
|
|
39
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/skills/${skillId}`, { method: "PUT", body: skill, ...options });
|
|
40
|
+
}
|
|
41
|
+
async function deleteSkillApi(skillId, options) {
|
|
42
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/skills/${skillId}`, { method: "DELETE", ...options });
|
|
43
|
+
}
|
|
44
|
+
async function searchSkillsApi(query, options) {
|
|
45
|
+
const params = new URLSearchParams();
|
|
46
|
+
params.set("q", query);
|
|
47
|
+
if (options.category) params.set("category", options.category);
|
|
48
|
+
if (options.limit) params.set("limit", String(options.limit));
|
|
49
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/skills/search?${params.toString()}`, { method: "GET", ...options });
|
|
50
|
+
}
|
|
51
|
+
async function getSkillUserConfigApi(skillId, options) {
|
|
52
|
+
const params = new URLSearchParams();
|
|
53
|
+
if (options.agentId) params.set("agentId", options.agentId);
|
|
54
|
+
const query = params.toString();
|
|
55
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/skills/${skillId}/user-config${query ? `?${query}` : ""}`, {
|
|
56
|
+
method: "GET",
|
|
57
|
+
...options
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async function updateSkillUserConfigApi(skillId, data, options) {
|
|
61
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/skills/${skillId}/user-config`, {
|
|
62
|
+
method: "PUT",
|
|
63
|
+
body: data,
|
|
64
|
+
...options
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
async function deleteSkillUserConfigApi(skillId, options) {
|
|
68
|
+
const params = new URLSearchParams();
|
|
69
|
+
if (options.agentId) params.set("agentId", options.agentId);
|
|
70
|
+
const query = params.toString();
|
|
71
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/skills/${skillId}/user-config${query ? `?${query}` : ""}`, {
|
|
72
|
+
method: "DELETE",
|
|
73
|
+
...options
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
async function listSkillUserConfigsApi(options) {
|
|
77
|
+
const params = new URLSearchParams();
|
|
78
|
+
if (options.agentId) params.set("agentId", options.agentId);
|
|
79
|
+
if (options.limit) params.set("limit", String(options.limit));
|
|
80
|
+
if (options.offset) params.set("offset", String(options.offset));
|
|
81
|
+
const query = params.toString();
|
|
82
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/skills/user-configs${query ? `?${query}` : ""}`, {
|
|
83
|
+
method: "GET",
|
|
84
|
+
...options
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
async function resolveSkillConfigApi(skillId, agentId, options) {
|
|
88
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/skills/${skillId}/resolve-config?agentId=${agentId}`, {
|
|
89
|
+
method: "GET",
|
|
90
|
+
...options
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
async function listSubAgentsApi(options) {
|
|
94
|
+
const params = new URLSearchParams();
|
|
95
|
+
if (options.onlySystem !== void 0) params.set("onlySystem", String(options.onlySystem));
|
|
96
|
+
if (options.enabled !== void 0) params.set("enabled", String(options.enabled));
|
|
97
|
+
const queryString = params.toString();
|
|
98
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/subagents${queryString ? `?${queryString}` : ""}`, { method: "GET", ...options });
|
|
99
|
+
}
|
|
100
|
+
async function getSubAgentApi(subAgentId, options) {
|
|
101
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/subagents/${subAgentId}`, { method: "GET", ...options });
|
|
102
|
+
}
|
|
103
|
+
async function createSubAgentApi(subAgent, options) {
|
|
104
|
+
return _browser.browserApiRequest.call(void 0, "/api/v1/subagents", { method: "POST", body: { subAgent }, ...options });
|
|
105
|
+
}
|
|
106
|
+
async function updateSubAgentApi(subAgentId, subAgent, options) {
|
|
107
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/subagents/${subAgentId}`, { method: "PUT", body: { subAgent }, ...options });
|
|
108
|
+
}
|
|
109
|
+
async function deleteSubAgentApi(subAgentId, options) {
|
|
110
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/subagents/${subAgentId}`, { method: "DELETE", ...options });
|
|
111
|
+
}
|
|
112
|
+
async function listWidgetsApi(agentId, options) {
|
|
113
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/agents/${agentId}/widgets`, { method: "GET", ...options });
|
|
114
|
+
}
|
|
115
|
+
async function getDefaultWidgetApi(agentId, options) {
|
|
116
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/agents/${agentId}/widgets/default`, { method: "GET", ...options });
|
|
117
|
+
}
|
|
118
|
+
async function createWidgetApi(agentId, widget, options) {
|
|
119
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/agents/${agentId}/widgets`, { method: "POST", body: { widget }, ...options });
|
|
120
|
+
}
|
|
121
|
+
async function getWidgetApi(widgetId, options) {
|
|
122
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/widgets/${widgetId}`, { method: "GET", ...options });
|
|
123
|
+
}
|
|
124
|
+
async function getWidgetByWidgetIdApi(widgetId, baseUrl) {
|
|
125
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/widgets/by-widget-id/${widgetId}`, { method: "GET", baseUrl, orgId: "" });
|
|
126
|
+
}
|
|
127
|
+
async function updateWidgetApi(widgetId, widget, options) {
|
|
128
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/widgets/${widgetId}`, { method: "PUT", body: { widget }, ...options });
|
|
129
|
+
}
|
|
130
|
+
async function deleteWidgetApi(widgetId, options) {
|
|
131
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/widgets/${widgetId}`, { method: "DELETE", ...options });
|
|
132
|
+
}
|
|
133
|
+
async function setDefaultWidgetApi(widgetId, agentId, options) {
|
|
134
|
+
return _browser.browserApiRequest.call(void 0, `/api/v1/widgets/${widgetId}/default`, { method: "POST", body: { agentId }, ...options });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
exports.listAgentsApi = listAgentsApi; exports.listAgentsSummaryApi = listAgentsSummaryApi; exports.getAgentApi = getAgentApi; exports.createAgentApi = createAgentApi; exports.updateAgentApi = updateAgentApi; exports.deleteAgentApi = deleteAgentApi; exports.getDefaultAgentApi = getDefaultAgentApi; exports.listSkillsApi = listSkillsApi; exports.getSkillApi = getSkillApi; exports.getSkillsByIdsApi = getSkillsByIdsApi; exports.createSkillApi = createSkillApi; exports.updateSkillApi = updateSkillApi; exports.deleteSkillApi = deleteSkillApi; exports.searchSkillsApi = searchSkillsApi; exports.getSkillUserConfigApi = getSkillUserConfigApi; exports.updateSkillUserConfigApi = updateSkillUserConfigApi; exports.deleteSkillUserConfigApi = deleteSkillUserConfigApi; exports.listSkillUserConfigsApi = listSkillUserConfigsApi; exports.resolveSkillConfigApi = resolveSkillConfigApi; exports.listSubAgentsApi = listSubAgentsApi; exports.getSubAgentApi = getSubAgentApi; exports.createSubAgentApi = createSubAgentApi; exports.updateSubAgentApi = updateSubAgentApi; exports.deleteSubAgentApi = deleteSubAgentApi; exports.listWidgetsApi = listWidgetsApi; exports.getDefaultWidgetApi = getDefaultWidgetApi; exports.createWidgetApi = createWidgetApi; exports.getWidgetApi = getWidgetApi; exports.getWidgetByWidgetIdApi = getWidgetByWidgetIdApi; exports.updateWidgetApi = updateWidgetApi; exports.deleteWidgetApi = deleteWidgetApi; exports.setDefaultWidgetApi = setDefaultWidgetApi;
|
|
171
|
+
//# sourceMappingURL=chunk-YYXYKVF4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/agents/dist/chunk-YYXYKVF4.js","../api/index.ts"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACA;ACKA,oDAAkC;AA4BlC,MAAA,SAAsB,aAAA,CAAc,OAAA,EAAqE;AACvG,EAAA,OAAO,wCAAA,gBAAkB,EAAkB,EAAE,MAAA,EAAQ,KAAA,EAAO,GAAG,QAAQ,CAAC,CAAA;AAC1E;AAEA,MAAA,SAAsB,oBAAA,CAAqB,OAAA,EAA4E;AACrH,EAAA,OAAO,wCAAA,wBAAkB,EAA0B,EAAE,MAAA,EAAQ,KAAA,EAAO,GAAG,QAAQ,CAAC,CAAA;AAClF;AAEA,MAAA,SAAsB,WAAA,CAAY,OAAA,EAAiB,OAAA,EAAgE;AACjH,EAAA,OAAO,wCAAA,CAAkB,eAAA,EAAkB,OAAO,CAAA,CAAA;AACpD;AAE4H;AAC7E,EAAA;AAC/C;AAE6E;AACzB,EAAA;AACpD;AAEyJ;AACrG,EAAA;AACpD;AAEyG;AACpD,EAAA;AACrD;AAMyG;AAC1D,EAAA;AAC/C;AAEmH;AAC/D,EAAA;AACpD;AAEgI;AAC5E,EAAA;AACpD;AAE4H;AAC7E,EAAA;AAC/C;AAE6E;AACzB,EAAA;AACpD;AAEyJ;AACrG,EAAA;AACpD;AAK4C;AACP,EAAA;AACd,EAAA;AACwB,EAAA;AACC,EAAA;AACI,EAAA;AACpD;AAQE;AAEmC,EAAA;AACgB,EAAA;AACrB,EAAA;AACoB,EAAA;AACxC,IAAA;AACL,IAAA;AACJ,EAAA;AACH;AAIE;AAQkD,EAAA;AACxC,IAAA;AACF,IAAA;AACH,IAAA;AACJ,EAAA;AACH;AAIE;AAEmC,EAAA;AACgB,EAAA;AACrB,EAAA;AACoB,EAAA;AACxC,IAAA;AACL,IAAA;AACJ,EAAA;AACH;AAIqD;AAChB,EAAA;AACgB,EAAA;AACL,EAAA;AACE,EAAA;AAClB,EAAA;AACL,EAAA;AACf,IAAA;AACL,IAAA;AACJ,EAAA;AACH;AAIE;AAGkD,EAAA;AACxC,IAAA;AACL,IAAA;AACJ,EAAA;AACH;AAQ+C;AACV,EAAA;AACc,EAAA;AACH,EAAA;AACV,EAAA;AACS,EAAA;AAC/C;AAE4H;AAC5E,EAAA;AAChD;AAEwI;AACtF,EAAA;AAClD;AAE4D;AACZ,EAAA;AAChD;AAE4D;AACZ,EAAA;AAChD;AAMiI;AAC7E,EAAA;AACpD;AAEiI;AAC7E,EAAA;AACpD;AAEqF;AACjC,EAAA;AACpD;AAE2H;AAC7E,EAAA;AAC9C;AAE+D;AACpC,EAAA;AAC3B;AAEsF;AACxC,EAAA;AAC9C;AAE2J;AAC7G,EAAA;AAC9C;AAE4D;AACd,EAAA;AAC9C;ADvGqD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/agents/dist/chunk-YYXYKVF4.js","sourcesContent":[null,"/**\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 SkillUserConfigResponse,\n SkillUserConfigListResponse,\n ResolveSkillConfigResponse,\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"]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ApiClientOptions } from '@elqnt/api-client';
|
|
2
|
+
import { Agent, AgentSummary, Skill, SubAgent } from '../models/index.mjs';
|
|
3
|
+
import '@elqnt/types';
|
|
4
|
+
|
|
5
|
+
type UseAgentsOptions = ApiClientOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Hook for agent CRUD operations
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const { loading, error, listAgents, createAgent } = useAgents({
|
|
12
|
+
* baseUrl: apiGatewayUrl,
|
|
13
|
+
* orgId: selectedOrgId,
|
|
14
|
+
* userId: user?.id,
|
|
15
|
+
* userEmail: user?.email,
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* const agents = await listAgents();
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare function useAgents(options: UseAgentsOptions): {
|
|
22
|
+
loading: boolean;
|
|
23
|
+
error: string | null;
|
|
24
|
+
listAgents: () => Promise<Agent[]>;
|
|
25
|
+
listAgentSummaries: () => Promise<AgentSummary[]>;
|
|
26
|
+
getAgent: (agentId: string) => Promise<Agent | null>;
|
|
27
|
+
createAgent: (agent: Partial<Agent>) => Promise<Agent | null>;
|
|
28
|
+
updateAgent: (agentId: string, agent: Partial<Agent>) => Promise<Agent | null>;
|
|
29
|
+
deleteAgent: (agentId: string) => Promise<boolean>;
|
|
30
|
+
getDefaultAgent: () => Promise<Agent | null>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Hook for skill CRUD operations
|
|
34
|
+
*/
|
|
35
|
+
declare function useSkills(options: UseAgentsOptions): {
|
|
36
|
+
loading: boolean;
|
|
37
|
+
error: string | null;
|
|
38
|
+
listSkills: () => Promise<Skill[]>;
|
|
39
|
+
getSkill: (skillId: string) => Promise<Skill | null>;
|
|
40
|
+
createSkill: (skill: Partial<Skill>) => Promise<Skill | null>;
|
|
41
|
+
updateSkill: (skillId: string, skill: Partial<Skill>) => Promise<Skill | null>;
|
|
42
|
+
deleteSkill: (skillId: string) => Promise<boolean>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Hook for sub-agent CRUD operations
|
|
46
|
+
*/
|
|
47
|
+
declare function useSubAgents(options: UseAgentsOptions): {
|
|
48
|
+
loading: boolean;
|
|
49
|
+
error: string | null;
|
|
50
|
+
listSubAgents: () => Promise<SubAgent[]>;
|
|
51
|
+
getSubAgent: (subAgentId: string) => Promise<SubAgent | null>;
|
|
52
|
+
createSubAgent: (subAgent: Partial<SubAgent>) => Promise<SubAgent | null>;
|
|
53
|
+
updateSubAgent: (subAgentId: string, subAgent: Partial<SubAgent>) => Promise<SubAgent | null>;
|
|
54
|
+
deleteSubAgent: (subAgentId: string) => Promise<boolean>;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { type UseAgentsOptions, useAgents, useSkills, useSubAgents };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ApiClientOptions } from '@elqnt/api-client';
|
|
2
|
+
import { Agent, AgentSummary, Skill, SubAgent } from '../models/index.js';
|
|
3
|
+
import '@elqnt/types';
|
|
4
|
+
|
|
5
|
+
type UseAgentsOptions = ApiClientOptions;
|
|
6
|
+
/**
|
|
7
|
+
* Hook for agent CRUD operations
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* const { loading, error, listAgents, createAgent } = useAgents({
|
|
12
|
+
* baseUrl: apiGatewayUrl,
|
|
13
|
+
* orgId: selectedOrgId,
|
|
14
|
+
* userId: user?.id,
|
|
15
|
+
* userEmail: user?.email,
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* const agents = await listAgents();
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
declare function useAgents(options: UseAgentsOptions): {
|
|
22
|
+
loading: boolean;
|
|
23
|
+
error: string | null;
|
|
24
|
+
listAgents: () => Promise<Agent[]>;
|
|
25
|
+
listAgentSummaries: () => Promise<AgentSummary[]>;
|
|
26
|
+
getAgent: (agentId: string) => Promise<Agent | null>;
|
|
27
|
+
createAgent: (agent: Partial<Agent>) => Promise<Agent | null>;
|
|
28
|
+
updateAgent: (agentId: string, agent: Partial<Agent>) => Promise<Agent | null>;
|
|
29
|
+
deleteAgent: (agentId: string) => Promise<boolean>;
|
|
30
|
+
getDefaultAgent: () => Promise<Agent | null>;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Hook for skill CRUD operations
|
|
34
|
+
*/
|
|
35
|
+
declare function useSkills(options: UseAgentsOptions): {
|
|
36
|
+
loading: boolean;
|
|
37
|
+
error: string | null;
|
|
38
|
+
listSkills: () => Promise<Skill[]>;
|
|
39
|
+
getSkill: (skillId: string) => Promise<Skill | null>;
|
|
40
|
+
createSkill: (skill: Partial<Skill>) => Promise<Skill | null>;
|
|
41
|
+
updateSkill: (skillId: string, skill: Partial<Skill>) => Promise<Skill | null>;
|
|
42
|
+
deleteSkill: (skillId: string) => Promise<boolean>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Hook for sub-agent CRUD operations
|
|
46
|
+
*/
|
|
47
|
+
declare function useSubAgents(options: UseAgentsOptions): {
|
|
48
|
+
loading: boolean;
|
|
49
|
+
error: string | null;
|
|
50
|
+
listSubAgents: () => Promise<SubAgent[]>;
|
|
51
|
+
getSubAgent: (subAgentId: string) => Promise<SubAgent | null>;
|
|
52
|
+
createSubAgent: (subAgent: Partial<SubAgent>) => Promise<SubAgent | null>;
|
|
53
|
+
updateSubAgent: (subAgentId: string, subAgent: Partial<SubAgent>) => Promise<SubAgent | null>;
|
|
54
|
+
deleteSubAgent: (subAgentId: string) => Promise<boolean>;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { type UseAgentsOptions, useAgents, useSkills, useSubAgents };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
var _chunkWL5S56WVjs = require('../chunk-WL5S56WV.js');
|
|
8
|
+
require('../chunk-YYXYKVF4.js');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
exports.useAgents = _chunkWL5S56WVjs.useAgents; exports.useSkills = _chunkWL5S56WVjs.useSkills; exports.useSubAgents = _chunkWL5S56WVjs.useSubAgents;
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/agents/dist/hooks/index.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ,YAAY;AACZ;AACE;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACA;AACA;AACF,qJAAC","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/agents/dist/hooks/index.js"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|