@burdenoff/microfe-botmanor 2026.1201.3 → 2026.1202.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/GettingStartedChecklist.js +1 -1
- package/dist/botlit/components/GettingStartedChecklist.js.map +1 -1
- package/dist/botlit/hooks/useAgentApprovals.js +28 -17
- package/dist/botlit/hooks/useAgentApprovals.js.map +1 -1
- package/dist/botlit/hooks/useBotAgents.js +15 -11
- package/dist/botlit/hooks/useBotAgents.js.map +1 -1
- package/dist/botlit/hooks/useBots.js +36 -62
- package/dist/botlit/hooks/useBots.js.map +1 -1
- package/dist/botlit/hooks/useBuckets.js +31 -24
- package/dist/botlit/hooks/useBuckets.js.map +1 -1
- package/dist/botlit/hooks/useChannels.js +44 -30
- package/dist/botlit/hooks/useChannels.js.map +1 -1
- package/dist/botlit/hooks/useLLMProviders.js +8 -6
- package/dist/botlit/hooks/useLLMProviders.js.map +1 -1
- package/dist/botlit/hooks/useMCPServers.js +21 -17
- package/dist/botlit/hooks/useMCPServers.js.map +1 -1
- package/dist/botlit/hooks/usePromptTemplates.js +5 -3
- package/dist/botlit/hooks/usePromptTemplates.js.map +1 -1
- package/dist/botlit/hooks/useStorePublishing.js +20 -10
- package/dist/botlit/hooks/useStorePublishing.js.map +1 -1
- package/dist/botlit/hooks/useTemplates.js +35 -29
- package/dist/botlit/hooks/useTemplates.js.map +1 -1
- package/dist/generated/wspace-operations.d.ts +522 -3
- package/dist/generated/wspace-operations.js +281 -15
- package/dist/generated/wspace-operations.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,29 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useWorkspaceAllPagesQuery as e, useWorkspaceId as t, useWorkspaceMutation as n } from "./internal/workspaceGateway.js";
|
|
2
2
|
import { useMemo as r } from "react";
|
|
3
3
|
import { gql as i } from "@apollo/client";
|
|
4
4
|
// src/botlit/hooks/useTemplates.ts
|
|
5
5
|
var a = i`
|
|
6
|
-
query ListBotTemplates($pagination:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
query ListBotTemplates($pagination: BotmanorOffsetPaginationInput) {
|
|
7
|
+
listBotmanorAppTemplatesPage(pagination: $pagination) {
|
|
8
|
+
items {
|
|
9
|
+
id
|
|
10
|
+
name
|
|
11
|
+
description
|
|
12
|
+
category
|
|
13
|
+
}
|
|
14
|
+
nextOffset
|
|
12
15
|
}
|
|
13
16
|
}
|
|
14
17
|
`, o = i`
|
|
15
|
-
query ListAgentTemplatesForCreate($pagination:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
query ListAgentTemplatesForCreate($pagination: BotmanorOffsetPaginationInput) {
|
|
19
|
+
listBotmanorAgentTemplatesPage(pagination: $pagination) {
|
|
20
|
+
items {
|
|
21
|
+
id
|
|
22
|
+
name
|
|
23
|
+
description
|
|
24
|
+
category
|
|
25
|
+
}
|
|
26
|
+
nextOffset
|
|
21
27
|
}
|
|
22
28
|
}
|
|
23
29
|
`, s = i`
|
|
@@ -38,34 +44,34 @@ var a = i`
|
|
|
38
44
|
name
|
|
39
45
|
}
|
|
40
46
|
}
|
|
41
|
-
`, l = [], u =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
let i = e(), s = r(() => u, []);
|
|
47
|
-
return n({
|
|
48
|
-
document: t === "bot" ? a : o,
|
|
47
|
+
`, l = [], u = 100, d = {};
|
|
48
|
+
function f(n) {
|
|
49
|
+
let i = t(), s = r(() => d, []);
|
|
50
|
+
return e({
|
|
51
|
+
document: n === "bot" ? a : o,
|
|
49
52
|
variables: s,
|
|
50
|
-
|
|
53
|
+
pageSize: u,
|
|
54
|
+
extractRows: (e) => (n === "bot" ? e?.listBotmanorAppTemplatesPage?.items : e?.listBotmanorAgentTemplatesPage?.items) ?? l,
|
|
55
|
+
extractNextOffset: (e) => (n === "bot" ? e?.listBotmanorAppTemplatesPage?.nextOffset : e?.listBotmanorAgentTemplatesPage?.nextOffset) ?? null,
|
|
56
|
+
select: (e) => e,
|
|
51
57
|
fallback: l,
|
|
52
58
|
enabled: !!i,
|
|
53
59
|
errorMessage: "Failed to load templates"
|
|
54
60
|
});
|
|
55
61
|
}
|
|
56
|
-
function
|
|
57
|
-
let r =
|
|
58
|
-
return
|
|
59
|
-
document:
|
|
62
|
+
function p(e) {
|
|
63
|
+
let r = t();
|
|
64
|
+
return n({
|
|
65
|
+
document: e === "bot" ? s : c,
|
|
60
66
|
variables: ({ name: e, templateId: t }) => ({
|
|
61
67
|
name: e.trim(),
|
|
62
68
|
templateId: t,
|
|
63
69
|
workspaceId: r
|
|
64
70
|
}),
|
|
65
|
-
select: (
|
|
66
|
-
errorMessage:
|
|
71
|
+
select: (t) => (e === "bot" ? t?.createAppFromTemplate : t?.createBotmanorAgentFromTemplate) ?? void 0,
|
|
72
|
+
errorMessage: e === "bot" ? "Failed to create the bot from the template" : "Failed to create the agent from the template"
|
|
67
73
|
});
|
|
68
74
|
}
|
|
69
|
-
export {
|
|
75
|
+
export { p as useCreateFromTemplate, f as useTemplates };
|
|
70
76
|
|
|
71
77
|
//# sourceMappingURL=useTemplates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTemplates.js","names":["LIST_APP_TEMPLATES_DOCUMENT","LIST_AGENT_TEMPLATES_DOCUMENT","CREATE_APP_FROM_TEMPLATE_DOCUMENT","CREATE_AGENT_FROM_TEMPLATE_DOCUMENT","NO_TEMPLATES","
|
|
1
|
+
{"version":3,"file":"useTemplates.js","names":["LIST_APP_TEMPLATES_DOCUMENT","LIST_AGENT_TEMPLATES_DOCUMENT","CREATE_APP_FROM_TEMPLATE_DOCUMENT","CREATE_AGENT_FROM_TEMPLATE_DOCUMENT","NO_TEMPLATES","TEMPLATE_PAGE_SIZE","EMPTY_VARIABLES","useTemplates","workspaceId","useWorkspaceId","variables","useMemo","useWorkspaceAllPagesQuery","kind","data","rows","useCreateFromTemplate","useWorkspaceMutation","name"],"sources":["../../../src/botlit/hooks/useTemplates.ts"],"sourcesContent":["/**\n * App and agent templates (BOFF-15360)\n * @module botlit/hooks\n *\n * Every workspace is provisioned with a starter catalogue of bot (app) and\n * agent templates. These hooks list them and create a bot or an agent from one\n * in a single step, the \"Create from template\" flow on the create pages.\n */\n\nimport { gql } from '@apollo/client';\nimport { useMemo } from 'react';\n\nimport {\n useWorkspaceAllPagesQuery,\n useWorkspaceId,\n useWorkspaceMutation,\n type QueryResult,\n} from './internal/workspaceGateway';\n\nexport interface TemplateRecord {\n id: string;\n name: string;\n description?: string | null;\n category?: string | null;\n}\n\ninterface ListAppTemplatesData {\n listBotmanorAppTemplatesPage?: {\n items: TemplateRecord[];\n nextOffset: number | null;\n } | null;\n}\n\ninterface ListAgentTemplatesData {\n listBotmanorAgentTemplatesPage?: {\n items: TemplateRecord[];\n nextOffset: number | null;\n } | null;\n}\n\ninterface CreatedRecord {\n id: string;\n name: string;\n}\n\ninterface CreateAppFromTemplateData {\n createAppFromTemplate?: CreatedRecord | null;\n}\n\ninterface CreateAgentFromTemplateData {\n createBotmanorAgentFromTemplate?: CreatedRecord | null;\n}\n\nconst LIST_APP_TEMPLATES_DOCUMENT = gql`\n query ListBotTemplates($pagination: BotmanorOffsetPaginationInput) {\n listBotmanorAppTemplatesPage(pagination: $pagination) {\n items {\n id\n name\n description\n category\n }\n nextOffset\n }\n }\n`;\n\nconst LIST_AGENT_TEMPLATES_DOCUMENT = gql`\n query ListAgentTemplatesForCreate($pagination: BotmanorOffsetPaginationInput) {\n listBotmanorAgentTemplatesPage(pagination: $pagination) {\n items {\n id\n name\n description\n category\n }\n nextOffset\n }\n }\n`;\n\nconst CREATE_APP_FROM_TEMPLATE_DOCUMENT = gql`\n mutation CreateBotFromTemplate($name: String!, $templateId: ID!, $workspaceId: ID!) {\n createAppFromTemplate(name: $name, templateId: $templateId, workspaceId: $workspaceId) {\n id\n name\n }\n }\n`;\n\nconst CREATE_AGENT_FROM_TEMPLATE_DOCUMENT = gql`\n mutation CreateAgentFromTemplate($name: String!, $templateId: ID!, $workspaceId: ID!) {\n createBotmanorAgentFromTemplate(\n name: $name\n templateId: $templateId\n workspaceId: $workspaceId\n ) {\n id\n name\n }\n }\n`;\n\nconst NO_TEMPLATES: TemplateRecord[] = [];\nconst TEMPLATE_PAGE_SIZE = 100;\nconst EMPTY_VARIABLES = {};\n\nexport type TemplateKind = 'bot' | 'agent';\n\nexport function useTemplates(kind: TemplateKind): QueryResult<TemplateRecord[]> {\n const workspaceId = useWorkspaceId();\n const variables = useMemo(() => EMPTY_VARIABLES, []);\n return useWorkspaceAllPagesQuery<\n ListAppTemplatesData & ListAgentTemplatesData,\n TemplateRecord,\n TemplateRecord[]\n >({\n document: kind === 'bot' ? LIST_APP_TEMPLATES_DOCUMENT : LIST_AGENT_TEMPLATES_DOCUMENT,\n variables,\n pageSize: TEMPLATE_PAGE_SIZE,\n extractRows: (data) =>\n (kind === 'bot'\n ? data?.listBotmanorAppTemplatesPage?.items\n : data?.listBotmanorAgentTemplatesPage?.items) ?? NO_TEMPLATES,\n extractNextOffset: (data) =>\n (kind === 'bot'\n ? data?.listBotmanorAppTemplatesPage?.nextOffset\n : data?.listBotmanorAgentTemplatesPage?.nextOffset) ?? null,\n select: (rows) => rows,\n fallback: NO_TEMPLATES,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load templates',\n });\n}\n\nexport interface CreateFromTemplateInput {\n name: string;\n templateId: string;\n}\n\nexport function useCreateFromTemplate(kind: TemplateKind) {\n const workspaceId = useWorkspaceId();\n return useWorkspaceMutation<\n CreateAppFromTemplateData & CreateAgentFromTemplateData,\n CreateFromTemplateInput,\n CreatedRecord\n >({\n document:\n kind === 'bot' ? CREATE_APP_FROM_TEMPLATE_DOCUMENT : CREATE_AGENT_FROM_TEMPLATE_DOCUMENT,\n variables: ({ name, templateId }) => ({ name: name.trim(), templateId, workspaceId }),\n select: (data) =>\n (kind === 'bot' ? data?.createAppFromTemplate : data?.createBotmanorAgentFromTemplate) ??\n undefined,\n errorMessage:\n kind === 'bot'\n ? 'Failed to create the bot from the template'\n : 'Failed to create the agent from the template',\n });\n}\n"],"mappings":";;;;AAqDA,IAAMA,IAA8B,CAAG;;;;;;;;;;;;GAcjCC,IAAgC,CAAG;;;;;;;;;;;;GAcnCC,IAAoC,CAAG;;;;;;;GASvCC,IAAsC,CAAG;;;;;;;;;;;GAazCC,IAAiC,CAAC,GAClCC,IAAqB,KACrBC,IAAkB,CAAC;AAIzB,SAAgBC,EAAa,GAAmD;CAC9E,IAAMC,IAAcC,EAAe,GAC7BC,IAAYC,QAAcL,GAAiB,CAAC,CAAC;CACnD,OAAOM,EAIL;EACA,UAAUC,MAAS,QAAQb,IAA8BC;EACzD;EACA,UAAUI;EACV,cAAc,OACXQ,MAAS,QACNC,GAAM,8BAA8B,QACpCA,GAAM,gCAAgC,UAAUV;EACtD,oBAAoB,OACjBS,MAAS,QACNC,GAAM,8BAA8B,aACpCA,GAAM,gCAAgC,eAAe;EAC3D,SAAS,MAASC;EAClB,UAAUX;EACV,SAAS,EAAQI;EACjB,cAAc;CAChB,CAAC;AACH;AAOA,SAAgBQ,EAAsB,GAAoB;CACxD,IAAMR,IAAcC,EAAe;CACnC,OAAOQ,EAIL;EACA,UACEJ,MAAS,QAAQX,IAAoCC;EACvD,YAAY,EAAE,SAAM,qBAAkB;GAAE,MAAMe,EAAK,KAAK;GAAG;GAAY;EAAY;EACnF,SAAS,OACNL,MAAS,QAAQC,GAAM,wBAAwBA,GAAM,oCACtD,KAAA;EACF,cACED,MAAS,QACL,+CACA;CACR,CAAC;AACH"}
|