@burdenoff/microfe-stewards 0.0.0-stage → 2026.1124.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.
Files changed (46) hide show
  1. package/README.md +19 -2
  2. package/dist/dev/fixtures.d.ts +16 -0
  3. package/dist/dev/main.d.ts +0 -0
  4. package/dist/generated/global-operations.d.ts +4 -0
  5. package/dist/generated/global-types.d.ts +32831 -0
  6. package/dist/generated/wspace-operations.d.ts +89 -0
  7. package/dist/generated/wspace-operations.js +42 -0
  8. package/dist/generated/wspace-operations.js.map +1 -0
  9. package/dist/generated/wspace-types.d.ts +214976 -0
  10. package/dist/generated/wspace-types.js +13 -0
  11. package/dist/generated/wspace-types.js.map +1 -0
  12. package/dist/index.d.ts +8 -0
  13. package/dist/index.js +4 -0
  14. package/dist/node_modules/zustand/esm/vanilla.js +19 -0
  15. package/dist/node_modules/zustand/esm/vanilla.js.map +1 -0
  16. package/dist/stewards/StewardsRoot.d.ts +9 -0
  17. package/dist/stewards/StewardsRoot.js +16 -0
  18. package/dist/stewards/StewardsRoot.js.map +1 -0
  19. package/dist/stewards/StewardsRoutes.d.ts +5 -0
  20. package/dist/stewards/StewardsRoutes.js +19 -0
  21. package/dist/stewards/StewardsRoutes.js.map +1 -0
  22. package/dist/stewards/components/StewardsTable.d.ts +8 -0
  23. package/dist/stewards/components/StewardsTable.js +74 -0
  24. package/dist/stewards/components/StewardsTable.js.map +1 -0
  25. package/dist/stewards/components/stewardLabels.d.ts +7 -0
  26. package/dist/stewards/components/stewardLabels.js +30 -0
  27. package/dist/stewards/components/stewardLabels.js.map +1 -0
  28. package/dist/stewards/hooks/useStewards.d.ts +10 -0
  29. package/dist/stewards/hooks/useStewards.js +17 -0
  30. package/dist/stewards/hooks/useStewards.js.map +1 -0
  31. package/dist/stewards/index.d.ts +3 -0
  32. package/dist/stewards/index.js +3 -0
  33. package/dist/stewards/pages/StewardsListPage.d.ts +1 -0
  34. package/dist/stewards/pages/StewardsListPage.js +66 -0
  35. package/dist/stewards/pages/StewardsListPage.js.map +1 -0
  36. package/dist/stewards/permissions/stewardPermissions.d.ts +16 -0
  37. package/dist/stewards/permissions/stewardPermissions.js +11 -0
  38. package/dist/stewards/permissions/stewardPermissions.js.map +1 -0
  39. package/dist/stewards/providers/StewardsProvider.d.ts +18 -0
  40. package/dist/stewards/providers/StewardsProvider.js +29 -0
  41. package/dist/stewards/providers/StewardsProvider.js.map +1 -0
  42. package/dist/stewards/store/stewardsStore.d.ts +12 -0
  43. package/dist/stewards/store/stewardsStore.js +11 -0
  44. package/dist/stewards/store/stewardsStore.js.map +1 -0
  45. package/dist/stewards/types/index.d.ts +15 -0
  46. package/package.json +127 -4
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Stewards microfrontend — root export for build-time composition.
3
+ *
4
+ * Host shells mount `StewardsRoot` on a splat route BEFORE `/botmanor/*`
5
+ * (precedent: `/botmanor/workflows/*`), and add an `@source` line for this
6
+ * package's `dist` to their Tailwind entry so its classes are not purged.
7
+ */
8
+ export * from './stewards/index';
package/dist/index.js ADDED
@@ -0,0 +1,4 @@
1
+ import { STEWARD_PERMISSIONS as e } from "./stewards/permissions/stewardPermissions.js";
2
+ import { StewardsRoot as t } from "./stewards/StewardsRoot.js";
3
+ import "./stewards/index.js";
4
+ export { e as STEWARD_PERMISSIONS, t as StewardsRoot };
@@ -0,0 +1,19 @@
1
+ // node_modules/zustand/esm/vanilla.mjs
2
+ var e = (e) => {
3
+ let t, n = /* @__PURE__ */ new Set(), r = (e, r) => {
4
+ let i = typeof e == "function" ? e(t) : e;
5
+ if (!Object.is(i, t)) {
6
+ let e = t;
7
+ t = r ?? (typeof i != "object" || !i) ? i : Object.assign({}, t, i), n.forEach((n) => n(t, e));
8
+ }
9
+ }, i = () => t, a = {
10
+ setState: r,
11
+ getState: i,
12
+ getInitialState: () => o,
13
+ subscribe: (e) => (n.add(e), () => n.delete(e))
14
+ }, o = t = e(r, i, a);
15
+ return a;
16
+ }, t = ((t) => t ? e(t) : e);
17
+ export { t as createStore };
18
+
19
+ //# sourceMappingURL=vanilla.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vanilla.js","names":["createStoreImpl","state","listeners","setState","nextState","partial","previousState","replace","listener","getState","api","initialState","createState","createStore"],"sources":["../../../../node_modules/zustand/esm/vanilla.mjs"],"sourcesContent":["const createStoreImpl = (createState) => {\n let state;\n const listeners = /* @__PURE__ */ new Set();\n const setState = (partial, replace) => {\n const nextState = typeof partial === \"function\" ? partial(state) : partial;\n if (!Object.is(nextState, state)) {\n const previousState = state;\n state = (replace != null ? replace : typeof nextState !== \"object\" || nextState === null) ? nextState : Object.assign({}, state, nextState);\n listeners.forEach((listener) => listener(state, previousState));\n }\n };\n const getState = () => state;\n const getInitialState = () => initialState;\n const subscribe = (listener) => {\n listeners.add(listener);\n return () => listeners.delete(listener);\n };\n const api = { setState, getState, getInitialState, subscribe };\n const initialState = state = createState(setState, getState, api);\n return api;\n};\nconst createStore = ((createState) => createState ? createStoreImpl(createState) : createStoreImpl);\n\nexport { createStore };\n"],"ignoreList":[0],"mappings":";AAAA,IAAMA,KAAmB,MAAgB;CACvC,IAAIC,GACEC,oBAA4B,IAAI,IAAI,GACpCC,KAAY,GAAS,MAAY;EACrC,IAAMC,IAAY,OAAOC,KAAY,aAAaA,EAAQJ,CAAK,IAAII;EACnE,IAAI,CAAC,OAAO,GAAGD,GAAWH,CAAK,GAAG;GAChC,IAAMK,IAAgBL;GAEtB,AADA,IAASM,MAA4B,OAAOH,KAAc,aAAYA,KAAsBA,IAAY,OAAO,OAAO,CAAC,GAAGH,GAAOG,CAAS,GAC1IF,EAAU,SAAS,MAAaM,EAASP,GAAOK,CAAa,CAAC;EAChE;CACF,GACMG,UAAiBR,GAMjBS,IAAM;EAAE;EAAU;EAAU,uBALJC;EAKqB,YAJhC,OACjBT,EAAU,IAAIM,CAAQ,SACTN,EAAU,OAAOM,CAAQ;CAEqB,GACvDG,IAAe,IAAQC,EAAYT,GAAUM,GAAUC,CAAG;CAChE,OAAOA;AACT,GACMG,MAAgB,MAAgBD,IAAcZ,EAAgBY,CAAW,IAAIZ"}
@@ -0,0 +1,9 @@
1
+ import { StewardsRootProps } from './types';
2
+ /**
3
+ * Root component host shells render for the Stewards microfrontend.
4
+ *
5
+ * It uses the host's Apollo client, permission provider and theme: it never
6
+ * styles `<html>` and creates no module-level singletons, so it can be mounted
7
+ * more than once.
8
+ */
9
+ export declare function StewardsRoot({ basePath, navigate, workspaceId }: StewardsRootProps): import('react').JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { StewardsProvider as e } from "./providers/StewardsProvider.js";
2
+ import { StewardsRoutes as t } from "./StewardsRoutes.js";
3
+ import { ErrorBoundary as n } from "@burdenoff/fe-libs/shared/components";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ // src/stewards/StewardsRoot.tsx
6
+ function i({ basePath: i, navigate: a, workspaceId: o }) {
7
+ return /* @__PURE__ */ r(n, { children: /* @__PURE__ */ r(e, {
8
+ basePath: i,
9
+ navigate: a,
10
+ workspaceId: o,
11
+ children: /* @__PURE__ */ r(t, {})
12
+ }) });
13
+ }
14
+ export { i as StewardsRoot };
15
+
16
+ //# sourceMappingURL=StewardsRoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StewardsRoot.js","names":["StewardsRoot","ErrorBoundary","StewardsProvider","StewardsRoutes"],"sources":["../../src/stewards/StewardsRoot.tsx"],"sourcesContent":["import { ErrorBoundary } from '@burdenoff/fe-libs/shared/components';\nimport { StewardsProvider } from './providers/StewardsProvider';\nimport { StewardsRoutes } from './StewardsRoutes';\nimport type { StewardsRootProps } from './types';\n\n/**\n * Root component host shells render for the Stewards microfrontend.\n *\n * It uses the host's Apollo client, permission provider and theme: it never\n * styles `<html>` and creates no module-level singletons, so it can be mounted\n * more than once.\n */\nexport function StewardsRoot({ basePath, navigate, workspaceId }: StewardsRootProps) {\n return (\n <ErrorBoundary>\n <StewardsProvider basePath={basePath} navigate={navigate} workspaceId={workspaceId}>\n <StewardsRoutes />\n </StewardsProvider>\n </ErrorBoundary>\n );\n}\n"],"mappings":";;;;;AAYA,SAAgBA,EAAa,EAAE,aAAU,aAAU,kBAAkC;CACnF,OACE,kBAACC,GAAD,EAAA,UACE,kBAACC,GAAD;EAA4B;EAAoB;EAAuB;EACrE,UAAA,kBAACC,GAAD,CAAiB,CAAA;CACD,CAAA,EACL,CAAA;AAEnB"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Routes relative to the host's mount point (e.g. `/botmanor/stewards/*`).
3
+ * Detail, charter, daybook, run and create pages land with BOFF-16146 (Track C).
4
+ */
5
+ export declare function StewardsRoutes(): import('react').JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { StewardsListPage as e } from "./pages/StewardsListPage.js";
2
+ import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
+ import { Navigate as r, Route as i, Routes as a } from "react-router";
4
+ // src/stewards/StewardsRoutes.tsx
5
+ function o() {
6
+ return /* @__PURE__ */ n(a, { children: [/* @__PURE__ */ t(i, {
7
+ index: !0,
8
+ element: /* @__PURE__ */ t(e, {})
9
+ }), /* @__PURE__ */ t(i, {
10
+ path: "*",
11
+ element: /* @__PURE__ */ t(r, {
12
+ to: ".",
13
+ replace: !0
14
+ })
15
+ })] });
16
+ }
17
+ export { o as StewardsRoutes };
18
+
19
+ //# sourceMappingURL=StewardsRoutes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StewardsRoutes.js","names":["StewardsRoutes","Routes","Route","StewardsListPage","Navigate"],"sources":["../../src/stewards/StewardsRoutes.tsx"],"sourcesContent":["import { Navigate, Route, Routes } from 'react-router';\nimport { StewardsListPage } from './pages/StewardsListPage';\n\n/**\n * Routes relative to the host's mount point (e.g. `/botmanor/stewards/*`).\n * Detail, charter, daybook, run and create pages land with BOFF-16146 (Track C).\n */\nexport function StewardsRoutes() {\n return (\n <Routes>\n <Route index element={<StewardsListPage />} />\n <Route path=\"*\" element={<Navigate to=\".\" replace />} />\n </Routes>\n );\n}\n"],"mappings":";;;;AAOA,SAAgBA,IAAiB;CAC/B,OACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;EAAO,OAAA;EAAM,SAAS,kBAACC,GAAD,CAAmB,CAAA;CAAI,CAAA,GAC7C,kBAACD,GAAD;EAAO,MAAK;EAAI,SAAS,kBAACE,GAAD;GAAU,IAAG;GAAI,SAAA;EAAS,CAAA;CAAI,CAAA,CACjD,EAAA,CAAA;AAEZ"}
@@ -0,0 +1,8 @@
1
+ import { StewardListItem } from '../types';
2
+ interface StewardsTableProps {
3
+ stewards: StewardListItem[];
4
+ onOpen: (stewardId: string) => void;
5
+ }
6
+ /** The workspace's stewards. Colours come from fe-libs semantic tokens only. */
7
+ export declare function StewardsTable({ stewards, onOpen }: StewardsTableProps): import('react').JSX.Element;
8
+ export {};
@@ -0,0 +1,74 @@
1
+ import { AUTONOMY_LABELS as e, DESK_LABELS as t, RUN_STATUS_LABELS as n, formatSpend as r } from "./stewardLabels.js";
2
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
3
+ // src/stewards/components/StewardsTable.tsx
4
+ function o({ stewards: o, onOpen: s }) {
5
+ return /* @__PURE__ */ a("table", {
6
+ className: "w-full text-sm",
7
+ "aria-label": "Stewards",
8
+ children: [/* @__PURE__ */ i("thead", { children: /* @__PURE__ */ a("tr", {
9
+ className: "border-b border-border-seam text-left text-xs text-text-secondary",
10
+ children: [
11
+ /* @__PURE__ */ i("th", {
12
+ className: "px-3 py-2 font-medium",
13
+ children: "Steward"
14
+ }),
15
+ /* @__PURE__ */ i("th", {
16
+ className: "px-3 py-2 font-medium",
17
+ children: "Autonomy"
18
+ }),
19
+ /* @__PURE__ */ i("th", {
20
+ className: "px-3 py-2 font-medium",
21
+ children: "Desk"
22
+ }),
23
+ /* @__PURE__ */ i("th", {
24
+ className: "px-3 py-2 font-medium",
25
+ children: "Last run"
26
+ }),
27
+ /* @__PURE__ */ i("th", {
28
+ className: "px-3 py-2 font-medium",
29
+ children: "Today"
30
+ }),
31
+ /* @__PURE__ */ i("th", {
32
+ className: "px-3 py-2 font-medium",
33
+ children: "Waiting"
34
+ })
35
+ ]
36
+ }) }), /* @__PURE__ */ i("tbody", { children: o.map((o) => /* @__PURE__ */ a("tr", {
37
+ className: "border-b border-border-seam",
38
+ children: [
39
+ /* @__PURE__ */ i("td", {
40
+ className: "px-3 py-2",
41
+ children: /* @__PURE__ */ i("button", {
42
+ type: "button",
43
+ className: "text-left font-medium text-text-primary hover:underline",
44
+ onClick: () => s(o.id),
45
+ children: o.agent?.name ?? o.agentId
46
+ })
47
+ }),
48
+ /* @__PURE__ */ i("td", {
49
+ className: "px-3 py-2 text-text-primary",
50
+ children: e[o.charter.autonomyLevel]
51
+ }),
52
+ /* @__PURE__ */ i("td", {
53
+ className: "px-3 py-2 text-text-secondary",
54
+ children: t[o.defaultDeskKind]
55
+ }),
56
+ /* @__PURE__ */ i("td", {
57
+ className: "px-3 py-2 text-text-secondary",
58
+ children: o.lastRun ? n[o.lastRun.status] : "Never run"
59
+ }),
60
+ /* @__PURE__ */ i("td", {
61
+ className: "px-3 py-2 text-text-secondary",
62
+ children: r(o.usageToday.credits, o.charter.budgetPerDay.credits)
63
+ }),
64
+ /* @__PURE__ */ i("td", {
65
+ className: "px-3 py-2 text-text-primary",
66
+ children: o.pendingApprovalCount
67
+ })
68
+ ]
69
+ }, o.id)) })]
70
+ });
71
+ }
72
+ export { o as StewardsTable };
73
+
74
+ //# sourceMappingURL=StewardsTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StewardsTable.js","names":["StewardsTable","stewards","onOpen","s","AUTONOMY_LABELS","DESK_LABELS","RUN_STATUS_LABELS","formatSpend"],"sources":["../../../src/stewards/components/StewardsTable.tsx"],"sourcesContent":["import type { StewardListItem } from '../types';\nimport { AUTONOMY_LABELS, DESK_LABELS, RUN_STATUS_LABELS, formatSpend } from './stewardLabels';\n\ninterface StewardsTableProps {\n stewards: StewardListItem[];\n onOpen: (stewardId: string) => void;\n}\n\n/** The workspace's stewards. Colours come from fe-libs semantic tokens only. */\nexport function StewardsTable({ stewards, onOpen }: StewardsTableProps) {\n return (\n <table className=\"w-full text-sm\" aria-label=\"Stewards\">\n <thead>\n <tr className=\"border-b border-border-seam text-left text-xs text-text-secondary\">\n <th className=\"px-3 py-2 font-medium\">Steward</th>\n <th className=\"px-3 py-2 font-medium\">Autonomy</th>\n <th className=\"px-3 py-2 font-medium\">Desk</th>\n <th className=\"px-3 py-2 font-medium\">Last run</th>\n <th className=\"px-3 py-2 font-medium\">Today</th>\n <th className=\"px-3 py-2 font-medium\">Waiting</th>\n </tr>\n </thead>\n <tbody>\n {stewards.map((s) => (\n <tr key={s.id} className=\"border-b border-border-seam\">\n <td className=\"px-3 py-2\">\n <button\n type=\"button\"\n className=\"text-left font-medium text-text-primary hover:underline\"\n onClick={() => onOpen(s.id)}\n >\n {s.agent?.name ?? s.agentId}\n </button>\n </td>\n <td className=\"px-3 py-2 text-text-primary\">\n {AUTONOMY_LABELS[s.charter.autonomyLevel]}\n </td>\n <td className=\"px-3 py-2 text-text-secondary\">{DESK_LABELS[s.defaultDeskKind]}</td>\n <td className=\"px-3 py-2 text-text-secondary\">\n {s.lastRun ? RUN_STATUS_LABELS[s.lastRun.status] : 'Never run'}\n </td>\n <td className=\"px-3 py-2 text-text-secondary\">\n {formatSpend(s.usageToday.credits, s.charter.budgetPerDay.credits)}\n </td>\n <td className=\"px-3 py-2 text-text-primary\">{s.pendingApprovalCount}</td>\n </tr>\n ))}\n </tbody>\n </table>\n );\n}\n"],"mappings":";;;AASA,SAAgBA,EAAc,EAAE,aAAU,aAA8B;CACtE,OACE,kBAAC,SAAD;EAAO,WAAU;EAAiB,cAAW;EAA7C,UAAA,CACE,kBAAC,SAAD,EAAA,UACE,kBAAC,MAAD;GAAI,WAAU;GAAd,UAAA;IACE,kBAAC,MAAD;KAAI,WAAU;KAAwB,UAAA;IAAW,CAAA;IACjD,kBAAC,MAAD;KAAI,WAAU;KAAwB,UAAA;IAAY,CAAA;IAClD,kBAAC,MAAD;KAAI,WAAU;KAAwB,UAAA;IAAQ,CAAA;IAC9C,kBAAC,MAAD;KAAI,WAAU;KAAwB,UAAA;IAAY,CAAA;IAClD,kBAAC,MAAD;KAAI,WAAU;KAAwB,UAAA;IAAS,CAAA;IAC/C,kBAAC,MAAD;KAAI,WAAU;KAAwB,UAAA;IAAW,CAAA;GAC/C;EACC,CAAA,EAAA,CAAA,GACP,kBAAC,SAAD,EAAA,UACGC,EAAS,KAAK,MACb,kBAAC,MAAD;GAAe,WAAU;GAAzB,UAAA;IACE,kBAAC,MAAD;KAAI,WAAU;KACZ,UAAA,kBAAC,UAAD;MACE,MAAK;MACL,WAAU;MACV,eAAeC,EAAOC,EAAE,EAAE;MAEzB,UAAAA,EAAE,OAAO,QAAQA,EAAE;KACd,CAAA;IACN,CAAA;IACJ,kBAAC,MAAD;KAAI,WAAU;KACX,UAAAC,EAAgBD,EAAE,QAAQ;IACzB,CAAA;IACJ,kBAAC,MAAD;KAAI,WAAU;KAAiC,UAAAE,EAAYF,EAAE;IAAqB,CAAA;IAClF,kBAAC,MAAD;KAAI,WAAU;KACX,UAAAA,EAAE,UAAUG,EAAkBH,EAAE,QAAQ,UAAU;IACjD,CAAA;IACJ,kBAAC,MAAD;KAAI,WAAU;KACX,UAAAI,EAAYJ,EAAE,WAAW,SAASA,EAAE,QAAQ,aAAa,OAAO;IAC/D,CAAA;IACJ,kBAAC,MAAD;KAAI,WAAU;KAA+B,UAAAA,EAAE;IAAyB,CAAA;GACtE;EArBK,GAAAA,EAAE,EAqBP,CACL,EACI,CAAA,CACF;;AAEX"}
@@ -0,0 +1,7 @@
1
+ import { BotmanorStewardAutonomy, BotmanorStewardDeskKind, BotmanorStewardRunStatus } from '../../generated/wspace-types';
2
+ /** Autonomy levels as the plan names them. There is no "full access" level. */
3
+ export declare const AUTONOMY_LABELS: Record<BotmanorStewardAutonomy, string>;
4
+ export declare const DESK_LABELS: Record<BotmanorStewardDeskKind, string>;
5
+ export declare const RUN_STATUS_LABELS: Record<BotmanorStewardRunStatus, string>;
6
+ /** "1.25 / 5 credits", or "1.25 credits" when there is no daily cap. */
7
+ export declare function formatSpend(used: number | null, cap: number | null): string;
@@ -0,0 +1,30 @@
1
+ import { BotmanorStewardAutonomy as e, BotmanorStewardDeskKind as t, BotmanorStewardRunStatus as n } from "../../generated/wspace-types.js";
2
+ // src/stewards/components/stewardLabels.ts
3
+ var r = {
4
+ [e.Observe]: "Observe",
5
+ [e.Ask]: "Ask",
6
+ [e.Guided]: "Guided",
7
+ [e.Trusted]: "Trusted"
8
+ }, i = {
9
+ [t.None]: "No desk",
10
+ [t.Browser]: "Browser only",
11
+ [t.Cloud]: "Cloud desk",
12
+ [t.OwnMachine]: "Own machine"
13
+ }, a = {
14
+ [n.Queued]: "Queued",
15
+ [n.Running]: "Running",
16
+ [n.WaitingApproval]: "Waiting for approval",
17
+ [n.WaitingTakeover]: "Waiting for a person",
18
+ [n.PausedBudget]: "Paused — budget",
19
+ [n.Completed]: "Completed",
20
+ [n.Failed]: "Failed",
21
+ [n.Cancelled]: "Cancelled",
22
+ [n.Stopped]: "Stopped"
23
+ };
24
+ function o(e, t) {
25
+ let n = (e ?? 0).toFixed(2);
26
+ return t == null ? `${n} credits` : `${n} / ${t.toFixed(2)} credits`;
27
+ }
28
+ export { r as AUTONOMY_LABELS, i as DESK_LABELS, a as RUN_STATUS_LABELS, o as formatSpend };
29
+
30
+ //# sourceMappingURL=stewardLabels.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stewardLabels.js","names":["AUTONOMY_LABELS","BotmanorStewardAutonomy","DESK_LABELS","BotmanorStewardDeskKind","RUN_STATUS_LABELS","BotmanorStewardRunStatus","formatSpend","u","used","cap"],"sources":["../../../src/stewards/components/stewardLabels.ts"],"sourcesContent":["import {\n BotmanorStewardAutonomy,\n BotmanorStewardDeskKind,\n BotmanorStewardRunStatus,\n} from '../../generated/wspace-types';\n\n/** Autonomy levels as the plan names them. There is no \"full access\" level. */\nexport const AUTONOMY_LABELS: Record<BotmanorStewardAutonomy, string> = {\n [BotmanorStewardAutonomy.Observe]: 'Observe',\n [BotmanorStewardAutonomy.Ask]: 'Ask',\n [BotmanorStewardAutonomy.Guided]: 'Guided',\n [BotmanorStewardAutonomy.Trusted]: 'Trusted',\n};\n\nexport const DESK_LABELS: Record<BotmanorStewardDeskKind, string> = {\n [BotmanorStewardDeskKind.None]: 'No desk',\n [BotmanorStewardDeskKind.Browser]: 'Browser only',\n [BotmanorStewardDeskKind.Cloud]: 'Cloud desk',\n [BotmanorStewardDeskKind.OwnMachine]: 'Own machine',\n};\n\nexport const RUN_STATUS_LABELS: Record<BotmanorStewardRunStatus, string> = {\n [BotmanorStewardRunStatus.Queued]: 'Queued',\n [BotmanorStewardRunStatus.Running]: 'Running',\n [BotmanorStewardRunStatus.WaitingApproval]: 'Waiting for approval',\n [BotmanorStewardRunStatus.WaitingTakeover]: 'Waiting for a person',\n [BotmanorStewardRunStatus.PausedBudget]: 'Paused — budget',\n [BotmanorStewardRunStatus.Completed]: 'Completed',\n [BotmanorStewardRunStatus.Failed]: 'Failed',\n [BotmanorStewardRunStatus.Cancelled]: 'Cancelled',\n [BotmanorStewardRunStatus.Stopped]: 'Stopped',\n};\n\n/** \"1.25 / 5 credits\", or \"1.25 credits\" when there is no daily cap. */\nexport function formatSpend(used: number | null, cap: number | null): string {\n const u = (used ?? 0).toFixed(2);\n return cap == null ? `${u} credits` : `${u} / ${cap.toFixed(2)} credits`;\n}\n"],"mappings":";;AAOA,IAAaA,IAA2D;EACrEC,EAAwB,UAAU;EAClCA,EAAwB,MAAM;EAC9BA,EAAwB,SAAS;EACjCA,EAAwB,UAAU;AACrC,GAEaC,IAAuD;EACjEC,EAAwB,OAAO;EAC/BA,EAAwB,UAAU;EAClCA,EAAwB,QAAQ;EAChCA,EAAwB,aAAa;AACxC,GAEaC,IAA8D;EACxEC,EAAyB,SAAS;EAClCA,EAAyB,UAAU;EACnCA,EAAyB,kBAAkB;EAC3CA,EAAyB,kBAAkB;EAC3CA,EAAyB,eAAe;EACxCA,EAAyB,YAAY;EACrCA,EAAyB,SAAS;EAClCA,EAAyB,YAAY;EACrCA,EAAyB,UAAU;AACtC;AAGA,SAAgBC,EAAY,GAAqB,GAA4B;CAC3E,IAAMC,KAAKC,KAAQ,EAAA,CAAG,QAAQ,CAAC;CAC/B,OAAOC,KAAO,OAAO,GAAGF,EAAE,YAAY,GAAGA,EAAE,KAAKE,EAAI,QAAQ,CAAC,EAAE;AACjE"}
@@ -0,0 +1,10 @@
1
+ import { BotmanorStewardStatus } from '../../generated/wspace-types';
2
+ import { StewardListItem } from '../types';
3
+ export interface UseStewardsResult {
4
+ stewards: StewardListItem[];
5
+ loading: boolean;
6
+ error: Error | undefined;
7
+ refetch: () => Promise<unknown>;
8
+ }
9
+ /** The workspace's stewards, optionally filtered by status. */
10
+ export declare function useStewards(status: BotmanorStewardStatus | null): UseStewardsResult;
@@ -0,0 +1,17 @@
1
+ import { useListBotmanorStewardsQuery as e } from "../../generated/wspace-operations.js";
2
+ // src/stewards/hooks/useStewards.ts
3
+ function t(t) {
4
+ let { data: n, loading: r, error: i, refetch: a } = e({
5
+ variables: { filter: t ? { status: t } : void 0 },
6
+ fetchPolicy: "cache-and-network"
7
+ });
8
+ return {
9
+ stewards: n?.listBotmanorStewards ?? [],
10
+ loading: r,
11
+ error: i ?? void 0,
12
+ refetch: a
13
+ };
14
+ }
15
+ export { t as useStewards };
16
+
17
+ //# sourceMappingURL=useStewards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStewards.js","names":["useStewards","useListBotmanorStewardsQuery","status","data","error"],"sources":["../../../src/stewards/hooks/useStewards.ts"],"sourcesContent":["import { useListBotmanorStewardsQuery } from '../../generated/wspace-operations';\nimport type { BotmanorStewardStatus } from '../../generated/wspace-types';\nimport type { StewardListItem } from '../types';\n\nexport interface UseStewardsResult {\n stewards: StewardListItem[];\n loading: boolean;\n error: Error | undefined;\n refetch: () => Promise<unknown>;\n}\n\n/** The workspace's stewards, optionally filtered by status. */\nexport function useStewards(status: BotmanorStewardStatus | null): UseStewardsResult {\n const { data, loading, error, refetch } = useListBotmanorStewardsQuery({\n variables: { filter: status ? { status } : undefined },\n fetchPolicy: 'cache-and-network',\n });\n return {\n stewards: data?.listBotmanorStewards ?? [],\n loading,\n error: error ?? undefined,\n refetch,\n };\n}\n"],"mappings":";;AAYA,SAAgBA,EAAY,GAAyD;CACnF,IAAM,EAAE,SAAM,YAAS,UAAO,eAAYC,EAA6B;EACrE,WAAW,EAAE,QAAQC,IAAS,EAAE,UAAO,IAAI,KAAA,EAAU;EACrD,aAAa;CACf,CAAC;CACD,OAAO;EACL,UAAUC,GAAM,wBAAwB,CAAC;EACzC;EACA,OAAOC,KAAS,KAAA;EAChB;CACF;AACF"}
@@ -0,0 +1,3 @@
1
+ export { StewardsRoot } from './StewardsRoot';
2
+ export { STEWARD_PERMISSIONS, type StewardPermission } from './permissions/stewardPermissions';
3
+ export type { StewardsRootProps, StewardListItem } from './types';
@@ -0,0 +1,3 @@
1
+ import { STEWARD_PERMISSIONS as e } from "./permissions/stewardPermissions.js";
2
+ import { StewardsRoot as t } from "./StewardsRoot.js";
3
+ export { e as STEWARD_PERMISSIONS, t as StewardsRoot };
@@ -0,0 +1 @@
1
+ export declare function StewardsListPage(): import('react').JSX.Element;
@@ -0,0 +1,66 @@
1
+ import { BotmanorStewardStatus as e } from "../../generated/wspace-types.js";
2
+ import { StewardsTable as t } from "../components/StewardsTable.js";
3
+ import { useStewards as n } from "../hooks/useStewards.js";
4
+ import { STEWARD_PERMISSIONS as r } from "../permissions/stewardPermissions.js";
5
+ import { useStewardsContext as i, useStewardsStore as a } from "../providers/StewardsProvider.js";
6
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
7
+ import { useSafePermissions as c } from "@burdenoff/fe-libs/shared/providers/shell";
8
+ // src/stewards/pages/StewardsListPage.tsx
9
+ function l(e, t) {
10
+ return `${e.endsWith("/") ? e.slice(0, -1) : e}/${t.replace(/^\//, "")}`;
11
+ }
12
+ function u() {
13
+ let { basePath: u, navigate: d } = i(), f = a((e) => e.statusFilter), p = a((e) => e.setStatusFilter), m = c(), h = !!m && !m.isLoading && m.hasPermission(r.CREATE), { stewards: g, loading: _, error: v } = n(f);
14
+ return /* @__PURE__ */ s("section", {
15
+ className: "flex flex-col gap-4 p-6",
16
+ children: [
17
+ /* @__PURE__ */ s("header", {
18
+ className: "flex items-center justify-between",
19
+ children: [/* @__PURE__ */ s("div", { children: [/* @__PURE__ */ o("h1", {
20
+ className: "text-xl font-semibold text-text-primary",
21
+ children: "Stewards"
22
+ }), /* @__PURE__ */ o("p", {
23
+ className: "text-sm text-text-secondary",
24
+ children: "Agents with a charter, duties and a desk. Every action they take goes through the charter on the server."
25
+ })] }), h && /* @__PURE__ */ o("button", {
26
+ type: "button",
27
+ className: "rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text",
28
+ onClick: () => d(l(u, "new")),
29
+ children: "New steward"
30
+ })]
31
+ }),
32
+ /* @__PURE__ */ s("label", {
33
+ className: "flex items-center gap-2 text-sm text-text-secondary",
34
+ children: ["Status", /* @__PURE__ */ s("select", {
35
+ className: "rounded-md border border-border-seam bg-bg-surface px-2 py-1 text-text-primary",
36
+ value: f ?? "",
37
+ onChange: (e) => p(e.target.value ? e.target.value : null),
38
+ children: [/* @__PURE__ */ o("option", {
39
+ value: "",
40
+ children: "All"
41
+ }), Object.values(e).map((e) => /* @__PURE__ */ o("option", {
42
+ value: e,
43
+ children: e.charAt(0) + e.slice(1).toLowerCase()
44
+ }, e))]
45
+ })]
46
+ }),
47
+ v ? /* @__PURE__ */ s("p", {
48
+ role: "alert",
49
+ className: "rounded-md bg-status-error-bg p-3 text-sm text-status-error-text",
50
+ children: ["Could not load stewards: ", v.message]
51
+ }) : _ && g.length === 0 ? /* @__PURE__ */ o("p", {
52
+ className: "text-sm text-text-secondary",
53
+ children: "Loading stewards…"
54
+ }) : g.length === 0 ? /* @__PURE__ */ o("p", {
55
+ className: "text-sm text-text-secondary",
56
+ children: "No stewards yet."
57
+ }) : /* @__PURE__ */ o(t, {
58
+ stewards: g,
59
+ onOpen: (e) => d(l(u, encodeURIComponent(e)))
60
+ })
61
+ ]
62
+ });
63
+ }
64
+ export { u as StewardsListPage };
65
+
66
+ //# sourceMappingURL=StewardsListPage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StewardsListPage.js","names":["joinPath","base","path","StewardsListPage","useStewardsContext","statusFilter","useStewardsStore","s","setStatusFilter","permissions","useSafePermissions","canCreate","STEWARD_PERMISSIONS","useStewards","navigate","basePath","BotmanorStewardStatus","status","error","loading","stewards","StewardsTable","id"],"sources":["../../../src/stewards/pages/StewardsListPage.tsx"],"sourcesContent":["import { useSafePermissions } from '@burdenoff/fe-libs/shared/providers/shell';\nimport { BotmanorStewardStatus } from '../../generated/wspace-types';\nimport { StewardsTable } from '../components/StewardsTable';\nimport { useStewards } from '../hooks/useStewards';\nimport { STEWARD_PERMISSIONS } from '../permissions/stewardPermissions';\nimport { useStewardsContext, useStewardsStore } from '../providers/StewardsProvider';\n\nfunction joinPath(base: string, path: string): string {\n const cleanBase = base.endsWith('/') ? base.slice(0, -1) : base;\n return `${cleanBase}/${path.replace(/^\\//, '')}`;\n}\n\nexport function StewardsListPage() {\n const { basePath, navigate } = useStewardsContext();\n const statusFilter = useStewardsStore((s) => s.statusFilter);\n const setStatusFilter = useStewardsStore((s) => s.setStatusFilter);\n const permissions = useSafePermissions();\n // Fail closed: no permission provider, or still loading, hides the action.\n // The gateway's @rbac stays the only enforcement point.\n const canCreate =\n !!permissions &&\n !permissions.isLoading &&\n permissions.hasPermission(STEWARD_PERMISSIONS.CREATE);\n const { stewards, loading, error } = useStewards(statusFilter);\n\n return (\n <section className=\"flex flex-col gap-4 p-6\">\n <header className=\"flex items-center justify-between\">\n <div>\n <h1 className=\"text-xl font-semibold text-text-primary\">Stewards</h1>\n <p className=\"text-sm text-text-secondary\">\n Agents with a charter, duties and a desk. Every action they take goes through the\n charter on the server.\n </p>\n </div>\n {canCreate && (\n <button\n type=\"button\"\n className=\"rounded-md bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text\"\n onClick={() => navigate(joinPath(basePath, 'new'))}\n >\n New steward\n </button>\n )}\n </header>\n <label className=\"flex items-center gap-2 text-sm text-text-secondary\">\n Status\n <select\n className=\"rounded-md border border-border-seam bg-bg-surface px-2 py-1 text-text-primary\"\n value={statusFilter ?? ''}\n onChange={(e) =>\n setStatusFilter(e.target.value ? (e.target.value as BotmanorStewardStatus) : null)\n }\n >\n <option value=\"\">All</option>\n {Object.values(BotmanorStewardStatus).map((status) => (\n <option key={status} value={status}>\n {status.charAt(0) + status.slice(1).toLowerCase()}\n </option>\n ))}\n </select>\n </label>\n {error ? (\n <p\n role=\"alert\"\n className=\"rounded-md bg-status-error-bg p-3 text-sm text-status-error-text\"\n >\n Could not load stewards: {error.message}\n </p>\n ) : loading && stewards.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">Loading stewards…</p>\n ) : stewards.length === 0 ? (\n <p className=\"text-sm text-text-secondary\">No stewards yet.</p>\n ) : (\n <StewardsTable\n stewards={stewards}\n onOpen={(id) => navigate(joinPath(basePath, encodeURIComponent(id)))}\n />\n )}\n </section>\n );\n}\n"],"mappings":";;;;;;;;AAOA,SAASA,EAAS,GAAc,GAAsB;CAEpD,OAAO,GADWC,EAAK,SAAS,GAAG,IAAIA,EAAK,MAAM,GAAG,EAAE,IAAIA,EACvC,GAAGC,EAAK,QAAQ,OAAO,EAAE;AAC/C;AAEA,SAAgBC,IAAmB;CACjC,IAAM,EAAE,aAAU,gBAAaC,EAAmB,GAC5CC,IAAeC,GAAkB,MAAMC,EAAE,YAAY,GACrDC,IAAkBF,GAAkB,MAAMC,EAAE,eAAe,GAC3DE,IAAcC,EAAmB,GAGjCC,IACJ,CAAC,CAACF,KACF,CAACA,EAAY,aACbA,EAAY,cAAcG,EAAoB,MAAM,GAChD,EAAE,aAAU,YAAS,aAAUC,EAAYR,CAAY;CAE7D,OACE,kBAAC,WAAD;EAAS,WAAU;EAAnB,UAAA;GACE,kBAAC,UAAD;IAAQ,WAAU;IAAlB,UAAA,CACE,kBAAC,OAAD,EAAA,UAAA,CACE,kBAAC,MAAD;KAAI,WAAU;KAA0C,UAAA;IAAY,CAAA,GACpE,kBAAC,KAAD;KAAG,WAAU;KAA8B,UAAA;IAGxC,CAAA,CACA,EAAA,CAAA,GACJM,KACC,kBAAC,UAAD;KACE,MAAK;KACL,WAAU;KACV,eAAeG,EAASd,EAASe,GAAU,KAAK,CAAC;KAClD,UAAA;IAEO,CAAA,CAEJ;;GACR,kBAAC,SAAD;IAAO,WAAU;IAAjB,UAAA,CAAuE,UAErE,kBAAC,UAAD;KACE,WAAU;KACV,OAAOV,KAAgB;KACvB,WAAW,MACTG,EAAgB,EAAE,OAAO,QAAS,EAAE,OAAO,QAAkC,IAAI;KAJrF,UAAA,CAOE,kBAAC,UAAD;MAAQ,OAAM;MAAG,UAAA;KAAW,CAAA,GAC3B,OAAO,OAAOQ,CAAqB,CAAC,CAAC,KAAK,MACzC,kBAAC,UAAD;MAAqB,OAAOC;MACzB,UAAAA,EAAO,OAAO,CAAC,IAAIA,EAAO,MAAM,CAAC,CAAC,CAAC,YAAY;KAC1C,GAFKA,CAEL,CACT,CACK;IACH,CAAA,CAAA;;GACNC,IACC,kBAAC,KAAD;IACE,MAAK;IACL,WAAU;IAFZ,UAAA,CAGC,6BAC2BA,EAAM,OAC/B;GACD,CAAA,IAAAC,KAAWC,EAAS,WAAW,IACjC,kBAAC,KAAD;IAAG,WAAU;IAA8B,UAAA;GAAoB,CAAA,IAC7DA,EAAS,WAAW,IACtB,kBAAC,KAAD;IAAG,WAAU;IAA8B,UAAA;GAAmB,CAAA,IAE9D,kBAACC,GAAD;IACY;IACV,SAAS,MAAOP,EAASd,EAASe,GAAU,mBAAmBO,CAAE,CAAC,CAAC;GACpE,CAAA;EAEI;;AAEb"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * RBAC permissions the Stewards UI checks before showing an action.
3
+ *
4
+ * They mirror the `@rbac` pairs on the Stewards GraphQL fields (botmanor-specs
5
+ * 10-STEWARDS-TECH-SPEC.md section 6.2): resource `botmanor-steward`, actions
6
+ * read / create / update / delete / execute. The UI hides exactly what the
7
+ * gateway would refuse; the gateway stays the only enforcement point.
8
+ */
9
+ export declare const STEWARD_PERMISSIONS: {
10
+ readonly READ: "botmanor-steward:read";
11
+ readonly CREATE: "botmanor-steward:create";
12
+ readonly UPDATE: "botmanor-steward:update";
13
+ readonly DELETE: "botmanor-steward:delete";
14
+ readonly EXECUTE: "botmanor-steward:execute";
15
+ };
16
+ export type StewardPermission = (typeof STEWARD_PERMISSIONS)[keyof typeof STEWARD_PERMISSIONS];
@@ -0,0 +1,11 @@
1
+ // src/stewards/permissions/stewardPermissions.ts
2
+ var e = {
3
+ READ: "botmanor-steward:read",
4
+ CREATE: "botmanor-steward:create",
5
+ UPDATE: "botmanor-steward:update",
6
+ DELETE: "botmanor-steward:delete",
7
+ EXECUTE: "botmanor-steward:execute"
8
+ };
9
+ export { e as STEWARD_PERMISSIONS };
10
+
11
+ //# sourceMappingURL=stewardPermissions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stewardPermissions.js","names":["STEWARD_PERMISSIONS"],"sources":["../../../src/stewards/permissions/stewardPermissions.ts"],"sourcesContent":["/**\n * RBAC permissions the Stewards UI checks before showing an action.\n *\n * They mirror the `@rbac` pairs on the Stewards GraphQL fields (botmanor-specs\n * 10-STEWARDS-TECH-SPEC.md section 6.2): resource `botmanor-steward`, actions\n * read / create / update / delete / execute. The UI hides exactly what the\n * gateway would refuse; the gateway stays the only enforcement point.\n */\nexport const STEWARD_PERMISSIONS = {\n READ: 'botmanor-steward:read',\n CREATE: 'botmanor-steward:create',\n UPDATE: 'botmanor-steward:update',\n DELETE: 'botmanor-steward:delete',\n EXECUTE: 'botmanor-steward:execute',\n} as const;\n\nexport type StewardPermission = (typeof STEWARD_PERMISSIONS)[keyof typeof STEWARD_PERMISSIONS];\n"],"mappings":";AAQA,IAAaA,IAAsB;CACjC,MAAM;CACN,QAAQ;CACR,QAAQ;CACR,QAAQ;CACR,SAAS;AACX"}
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ import { StewardsListState, StewardsStore } from '../store/stewardsStore';
3
+ interface StewardsContextValue {
4
+ basePath: string;
5
+ navigate: (path: string) => void;
6
+ workspaceId?: string;
7
+ store: StewardsStore;
8
+ }
9
+ interface StewardsProviderProps {
10
+ basePath: string;
11
+ navigate: (path: string) => void;
12
+ workspaceId?: string;
13
+ children: ReactNode;
14
+ }
15
+ export declare function StewardsProvider({ basePath, navigate, workspaceId, children, }: StewardsProviderProps): import('react').JSX.Element;
16
+ export declare function useStewardsContext(): StewardsContextValue;
17
+ export declare function useStewardsStore<T>(selector: (state: StewardsListState) => T): T;
18
+ export {};
@@ -0,0 +1,29 @@
1
+ import { createStewardsStore as e } from "../store/stewardsStore.js";
2
+ import { createContext as t, useContext as n, useState as r } from "react";
3
+ import { useStore as i } from "zustand";
4
+ import { jsx as a } from "react/jsx-runtime";
5
+ // src/stewards/providers/StewardsProvider.tsx
6
+ var o = t(null);
7
+ function s({ basePath: t, navigate: n, workspaceId: i, children: s }) {
8
+ let [c] = r(() => e());
9
+ return /* @__PURE__ */ a(o.Provider, {
10
+ value: {
11
+ basePath: t,
12
+ navigate: n,
13
+ workspaceId: i,
14
+ store: c
15
+ },
16
+ children: s
17
+ });
18
+ }
19
+ function c() {
20
+ let e = n(o);
21
+ if (!e) throw Error("useStewardsContext must be used inside <StewardsProvider>");
22
+ return e;
23
+ }
24
+ function l(e) {
25
+ return i(c().store, e);
26
+ }
27
+ export { s as StewardsProvider, c as useStewardsContext, l as useStewardsStore };
28
+
29
+ //# sourceMappingURL=StewardsProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StewardsProvider.js","names":["StewardsContext","createContext","StewardsProvider","store","useState","createStewardsStore","useStewardsContext","value","useContext","useStewardsStore","useStore","selector"],"sources":["../../../src/stewards/providers/StewardsProvider.tsx"],"sourcesContent":["import { createContext, useContext, useState, type ReactNode } from 'react';\nimport { useStore } from 'zustand';\nimport {\n createStewardsStore,\n type StewardsListState,\n type StewardsStore,\n} from '../store/stewardsStore';\n\ninterface StewardsContextValue {\n basePath: string;\n navigate: (path: string) => void;\n workspaceId?: string;\n store: StewardsStore;\n}\n\nconst StewardsContext = createContext<StewardsContextValue | null>(null);\n\ninterface StewardsProviderProps {\n basePath: string;\n navigate: (path: string) => void;\n workspaceId?: string;\n children: ReactNode;\n}\n\nexport function StewardsProvider({\n basePath,\n navigate,\n workspaceId,\n children,\n}: StewardsProviderProps) {\n // Lazy initial state: the store is created once per mounted provider.\n const [store] = useState(() => createStewardsStore());\n return (\n <StewardsContext.Provider value={{ basePath, navigate, workspaceId, store }}>\n {children}\n </StewardsContext.Provider>\n );\n}\n\nexport function useStewardsContext(): StewardsContextValue {\n const value = useContext(StewardsContext);\n if (!value) {\n throw new Error('useStewardsContext must be used inside <StewardsProvider>');\n }\n return value;\n}\n\nexport function useStewardsStore<T>(selector: (state: StewardsListState) => T): T {\n return useStore(useStewardsContext().store, selector);\n}\n"],"mappings":";;;;;AAeA,IAAMA,IAAkBC,EAA2C,IAAI;AASvE,SAAgBC,EAAiB,EAC/B,aACA,aACA,gBACA,eACwB;CAExB,IAAM,CAACC,KAASC,QAAeC,EAAoB,CAAC;CACpD,OACE,kBAACL,EAAgB,UAAjB;EAA0B,OAAO;GAAE;GAAU;GAAU;GAAa;EAAM;EACvE;CACuB,CAAA;AAE9B;AAEA,SAAgBM,IAA2C;CACzD,IAAMC,IAAQC,EAAWR,CAAe;CACxC,IAAI,CAACO,GACH,MAAU,MAAM,2DAA2D;CAE7E,OAAOA;AACT;AAEA,SAAgBE,EAAoB,GAA8C;CAChF,OAAOC,EAASJ,EAAmB,CAAC,CAAC,OAAOK,CAAQ;AACtD"}
@@ -0,0 +1,12 @@
1
+ import { BotmanorStewardStatus } from '../../generated/wspace-types';
2
+ export interface StewardsListState {
3
+ /** `null` shows every status. */
4
+ statusFilter: BotmanorStewardStatus | null;
5
+ setStatusFilter: (status: BotmanorStewardStatus | null) => void;
6
+ }
7
+ /**
8
+ * One store per mounted `StewardsRoot` — never a module-level singleton, so two
9
+ * shells (or two mounts in one shell) never share list state.
10
+ */
11
+ export declare function createStewardsStore(initialStatus?: BotmanorStewardStatus | null): import('zustand').StoreApi<StewardsListState>;
12
+ export type StewardsStore = ReturnType<typeof createStewardsStore>;
@@ -0,0 +1,11 @@
1
+ import { createStore as e } from "../../node_modules/zustand/esm/vanilla.js";
2
+ // src/stewards/store/stewardsStore.ts
3
+ function t(t = null) {
4
+ return e()((e) => ({
5
+ statusFilter: t,
6
+ setStatusFilter: (t) => e({ statusFilter: t })
7
+ }));
8
+ }
9
+ export { t as createStewardsStore };
10
+
11
+ //# sourceMappingURL=stewardsStore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stewardsStore.js","names":["createStewardsStore","createStore","initialStatus","set"],"sources":["../../../src/stewards/store/stewardsStore.ts"],"sourcesContent":["import { createStore } from 'zustand/vanilla';\nimport { BotmanorStewardStatus } from '../../generated/wspace-types';\n\nexport interface StewardsListState {\n /** `null` shows every status. */\n statusFilter: BotmanorStewardStatus | null;\n setStatusFilter: (status: BotmanorStewardStatus | null) => void;\n}\n\n/**\n * One store per mounted `StewardsRoot` — never a module-level singleton, so two\n * shells (or two mounts in one shell) never share list state.\n */\nexport function createStewardsStore(initialStatus: BotmanorStewardStatus | null = null) {\n return createStore<StewardsListState>()((set) => ({\n statusFilter: initialStatus,\n setStatusFilter: (statusFilter) => set({ statusFilter }),\n }));\n}\n\nexport type StewardsStore = ReturnType<typeof createStewardsStore>;\n"],"mappings":";;AAaA,SAAgBA,EAAoB,IAA8C,MAAM;CACtF,OAAOC,EAA+B,CAAC,EAAE,OAAS;EAChD,cAAcC;EACd,kBAAkB,MAAiBC,EAAI,EAAE,gBAAa,CAAC;CACzD,EAAE;AACJ"}
@@ -0,0 +1,15 @@
1
+ import { MicrofrontendRootProps } from '@burdenoff/fe-libs/shared/types';
2
+ import { ListBotmanorStewardsQuery } from '../../generated/wspace-operations';
3
+ /**
4
+ * Props the host shell passes to `StewardsRoot`.
5
+ *
6
+ * `basePath` and `navigate` come from the shared microfrontend contract. No
7
+ * GraphQL client is passed: the MFE uses the host's Apollo client through the
8
+ * React context the shell already provides.
9
+ */
10
+ export interface StewardsRootProps extends MicrofrontendRootProps {
11
+ /** Workspace the stewards belong to (the gateway scopes every call to it). */
12
+ workspaceId?: string;
13
+ }
14
+ /** One row of the stewards list, exactly as `ListBotmanorStewards` returns it. */
15
+ export type StewardListItem = ListBotmanorStewardsQuery['listBotmanorStewards'][number];