@burdenoff/microfe-botmanor 2026.1123.8 → 2026.1123.9

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.
@@ -1,4 +1,4 @@
1
- import { CreateKnowledgeBaseDocument as e, DeleteKnowledgeBaseDocument as t, GetKnowledgeBaseDocument as n, GetKnowledgeBaseUsageDocument as r, ListKnowledgeBasesDocument as i, ListKnowledgeDocumentsDocument as a, RebuildKnowledgeBaseIndexDocument as o, RemoveKnowledgeDocumentDocument as s, UpdateKnowledgeBaseDocument as c } from "../../generated/wspace-operations.js";
1
+ import { CreateKnowledgeBaseDocument as e, DeleteKnowledgeBaseDocument as t, GetKnowledgeBaseDocument as n, GetKnowledgeBaseUsageDocument as r, ListBotmanorKnowledgeBasesPageDocument as i, ListKnowledgeDocumentsDocument as a, RebuildKnowledgeBaseIndexDocument as o, RemoveKnowledgeDocumentDocument as s, UpdateKnowledgeBaseDocument as c } from "../../generated/wspace-operations.js";
2
2
  import { useAllPagesQuery as l } from "./internal/allPages.js";
3
3
  import { buildMutationInput as u, fieldsOf as d } from "./internal/mutationInput.js";
4
4
  import { useWorkspaceClient as f, useWorkspaceId as p, useWorkspaceMutation as m, useWorkspaceQuery as h } from "./internal/workspaceGateway.js";
@@ -24,15 +24,12 @@ var v = 100, y = d({
24
24
  name: !0
25
25
  }), x = [], S = [];
26
26
  function C(e) {
27
- return e?.listKnowledgeBases ?? x;
28
- }
29
- function w(e) {
30
27
  return e?.getKnowledgeBase ?? null;
31
28
  }
32
- function T(e) {
29
+ function w(e) {
33
30
  return e?.listKnowledgeDocuments ?? S;
34
31
  }
35
- function E(e) {
32
+ function T(e) {
36
33
  let t = p(), n = e?.search, r = _(() => ({ filters: {
37
34
  workspaceId: t,
38
35
  search: n || void 0
@@ -41,36 +38,37 @@ function E(e) {
41
38
  document: i,
42
39
  variables: r,
43
40
  pageSize: v,
44
- extractRows: C,
41
+ extractRows: (e) => e?.listBotmanorKnowledgeBasesPage.items ?? x,
42
+ extractNextOffset: (e) => e?.listBotmanorKnowledgeBasesPage.nextOffset ?? null,
45
43
  fallback: x,
46
44
  enabled: !!t,
47
45
  errorMessage: "Failed to load knowledge bases"
48
46
  });
49
47
  }
50
- function D(e) {
48
+ function E(e) {
51
49
  let t = _(() => ({ id: e ?? "" }), [e]);
52
50
  return h({
53
51
  document: n,
54
52
  variables: t,
55
- select: w,
53
+ select: C,
56
54
  fallback: null,
57
55
  enabled: !!e,
58
56
  errorMessage: "Failed to load knowledge base"
59
57
  });
60
58
  }
61
- function O(e) {
59
+ function D(e) {
62
60
  let t = _(() => ({ knowledgeBaseId: e ?? "" }), [e]);
63
61
  return l({
64
62
  document: a,
65
63
  variables: t,
66
64
  pageSize: v,
67
- extractRows: T,
65
+ extractRows: w,
68
66
  fallback: S,
69
67
  enabled: !!e,
70
68
  errorMessage: "Failed to load knowledge documents"
71
69
  });
72
70
  }
73
- function k() {
71
+ function O() {
74
72
  let e = f();
75
73
  return g(async (t) => {
76
74
  let n = await e.query({
@@ -82,7 +80,7 @@ function k() {
82
80
  return n.data?.getKnowledgeBaseUsage ?? { agents: [] };
83
81
  }, [e]);
84
82
  }
85
- function A() {
83
+ function k() {
86
84
  return m({
87
85
  document: s,
88
86
  variables: (e) => ({ id: e }),
@@ -90,7 +88,7 @@ function A() {
90
88
  errorMessage: "Failed to remove the document"
91
89
  });
92
90
  }
93
- function j() {
91
+ function A() {
94
92
  let t = p(), n = g((e) => ({ input: u({
95
93
  ...e,
96
94
  workspaceId: t
@@ -102,7 +100,7 @@ function j() {
102
100
  errorMessage: "Failed to create knowledge base"
103
101
  });
104
102
  }
105
- function M() {
103
+ function j() {
106
104
  return m({
107
105
  document: c,
108
106
  variables: ({ kbId: e, input: t }) => ({
@@ -113,7 +111,7 @@ function M() {
113
111
  errorMessage: "Failed to update knowledge base"
114
112
  });
115
113
  }
116
- function N() {
114
+ function M() {
117
115
  return m({
118
116
  document: o,
119
117
  variables: (e) => ({ knowledgeBaseId: e }),
@@ -121,7 +119,7 @@ function N() {
121
119
  errorMessage: "Failed to rebuild the knowledge base index"
122
120
  });
123
121
  }
124
- function P() {
122
+ function N() {
125
123
  return m({
126
124
  document: t,
127
125
  variables: (e) => ({ id: e }),
@@ -129,6 +127,6 @@ function P() {
129
127
  errorMessage: "Failed to delete knowledge base"
130
128
  });
131
129
  }
132
- export { j as useCreateKnowledgeBase, P as useDeleteKnowledgeBase, D as useKnowledgeBase, E as useKnowledgeBases, O as useKnowledgeDocuments, k as useLoadKnowledgeBaseUsage, N as useRebuildKnowledgeBaseIndex, A as useRemoveKnowledgeDocument, M as useUpdateKnowledgeBase };
130
+ export { A as useCreateKnowledgeBase, N as useDeleteKnowledgeBase, E as useKnowledgeBase, T as useKnowledgeBases, D as useKnowledgeDocuments, O as useLoadKnowledgeBaseUsage, M as useRebuildKnowledgeBaseIndex, k as useRemoveKnowledgeDocument, j as useUpdateKnowledgeBase };
133
131
 
134
132
  //# sourceMappingURL=useKnowledgeBases.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useKnowledgeBases.js","names":["LIST_LIMIT","CREATE_KB_FIELDS","fieldsOf","UPDATE_KB_FIELDS","NO_KNOWLEDGE_BASES","NO_DOCUMENTS","selectKnowledgeBases","data","selectKnowledgeBase","selectDocuments","useKnowledgeBases","workspaceId","useWorkspaceId","search","filter","variables","useMemo","useAllPagesQuery","ListKnowledgeBasesDocument","useKnowledgeBase","kbId","useWorkspaceQuery","GetKnowledgeBaseDocument","useKnowledgeDocuments","ListKnowledgeDocumentsDocument","useLoadKnowledgeBaseUsage","client","useWorkspaceClient","useCallback","result","GetKnowledgeBaseUsageDocument","operationError","useRemoveKnowledgeDocument","useWorkspaceMutation","RemoveKnowledgeDocumentDocument","documentId","useCreateKnowledgeBase","buildMutationInput","input","CreateKnowledgeBaseDocument","useUpdateKnowledgeBase","UpdateKnowledgeBaseDocument","useRebuildKnowledgeBaseIndex","RebuildKnowledgeBaseIndexDocument","useDeleteKnowledgeBase","DeleteKnowledgeBaseDocument"],"sources":["../../../src/botlit/hooks/useKnowledgeBases.ts"],"sourcesContent":["/**\n * Knowledge Bases Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listKnowledgeBases` / `getKnowledgeBase` /\n * `listKnowledgeDocuments` operations and the create/update/delete mutations on\n * wspace-botlit-svc.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateKnowledgeBaseDocument,\n DeleteKnowledgeBaseDocument,\n GetKnowledgeBaseDocument,\n GetKnowledgeBaseUsageDocument,\n ListKnowledgeBasesDocument,\n ListKnowledgeDocumentsDocument,\n RebuildKnowledgeBaseIndexDocument,\n RemoveKnowledgeDocumentDocument,\n UpdateKnowledgeBaseDocument,\n type CreateKnowledgeBaseMutation,\n type DeleteKnowledgeBaseMutation,\n type GetKnowledgeBaseQuery,\n type ListKnowledgeBasesQuery,\n type ListKnowledgeDocumentsQuery,\n type GetKnowledgeBaseUsageQuery,\n type RebuildKnowledgeBaseIndexMutation,\n type RemoveKnowledgeDocumentMutation,\n type UpdateKnowledgeBaseMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateKnowledgeBaseInput,\n UpdateKnowledgeBaseInput,\n} from '../../generated/wspace-types';\nimport type { BaseFilter } from '../types';\nimport { useAllPagesQuery } from './internal/allPages';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceClient,\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 100;\n\nexport interface KnowledgeBaseRecord {\n id: string;\n name: string;\n description?: string | null;\n indexStatus: string;\n embeddingModel: string;\n embeddingDimensions: number;\n chunkingStrategy: string;\n chunkSize: number;\n chunkOverlap: number;\n totalDocuments: number;\n totalChunks: number;\n vectorCount: number;\n lastIndexedAt?: string | null;\n metadata?: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n createdById: string;\n updatedById: string;\n workspaceId: string;\n}\n\nexport interface KnowledgeDocumentRecord {\n id: string;\n knowledgeBaseId: string;\n title: string;\n fileId: string;\n status: string;\n chunkCount: number;\n processingError?: string | null;\n processedAt?: string | null;\n addedAt: string;\n addedById: string;\n updatedAt: string;\n}\n\n/**\n * `CreateKnowledgeBaseInput` minus the `workspaceId` the hook supplies.\n * `embeddingModel`/`embeddingDimensions` are required by the service.\n */\nexport type CreateKnowledgeBaseVariables = Omit<\n GraphQLInput<CreateKnowledgeBaseInput>,\n 'workspaceId'\n>;\n\nexport interface UpdateKnowledgeBaseVariables {\n kbId: string;\n input: GraphQLInput<UpdateKnowledgeBaseInput>;\n}\n\nconst CREATE_KB_FIELDS = fieldsOf<CreateKnowledgeBaseInput>({\n chunkOverlap: true,\n chunkSize: true,\n chunkingStrategy: true,\n description: true,\n embeddingDimensions: true,\n embeddingModel: true,\n metadata: true,\n name: true,\n // Optional: the service picks the environment default when omitted.\n vectorStoreDriver: true,\n workspaceId: true,\n});\n\nconst UPDATE_KB_FIELDS = fieldsOf<UpdateKnowledgeBaseInput>({\n chunkOverlap: true,\n chunkSize: true,\n chunkingStrategy: true,\n description: true,\n metadata: true,\n name: true,\n});\n\nconst NO_KNOWLEDGE_BASES: KnowledgeBaseRecord[] = [];\nconst NO_DOCUMENTS: KnowledgeDocumentRecord[] = [];\n\nfunction selectKnowledgeBases(data: ListKnowledgeBasesQuery | undefined): KnowledgeBaseRecord[] {\n return data?.listKnowledgeBases ?? NO_KNOWLEDGE_BASES;\n}\n\nfunction selectKnowledgeBase(data: GetKnowledgeBaseQuery | undefined): KnowledgeBaseRecord | null {\n return data?.getKnowledgeBase ?? null;\n}\n\nfunction selectDocuments(data: ListKnowledgeDocumentsQuery | undefined): KnowledgeDocumentRecord[] {\n return data?.listKnowledgeDocuments ?? NO_DOCUMENTS;\n}\n\nexport const knowledgeBaseKeys = {\n all: ['knowledgeBases'] as const,\n lists: () => [...knowledgeBaseKeys.all, 'list'] as const,\n list: (filter?: BaseFilter) => [...knowledgeBaseKeys.lists(), filter] as const,\n details: () => [...knowledgeBaseKeys.all, 'detail'] as const,\n detail: (id: string) => [...knowledgeBaseKeys.details(), id] as const,\n documents: (kbId: string) => [...knowledgeBaseKeys.detail(kbId), 'documents'] as const,\n};\n\nexport function useKnowledgeBases(filter?: BaseFilter): QueryResult<KnowledgeBaseRecord[]> {\n const workspaceId = useWorkspaceId();\n const search = filter?.search;\n\n const variables = useMemo(\n () => ({\n filters: { workspaceId, search: search || undefined },\n }),\n [workspaceId, search]\n );\n\n // Every page: pickers and lookups need the whole list, not the first 100.\n return useAllPagesQuery<ListKnowledgeBasesQuery, KnowledgeBaseRecord>({\n document: ListKnowledgeBasesDocument,\n variables,\n pageSize: LIST_LIMIT,\n extractRows: selectKnowledgeBases,\n fallback: NO_KNOWLEDGE_BASES,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load knowledge bases',\n });\n}\n\nexport function useKnowledgeBase(\n kbId: string | undefined\n): QueryResult<KnowledgeBaseRecord | null> {\n const variables = useMemo(() => ({ id: kbId ?? '' }), [kbId]);\n\n return useWorkspaceQuery<GetKnowledgeBaseQuery, KnowledgeBaseRecord | null>({\n document: GetKnowledgeBaseDocument,\n variables,\n select: selectKnowledgeBase,\n fallback: null,\n enabled: Boolean(kbId),\n errorMessage: 'Failed to load knowledge base',\n });\n}\n\n/** Every document of a knowledge base: all pages, `loading` until the last one is in. */\nexport function useKnowledgeDocuments(\n kbId: string | undefined\n): QueryResult<KnowledgeDocumentRecord[]> {\n const variables = useMemo(() => ({ knowledgeBaseId: kbId ?? '' }), [kbId]);\n\n return useAllPagesQuery<ListKnowledgeDocumentsQuery, KnowledgeDocumentRecord>({\n document: ListKnowledgeDocumentsDocument,\n variables,\n pageSize: LIST_LIMIT,\n extractRows: selectDocuments,\n fallback: NO_DOCUMENTS,\n enabled: Boolean(kbId),\n errorMessage: 'Failed to load knowledge documents',\n });\n}\n\n/** What still uses a knowledge base: the live agents that have it attached (BOFF-12472). */\nexport interface KnowledgeBaseUsage {\n agents: Array<{ id: string; name: string; status: string }>;\n}\n\n/** Returns a function that reads what uses a knowledge base, fresh each time: a delete is about to rely on it. */\nexport function useLoadKnowledgeBaseUsage() {\n const client = useWorkspaceClient();\n\n return useCallback(\n async (kbId: string): Promise<KnowledgeBaseUsage> => {\n const result = await client.query<GetKnowledgeBaseUsageQuery>({\n query: GetKnowledgeBaseUsageDocument,\n variables: { id: kbId },\n fetchPolicy: 'network-only',\n });\n const operationError = (result as { error?: unknown }).error;\n if (operationError != null) {\n throw operationError instanceof Error\n ? operationError\n : new Error('Failed to load what uses this knowledge base');\n }\n return result.data?.getKnowledgeBaseUsage ?? { agents: [] };\n },\n [client]\n );\n}\n\n/** Removes one document and its vectors (`removeKnowledgeDocument`). */\nexport function useRemoveKnowledgeDocument() {\n return useWorkspaceMutation<RemoveKnowledgeDocumentMutation, string, boolean>({\n document: RemoveKnowledgeDocumentDocument,\n variables: (documentId) => ({ id: documentId }),\n select: (data) => data?.removeKnowledgeDocument,\n errorMessage: 'Failed to remove the document',\n });\n}\n\nexport function useCreateKnowledgeBase() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: CreateKnowledgeBaseVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_KB_FIELDS),\n }),\n [workspaceId]\n );\n\n return useWorkspaceMutation<\n CreateKnowledgeBaseMutation,\n CreateKnowledgeBaseVariables,\n { id: string; name: string; workspaceId: string }\n >({\n document: CreateKnowledgeBaseDocument,\n variables,\n select: (data) => data?.createKnowledgeBase,\n errorMessage: 'Failed to create knowledge base',\n });\n}\n\nexport function useUpdateKnowledgeBase() {\n return useWorkspaceMutation<\n UpdateKnowledgeBaseMutation,\n UpdateKnowledgeBaseVariables,\n { id: string; name: string; indexStatus: string }\n >({\n document: UpdateKnowledgeBaseDocument,\n variables: ({ kbId, input }) => ({\n id: kbId,\n input: buildMutationInput(input, UPDATE_KB_FIELDS),\n }),\n select: (data) => data?.updateKnowledgeBase,\n errorMessage: 'Failed to update knowledge base',\n });\n}\n\n/** Re-indexes every document in the knowledge base (`rebuildKnowledgeBaseIndex`). */\nexport function useRebuildKnowledgeBaseIndex() {\n return useWorkspaceMutation<RebuildKnowledgeBaseIndexMutation, string, boolean>({\n document: RebuildKnowledgeBaseIndexDocument,\n variables: (kbId) => ({ knowledgeBaseId: kbId }),\n select: (data) => data?.rebuildKnowledgeBaseIndex,\n errorMessage: 'Failed to rebuild the knowledge base index',\n });\n}\n\nexport function useDeleteKnowledgeBase() {\n return useWorkspaceMutation<DeleteKnowledgeBaseMutation, string, boolean>({\n document: DeleteKnowledgeBaseDocument,\n variables: (kbId) => ({ id: kbId }),\n select: (data) => data?.deleteKnowledgeBase,\n errorMessage: 'Failed to delete knowledge base',\n });\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"useKnowledgeBases.js","names":["LIST_LIMIT","CREATE_KB_FIELDS","fieldsOf","UPDATE_KB_FIELDS","NO_KNOWLEDGE_BASES","NO_DOCUMENTS","selectKnowledgeBase","data","selectDocuments","useKnowledgeBases","workspaceId","useWorkspaceId","search","filter","variables","useMemo","useAllPagesQuery","ListBotmanorKnowledgeBasesPageDocument","useKnowledgeBase","kbId","useWorkspaceQuery","GetKnowledgeBaseDocument","useKnowledgeDocuments","ListKnowledgeDocumentsDocument","useLoadKnowledgeBaseUsage","client","useWorkspaceClient","useCallback","result","GetKnowledgeBaseUsageDocument","operationError","useRemoveKnowledgeDocument","useWorkspaceMutation","RemoveKnowledgeDocumentDocument","documentId","useCreateKnowledgeBase","buildMutationInput","input","CreateKnowledgeBaseDocument","useUpdateKnowledgeBase","UpdateKnowledgeBaseDocument","useRebuildKnowledgeBaseIndex","RebuildKnowledgeBaseIndexDocument","useDeleteKnowledgeBase","DeleteKnowledgeBaseDocument"],"sources":["../../../src/botlit/hooks/useKnowledgeBases.ts"],"sourcesContent":["/**\n * Knowledge Bases Hooks\n * @module botlit/hooks\n *\n * Backed by the live `listBotmanorKnowledgeBasesPage` / `getKnowledgeBase` /\n * `listKnowledgeDocuments` operations and the create/update/delete mutations on\n * wspace-botlit-svc.\n */\n\nimport { useCallback, useMemo } from 'react';\nimport {\n CreateKnowledgeBaseDocument,\n DeleteKnowledgeBaseDocument,\n GetKnowledgeBaseDocument,\n GetKnowledgeBaseUsageDocument,\n ListBotmanorKnowledgeBasesPageDocument,\n ListKnowledgeDocumentsDocument,\n RebuildKnowledgeBaseIndexDocument,\n RemoveKnowledgeDocumentDocument,\n UpdateKnowledgeBaseDocument,\n type CreateKnowledgeBaseMutation,\n type DeleteKnowledgeBaseMutation,\n type GetKnowledgeBaseQuery,\n type ListBotmanorKnowledgeBasesPageQuery,\n type ListKnowledgeDocumentsQuery,\n type GetKnowledgeBaseUsageQuery,\n type RebuildKnowledgeBaseIndexMutation,\n type RemoveKnowledgeDocumentMutation,\n type UpdateKnowledgeBaseMutation,\n} from '../../generated/wspace-operations';\nimport type {\n CreateKnowledgeBaseInput,\n UpdateKnowledgeBaseInput,\n} from '../../generated/wspace-types';\nimport type { BaseFilter } from '../types';\nimport { useAllPagesQuery } from './internal/allPages';\nimport { buildMutationInput, fieldsOf, type GraphQLInput } from './internal/mutationInput';\nimport {\n useWorkspaceClient,\n useWorkspaceId,\n useWorkspaceMutation,\n useWorkspaceQuery,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nconst LIST_LIMIT = 100;\n\nexport interface KnowledgeBaseRecord {\n id: string;\n name: string;\n description?: string | null;\n indexStatus: string;\n embeddingModel: string;\n embeddingDimensions: number;\n chunkingStrategy: string;\n chunkSize: number;\n chunkOverlap: number;\n totalDocuments: number;\n totalChunks: number;\n vectorCount: number;\n lastIndexedAt?: string | null;\n metadata?: Record<string, unknown> | null;\n createdAt: string;\n updatedAt: string;\n createdById: string;\n updatedById: string;\n workspaceId: string;\n}\n\nexport interface KnowledgeDocumentRecord {\n id: string;\n knowledgeBaseId: string;\n title: string;\n fileId: string;\n status: string;\n chunkCount: number;\n processingError?: string | null;\n processedAt?: string | null;\n addedAt: string;\n addedById: string;\n updatedAt: string;\n}\n\n/**\n * `CreateKnowledgeBaseInput` minus the `workspaceId` the hook supplies.\n * `embeddingModel`/`embeddingDimensions` are required by the service.\n */\nexport type CreateKnowledgeBaseVariables = Omit<\n GraphQLInput<CreateKnowledgeBaseInput>,\n 'workspaceId'\n>;\n\nexport interface UpdateKnowledgeBaseVariables {\n kbId: string;\n input: GraphQLInput<UpdateKnowledgeBaseInput>;\n}\n\nconst CREATE_KB_FIELDS = fieldsOf<CreateKnowledgeBaseInput>({\n chunkOverlap: true,\n chunkSize: true,\n chunkingStrategy: true,\n description: true,\n embeddingDimensions: true,\n embeddingModel: true,\n metadata: true,\n name: true,\n // Optional: the service picks the environment default when omitted.\n vectorStoreDriver: true,\n workspaceId: true,\n});\n\nconst UPDATE_KB_FIELDS = fieldsOf<UpdateKnowledgeBaseInput>({\n chunkOverlap: true,\n chunkSize: true,\n chunkingStrategy: true,\n description: true,\n metadata: true,\n name: true,\n});\n\nconst NO_KNOWLEDGE_BASES: KnowledgeBaseRecord[] = [];\nconst NO_DOCUMENTS: KnowledgeDocumentRecord[] = [];\n\nfunction selectKnowledgeBase(data: GetKnowledgeBaseQuery | undefined): KnowledgeBaseRecord | null {\n return data?.getKnowledgeBase ?? null;\n}\n\nfunction selectDocuments(data: ListKnowledgeDocumentsQuery | undefined): KnowledgeDocumentRecord[] {\n return data?.listKnowledgeDocuments ?? NO_DOCUMENTS;\n}\n\nexport const knowledgeBaseKeys = {\n all: ['knowledgeBases'] as const,\n lists: () => [...knowledgeBaseKeys.all, 'list'] as const,\n list: (filter?: BaseFilter) => [...knowledgeBaseKeys.lists(), filter] as const,\n details: () => [...knowledgeBaseKeys.all, 'detail'] as const,\n detail: (id: string) => [...knowledgeBaseKeys.details(), id] as const,\n documents: (kbId: string) => [...knowledgeBaseKeys.detail(kbId), 'documents'] as const,\n};\n\nexport function useKnowledgeBases(filter?: BaseFilter): QueryResult<KnowledgeBaseRecord[]> {\n const workspaceId = useWorkspaceId();\n const search = filter?.search;\n\n const variables = useMemo(\n () => ({\n filters: { workspaceId, search: search || undefined },\n }),\n [workspaceId, search]\n );\n\n // Every page: pickers and lookups need the whole list, not the first 100.\n return useAllPagesQuery<ListBotmanorKnowledgeBasesPageQuery, KnowledgeBaseRecord>({\n document: ListBotmanorKnowledgeBasesPageDocument,\n variables,\n pageSize: LIST_LIMIT,\n extractRows: (data) => data?.listBotmanorKnowledgeBasesPage.items ?? NO_KNOWLEDGE_BASES,\n extractNextOffset: (data) => data?.listBotmanorKnowledgeBasesPage.nextOffset ?? null,\n fallback: NO_KNOWLEDGE_BASES,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load knowledge bases',\n });\n}\n\nexport function useKnowledgeBase(\n kbId: string | undefined\n): QueryResult<KnowledgeBaseRecord | null> {\n const variables = useMemo(() => ({ id: kbId ?? '' }), [kbId]);\n\n return useWorkspaceQuery<GetKnowledgeBaseQuery, KnowledgeBaseRecord | null>({\n document: GetKnowledgeBaseDocument,\n variables,\n select: selectKnowledgeBase,\n fallback: null,\n enabled: Boolean(kbId),\n errorMessage: 'Failed to load knowledge base',\n });\n}\n\n/** Every document of a knowledge base: all pages, `loading` until the last one is in. */\nexport function useKnowledgeDocuments(\n kbId: string | undefined\n): QueryResult<KnowledgeDocumentRecord[]> {\n const variables = useMemo(() => ({ knowledgeBaseId: kbId ?? '' }), [kbId]);\n\n return useAllPagesQuery<ListKnowledgeDocumentsQuery, KnowledgeDocumentRecord>({\n document: ListKnowledgeDocumentsDocument,\n variables,\n pageSize: LIST_LIMIT,\n extractRows: selectDocuments,\n fallback: NO_DOCUMENTS,\n enabled: Boolean(kbId),\n errorMessage: 'Failed to load knowledge documents',\n });\n}\n\n/** What still uses a knowledge base: the live agents that have it attached (BOFF-12472). */\nexport interface KnowledgeBaseUsage {\n agents: Array<{ id: string; name: string; status: string }>;\n}\n\n/** Returns a function that reads what uses a knowledge base, fresh each time: a delete is about to rely on it. */\nexport function useLoadKnowledgeBaseUsage() {\n const client = useWorkspaceClient();\n\n return useCallback(\n async (kbId: string): Promise<KnowledgeBaseUsage> => {\n const result = await client.query<GetKnowledgeBaseUsageQuery>({\n query: GetKnowledgeBaseUsageDocument,\n variables: { id: kbId },\n fetchPolicy: 'network-only',\n });\n const operationError = (result as { error?: unknown }).error;\n if (operationError != null) {\n throw operationError instanceof Error\n ? operationError\n : new Error('Failed to load what uses this knowledge base');\n }\n return result.data?.getKnowledgeBaseUsage ?? { agents: [] };\n },\n [client]\n );\n}\n\n/** Removes one document and its vectors (`removeKnowledgeDocument`). */\nexport function useRemoveKnowledgeDocument() {\n return useWorkspaceMutation<RemoveKnowledgeDocumentMutation, string, boolean>({\n document: RemoveKnowledgeDocumentDocument,\n variables: (documentId) => ({ id: documentId }),\n select: (data) => data?.removeKnowledgeDocument,\n errorMessage: 'Failed to remove the document',\n });\n}\n\nexport function useCreateKnowledgeBase() {\n const workspaceId = useWorkspaceId();\n\n const variables = useCallback(\n (input: CreateKnowledgeBaseVariables) => ({\n input: buildMutationInput({ ...input, workspaceId }, CREATE_KB_FIELDS),\n }),\n [workspaceId]\n );\n\n return useWorkspaceMutation<\n CreateKnowledgeBaseMutation,\n CreateKnowledgeBaseVariables,\n { id: string; name: string; workspaceId: string }\n >({\n document: CreateKnowledgeBaseDocument,\n variables,\n select: (data) => data?.createKnowledgeBase,\n errorMessage: 'Failed to create knowledge base',\n });\n}\n\nexport function useUpdateKnowledgeBase() {\n return useWorkspaceMutation<\n UpdateKnowledgeBaseMutation,\n UpdateKnowledgeBaseVariables,\n { id: string; name: string; indexStatus: string }\n >({\n document: UpdateKnowledgeBaseDocument,\n variables: ({ kbId, input }) => ({\n id: kbId,\n input: buildMutationInput(input, UPDATE_KB_FIELDS),\n }),\n select: (data) => data?.updateKnowledgeBase,\n errorMessage: 'Failed to update knowledge base',\n });\n}\n\n/** Re-indexes every document in the knowledge base (`rebuildKnowledgeBaseIndex`). */\nexport function useRebuildKnowledgeBaseIndex() {\n return useWorkspaceMutation<RebuildKnowledgeBaseIndexMutation, string, boolean>({\n document: RebuildKnowledgeBaseIndexDocument,\n variables: (kbId) => ({ knowledgeBaseId: kbId }),\n select: (data) => data?.rebuildKnowledgeBaseIndex,\n errorMessage: 'Failed to rebuild the knowledge base index',\n });\n}\n\nexport function useDeleteKnowledgeBase() {\n return useWorkspaceMutation<DeleteKnowledgeBaseMutation, string, boolean>({\n document: DeleteKnowledgeBaseDocument,\n variables: (kbId) => ({ id: kbId }),\n select: (data) => data?.deleteKnowledgeBase,\n errorMessage: 'Failed to delete knowledge base',\n });\n}\n"],"mappings":"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"}
@@ -2525,31 +2525,34 @@ export type RejectHandoffMutation = {
2525
2525
  status: Types.BotmanorHandoffStatus;
2526
2526
  };
2527
2527
  };
2528
- export type ListKnowledgeBasesQueryVariables = Exact<{
2528
+ export type ListBotmanorKnowledgeBasesPageQueryVariables = Exact<{
2529
2529
  filters?: Types.KnowledgeBaseFilterInput | null | undefined;
2530
- pagination?: Types.PaginationInput | null | undefined;
2530
+ pagination?: Types.BotmanorOffsetPaginationInput | null | undefined;
2531
2531
  }>;
2532
- export type ListKnowledgeBasesQuery = {
2533
- listKnowledgeBases: Array<{
2534
- id: string;
2535
- name: string;
2536
- description: string | null;
2537
- indexStatus: Types.IndexStatus;
2538
- embeddingModel: string;
2539
- embeddingDimensions: number;
2540
- chunkingStrategy: string;
2541
- chunkSize: number;
2542
- chunkOverlap: number;
2543
- totalDocuments: number;
2544
- totalChunks: number;
2545
- vectorCount: number;
2546
- lastIndexedAt: string | null;
2547
- createdAt: string;
2548
- updatedAt: string;
2549
- createdById: string;
2550
- updatedById: string;
2551
- workspaceId: string;
2552
- }>;
2532
+ export type ListBotmanorKnowledgeBasesPageQuery = {
2533
+ listBotmanorKnowledgeBasesPage: {
2534
+ nextOffset: number | null;
2535
+ items: Array<{
2536
+ id: string;
2537
+ name: string;
2538
+ description: string | null;
2539
+ indexStatus: Types.IndexStatus;
2540
+ embeddingModel: string;
2541
+ embeddingDimensions: number;
2542
+ chunkingStrategy: string;
2543
+ chunkSize: number;
2544
+ chunkOverlap: number;
2545
+ totalDocuments: number;
2546
+ totalChunks: number;
2547
+ vectorCount: number;
2548
+ lastIndexedAt: string | null;
2549
+ createdAt: string;
2550
+ updatedAt: string;
2551
+ createdById: string;
2552
+ updatedById: string;
2553
+ workspaceId: string;
2554
+ }>;
2555
+ };
2553
2556
  };
2554
2557
  export type GetKnowledgeBaseQueryVariables = Exact<{
2555
2558
  id: string | number;
@@ -6436,32 +6439,32 @@ export declare function useRejectHandoffMutation(baseOptions?: ApolloReactHooks.
6436
6439
  export type RejectHandoffMutationHookResult = ReturnType<typeof useRejectHandoffMutation>;
6437
6440
  export type RejectHandoffMutationResult = Apollo.MutationResult<Types.RejectHandoffMutation>;
6438
6441
  export type RejectHandoffMutationOptions = Apollo.BaseMutationOptions<Types.RejectHandoffMutation, Types.RejectHandoffMutationVariables>;
6439
- export declare const ListKnowledgeBasesDocument: Apollo.DocumentNode;
6442
+ export declare const ListBotmanorKnowledgeBasesPageDocument: Apollo.DocumentNode;
6440
6443
  /**
6441
- * __useListKnowledgeBasesQuery__
6444
+ * __useListBotmanorKnowledgeBasesPageQuery__
6442
6445
  *
6443
- * To run a query within a React component, call `useListKnowledgeBasesQuery` and pass it any options that fit your needs.
6444
- * When your component renders, `useListKnowledgeBasesQuery` returns an object from Apollo Client that contains loading, error, and data properties
6446
+ * To run a query within a React component, call `useListBotmanorKnowledgeBasesPageQuery` and pass it any options that fit your needs.
6447
+ * When your component renders, `useListBotmanorKnowledgeBasesPageQuery` returns an object from Apollo Client that contains loading, error, and data properties
6445
6448
  * you can use to render your UI.
6446
6449
  *
6447
6450
  * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
6448
6451
  *
6449
6452
  * @example
6450
- * const { data, loading, error } = useListKnowledgeBasesQuery({
6453
+ * const { data, loading, error } = useListBotmanorKnowledgeBasesPageQuery({
6451
6454
  * variables: {
6452
6455
  * filters: // value for 'filters'
6453
6456
  * pagination: // value for 'pagination'
6454
6457
  * },
6455
6458
  * });
6456
6459
  */
6457
- export declare function useListKnowledgeBasesQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.ListKnowledgeBasesQuery, Types.ListKnowledgeBasesQueryVariables>): ApolloReactHooks.useQuery.Result<Types.ListKnowledgeBasesQuery, Types.ListKnowledgeBasesQueryVariables, "empty" | "complete" | "streaming", Types.ListKnowledgeBasesQueryVariables, undefined>;
6458
- export declare function useListKnowledgeBasesLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.ListKnowledgeBasesQuery, Types.ListKnowledgeBasesQueryVariables>): ApolloReactHooks.useLazyQuery.ResultTuple<Types.ListKnowledgeBasesQuery, Types.ListKnowledgeBasesQueryVariables, "empty" | "complete" | "streaming", undefined>;
6459
- export declare function useListKnowledgeBasesSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.ListKnowledgeBasesQuery, Types.ListKnowledgeBasesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.ListKnowledgeBasesQuery, Types.ListKnowledgeBasesQueryVariables>;
6460
- export declare function useListKnowledgeBasesSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.ListKnowledgeBasesQuery, Types.ListKnowledgeBasesQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.ListKnowledgeBasesQuery | undefined, Types.ListKnowledgeBasesQueryVariables>;
6461
- export type ListKnowledgeBasesQueryHookResult = ReturnType<typeof useListKnowledgeBasesQuery>;
6462
- export type ListKnowledgeBasesLazyQueryHookResult = ReturnType<typeof useListKnowledgeBasesLazyQuery>;
6463
- export type ListKnowledgeBasesSuspenseQueryHookResult = ReturnType<typeof useListKnowledgeBasesSuspenseQuery>;
6464
- export type ListKnowledgeBasesQueryResult = Apollo.QueryResult<Types.ListKnowledgeBasesQuery, Types.ListKnowledgeBasesQueryVariables>;
6460
+ export declare function useListBotmanorKnowledgeBasesPageQuery(baseOptions?: ApolloReactHooks.QueryHookOptions<Types.ListBotmanorKnowledgeBasesPageQuery, Types.ListBotmanorKnowledgeBasesPageQueryVariables>): ApolloReactHooks.useQuery.Result<Types.ListBotmanorKnowledgeBasesPageQuery, Types.ListBotmanorKnowledgeBasesPageQueryVariables, "empty" | "complete" | "streaming", Types.ListBotmanorKnowledgeBasesPageQueryVariables, undefined>;
6461
+ export declare function useListBotmanorKnowledgeBasesPageLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<Types.ListBotmanorKnowledgeBasesPageQuery, Types.ListBotmanorKnowledgeBasesPageQueryVariables>): ApolloReactHooks.useLazyQuery.ResultTuple<Types.ListBotmanorKnowledgeBasesPageQuery, Types.ListBotmanorKnowledgeBasesPageQueryVariables, "empty" | "complete" | "streaming", undefined>;
6462
+ export declare function useListBotmanorKnowledgeBasesPageSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<Types.ListBotmanorKnowledgeBasesPageQuery, Types.ListBotmanorKnowledgeBasesPageQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.ListBotmanorKnowledgeBasesPageQuery, Types.ListBotmanorKnowledgeBasesPageQueryVariables>;
6463
+ export declare function useListBotmanorKnowledgeBasesPageSuspenseQuery(baseOptions?: ApolloReactHooks.SkipToken | ApolloReactHooks.SuspenseQueryHookOptions<Types.ListBotmanorKnowledgeBasesPageQuery, Types.ListBotmanorKnowledgeBasesPageQueryVariables>): ApolloReactHooks.UseSuspenseQueryResult<Types.ListBotmanorKnowledgeBasesPageQuery | undefined, Types.ListBotmanorKnowledgeBasesPageQueryVariables>;
6464
+ export type ListBotmanorKnowledgeBasesPageQueryHookResult = ReturnType<typeof useListBotmanorKnowledgeBasesPageQuery>;
6465
+ export type ListBotmanorKnowledgeBasesPageLazyQueryHookResult = ReturnType<typeof useListBotmanorKnowledgeBasesPageLazyQuery>;
6466
+ export type ListBotmanorKnowledgeBasesPageSuspenseQueryHookResult = ReturnType<typeof useListBotmanorKnowledgeBasesPageSuspenseQuery>;
6467
+ export type ListBotmanorKnowledgeBasesPageQueryResult = Apollo.QueryResult<Types.ListBotmanorKnowledgeBasesPageQuery, Types.ListBotmanorKnowledgeBasesPageQueryVariables>;
6465
6468
  export declare const GetKnowledgeBaseDocument: Apollo.DocumentNode;
6466
6469
  /**
6467
6470
  * __useGetKnowledgeBaseQuery__
@@ -1431,26 +1431,29 @@ var oe = e`
1431
1431
  }
1432
1432
  }
1433
1433
  `, pe = e`
1434
- query listKnowledgeBases($filters: KnowledgeBaseFilterInput, $pagination: PaginationInput) {
1435
- listKnowledgeBases(filters: $filters, pagination: $pagination) {
1436
- id
1437
- name
1438
- description
1439
- indexStatus
1440
- embeddingModel
1441
- embeddingDimensions
1442
- chunkingStrategy
1443
- chunkSize
1444
- chunkOverlap
1445
- totalDocuments
1446
- totalChunks
1447
- vectorCount
1448
- lastIndexedAt
1449
- createdAt
1450
- updatedAt
1451
- createdById
1452
- updatedById
1453
- workspaceId
1434
+ query ListBotmanorKnowledgeBasesPage($filters: KnowledgeBaseFilterInput, $pagination: BotmanorOffsetPaginationInput) {
1435
+ listBotmanorKnowledgeBasesPage(filters: $filters, pagination: $pagination) {
1436
+ items {
1437
+ id
1438
+ name
1439
+ description
1440
+ indexStatus
1441
+ embeddingModel
1442
+ embeddingDimensions
1443
+ chunkingStrategy
1444
+ chunkSize
1445
+ chunkOverlap
1446
+ totalDocuments
1447
+ totalChunks
1448
+ vectorCount
1449
+ lastIndexedAt
1450
+ createdAt
1451
+ updatedAt
1452
+ createdById
1453
+ updatedById
1454
+ workspaceId
1455
+ }
1456
+ nextOffset
1454
1457
  }
1455
1458
  }
1456
1459
  `, me = e`
@@ -2651,6 +2654,6 @@ var Ot = e`
2651
2654
  }
2652
2655
  }
2653
2656
  `;
2654
- export { oe as AcceptHandoffDocument, t as AgentBindingsFieldsFragmentDoc, Pt as AgentExecutionUpdatedDocument, $e as ApplyBotmanorRetentionDocument, se as AssignHandoffDocument, Nt as BotmanorExecutionUpdatedDocument, X as BotmanorGettingStartedKnowledgeDocument, ne as BotmanorMyIntegrationConnectionsDocument, Ie as BotmanorPlanUsageDocument, Qe as BotmanorRetentionStatusDocument, Q as BotmanorWorkspaceMemberIdentitiesDocument, Z as BotmanorWorkspaceMembersDocument, I as ChannelOverviewDocument, U as ChatAssistantsDocument, ee as CheckA2APlanQuotaDocument, x as ConfigureSupervisorDocument, A as CountBucketsDocument, kt as CountInstalledPackagesDocument, Ot as CountStorePackagesDocument, c as CreateA2ARegistryEntryDocument, Ee as CreateBotmanorLlmModelDocument, $ as CreateBotmanorLlmProviderDocument, D as CreateBucketDocument, L as CreateChannelConnectorDocument, B as CreateChannelRouteDocument, ge as CreateKnowledgeBaseDocument, je as CreateMcpConnectionDocument, _t as CreatePolicyBundleDraftDocument, ze as CreatePolicyDocument, We as CreatePromptTemplateDocument, nt as CreateRetrievalProfileDocument, st as CreateSkillDocument, mt as CreateStorePackageDraftDocument, u as DeleteA2ARegistryEntryDocument, k as DeleteBucketDocument, z as DeleteChannelConnectorDocument, H as DeleteChannelRouteDocument, ve as DeleteKnowledgeBaseDocument, Ne as DeleteMcpConnectionDocument, Ve as DeletePolicyDocument, Ke as DeletePromptTemplateDocument, it as DeleteRetrievalProfileDocument, lt as DeleteSkillDocument, gt as DeleteStorePackageDraftDocument, qe as DuplicatePromptTemplateDocument, te as GetA2ARegistryEntryDocument, f as GetA2ARegistryEntryUsageDocument, p as GetAgentBindingsDocument, At as GetAgentRunStatsDocument, jt as GetBotRunStatsDocument, M as GetBucketContentsDocument, T as GetBucketDocument, N as GetChannelConnectorDocument, Mt as GetDailyUsageStatsDocument, q as GetExecutionDocument, Y as GetExecutionSummaryDocument, me as GetKnowledgeBaseDocument, xe as GetKnowledgeBaseUsageDocument, De as GetMcpConnectionDocument, Le as GetPolicyDocument, He as GetPromptTemplateDocument, Ze as GetPromptTemplateVersionsDocument, et as GetRetrievalProfileDocument, at as GetSkillDocument, St as GetStorePackageBySlugDocument, g as GetSupervisorConfigDocument, re as HandoffConfigDocument, ie as HandoffQueueDocument, le as HandoffTranscriptDocument, Tt as InstallPackageDocument, o as InstalledPackageFieldsFragmentDoc, s as ListA2ARegistryEntriesDocument, v as ListAiPredictionsDocument, w as ListBotAppsPageDocument, h as ListBotmanorAgentsPageDocument, J as ListBotmanorExecutionsPageDocument, wt as ListBotmanorInstalledPackagesPageDocument, we as ListBotmanorLlmModelsDocument, Se as ListBotmanorLlmProvidersDocument, Ct as ListBotmanorStorePackagesPageDocument, E as ListBucketsDocument, P as ListChannelConnectorsDocument, F as ListChannelRoutesDocument, pe as ListKnowledgeBasesDocument, he as ListKnowledgeDocumentsDocument, Oe as ListMcpConnectionsDocument, Ae as ListMcpResourcesDocument, ke as ListMcpToolsDocument, pt as ListOwnStorePackagesDocument, Re as ListPoliciesDocument, Ue as ListPromptTemplatesDocument, tt as ListRetrievalProfilesDocument, ot as ListSkillsDocument, dt as ListStorePackageSubmissionsDocument, _ as ListSupervisorRunsDocument, W as MyAssistantConversationRetentionDocument, G as MyAssistantWorkflowConversationsDocument, i as OwnStorePackageFieldsFragmentDoc, C as PauseBotmanorAgentForSupervisorDocument, ye as RebuildKnowledgeBaseIndexDocument, S as RebuildKnowledgeBaseIndexForSupervisorDocument, fe as RejectHandoffDocument, ue as ReleaseHandoffDocument, be as RemoveKnowledgeDocumentDocument, Je as RenderPromptTemplateDocument, ce as ReplyToHandoffDocument, de as ResolveHandoffDocument, K as RetireMyAssistantConversationDocument, bt as ReviewStorePackageSubmissionDocument, b as RunSupervisorNowDocument, Xe as SavePromptTemplateVersionDocument, j as SearchBucketsDocument, m as SetAgentBindingsDocument, y as SetAiPredictionStatusDocument, a as StorePackageFieldsFragmentDoc, ft as StorePackageReviewQueueDocument, r as StorePackageSubmissionFieldsFragmentDoc, n as StorePackageValidationFieldsFragmentDoc, vt as SubmitStorePackageForReviewDocument, Te as TestLlmConnectionDocument, Pe as TestMcpConnectionDocument, Ye as TestPromptTemplateDocument, Dt as UninstallPackageDocument, xt as UnpublishStorePackageDocument, l as UpdateA2ARegistryEntryDocument, Ce as UpdateBotmanorLlmProviderDocument, O as UpdateBucketDocument, R as UpdateChannelConnectorDocument, V as UpdateChannelRouteDocument, Et as UpdateInstalledPackageDocument, _e as UpdateKnowledgeBaseDocument, Me as UpdateMcpConnectionDocument, Fe as UpdateMcpToolDocument, Be as UpdatePolicyDocument, Ge as UpdatePromptTemplateDocument, rt as UpdateRetrievalProfileDocument, ct as UpdateSkillDocument, ht as UpdateStorePackageDraftDocument, ae as UpsertHandoffConfigDocument, ut as ValidateStorePackageDocument, d as VerifyA2ARegistryEntryDocument, yt as WithdrawStorePackageSubmissionDocument };
2657
+ export { oe as AcceptHandoffDocument, t as AgentBindingsFieldsFragmentDoc, Pt as AgentExecutionUpdatedDocument, $e as ApplyBotmanorRetentionDocument, se as AssignHandoffDocument, Nt as BotmanorExecutionUpdatedDocument, X as BotmanorGettingStartedKnowledgeDocument, ne as BotmanorMyIntegrationConnectionsDocument, Ie as BotmanorPlanUsageDocument, Qe as BotmanorRetentionStatusDocument, Q as BotmanorWorkspaceMemberIdentitiesDocument, Z as BotmanorWorkspaceMembersDocument, I as ChannelOverviewDocument, U as ChatAssistantsDocument, ee as CheckA2APlanQuotaDocument, x as ConfigureSupervisorDocument, A as CountBucketsDocument, kt as CountInstalledPackagesDocument, Ot as CountStorePackagesDocument, c as CreateA2ARegistryEntryDocument, Ee as CreateBotmanorLlmModelDocument, $ as CreateBotmanorLlmProviderDocument, D as CreateBucketDocument, L as CreateChannelConnectorDocument, B as CreateChannelRouteDocument, ge as CreateKnowledgeBaseDocument, je as CreateMcpConnectionDocument, _t as CreatePolicyBundleDraftDocument, ze as CreatePolicyDocument, We as CreatePromptTemplateDocument, nt as CreateRetrievalProfileDocument, st as CreateSkillDocument, mt as CreateStorePackageDraftDocument, u as DeleteA2ARegistryEntryDocument, k as DeleteBucketDocument, z as DeleteChannelConnectorDocument, H as DeleteChannelRouteDocument, ve as DeleteKnowledgeBaseDocument, Ne as DeleteMcpConnectionDocument, Ve as DeletePolicyDocument, Ke as DeletePromptTemplateDocument, it as DeleteRetrievalProfileDocument, lt as DeleteSkillDocument, gt as DeleteStorePackageDraftDocument, qe as DuplicatePromptTemplateDocument, te as GetA2ARegistryEntryDocument, f as GetA2ARegistryEntryUsageDocument, p as GetAgentBindingsDocument, At as GetAgentRunStatsDocument, jt as GetBotRunStatsDocument, M as GetBucketContentsDocument, T as GetBucketDocument, N as GetChannelConnectorDocument, Mt as GetDailyUsageStatsDocument, q as GetExecutionDocument, Y as GetExecutionSummaryDocument, me as GetKnowledgeBaseDocument, xe as GetKnowledgeBaseUsageDocument, De as GetMcpConnectionDocument, Le as GetPolicyDocument, He as GetPromptTemplateDocument, Ze as GetPromptTemplateVersionsDocument, et as GetRetrievalProfileDocument, at as GetSkillDocument, St as GetStorePackageBySlugDocument, g as GetSupervisorConfigDocument, re as HandoffConfigDocument, ie as HandoffQueueDocument, le as HandoffTranscriptDocument, Tt as InstallPackageDocument, o as InstalledPackageFieldsFragmentDoc, s as ListA2ARegistryEntriesDocument, v as ListAiPredictionsDocument, w as ListBotAppsPageDocument, h as ListBotmanorAgentsPageDocument, J as ListBotmanorExecutionsPageDocument, wt as ListBotmanorInstalledPackagesPageDocument, pe as ListBotmanorKnowledgeBasesPageDocument, we as ListBotmanorLlmModelsDocument, Se as ListBotmanorLlmProvidersDocument, Ct as ListBotmanorStorePackagesPageDocument, E as ListBucketsDocument, P as ListChannelConnectorsDocument, F as ListChannelRoutesDocument, he as ListKnowledgeDocumentsDocument, Oe as ListMcpConnectionsDocument, Ae as ListMcpResourcesDocument, ke as ListMcpToolsDocument, pt as ListOwnStorePackagesDocument, Re as ListPoliciesDocument, Ue as ListPromptTemplatesDocument, tt as ListRetrievalProfilesDocument, ot as ListSkillsDocument, dt as ListStorePackageSubmissionsDocument, _ as ListSupervisorRunsDocument, W as MyAssistantConversationRetentionDocument, G as MyAssistantWorkflowConversationsDocument, i as OwnStorePackageFieldsFragmentDoc, C as PauseBotmanorAgentForSupervisorDocument, ye as RebuildKnowledgeBaseIndexDocument, S as RebuildKnowledgeBaseIndexForSupervisorDocument, fe as RejectHandoffDocument, ue as ReleaseHandoffDocument, be as RemoveKnowledgeDocumentDocument, Je as RenderPromptTemplateDocument, ce as ReplyToHandoffDocument, de as ResolveHandoffDocument, K as RetireMyAssistantConversationDocument, bt as ReviewStorePackageSubmissionDocument, b as RunSupervisorNowDocument, Xe as SavePromptTemplateVersionDocument, j as SearchBucketsDocument, m as SetAgentBindingsDocument, y as SetAiPredictionStatusDocument, a as StorePackageFieldsFragmentDoc, ft as StorePackageReviewQueueDocument, r as StorePackageSubmissionFieldsFragmentDoc, n as StorePackageValidationFieldsFragmentDoc, vt as SubmitStorePackageForReviewDocument, Te as TestLlmConnectionDocument, Pe as TestMcpConnectionDocument, Ye as TestPromptTemplateDocument, Dt as UninstallPackageDocument, xt as UnpublishStorePackageDocument, l as UpdateA2ARegistryEntryDocument, Ce as UpdateBotmanorLlmProviderDocument, O as UpdateBucketDocument, R as UpdateChannelConnectorDocument, V as UpdateChannelRouteDocument, Et as UpdateInstalledPackageDocument, _e as UpdateKnowledgeBaseDocument, Me as UpdateMcpConnectionDocument, Fe as UpdateMcpToolDocument, Be as UpdatePolicyDocument, Ge as UpdatePromptTemplateDocument, rt as UpdateRetrievalProfileDocument, ct as UpdateSkillDocument, ht as UpdateStorePackageDraftDocument, ae as UpsertHandoffConfigDocument, ut as ValidateStorePackageDocument, d as VerifyA2ARegistryEntryDocument, yt as WithdrawStorePackageSubmissionDocument };
2655
2658
 
2656
2659
  //# sourceMappingURL=wspace-operations.js.map