@burdenoff/microfe-bigconsole 2026.1118.7 → 2026.1118.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.
@@ -0,0 +1,102 @@
1
+ import { LintableBoard, LintFix } from './boardLint';
2
+ /** The page fields Board Lint needs. */
3
+ export interface SavedBoardPage {
4
+ id: string;
5
+ name: string;
6
+ }
7
+ /** The widget fields Board Lint needs; a store `Widget` satisfies this. */
8
+ export interface SavedBoardWidget {
9
+ id: string;
10
+ pageId: string;
11
+ type: string;
12
+ title: string;
13
+ config: Record<string, unknown>;
14
+ position?: {
15
+ x: number;
16
+ y: number;
17
+ width: number;
18
+ height: number;
19
+ } | null;
20
+ dataSinkId?: string | null;
21
+ dataSourceId?: string | null;
22
+ parserId?: string | null;
23
+ datasetId?: string | null;
24
+ savedQueryId?: string | null;
25
+ /**
26
+ * Whether the widget has a data source by the app's own rule (see `widgetDataSourcePolicy`). When given it
27
+ * decides the "not connected" note; otherwise the ids above are used.
28
+ */
29
+ connected?: boolean | null;
30
+ }
31
+ export interface SavedBoard {
32
+ board: LintableBoard;
33
+ /** `widgetIds[i]` is the saved widget behind flat widget index `i` (the index a `LintFix` carries). */
34
+ widgetIds: string[];
35
+ }
36
+ /** The part of `updateWidget`'s input that a lint fix (or its undo) can touch. */
37
+ export interface SavedWidgetUpdate {
38
+ id: string;
39
+ title: string;
40
+ config: Record<string, unknown>;
41
+ }
42
+ /** One setting a fix changed: whether it existed, what it was, and what the fix set it to. */
43
+ export interface SavedSettingChange {
44
+ key: string;
45
+ had: boolean;
46
+ before: unknown;
47
+ after: unknown;
48
+ }
49
+ /** Exactly what a fix changed on one widget: enough to take back that, and only that. */
50
+ export interface SavedWidgetUndo {
51
+ id: string;
52
+ title: {
53
+ before: string;
54
+ after: string;
55
+ } | null;
56
+ settings: SavedSettingChange[];
57
+ }
58
+ export interface SavedWidgetUpdatePlan {
59
+ /** What to send to apply the fix. */
60
+ update: SavedWidgetUpdate;
61
+ /** What the fix changed, for Undo. */
62
+ undo: SavedWidgetUndo;
63
+ }
64
+ export type SavedWidgetRestore = {
65
+ ok: true;
66
+ update: SavedWidgetUpdate;
67
+ }
68
+ /** `gone`: the widget no longer exists. `changed`: someone changed what the fix had set, so Undo would erase it. */
69
+ | {
70
+ ok: false;
71
+ reason: 'gone' | 'changed';
72
+ };
73
+ /** Describe a saved dashboard to Board Lint. Widgets whose page is not in `pages` are left out. */
74
+ export declare function buildSavedBoard(pages: readonly SavedBoardPage[], widgets: Iterable<SavedBoardWidget>): SavedBoard;
75
+ /**
76
+ * True when the widget at `widgetIndex` is the same saved widget in both boards. A fix names its widget by
77
+ * position, so before applying one to a freshly fetched board, confirm the position still points where the
78
+ * review said it did. Widgets added, removed or moved since then change the answer, and the fix is refused
79
+ * instead of editing the wrong widget.
80
+ */
81
+ export declare function isSameWidgetAt(shown: SavedBoard | null, current: SavedBoard, widgetIndex: number): boolean;
82
+ /**
83
+ * Plan a fix again against a fresher copy of the board. A fix is planned from the board on screen and can carry
84
+ * whole arrays (colour rules, columns); applying it to a widget that has since changed would overwrite those
85
+ * edits. Re-planning rebuilds it from the current settings. Returns null when the problem is gone, or the fix
86
+ * has no rule to re-plan from, so nothing is written.
87
+ */
88
+ export declare function replanFix(fix: LintFix, board: LintableBoard): LintFix | null;
89
+ /**
90
+ * Turn a planned fix into the update that applies it and a record of exactly what it changed. Returns null when
91
+ * the widget behind the fix is gone (for example deleted while the review was open), so nothing is written.
92
+ *
93
+ * `config` is sent whole, the same way the widget editors save it: the fix's overrides are merged over the
94
+ * current config.
95
+ */
96
+ export declare function planSavedWidgetUpdate(fix: LintFix, widgetIds: readonly string[], widgets: ReadonlyMap<string, SavedBoardWidget>): SavedWidgetUpdatePlan | null;
97
+ /**
98
+ * Plan Undo against the widget as it is now. Only the title and settings the fix changed are put back, so
99
+ * anything else edited since stays. If one of those has itself been changed again, Undo would erase that newer
100
+ * edit, so it is refused instead.
101
+ */
102
+ export declare function planSavedWidgetRestore(undo: SavedWidgetUndo, current: SavedBoardWidget | undefined): SavedWidgetRestore;
@@ -0,0 +1,100 @@
1
+ import { lintBoard as e, planLintFix as t } from "./boardLint.js";
2
+ // src/bigconsole/utils/savedBoardLint.ts
3
+ function n(e, t) {
4
+ let n = e.position?.y ?? 0, r = t.position?.y ?? 0;
5
+ if (n !== r) return n - r;
6
+ let i = e.position?.x ?? 0, a = t.position?.x ?? 0;
7
+ return i === a ? e.id.localeCompare(t.id) : i - a;
8
+ }
9
+ function r(e) {
10
+ return {
11
+ title: e.title,
12
+ type: e.type,
13
+ config: e.config,
14
+ position: e.position ?? null,
15
+ dataSinkId: e.dataSinkId ?? null,
16
+ dataSourceId: e.dataSourceId ?? null,
17
+ parserId: e.parserId ?? null,
18
+ connected: e.connected ?? !!(e.dataSinkId || e.dataSourceId || e.parserId || e.datasetId || e.savedQueryId)
19
+ };
20
+ }
21
+ function i(e, t) {
22
+ let i = Array.from(t), a = [];
23
+ return {
24
+ board: { pages: e.map((e) => {
25
+ let t = i.filter((t) => t.pageId === e.id).sort(n);
26
+ for (let e of t) a.push(e.id);
27
+ return {
28
+ name: e.name,
29
+ widgets: t.map(r)
30
+ };
31
+ }) },
32
+ widgetIds: a
33
+ };
34
+ }
35
+ function a(e, t, n) {
36
+ if (!e) return !1;
37
+ let r = e.widgetIds[n];
38
+ return r !== void 0 && t.widgetIds[n] === r;
39
+ }
40
+ function o(e, t) {
41
+ if (e === t) return !0;
42
+ if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
43
+ if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) && e.length === t.length && e.every((e, n) => o(e, t[n]));
44
+ let n = Object.entries(e), r = new Map(Object.entries(t));
45
+ return n.length === r.size && n.every(([e, t]) => r.has(e) && o(t, r.get(e)));
46
+ }
47
+ function s(n, r) {
48
+ if (!n.ruleId) return null;
49
+ let i = e(r).find((e) => e.ruleId === n.ruleId && e.widgetFlatIndex === n.widgetIndex);
50
+ return i ? t(r, i) : null;
51
+ }
52
+ function c(e, t, n) {
53
+ let r = t[e.widgetIndex], i = r === void 0 ? void 0 : n.get(r);
54
+ if (!i) return null;
55
+ let a = e.configOverrides ?? {};
56
+ return {
57
+ update: {
58
+ id: i.id,
59
+ title: e.title ?? i.title,
60
+ config: {
61
+ ...i.config,
62
+ ...a
63
+ }
64
+ },
65
+ undo: {
66
+ id: i.id,
67
+ title: e.title !== void 0 && e.title !== i.title ? {
68
+ before: i.title,
69
+ after: e.title
70
+ } : null,
71
+ settings: Object.entries(a).map(([e, t]) => ({
72
+ key: e,
73
+ had: e in i.config,
74
+ before: i.config[e],
75
+ after: t
76
+ }))
77
+ }
78
+ };
79
+ }
80
+ function l(e, t) {
81
+ if (!t) return {
82
+ ok: !1,
83
+ reason: "gone"
84
+ };
85
+ if (e.title && t.title !== e.title.after || e.settings.some((e) => !o(t.config[e.key], e.after))) return {
86
+ ok: !1,
87
+ reason: "changed"
88
+ };
89
+ let n = new Set(e.settings.filter((e) => !e.had).map((e) => e.key)), r = Object.fromEntries(Object.entries(t.config).filter(([e]) => !n.has(e)));
90
+ for (let t of e.settings) t.had && (r[t.key] = t.before);
91
+ return {
92
+ ok: !0,
93
+ update: {
94
+ id: t.id,
95
+ title: e.title ? e.title.before : t.title,
96
+ config: r
97
+ }
98
+ };
99
+ }
100
+ export { i as buildSavedBoard, a as isSameWidgetAt, l as planSavedWidgetRestore, c as planSavedWidgetUpdate, s as replanFix };
@@ -447,8 +447,18 @@ export type BigConsoleEmitWidgetEventInput = {
447
447
  };
448
448
  /** Dashboard export options */
449
449
  export type BigConsoleExportDashboardOptions = {
450
- /** Include data source reference information (default: false) */
450
+ /**
451
+ * Include data source references (default: false). When true, widget bindings
452
+ * are written as stable keys (data sink key, parser output key) that an import
453
+ * resolves in the target workspace. When false, the file carries no data source
454
+ * or workspace identifiers at all.
455
+ */
451
456
  includeDataSourceRefs?: boolean | null | undefined;
457
+ /**
458
+ * Include the exportedAt timestamp (default: true). Turn off for diff-stable
459
+ * files: two exports of an unchanged dashboard are then byte-identical.
460
+ */
461
+ includeExportedAt?: boolean | null | undefined;
452
462
  /**
453
463
  * Include webhook mappings (default: false). Requires permission to edit the
454
464
  * dashboard and a current export consent grant in the x-consent-* headers.
@@ -1494,6 +1504,13 @@ export type GetCommentsInput = {
1494
1504
  };
1495
1505
  /** Dashboard import input */
1496
1506
  export type ImportBigConsoleDashboardInput = {
1507
+ /**
1508
+ * What to do when a live dashboard with the same name already exists (default: RENAME).
1509
+ * RENAME imports under a free "name (imported)" name. FAIL refuses with E_DASHBOARD_NAME_EXISTS.
1510
+ * OVERWRITE archives the existing dashboard (restorable with restoreDashboard) and imports under the
1511
+ * exact name. The other enum values are not supported for import.
1512
+ */
1513
+ conflictResolution?: BigConsoleConflictResolution | null | undefined;
1497
1514
  /** JSON content of the export file */
1498
1515
  content: string;
1499
1516
  /** Override dashboard name (optional) */
@@ -1585,7 +1602,12 @@ export type SandboxResourcesInput = {
1585
1602
  memoryLimit?: string | null | undefined;
1586
1603
  memoryRequest?: string | null | undefined;
1587
1604
  };
1588
- export type SandboxSource = 'AI_ASSISTANT' | 'DOCS_BUILDER' | 'MANUAL' | 'SYSTEM' | 'WORKFLOW';
1605
+ export type SandboxSource = 'AI_ASSISTANT'
1606
+ /**
1607
+ * Background agent-job work, such as a proactive review (BOFF-13197). Set by the service only:
1608
+ * createSandbox treats it as MANUAL. Not counted against the workspace environment quota.
1609
+ */
1610
+ | 'BACKGROUND' | 'DOCS_BUILDER' | 'MANUAL' | 'SYSTEM' | 'WORKFLOW';
1589
1611
  export type SandboxStatus = 'EXPIRED' | 'FAILED' | 'PENDING' | 'PROVISIONING' | 'RUNNING' | 'STOPPED' | 'STOPPING';
1590
1612
  export type SandboxStorageInput = {
1591
1613
  /**
@@ -1600,6 +1622,8 @@ export type SandboxStorageInput = {
1600
1622
  sizeGi?: number | null | undefined;
1601
1623
  };
1602
1624
  export type SandboxTemplate = 'AI_BUILDER'
1625
+ /** One Code-node run in Ruby, Go or Bash (BOFF-12106), as startSandboxCodeRun creates it. */
1626
+ | 'CODE_RUNTIME'
1603
1627
  /** One coding-agent job (BOFF-9968). Created only by startSandboxAgentJob. */
1604
1628
  | 'CODING_AGENT' | 'CUSTOM' | 'DOCS_BUILDER' | 'MISC_SHELL' | 'VIBECONTROLS' | 'WORKFLOW_MULTI_NODE';
1605
1629
  /** Standard sort order */