@burdenoff/fe-libs 2026.1016.3 → 2026.1017.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 (31) hide show
  1. package/README.md +25 -1
  2. package/dist/shared/assistant/i18nManifest.d.ts +1 -0
  3. package/dist/shared/assistant/i18nManifest.js +1 -0
  4. package/dist/shared/assistant/speech/hostedTtsSpeechEngine.d.ts +6 -0
  5. package/dist/shared/assistant/speech/hostedTtsSpeechEngine.js +118 -101
  6. package/dist/shared/assistant/speech/notifyCancellationSpeechEngine.js +3 -0
  7. package/dist/shared/assistant/speech/routingSpeechEngine.js +11 -8
  8. package/dist/shared/assistant/speech/types.d.ts +11 -0
  9. package/dist/shared/assistant/ui/AssistantMessageItem.js +110 -100
  10. package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts +10 -0
  11. package/dist/shared/assistant/ui/AssistantSpeechProvider.js +278 -261
  12. package/dist/shared/assistant/ui/useVoiceSession.js +222 -227
  13. package/dist/shared/assistant/voice/handsfree/playbackReference.d.ts +15 -4
  14. package/dist/shared/assistant/voice/handsfree/playbackReference.js +9 -6
  15. package/dist/shared/pages/AiPage.d.ts +0 -8
  16. package/dist/shared/pages/AiPage.js +126 -72
  17. package/dist/shared/pages/ai/CatalogPanel.d.ts +9 -0
  18. package/dist/shared/pages/ai/CatalogPanel.js +80 -0
  19. package/dist/shared/pages/ai/ReadNotice.d.ts +4 -0
  20. package/dist/shared/pages/ai/ReadNotice.js +18 -0
  21. package/dist/shared/pages/ai/SummaryPanel.d.ts +7 -0
  22. package/dist/shared/pages/ai/SummaryPanel.js +135 -0
  23. package/dist/shared/pages/ai/contracts.d.ts +45 -0
  24. package/dist/shared/pages/ai/contracts.js +159 -0
  25. package/dist/shared/pages/ai/i18n.d.ts +1 -0
  26. package/dist/shared/pages/ai/i18n.js +10 -0
  27. package/dist/shared/pages/ai/useAiRead.d.ts +18 -0
  28. package/dist/shared/pages/ai/useAiRead.js +57 -0
  29. package/dist/shared/utils/mockData.js +212 -0
  30. package/dist/shared-assistant.js +270 -270
  31. package/package.json +1 -5
@@ -0,0 +1,159 @@
1
+ import { gql as e } from "@apollo/client/core";
2
+ //#region src/shared/pages/ai/contracts.ts
3
+ var t = e`
4
+ query AiOperationsModels($pagination: PaginationInput!) {
5
+ promptModels(pagination: $pagination) {
6
+ items {
7
+ id
8
+ key
9
+ displayName
10
+ modality
11
+ isActive
12
+ deprecatedAt
13
+ supportsTools
14
+ supportsStreaming
15
+ supportsVision
16
+ }
17
+ total
18
+ hasMore
19
+ }
20
+ }
21
+ `, n = e`
22
+ query AiOperationsProviders($pagination: PaginationInput!) {
23
+ promptProviders(pagination: $pagination) {
24
+ items {
25
+ id
26
+ key
27
+ displayName
28
+ kind
29
+ isActive
30
+ }
31
+ total
32
+ hasMore
33
+ }
34
+ }
35
+ `, r = e`
36
+ query AiOperationsSummary($from: DateTime!, $to: DateTime!, $productKey: String!) {
37
+ promptUsageSummaryV2(from: $from, to: $to, productKey: $productKey) {
38
+ workspaceId
39
+ from
40
+ to
41
+ scope
42
+ productKey
43
+ operationKey
44
+ origin
45
+ currency
46
+ costKind
47
+ operations
48
+ attempts
49
+ pendingAttempts
50
+ knownAttempts
51
+ partialAttempts
52
+ unknownAttempts
53
+ inputTokens {
54
+ knownSubtotal
55
+ knownAttempts
56
+ missingAttempts
57
+ }
58
+ outputTokens {
59
+ knownSubtotal
60
+ knownAttempts
61
+ missingAttempts
62
+ }
63
+ totalTokens {
64
+ knownSubtotal
65
+ knownAttempts
66
+ missingAttempts
67
+ }
68
+ costMicroUsd {
69
+ knownSubtotal
70
+ knownAttempts
71
+ missingAttempts
72
+ }
73
+ }
74
+ }
75
+ `;
76
+ function i(e) {
77
+ if (!e || typeof e != "object" || Array.isArray(e)) throw Error("AI_READ_SHAPE");
78
+ return Object.fromEntries(Object.entries(e));
79
+ }
80
+ function a(e) {
81
+ if (typeof e != "string" || !e.length) throw Error("AI_READ_SHAPE");
82
+ return e;
83
+ }
84
+ function o(e) {
85
+ if (typeof e != "boolean") throw Error("AI_READ_SHAPE");
86
+ return e;
87
+ }
88
+ function s(e) {
89
+ if (typeof e != "string" || e.trim() !== e || e.length > 200 || !/^(0|[1-9][0-9]*)$/.test(e)) throw Error("AI_READ_INTEGER");
90
+ return e;
91
+ }
92
+ function c(e, t) {
93
+ let n = i(i(e)[t === "models" ? "promptModels" : "promptProviders"]);
94
+ if (!Array.isArray(n.items) || n.items.length > 20 || typeof n.total != "number" || !Number.isSafeInteger(n.total) || n.total < 0) throw Error("AI_READ_SHAPE");
95
+ let r = n.items.map((e) => {
96
+ let n = i(e), r = t === "models" && n.deprecatedAt !== null;
97
+ return r && a(n.deprecatedAt), {
98
+ id: a(n.id),
99
+ key: a(n.key),
100
+ displayName: a(n.displayName),
101
+ isActive: o(n.isActive),
102
+ detail: a(t === "models" ? n.modality : n.kind),
103
+ deprecated: r
104
+ };
105
+ });
106
+ if (new Set(r.map((e) => e.id)).size !== r.length) throw Error("AI_READ_SHAPE");
107
+ let s = o(n.hasMore);
108
+ if (r.length > n.total || s && r.length === 0) throw Error("AI_READ_SHAPE");
109
+ return {
110
+ items: r,
111
+ total: n.total,
112
+ hasMore: s
113
+ };
114
+ }
115
+ function l(e, t, n, r) {
116
+ let o = i(i(e).promptUsageSummaryV2);
117
+ if (o.workspaceId !== t || o.productKey !== n || o.operationKey !== null || o.scope !== "RECORDED_V2_ATTEMPTS" || o.origin !== "CALLER_REPORTED" || o.currency !== "USD" || o.costKind !== "ESTIMATE" || Date.parse(a(o.from)) !== Date.parse(r.from) || Date.parse(a(o.to)) !== Date.parse(r.to)) throw Error("AI_READ_SCOPE");
118
+ let c = s(o.attempts), l = s(o.knownAttempts), u = s(o.partialAttempts), d = s(o.unknownAttempts), f = s(o.pendingAttempts), p = s(o.operations);
119
+ if (BigInt(l) + BigInt(u) + BigInt(d) !== BigInt(c) || BigInt(f) > BigInt(d) || BigInt(p) > BigInt(c)) throw Error("AI_READ_COUNTS");
120
+ let m = (e) => {
121
+ let t = i(e), n = s(t.knownAttempts), r = s(t.missingAttempts), a = t.knownSubtotal === null ? null : s(t.knownSubtotal);
122
+ if (BigInt(n) + BigInt(r) !== BigInt(c) || n === "0" != (a === null)) throw Error("AI_READ_COUNTS");
123
+ return {
124
+ knownSubtotal: a,
125
+ knownAttempts: n,
126
+ missingAttempts: r
127
+ };
128
+ };
129
+ return {
130
+ operations: p,
131
+ attempts: c,
132
+ pendingAttempts: f,
133
+ knownAttempts: l,
134
+ partialAttempts: u,
135
+ unknownAttempts: d,
136
+ inputTokens: m(o.inputTokens),
137
+ outputTokens: m(o.outputTokens),
138
+ totalTokens: m(o.totalTokens),
139
+ costMicroUsd: m(o.costMicroUsd)
140
+ };
141
+ }
142
+ function u(e, t) {
143
+ return new Intl.NumberFormat(t).format(BigInt(s(e)));
144
+ }
145
+ function d(e, t) {
146
+ let n = s(e).padStart(7, "0"), r = new Intl.NumberFormat(t).formatToParts(1.1).find((e) => e.type === "decimal")?.value ?? ".", i = new Intl.NumberFormat(t, {
147
+ useGrouping: !1,
148
+ minimumIntegerDigits: 6
149
+ }).format(BigInt(n.slice(-6)));
150
+ return `USD ${u(n.slice(0, -6).replace(/^0+(?=.)/, ""), t)}${r}${i}`;
151
+ }
152
+ function f(e = /* @__PURE__ */ new Date()) {
153
+ return {
154
+ from: (/* @__PURE__ */ new Date(e.getTime() - 7 * 864e5)).toISOString(),
155
+ to: e.toISOString()
156
+ };
157
+ }
158
+ //#endregion
159
+ export { t as MODELS, n as PROVIDERS, r as SUMMARY, c as catalog, u as exactInteger, d as exactUsd, f as sevenDays, l as summary };
@@ -0,0 +1 @@
1
+ export declare function useAiTr(): (key: string, fallback: string, params?: Record<string, string | number>) => string;
@@ -0,0 +1,10 @@
1
+ import { interpolate as e } from "../../providers/shell/interpolate.js";
2
+ import { useOptionalI18n as t } from "../../providers/shell/I18nProvider.js";
3
+ import { useCallback as n } from "react";
4
+ //#region src/shared/pages/ai/i18n.ts
5
+ function r() {
6
+ let r = t();
7
+ return n((t, n, i) => r ? r.t(`ai.operations.${t}`, n, i) : e(n, i ?? {}), [r]);
8
+ }
9
+ //#endregion
10
+ export { r as useAiTr };
@@ -0,0 +1,18 @@
1
+ import { ApolloClient, DocumentNode } from '@apollo/client/core';
2
+ export type ReadAccess = 'ready' | 'loading' | 'denied' | 'unavailable';
3
+ export interface ReadScope {
4
+ workspaceId: string;
5
+ actorId: string;
6
+ profileId: string | null;
7
+ /** In-memory identity boundary only; never serialized, logged or persisted. */
8
+ accessToken: string | null;
9
+ workspaceToken: string | null;
10
+ }
11
+ export type ReadState<T> = {
12
+ status: 'ready';
13
+ data: T;
14
+ } | {
15
+ status: 'loading' | 'denied' | 'unavailable' | 'error';
16
+ };
17
+ /** No cache writes/deduplication: a previous identity's result cannot be reused. */
18
+ export declare function useAiRead<T>(client: ApolloClient, scope: ReadScope, access: ReadAccess, query: DocumentNode, variables: Record<string, unknown>, parse: (value: unknown) => T, revision?: number): ReadState<T>;
@@ -0,0 +1,57 @@
1
+ import { useEffect as e, useMemo as t, useState as n } from "react";
2
+ //#region src/shared/pages/ai/useAiRead.ts
3
+ function r(r, i, a, o, s, c, l = 0) {
4
+ let u = t(() => ({
5
+ client: r,
6
+ scope: i,
7
+ access: a,
8
+ query: o,
9
+ variables: s,
10
+ parse: c,
11
+ revision: l
12
+ }), [
13
+ r,
14
+ i,
15
+ a,
16
+ o,
17
+ s,
18
+ c,
19
+ l
20
+ ]), [d, f] = n(null);
21
+ return e(() => {
22
+ if (a !== "ready") return;
23
+ let e = new AbortController();
24
+ return r.query({
25
+ query: o,
26
+ variables: s,
27
+ fetchPolicy: "no-cache",
28
+ errorPolicy: "none",
29
+ context: {
30
+ queryDeduplication: !1,
31
+ fetchOptions: { signal: e.signal }
32
+ }
33
+ }).then((t) => {
34
+ e.signal.aborted || f({
35
+ identity: u,
36
+ state: {
37
+ status: "ready",
38
+ data: c(t.data)
39
+ }
40
+ });
41
+ }).catch(() => {
42
+ e.signal.aborted || f({
43
+ identity: u,
44
+ state: { status: "error" }
45
+ });
46
+ }), () => e.abort();
47
+ }, [
48
+ r,
49
+ a,
50
+ o,
51
+ s,
52
+ c,
53
+ u
54
+ ]), a === "ready" ? d?.identity === u ? d.state : { status: "loading" } : { status: a };
55
+ }
56
+ //#endregion
57
+ export { r as useAiRead };
@@ -0,0 +1,212 @@
1
+ //#region src/shared/utils/mockData.ts
2
+ var e = [
3
+ {
4
+ id: "fluidgrids",
5
+ name: "FluidGrids",
6
+ icon: "FG",
7
+ color: "#3b82f6",
8
+ url: "https://app.fluidgrids.com"
9
+ },
10
+ {
11
+ id: "bigconsole",
12
+ name: "BigConsole",
13
+ icon: "BC",
14
+ color: "#8b5cf6",
15
+ url: "https://app.bigconsole.com"
16
+ },
17
+ {
18
+ id: "workspaces",
19
+ name: "Workspaces",
20
+ icon: "WS",
21
+ color: "#06b6d4",
22
+ url: "https://app.burdenoff.com"
23
+ },
24
+ {
25
+ id: "vibecontrols",
26
+ name: "VibeControls",
27
+ icon: "VC",
28
+ color: "#10b981",
29
+ url: "https://app.vibecontrols.com"
30
+ },
31
+ {
32
+ id: "botlit",
33
+ name: "BotManor",
34
+ icon: "BL",
35
+ color: "#f59e0b",
36
+ url: "https://app.botmanor.com"
37
+ }
38
+ ], t = [
39
+ {
40
+ code: "en",
41
+ name: "English",
42
+ nativeName: "English",
43
+ flag: "🇺🇸"
44
+ },
45
+ {
46
+ code: "es",
47
+ name: "Spanish",
48
+ nativeName: "Español",
49
+ flag: "🇪🇸"
50
+ },
51
+ {
52
+ code: "fr",
53
+ name: "French",
54
+ nativeName: "Français",
55
+ flag: "🇫🇷"
56
+ },
57
+ {
58
+ code: "de",
59
+ name: "German",
60
+ nativeName: "Deutsch",
61
+ flag: "🇩🇪"
62
+ },
63
+ {
64
+ code: "ja",
65
+ name: "Japanese",
66
+ nativeName: "日本語",
67
+ flag: "🇯🇵"
68
+ },
69
+ {
70
+ code: "zh",
71
+ name: "Chinese",
72
+ nativeName: "中文",
73
+ flag: "🇨🇳"
74
+ },
75
+ {
76
+ code: "ta",
77
+ name: "Tamil",
78
+ nativeName: "தமிழ்",
79
+ flag: "🇮🇳"
80
+ },
81
+ {
82
+ code: "hi",
83
+ name: "Hindi",
84
+ nativeName: "हिन्दी",
85
+ flag: "🇮🇳"
86
+ },
87
+ {
88
+ code: "ko",
89
+ name: "Korean",
90
+ nativeName: "한국어",
91
+ flag: "🇰🇷"
92
+ }
93
+ ], n = [
94
+ {
95
+ id: "org-1",
96
+ name: "Acme Corporation",
97
+ slug: "acme-corp",
98
+ tenantId: "tenant-1"
99
+ },
100
+ {
101
+ id: "org-2",
102
+ name: "TechStart Inc.",
103
+ slug: "techstart",
104
+ tenantId: "tenant-2"
105
+ },
106
+ {
107
+ id: "org-3",
108
+ name: "GlobalEdge Ltd.",
109
+ slug: "globaledge",
110
+ tenantId: "tenant-3"
111
+ }
112
+ ], r = [
113
+ {
114
+ id: "ws-1",
115
+ name: "Product Engineering",
116
+ organizationId: "org-1",
117
+ slug: "product-eng"
118
+ },
119
+ {
120
+ id: "ws-2",
121
+ name: "Marketing",
122
+ organizationId: "org-1",
123
+ slug: "marketing"
124
+ },
125
+ {
126
+ id: "ws-3",
127
+ name: "Design Studio",
128
+ organizationId: "org-1",
129
+ slug: "design-studio"
130
+ },
131
+ {
132
+ id: "ws-4",
133
+ name: "R&D Lab",
134
+ organizationId: "org-2",
135
+ slug: "rd-lab"
136
+ },
137
+ {
138
+ id: "ws-5",
139
+ name: "Operations",
140
+ organizationId: "org-2",
141
+ slug: "operations"
142
+ },
143
+ {
144
+ id: "ws-6",
145
+ name: "Client Projects",
146
+ organizationId: "org-3",
147
+ slug: "client-projects"
148
+ }
149
+ ], i = [
150
+ {
151
+ id: "proj-1",
152
+ name: "Platform V2",
153
+ workspaceId: "ws-1",
154
+ slug: "platform-v2"
155
+ },
156
+ {
157
+ id: "proj-2",
158
+ name: "Mobile App",
159
+ workspaceId: "ws-1",
160
+ slug: "mobile-app"
161
+ },
162
+ {
163
+ id: "proj-3",
164
+ name: "API Gateway",
165
+ workspaceId: "ws-1",
166
+ slug: "api-gateway"
167
+ },
168
+ {
169
+ id: "proj-4",
170
+ name: "Q1 Campaign",
171
+ workspaceId: "ws-2",
172
+ slug: "q1-campaign"
173
+ },
174
+ {
175
+ id: "proj-5",
176
+ name: "Brand Refresh",
177
+ workspaceId: "ws-2",
178
+ slug: "brand-refresh"
179
+ },
180
+ {
181
+ id: "proj-6",
182
+ name: "Design System",
183
+ workspaceId: "ws-3",
184
+ slug: "design-system"
185
+ },
186
+ {
187
+ id: "proj-7",
188
+ name: "UX Research",
189
+ workspaceId: "ws-3",
190
+ slug: "ux-research"
191
+ },
192
+ {
193
+ id: "proj-8",
194
+ name: "ML Pipeline",
195
+ workspaceId: "ws-4",
196
+ slug: "ml-pipeline"
197
+ },
198
+ {
199
+ id: "proj-9",
200
+ name: "Infra Automation",
201
+ workspaceId: "ws-5",
202
+ slug: "infra-automation"
203
+ },
204
+ {
205
+ id: "proj-10",
206
+ name: "Client Portal",
207
+ workspaceId: "ws-6",
208
+ slug: "client-portal"
209
+ }
210
+ ];
211
+ //#endregion
212
+ export { t as mockLanguages, n as mockOrganizations, e as mockProducts, i as mockProjects, r as mockWorkspaces };