@burdenoff/microfe-botmanor 2026.1120.21 → 2026.1120.23

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 (62) hide show
  1. package/dist/botlit/BotmanorRootInner.js +46 -45
  2. package/dist/botlit/BotmanorRootInner.js.map +1 -1
  3. package/dist/botlit/components/A2ACardVerificationCard.d.ts +8 -0
  4. package/dist/botlit/components/A2ACardVerificationCard.js +123 -0
  5. package/dist/botlit/components/A2ACardVerificationCard.js.map +1 -0
  6. package/dist/botlit/components/A2ARunCollaborationPanel.d.ts +4 -0
  7. package/dist/botlit/components/A2ARunCollaborationPanel.js +149 -0
  8. package/dist/botlit/components/A2ARunCollaborationPanel.js.map +1 -0
  9. package/dist/botlit/components/A2AVerificationBadge.d.ts +4 -0
  10. package/dist/botlit/components/A2AVerificationBadge.js +37 -0
  11. package/dist/botlit/components/A2AVerificationBadge.js.map +1 -0
  12. package/dist/botlit/components/AgentA2APanel.js +85 -73
  13. package/dist/botlit/components/AgentA2APanel.js.map +1 -1
  14. package/dist/botlit/components/PlanUsageCard.d.ts +2 -0
  15. package/dist/botlit/components/PlanUsageCard.js +79 -0
  16. package/dist/botlit/components/PlanUsageCard.js.map +1 -0
  17. package/dist/botlit/components/QuotaExhaustedDialog.d.ts +14 -3
  18. package/dist/botlit/components/QuotaExhaustedDialog.js +33 -13
  19. package/dist/botlit/components/QuotaExhaustedDialog.js.map +1 -1
  20. package/dist/botlit/hooks/index.d.ts +1 -1
  21. package/dist/botlit/hooks/useA2A.d.ts +36 -0
  22. package/dist/botlit/hooks/useA2A.js +154 -109
  23. package/dist/botlit/hooks/useA2A.js.map +1 -1
  24. package/dist/botlit/hooks/useA2APlan.d.ts +8 -0
  25. package/dist/botlit/hooks/useA2APlan.js +24 -0
  26. package/dist/botlit/hooks/useA2APlan.js.map +1 -0
  27. package/dist/botlit/hooks/usePlanUsage.d.ts +19 -0
  28. package/dist/botlit/hooks/usePlanUsage.js +45 -0
  29. package/dist/botlit/hooks/usePlanUsage.js.map +1 -0
  30. package/dist/botlit/pages/A2AAgentDetailPage.js +384 -342
  31. package/dist/botlit/pages/A2AAgentDetailPage.js.map +1 -1
  32. package/dist/botlit/pages/A2ARegistryPage.js +148 -140
  33. package/dist/botlit/pages/A2ARegistryPage.js.map +1 -1
  34. package/dist/botlit/pages/BotDetailPage.js +4 -4
  35. package/dist/botlit/pages/DashboardPage.js +151 -149
  36. package/dist/botlit/pages/DashboardPage.js.map +1 -1
  37. package/dist/botlit/pages/ExecutionDetailPage.js +172 -170
  38. package/dist/botlit/pages/ExecutionDetailPage.js.map +1 -1
  39. package/dist/botlit/providers/QuotaGuard.d.ts +2 -0
  40. package/dist/botlit/providers/QuotaGuard.js +51 -0
  41. package/dist/botlit/providers/QuotaGuard.js.map +1 -0
  42. package/dist/botlit/providers/quotaGuardContext.d.ts +11 -0
  43. package/dist/botlit/providers/quotaGuardContext.js +9 -0
  44. package/dist/botlit/providers/quotaGuardContext.js.map +1 -0
  45. package/dist/botlit/utils/a2aRunCollaboration.d.ts +37 -0
  46. package/dist/botlit/utils/a2aRunCollaboration.js +42 -0
  47. package/dist/botlit/utils/a2aRunCollaboration.js.map +1 -0
  48. package/dist/botlit/utils/a2aVerificationStatus.d.ts +11 -0
  49. package/dist/botlit/utils/a2aVerificationStatus.js +18 -0
  50. package/dist/botlit/utils/a2aVerificationStatus.js.map +1 -0
  51. package/dist/botlit/utils/quotaErrors.d.ts +48 -0
  52. package/dist/botlit/utils/quotaErrors.js +118 -0
  53. package/dist/botlit/utils/quotaErrors.js.map +1 -0
  54. package/dist/botlit/utils/watchPlanLimits.d.ts +12 -0
  55. package/dist/botlit/utils/watchPlanLimits.js +27 -0
  56. package/dist/botlit/utils/watchPlanLimits.js.map +1 -0
  57. package/dist/generated/wspace-operations.d.ts +211 -0
  58. package/dist/generated/wspace-operations.js +206 -114
  59. package/dist/generated/wspace-operations.js.map +1 -1
  60. package/dist/generated/wspace-types.d.ts +74 -1
  61. package/dist/generated/wspace-types.js.map +1 -1
  62. package/package.json +1 -1
@@ -0,0 +1,24 @@
1
+ import { CheckA2APlanQuotaDocument as e } from "../../generated/wspace-operations.js";
2
+ import { useWorkspaceId as t, useWorkspaceQuery as n } from "./internal/workspaceGateway.js";
3
+ import { useMemo as r } from "react";
4
+ // src/botlit/hooks/useA2APlan.ts
5
+ function i(e) {
6
+ return e ? e.allowed || e.noLimit || !e.assignmentId ? "allowed" : "exhausted" : "unknown";
7
+ }
8
+ function a() {
9
+ let a = t(), o = r(() => ({ workspaceId: a ?? "" }), [a]), s = n({
10
+ document: e,
11
+ variables: o,
12
+ select: (e) => i(e?.checkWorkspaceQuota),
13
+ fallback: "unknown",
14
+ enabled: !!a,
15
+ errorMessage: "Failed to check the A2A plan allowance"
16
+ });
17
+ return {
18
+ allowance: s.error ? "unknown" : s.data,
19
+ loading: s.loading
20
+ };
21
+ }
22
+ export { i as readA2APlanAllowance, a as useA2APlanAllowance };
23
+
24
+ //# sourceMappingURL=useA2APlan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useA2APlan.js","names":["readA2APlanAllowance","check","useA2APlanAllowance","workspaceId","useWorkspaceId","variables","useMemo","result","useWorkspaceQuery","CheckA2APlanQuotaDocument","data"],"sources":["../../../src/botlit/hooks/useA2APlan.ts"],"sourcesContent":["/**\n * A2A plan allowance (BOFF-15360)\n * @module botlit/hooks\n *\n * Agent-to-agent orchestration is a plan dimension\n * (`botmanor.a2a.orchestrations.count`). The service refuses a delegation\n * only when the workspace has a quota assignment for it with nothing left;\n * a workspace without an assignment is not metered. This hook reads the same\n * check so the A2A tab can say so before agents are connected.\n */\n\nimport { useMemo } from 'react';\nimport {\n CheckA2APlanQuotaDocument,\n type CheckA2APlanQuotaQuery,\n} from '../../generated/wspace-operations';\nimport { useWorkspaceId, useWorkspaceQuery } from './internal/workspaceGateway';\n\nexport type A2APlanAllowance = 'allowed' | 'exhausted' | 'unknown';\n\n/** Reads the quota check the way the delegation service applies it. */\nexport function readA2APlanAllowance(\n check: CheckA2APlanQuotaQuery['checkWorkspaceQuota'] | null | undefined\n): A2APlanAllowance {\n if (!check) return 'unknown';\n if (check.allowed || check.noLimit || !check.assignmentId) return 'allowed';\n return 'exhausted';\n}\n\nexport function useA2APlanAllowance(): { allowance: A2APlanAllowance; loading: boolean } {\n const workspaceId = useWorkspaceId();\n const variables = useMemo(() => ({ workspaceId: workspaceId ?? '' }), [workspaceId]);\n const result = useWorkspaceQuery<CheckA2APlanQuotaQuery, A2APlanAllowance>({\n document: CheckA2APlanQuotaDocument,\n variables,\n select: (data) => readA2APlanAllowance(data?.checkWorkspaceQuota),\n fallback: 'unknown',\n enabled: Boolean(workspaceId),\n // A failed check is not a refusal: the panel just shows no warning.\n errorMessage: 'Failed to check the A2A plan allowance',\n });\n return { allowance: result.error ? 'unknown' : result.data, loading: result.loading };\n}\n"],"mappings":";;;;AAqBA,SAAgBA,EACd,GACkB;CAGlB,OAFKC,IACDA,EAAM,WAAWA,EAAM,WAAW,CAACA,EAAM,eAAqB,YAC3D,cAFY;AAGrB;AAEA,SAAgBC,IAAyE;CACvF,IAAMC,IAAcC,EAAe,GAC7BC,IAAYC,SAAe,EAAE,aAAaH,KAAe,GAAG,IAAI,CAACA,CAAW,CAAC,GAC7EI,IAASC,EAA4D;EACzE,UAAUC;EACV;EACA,SAAS,MAAST,EAAqBU,GAAM,mBAAmB;EAChE,UAAU;EACV,SAAS,EAAQP;EAEjB,cAAc;CAChB,CAAC;CACD,OAAO;EAAE,WAAWI,EAAO,QAAQ,YAAYA,EAAO;EAAM,SAASA,EAAO;CAAQ;AACtF"}
@@ -0,0 +1,19 @@
1
+ import { BotmanorPlanUsageQuery } from '../../generated/wspace-operations';
2
+ import { BotmanorQuotaKey } from '../utils/quotaErrors';
3
+ import { QueryResult } from './internal/workspaceGateway';
4
+ export interface PlanAllowance {
5
+ quotaName: string;
6
+ /** Known BotManor allowance, or undefined for a quota this build has no label for. */
7
+ key: BotmanorQuotaKey | undefined;
8
+ used: number;
9
+ /** null = unlimited. */
10
+ limit: number | null;
11
+ /** NEVER | DAILY | MONTHLY. */
12
+ resetPeriod: string;
13
+ lastResetAt: string | null;
14
+ }
15
+ type Row = BotmanorPlanUsageQuery['workspaceQuotaOverview'][number];
16
+ /** Folds the overview rows into one allowance per quota. */
17
+ export declare function toPlanAllowances(rows: readonly Row[]): PlanAllowance[];
18
+ export declare function usePlanUsage(): QueryResult<PlanAllowance[]>;
19
+ export {};
@@ -0,0 +1,45 @@
1
+ import { BotmanorPlanUsageDocument as e } from "../../generated/wspace-operations.js";
2
+ import { quotaKeyOfName as t } from "../utils/quotaErrors.js";
3
+ import { useWorkspaceId as n, useWorkspaceQuery as r } from "./internal/workspaceGateway.js";
4
+ import { useMemo as i } from "react";
5
+ // src/botlit/hooks/usePlanUsage.ts
6
+ var a = {
7
+ bots: 0,
8
+ runs: 1,
9
+ messages: 2,
10
+ knowledgeBases: 3,
11
+ mcpServers: 4,
12
+ aiCredits: 5
13
+ }, o = Object.keys(a).length, s = [];
14
+ function c(e) {
15
+ let n = /* @__PURE__ */ new Map();
16
+ for (let r of e) {
17
+ let { assignment: e } = r;
18
+ if (!e.isActive || e.productId !== "botmanor") continue;
19
+ let i = Number.isFinite(r.effectiveUsed) ? r.effectiveUsed : e.used, a = e.noLimit ? null : e.limit ?? 0, o = n.get(e.quotaName);
20
+ o ? (o.used += i, o.limit = o.limit === null || a === null ? null : o.limit + a) : n.set(e.quotaName, {
21
+ quotaName: e.quotaName,
22
+ key: t(e.quotaName),
23
+ used: i,
24
+ limit: a,
25
+ resetPeriod: e.resetPeriod,
26
+ lastResetAt: e.lastResetAt ?? null
27
+ });
28
+ }
29
+ let r = (e) => e.key ? a[e.key] : o;
30
+ return [...n.values()].sort((e, t) => r(e) - r(t) || e.quotaName.localeCompare(t.quotaName));
31
+ }
32
+ function l() {
33
+ let t = n(), a = i(() => t ? { workspaceId: t } : void 0, [t]);
34
+ return r({
35
+ document: e,
36
+ variables: a,
37
+ select: (e) => c(e?.workspaceQuotaOverview ?? []),
38
+ fallback: s,
39
+ enabled: !!t,
40
+ errorMessage: "Failed to load your plan usage"
41
+ });
42
+ }
43
+ export { c as toPlanAllowances, l as usePlanUsage };
44
+
45
+ //# sourceMappingURL=usePlanUsage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePlanUsage.js","names":["RANK","UNRANKED","EMPTY","toPlanAllowances","byName","row","rows","assignment","used","limit","existing","quotaKeyOfName","rank","allowance","a","b","usePlanUsage","workspaceId","useWorkspaceId","variables","useMemo","useWorkspaceQuery","BotmanorPlanUsageDocument","data"],"sources":["../../../src/botlit/hooks/usePlanUsage.ts"],"sourcesContent":["/**\n * BotManor plan allowances (BOFF-15484)\n * @module botlit/hooks\n *\n * The workspace's BotManor quotas from `workspaceQuotaOverview`, filtered to\n * product `botmanor` on the server: what the plan allows, what has been used\n * and when the counter resets. Only active assignments count; a quota with\n * several assignments (stacked subscriptions) is summed.\n */\n\nimport { useMemo } from 'react';\n\nimport {\n BotmanorPlanUsageDocument,\n type BotmanorPlanUsageQuery,\n} from '../../generated/wspace-operations';\nimport { quotaKeyOfName, type BotmanorQuotaKey } from '../utils/quotaErrors';\nimport { useWorkspaceId, useWorkspaceQuery, type QueryResult } from './internal/workspaceGateway';\n\nexport interface PlanAllowance {\n quotaName: string;\n /** Known BotManor allowance, or undefined for a quota this build has no label for. */\n key: BotmanorQuotaKey | undefined;\n used: number;\n /** null = unlimited. */\n limit: number | null;\n /** NEVER | DAILY | MONTHLY. */\n resetPeriod: string;\n lastResetAt: string | null;\n}\n\n/**\n * Display rank on the plan card; quotas without a known key follow, by name.\n * A Record, so adding a BotmanorQuotaKey without a rank fails to compile.\n */\nconst RANK: Record<BotmanorQuotaKey, number> = {\n bots: 0,\n runs: 1,\n messages: 2,\n knowledgeBases: 3,\n mcpServers: 4,\n aiCredits: 5,\n};\nconst UNRANKED = Object.keys(RANK).length;\n\nconst EMPTY: PlanAllowance[] = [];\n\ntype Row = BotmanorPlanUsageQuery['workspaceQuotaOverview'][number];\n\n/** Folds the overview rows into one allowance per quota. */\nexport function toPlanAllowances(rows: readonly Row[]): PlanAllowance[] {\n const byName = new Map<string, PlanAllowance>();\n for (const row of rows) {\n const { assignment } = row;\n if (!assignment.isActive || assignment.productId !== 'botmanor') continue;\n const used = Number.isFinite(row.effectiveUsed) ? row.effectiveUsed : assignment.used;\n const limit = assignment.noLimit ? null : (assignment.limit ?? 0);\n const existing = byName.get(assignment.quotaName);\n if (!existing) {\n byName.set(assignment.quotaName, {\n quotaName: assignment.quotaName,\n key: quotaKeyOfName(assignment.quotaName),\n used,\n limit,\n resetPeriod: assignment.resetPeriod,\n lastResetAt: assignment.lastResetAt ?? null,\n });\n continue;\n }\n existing.used += used;\n existing.limit = existing.limit === null || limit === null ? null : existing.limit + limit;\n }\n const rank = (allowance: PlanAllowance) => (allowance.key ? RANK[allowance.key] : UNRANKED);\n return [...byName.values()].sort(\n (a, b) => rank(a) - rank(b) || a.quotaName.localeCompare(b.quotaName)\n );\n}\n\nexport function usePlanUsage(): QueryResult<PlanAllowance[]> {\n const workspaceId = useWorkspaceId();\n const variables = useMemo(() => (workspaceId ? { workspaceId } : undefined), [workspaceId]);\n return useWorkspaceQuery<BotmanorPlanUsageQuery, PlanAllowance[]>({\n document: BotmanorPlanUsageDocument,\n variables,\n select: (data) => toPlanAllowances(data?.workspaceQuotaOverview ?? []),\n fallback: EMPTY,\n enabled: Boolean(workspaceId),\n errorMessage: 'Failed to load your plan usage',\n });\n}\n"],"mappings":";;;;;AAmCA,IAAMA,IAAyC;CAC7C,MAAM;CACN,MAAM;CACN,UAAU;CACV,gBAAgB;CAChB,YAAY;CACZ,WAAW;AACb,GACMC,IAAW,OAAO,KAAKD,CAAI,CAAC,CAAC,QAE7BE,IAAyB,CAAC;AAKhC,SAAgBC,EAAiB,GAAuC;CACtE,IAAMC,oBAAS,IAAI,IAA2B;CAC9C,KAAK,IAAMC,KAAOC,GA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