@burdenoff/microfe-botmanor 2026.1112.1 → 2026.1112.2
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/hooks/index.d.ts +2 -2
- package/dist/botlit/hooks/useAgents.d.ts +15 -1
- package/dist/botlit/hooks/useAgents.js +82 -59
- package/dist/botlit/hooks/useAgents.js.map +1 -1
- package/dist/botlit/hooks/useBots.d.ts +14 -1
- package/dist/botlit/hooks/useBots.js +62 -40
- package/dist/botlit/hooks/useBots.js.map +1 -1
- package/dist/botlit/pages/DashboardPage.js +170 -170
- package/dist/botlit/pages/DashboardPage.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +37 -0
- package/dist/generated/wspace-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { useBotlit as e } from "../providers/BotlitProvider.js";
|
|
2
2
|
import { buildMutationInput as t, fieldsOf as n } from "./internal/mutationInput.js";
|
|
3
|
-
import { useWorkspacePaginatedQuery as r } from "./internal/workspaceGateway.js";
|
|
4
|
-
import { useCallback as
|
|
5
|
-
import { gql as
|
|
6
|
-
import { useGatewayClient as
|
|
3
|
+
import { useWorkspacePaginatedQuery as r, useWorkspaceQuery as i } from "./internal/workspaceGateway.js";
|
|
4
|
+
import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
|
|
5
|
+
import { gql as l } from "@apollo/client";
|
|
6
|
+
import { useGatewayClient as u } from "@burdenoff/fe-libs/shared/graphql";
|
|
7
7
|
// src/botlit/hooks/useBots.ts
|
|
8
|
-
var
|
|
8
|
+
var d = l`
|
|
9
9
|
query ListBotApps($filters: BotAppFilterInput, $pagination: PaginationInput) {
|
|
10
10
|
listBotApps(filters: $filters, pagination: $pagination) {
|
|
11
11
|
id
|
|
@@ -31,7 +31,7 @@ var u = c`
|
|
|
31
31
|
workspaceId
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
`,
|
|
34
|
+
`, f = l`
|
|
35
35
|
query GetBotApp($id: ID!) {
|
|
36
36
|
getBotApp(id: $id) {
|
|
37
37
|
id
|
|
@@ -57,7 +57,7 @@ var u = c`
|
|
|
57
57
|
workspaceId
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
`,
|
|
60
|
+
`, p = l`
|
|
61
61
|
mutation CreateBotApp($input: CreateBotAppInput!) {
|
|
62
62
|
createBotApp(input: $input) {
|
|
63
63
|
id
|
|
@@ -77,7 +77,7 @@ var u = c`
|
|
|
77
77
|
workspaceId
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
`,
|
|
80
|
+
`, m = l`
|
|
81
81
|
mutation UpdateBotApp($id: ID!, $input: UpdateBotAppInput!) {
|
|
82
82
|
updateBotApp(id: $id, input: $input) {
|
|
83
83
|
id
|
|
@@ -99,11 +99,11 @@ var u = c`
|
|
|
99
99
|
workspaceId
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
`,
|
|
102
|
+
`, h = l`
|
|
103
103
|
mutation DeleteBotApp($id: ID!) {
|
|
104
104
|
deleteBotApp(id: $id)
|
|
105
105
|
}
|
|
106
|
-
`,
|
|
106
|
+
`, g = 100, _ = [], v = n({
|
|
107
107
|
bucketId: !0,
|
|
108
108
|
context: !0,
|
|
109
109
|
defaultAgentId: !0,
|
|
@@ -122,10 +122,10 @@ var u = c`
|
|
|
122
122
|
welcomeMessage: !0,
|
|
123
123
|
workflowId: !0
|
|
124
124
|
});
|
|
125
|
-
function
|
|
125
|
+
function y(e) {
|
|
126
126
|
return e;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function b(e, t) {
|
|
129
129
|
if (e || t) return {
|
|
130
130
|
workspaceId: e,
|
|
131
131
|
search: t?.search,
|
|
@@ -134,54 +134,76 @@ function y(e, t) {
|
|
|
134
134
|
bucketId: t?.bucketId
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
|
-
function
|
|
138
|
-
let { workspaceId: n } = e(), i =
|
|
137
|
+
function x(t) {
|
|
138
|
+
let { workspaceId: n } = e(), i = s(() => ({ filters: b(n, t) }), [t, n]);
|
|
139
139
|
return r({
|
|
140
|
-
document:
|
|
140
|
+
document: d,
|
|
141
141
|
variables: i,
|
|
142
|
-
pageSize:
|
|
142
|
+
pageSize: g,
|
|
143
143
|
extractRows: (e) => e?.listBotApps ?? [],
|
|
144
144
|
select: (e) => e,
|
|
145
|
-
fallback:
|
|
145
|
+
fallback: _,
|
|
146
146
|
enabled: !!n,
|
|
147
147
|
errorMessage: "Failed to load bots"
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
|
|
151
|
-
|
|
150
|
+
var S = l`
|
|
151
|
+
query GetBotAppCounts {
|
|
152
|
+
getBotAppCounts {
|
|
153
|
+
total
|
|
154
|
+
draft
|
|
155
|
+
active
|
|
156
|
+
paused
|
|
157
|
+
archived
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
`;
|
|
161
|
+
function C(t = !0) {
|
|
162
|
+
let { workspaceId: n } = e(), r = s(() => ({}), []);
|
|
163
|
+
return i({
|
|
164
|
+
document: S,
|
|
165
|
+
variables: r,
|
|
166
|
+
select: (e) => e?.getBotAppCounts ?? null,
|
|
167
|
+
fallback: null,
|
|
168
|
+
enabled: t && !!n,
|
|
169
|
+
errorMessage: "Failed to load bot counts"
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
function w(e) {
|
|
173
|
+
let t = y(u("workspace")), [n, r] = c(null), [i, s] = c(!1), [l, d] = c(), p = a(async () => {
|
|
152
174
|
if (!e) r(null);
|
|
153
175
|
else {
|
|
154
|
-
|
|
176
|
+
s(!0), d(void 0);
|
|
155
177
|
try {
|
|
156
178
|
let n = await t.query({
|
|
157
|
-
query:
|
|
179
|
+
query: f,
|
|
158
180
|
variables: { id: e },
|
|
159
181
|
fetchPolicy: "network-only"
|
|
160
182
|
});
|
|
161
183
|
r(n.data?.getBotApp ?? null);
|
|
162
184
|
} catch (e) {
|
|
163
|
-
|
|
185
|
+
d(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load bot"));
|
|
164
186
|
} finally {
|
|
165
|
-
|
|
187
|
+
s(!1);
|
|
166
188
|
}
|
|
167
189
|
}
|
|
168
190
|
}, [e, t]);
|
|
169
|
-
return
|
|
191
|
+
return o(() => {
|
|
170
192
|
p();
|
|
171
193
|
}, [p]), {
|
|
172
194
|
data: n,
|
|
173
|
-
loading:
|
|
174
|
-
error:
|
|
195
|
+
loading: i,
|
|
196
|
+
error: l,
|
|
175
197
|
refetch: p
|
|
176
198
|
};
|
|
177
199
|
}
|
|
178
|
-
function
|
|
179
|
-
let e =
|
|
200
|
+
function T() {
|
|
201
|
+
let e = y(u("workspace")), [t, n] = c({
|
|
180
202
|
data: void 0,
|
|
181
203
|
loading: !1,
|
|
182
204
|
error: void 0
|
|
183
205
|
});
|
|
184
|
-
return [
|
|
206
|
+
return [a(async (t) => {
|
|
185
207
|
n({
|
|
186
208
|
data: void 0,
|
|
187
209
|
loading: !0,
|
|
@@ -189,7 +211,7 @@ function S() {
|
|
|
189
211
|
});
|
|
190
212
|
try {
|
|
191
213
|
let r = (await e.mutate({
|
|
192
|
-
mutation:
|
|
214
|
+
mutation: p,
|
|
193
215
|
variables: { input: t }
|
|
194
216
|
})).data?.createBotApp;
|
|
195
217
|
if (!r) throw Error("Failed to create bot");
|
|
@@ -208,13 +230,13 @@ function S() {
|
|
|
208
230
|
}
|
|
209
231
|
}, [e]), t];
|
|
210
232
|
}
|
|
211
|
-
function
|
|
212
|
-
let e =
|
|
233
|
+
function E() {
|
|
234
|
+
let e = y(u("workspace")), [n, r] = c({
|
|
213
235
|
data: void 0,
|
|
214
236
|
loading: !1,
|
|
215
237
|
error: void 0
|
|
216
238
|
});
|
|
217
|
-
return [
|
|
239
|
+
return [a(async ({ botId: n, input: i }) => {
|
|
218
240
|
r({
|
|
219
241
|
data: void 0,
|
|
220
242
|
loading: !0,
|
|
@@ -222,10 +244,10 @@ function C() {
|
|
|
222
244
|
});
|
|
223
245
|
try {
|
|
224
246
|
let a = (await e.mutate({
|
|
225
|
-
mutation:
|
|
247
|
+
mutation: m,
|
|
226
248
|
variables: {
|
|
227
249
|
id: n,
|
|
228
|
-
input: t(i,
|
|
250
|
+
input: t(i, v)
|
|
229
251
|
}
|
|
230
252
|
})).data?.updateBotApp;
|
|
231
253
|
if (!a) throw Error("Failed to update bot");
|
|
@@ -244,13 +266,13 @@ function C() {
|
|
|
244
266
|
}
|
|
245
267
|
}, [e]), n];
|
|
246
268
|
}
|
|
247
|
-
function
|
|
248
|
-
let e =
|
|
269
|
+
function D() {
|
|
270
|
+
let e = y(u("workspace")), [t, n] = c({
|
|
249
271
|
data: void 0,
|
|
250
272
|
loading: !1,
|
|
251
273
|
error: void 0
|
|
252
274
|
});
|
|
253
|
-
return [
|
|
275
|
+
return [a(async (t) => {
|
|
254
276
|
n({
|
|
255
277
|
data: void 0,
|
|
256
278
|
loading: !0,
|
|
@@ -258,7 +280,7 @@ function w() {
|
|
|
258
280
|
});
|
|
259
281
|
try {
|
|
260
282
|
let r = (await e.mutate({
|
|
261
|
-
mutation:
|
|
283
|
+
mutation: h,
|
|
262
284
|
variables: { id: t }
|
|
263
285
|
})).data?.deleteBotApp ?? !1;
|
|
264
286
|
return n({
|
|
@@ -276,6 +298,6 @@ function w() {
|
|
|
276
298
|
}
|
|
277
299
|
}, [e]), t];
|
|
278
300
|
}
|
|
279
|
-
export {
|
|
301
|
+
export { w as useBot, C as useBotAppCounts, x as useBots, T as useCreateBot, D as useDeleteBot, E as useUpdateBot };
|
|
280
302
|
|
|
281
303
|
//# sourceMappingURL=useBots.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBots.js","names":["LIST_BOT_APPS_DOCUMENT","GET_BOT_APP_DOCUMENT","CREATE_BOT_APP_DOCUMENT","UPDATE_BOT_APP_DOCUMENT","DELETE_BOT_APP_DOCUMENT","LIST_PAGE_SIZE","NO_BOTS","UPDATE_BOT_APP_FIELDS","fieldsOf","getWorkspaceClient","client","buildBotFilter","workspaceId","filter","useBots","useBotlit","variables","useMemo","useWorkspacePaginatedQuery","data","rows","useBot","useGatewayClient","setData","useState","loading","setLoading","error","setError","refetch","useCallback","botId","result","queryError","useEffect","useCreateBot","state","setState","createdBot","mutationError","useUpdateBot","updatedBot","buildMutationInput","input","useDeleteBot","deleted"],"sources":["../../../src/botlit/hooks/useBots.ts"],"sourcesContent":["import { gql, type ApolloClient } from '@apollo/client';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\n\nimport type { UpdateBotAppInput } from '../../generated/wspace-types';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport type { BaseFilter } from '../types';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport { useWorkspacePaginatedQuery, type PaginatedQueryResult } from './internal/workspaceGateway';\n\nconst LIST_BOT_APPS_DOCUMENT = gql`\n query ListBotApps($filters: BotAppFilterInput, $pagination: PaginationInput) {\n listBotApps(filters: $filters, pagination: $pagination) {\n id\n name\n slug\n description\n icon\n type\n status\n visibility\n routingStrategy\n defaultAgentId\n welcomeMessage\n fallbackMessage\n workflowId\n executionCount\n lastExecutedAt\n tagIds\n createdAt\n updatedAt\n createdById\n updatedById\n workspaceId\n }\n }\n`;\n\nconst GET_BOT_APP_DOCUMENT = gql`\n query GetBotApp($id: ID!) {\n getBotApp(id: $id) {\n id\n name\n slug\n description\n icon\n type\n status\n visibility\n routingStrategy\n defaultAgentId\n welcomeMessage\n fallbackMessage\n workflowId\n executionCount\n lastExecutedAt\n tagIds\n createdAt\n updatedAt\n createdById\n updatedById\n workspaceId\n }\n }\n`;\n\nconst CREATE_BOT_APP_DOCUMENT = gql`\n mutation CreateBotApp($input: CreateBotAppInput!) {\n createBotApp(input: $input) {\n id\n name\n slug\n description\n icon\n type\n status\n visibility\n routingStrategy\n defaultAgentId\n workflowId\n tagIds\n createdAt\n updatedAt\n workspaceId\n }\n }\n`;\n\nconst UPDATE_BOT_APP_DOCUMENT = gql`\n mutation UpdateBotApp($id: ID!, $input: UpdateBotAppInput!) {\n updateBotApp(id: $id, input: $input) {\n id\n name\n slug\n description\n icon\n type\n status\n visibility\n routingStrategy\n defaultAgentId\n welcomeMessage\n fallbackMessage\n workflowId\n tagIds\n updatedAt\n updatedById\n workspaceId\n }\n }\n`;\n\nconst DELETE_BOT_APP_DOCUMENT = gql`\n mutation DeleteBotApp($id: ID!) {\n deleteBotApp(id: $id)\n }\n`;\n\ntype WorkspaceClient = ApolloClient;\n\nexport interface BotAppRecord {\n id: string;\n name: string;\n slug: string;\n description?: string | null;\n icon?: string | null;\n type: string;\n status: string;\n visibility?: string | null;\n routingStrategy?: string | null;\n defaultAgentId?: string | null;\n welcomeMessage?: string | null;\n fallbackMessage?: string | null;\n /** Bound FluidGrids workflow definition id — the bot's designed behaviour. */\n workflowId?: string | null;\n executionCount?: number | null;\n lastExecutedAt?: string | null;\n tagIds?: string[] | null;\n createdAt?: string | null;\n updatedAt?: string | null;\n createdById?: string | null;\n updatedById?: string | null;\n workspaceId?: string | null;\n}\n\ninterface ListBotAppsData {\n listBotApps: BotAppRecord[];\n}\n\nconst LIST_PAGE_SIZE = 100;\nconst NO_BOTS: BotAppRecord[] = [];\n\ninterface GetBotAppData {\n getBotApp: BotAppRecord | null;\n}\n\ninterface CreateBotAppData {\n createBotApp: BotAppRecord;\n}\n\ninterface UpdateBotAppData {\n updateBotApp: BotAppRecord;\n}\n\ninterface DeleteBotAppData {\n deleteBotApp: boolean;\n}\n\ninterface BotMutationState<T> {\n data: T | undefined;\n loading: boolean;\n error: Error | undefined;\n}\n\ninterface CreateBotInput {\n workspaceId: string;\n name: string;\n slug?: string;\n type: string;\n routingStrategy?: string;\n description?: string;\n icon?: string;\n}\n\ninterface UpdateBotInput {\n botId: string;\n input: GraphQLInput<UpdateBotAppInput>;\n}\n\nconst UPDATE_BOT_APP_FIELDS = fieldsOf<UpdateBotAppInput>({\n bucketId: true,\n context: true,\n defaultAgentId: true,\n description: true,\n fallbackMessage: true,\n icon: true,\n metadata: true,\n name: true,\n routingStrategy: true,\n slug: true,\n status: true,\n tagIds: true,\n tags: true,\n type: true,\n visibility: true,\n welcomeMessage: true,\n workflowId: true,\n});\n\nfunction getWorkspaceClient(client: unknown): WorkspaceClient {\n return client as WorkspaceClient;\n}\n\nfunction buildBotFilter(\n workspaceId: string | undefined,\n filter?: BaseFilter\n): Record<string, unknown> | undefined {\n if (!workspaceId && !filter) return undefined;\n\n return {\n workspaceId,\n search: filter?.search,\n status: filter?.status?.[0],\n visibility: filter?.visibility?.[0],\n bucketId: filter?.bucketId,\n };\n}\n\nexport const botKeys = {\n all: ['bots'] as const,\n lists: () => [...botKeys.all, 'list'] as const,\n list: (filter?: BaseFilter) => [...botKeys.lists(), filter] as const,\n details: () => [...botKeys.all, 'detail'] as const,\n detail: (id: string) => [...botKeys.details(), id] as const,\n};\n\nexport function useBots(filter?: BaseFilter): PaginatedQueryResult<BotAppRecord[]> {\n const { workspaceId } = useBotlit();\n\n const variables = useMemo(\n () => ({ filters: buildBotFilter(workspaceId, filter) }),\n [filter, workspaceId]\n );\n\n return useWorkspacePaginatedQuery<ListBotAppsData, BotAppRecord, BotAppRecord[]>({\n document: LIST_BOT_APPS_DOCUMENT,\n variables,\n pageSize: LIST_PAGE_SIZE,\n extractRows: (data) => data?.listBotApps ?? [],\n select: (rows) => rows,\n fallback: NO_BOTS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load bots',\n });\n}\n\nexport function useBot(botId: string | undefined) {\n const client = getWorkspaceClient(useGatewayClient('workspace'));\n const [data, setData] = useState<BotAppRecord | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | undefined>();\n\n const refetch = useCallback(async () => {\n if (!botId) {\n setData(null);\n return;\n }\n\n setLoading(true);\n setError(undefined);\n try {\n const result = await client.query<GetBotAppData>({\n query: GET_BOT_APP_DOCUMENT,\n variables: { id: botId },\n fetchPolicy: 'network-only',\n });\n setData(result.data?.getBotApp ?? null);\n } catch (queryError) {\n setError(queryError instanceof Error ? queryError : new Error('Failed to load bot'));\n } finally {\n setLoading(false);\n }\n }, [botId, client]);\n\n useEffect(() => {\n void refetch();\n }, [refetch]);\n\n return { data, loading, error, refetch };\n}\n\nexport function useCreateBot() {\n const client = getWorkspaceClient(useGatewayClient('workspace'));\n const [state, setState] = useState<BotMutationState<BotAppRecord>>({\n data: undefined,\n loading: false,\n error: undefined,\n });\n\n const createBot = useCallback(\n async (input: CreateBotInput) => {\n setState({ data: undefined, loading: true, error: undefined });\n try {\n const result = await client.mutate<CreateBotAppData>({\n mutation: CREATE_BOT_APP_DOCUMENT,\n variables: { input },\n });\n\n const createdBot = result.data?.createBotApp;\n if (!createdBot) {\n throw new Error('Failed to create bot');\n }\n\n setState({ data: createdBot, loading: false, error: undefined });\n return createdBot;\n } catch (mutationError) {\n const error =\n mutationError instanceof Error ? mutationError : new Error('Failed to create bot');\n setState({ data: undefined, loading: false, error });\n throw error;\n }\n },\n [client]\n );\n\n return [createBot, state] as const;\n}\n\nexport function useUpdateBot() {\n const client = getWorkspaceClient(useGatewayClient('workspace'));\n const [state, setState] = useState<BotMutationState<BotAppRecord>>({\n data: undefined,\n loading: false,\n error: undefined,\n });\n\n const updateBot = useCallback(\n async ({ botId, input }: UpdateBotInput) => {\n setState({ data: undefined, loading: true, error: undefined });\n try {\n const result = await client.mutate<UpdateBotAppData>({\n mutation: UPDATE_BOT_APP_DOCUMENT,\n variables: { id: botId, input: buildMutationInput(input, UPDATE_BOT_APP_FIELDS) },\n });\n\n const updatedBot = result.data?.updateBotApp;\n if (!updatedBot) {\n throw new Error('Failed to update bot');\n }\n\n setState({ data: updatedBot, loading: false, error: undefined });\n return updatedBot;\n } catch (mutationError) {\n const error =\n mutationError instanceof Error ? mutationError : new Error('Failed to update bot');\n setState({ data: undefined, loading: false, error });\n throw error;\n }\n },\n [client]\n );\n\n return [updateBot, state] as const;\n}\n\nexport function useDeleteBot() {\n const client = getWorkspaceClient(useGatewayClient('workspace'));\n const [state, setState] = useState<BotMutationState<boolean>>({\n data: undefined,\n loading: false,\n error: undefined,\n });\n\n const deleteBot = useCallback(\n async (botId: string) => {\n setState({ data: undefined, loading: true, error: undefined });\n try {\n const result = await client.mutate<DeleteBotAppData>({\n mutation: DELETE_BOT_APP_DOCUMENT,\n variables: { id: botId },\n });\n\n const deleted = result.data?.deleteBotApp ?? false;\n setState({ data: deleted, loading: false, error: undefined });\n return deleted;\n } catch (mutationError) {\n const error =\n mutationError instanceof Error ? mutationError : new Error('Failed to delete bot');\n setState({ data: undefined, loading: false, error });\n throw error;\n }\n },\n [client]\n );\n\n return [deleteBot, state] as const;\n}\n"],"mappings":";;;;;;;AAUA,IAAMA,IAAyB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;GA4B5BC,IAAuB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;GA4B1BC,IAA0B,CAAG;;;;;;;;;;;;;;;;;;;;GAsB7BC,IAA0B,CAAG;;;;;;;;;;;;;;;;;;;;;;GAwB7BC,IAA0B,CAAG;;;;GAqC7BC,IAAiB,KACjBC,IAA0B,CAAC,GAuC3BC,IAAwBC,EAA4B;CACxD,UAAU;CACV,SAAS;CACT,gBAAgB;CAChB,aAAa;CACb,iBAAiB;CACjB,MAAM;CACN,UAAU;CACV,MAAM;CACN,iBAAiB;CACjB,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,MAAM;CACN,MAAM;CACN,YAAY;CACZ,gBAAgB;CAChB,YAAY;AACd,CAAC;AAED,SAASC,EAAmB,GAAkC;CAC5D,OAAOC;AACT;AAEA,SAASC,EACP,GACA,GACqC;CACrC,IAAKC,KAAgBC,GAErB,OAAO;EACL;EACA,QAAQA,GAAQ;EAChB,QAAQA,GAAQ,SAAS;EACzB,YAAYA,GAAQ,aAAa;EACjC,UAAUA,GAAQ;CACpB;AACF;AAUA,SAAgBC,EAAQ,GAA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AO;GAAM,CAAC,GAC7CV;EACR;CACF,GACA,CAACjB,CAAM,CAGD,GAAW0B,CAAK;AAC1B;AAEA,SAAgBQ,IAAe;CAC7B,IAAMlC,IAASD,EAAmBa,EAAiB,WAAW,CAAC,GACzD,CAACc,GAAOC,KAAYb,EAAoC;EAC5D,MAAM,KAAA;EACN,SAAS;EACT,OAAO,KAAA;CACT,CAAC;CAwBD,OAAO,CAtBWM,EAChB,OAAO,MAAkB;EACvB,EAAS;GAAE,MAAM,KAAA;GAAW,SAAS;GAAM,OAAO,KAAA;EAAU,CAAC;EAC7D,IAAI;GAMF,IAAMe,KAAU,MALKnC,EAAO,OAAyB;IACnD,UAAUN;IACV,WAAW,EAAE,IAAI2B,EAAM;GACzB,CAAC,EAAA,CAEsB,MAAM,gBAAgB;GAE7C,OADAM,EAAS;IAAE,MAAMQ;IAAS,SAAS;IAAO,OAAO,KAAA;GAAU,CAAC,GACrDA;EACT,SAASN,GAAe;GACtB,IAAMZ,IACJY,aAAyB,QAAQA,IAAgB,gBAAI,MAAM,sBAAsB;GAEnF,MADAF,EAAS;IAAE,MAAM,KAAA;IAAW,SAAS;IAAO;GAAM,CAAC,GAC7CV;EACR;CACF,GACA,CAACjB,CAAM,CAGD,GAAW0B,CAAK;AAC1B"}
|
|
1
|
+
{"version":3,"file":"useBots.js","names":["LIST_BOT_APPS_DOCUMENT","GET_BOT_APP_DOCUMENT","CREATE_BOT_APP_DOCUMENT","UPDATE_BOT_APP_DOCUMENT","DELETE_BOT_APP_DOCUMENT","LIST_PAGE_SIZE","NO_BOTS","UPDATE_BOT_APP_FIELDS","fieldsOf","getWorkspaceClient","client","buildBotFilter","workspaceId","filter","useBots","useBotlit","variables","useMemo","useWorkspacePaginatedQuery","data","rows","GET_BOT_APP_COUNTS_DOCUMENT","useBotAppCounts","useWorkspaceQuery","enabled","useBot","useGatewayClient","setData","useState","loading","setLoading","error","setError","refetch","useCallback","botId","result","queryError","useEffect","useCreateBot","state","setState","createdBot","mutationError","useUpdateBot","updatedBot","buildMutationInput","input","useDeleteBot","deleted"],"sources":["../../../src/botlit/hooks/useBots.ts"],"sourcesContent":["import { gql, type ApolloClient } from '@apollo/client';\nimport { useCallback, useEffect, useMemo, useState } from 'react';\nimport { useGatewayClient } from '@burdenoff/fe-libs/shared/graphql';\n\nimport type { UpdateBotAppInput } from '../../generated/wspace-types';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport type { BaseFilter } from '../types';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspacePaginatedQuery,\n useWorkspaceQuery,\n type PaginatedQueryResult,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_BOT_APPS_DOCUMENT = gql`\n query ListBotApps($filters: BotAppFilterInput, $pagination: PaginationInput) {\n listBotApps(filters: $filters, pagination: $pagination) {\n id\n name\n slug\n description\n icon\n type\n status\n visibility\n routingStrategy\n defaultAgentId\n welcomeMessage\n fallbackMessage\n workflowId\n executionCount\n lastExecutedAt\n tagIds\n createdAt\n updatedAt\n createdById\n updatedById\n workspaceId\n }\n }\n`;\n\nconst GET_BOT_APP_DOCUMENT = gql`\n query GetBotApp($id: ID!) {\n getBotApp(id: $id) {\n id\n name\n slug\n description\n icon\n type\n status\n visibility\n routingStrategy\n defaultAgentId\n welcomeMessage\n fallbackMessage\n workflowId\n executionCount\n lastExecutedAt\n tagIds\n createdAt\n updatedAt\n createdById\n updatedById\n workspaceId\n }\n }\n`;\n\nconst CREATE_BOT_APP_DOCUMENT = gql`\n mutation CreateBotApp($input: CreateBotAppInput!) {\n createBotApp(input: $input) {\n id\n name\n slug\n description\n icon\n type\n status\n visibility\n routingStrategy\n defaultAgentId\n workflowId\n tagIds\n createdAt\n updatedAt\n workspaceId\n }\n }\n`;\n\nconst UPDATE_BOT_APP_DOCUMENT = gql`\n mutation UpdateBotApp($id: ID!, $input: UpdateBotAppInput!) {\n updateBotApp(id: $id, input: $input) {\n id\n name\n slug\n description\n icon\n type\n status\n visibility\n routingStrategy\n defaultAgentId\n welcomeMessage\n fallbackMessage\n workflowId\n tagIds\n updatedAt\n updatedById\n workspaceId\n }\n }\n`;\n\nconst DELETE_BOT_APP_DOCUMENT = gql`\n mutation DeleteBotApp($id: ID!) {\n deleteBotApp(id: $id)\n }\n`;\n\ntype WorkspaceClient = ApolloClient;\n\nexport interface BotAppRecord {\n id: string;\n name: string;\n slug: string;\n description?: string | null;\n icon?: string | null;\n type: string;\n status: string;\n visibility?: string | null;\n routingStrategy?: string | null;\n defaultAgentId?: string | null;\n welcomeMessage?: string | null;\n fallbackMessage?: string | null;\n /** Bound FluidGrids workflow definition id — the bot's designed behaviour. */\n workflowId?: string | null;\n executionCount?: number | null;\n lastExecutedAt?: string | null;\n tagIds?: string[] | null;\n createdAt?: string | null;\n updatedAt?: string | null;\n createdById?: string | null;\n updatedById?: string | null;\n workspaceId?: string | null;\n}\n\ninterface ListBotAppsData {\n listBotApps: BotAppRecord[];\n}\n\nconst LIST_PAGE_SIZE = 100;\nconst NO_BOTS: BotAppRecord[] = [];\n\ninterface GetBotAppData {\n getBotApp: BotAppRecord | null;\n}\n\ninterface CreateBotAppData {\n createBotApp: BotAppRecord;\n}\n\ninterface UpdateBotAppData {\n updateBotApp: BotAppRecord;\n}\n\ninterface DeleteBotAppData {\n deleteBotApp: boolean;\n}\n\ninterface BotMutationState<T> {\n data: T | undefined;\n loading: boolean;\n error: Error | undefined;\n}\n\ninterface CreateBotInput {\n workspaceId: string;\n name: string;\n slug?: string;\n type: string;\n routingStrategy?: string;\n description?: string;\n icon?: string;\n}\n\ninterface UpdateBotInput {\n botId: string;\n input: GraphQLInput<UpdateBotAppInput>;\n}\n\nconst UPDATE_BOT_APP_FIELDS = fieldsOf<UpdateBotAppInput>({\n bucketId: true,\n context: true,\n defaultAgentId: true,\n description: true,\n fallbackMessage: true,\n icon: true,\n metadata: true,\n name: true,\n routingStrategy: true,\n slug: true,\n status: true,\n tagIds: true,\n tags: true,\n type: true,\n visibility: true,\n welcomeMessage: true,\n workflowId: true,\n});\n\nfunction getWorkspaceClient(client: unknown): WorkspaceClient {\n return client as WorkspaceClient;\n}\n\nfunction buildBotFilter(\n workspaceId: string | undefined,\n filter?: BaseFilter\n): Record<string, unknown> | undefined {\n if (!workspaceId && !filter) return undefined;\n\n return {\n workspaceId,\n search: filter?.search,\n status: filter?.status?.[0],\n visibility: filter?.visibility?.[0],\n bucketId: filter?.bucketId,\n };\n}\n\nexport const botKeys = {\n all: ['bots'] as const,\n lists: () => [...botKeys.all, 'list'] as const,\n list: (filter?: BaseFilter) => [...botKeys.lists(), filter] as const,\n details: () => [...botKeys.all, 'detail'] as const,\n detail: (id: string) => [...botKeys.details(), id] as const,\n};\n\nexport function useBots(filter?: BaseFilter): PaginatedQueryResult<BotAppRecord[]> {\n const { workspaceId } = useBotlit();\n\n const variables = useMemo(\n () => ({ filters: buildBotFilter(workspaceId, filter) }),\n [filter, workspaceId]\n );\n\n return useWorkspacePaginatedQuery<ListBotAppsData, BotAppRecord, BotAppRecord[]>({\n document: LIST_BOT_APPS_DOCUMENT,\n variables,\n pageSize: LIST_PAGE_SIZE,\n extractRows: (data) => data?.listBotApps ?? [],\n select: (rows) => rows,\n fallback: NO_BOTS,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load bots',\n });\n}\n\n/**\n * Exact bot counts by status for the workspace (BOFF-12426). Unlike `useBots`\n * this is not capped at one page, so it is the source for dashboard totals.\n * `total` counts every status; the dashboard shows `total - archived`.\n */\nexport interface BotAppCounts {\n total: number;\n draft: number;\n active: number;\n paused: number;\n archived: number;\n}\n\ninterface BotAppCountsData {\n getBotAppCounts?: BotAppCounts | null;\n}\n\nconst GET_BOT_APP_COUNTS_DOCUMENT = gql`\n query GetBotAppCounts {\n getBotAppCounts {\n total\n draft\n active\n paused\n archived\n }\n }\n`;\n\nexport function useBotAppCounts(enabled = true): QueryResult<BotAppCounts | null> {\n const { workspaceId } = useBotlit();\n const variables = useMemo(() => ({}), []);\n\n return useWorkspaceQuery<BotAppCountsData, BotAppCounts | null>({\n document: GET_BOT_APP_COUNTS_DOCUMENT,\n variables,\n select: (data) => data?.getBotAppCounts ?? null,\n fallback: null,\n enabled: enabled && Boolean(workspaceId),\n errorMessage: 'Failed to load bot counts',\n });\n}\n\nexport function useBot(botId: string | undefined) {\n const client = getWorkspaceClient(useGatewayClient('workspace'));\n const [data, setData] = useState<BotAppRecord | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<Error | undefined>();\n\n const refetch = useCallback(async () => {\n if (!botId) {\n setData(null);\n return;\n }\n\n setLoading(true);\n setError(undefined);\n try {\n const result = await client.query<GetBotAppData>({\n query: GET_BOT_APP_DOCUMENT,\n variables: { id: botId },\n fetchPolicy: 'network-only',\n });\n setData(result.data?.getBotApp ?? null);\n } catch (queryError) {\n setError(queryError instanceof Error ? queryError : new Error('Failed to load bot'));\n } finally {\n setLoading(false);\n }\n }, [botId, client]);\n\n useEffect(() => {\n void refetch();\n }, [refetch]);\n\n return { data, loading, error, refetch };\n}\n\nexport function useCreateBot() {\n const client = getWorkspaceClient(useGatewayClient('workspace'));\n const [state, setState] = useState<BotMutationState<BotAppRecord>>({\n data: undefined,\n loading: false,\n error: undefined,\n });\n\n const createBot = useCallback(\n async (input: CreateBotInput) => {\n setState({ data: undefined, loading: true, error: undefined });\n try {\n const result = await client.mutate<CreateBotAppData>({\n mutation: CREATE_BOT_APP_DOCUMENT,\n variables: { input },\n });\n\n const createdBot = result.data?.createBotApp;\n if (!createdBot) {\n throw new Error('Failed to create bot');\n }\n\n setState({ data: createdBot, loading: false, error: undefined });\n return createdBot;\n } catch (mutationError) {\n const error =\n mutationError instanceof Error ? mutationError : new Error('Failed to create bot');\n setState({ data: undefined, loading: false, error });\n throw error;\n }\n },\n [client]\n );\n\n return [createBot, state] as const;\n}\n\nexport function useUpdateBot() {\n const client = getWorkspaceClient(useGatewayClient('workspace'));\n const [state, setState] = useState<BotMutationState<BotAppRecord>>({\n data: undefined,\n loading: false,\n error: undefined,\n });\n\n const updateBot = useCallback(\n async ({ botId, input }: UpdateBotInput) => {\n setState({ data: undefined, loading: true, error: undefined });\n try {\n const result = await client.mutate<UpdateBotAppData>({\n mutation: UPDATE_BOT_APP_DOCUMENT,\n variables: { id: botId, input: buildMutationInput(input, UPDATE_BOT_APP_FIELDS) },\n });\n\n const updatedBot = result.data?.updateBotApp;\n if (!updatedBot) {\n throw new Error('Failed to update bot');\n }\n\n setState({ data: updatedBot, loading: false, error: undefined });\n return updatedBot;\n } catch (mutationError) {\n const error =\n mutationError instanceof Error ? mutationError : new Error('Failed to update bot');\n setState({ data: undefined, loading: false, error });\n throw error;\n }\n },\n [client]\n );\n\n return [updateBot, state] as const;\n}\n\nexport function useDeleteBot() {\n const client = getWorkspaceClient(useGatewayClient('workspace'));\n const [state, setState] = useState<BotMutationState<boolean>>({\n data: undefined,\n loading: false,\n error: undefined,\n });\n\n const deleteBot = useCallback(\n async (botId: string) => {\n setState({ data: undefined, loading: true, error: undefined });\n try {\n const result = await client.mutate<DeleteBotAppData>({\n mutation: DELETE_BOT_APP_DOCUMENT,\n variables: { id: botId },\n });\n\n const deleted = result.data?.deleteBotApp ?? false;\n setState({ data: deleted, loading: false, error: undefined });\n return deleted;\n } catch (mutationError) {\n const error =\n mutationError instanceof Error ? mutationError : new Error('Failed to delete bot');\n setState({ data: undefined, loading: false, error });\n throw error;\n }\n },\n [client]\n );\n\n return [deleteBot, state] as const;\n}\n"],"mappings":";;;;;;;AAeA,IAAMA,IAAyB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;GA4B5BC,IAAuB,CAAG;;;;;;;;;;;;;;;;;;;;;;;;;;GA4B1BC,IAA0B,CAAG;;;;;;;;;;;;;;;;;;;;GAsB7BC,IAA0B,CAAG;;;;;;;;;;;;;;;;;;;;;;GAwB7BC,IAA0B,CAAG;;;;GAqC7BC,IAAiB,KACjBC,IAA0B,CAAC,GAuC3BC,IAAwBC,EAA4B;CACxD,UAAU;CACV,S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