@burdenoff/microfe-bigconsole 2026.1005.2 → 2026.1005.4
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordAdapters.d.ts","sourceRoot":"","sources":["../../../src/bigconsole/assistant/recordAdapters.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"recordAdapters.d.ts","sourceRoot":"","sources":["../../../src/bigconsole/assistant/recordAdapters.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,2DAA2D,CAAC;AACnE,OAAO,EAAwB,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAEvF,0FAA0F;AAC1F,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAE1C,eAAO,MAAM,uBAAuB,gNAMnC,CAAC;AAEF,eAAO,MAAM,uBAAuB,oMAMnC,CAAC;AAEF,gGAAgG;AAChG,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,OAAO,YAAY,CAAC;IAClC,cAAc,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;CACrC;AAiKD,wBAAgB,8BAA8B,CAAC,IAAI,GAAE,iBAA6B,GAAG,SAAS,sBAAsB,EAAE,CAuBrH;AAED,eAAO,MAAM,0BAA0B,EAAE,SAAS,sBAAsB,EAAqC,CAAC"}
|
|
@@ -2,41 +2,57 @@ import { getStoredWorkspaceId as e, graphqlFetch as t } from "@burdenoff/fe-libs
|
|
|
2
2
|
var n = "\n query AssistantFindDashboards($search: String, $first: Int) {\n listDashboards(search: $search, first: $first, includeArchived: false) {\n edges { node { id name workspaceId } }\n }\n }\n", r = "\n query AssistantFindDataSinks($search: String, $first: Int) {\n listDataSinks(search: $search, first: $first) {\n edges { node { id name key workspaceId deletedAt } }\n }\n }\n", i = {
|
|
3
3
|
graphqlFetch: t,
|
|
4
4
|
getWorkspaceId: e
|
|
5
|
+
}, a = (e) => e.normalize("NFKC").toLowerCase().replace(/[^\p{L}\p{N}\s]/gu, " ").replace(/\s+/g, " ").trim(), o = (e) => [...new Set(e.split(" ").filter((e) => e.length > 0))].sort((e, t) => [...t].length - [...e].length), s = (e) => {
|
|
6
|
+
let t = e.filter((e) => [...e].length >= 3);
|
|
7
|
+
return t.length > 0 ? t : e.filter((e) => [...e].length === 2);
|
|
5
8
|
};
|
|
6
|
-
async function
|
|
7
|
-
let
|
|
8
|
-
if (!
|
|
9
|
-
let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
let u = [];
|
|
27
|
-
for (let e of l) {
|
|
28
|
-
let t = e?.node;
|
|
29
|
-
if (!t || typeof t.id != "string" || t.id.length === 0 || typeof t.workspaceId == "string" && t.workspaceId !== s) continue;
|
|
30
|
-
let n = o(t);
|
|
31
|
-
n !== null && u.push({
|
|
32
|
-
params: { id: t.id },
|
|
33
|
-
name: n
|
|
9
|
+
async function c(e, t, n, r, i, c, l) {
|
|
10
|
+
let u = e.getWorkspaceId();
|
|
11
|
+
if (!u) return [];
|
|
12
|
+
let d = a(i), f = o(d);
|
|
13
|
+
if (f.length === 0) return [];
|
|
14
|
+
let [p, m] = s(f), h = async (i) => {
|
|
15
|
+
if (c.aborted) return null;
|
|
16
|
+
let a = await e.graphqlFetch({
|
|
17
|
+
gateway: "workspace",
|
|
18
|
+
query: t,
|
|
19
|
+
operationName: n,
|
|
20
|
+
variables: {
|
|
21
|
+
search: i,
|
|
22
|
+
first: 10
|
|
23
|
+
},
|
|
24
|
+
workspaceToken: !0,
|
|
25
|
+
workspaceId: u,
|
|
26
|
+
organizationId: !0,
|
|
27
|
+
signal: c,
|
|
28
|
+
suppressGlobalErrorEvent: !0
|
|
34
29
|
});
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
if (a.errors?.length) return null;
|
|
31
|
+
let o = a.data?.[r]?.edges;
|
|
32
|
+
if (!Array.isArray(o)) return null;
|
|
33
|
+
let s = [];
|
|
34
|
+
for (let e of o) {
|
|
35
|
+
let t = e?.node;
|
|
36
|
+
if (!t || typeof t.id != "string" || t.id.length === 0 || typeof t.workspaceId == "string" && t.workspaceId !== u) continue;
|
|
37
|
+
let n = l(t);
|
|
38
|
+
n !== null && s.push({
|
|
39
|
+
params: { id: t.id },
|
|
40
|
+
name: n
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
rows: o.length,
|
|
45
|
+
matches: s
|
|
46
|
+
};
|
|
47
|
+
}, g = (e) => h(e).catch(() => null), _ = (e) => a(e.name) === d, [v, y] = await Promise.all([h(d), p !== void 0 && p !== d ? g(p) : null]);
|
|
48
|
+
if (v === null) return [];
|
|
49
|
+
let b = [...v.matches], x = (e) => {
|
|
50
|
+
for (let t of e?.matches ?? []) _(t) && !b.some((e) => e.params.id === t.params.id) && b.push(t);
|
|
51
|
+
};
|
|
52
|
+
return x(y), y !== null && y.rows >= 10 && !b.some(_) && m !== void 0 && e.getWorkspaceId() === u && x(await g(m)), b;
|
|
37
53
|
}
|
|
38
|
-
var
|
|
39
|
-
function
|
|
54
|
+
var l = (e) => typeof e == "string" && e.trim().length > 0 ? e.trim() : null;
|
|
55
|
+
function u(e = i) {
|
|
40
56
|
return [{
|
|
41
57
|
id: "bigconsole-dashboard",
|
|
42
58
|
nouns: ["dashboard", "dashboards"],
|
|
@@ -45,7 +61,7 @@ function s(e = i) {
|
|
|
45
61
|
fallback: "dashboard"
|
|
46
62
|
},
|
|
47
63
|
entityRouteId: "bigconsole-dashboard",
|
|
48
|
-
find: (t, r) =>
|
|
64
|
+
find: (t, r) => c(e, n, "AssistantFindDashboards", "listDashboards", t, r, (e) => l(e.name))
|
|
49
65
|
}, {
|
|
50
66
|
id: "bigconsole-datasink",
|
|
51
67
|
nouns: [
|
|
@@ -61,11 +77,11 @@ function s(e = i) {
|
|
|
61
77
|
fallback: "data source"
|
|
62
78
|
},
|
|
63
79
|
entityRouteId: "bigconsole-datasink",
|
|
64
|
-
find: (t, n) =>
|
|
80
|
+
find: (t, n) => c(e, r, "AssistantFindDataSinks", "listDataSinks", t, n, (e) => e.deletedAt ? null : l(e.name) ?? l(e.key))
|
|
65
81
|
}];
|
|
66
82
|
}
|
|
67
|
-
var
|
|
83
|
+
var d = u();
|
|
68
84
|
//#endregion
|
|
69
|
-
export {
|
|
85
|
+
export { d as BIGCONSOLE_RECORD_ADAPTERS };
|
|
70
86
|
|
|
71
87
|
//# sourceMappingURL=recordAdapters.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recordAdapters.js","names":[],"sources":["../../../src/bigconsole/assistant/recordAdapters.ts"],"sourcesContent":["/**\n * BigConsole's named-record adapters for the shared assistant (BOFF-8060 N1b):\n * \"open the Coffee Shop Sales dashboard\", \"open the Orders data source\".\n *\n * An adapter only LOOKS A RECORD UP BY NAME through the READ API the product's\n * own list pages already use (`listDashboards`, `listDataSinks`, with their\n * `search` argument), as the signed-in person: the workspace token is theirs and\n * the gateway's `@rbac` filters the list, so a record they may not read never\n * comes back. The adapter produces route params, never a path: fe-libs fills the\n * entity route declared in `assistantProduct.ts` (`ENTITY_ROUTES`) and re-validates\n * it, and only for a person who can see the route's sidebar entry.\n *\n * ★ Raw operation strings, as in `conversationHistoryApi.ts`: two tiny read-only\n * selections used only here. `tests/recordAdapters.test.ts` validates both against\n * the committed workspace schema, so a renamed field fails there, not in prod.\n *\n * ★ Nothing here writes, opens a form, or touches the DOM.\n */\nimport type {\n AssistantRecordAdapter,\n AssistantRecordMatch,\n} from '@burdenoff/fe-libs/shared/assistant/uiActions/recordNames';\nimport { getStoredWorkspaceId, graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\n/** More than a handful of candidates is never offered (the panel offers at most four). */\nexport const RECORD_LOOKUP_PAGE_SIZE = 10;\n\nexport const FIND_DASHBOARDS_BY_NAME = `\n query AssistantFindDashboards($search: String, $first: Int) {\n listDashboards(search: $search, first: $first, includeArchived: false) {\n edges { node { id name workspaceId } }\n }\n }\n`;\n\nexport const FIND_DATA_SINKS_BY_NAME = `\n query AssistantFindDataSinks($search: String, $first: Int) {\n listDataSinks(search: $search, first: $first) {\n edges { node { id name key workspaceId deletedAt } }\n }\n }\n`;\n\n/** The two things the adapters need from the app; injectable so tests run without a network. */\nexport interface RecordAdapterDeps {\n graphqlFetch: typeof graphqlFetch;\n getWorkspaceId: () => string | null;\n}\nconst LIVE_DEPS: RecordAdapterDeps = { graphqlFetch, getWorkspaceId: getStoredWorkspaceId };\n\ninterface RawNode {\n id?: unknown;\n name?: unknown;\n key?: unknown;\n workspaceId?: unknown;\n deletedAt?: unknown;\n}\ntype ListData = Record<string, { edges?: Array<{ node?: RawNode | null } | null> | null } | null | undefined>;\n\n/**\n * Run one list query as the signed-in person and map its nodes to matches.\n * Any failure (no workspace, a GraphQL error, a refusal, an abort) is \"no\n * match\": the sentence then goes to the model exactly as it would have.\n */\nasync function findByName(\n deps: RecordAdapterDeps,\n query: string,\n operationName: string,\n field: string,\n name: string,\n signal: AbortSignal,\n pick: (node: RawNode) => string | null\n): Promise<readonly AssistantRecordMatch[]> {\n const workspaceId = deps.getWorkspaceId();\n if (!workspaceId) return [];\n const result = await deps.graphqlFetch<ListData>({\n gateway: 'workspace',\n query,\n operationName,\n variables: { search: name, first: RECORD_LOOKUP_PAGE_SIZE },\n // The person's own workspace token, minted for THIS workspace.\n workspaceToken: true,\n workspaceId,\n organizationId: true,\n signal,\n suppressGlobalErrorEvent: true,\n });\n if (result.errors?.length) return [];\n const edges = result.data?.[field]?.edges;\n if (!Array.isArray(edges)) return [];\n const matches: AssistantRecordMatch[] = [];\n for (const edge of edges) {\n const node = edge?.node;\n if (!node || typeof node.id !== 'string' || node.id.length === 0) continue;\n // A list answered for another workspace (a switch mid-request) is not used.\n if (typeof node.workspaceId === 'string' && node.workspaceId !== workspaceId) continue;\n const label = pick(node);\n if (label === null) continue;\n matches.push({ params: { id: node.id }, name: label });\n }\n return matches;\n}\n\nconst text = (value: unknown): string | null =>\n typeof value === 'string' && value.trim().length > 0 ? value.trim() : null;\n\nexport function createBigConsoleRecordAdapters(deps: RecordAdapterDeps = LIVE_DEPS): readonly AssistantRecordAdapter[] {\n const dashboards: AssistantRecordAdapter = {\n id: 'bigconsole-dashboard',\n nouns: ['dashboard', 'dashboards'],\n noun: { key: 'entity.dashboard', fallback: 'dashboard' },\n entityRouteId: 'bigconsole-dashboard',\n find: (name, signal) =>\n findByName(deps, FIND_DASHBOARDS_BY_NAME, 'AssistantFindDashboards', 'listDashboards', name, signal, (node) =>\n text(node.name)\n ),\n };\n const dataSinks: AssistantRecordAdapter = {\n id: 'bigconsole-datasink',\n nouns: ['data source', 'data sources', 'data sink', 'data sinks', 'datasink', 'datasinks'],\n noun: { key: 'entity.datasink', fallback: 'data source' },\n entityRouteId: 'bigconsole-datasink',\n find: (name, signal) =>\n findByName(deps, FIND_DATA_SINKS_BY_NAME, 'AssistantFindDataSinks', 'listDataSinks', name, signal, (node) =>\n // A deleted data source is not a page to open; an unnamed one is called by its key.\n node.deletedAt ? null : (text(node.name) ?? text(node.key))\n ),\n };\n return [dashboards, dataSinks];\n}\n\nexport const BIGCONSOLE_RECORD_ADAPTERS: readonly AssistantRecordAdapter[] = createBigConsoleRecordAdapters();\n"],"mappings":";AA2BA,IAAa,IAA0B,+MAQ1B,IAA0B,mMAajC,IAA+B;CAAE;CAAc,gBAAgB;CAAsB;AAgB3F,eAAe,EACb,GACA,GACA,GACA,GACA,GACA,GACA,GAC0C;CAC1C,IAAM,IAAc,EAAK,gBAAgB;AACzC,KAAI,CAAC,EAAa,QAAO,EAAE;CAC3B,IAAM,IAAS,MAAM,EAAK,aAAuB;EAC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D;EACJ,CAC6B;;AAGhC,IAAa,IAAgE,GAAgC"}
|
|
1
|
+
{"version":3,"file":"recordAdapters.js","names":[],"sources":["../../../src/bigconsole/assistant/recordAdapters.ts"],"sourcesContent":["/**\n * BigConsole's named-record adapters for the shared assistant (BOFF-8060 N1b):\n * \"open the Coffee Shop Sales dashboard\", \"open the Orders data source\".\n *\n * An adapter only LOOKS A RECORD UP BY NAME through the READ API the product's\n * own list pages already use (`listDashboards`, `listDataSinks`, with their\n * `search` argument), as the signed-in person: the workspace token is theirs and\n * the gateway's `@rbac` filters the list, so a record they may not read never\n * comes back. The adapter produces route params, never a path: fe-libs fills the\n * entity route declared in `assistantProduct.ts` (`ENTITY_ROUTES`) and re-validates\n * it, and only for a person who can see the route's sidebar entry.\n *\n * ★ Raw operation strings, as in `conversationHistoryApi.ts`: two tiny read-only\n * selections used only here. `tests/recordAdapters.test.ts` validates both against\n * the committed workspace schema, so a renamed field fails there, not in prod.\n *\n * ★ What the server is asked (BOFF-8060 F8). The shared planner hands over a\n * NORMALISED name (lower case, every punctuation mark a space) while the server's\n * `search` is a plain substring match on the RAW name. The WHOLE SENTENCE is what this\n * lookup has always asked, and what it answered stays the answer; but \"boff 7926 embed\n * all widgets prod check\" is not a substring of \"BOFF-7926 embed all widgets (prod\n * check)\", so a name with punctuation is never found by it. ONE WORD has no punctuation\n * or space in it, so it is a substring of the raw name: it is asked in parallel (and at\n * most once more), and ONLY a row whose normalised name equals the sentence exactly is\n * taken from it. The answer is therefore exactly what the old lookup answered, plus the\n * exact names it could not see: a partial row from a one-word page would give the\n * planner candidates the whole sentence never offered (\"an ambiguous name asks, never\n * guesses\"). The matching itself stays with the shared planner.\n *\n * ★ Nothing here writes, opens a form, or touches the DOM.\n */\nimport type {\n AssistantRecordAdapter,\n AssistantRecordMatch,\n} from '@burdenoff/fe-libs/shared/assistant/uiActions/recordNames';\nimport { getStoredWorkspaceId, graphqlFetch } from '@burdenoff/fe-libs/shared/graphql';\n\n/** More than a handful of candidates is never offered (the panel offers at most four). */\nexport const RECORD_LOOKUP_PAGE_SIZE = 10;\n\nexport const FIND_DASHBOARDS_BY_NAME = `\n query AssistantFindDashboards($search: String, $first: Int) {\n listDashboards(search: $search, first: $first, includeArchived: false) {\n edges { node { id name workspaceId } }\n }\n }\n`;\n\nexport const FIND_DATA_SINKS_BY_NAME = `\n query AssistantFindDataSinks($search: String, $first: Int) {\n listDataSinks(search: $search, first: $first) {\n edges { node { id name key workspaceId deletedAt } }\n }\n }\n`;\n\n/** The two things the adapters need from the app; injectable so tests run without a network. */\nexport interface RecordAdapterDeps {\n graphqlFetch: typeof graphqlFetch;\n getWorkspaceId: () => string | null;\n}\nconst LIVE_DEPS: RecordAdapterDeps = { graphqlFetch, getWorkspaceId: getStoredWorkspaceId };\n\ninterface RawNode {\n id?: unknown;\n name?: unknown;\n key?: unknown;\n workspaceId?: unknown;\n deletedAt?: unknown;\n}\ntype ListData = Record<string, { edges?: Array<{ node?: RawNode | null } | null> | null } | null | undefined>;\n\n/**\n * The shared planner's own normalisation (fe-libs `recordNames.ts`, not exported):\n * it is applied to the request and to every record name before they are compared,\n * so the adapter reasons about names exactly as the planner will. Idempotent, so a\n * name that arrives already normalised is unchanged.\n */\nconst normalise = (value: string): string =>\n value\n .normalize('NFKC')\n .toLowerCase()\n .replace(/[^\\p{L}\\p{N}\\s]/gu, ' ')\n .replace(/\\s+/g, ' ')\n .trim();\n\n/**\n * The distinct words of a normalised request, best search term first: the longest\n * (it narrows the server's substring match the most), the earlier word on a tie.\n * `Array.prototype.sort` is stable, so the original order is the tie-break.\n */\nconst searchTerms = (wanted: string): string[] =>\n [...new Set(wanted.split(' ').filter((word) => word.length > 0))].sort((a, b) => [...b].length - [...a].length);\n\n/**\n * The words worth asking the server with on their own, best first (`terms` is longest first, earlier on a tie):\n * those of at least three characters; only if there are none, those of exactly two (\"HR-IT\" is typed \"hr it\").\n * A word of one character is in too many names, so it is never asked alone. A one-word page can only ADD exact\n * names, so a short word costs the planner nothing.\n */\nconst searchWords = (terms: readonly string[]): string[] => {\n const long = terms.filter((word) => [...word].length >= 3);\n return long.length > 0 ? long : terms.filter((word) => [...word].length === 2);\n};\n\n/** One answer of the server: how many rows it sent, and its usable rows as matches, in the server's order. */\ninterface Page {\n rows: number;\n matches: AssistantRecordMatch[];\n}\n\n/**\n * Look a record up by name as the signed-in person and map its nodes to matches.\n *\n * ★ The answer is what the whole-sentence request alone has always answered, plus the\n * exact names it cannot see. The rows of the whole-sentence request are returned\n * unchanged and in order: ONE page of RECORD_LOOKUP_PAGE_SIZE rows, whose partial\n * matches the planner weighs as it always has. A one-word request can only ADD a row\n * whose normalised name equals the sentence exactly (a record that is not deleted and\n * is in this workspace, like any other row); it never adds a partial one.\n *\n * Failure (no workspace, a GraphQL error, a refusal, an abort) of the whole-sentence\n * request is \"no match\": the sentence then goes to the model exactly as it would have.\n * A one-word request that fails or is refused is ignored: it could only have added\n * exact names, and the answer the old lookup gave stands.\n *\n * At most THREE list requests in TWO round trips, usually ONE:\n * Round 1, in parallel:\n * (a) `search` = the whole normalised sentence, as ever;\n * (b) `search` = the longest word, which has no punctuation or space in it, so it is\n * a substring of the raw name whatever punctuation the name has. Only for a\n * sentence of more than one word: its longest word of at least three characters or,\n * if none is that long, its longest word of two (never a word of one character).\n * Round 2, ONE request, only if no exact name has been found, (b) came back full (the\n * exact record may be past it) and the workspace is still the one round 1 asked\n * about: the next distinct word by the same rule.\n * No request is made without `search`, and none once the panel has stopped waiting.\n */\nasync function findByName(\n deps: RecordAdapterDeps,\n query: string,\n operationName: string,\n field: string,\n name: string,\n signal: AbortSignal,\n pick: (node: RawNode) => string | null\n): Promise<readonly AssistantRecordMatch[]> {\n const workspaceId = deps.getWorkspaceId();\n if (!workspaceId) return [];\n const wanted = normalise(name);\n const terms = searchTerms(wanted);\n // Nothing to match: the planner plans a request with no words as \"none\".\n if (terms.length === 0) return [];\n const [best, next] = searchWords(terms);\n\n /** One list request for `search`; `null` is \"no usable answer\". */\n const ask = async (search: string): Promise<Page | null> => {\n // Once the panel has stopped waiting nothing is worth asking.\n if (signal.aborted) return null;\n const result = await deps.graphqlFetch<ListData>({\n gateway: 'workspace',\n query,\n operationName,\n variables: { search, first: RECORD_LOOKUP_PAGE_SIZE },\n // The person's own workspace token, minted for THIS workspace.\n workspaceToken: true,\n workspaceId,\n organizationId: true,\n signal,\n suppressGlobalErrorEvent: true,\n });\n if (result.errors?.length) return null;\n const edges = result.data?.[field]?.edges;\n if (!Array.isArray(edges)) return null;\n const matches: AssistantRecordMatch[] = [];\n for (const edge of edges) {\n const node = edge?.node;\n if (!node || typeof node.id !== 'string' || node.id.length === 0) continue;\n // A list answered for another workspace (a switch mid-request) is not used.\n if (typeof node.workspaceId === 'string' && node.workspaceId !== workspaceId) continue;\n const label = pick(node);\n if (label === null) continue;\n matches.push({ params: { id: node.id }, name: label });\n }\n return { rows: edges.length, matches };\n };\n /** A one-word request never rejects: when it fails there is simply nothing to add. */\n const askWord = (word: string): Promise<Page | null> => ask(word).catch(() => null);\n const isExact = (match: AssistantRecordMatch): boolean => normalise(match.name) === wanted;\n\n // Round 1, in parallel.\n const [whole, word] = await Promise.all([ask(wanted), best !== undefined && best !== wanted ? askWord(best) : null]);\n // As it always was: the whole-sentence request refused or failed is \"no match\".\n if (whole === null) return [];\n\n const answer = [...whole.matches];\n /** Adds the exact names of a one-word page that the answer does not hold yet, and nothing else. */\n const addExact = (page: Page | null): void => {\n for (const match of page?.matches ?? []) {\n if (isExact(match) && !answer.some((known) => known.params.id === match.params.id)) answer.push(match);\n }\n };\n addExact(word);\n\n // Round 2: ONE request, only while the exact record may still be past the one-word page.\n if (\n word !== null &&\n word.rows >= RECORD_LOOKUP_PAGE_SIZE &&\n !answer.some(isExact) &&\n next !== undefined &&\n // a workspace switch since round 1 would make this request (and its answer) about the wrong workspace\n deps.getWorkspaceId() === workspaceId\n ) {\n addExact(await askWord(next));\n }\n return answer;\n}\n\nconst text = (value: unknown): string | null =>\n typeof value === 'string' && value.trim().length > 0 ? value.trim() : null;\n\nexport function createBigConsoleRecordAdapters(deps: RecordAdapterDeps = LIVE_DEPS): readonly AssistantRecordAdapter[] {\n const dashboards: AssistantRecordAdapter = {\n id: 'bigconsole-dashboard',\n nouns: ['dashboard', 'dashboards'],\n noun: { key: 'entity.dashboard', fallback: 'dashboard' },\n entityRouteId: 'bigconsole-dashboard',\n find: (name, signal) =>\n findByName(deps, FIND_DASHBOARDS_BY_NAME, 'AssistantFindDashboards', 'listDashboards', name, signal, (node) =>\n text(node.name)\n ),\n };\n const dataSinks: AssistantRecordAdapter = {\n id: 'bigconsole-datasink',\n nouns: ['data source', 'data sources', 'data sink', 'data sinks', 'datasink', 'datasinks'],\n noun: { key: 'entity.datasink', fallback: 'data source' },\n entityRouteId: 'bigconsole-datasink',\n find: (name, signal) =>\n findByName(deps, FIND_DATA_SINKS_BY_NAME, 'AssistantFindDataSinks', 'listDataSinks', name, signal, (node) =>\n // A deleted data source is not a page to open; an unnamed one is called by its key.\n node.deletedAt ? null : (text(node.name) ?? text(node.key))\n ),\n };\n return [dashboards, dataSinks];\n}\n\nexport const BIGCONSOLE_RECORD_ADAPTERS: readonly AssistantRecordAdapter[] = createBigConsoleRecordAdapters();\n"],"mappings":";AAwCA,IAAa,IAA0B,+MAQ1B,IAA0B,mMAajC,IAA+B;CAAE;CAAc,gBAAgB;CAAsB,EAiBrF,KAAa,MACjB,EACG,UAAU,OAAO,CACjB,aAAa,CACb,QAAQ,qBAAqB,IAAI,CACjC,QAAQ,QAAQ,IAAI,CACpB,MAAM,EAOL,KAAe,MACnB,CAAC,GAAG,IAAI,IAAI,EAAO,MAAM,IAAI,CAAC,QAAQ,MAAS,EAAK,SAAS,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,OAAO,EAQ3G,KAAe,MAAuC;CAC1D,IAAM,IAAO,EAAM,QAAQ,MAAS,CAAC,GAAG,EAAK,CA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 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@burdenoff/microfe-bigconsole",
|
|
3
|
-
"version": "2026.1005.
|
|
3
|
+
"version": "2026.1005.4",
|
|
4
4
|
"description": "BigConsole - AI-powered analytics and dashboard platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@apollo/client": "^4.0.11",
|
|
53
|
-
"@burdenoff/fe-libs": "2026.1005.
|
|
53
|
+
"@burdenoff/fe-libs": "2026.1005.2",
|
|
54
54
|
"@burdenoff/fluidgrids-fe-sdk": "2026.731.4",
|
|
55
55
|
"@iconify/react": "^6.0.2",
|
|
56
56
|
"@monaco-editor/react": "^4.7.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"zustand": "^5.0.3"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@burdenoff/fe-libs": "2026.1005.
|
|
88
|
+
"@burdenoff/fe-libs": "2026.1005.2",
|
|
89
89
|
"@burdenoff/fluidgrids-fe-sdk": "2026.731.4",
|
|
90
90
|
"@eslint/js": "^10.0.1",
|
|
91
91
|
"@graphql-codegen/add": "^5.0.0",
|