react-semaphor 0.1.537 → 0.1.538
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/analytics-protocol/index.js +352 -341
- package/dist/assistant-context/index.js +10 -0
- package/dist/assistant-protocol/index.js +104 -0
- package/dist/brand-studio/index.js +35 -31
- package/dist/briefings/index.js +46 -45
- package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +28 -0
- package/dist/chunks/add-to-dashboard-CxtTfISD.js +56 -0
- package/dist/chunks/aggregate-table-row-presentation-Qgpv6_G8.js +979 -0
- package/dist/chunks/analytics-base-schemas-BFAoRlkU.js +472 -0
- package/dist/chunks/apply-dashboard-operations-C-iahGka.js +402 -0
- package/dist/chunks/assistant-chat-BAqUIFp5.js +7966 -0
- package/dist/chunks/availability-Bp5Gfu1I.js +44 -0
- package/dist/chunks/{bookmark-state-B-I9BDD0.js → bookmark-state-k7y5SNGf.js} +9 -9
- package/dist/chunks/{braces-8TRlDwDw.js → braces-o9UiRQes.js} +1 -1
- package/dist/chunks/calculated-field-identity-DcBS2NPP.js +2161 -0
- package/dist/chunks/calendar-day-equality-Bpl15IBo.js +487 -0
- package/dist/chunks/class-utils-Df1OVOT1.js +2315 -0
- package/dist/chunks/{field-dependencies-CpRUwr9J.js → common-types-CUf03Htv.js} +65 -58
- package/dist/chunks/context-HD9usB1P.js +349 -0
- package/dist/chunks/conversation-sQiWYUOb.js +16 -0
- package/dist/chunks/csv-utils-GUfKyT1J.js +56 -0
- package/dist/chunks/custom-visual-inputs-BrUOIwln.js +3288 -0
- package/dist/chunks/{dashboard-BPJo-Fnd.js → dashboard-DTDDFQsS.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-A2uVpHCp.js → dashboard-briefing-launcher-Bb2QUqOa.js} +764 -740
- package/dist/chunks/{dashboard-controls-DxTuVis_.js → dashboard-controls-FpONU8QV.js} +683 -686
- package/dist/chunks/{common-types-g7yS12Cg.js → dashboard-filter-value-compatibility-D95O4nd7.js} +18 -24
- package/dist/chunks/dashboard-json-DazPhBU_.js +69 -0
- package/dist/chunks/document-dashboard-inputs-D96rlU7S.js +10678 -0
- package/dist/chunks/document-sheet-utils-C1eEldxs.js +1076 -0
- package/dist/chunks/{edit-dashboard-visual-ByV0OwSp.js → edit-dashboard-visual-CIhZodVH.js} +4744 -4746
- package/dist/chunks/editor-draft-sync-BN5qYHPF.js +15 -0
- package/dist/chunks/filter-value-text-BhWugPWE.js +163 -0
- package/dist/chunks/index-CqMiAkay.js +3164 -0
- package/dist/chunks/index-CuHybtft.js +51 -0
- package/dist/chunks/layout-grid-Bgzth8vd.js +16 -0
- package/dist/chunks/{matrix-analytical-definition-CgBTD6H8.js → matrix-analytical-definition-bcprSe4u.js} +1 -1
- package/dist/chunks/{matrix-card-CAdizkUl.js → matrix-card-CJn1hB5V.js} +13 -12
- package/dist/chunks/matrix-definition-DQDI2okF.js +206 -0
- package/dist/chunks/{matrix-formatter-DJCk8Znf.js → matrix-formatter-Bgw32tb3.js} +648 -457
- package/dist/chunks/matrix-member-presentation-BNPSDKBG.js +105 -0
- package/dist/chunks/{matrix-operation-contract-BKupLHXL.js → matrix-operation-contract-B8PBF1Gd.js} +134 -133
- package/dist/chunks/{metric-comparison-BKHyvnAy.js → metric-comparison-CojWeLqx.js} +1 -1
- package/dist/chunks/{palette-Cp1hqZtm.js → palette-D10o_yYX.js} +1 -1
- package/dist/chunks/pivot-header-presentation-MkcKnjn3.js +42 -0
- package/dist/chunks/{pivot-result-identity-Bs4tLtLo.js → pivot-result-identity-D6hhcRXi.js} +1 -1
- package/dist/chunks/pivot-result-lifecycle-8qCDmpKc.js +804 -0
- package/dist/chunks/raw-temporal-D61lr48Y.js +1464 -0
- package/dist/chunks/{raw-temporal-contract-mLFS-9wk.js → raw-temporal-contract-C51YG48G.js} +1 -1
- package/dist/chunks/report-preferences-dialog-BCGs4-AE.js +1808 -0
- package/dist/chunks/{report-runtime-context-CG_I0PPW.js → report-runtime-context-B984Nq1E.js} +8 -7
- package/dist/chunks/save-CfJpQQ68.js +21 -0
- package/dist/chunks/saved-dashboard-context-BrTkjcod.js +566 -0
- package/dist/chunks/{selection-reducer-CiDEtmAq.js → selection-reducer-vKIb_jS6.js} +2 -2
- package/dist/chunks/{semaphor-ready-indicator-CHu1L-lo.js → semaphor-ready-indicator-CHHoWhil.js} +65586 -62749
- package/dist/chunks/{shelf-drop-preview-context-i-H6DFyU.js → shelf-drop-preview-context-EsayECEC.js} +199 -196
- package/dist/chunks/{source-entity-resolution-C-oNyYMp.js → source-entity-resolution-CVA1a85c.js} +8 -8
- package/dist/chunks/switch-CvItuC1Q.js +8199 -0
- package/dist/chunks/{temporal-bucket-DlFuhCnT.js → temporal-bucket-D8JF7zKz.js} +86 -71
- package/dist/chunks/{temporal-bucket-contract-D2OuaVZ7.js → temporal-bucket-contract-DaOajRC7.js} +1 -1
- package/dist/chunks/{token-types-DtSJOUjh.js → token-types-bxUxXDX2.js} +1 -1
- package/dist/chunks/{upload-CAIpsti1.js → upload-BFX7apKV.js} +1 -1
- package/dist/chunks/{use-create-flow-overlay-state-Bj63WwHc.js → use-create-flow-overlay-state-BqA92GkX.js} +331 -339
- package/dist/chunks/{validators-DMSH81OM.js → validators-Ej1DdCXa.js} +1050 -1510
- package/dist/chunks/visual-choice-JiJ-_3bi.js +204 -0
- package/dist/chunks/x-4f5U2XwU.js +100 -0
- package/dist/chunks/{zoned-wall-clock-1qlWCE20.js → zoned-wall-clock-MulfA26h.js} +2 -2
- package/dist/dashboard/index.js +2 -2
- package/dist/dashboard-authoring/index.js +823 -661
- package/dist/data-app-sdk/index.js +32 -30
- package/dist/data-app-sdk-adapters/index.js +23 -22
- package/dist/data-app-sdk-validation/index.js +23 -22
- package/dist/format-utils/index.js +173 -168
- package/dist/index.js +267 -258
- package/dist/layouts/index.js +236 -24
- package/dist/report-runtime-context/index.js +2 -2
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +2 -2
- package/dist/types/assistant-context.d.ts +2 -0
- package/dist/types/assistant-protocol.d.ts +2 -0
- package/dist/types/components/assistant/assistant-entry-points.d.ts +18 -0
- package/dist/types/components/assistant/assistant-provider.d.ts +19 -0
- package/dist/types/components/assistant/assistant-store.d.ts +52 -0
- package/dist/types/components/assistant/use-assistant.d.ts +38 -0
- package/dist/types/components/index.d.ts +5 -1
- package/dist/types/components/surfboard/filter/types.d.ts +5 -2
- package/dist/types/index.js +50 -51
- package/dist/types/lib/api/invalidate-token.d.ts +7 -0
- package/dist/types/lib/charts/cartesian-fields.d.ts +64 -0
- package/dist/types/lib/charts/types.d.ts +7 -0
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +14 -2
- package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +5 -6
- package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +8 -3
- package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +11 -6
- package/dist/types/lib/dashboard-pagination/dashboard-card-pagination.d.ts +7 -0
- package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +79 -0
- package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +3 -2
- package/dist/types/lib/document/document-table-data-policy.d.ts +15 -0
- package/dist/types/lib/filter-values/filter-mode.d.ts +22 -0
- package/dist/types/lib/hooks/use-calendar-context.d.ts +5 -0
- package/dist/types/lib/hooks/use-text-filter.d.ts +7 -0
- package/dist/types/lib/print/print-inputs.d.ts +4 -2
- package/dist/types/lib/query-context/build-card-query-context.d.ts +12 -4
- package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +93 -0
- package/dist/types/lib/query-context/card-server-request.d.ts +72 -0
- package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
- package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +56 -0
- package/dist/types/lib/query-context/document-section-card-query.d.ts +45 -0
- package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +17 -2
- package/dist/types/lib/stores/dashboard-store.d.ts +34 -11
- package/dist/types/lib/stores/editor-store.d.ts +4 -2
- package/dist/types/lib/types/token-types.d.ts +11 -0
- package/dist/types/lib/utils/card-type-change.d.ts +30 -0
- package/dist/types/lib/utils/comparison-window-caption.d.ts +12 -0
- package/dist/types/lib/utils/filter-default-value-utils.d.ts +13 -2
- package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +74 -0
- package/dist/types/shared/analytics-protocol/contracts.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +43 -0
- package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
- package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +1 -1
- package/dist/types/shared/analytics-protocol/visual-choice.d.ts +75 -0
- package/dist/types/shared/assistant-context/index.d.ts +9 -0
- package/dist/types/shared/assistant-context/project-context.d.ts +55 -0
- package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +130 -0
- package/dist/types/shared/assistant-protocol/add-to-dashboard.d.ts +17 -0
- package/dist/types/shared/assistant-protocol/artifact.d.ts +63 -0
- package/dist/types/shared/assistant-protocol/availability.d.ts +39 -0
- package/dist/types/shared/assistant-protocol/context.d.ts +952 -0
- package/dist/types/shared/assistant-protocol/conversation.d.ts +38 -0
- package/dist/types/shared/assistant-protocol/index.d.ts +16 -0
- package/dist/types/shared/assistant-protocol/limits.d.ts +53 -0
- package/dist/types/shared/assistant-protocol/parts.d.ts +131 -0
- package/dist/types/shared/assistant-protocol/request.d.ts +77 -0
- package/dist/types/shared/assistant-protocol/sources.d.ts +27 -0
- package/dist/types/shared/assistant-protocol/token-config.d.ts +32 -0
- package/dist/types/shared/assistant-protocol/transcript.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +112 -0
- package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +1794 -0
- package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
- package/dist/types/shared/dashboard-authoring/new-card.d.ts +10 -0
- package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +40 -0
- package/dist/types/shared/dashboard-authoring/resolved-primary-date-field-validation.d.ts +16 -0
- package/dist/types/shared/format-utils/filter-detail.d.ts +70 -0
- package/dist/types/shared/format-utils/filter-value-text.d.ts +15 -0
- package/dist/types/shared/format-utils/index.d.ts +3 -0
- package/dist/types/shared/format-utils/raw-temporal.d.ts +7 -0
- package/dist/types/shared/format-utils/temporal-bucket.d.ts +7 -0
- package/dist/types/shared/layouts/frame-layouts.d.ts +23 -0
- package/dist/types/shared/layouts/index.d.ts +1 -0
- package/package.json +12 -2
- package/dist/chunks/calculated-field-identity-BptYhyOP.js +0 -1326
- package/dist/chunks/calendar-day-equality-BRjN1S9h.js +0 -383
- package/dist/chunks/card-config-utils-BOM1dxCk.js +0 -1150
- package/dist/chunks/constants-DNWVy8Y3.js +0 -9
- package/dist/chunks/dashboard-json-B1dEQu98.js +0 -65
- package/dist/chunks/field-aggregations-CoLzYHeL.js +0 -1229
- package/dist/chunks/index-DTcTAGGM.js +0 -4101
- package/dist/chunks/matrix-continuation-C4sRcjZU.js +0 -72
- package/dist/chunks/matrix-control-sources-DTqcA2_L.js +0 -636
- package/dist/chunks/matrix-definition-D9iShKZI.js +0 -87
- package/dist/chunks/matrix-member-presentation-Ct8GuxHt.js +0 -209
- package/dist/chunks/numeric-presentation-CWu3gunq.js +0 -537
- package/dist/chunks/pivot-header-presentation-CHs2GFrM.js +0 -753
- package/dist/chunks/pivot-result-lifecycle-DQz_gjGu.js +0 -789
- package/dist/chunks/raw-temporal-iMXRK-Qz.js +0 -930
- package/dist/chunks/report-preferences-dialog-DXPjteCU.js +0 -1623
- package/dist/chunks/save-kO6cIaob.js +0 -34
- package/dist/chunks/semantic-format-DiqYeKwU.js +0 -192
- package/dist/chunks/switch-DO8a0EfJ.js +0 -25004
- package/dist/chunks/temporal-input-presentation-BD7YNUzu.js +0 -195
- package/dist/chunks/x-CXDkqdur.js +0 -149
- package/dist/types/lib/class-utils.d.ts +0 -2
- package/dist/types/lib/document/document-input-runtime.d.ts +0 -26
- package/dist/types/lib/utils.d.ts +0 -51
|
@@ -9,12 +9,12 @@ import { TFilter, TFilterValue } from '../../components/surfboard/filter/types.j
|
|
|
9
9
|
import { TransientInputContext } from '../dashboard-inputs/transient-input-context.js';
|
|
10
10
|
import { MissingPrintInputs } from '../print/print-inputs.js';
|
|
11
11
|
import { default as ReactGridLayout } from 'react-grid-layout';
|
|
12
|
+
import { DashboardFramePlacement } from '../../shared/dashboard-authoring/operations/apply-dashboard-operations.js';
|
|
12
13
|
import { FilterGroup, Field } from '../types/explorer-types.js';
|
|
13
14
|
import { DashboardControlsModelOptions } from '../controls/control-authoring-types.js';
|
|
14
15
|
import { SemanticExecutionPayload } from '../types/semantic-runtime-types.js';
|
|
15
16
|
import { DocumentPanelTarget } from '../document/document-panel-target.js';
|
|
16
17
|
import { DocumentEdit, DocumentEditResult } from '../document/document-edits.js';
|
|
17
|
-
import { DocumentFilterMode } from '../document/document-input-runtime.js';
|
|
18
18
|
import { DashboardInputRuntimeTarget } from '../dashboard-inputs/dashboard-input-values.js';
|
|
19
19
|
import { DashboardFilterMappingAuthoringIssue, DashboardFilterInputAcceptanceResult, DashboardFilterMappingAcceptanceResult, DashboardFilterMappingAuthoringRequest, DashboardFilterMappingDisableResult } from '../dashboard-inputs/dashboard-filter-mapping-authoring.js';
|
|
20
20
|
import { DashboardFilterOptionSource } from '../../shared/dashboard-authoring/index.js';
|
|
@@ -25,10 +25,10 @@ import { ResolvedValueFormatPreferenceSources, ResolvedValueFormatPreferences }
|
|
|
25
25
|
import { DashboardNavigationEntry, DashboardNavigationState, DashboardTransientContextScope, InsightRenderRequest, NavigationRejection } from '../dashboard-navigation/index.js';
|
|
26
26
|
import { CardViewStateMap, DrillStep } from '../dashboard-view-state/index.js';
|
|
27
27
|
import { DashboardCardPaginationState } from '../dashboard-pagination/dashboard-card-pagination.js';
|
|
28
|
+
export declare function mergeSemanticExecutionPayloadIntoTarget(target: SemanticExecutionPayload, incoming?: SemanticExecutionPayload): void;
|
|
28
29
|
type AddFrameOptions = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
copyLayoutFromFrameId?: string;
|
|
30
|
+
/** Default `end`; beside a frame is how a duplicate lands next to its original. */
|
|
31
|
+
placement?: DashboardFramePlacement;
|
|
32
32
|
semanticExecutionPayload?: SemanticExecutionPayload;
|
|
33
33
|
};
|
|
34
34
|
export type FilterDashboardInputDefinitionUpdateMetadata = {
|
|
@@ -87,6 +87,15 @@ export type DashboardStore = {
|
|
|
87
87
|
/** Live edit-session check for host navigation; owned by dashboard controls. */
|
|
88
88
|
checkUnsavedDashboardChanges: (() => boolean) | null;
|
|
89
89
|
isDashboardEditing: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* The dashboard and its semantic payload when editing turned on (Phase 7a,
|
|
92
|
+
* D7-7). The toolbars' "before editing" reads this, so a change made in the
|
|
93
|
+
* same step that turns editing on (Add to dashboard) is an unsaved change.
|
|
94
|
+
*/
|
|
95
|
+
editingStartedWith: {
|
|
96
|
+
dashboard: TDashboard;
|
|
97
|
+
semanticExecutionPayload: SemanticExecutionPayload;
|
|
98
|
+
} | null;
|
|
90
99
|
isVisualEditing: boolean;
|
|
91
100
|
showDashboardJSON: boolean;
|
|
92
101
|
showFilters: boolean;
|
|
@@ -160,24 +169,27 @@ export type DashboardStore = {
|
|
|
160
169
|
};
|
|
161
170
|
export type DocumentInputRuntimeState = {
|
|
162
171
|
filterValuesByInputId: Record<string, TFilterValue | undefined>;
|
|
163
|
-
filterModesByInputId: Record<string, DocumentFilterMode>;
|
|
164
172
|
controlValuesByInputId: Record<string, unknown>;
|
|
165
173
|
};
|
|
166
174
|
type Actions = {
|
|
167
175
|
applyResolvedCalendarPreferences: (resolved: CalendarPreferencesResponse['resolved'], sources: ResolvedCalendarPreferenceSources) => void;
|
|
168
176
|
applyResolvedValueFormatPreferences: (resolved: ResolvedValueFormatPreferences, sources: ResolvedValueFormatPreferenceSources) => void;
|
|
169
177
|
triggerReload: () => void;
|
|
170
|
-
setFilterMode: (filterId: string, filterMode: 'include' | 'exclude') => void;
|
|
171
178
|
setInitStore: () => void;
|
|
172
179
|
setGlobalStyle: (style: TStyle) => void;
|
|
173
|
-
setDefaultFilterValues: (filterValues: TFilterValue[] | undefined) => void;
|
|
174
|
-
setDefaultControlValues: (controlValues: Record<string, unknown> | undefined) => void;
|
|
175
180
|
setDashboardInputs: (inputs: DashboardInput[]) => void;
|
|
176
181
|
upsertDashboardInput: (input: DashboardInput) => void;
|
|
177
182
|
updateFilterDashboardInputDefinition: (inputId: string, filter: TFilter, metadata?: FilterDashboardInputDefinitionUpdateMetadata) => FilterDashboardInputDefinitionUpdateResult;
|
|
178
183
|
acceptDashboardFilterInput: (updatedFilter: TFilter, optionSource: DashboardFilterOptionSource | undefined, settings?: DashboardFilterAuthoringSettingsUpdate, inputMetadata?: {
|
|
179
184
|
variableName?: string;
|
|
180
185
|
}) => DashboardFilterInputAcceptanceResult;
|
|
186
|
+
/**
|
|
187
|
+
* Saves filter settings for a dashboard filter no Input owns: the
|
|
188
|
+
* definition, and through the default-storage owner its live value and
|
|
189
|
+
* saved overlay entry when the default changed (FM-D9). A comparison
|
|
190
|
+
* default keeps its own action (`setDefaultDashboardInputComparisonSelection`).
|
|
191
|
+
*/
|
|
192
|
+
acceptOrdinaryDashboardFilter: (updatedFilter: TFilter, settings?: Pick<DashboardFilterAuthoringSettingsUpdate, 'defaultValueChanged' | 'selectionIdentityChanged' | 'target'>) => void;
|
|
181
193
|
acceptDashboardFilterMapping: (request: DashboardFilterMappingAuthoringRequest, updatedFilter?: TFilter, settings?: DashboardFilterAuthoringSettingsUpdate) => DashboardFilterMappingAcceptanceResult;
|
|
182
194
|
disableDashboardFilterMapping: (filterId: string, updatedFilter?: TFilter, settings?: DashboardFilterAuthoringSettingsUpdate) => DashboardFilterMappingDisableResult;
|
|
183
195
|
removeDashboardInput: (inputId: string) => void;
|
|
@@ -230,6 +242,11 @@ type Actions = {
|
|
|
230
242
|
missingPrintInputs?: MissingPrintInputs;
|
|
231
243
|
/** The viewer layer for this hydration, written in the same store update. */
|
|
232
244
|
viewer?: DashboardViewerState;
|
|
245
|
+
/**
|
|
246
|
+
* The viewer's inline filter values (a default bookmark's, or the live
|
|
247
|
+
* ones on a refetch). Absent: the cards' inline filter defaults.
|
|
248
|
+
*/
|
|
249
|
+
inlineFilterValuesMap?: Record<string, TFilterValue[]>;
|
|
233
250
|
}) => void;
|
|
234
251
|
/**
|
|
235
252
|
* The host's control defaults changed for the dashboard on screen: writes
|
|
@@ -260,8 +277,6 @@ type Actions = {
|
|
|
260
277
|
setDocumentInputFilterValues: (sheetId: string, valuesByInputId: Record<string, TFilterValue | undefined>) => void;
|
|
261
278
|
setDocumentInputFilterValue: (sheetId: string, inputId: string, filterValue: TFilterValue) => void;
|
|
262
279
|
removeDocumentInputFilterValue: (sheetId: string, inputId: string) => void;
|
|
263
|
-
setDocumentInputFilterModes: (sheetId: string, modesByInputId: Record<string, DocumentFilterMode>) => void;
|
|
264
|
-
setDocumentInputFilterMode: (sheetId: string, inputId: string, filterMode: DocumentFilterMode) => void;
|
|
265
280
|
setDocumentInputControlValues: (sheetId: string, valuesByInputId: Record<string, unknown>) => void;
|
|
266
281
|
setDocumentInputControlValue: (sheetId: string, inputId: string, value: unknown) => void;
|
|
267
282
|
clearDocumentInputRuntime: (sheetId?: string) => void;
|
|
@@ -294,7 +309,6 @@ type Actions = {
|
|
|
294
309
|
}) => void;
|
|
295
310
|
clearAllInlineFilterValues: () => void;
|
|
296
311
|
setInlineFilterValuesMap: (map: Record<string, TFilterValue[]>) => void;
|
|
297
|
-
setCardInlineFilterMode: (sheetId: string, cardId: string, filterId: string, filterMode: 'include' | 'exclude') => void;
|
|
298
312
|
setCardInlineFilterDefaultValues: (sheetId: string, cardId: string, filterId: string, defaultValues: (string | number)[] | undefined) => void;
|
|
299
313
|
addFrame: (sheetId: string, frame: TFrame, positionOrOptions?: 'start' | 'end' | AddFrameOptions) => void;
|
|
300
314
|
updateFrame: (sheetId: string, frame: TFrame, options?: {
|
|
@@ -432,6 +446,15 @@ export type ViewerRequestToken = {
|
|
|
432
446
|
readonly restoreSeq: number;
|
|
433
447
|
readonly client: ViewerStateClient | null;
|
|
434
448
|
};
|
|
449
|
+
/**
|
|
450
|
+
* Where the current edit session starts (D7-7): what the store recorded when
|
|
451
|
+
* editing turned on, else the dashboard as it is now. Both toolbars' "before
|
|
452
|
+
* editing" capture reads this.
|
|
453
|
+
*/
|
|
454
|
+
export declare function selectEditSessionStart(state: Pick<DashboardStore, 'editingStartedWith' | 'dashboard' | 'semanticExecutionPayload'>): {
|
|
455
|
+
dashboard: TDashboard;
|
|
456
|
+
semanticExecutionPayload: SemanticExecutionPayload;
|
|
457
|
+
};
|
|
435
458
|
export declare const useDashboardStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<DashboardStore>, "setState"> & {
|
|
436
459
|
setState(nextStateOrUpdater: DashboardStore | Partial<DashboardStore> | ((state: import('immer').WritableDraft<DashboardStore>) => void), shouldReplace?: false): void;
|
|
437
460
|
setState(nextStateOrUpdater: DashboardStore | ((state: import('immer').WritableDraft<DashboardStore>) => void), shouldReplace: true): void;
|
|
@@ -4,6 +4,7 @@ import { TChartType } from '../charts/types.js';
|
|
|
4
4
|
import { FilterByColumn, OldFilterValue, GroupByColumn, MetricColumn, OrderBy, QueryConfig } from '../types/query-types.js';
|
|
5
5
|
import { TableActions } from './table-actions.js';
|
|
6
6
|
import { CardConfig, QueryColumnKeyMap } from '../types/explorer-types.js';
|
|
7
|
+
import { CardTypeChange, CardTypeChangeOptions } from '../utils/card-type-change.js';
|
|
7
8
|
import { ExplorerActions } from './explorer-actions.js';
|
|
8
9
|
/**
|
|
9
10
|
* Draft slots for preserving work when switching between dev and standard modes.
|
|
@@ -173,8 +174,9 @@ type Actions = TableActions & ExplorerActions & {
|
|
|
173
174
|
setSqlGen: (sqlGen: SqlGen) => void;
|
|
174
175
|
setSqlGenMeasure: (name: string, calc: AggregateCalc) => void;
|
|
175
176
|
setSqlGenDimension: (dimension: string) => void;
|
|
176
|
-
|
|
177
|
-
|
|
177
|
+
/** `catalog` completes a join carried across the Matrix boundary (see useCardTypeSwitch). */
|
|
178
|
+
/** The one card type change (`changeCardType`); returns its decision. */
|
|
179
|
+
setCardType: (type: TChartType, options?: CardTypeChangeOptions) => CardTypeChange;
|
|
178
180
|
setCardSql: (sql: string | undefined) => void;
|
|
179
181
|
setCardPython: (python: string | undefined) => void;
|
|
180
182
|
setCardCustomCfg: (cfg: any) => void;
|
|
@@ -109,9 +109,13 @@ export type UIConfig = {
|
|
|
109
109
|
projectFeatures?: {
|
|
110
110
|
schemaVersion: 'project-features/v1';
|
|
111
111
|
features: {
|
|
112
|
+
/** Master switch over every AI feature. Absent in tokens minted before it existed. */
|
|
113
|
+
aiFeatures?: boolean;
|
|
112
114
|
dashboardAiAuthoring: boolean;
|
|
113
115
|
analyticalBriefings: boolean;
|
|
114
116
|
aiWritingHelpers: boolean;
|
|
117
|
+
/** The assistant switch. Absent in tokens minted before it existed. */
|
|
118
|
+
assistant?: boolean;
|
|
115
119
|
};
|
|
116
120
|
};
|
|
117
121
|
/**
|
|
@@ -119,6 +123,13 @@ export type UIConfig = {
|
|
|
119
123
|
* Defaults to true unless explicitly disabled.
|
|
120
124
|
*/
|
|
121
125
|
showDirectSource?: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* The assistant (analytics agent Plan 1): `enabled`, `name`, `layout`.
|
|
128
|
+
* Tokens semaphor-app issues for its own pages enable it; customers enable
|
|
129
|
+
* it in embeds. When `enabled` is absent, a token's old
|
|
130
|
+
* `showDashboardAssistant` is read in its place.
|
|
131
|
+
*/
|
|
132
|
+
assistant?: import('../../shared/assistant-protocol/token-config.js').AssistantTokenConfig;
|
|
122
133
|
/**
|
|
123
134
|
* Enables QueryInfo debug tools for Explorer troubleshooting.
|
|
124
135
|
* Defaults to true unless explicitly disabled.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { TCard, TCardPreferences, TCustomCardPreferences } from '../types/common-types.js';
|
|
2
|
+
import { Field } from '../types/explorer-types.js';
|
|
3
|
+
export declare function sharedCardPreferences(preferences: TCardPreferences | undefined): TCardPreferences;
|
|
4
|
+
export type CardTypeChangeOptions = {
|
|
5
|
+
/** The loaded column catalog; the Matrix carry resolves fields against it. */
|
|
6
|
+
catalog?: readonly Field[];
|
|
7
|
+
/** True while the catalog loads: a Matrix carry then waits (P4-09). */
|
|
8
|
+
catalogLoading?: boolean;
|
|
9
|
+
/** A plugin visual chosen as `custom`. */
|
|
10
|
+
customVisual?: TCustomCardPreferences;
|
|
11
|
+
};
|
|
12
|
+
export type CardTypeChange = {
|
|
13
|
+
status: 'refused';
|
|
14
|
+
reason: 'catalog_loading';
|
|
15
|
+
} | {
|
|
16
|
+
status: 'unchanged';
|
|
17
|
+
} | {
|
|
18
|
+
status: 'changed';
|
|
19
|
+
card: TCard;
|
|
20
|
+
/** Labels of authored parts the new type could not keep. */
|
|
21
|
+
leftOut: readonly string[];
|
|
22
|
+
crossedMatrixBoundary: boolean;
|
|
23
|
+
forcesSqlMode: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* The one decision of what changing a card's type does (ledger H-2). Every
|
|
27
|
+
* picker goes through it, so a refusal or a reset holds on every path. Pure:
|
|
28
|
+
* the editor store applies the result.
|
|
29
|
+
*/
|
|
30
|
+
export declare function changeCardType(card: TCard, type: TCard['type'], options?: CardTypeChangeOptions): CardTypeChange;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MetricComparisonWindowGrain } from '../../shared/analytics-protocol/index.js';
|
|
2
|
+
export declare function formatCanonicalComparisonRange(period: {
|
|
3
|
+
start: string;
|
|
4
|
+
end: string;
|
|
5
|
+
}, timezone: string, windowGrain: MetricComparisonWindowGrain | undefined, short?: boolean): string;
|
|
6
|
+
export declare function formatCanonicalComparisonBoundaries(period: {
|
|
7
|
+
start: string;
|
|
8
|
+
end: string;
|
|
9
|
+
}, timezone: string, windowGrain: MetricComparisonWindowGrain | undefined, short?: boolean): {
|
|
10
|
+
start: string;
|
|
11
|
+
end: string;
|
|
12
|
+
};
|
|
@@ -6,12 +6,24 @@ import { TInlineFilter } from '../types/common-types.js';
|
|
|
6
6
|
* clock and Monday weeks; a calendar carries its anchor and fiscal periods.
|
|
7
7
|
*/
|
|
8
8
|
export type DefaultsCalendar = string | DefaultDateCalendar;
|
|
9
|
-
type DefaultBackedFilter = Pick<TFilter, 'id' | 'column' | 'operation' | 'dataType' | 'nativeDataType' | 'dateSelectionMode' | 'defaultValues' | 'defaultDateFilter' | 'fieldMeta' | 'semanticContext'> & Partial<Pick<TInlineFilter, 'id' | 'column' | 'operation' | 'dataType' | 'nativeDataType' | 'dateSelectionMode' | 'defaultValues' | 'defaultDateFilter' | 'fieldMeta' | 'semanticContext'>>;
|
|
9
|
+
export type DefaultBackedFilter = Pick<TFilter, 'id' | 'column' | 'operation' | 'dataType' | 'nativeDataType' | 'dateSelectionMode' | 'defaultValues' | 'defaultDateFilter' | 'fieldMeta' | 'semanticContext'> & Partial<Pick<TInlineFilter, 'id' | 'column' | 'operation' | 'dataType' | 'nativeDataType' | 'dateSelectionMode' | 'defaultValues' | 'defaultDateFilter' | 'fieldMeta' | 'semanticContext'>>;
|
|
10
10
|
/**
|
|
11
11
|
* Converts a filter's default configuration into an active runtime filter value.
|
|
12
12
|
* Returns undefined when no defaults are configured.
|
|
13
13
|
*/
|
|
14
14
|
export declare function buildFilterValueFromDefaults(filter: DefaultBackedFilter, calendar?: DefaultsCalendar | null): TFilterValue | undefined;
|
|
15
|
+
/** A filter's authored default as settings fields: mode or range condition, values, date window. */
|
|
16
|
+
export type FilterDefaultSettings = Partial<Pick<DefaultBackedFilter, 'operation' | 'defaultValues' | 'defaultDateFilter'>>;
|
|
17
|
+
/** The default fields of a filter, every key present so a spread replaces them all. */
|
|
18
|
+
export declare function pickFilterDefaultSettings(filter: FilterDefaultSettings): FilterDefaultSettings;
|
|
19
|
+
/**
|
|
20
|
+
* Whether an edit changed what the filter's default applies: its values, its
|
|
21
|
+
* date window, or the operation it applies under (Include / Exclude, a range
|
|
22
|
+
* condition), which `buildFilterValueFromDefaults` carries onto the value.
|
|
23
|
+
* The definition's operation is authored only (filter-mode-ownership FM-D1),
|
|
24
|
+
* so an operation change is always an authoring change.
|
|
25
|
+
*/
|
|
26
|
+
export declare function haveFilterDefaultsChanged(previous: FilterDefaultSettings | undefined, next: FilterDefaultSettings): boolean;
|
|
15
27
|
export declare function buildFilterValuesFromDefaults(filters: DefaultBackedFilter[] | undefined, calendar?: DefaultsCalendar): TFilterValue[];
|
|
16
28
|
/**
|
|
17
29
|
* The window a saved relative date names at the report calendar's anchor, by the
|
|
@@ -34,4 +46,3 @@ export declare function resolveSameDashboardFilterValues(params: {
|
|
|
34
46
|
currentFilterValues: TFilterValue[] | undefined;
|
|
35
47
|
defaultFilterValues: TFilterValue[];
|
|
36
48
|
}): TFilterValue[];
|
|
37
|
-
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { FilterGroup } from '../../lib/types/explorer-types.js';
|
|
2
|
+
import { MetricComparisonWindowGrain, ResolvedDateWindow } from './metric-comparison.js';
|
|
3
|
+
import { RelativeDateFilter } from './relative-date-filter.js';
|
|
4
|
+
/**
|
|
5
|
+
* What a governed query applied, as evidence (analytics agent Plan 1, Phase
|
|
6
|
+
* 3b, ledger D3b-4): the public conditions of the executed query, decided
|
|
7
|
+
* where the query builder settles its final filters, and the conditions it
|
|
8
|
+
* skipped with the reason. Public only: conditions are taken before security
|
|
9
|
+
* is added, and nothing here can hold a policy, a security parameter or SQL.
|
|
10
|
+
*/
|
|
11
|
+
/** A filter value's operation, as the query transports it. */
|
|
12
|
+
export type AppliedFilterOperation = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
|
|
13
|
+
/** The field a condition is on, as the query named it. */
|
|
14
|
+
export type AppliedConstraintField = {
|
|
15
|
+
name: string;
|
|
16
|
+
/** The field's label, when the filter carried one. */
|
|
17
|
+
label?: string;
|
|
18
|
+
qualifiedName?: string;
|
|
19
|
+
};
|
|
20
|
+
export type AppliedFilterCondition = {
|
|
21
|
+
/** The filter the condition came from: a dashboard input, a request filter, a time window. */
|
|
22
|
+
filterId: string;
|
|
23
|
+
field: AppliedConstraintField;
|
|
24
|
+
operation: AppliedFilterOperation;
|
|
25
|
+
/** As executed: a relative window's values are its resolved bounds. */
|
|
26
|
+
values: unknown[];
|
|
27
|
+
valueType: 'string' | 'number' | 'date' | 'boolean';
|
|
28
|
+
/** A relative window, with the bounds it resolved to in `values`. */
|
|
29
|
+
relative?: RelativeDateFilter;
|
|
30
|
+
/**
|
|
31
|
+
* On a date condition: the calendar zone the query ran in, which its
|
|
32
|
+
* bounds' day boundaries are in. Bounds that span whole days in it read as
|
|
33
|
+
* those dates (as a comparison window's `timezone`).
|
|
34
|
+
*/
|
|
35
|
+
timezone?: string;
|
|
36
|
+
/** The dashboard date replaced the card's own date range on this field for the run. */
|
|
37
|
+
replacesCardRange?: true;
|
|
38
|
+
/**
|
|
39
|
+
* The measures this condition applied to, when it applied to some of the
|
|
40
|
+
* answer's measures only (two measures compared over different periods).
|
|
41
|
+
* Absent when it applied to the whole answer.
|
|
42
|
+
*/
|
|
43
|
+
measures?: string[];
|
|
44
|
+
};
|
|
45
|
+
export type SemaphorAppliedConstraint = ({
|
|
46
|
+
kind: 'filter';
|
|
47
|
+
} & AppliedFilterCondition)
|
|
48
|
+
/** The card's own saved filters (with drill steps and selections), as it ran them; `measures` as for a filter. */
|
|
49
|
+
| {
|
|
50
|
+
kind: 'card_filters';
|
|
51
|
+
filters: FilterGroup;
|
|
52
|
+
measures?: string[];
|
|
53
|
+
}
|
|
54
|
+
/** One measure's comparison, with both windows as the server placed them. */
|
|
55
|
+
| {
|
|
56
|
+
kind: 'comparison_window';
|
|
57
|
+
measure: string;
|
|
58
|
+
current: ResolvedDateWindow;
|
|
59
|
+
comparison: ResolvedDateWindow;
|
|
60
|
+
/** The grain the windows were placed at, for wording them. */
|
|
61
|
+
grain?: MetricComparisonWindowGrain;
|
|
62
|
+
};
|
|
63
|
+
/** Why a condition was left out of the executed query. */
|
|
64
|
+
export type SemaphorSkippedConstraintReason = 'dataset_not_reachable' | 'field_not_resolvable' | 'missing_metadata' | 'unsupported_calculated_filter';
|
|
65
|
+
export type SemaphorSkippedConstraint = {
|
|
66
|
+
filterId?: string;
|
|
67
|
+
field?: AppliedConstraintField;
|
|
68
|
+
reason: SemaphorSkippedConstraintReason;
|
|
69
|
+
};
|
|
70
|
+
/** On a governed analyze result; SQL and Matrix results carry none. */
|
|
71
|
+
export type SemaphorQueryConstraints = {
|
|
72
|
+
applied: SemaphorAppliedConstraint[];
|
|
73
|
+
skipped: SemaphorSkippedConstraint[];
|
|
74
|
+
};
|
|
@@ -3,6 +3,7 @@ import { matrixAnalyticalIntentSchema } from './matrix-definition-contract.js';
|
|
|
3
3
|
import { matrixResultSchema } from './matrix-window-contract.js';
|
|
4
4
|
import { CalendarContext } from '../report-runtime-context/index.js';
|
|
5
5
|
import { DateUnit } from './relative-date-filter.js';
|
|
6
|
+
import { SemaphorQueryConstraints } from './applied-constraints.js';
|
|
6
7
|
export type SemaphorProtocolVersion = 1;
|
|
7
8
|
export type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
|
|
8
9
|
export type SemaphorSourceLevel = 'database' | 'schema' | 'table';
|
|
@@ -798,6 +799,8 @@ export type SemaphorAnalyticsExecutionResult = {
|
|
|
798
799
|
relationshipDiagnostics?: SemaphorRelationshipDiagnostics;
|
|
799
800
|
diagnosticFeedback?: SemaphorAnalyticsDiagnosticFeedback;
|
|
800
801
|
population?: SemaphorAnalyticsPopulation;
|
|
802
|
+
/** The public conditions the executed query applied and skipped (analytics agent Plan 1, D3b-4). */
|
|
803
|
+
constraints?: SemaphorQueryConstraints;
|
|
801
804
|
metadata?: Record<string, unknown>;
|
|
802
805
|
};
|
|
803
806
|
export type SemaphorAnalyticsDiagnosticReasonCode = 'ambiguous_fields' | 'empty_result' | 'missing_grounded_fields' | 'missing_relationship' | 'no_grounded_query' | 'partial_result' | 'presentation_incomplete' | 'query_validation_failed' | 'unsafe_join';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { TFilterValue } from '../../components/surfboard/filter/types.js';
|
|
2
|
+
import { FilterCondition, FilterGroup } from '../../lib/types/explorer-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* Which dashboard filter owns which of a card's fields. One field matcher
|
|
5
|
+
* and one notion of "a condition every row must pass" for the run's Global
|
|
6
|
+
* Date ownership (app `withGlobalDateOwnership`) and for adding an answer to
|
|
7
|
+
* a dashboard (`withDashboardFilterOwnership`, analytics agent Plan 1,
|
|
8
|
+
* Phase 7a, D7-6).
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Whether a dashboard filter value targets this field: its qualified field
|
|
12
|
+
* name, or the last name segment for an unqualified field.
|
|
13
|
+
*/
|
|
14
|
+
export declare function filterValueTargetsField(filter: TFilterValue, field: {
|
|
15
|
+
name: string;
|
|
16
|
+
qualifiedFieldName?: string;
|
|
17
|
+
}): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether every condition of this group must hold for a row: it is not
|
|
20
|
+
* negated, and it joins with AND (or has at most one child, so its operator
|
|
21
|
+
* joins nothing). A condition inside any other group is a branch, never a
|
|
22
|
+
* constraint on the whole card.
|
|
23
|
+
*/
|
|
24
|
+
export declare function isUnconditionalGroup(group: FilterGroup): boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The card's conditions every row must pass: the root group's and those of
|
|
27
|
+
* nested groups reached only through unconditional groups.
|
|
28
|
+
*/
|
|
29
|
+
export declare function unconditionalConditions(filters: FilterGroup | null | undefined): FilterCondition[];
|
|
30
|
+
/**
|
|
31
|
+
* The card config without its own conditions on every field a dashboard
|
|
32
|
+
* filter that applies to it targets, so the dashboard filter decides that
|
|
33
|
+
* field (D7-6). As Global Date ownership: only the root group's conditions,
|
|
34
|
+
* and only when the root is unconditional, since removing a condition from
|
|
35
|
+
* an OR or negated group would change what the rest of the group means. The
|
|
36
|
+
* same object when nothing is owned. Pass only the filter values that apply
|
|
37
|
+
* to the card. A value with no qualified identity (a dashboard filter by
|
|
38
|
+
* column) is applied by its column name, so it owns the card's field of that
|
|
39
|
+
* name.
|
|
40
|
+
*/
|
|
41
|
+
export declare function withDashboardFilterOwnership<T extends {
|
|
42
|
+
filters?: FilterGroup | null;
|
|
43
|
+
}>(cardConfig: T, appliedFilters: readonly TFilterValue[]): T;
|
|
@@ -13,6 +13,8 @@ export * from './physical-source-resolution.js';
|
|
|
13
13
|
export * from './source-entity-resolution.js';
|
|
14
14
|
export * from './fixtures.js';
|
|
15
15
|
export * from './metric-comparison.js';
|
|
16
|
+
export * from './applied-constraints.js';
|
|
17
|
+
export * from './filter-field-ownership.js';
|
|
16
18
|
export * from './sort-target.js';
|
|
17
19
|
export * from './dashboard-date-comparison-definition.js';
|
|
18
20
|
export * from './dashboard-input-contract.js';
|
|
@@ -27,6 +29,7 @@ export * from './operation-temporal-state.js';
|
|
|
27
29
|
export * from './aggregate-expression.js';
|
|
28
30
|
export * from './measure-aggregation-profile.js';
|
|
29
31
|
export * from './analytics-refusal.js';
|
|
32
|
+
export * from './visual-choice.js';
|
|
30
33
|
/**
|
|
31
34
|
* The saved filter contract, strict: a key outside it (an execution-only
|
|
32
35
|
* field the server adds while it runs a filter) fails to parse, so a save
|
|
@@ -78,7 +78,7 @@ export type MatrixFailure = {
|
|
|
78
78
|
};
|
|
79
79
|
};
|
|
80
80
|
export type MatrixCapabilities = {
|
|
81
|
-
dialect: 'postgres' | 'clickhouse' | 'duckdb';
|
|
81
|
+
dialect: 'postgres' | 'clickhouse' | 'duckdb' | 'snowflake';
|
|
82
82
|
aggregates: readonly MatrixAggregate[];
|
|
83
83
|
};
|
|
84
84
|
export type MatrixWindow = {
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { SemaphorResultColumn } from './contracts.js';
|
|
2
|
+
/**
|
|
3
|
+
* Which visual fits a result (analytics agent Plan 1, spec 2.5, AG-D15, D4b-1).
|
|
4
|
+
* Pure and conservative: a chart only when the result proves its shape, else
|
|
5
|
+
* a table. The assistant's artifacts and the MCP analyze result's visual hint
|
|
6
|
+
* (Phase 4c) both read it.
|
|
7
|
+
*/
|
|
8
|
+
export declare const VISUAL_KINDS: readonly ["number", "line", "bar", "stackedBar", "table"];
|
|
9
|
+
export type VisualKind = (typeof VISUAL_KINDS)[number];
|
|
10
|
+
export type VisualSpec = {
|
|
11
|
+
kind: VisualKind;
|
|
12
|
+
/** Result column keys by role. A table shows every column and has none. */
|
|
13
|
+
encodings: {
|
|
14
|
+
x?: string;
|
|
15
|
+
y?: string[];
|
|
16
|
+
series?: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
/** Everything eligibility needs. */
|
|
20
|
+
export type VisualChoiceInput = {
|
|
21
|
+
columns: SemaphorResultColumn[];
|
|
22
|
+
/** The rows in hand. */
|
|
23
|
+
records: Array<Record<string, unknown>>;
|
|
24
|
+
/** Rows in the whole result. */
|
|
25
|
+
rowCount: number;
|
|
26
|
+
/** True for governed semantic analysis; false for advanced SQL. */
|
|
27
|
+
governed: boolean;
|
|
28
|
+
/** False when the result answered only part of the question. */
|
|
29
|
+
complete: boolean;
|
|
30
|
+
/** True when the result has more rows than `records`, or hit its row limit. */
|
|
31
|
+
truncated: boolean;
|
|
32
|
+
};
|
|
33
|
+
export type VisualChoice = {
|
|
34
|
+
ok: true;
|
|
35
|
+
visual: VisualSpec;
|
|
36
|
+
eligible: VisualKind[];
|
|
37
|
+
reason: string;
|
|
38
|
+
} | {
|
|
39
|
+
ok: false;
|
|
40
|
+
code: 'kind_not_eligible';
|
|
41
|
+
eligible: VisualKind[];
|
|
42
|
+
message: string;
|
|
43
|
+
};
|
|
44
|
+
/** Thresholds, tuned by the regression set. */
|
|
45
|
+
export declare const VISUAL_CHOICE_LIMITS: {
|
|
46
|
+
/** Fewest points on a line. */
|
|
47
|
+
readonly lineMinPoints: 2;
|
|
48
|
+
/** Most measures on one line chart. */
|
|
49
|
+
readonly lineMaxMeasures: 3;
|
|
50
|
+
/**
|
|
51
|
+
* Categories (or time points) on a bar chart. Up to `barDefaultMaxCategories`
|
|
52
|
+
* a category breakdown opens as bars; past it, up to `barMaxCategories`, it
|
|
53
|
+
* opens as a table with bars in the toggle and on request; past that, a
|
|
54
|
+
* table only.
|
|
55
|
+
*/
|
|
56
|
+
readonly barMinCategories: 2;
|
|
57
|
+
readonly barDefaultMaxCategories: 12;
|
|
58
|
+
readonly barMaxCategories: 30;
|
|
59
|
+
/** Series a bar with series shows, at least and at most. */
|
|
60
|
+
readonly seriesMin: 2;
|
|
61
|
+
readonly seriesMax: 6;
|
|
62
|
+
};
|
|
63
|
+
export type VisualColumnRole = 'time' | 'dimension' | 'measure' | 'other';
|
|
64
|
+
/**
|
|
65
|
+
* Without `requested`: the default visual and the eligible kinds, default
|
|
66
|
+
* first. With `requested`: that visual if eligible, else a refusal that names
|
|
67
|
+
* the eligible kinds.
|
|
68
|
+
*/
|
|
69
|
+
export declare function chooseVisual(input: VisualChoiceInput, requested?: VisualKind): VisualChoice;
|
|
70
|
+
/**
|
|
71
|
+
* A column's part in a visual: a governed column by its role (a time bucket
|
|
72
|
+
* or date is time); an SQL column, or a governed one without a role, by its
|
|
73
|
+
* data type.
|
|
74
|
+
*/
|
|
75
|
+
export declare function visualColumnRole(column: SemaphorResultColumn, governed: boolean): VisualColumnRole;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `react-semaphor/assistant-context`: builds the assistant's context from a
|
|
3
|
+
* dashboard (analytics agent Plan 1, spec 2.2, ledger D3a-9). Apart from the
|
|
4
|
+
* server-safe `assistant-protocol` entry because it reads the dashboard
|
|
5
|
+
* runtime's compilers; it loads in Node, where the regression set builds a
|
|
6
|
+
* case's context from a saved dashboard with `projectSavedDashboardContext`.
|
|
7
|
+
*/
|
|
8
|
+
export { AssistantContextSourceError, projectAssistantContext, type AssistantContextSource, type AssistantContextSourceIssue, } from './project-context.js';
|
|
9
|
+
export { assistantCardReplayFields, buildSavedCardRequest, cardReplayOf, projectSavedDashboardContext, projectSavedDashboardTurn, type AssistantCardReplayFields, type SavedCardRequestRefusal, type SavedDashboardPlace, } from './saved-dashboard-context.js';
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { TCard, TDashboard } from '../../lib/types/common-types.js';
|
|
2
|
+
import { TransientInputContext } from '../../lib/dashboard-inputs/transient-input-context.js';
|
|
3
|
+
import { DashboardInputRuntimeValues } from '../../lib/dashboard-inputs/resolve-dashboard-input-context.js';
|
|
4
|
+
import { CardExecutionSnapshotState } from '../../lib/query-context/describe-card-execution-snapshot.js';
|
|
5
|
+
import { CalendarContext } from '../report-runtime-context/index.js';
|
|
6
|
+
import { AssistantContext } from '../assistant-protocol/context.js';
|
|
7
|
+
/**
|
|
8
|
+
* Builds the assistant's context from a dashboard (analytics agent Plan 1,
|
|
9
|
+
* spec 2.2, ledger D3a-2 to D3a-9). The browser calls it at send time with the
|
|
10
|
+
* asked-about card's snapshot from that card's store adapter; the regression
|
|
11
|
+
* set calls it in Node with a snapshot built from the saved dashboard.
|
|
12
|
+
*
|
|
13
|
+
* It formats what the owners compiled: inputs through the input resolver,
|
|
14
|
+
* scope through `doesDashboardInputApplyToTarget` (inside the resolver), the
|
|
15
|
+
* asked-about card through `describeCardExecutionSnapshot`, every condition
|
|
16
|
+
* through the one full-detail renderer. Throws `AssistantContextTooLargeError`
|
|
17
|
+
* when the result is over `contextBytes`, and `AssistantContextSourceError`
|
|
18
|
+
* when the source names a sheet or a selected card it does not hold: nothing
|
|
19
|
+
* asked about is dropped silently.
|
|
20
|
+
*/
|
|
21
|
+
export type AssistantContextSourceIssue = 'sheet_not_found' | 'card_not_found' | 'card_not_on_sheet' | 'document_inputs_not_built';
|
|
22
|
+
export declare class AssistantContextSourceError extends Error {
|
|
23
|
+
readonly code: AssistantContextSourceIssue;
|
|
24
|
+
constructor(code: AssistantContextSourceIssue, message: string);
|
|
25
|
+
}
|
|
26
|
+
export type AssistantContextSource = {
|
|
27
|
+
surface: 'none';
|
|
28
|
+
timeZone: string;
|
|
29
|
+
} | {
|
|
30
|
+
surface: 'dashboard';
|
|
31
|
+
dashboard: TDashboard;
|
|
32
|
+
/** Null only for a dashboard with no sheets. */
|
|
33
|
+
sheetId: string | null;
|
|
34
|
+
unsavedEdits: boolean;
|
|
35
|
+
/** The dashboard store's input values (the same values its cards run with). */
|
|
36
|
+
runtimeValues: DashboardInputRuntimeValues;
|
|
37
|
+
transientContexts: readonly TransientInputContext[] | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The card in focus with its snapshot: the one the user asked about, or
|
|
40
|
+
* in the editor the draft (`card`), which is described instead of the
|
|
41
|
+
* dashboard's copy (D5-3).
|
|
42
|
+
*/
|
|
43
|
+
selectedCard?: {
|
|
44
|
+
cardId: string;
|
|
45
|
+
snapshot: CardExecutionSnapshotState;
|
|
46
|
+
card?: TCard;
|
|
47
|
+
};
|
|
48
|
+
/** The editor is open on the card in focus (Phase 5): the surface is the editor. */
|
|
49
|
+
editing?: {
|
|
50
|
+
mode: 'visual' | 'sql';
|
|
51
|
+
};
|
|
52
|
+
/** The report calendar the cards run in; its zone is the viewer's. */
|
|
53
|
+
calendar: CalendarContext;
|
|
54
|
+
};
|
|
55
|
+
export declare function projectAssistantContext(source: AssistantContextSource): AssistantContext;
|