@burdenoff/microfe-botmanor 2026.1127.7 → 2026.1127.8
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/AiOperationsPanel.js +215 -140
- package/dist/botlit/components/AiOperationsPanel.js.map +1 -1
- package/dist/botlit/permissions/index.js +3 -3
- package/dist/botlit/providers/BotlitProvider.js +39 -31
- package/dist/botlit/providers/BotlitProvider.js.map +1 -1
- package/dist/botlit/providers/SupervisorActionScope.d.ts +20 -0
- package/dist/botlit/providers/SupervisorActionScope.js +61 -0
- package/dist/botlit/providers/SupervisorActionScope.js.map +1 -0
- package/dist/generated/wspace-types.js +13 -11
- package/dist/generated/wspace-types.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import { joinPath as e } from "../utils/navigation.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { SupervisorActionProvider as t } from "./SupervisorActionScope.js";
|
|
3
|
+
import { createContext as n, useCallback as r, useContext as i, useMemo as a } from "react";
|
|
4
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
5
|
+
import { MemoryRouter as s, useNavigate as c } from "react-router";
|
|
5
6
|
// src/botlit/providers/BotlitProvider.tsx
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
let e =
|
|
7
|
+
var l = n(null);
|
|
8
|
+
function u() {
|
|
9
|
+
let e = i(l);
|
|
9
10
|
if (!e) throw Error("useBotlit must be used within a BotlitProvider");
|
|
10
11
|
return e;
|
|
11
12
|
}
|
|
12
|
-
var
|
|
13
|
-
let _ =
|
|
13
|
+
var d = ({ children: t, basePath: n, currentUser: i, tenantId: s, organizationId: u, workspaceId: d, apiGatewayUrl: f, authToken: p, productId: m, onBotSelect: h, onAgentSelect: g }) => {
|
|
14
|
+
let _ = c(), v = n || "/", y = r((t) => e(v, t), [v]), b = r((t) => {
|
|
14
15
|
let n = e(v, t);
|
|
15
16
|
_(n);
|
|
16
|
-
}, [v, _]), x =
|
|
17
|
+
}, [v, _]), x = a(() => ({
|
|
17
18
|
basePath: v,
|
|
18
19
|
navigate: void 0,
|
|
19
|
-
currentUser:
|
|
20
|
-
tenantId:
|
|
20
|
+
currentUser: i,
|
|
21
|
+
tenantId: s,
|
|
21
22
|
organizationId: u,
|
|
22
23
|
workspaceId: d,
|
|
23
24
|
apiGatewayUrl: f,
|
|
@@ -30,8 +31,8 @@ var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, organizationId
|
|
|
30
31
|
getPath: y
|
|
31
32
|
}), [
|
|
32
33
|
v,
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
i,
|
|
35
|
+
s,
|
|
35
36
|
u,
|
|
36
37
|
d,
|
|
37
38
|
f,
|
|
@@ -42,18 +43,18 @@ var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, organizationId
|
|
|
42
43
|
b,
|
|
43
44
|
y
|
|
44
45
|
]);
|
|
45
|
-
return /* @__PURE__ */
|
|
46
|
+
return /* @__PURE__ */ o(l.Provider, {
|
|
46
47
|
value: x,
|
|
47
48
|
children: t
|
|
48
49
|
});
|
|
49
|
-
},
|
|
50
|
-
let _ =
|
|
51
|
-
|
|
52
|
-
}, [_,
|
|
50
|
+
}, f = ({ children: t, basePath: n, navigate: i, currentUser: s, tenantId: c, organizationId: u, workspaceId: d, apiGatewayUrl: f, authToken: p, productId: m, onBotSelect: h, onAgentSelect: g }) => {
|
|
51
|
+
let _ = n || "/", v = r((t) => e(_, t), [_]), y = r((t) => {
|
|
52
|
+
i(e(_, t));
|
|
53
|
+
}, [_, i]), b = a(() => ({
|
|
53
54
|
basePath: _,
|
|
54
|
-
navigate:
|
|
55
|
+
navigate: i,
|
|
55
56
|
currentUser: s,
|
|
56
|
-
tenantId:
|
|
57
|
+
tenantId: c,
|
|
57
58
|
organizationId: u,
|
|
58
59
|
workspaceId: d,
|
|
59
60
|
apiGatewayUrl: f,
|
|
@@ -66,9 +67,9 @@ var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, organizationId
|
|
|
66
67
|
getPath: v
|
|
67
68
|
}), [
|
|
68
69
|
_,
|
|
69
|
-
|
|
70
|
+
i,
|
|
70
71
|
s,
|
|
71
|
-
|
|
72
|
+
c,
|
|
72
73
|
u,
|
|
73
74
|
d,
|
|
74
75
|
f,
|
|
@@ -79,23 +80,30 @@ var u = ({ children: t, basePath: r, currentUser: o, tenantId: l, organizationId
|
|
|
79
80
|
y,
|
|
80
81
|
v
|
|
81
82
|
]);
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
+
return /* @__PURE__ */ o(l.Provider, {
|
|
83
84
|
value: b,
|
|
84
85
|
children: t
|
|
85
86
|
});
|
|
86
|
-
},
|
|
87
|
-
let { children:
|
|
88
|
-
|
|
87
|
+
}, p = (e) => {
|
|
88
|
+
let { children: n, navigate: r, tenantId: i, workspaceId: a, currentUser: c } = e, l = JSON.stringify([
|
|
89
|
+
i,
|
|
90
|
+
a,
|
|
91
|
+
c?.id
|
|
92
|
+
]), u = /* @__PURE__ */ o(t, {
|
|
93
|
+
scopeKey: l,
|
|
94
|
+
children: n
|
|
95
|
+
});
|
|
96
|
+
return r ? /* @__PURE__ */ o(f, {
|
|
89
97
|
...e,
|
|
90
|
-
navigate:
|
|
98
|
+
navigate: r,
|
|
91
99
|
isStandalone: !1,
|
|
92
|
-
children:
|
|
93
|
-
}) : /* @__PURE__ */
|
|
100
|
+
children: u
|
|
101
|
+
}) : /* @__PURE__ */ o(s, { children: /* @__PURE__ */ o(d, {
|
|
94
102
|
...e,
|
|
95
103
|
isStandalone: !0,
|
|
96
|
-
children:
|
|
104
|
+
children: u
|
|
97
105
|
}) });
|
|
98
106
|
};
|
|
99
|
-
export {
|
|
107
|
+
export { p as BotlitProvider, u as useBotlit };
|
|
100
108
|
|
|
101
109
|
//# sourceMappingURL=BotlitProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BotlitProvider.js","names":["useRouterNavigate","BotlitContext","createContext","useBotlit","context","useContext","StandaloneProviderInner","routerNavigate","useNavigate","effectiveBasePath","basePath","getPath","useCallback","joinPath","relativePath","navigateTo","fullPath","contextValue","useMemo","currentUser","tenantId","organizationId","workspaceId","apiGatewayUrl","authToken","productId","onBotSelect","onAgentSelect","IntegratedProviderInner","navigate","BotlitProvider","props","MemoryRouter"],"sources":["../../../src/botlit/providers/BotlitProvider.tsx"],"sourcesContent":["/**\n * BotManor Context Provider\n * @module botlit/providers\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router';\nimport type { BotmanorRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface BotlitContextValue extends Omit<\n BotmanorRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst BotlitContext = createContext<BotlitContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useBotlit(): BotlitContextValue {\n const context = useContext(BotlitContext);\n if (!context) {\n throw new Error('useBotlit must be used within a BotlitProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<BotmanorRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n // Always call hooks unconditionally in this component\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\nexport const BotlitProvider: FC<PropsWithChildren<BotmanorRootProps>> = (props) => {\n const { children, navigate } = props;\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {
|
|
1
|
+
{"version":3,"file":"BotlitProvider.js","names":["useRouterNavigate","BotlitContext","createContext","useBotlit","context","useContext","StandaloneProviderInner","routerNavigate","useNavigate","effectiveBasePath","basePath","getPath","useCallback","joinPath","relativePath","navigateTo","fullPath","contextValue","useMemo","currentUser","tenantId","organizationId","workspaceId","apiGatewayUrl","authToken","productId","onBotSelect","onAgentSelect","IntegratedProviderInner","navigate","BotlitProvider","props","scopeKey","workspaceChildren","SupervisorActionProvider","MemoryRouter"],"sources":["../../../src/botlit/providers/BotlitProvider.tsx"],"sourcesContent":["/**\n * BotManor Context Provider\n * @module botlit/providers\n */\n\nimport type { FC, PropsWithChildren } from 'react';\nimport { createContext, useContext, useMemo, useCallback } from 'react';\nimport { MemoryRouter, useNavigate as useRouterNavigate } from 'react-router';\nimport type { BotmanorRootProps } from '../types';\nimport { joinPath } from '../utils/navigation';\nimport { SupervisorActionProvider } from './SupervisorActionScope';\n\n// ============================================================================\n// Context\n// ============================================================================\n\ninterface BotlitContextValue extends Omit<\n BotmanorRootProps,\n 'registerNavItems' | 'registerFooterItems' | 'navigate'\n> {\n isStandalone: boolean;\n /** Shell's navigate function (only available in integrated mode) */\n navigate?: (path: string) => void;\n /** Navigate to a path relative to basePath */\n navigateTo: (relativePath: string) => void;\n /** Get the full path for a relative path */\n getPath: (relativePath: string) => string;\n}\n\nconst BotlitContext = createContext<BotlitContextValue | null>(null);\n\n// ============================================================================\n// Hook\n// ============================================================================\n\nexport function useBotlit(): BotlitContextValue {\n const context = useContext(BotlitContext);\n if (!context) {\n throw new Error('useBotlit must be used within a BotlitProvider');\n }\n return context;\n}\n\n// ============================================================================\n// Provider Component\n// ============================================================================\n\ntype ProviderProps = Omit<BotmanorRootProps, 'registerNavItems' | 'registerFooterItems'> & {\n isStandalone: boolean;\n};\n\n/** Provider for standalone mode (has access to MemoryRouter) */\nconst StandaloneProviderInner: FC<PropsWithChildren<ProviderProps>> = ({\n children,\n basePath,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n // Always call hooks unconditionally in this component\n const routerNavigate = useRouterNavigate();\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n routerNavigate(fullPath);\n },\n [effectiveBasePath, routerNavigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate: undefined,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: true,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\n/** Provider for integrated mode (shell provides navigate) */\nconst IntegratedProviderInner: FC<\n PropsWithChildren<ProviderProps & { navigate: (path: string) => void }>\n> = ({\n children,\n basePath,\n navigate,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n}) => {\n const effectiveBasePath = basePath || '/';\n\n const getPath = useCallback(\n (relativePath: string) => joinPath(effectiveBasePath, relativePath),\n [effectiveBasePath]\n );\n\n const navigateTo = useCallback(\n (relativePath: string) => {\n const fullPath = joinPath(effectiveBasePath, relativePath);\n navigate(fullPath);\n },\n [effectiveBasePath, navigate]\n );\n\n const contextValue = useMemo<BotlitContextValue>(\n () => ({\n basePath: effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n isStandalone: false,\n navigateTo,\n getPath,\n }),\n [\n effectiveBasePath,\n navigate,\n currentUser,\n tenantId,\n organizationId,\n workspaceId,\n apiGatewayUrl,\n authToken,\n productId,\n onBotSelect,\n onAgentSelect,\n navigateTo,\n getPath,\n ]\n );\n\n return <BotlitContext.Provider value={contextValue}>{children}</BotlitContext.Provider>;\n};\n\nexport const BotlitProvider: FC<PropsWithChildren<BotmanorRootProps>> = (props) => {\n const { children, navigate, tenantId, workspaceId, currentUser } = props;\n const scopeKey = JSON.stringify([tenantId, workspaceId, currentUser?.id]);\n const workspaceChildren = (\n <SupervisorActionProvider scopeKey={scopeKey}>{children}</SupervisorActionProvider>\n );\n // Standalone mode: no navigate function provided (MFE manages its own router)\n // Integrated mode: navigate function provided by shell (shell provides router)\n const isStandalone = !navigate;\n\n // Standalone mode: wrap in MemoryRouter\n if (isStandalone) {\n return (\n <MemoryRouter>\n <StandaloneProviderInner {...props} isStandalone={true}>\n {workspaceChildren}\n </StandaloneProviderInner>\n </MemoryRouter>\n );\n }\n\n // Integrated mode: shell provides router\n return (\n <IntegratedProviderInner {...props} navigate={navigate} isStandalone={false}>\n {workspaceChildren}\n </IntegratedProviderInner>\n );\n};\n"],"mappings":";;;;;;AA6BA,IAAMC,IAAgBC,EAAyC,IAAI;AAMnE,SAAgBC,IAAgC;CAC9C,IAAMC,IAAUC,EAAWJ,CAAa;CACxC,IAAI,CAACG,GACH,MAAU,MAAM,gDAAgD;CAElE,OAAOA;AACT;AAWA,IAAME,KAAiE,EACrE,aACA,aACA,gBACA,aACA,mBACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CAEJ,IAAMC,IAAiBP,EAAkB,GACnCS,IAAoBC,KAAY,KAEhCC,IAAUC,GACb,MAAyBC,EAASJ,GAAmBK,CAAY,GAClE,CAACL,CAAiB,CACpB,GAEMM,IAAaH,GAChB,MAAyB;EACxB,IAAMI,IAAWH,EAASJ,GAAmBK,CAAY;EACzD,EAAeE,CAAQ;CACzB,GACA,CAACP,GAAmBF,CAAc,CACpC,GAEMU,IAAeC,SACZ;EACL,UAAUT;EACV,UAAU,KAAA;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACEA;EACAU;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAZ;EACAJ;CACF,CACF;CAEA,OAAO,kBAACV,EAAc,UAAf;EAAwB,OAAOgB;EAAe;CAAiC,CAAA;AACxF,GAGMW,KAED,EACH,aACA,aACA,aACA,gBACA,aACA,mBACA,gBACA,kBACA,cACA,cACA,gBACA,uBACI;CACJ,IAAMnB,IAAoBC,KAAY,KAEhCC,IAAUC,GACb,MAAyBC,EAASJ,GAAmBK,CAAY,GAClE,CAACL,CAAiB,CACpB,GAEMM,IAAaH,GAChB,MAAyB;EAExB,EADiBC,EAASJ,GAAmBK,CACpC,CAAQ;CACnB,GACA,CAACL,GAAmBoB,CAAQ,CAC9B,GAEMZ,IAAeC,SACZ;EACL,UAAUT;EACV;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA,cAAc;EACd;EACA;CACF,IACA;EACEA;EACAoB;EACAV;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAC;EACAZ;EACAJ;CACF,CACF;CAEA,OAAO,kBAACV,EAAc,UAAf;EAAwB,OAAOgB;EAAe;CAAiC,CAAA;AACxF,GAEaa,KAA4D,MAAU;CACjF,IAAM,EAAE,aAAU,aAAU,aAAU,gBAAa,mBAAgBC,GAC7DC,IAAW,KAAK,UAAU;EAACZ;EAAUE;EAAaH,GAAa;CAAE,CAAC,GAClEc,IACJ,kBAACC,GAAD;EAAoC;EAAW;CAAmC,CAAA;CAkBpF,OAdsBL,IAepB,kBAACD,GAAD;EAAyB,GAAIG;EAAiB;EAAU,cAAc;EACnE,UAAAE;CACsB,CAAA,IAZvB,kBAACE,GAAD,EAAA,UACE,kBAAC7B,GAAD;EAAyB,GAAIyB;EAAO,cAAc;EAC/C,UAAAE;CACsB,CAAA,EACb,CAAA;AAUpB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
interface ActionSnapshot {
|
|
3
|
+
busy: boolean;
|
|
4
|
+
completedActions: ReadonlySet<string>;
|
|
5
|
+
}
|
|
6
|
+
/** Keeps Supervisor receipts and in-flight actions across routes within one workspace session. */
|
|
7
|
+
export declare function SupervisorActionProvider({ children, scopeKey, }: PropsWithChildren<{
|
|
8
|
+
scopeKey: string;
|
|
9
|
+
}>): import('react').JSX.Element;
|
|
10
|
+
export declare function useSupervisorActionScope(): {
|
|
11
|
+
key: string;
|
|
12
|
+
activate(): () => void;
|
|
13
|
+
isActive: () => boolean;
|
|
14
|
+
getSnapshot: () => ActionSnapshot;
|
|
15
|
+
subscribe(listener: () => void): () => void;
|
|
16
|
+
start(): boolean;
|
|
17
|
+
finish(): void;
|
|
18
|
+
acknowledge(id: string): void;
|
|
19
|
+
};
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { createContext as e, useContext as t, useLayoutEffect as n, useMemo as r } from "react";
|
|
2
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
3
|
+
// src/botlit/providers/SupervisorActionScope.tsx
|
|
4
|
+
function a(e) {
|
|
5
|
+
let t = !1, n = {
|
|
6
|
+
busy: !1,
|
|
7
|
+
completedActions: /* @__PURE__ */ new Set()
|
|
8
|
+
}, r = /* @__PURE__ */ new Set();
|
|
9
|
+
function i(e) {
|
|
10
|
+
n = e, r.forEach((e) => e());
|
|
11
|
+
}
|
|
12
|
+
return {
|
|
13
|
+
key: e,
|
|
14
|
+
activate() {
|
|
15
|
+
return t = !0, () => {
|
|
16
|
+
t = !1;
|
|
17
|
+
};
|
|
18
|
+
},
|
|
19
|
+
isActive: () => t,
|
|
20
|
+
getSnapshot: () => n,
|
|
21
|
+
subscribe(e) {
|
|
22
|
+
return r.add(e), () => {
|
|
23
|
+
r.delete(e);
|
|
24
|
+
};
|
|
25
|
+
},
|
|
26
|
+
start() {
|
|
27
|
+
return !t || n.busy ? !1 : (i({
|
|
28
|
+
...n,
|
|
29
|
+
busy: !0
|
|
30
|
+
}), !0);
|
|
31
|
+
},
|
|
32
|
+
finish() {
|
|
33
|
+
i({
|
|
34
|
+
...n,
|
|
35
|
+
busy: !1
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
acknowledge(e) {
|
|
39
|
+
i({
|
|
40
|
+
...n,
|
|
41
|
+
completedActions: new Set(n.completedActions).add(e)
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
var o = e(null);
|
|
47
|
+
function s({ children: e, scopeKey: t }) {
|
|
48
|
+
let s = r(() => a(t), [t]);
|
|
49
|
+
return n(() => s.activate(), [s]), /* @__PURE__ */ i(o.Provider, {
|
|
50
|
+
value: s,
|
|
51
|
+
children: e
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
function c() {
|
|
55
|
+
let e = t(o);
|
|
56
|
+
if (!e) throw Error("Supervisor actions require a BotManor workspace provider.");
|
|
57
|
+
return e;
|
|
58
|
+
}
|
|
59
|
+
export { s as SupervisorActionProvider, c as useSupervisorActionScope };
|
|
60
|
+
|
|
61
|
+
//# sourceMappingURL=SupervisorActionScope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SupervisorActionScope.js","names":["createActionScope","active","snapshot","listeners","publish","next","listener","id","SupervisorActionContext","createContext","SupervisorActionProvider","scope","useMemo","scopeKey","useLayoutEffect","useSupervisorActionScope","useContext"],"sources":["../../../src/botlit/providers/SupervisorActionScope.tsx"],"sourcesContent":["import { createContext, useContext, useLayoutEffect, useMemo, type PropsWithChildren } from 'react';\n\ninterface ActionSnapshot {\n busy: boolean;\n completedActions: ReadonlySet<string>;\n}\n\nfunction createActionScope(key: string) {\n let active = false;\n let snapshot: ActionSnapshot = { busy: false, completedActions: new Set() };\n const listeners = new Set<() => void>();\n\n function publish(next: ActionSnapshot) {\n snapshot = next;\n listeners.forEach((listener) => listener());\n }\n\n return {\n key,\n activate() {\n active = true;\n return () => {\n active = false;\n };\n },\n isActive: () => active,\n getSnapshot: () => snapshot,\n subscribe(listener: () => void) {\n listeners.add(listener);\n return () => {\n listeners.delete(listener);\n };\n },\n start() {\n if (!active || snapshot.busy) return false;\n publish({ ...snapshot, busy: true });\n return true;\n },\n finish() {\n publish({ ...snapshot, busy: false });\n },\n acknowledge(id: string) {\n publish({ ...snapshot, completedActions: new Set(snapshot.completedActions).add(id) });\n },\n };\n}\n\nconst SupervisorActionContext = createContext<ReturnType<typeof createActionScope> | null>(null);\n\n/** Keeps Supervisor receipts and in-flight actions across routes within one workspace session. */\nexport function SupervisorActionProvider({\n children,\n scopeKey,\n}: PropsWithChildren<{ scopeKey: string }>) {\n const scope = useMemo(() => createActionScope(scopeKey), [scopeKey]);\n useLayoutEffect(() => scope.activate(), [scope]);\n return (\n <SupervisorActionContext.Provider value={scope}>{children}</SupervisorActionContext.Provider>\n );\n}\n\nexport function useSupervisorActionScope() {\n const scope = useContext(SupervisorActionContext);\n if (!scope) throw new Error('Supervisor actions require a BotManor workspace provider.');\n return scope;\n}\n"],"mappings":";;;AAOA,SAASA,EAAkB,GAAa;CACtC,IAAIC,IAAS,IACTC,IAA2B;EAAE,MAAM;EAAO,kCAAkB,IAAI,IAAI;CAAE,GACpEC,oBAAY,IAAI,IAAgB;CAEtC,SAASC,EAAQ,GAAsB;EAErC,AADA,IAAWC,GACXF,EAAU,SAAS,MAAaG,EAAS,CAAC;CAC5C;CAEA,OAAO;EACL;EACA,WAAW;GAET,OADA,IAAS,UACI;IACX,IAAS;GACX;EACF;EACA,gBAAgBL;EAChB,mBAAmBC;EACnB,UAAU,GAAsB;GAE9B,OADAC,EAAU,IAAIG,CAAQ,SACT;IACX,EAAU,OAAOA,CAAQ;GAC3B;EACF;EACA,QAAQ;GAGN,OAFI,CAACL,KAAUC,EAAS,OAAa,MACrCE,EAAQ;IAAE,GAAGF;IAAU,MAAM;GAAK,CAAC,GAC5B;EACT;EACA,SAAS;GACP,EAAQ;IAAE,GAAGA;IAAU,MAAM;GAAM,CAAC;EACtC;EACA,YAAY,GAAY;GACtB,EAAQ;IAAE,GAAGA;IAAU,kBAAkB,IAAI,IAAIA,EAAS,gBAAgB,CAAC,CAAC,IAAIK,CAAE;GAAE,CAAC;EACvF;CACF;AACF;AAEA,IAAMC,IAA0BC,EAA2D,IAAI;AAG/F,SAAgBC,EAAyB,EACvC,aACA,eAC0C;CAC1C,IAAMC,IAAQC,QAAcZ,EAAkBa,CAAQ,GAAG,CAACA,CAAQ,CAAC;CAEnE,OADAC,QAAsBH,EAAM,SAAS,GAAG,CAACA,CAAK,CAAC,GAE7C,kBAACH,EAAwB,UAAzB;EAAkC,OAAOG;EAAQ;CAA2C,CAAA;AAEhG;AAEA,SAAgBI,IAA2B;CACzC,IAAMJ,IAAQK,EAAWR,CAAuB;CAChD,IAAI,CAACG,GAAO,MAAU,MAAM,2DAA2D;CACvF,OAAOA;AACT"}
|
|
@@ -2,28 +2,30 @@
|
|
|
2
2
|
var e = /* @__PURE__ */ function(e) {
|
|
3
3
|
return e.Accepted = "ACCEPTED", e.Dismissed = "DISMISSED", e.Generated = "GENERATED", e.Superseded = "SUPERSEDED", e;
|
|
4
4
|
}({}), t = /* @__PURE__ */ function(e) {
|
|
5
|
-
return e.
|
|
5
|
+
return e.Active = "ACTIVE", e.Archived = "ARCHIVED", e.Draft = "DRAFT", e.Paused = "PAUSED", e.Training = "TRAINING", e;
|
|
6
6
|
}({}), n = /* @__PURE__ */ function(e) {
|
|
7
|
-
return e.
|
|
7
|
+
return e.Abstain = "ABSTAIN", e.Continue = "CONTINUE", e;
|
|
8
8
|
}({}), r = /* @__PURE__ */ function(e) {
|
|
9
|
-
return e.
|
|
9
|
+
return e.Bot = "BOT", e.Customer = "CUSTOMER", e.Operator = "OPERATOR", e;
|
|
10
10
|
}({}), i = /* @__PURE__ */ function(e) {
|
|
11
|
-
return e.
|
|
11
|
+
return e.Accepted = "ACCEPTED", e.Assigned = "ASSIGNED", e.Expired = "EXPIRED", e.Rejected = "REJECTED", e.Released = "RELEASED", e.Requested = "REQUESTED", e.Resolved = "RESOLVED", e;
|
|
12
12
|
}({}), a = /* @__PURE__ */ function(e) {
|
|
13
|
-
return e.
|
|
13
|
+
return e.OwnedByMe = "OWNED_BY_ME", e.SharedWithMe = "SHARED_WITH_ME", e;
|
|
14
14
|
}({}), o = /* @__PURE__ */ function(e) {
|
|
15
|
-
return e.
|
|
15
|
+
return e.Agent = "AGENT", e.App = "APP", e.Workspace = "WORKSPACE", e;
|
|
16
16
|
}({}), s = /* @__PURE__ */ function(e) {
|
|
17
|
-
return e.
|
|
17
|
+
return e.Day = "DAY", e.Window = "WINDOW", e;
|
|
18
18
|
}({}), c = /* @__PURE__ */ function(e) {
|
|
19
|
-
return e.
|
|
19
|
+
return e.Cancelled = "CANCELLED", e.Completed = "COMPLETED", e.Failed = "FAILED", e.Pending = "PENDING", e.Running = "RUNNING", e.Timeout = "TIMEOUT", e;
|
|
20
20
|
}({}), l = /* @__PURE__ */ function(e) {
|
|
21
|
-
return e.
|
|
21
|
+
return e.Forked = "FORKED", e.Linked = "LINKED", e;
|
|
22
22
|
}({}), u = /* @__PURE__ */ function(e) {
|
|
23
|
-
return e.
|
|
23
|
+
return e.A2AAgent = "A2A_AGENT", e.Agent = "AGENT", e.App = "APP", e.ChannelTemplate = "CHANNEL_TEMPLATE", e.Integration = "INTEGRATION", e.KbTemplate = "KB_TEMPLATE", e.KnowledgeBase = "KNOWLEDGE_BASE", e.McpPack = "MCP_PACK", e.PolicyBundle = "POLICY_BUNDLE", e.Prompt = "PROMPT", e.PromptTemplate = "PROMPT_TEMPLATE", e.RetrievalProfile = "RETRIEVAL_PROFILE", e.Skill = "SKILL", e.Template = "TEMPLATE", e.Tool = "TOOL", e.Workflow = "WORKFLOW", e;
|
|
24
24
|
}({}), d = /* @__PURE__ */ function(e) {
|
|
25
|
+
return e.Budget = "BUDGET", e.Content = "CONTENT", e.Data = "DATA", e.RateLimit = "RATE_LIMIT", e.Response = "RESPONSE", e.Retention = "RETENTION", e.Tool = "TOOL", e;
|
|
26
|
+
}({}), f = /* @__PURE__ */ function(e) {
|
|
25
27
|
return e.Major = "MAJOR", e.Minor = "MINOR", e.Patch = "PATCH", e;
|
|
26
28
|
}({});
|
|
27
|
-
export { e as AiPredictionStatus, t as
|
|
29
|
+
export { e as AiPredictionStatus, t as BotmanorAgentStatus, n as BotmanorHandoffFallbackBehavior, r as BotmanorHandoffMessageRole, i as BotmanorHandoffStatus, a as ConnectionAccessFilter, o as DailyUsageDimension, s as DailyUsageInterval, c as ExecutionStatus, l as InstallMode, u as PackageKind, d as PolicyType, f as PromptVersionBump };
|
|
28
30
|
|
|
29
31
|
//# sourceMappingURL=wspace-types.js.map
|