@burdenoff/microfe-botmanor 2026.1115.1 → 2026.1116.1
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/botlit/components/BotFormFields.js +66 -87
- package/dist/botlit/components/BotFormFields.js.map +1 -1
- package/dist/botlit/components/EmojiPicker.d.ts +20 -0
- package/dist/botlit/components/EmojiPicker.js +42 -0
- package/dist/botlit/components/EmojiPicker.js.map +1 -0
- package/dist/botlit/components/PageLayout.d.ts +5 -0
- package/dist/botlit/components/PageLayout.js +23 -14
- package/dist/botlit/components/PageLayout.js.map +1 -1
- package/dist/botlit/components/index.d.ts +1 -0
- package/dist/botlit/hooks/internal/allPages.d.ts +2 -0
- package/dist/botlit/hooks/internal/allPages.js +25 -0
- package/dist/botlit/hooks/internal/allPages.js.map +1 -0
- package/dist/botlit/hooks/useAgents.d.ts +24 -3
- package/dist/botlit/hooks/useAgents.js +158 -109
- package/dist/botlit/hooks/useAgents.js.map +1 -1
- package/dist/botlit/hooks/useBotAgents.d.ts +23 -0
- package/dist/botlit/hooks/useBotAgents.js +69 -0
- package/dist/botlit/hooks/useBotAgents.js.map +1 -0
- package/dist/botlit/hooks/useBots.js +2 -2
- package/dist/botlit/hooks/useBots.js.map +1 -1
- package/dist/botlit/hooks/useKnowledgeBases.js +40 -44
- package/dist/botlit/hooks/useKnowledgeBases.js.map +1 -1
- package/dist/botlit/hooks/useMCPServers.js +53 -57
- package/dist/botlit/hooks/useMCPServers.js.map +1 -1
- package/dist/botlit/pages/AgentBuilderPage.js +832 -425
- package/dist/botlit/pages/AgentBuilderPage.js.map +1 -1
- package/dist/botlit/pages/AgentDetailPage.js +407 -325
- package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
- package/dist/botlit/pages/AgentsListPage.js +487 -291
- package/dist/botlit/pages/AgentsListPage.js.map +1 -1
- package/dist/botlit/pages/BotDetailPage.js +247 -257
- package/dist/botlit/pages/BotDetailPage.js.map +1 -1
- package/dist/botlit/pages/BotsListPage.js +2 -2
- package/dist/botlit/pages/BotsListPage.js.map +1 -1
- package/dist/botlit/types/index.d.ts +4 -1
- package/dist/botlit/utils/agentDelete.d.ts +5 -0
- package/dist/botlit/utils/agentDelete.js +15 -0
- package/dist/botlit/utils/agentDelete.js.map +1 -0
- package/dist/botlit/utils/agentSettings.d.ts +77 -0
- package/dist/botlit/utils/agentSettings.js +78 -0
- package/dist/botlit/utils/agentSettings.js.map +1 -0
- package/dist/generated/wspace-operations.d.ts +4 -0
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +43 -0
- package/dist/generated/wspace-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { UpdateBotmanorAgentInput } from '../../generated/wspace-types';
|
|
2
|
-
import {
|
|
2
|
+
import { AgentFilter } from '../types';
|
|
3
3
|
import { GraphQLInput } from './internal/mutationInput';
|
|
4
4
|
import { PaginatedQueryResult, QueryResult } from './internal/workspaceGateway';
|
|
5
5
|
export interface AgentRecord {
|
|
@@ -7,6 +7,8 @@ export interface AgentRecord {
|
|
|
7
7
|
name: string;
|
|
8
8
|
slug: string;
|
|
9
9
|
description?: string | null;
|
|
10
|
+
/** Emoji chosen for the agent; null means the default. */
|
|
11
|
+
avatar?: string | null;
|
|
10
12
|
type: string;
|
|
11
13
|
status: string;
|
|
12
14
|
visibility?: string | null;
|
|
@@ -55,12 +57,16 @@ interface CreateAgentInput {
|
|
|
55
57
|
name: string;
|
|
56
58
|
slug?: string;
|
|
57
59
|
description?: string;
|
|
60
|
+
avatar?: string;
|
|
58
61
|
type: string;
|
|
59
62
|
systemPrompt: string;
|
|
60
63
|
temperature?: number;
|
|
61
64
|
maxTokens?: number;
|
|
65
|
+
maxConcurrentExecutions?: number;
|
|
62
66
|
capabilities?: string[];
|
|
63
67
|
llmModelId?: string;
|
|
68
|
+
knowledgeBaseIds?: string[];
|
|
69
|
+
mcpConnectionIds?: string[];
|
|
64
70
|
}
|
|
65
71
|
interface UpdateAgentInput {
|
|
66
72
|
agentId: string;
|
|
@@ -69,11 +75,11 @@ interface UpdateAgentInput {
|
|
|
69
75
|
export declare const agentKeys: {
|
|
70
76
|
all: readonly ["agents"];
|
|
71
77
|
lists: () => readonly ["agents", "list"];
|
|
72
|
-
list: (filter?:
|
|
78
|
+
list: (filter?: AgentFilter) => readonly ["agents", "list", AgentFilter | undefined];
|
|
73
79
|
details: () => readonly ["agents", "detail"];
|
|
74
80
|
detail: (id: string) => readonly ["agents", "detail", string];
|
|
75
81
|
};
|
|
76
|
-
export declare function useAgents(filter?:
|
|
82
|
+
export declare function useAgents(filter?: AgentFilter): PaginatedQueryResult<AgentRecord[]>;
|
|
77
83
|
/**
|
|
78
84
|
* Exact agent counts by status for the workspace (BOFF-12426). Unlike
|
|
79
85
|
* `useAgents` this is not capped at one page, so it is the source for
|
|
@@ -88,6 +94,21 @@ export interface AgentCounts {
|
|
|
88
94
|
archived: number;
|
|
89
95
|
}
|
|
90
96
|
export declare function useAgentCounts(enabled?: boolean): QueryResult<AgentCounts | null>;
|
|
97
|
+
/** What still uses an agent, shown in the delete confirmation (BOFF-12457). */
|
|
98
|
+
export interface AgentUsage {
|
|
99
|
+
bots: Array<{
|
|
100
|
+
id: string;
|
|
101
|
+
name: string;
|
|
102
|
+
isDefault: boolean;
|
|
103
|
+
}>;
|
|
104
|
+
a2aConnections: Array<{
|
|
105
|
+
id: string;
|
|
106
|
+
name: string;
|
|
107
|
+
}>;
|
|
108
|
+
workflowIds: string[];
|
|
109
|
+
}
|
|
110
|
+
/** Returns a function that reads what uses an agent. Reads fresh every time, because a delete is about to rely on it. */
|
|
111
|
+
export declare function useLoadAgentUsage(): (agentId: string) => Promise<AgentUsage>;
|
|
91
112
|
export declare function useAgent(agentId: string | undefined): {
|
|
92
113
|
data: AgentRecord | null;
|
|
93
114
|
loading: boolean;
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { useBotlit as e } from "../providers/BotlitProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { graphqlErrorMessage as t } from "../utils/errors.js";
|
|
3
|
+
import { buildMutationInput as n, fieldsOf as r } from "./internal/mutationInput.js";
|
|
4
|
+
import { useWorkspacePaginatedQuery as i, useWorkspaceQuery as a } from "./internal/workspaceGateway.js";
|
|
5
|
+
import { useCallback as o, useEffect as s, useMemo as c, useState as l } from "react";
|
|
6
|
+
import { gql as u } from "@apollo/client";
|
|
7
|
+
import { useGatewayClient as d } from "@burdenoff/fe-libs/shared/graphql";
|
|
7
8
|
// src/botlit/hooks/useAgents.ts
|
|
8
|
-
var
|
|
9
|
+
var f = u`
|
|
9
10
|
query ListBotmanorAgents($filters: BotmanorAgentFilterInput, $pagination: PaginationInput) {
|
|
10
11
|
listBotmanorAgents(filters: $filters, pagination: $pagination) {
|
|
11
12
|
id
|
|
12
13
|
name
|
|
13
14
|
slug
|
|
14
15
|
description
|
|
16
|
+
avatar
|
|
15
17
|
type
|
|
16
18
|
status
|
|
17
19
|
visibility
|
|
@@ -29,13 +31,14 @@ var d = l`
|
|
|
29
31
|
workspaceId
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
|
-
`,
|
|
34
|
+
`, p = u`
|
|
33
35
|
query GetBotmanorAgent($id: ID!) {
|
|
34
36
|
getBotmanorAgent(id: $id) {
|
|
35
37
|
id
|
|
36
38
|
name
|
|
37
39
|
slug
|
|
38
40
|
description
|
|
41
|
+
avatar
|
|
39
42
|
type
|
|
40
43
|
status
|
|
41
44
|
visibility
|
|
@@ -63,13 +66,14 @@ var d = l`
|
|
|
63
66
|
workspaceId
|
|
64
67
|
}
|
|
65
68
|
}
|
|
66
|
-
`,
|
|
69
|
+
`, m = u`
|
|
67
70
|
mutation CreateBotmanorAgent($input: CreateBotmanorAgentInput!) {
|
|
68
71
|
createBotmanorAgent(input: $input) {
|
|
69
72
|
id
|
|
70
73
|
name
|
|
71
74
|
slug
|
|
72
75
|
description
|
|
76
|
+
avatar
|
|
73
77
|
type
|
|
74
78
|
status
|
|
75
79
|
visibility
|
|
@@ -85,13 +89,14 @@ var d = l`
|
|
|
85
89
|
workspaceId
|
|
86
90
|
}
|
|
87
91
|
}
|
|
88
|
-
`,
|
|
92
|
+
`, h = u`
|
|
89
93
|
mutation UpdateBotmanorAgent($id: ID!, $input: UpdateBotmanorAgentInput!) {
|
|
90
94
|
updateBotmanorAgent(id: $id, input: $input) {
|
|
91
95
|
id
|
|
92
96
|
name
|
|
93
97
|
slug
|
|
94
98
|
description
|
|
99
|
+
avatar
|
|
95
100
|
type
|
|
96
101
|
status
|
|
97
102
|
visibility
|
|
@@ -112,11 +117,11 @@ var d = l`
|
|
|
112
117
|
workspaceId
|
|
113
118
|
}
|
|
114
119
|
}
|
|
115
|
-
`,
|
|
120
|
+
`, g = u`
|
|
116
121
|
mutation DeleteBotmanorAgent($id: ID!) {
|
|
117
122
|
deleteBotmanorAgent(id: $id)
|
|
118
123
|
}
|
|
119
|
-
`,
|
|
124
|
+
`, _ = u`
|
|
120
125
|
query ListAgentVersions($agentId: ID!, $pagination: PaginationInput) {
|
|
121
126
|
listAgentVersions(agentId: $agentId, pagination: $pagination) {
|
|
122
127
|
id
|
|
@@ -131,7 +136,7 @@ var d = l`
|
|
|
131
136
|
publishedAt
|
|
132
137
|
}
|
|
133
138
|
}
|
|
134
|
-
`,
|
|
139
|
+
`, v = u`
|
|
135
140
|
mutation PublishAgentVersion($agentId: ID!, $versionId: ID!, $changelog: String) {
|
|
136
141
|
publishAgentVersion(agentId: $agentId, versionId: $versionId, changelog: $changelog) {
|
|
137
142
|
id
|
|
@@ -143,7 +148,7 @@ var d = l`
|
|
|
143
148
|
publishedAt
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
|
-
`,
|
|
151
|
+
`, y = u`
|
|
147
152
|
mutation RollbackAgentVersion($agentId: ID!, $targetVersionId: ID!) {
|
|
148
153
|
rollbackAgentVersion(agentId: $agentId, targetVersionId: $targetVersionId) {
|
|
149
154
|
id
|
|
@@ -155,7 +160,8 @@ var d = l`
|
|
|
155
160
|
publishedAt
|
|
156
161
|
}
|
|
157
162
|
}
|
|
158
|
-
`,
|
|
163
|
+
`, b = 100, x = [], S = r({
|
|
164
|
+
avatar: !0,
|
|
159
165
|
bucketId: !0,
|
|
160
166
|
capabilities: !0,
|
|
161
167
|
context: !0,
|
|
@@ -178,10 +184,14 @@ var d = l`
|
|
|
178
184
|
visibility: !0,
|
|
179
185
|
workflowIds: !0
|
|
180
186
|
});
|
|
181
|
-
function
|
|
187
|
+
function C(e, n) {
|
|
188
|
+
let r = e.error;
|
|
189
|
+
if (r != null) throw Error(t(r, n), { cause: r });
|
|
190
|
+
}
|
|
191
|
+
function w(e) {
|
|
182
192
|
return e;
|
|
183
193
|
}
|
|
184
|
-
function
|
|
194
|
+
function T(e, t) {
|
|
185
195
|
if (e || t) return {
|
|
186
196
|
workspaceId: e,
|
|
187
197
|
search: t?.search,
|
|
@@ -190,20 +200,20 @@ function C(e, t) {
|
|
|
190
200
|
bucketId: t?.bucketId
|
|
191
201
|
};
|
|
192
202
|
}
|
|
193
|
-
function
|
|
194
|
-
let { workspaceId: n } = e(),
|
|
195
|
-
return
|
|
196
|
-
document:
|
|
197
|
-
variables:
|
|
198
|
-
pageSize:
|
|
203
|
+
function E(t) {
|
|
204
|
+
let { workspaceId: n } = e(), r = c(() => ({ filters: T(n, t) }), [t, n]);
|
|
205
|
+
return i({
|
|
206
|
+
document: f,
|
|
207
|
+
variables: r,
|
|
208
|
+
pageSize: b,
|
|
199
209
|
extractRows: (e) => e?.listBotmanorAgents ?? [],
|
|
200
210
|
select: (e) => e,
|
|
201
|
-
fallback:
|
|
211
|
+
fallback: x,
|
|
202
212
|
enabled: !!n,
|
|
203
213
|
errorMessage: "Failed to load agents"
|
|
204
214
|
});
|
|
205
215
|
}
|
|
206
|
-
var
|
|
216
|
+
var D = u`
|
|
207
217
|
query GetBotmanorAgentCounts {
|
|
208
218
|
getBotmanorAgentCounts {
|
|
209
219
|
total
|
|
@@ -215,10 +225,10 @@ var T = l`
|
|
|
215
225
|
}
|
|
216
226
|
}
|
|
217
227
|
`;
|
|
218
|
-
function
|
|
219
|
-
let { workspaceId: n } = e(), r =
|
|
220
|
-
return
|
|
221
|
-
document:
|
|
228
|
+
function O(t = !0) {
|
|
229
|
+
let { workspaceId: n } = e(), r = c(() => ({}), []);
|
|
230
|
+
return a({
|
|
231
|
+
document: D,
|
|
222
232
|
variables: r,
|
|
223
233
|
select: (e) => e?.getBotmanorAgentCounts ?? null,
|
|
224
234
|
fallback: null,
|
|
@@ -226,143 +236,182 @@ function E(t = !0) {
|
|
|
226
236
|
errorMessage: "Failed to load agent counts"
|
|
227
237
|
});
|
|
228
238
|
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
239
|
+
var k = u`
|
|
240
|
+
query GetBotmanorAgentUsage($id: ID!) {
|
|
241
|
+
getBotmanorAgentUsage(id: $id) {
|
|
242
|
+
bots {
|
|
243
|
+
id
|
|
244
|
+
name
|
|
245
|
+
isDefault
|
|
246
|
+
}
|
|
247
|
+
a2aConnections {
|
|
248
|
+
id
|
|
249
|
+
name
|
|
250
|
+
}
|
|
251
|
+
workflowIds
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
`;
|
|
255
|
+
function A() {
|
|
256
|
+
let e = w(d("workspace"));
|
|
257
|
+
return o(async (t) => {
|
|
258
|
+
let n = await e.query({
|
|
259
|
+
query: k,
|
|
260
|
+
variables: { id: t },
|
|
261
|
+
fetchPolicy: "network-only"
|
|
262
|
+
}), r = n.error;
|
|
263
|
+
if (r != null) throw r instanceof Error ? r : /* @__PURE__ */ Error("Failed to load agent usage");
|
|
264
|
+
return n.data?.getBotmanorAgentUsage ?? {
|
|
265
|
+
bots: [],
|
|
266
|
+
a2aConnections: [],
|
|
267
|
+
workflowIds: []
|
|
268
|
+
};
|
|
269
|
+
}, [e]);
|
|
270
|
+
}
|
|
271
|
+
function j(e) {
|
|
272
|
+
let t = w(d("workspace")), [n, r] = l(null), [i, a] = l(!!e), [c, u] = l(), f = o(async () => {
|
|
273
|
+
if (!e) r(null), a(!1);
|
|
232
274
|
else {
|
|
233
|
-
|
|
275
|
+
a(!0), u(void 0);
|
|
234
276
|
try {
|
|
235
277
|
let n = await t.query({
|
|
236
|
-
query:
|
|
278
|
+
query: p,
|
|
237
279
|
variables: { id: e },
|
|
238
280
|
fetchPolicy: "network-only"
|
|
239
|
-
});
|
|
281
|
+
}), i = n.error;
|
|
282
|
+
if (i != null) throw i instanceof Error ? i : /* @__PURE__ */ Error("Failed to load agent");
|
|
240
283
|
r(n.data?.getBotmanorAgent ?? null);
|
|
241
284
|
} catch (e) {
|
|
242
|
-
|
|
285
|
+
r(null), u(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load agent"));
|
|
243
286
|
} finally {
|
|
244
|
-
|
|
287
|
+
a(!1);
|
|
245
288
|
}
|
|
246
289
|
}
|
|
247
290
|
}, [e, t]);
|
|
248
|
-
return
|
|
249
|
-
|
|
250
|
-
}, [
|
|
291
|
+
return s(() => {
|
|
292
|
+
f();
|
|
293
|
+
}, [f]), {
|
|
251
294
|
data: n,
|
|
252
295
|
loading: i,
|
|
253
|
-
error:
|
|
254
|
-
refetch:
|
|
296
|
+
error: c,
|
|
297
|
+
refetch: f
|
|
255
298
|
};
|
|
256
299
|
}
|
|
257
|
-
function
|
|
258
|
-
let e =
|
|
300
|
+
function M() {
|
|
301
|
+
let e = w(d("workspace")), [n, r] = l({
|
|
259
302
|
data: void 0,
|
|
260
303
|
loading: !1,
|
|
261
304
|
error: void 0
|
|
262
305
|
});
|
|
263
|
-
return [
|
|
264
|
-
|
|
306
|
+
return [o(async (n) => {
|
|
307
|
+
r({
|
|
265
308
|
data: void 0,
|
|
266
309
|
loading: !0,
|
|
267
310
|
error: void 0
|
|
268
311
|
});
|
|
269
312
|
try {
|
|
270
|
-
let
|
|
271
|
-
mutation:
|
|
272
|
-
variables: { input:
|
|
273
|
-
})
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
313
|
+
let t = await e.mutate({
|
|
314
|
+
mutation: m,
|
|
315
|
+
variables: { input: n }
|
|
316
|
+
});
|
|
317
|
+
C(t, "Failed to create agent");
|
|
318
|
+
let i = t.data?.createBotmanorAgent;
|
|
319
|
+
if (!i) throw Error("Failed to create agent");
|
|
320
|
+
return r({
|
|
321
|
+
data: i,
|
|
277
322
|
loading: !1,
|
|
278
323
|
error: void 0
|
|
279
|
-
}),
|
|
324
|
+
}), i;
|
|
280
325
|
} catch (e) {
|
|
281
|
-
let
|
|
282
|
-
throw
|
|
326
|
+
let n = Error(t(e, "Failed to create agent"), { cause: e });
|
|
327
|
+
throw r({
|
|
283
328
|
data: void 0,
|
|
284
329
|
loading: !1,
|
|
285
|
-
error:
|
|
286
|
-
}),
|
|
330
|
+
error: n
|
|
331
|
+
}), n;
|
|
287
332
|
}
|
|
288
|
-
}, [e]),
|
|
333
|
+
}, [e]), n];
|
|
289
334
|
}
|
|
290
|
-
function
|
|
291
|
-
let e =
|
|
335
|
+
function N() {
|
|
336
|
+
let e = w(d("workspace")), [r, i] = l({
|
|
292
337
|
data: void 0,
|
|
293
338
|
loading: !1,
|
|
294
339
|
error: void 0
|
|
295
340
|
});
|
|
296
|
-
return [
|
|
297
|
-
|
|
341
|
+
return [o(async ({ agentId: r, input: a }) => {
|
|
342
|
+
i({
|
|
298
343
|
data: void 0,
|
|
299
344
|
loading: !0,
|
|
300
345
|
error: void 0
|
|
301
346
|
});
|
|
302
347
|
try {
|
|
303
|
-
let
|
|
304
|
-
mutation:
|
|
348
|
+
let t = await e.mutate({
|
|
349
|
+
mutation: h,
|
|
305
350
|
variables: {
|
|
306
|
-
id:
|
|
307
|
-
input:
|
|
351
|
+
id: r,
|
|
352
|
+
input: n(a, S)
|
|
308
353
|
}
|
|
309
|
-
})
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
354
|
+
});
|
|
355
|
+
C(t, "Failed to update agent");
|
|
356
|
+
let o = t.data?.updateBotmanorAgent;
|
|
357
|
+
if (!o) throw Error("Failed to update agent");
|
|
358
|
+
return i({
|
|
359
|
+
data: o,
|
|
313
360
|
loading: !1,
|
|
314
361
|
error: void 0
|
|
315
|
-
}),
|
|
362
|
+
}), o;
|
|
316
363
|
} catch (e) {
|
|
317
|
-
let
|
|
318
|
-
throw
|
|
364
|
+
let n = Error(t(e, "Failed to update agent"), { cause: e });
|
|
365
|
+
throw i({
|
|
319
366
|
data: void 0,
|
|
320
367
|
loading: !1,
|
|
321
|
-
error:
|
|
322
|
-
}),
|
|
368
|
+
error: n
|
|
369
|
+
}), n;
|
|
323
370
|
}
|
|
324
|
-
}, [e]),
|
|
371
|
+
}, [e]), r];
|
|
325
372
|
}
|
|
326
|
-
function
|
|
327
|
-
let e =
|
|
373
|
+
function P() {
|
|
374
|
+
let e = w(d("workspace")), [n, r] = l({
|
|
328
375
|
data: void 0,
|
|
329
376
|
loading: !1,
|
|
330
377
|
error: void 0
|
|
331
378
|
});
|
|
332
|
-
return [
|
|
333
|
-
|
|
379
|
+
return [o(async (n) => {
|
|
380
|
+
r({
|
|
334
381
|
data: void 0,
|
|
335
382
|
loading: !0,
|
|
336
383
|
error: void 0
|
|
337
384
|
});
|
|
338
385
|
try {
|
|
339
|
-
let
|
|
340
|
-
mutation:
|
|
341
|
-
variables: { id:
|
|
342
|
-
})
|
|
343
|
-
|
|
344
|
-
|
|
386
|
+
let t = await e.mutate({
|
|
387
|
+
mutation: g,
|
|
388
|
+
variables: { id: n }
|
|
389
|
+
});
|
|
390
|
+
C(t, "Failed to delete agent");
|
|
391
|
+
let i = t.data?.deleteBotmanorAgent ?? !1;
|
|
392
|
+
return r({
|
|
393
|
+
data: i,
|
|
345
394
|
loading: !1,
|
|
346
395
|
error: void 0
|
|
347
|
-
}),
|
|
396
|
+
}), i;
|
|
348
397
|
} catch (e) {
|
|
349
|
-
let
|
|
350
|
-
throw
|
|
398
|
+
let n = Error(t(e, "Failed to delete agent"), { cause: e });
|
|
399
|
+
throw r({
|
|
351
400
|
data: void 0,
|
|
352
401
|
loading: !1,
|
|
353
|
-
error:
|
|
354
|
-
}),
|
|
402
|
+
error: n
|
|
403
|
+
}), n;
|
|
355
404
|
}
|
|
356
|
-
}, [e]),
|
|
405
|
+
}, [e]), n];
|
|
357
406
|
}
|
|
358
|
-
function
|
|
359
|
-
let t =
|
|
407
|
+
function F(e) {
|
|
408
|
+
let t = w(d("workspace")), [n, r] = l([]), [i, a] = l(!1), [c, u] = l(), f = o(async () => {
|
|
360
409
|
if (!e) r([]);
|
|
361
410
|
else {
|
|
362
|
-
|
|
411
|
+
a(!0), u(void 0);
|
|
363
412
|
try {
|
|
364
413
|
let n = (await t.query({
|
|
365
|
-
query:
|
|
414
|
+
query: _,
|
|
366
415
|
variables: {
|
|
367
416
|
agentId: e,
|
|
368
417
|
pagination: {
|
|
@@ -374,28 +423,28 @@ function j(e) {
|
|
|
374
423
|
})).data?.listAgentVersions ?? [];
|
|
375
424
|
r([...n].sort((e, t) => e.createdAt && t.createdAt ? t.createdAt.localeCompare(e.createdAt) : 0));
|
|
376
425
|
} catch (e) {
|
|
377
|
-
|
|
426
|
+
u(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load agent versions"));
|
|
378
427
|
} finally {
|
|
379
|
-
|
|
428
|
+
a(!1);
|
|
380
429
|
}
|
|
381
430
|
}
|
|
382
431
|
}, [e, t]);
|
|
383
|
-
return
|
|
432
|
+
return s(() => {
|
|
384
433
|
f();
|
|
385
434
|
}, [f]), {
|
|
386
435
|
data: n,
|
|
387
436
|
loading: i,
|
|
388
|
-
error:
|
|
437
|
+
error: c,
|
|
389
438
|
refetch: f
|
|
390
439
|
};
|
|
391
440
|
}
|
|
392
|
-
function
|
|
393
|
-
let e =
|
|
441
|
+
function I() {
|
|
442
|
+
let e = w(d("workspace")), [t, n] = l({
|
|
394
443
|
data: void 0,
|
|
395
444
|
loading: !1,
|
|
396
445
|
error: void 0
|
|
397
446
|
});
|
|
398
|
-
return [
|
|
447
|
+
return [o(async ({ agentId: t, versionId: r, changelog: i }) => {
|
|
399
448
|
n({
|
|
400
449
|
data: void 0,
|
|
401
450
|
loading: !0,
|
|
@@ -403,7 +452,7 @@ function M() {
|
|
|
403
452
|
});
|
|
404
453
|
try {
|
|
405
454
|
let a = (await e.mutate({
|
|
406
|
-
mutation:
|
|
455
|
+
mutation: v,
|
|
407
456
|
variables: {
|
|
408
457
|
agentId: t,
|
|
409
458
|
versionId: r,
|
|
@@ -426,13 +475,13 @@ function M() {
|
|
|
426
475
|
}
|
|
427
476
|
}, [e]), t];
|
|
428
477
|
}
|
|
429
|
-
function
|
|
430
|
-
let e =
|
|
478
|
+
function L() {
|
|
479
|
+
let e = w(d("workspace")), [t, n] = l({
|
|
431
480
|
data: void 0,
|
|
432
481
|
loading: !1,
|
|
433
482
|
error: void 0
|
|
434
483
|
});
|
|
435
|
-
return [
|
|
484
|
+
return [o(async ({ agentId: t, targetVersionId: r }) => {
|
|
436
485
|
n({
|
|
437
486
|
data: void 0,
|
|
438
487
|
loading: !0,
|
|
@@ -440,7 +489,7 @@ function N() {
|
|
|
440
489
|
});
|
|
441
490
|
try {
|
|
442
491
|
let i = (await e.mutate({
|
|
443
|
-
mutation:
|
|
492
|
+
mutation: y,
|
|
444
493
|
variables: {
|
|
445
494
|
agentId: t,
|
|
446
495
|
targetVersionId: r
|
|
@@ -462,6 +511,6 @@ function N() {
|
|
|
462
511
|
}
|
|
463
512
|
}, [e]), t];
|
|
464
513
|
}
|
|
465
|
-
export {
|
|
514
|
+
export { j as useAgent, O as useAgentCounts, F as useAgentVersions, E as useAgents, M as useCreateAgent, P as useDeleteAgent, A as useLoadAgentUsage, I as usePublishAgentVersion, L as useRollbackAgentVersion, N as useUpdateAgent };
|
|
466
515
|
|
|
467
516
|
//# sourceMappingURL=useAgents.js.map
|