@burdenoff/microfe-bigconsole 2026.1012.7 → 2026.1012.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bigconsole/assistant/assistantRunPersistence.d.ts +1 -5
- package/dist/bigconsole/assistant/assistantRunPersistence.js +2 -1
- package/dist/bigconsole/assistant/assistantRunStore.d.ts +9 -6
- package/dist/bigconsole/assistant/assistantRunStore.js +21 -5
- package/dist/bigconsole/assistant/usePreviewWidgetDashboard.d.ts +9 -0
- package/dist/bigconsole/assistant/usePreviewWidgetDashboard.js +75 -0
- package/dist/bigconsole/components/DrilldownDashboardRenderer.d.ts +3 -0
- package/dist/bigconsole/components/DrilldownDashboardRenderer.js +106 -88
- package/dist/bigconsole/components/preview/AiPreviewContent.d.ts +4 -2
- package/dist/bigconsole/components/preview/AiPreviewContent.js +121 -93
- package/dist/bigconsole/components/preview/AiPreviewPanel.js +114 -94
- package/dist/bigconsole/components/preview/confirmedPreviewWidgets.d.ts +5 -0
- package/dist/bigconsole/components/preview/confirmedPreviewWidgets.js +27 -0
- package/dist/bigconsole/customWidget/CustomWidgetProposalPanel.js +198 -196
- package/dist/bigconsole/customWidget/proposalSource.d.ts +3 -1
- package/dist/bigconsole/customWidget/proposalSource.js +42 -28
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomWidgetProposal } from './proposalContract';
|
|
1
|
+
import { CustomWidgetProposal, ProposableWidgetType } from './proposalContract';
|
|
2
2
|
|
|
3
3
|
/** A sink the current user may bind to, as the panel knows it. */
|
|
4
4
|
export interface ProposalCandidateSink {
|
|
@@ -33,6 +33,8 @@ export interface CustomWidgetProposalSource {
|
|
|
33
33
|
readonly id: string;
|
|
34
34
|
propose(request: ProposalRequest): Promise<CustomWidgetProposal>;
|
|
35
35
|
}
|
|
36
|
+
/** Keep shared human edits while removing mappings the new renderer cannot use. */
|
|
37
|
+
export declare function changeProposalWidgetType(proposal: CustomWidgetProposal, widgetType: ProposableWidgetType): CustomWidgetProposal;
|
|
36
38
|
/**
|
|
37
39
|
* Derives a proposal from the prompt and the workspace's real, permitted sinks
|
|
38
40
|
* and parsers. Deterministic, so the review UI and its tests behave predictably.
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import { PROPOSABLE_WIDGET_TYPES as e } from "./proposalContract.js";
|
|
1
2
|
//#region src/bigconsole/customWidget/proposalSource.ts
|
|
2
|
-
function
|
|
3
|
+
function t(e) {
|
|
3
4
|
return e.filter((e) => !e.deletedAt && e.isActive !== !1).map(({ id: e, key: t, name: n }) => ({
|
|
4
5
|
id: e,
|
|
5
6
|
key: t,
|
|
6
7
|
name: n
|
|
7
8
|
}));
|
|
8
9
|
}
|
|
9
|
-
var
|
|
10
|
+
var n = [
|
|
10
11
|
{
|
|
11
12
|
type: "funnel_chart",
|
|
12
13
|
words: [
|
|
@@ -65,7 +66,7 @@ var t = [
|
|
|
65
66
|
"graph"
|
|
66
67
|
]
|
|
67
68
|
}
|
|
68
|
-
],
|
|
69
|
+
], r = [
|
|
69
70
|
{
|
|
70
71
|
chartType: "bar",
|
|
71
72
|
words: ["bar"]
|
|
@@ -92,17 +93,17 @@ var t = [
|
|
|
92
93
|
]
|
|
93
94
|
}
|
|
94
95
|
];
|
|
95
|
-
function
|
|
96
|
-
let
|
|
97
|
-
for (let { type: e, words: r } of
|
|
96
|
+
function i(e) {
|
|
97
|
+
let t = e.toLowerCase();
|
|
98
|
+
for (let { type: e, words: r } of n) if (r.some((e) => t.includes(e))) return e;
|
|
98
99
|
return "chart";
|
|
99
100
|
}
|
|
100
|
-
function
|
|
101
|
+
function a(e) {
|
|
101
102
|
let t = e.toLowerCase();
|
|
102
|
-
for (let { chartType: e, words:
|
|
103
|
+
for (let { chartType: e, words: n } of r) if (n.some((e) => t.includes(e))) return e;
|
|
103
104
|
return "line";
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
+
function o(e, t) {
|
|
106
107
|
if (t.length === 0) return;
|
|
107
108
|
let n = e.toLowerCase().split(/[^a-z0-9]+/).filter((e) => e.length > 2), r;
|
|
108
109
|
for (let e of t) {
|
|
@@ -114,7 +115,7 @@ function a(e, t) {
|
|
|
114
115
|
}
|
|
115
116
|
return r?.sink ?? t[0];
|
|
116
117
|
}
|
|
117
|
-
function
|
|
118
|
+
function s(e) {
|
|
118
119
|
switch (e) {
|
|
119
120
|
case "heatmap": return {
|
|
120
121
|
xAxisField: "column",
|
|
@@ -138,7 +139,20 @@ function o(e) {
|
|
|
138
139
|
};
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
|
-
function
|
|
142
|
+
function c(t, n) {
|
|
143
|
+
if (t.widgetType === n) return t;
|
|
144
|
+
let r = s(n), i = Object.fromEntries(Object.entries(r).map(([e, n]) => [e, t.fieldMapping[e] ?? n])), a = new Set(e.flatMap((e) => Object.keys(s(e)))), o = new Set([...a].filter((e) => !Object.hasOwn(r, e)));
|
|
145
|
+
return {
|
|
146
|
+
...t,
|
|
147
|
+
widgetType: n,
|
|
148
|
+
fieldMapping: i,
|
|
149
|
+
presentation: {
|
|
150
|
+
...t.presentation,
|
|
151
|
+
config: Object.fromEntries(Object.entries(t.presentation.config).filter(([e]) => !o.has(e)))
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
function l(e, t) {
|
|
142
156
|
let n = {
|
|
143
157
|
showLegend: !0,
|
|
144
158
|
showTooltip: !0
|
|
@@ -146,7 +160,7 @@ function s(e, t) {
|
|
|
146
160
|
switch (e) {
|
|
147
161
|
case "chart": return {
|
|
148
162
|
...n,
|
|
149
|
-
chartType:
|
|
163
|
+
chartType: a(t),
|
|
150
164
|
showGrid: !0
|
|
151
165
|
};
|
|
152
166
|
case "funnel_chart": return {
|
|
@@ -173,37 +187,37 @@ function s(e, t) {
|
|
|
173
187
|
default: return n;
|
|
174
188
|
}
|
|
175
189
|
}
|
|
176
|
-
function
|
|
190
|
+
function u(e) {
|
|
177
191
|
let t = e.trim().replace(/^(please\s+)?(create|build|make|add|show me|show|give me)\s+(an?\s+|the\s+)?/i, "").split(/[.;\n]/)[0].trim();
|
|
178
192
|
if (!t) return "Custom widget";
|
|
179
193
|
let n = t.charAt(0).toUpperCase() + t.slice(1);
|
|
180
194
|
return n.length > 60 ? `${n.slice(0, 57)}…` : n;
|
|
181
195
|
}
|
|
182
|
-
var
|
|
196
|
+
var d = 0, f = {
|
|
183
197
|
id: "local-heuristic-v1",
|
|
184
198
|
async propose({ prompt: e, sinks: t, parsers: n }) {
|
|
185
|
-
let
|
|
186
|
-
return
|
|
199
|
+
let r = i(e), a = o(e, t), c = a ? n.find((e) => e.inputSinkKey === a.key) : void 0;
|
|
200
|
+
return d += 1, {
|
|
187
201
|
version: "1.0",
|
|
188
|
-
id: `proposal-${
|
|
202
|
+
id: `proposal-${d}`,
|
|
189
203
|
sourcePrompt: e,
|
|
190
|
-
generatedBy:
|
|
191
|
-
widgetType:
|
|
204
|
+
generatedBy: f.id,
|
|
205
|
+
widgetType: r,
|
|
192
206
|
binding: {
|
|
193
|
-
dataSinkId:
|
|
194
|
-
dataSinkKey:
|
|
195
|
-
parserId:
|
|
196
|
-
parserName:
|
|
207
|
+
dataSinkId: a?.id ?? "",
|
|
208
|
+
dataSinkKey: a?.key,
|
|
209
|
+
parserId: c?.id,
|
|
210
|
+
parserName: c?.name
|
|
197
211
|
},
|
|
198
|
-
fieldMapping:
|
|
212
|
+
fieldMapping: s(r),
|
|
199
213
|
presentation: {
|
|
200
|
-
title:
|
|
214
|
+
title: u(e),
|
|
201
215
|
description: `Generated from: "${e}"`,
|
|
202
|
-
config:
|
|
216
|
+
config: l(r, e)
|
|
203
217
|
},
|
|
204
|
-
rationale:
|
|
218
|
+
rationale: a ? `Matched DataSink "${a.key}"${c ? ` and parser "${c.name}"` : " (no parser found for this sink)"}.` : "No DataSink is available in this workspace — create one before saving this widget."
|
|
205
219
|
};
|
|
206
220
|
}
|
|
207
221
|
};
|
|
208
222
|
//#endregion
|
|
209
|
-
export {
|
|
223
|
+
export { c as changeProposalWidgetType, f as localProposalSource, t as selectActiveProposalSinks };
|