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.
Files changed (173) hide show
  1. package/dist/analytics-protocol/index.js +352 -341
  2. package/dist/assistant-context/index.js +10 -0
  3. package/dist/assistant-protocol/index.js +104 -0
  4. package/dist/brand-studio/index.js +35 -31
  5. package/dist/briefings/index.js +46 -45
  6. package/dist/chunks/_commonjsHelpers-BkfeUUK-.js +28 -0
  7. package/dist/chunks/add-to-dashboard-CxtTfISD.js +56 -0
  8. package/dist/chunks/aggregate-table-row-presentation-Qgpv6_G8.js +979 -0
  9. package/dist/chunks/analytics-base-schemas-BFAoRlkU.js +472 -0
  10. package/dist/chunks/apply-dashboard-operations-C-iahGka.js +402 -0
  11. package/dist/chunks/assistant-chat-BAqUIFp5.js +7966 -0
  12. package/dist/chunks/availability-Bp5Gfu1I.js +44 -0
  13. package/dist/chunks/{bookmark-state-B-I9BDD0.js → bookmark-state-k7y5SNGf.js} +9 -9
  14. package/dist/chunks/{braces-8TRlDwDw.js → braces-o9UiRQes.js} +1 -1
  15. package/dist/chunks/calculated-field-identity-DcBS2NPP.js +2161 -0
  16. package/dist/chunks/calendar-day-equality-Bpl15IBo.js +487 -0
  17. package/dist/chunks/class-utils-Df1OVOT1.js +2315 -0
  18. package/dist/chunks/{field-dependencies-CpRUwr9J.js → common-types-CUf03Htv.js} +65 -58
  19. package/dist/chunks/context-HD9usB1P.js +349 -0
  20. package/dist/chunks/conversation-sQiWYUOb.js +16 -0
  21. package/dist/chunks/csv-utils-GUfKyT1J.js +56 -0
  22. package/dist/chunks/custom-visual-inputs-BrUOIwln.js +3288 -0
  23. package/dist/chunks/{dashboard-BPJo-Fnd.js → dashboard-DTDDFQsS.js} +1 -1
  24. package/dist/chunks/{dashboard-briefing-launcher-A2uVpHCp.js → dashboard-briefing-launcher-Bb2QUqOa.js} +764 -740
  25. package/dist/chunks/{dashboard-controls-DxTuVis_.js → dashboard-controls-FpONU8QV.js} +683 -686
  26. package/dist/chunks/{common-types-g7yS12Cg.js → dashboard-filter-value-compatibility-D95O4nd7.js} +18 -24
  27. package/dist/chunks/dashboard-json-DazPhBU_.js +69 -0
  28. package/dist/chunks/document-dashboard-inputs-D96rlU7S.js +10678 -0
  29. package/dist/chunks/document-sheet-utils-C1eEldxs.js +1076 -0
  30. package/dist/chunks/{edit-dashboard-visual-ByV0OwSp.js → edit-dashboard-visual-CIhZodVH.js} +4744 -4746
  31. package/dist/chunks/editor-draft-sync-BN5qYHPF.js +15 -0
  32. package/dist/chunks/filter-value-text-BhWugPWE.js +163 -0
  33. package/dist/chunks/index-CqMiAkay.js +3164 -0
  34. package/dist/chunks/index-CuHybtft.js +51 -0
  35. package/dist/chunks/layout-grid-Bgzth8vd.js +16 -0
  36. package/dist/chunks/{matrix-analytical-definition-CgBTD6H8.js → matrix-analytical-definition-bcprSe4u.js} +1 -1
  37. package/dist/chunks/{matrix-card-CAdizkUl.js → matrix-card-CJn1hB5V.js} +13 -12
  38. package/dist/chunks/matrix-definition-DQDI2okF.js +206 -0
  39. package/dist/chunks/{matrix-formatter-DJCk8Znf.js → matrix-formatter-Bgw32tb3.js} +648 -457
  40. package/dist/chunks/matrix-member-presentation-BNPSDKBG.js +105 -0
  41. package/dist/chunks/{matrix-operation-contract-BKupLHXL.js → matrix-operation-contract-B8PBF1Gd.js} +134 -133
  42. package/dist/chunks/{metric-comparison-BKHyvnAy.js → metric-comparison-CojWeLqx.js} +1 -1
  43. package/dist/chunks/{palette-Cp1hqZtm.js → palette-D10o_yYX.js} +1 -1
  44. package/dist/chunks/pivot-header-presentation-MkcKnjn3.js +42 -0
  45. package/dist/chunks/{pivot-result-identity-Bs4tLtLo.js → pivot-result-identity-D6hhcRXi.js} +1 -1
  46. package/dist/chunks/pivot-result-lifecycle-8qCDmpKc.js +804 -0
  47. package/dist/chunks/raw-temporal-D61lr48Y.js +1464 -0
  48. package/dist/chunks/{raw-temporal-contract-mLFS-9wk.js → raw-temporal-contract-C51YG48G.js} +1 -1
  49. package/dist/chunks/report-preferences-dialog-BCGs4-AE.js +1808 -0
  50. package/dist/chunks/{report-runtime-context-CG_I0PPW.js → report-runtime-context-B984Nq1E.js} +8 -7
  51. package/dist/chunks/save-CfJpQQ68.js +21 -0
  52. package/dist/chunks/saved-dashboard-context-BrTkjcod.js +566 -0
  53. package/dist/chunks/{selection-reducer-CiDEtmAq.js → selection-reducer-vKIb_jS6.js} +2 -2
  54. package/dist/chunks/{semaphor-ready-indicator-CHu1L-lo.js → semaphor-ready-indicator-CHHoWhil.js} +65586 -62749
  55. package/dist/chunks/{shelf-drop-preview-context-i-H6DFyU.js → shelf-drop-preview-context-EsayECEC.js} +199 -196
  56. package/dist/chunks/{source-entity-resolution-C-oNyYMp.js → source-entity-resolution-CVA1a85c.js} +8 -8
  57. package/dist/chunks/switch-CvItuC1Q.js +8199 -0
  58. package/dist/chunks/{temporal-bucket-DlFuhCnT.js → temporal-bucket-D8JF7zKz.js} +86 -71
  59. package/dist/chunks/{temporal-bucket-contract-D2OuaVZ7.js → temporal-bucket-contract-DaOajRC7.js} +1 -1
  60. package/dist/chunks/{token-types-DtSJOUjh.js → token-types-bxUxXDX2.js} +1 -1
  61. package/dist/chunks/{upload-CAIpsti1.js → upload-BFX7apKV.js} +1 -1
  62. package/dist/chunks/{use-create-flow-overlay-state-Bj63WwHc.js → use-create-flow-overlay-state-BqA92GkX.js} +331 -339
  63. package/dist/chunks/{validators-DMSH81OM.js → validators-Ej1DdCXa.js} +1050 -1510
  64. package/dist/chunks/visual-choice-JiJ-_3bi.js +204 -0
  65. package/dist/chunks/x-4f5U2XwU.js +100 -0
  66. package/dist/chunks/{zoned-wall-clock-1qlWCE20.js → zoned-wall-clock-MulfA26h.js} +2 -2
  67. package/dist/dashboard/index.js +2 -2
  68. package/dist/dashboard-authoring/index.js +823 -661
  69. package/dist/data-app-sdk/index.js +32 -30
  70. package/dist/data-app-sdk-adapters/index.js +23 -22
  71. package/dist/data-app-sdk-validation/index.js +23 -22
  72. package/dist/format-utils/index.js +173 -168
  73. package/dist/index.js +267 -258
  74. package/dist/layouts/index.js +236 -24
  75. package/dist/report-runtime-context/index.js +2 -2
  76. package/dist/style.css +1 -1
  77. package/dist/surfboard/index.js +2 -2
  78. package/dist/types/assistant-context.d.ts +2 -0
  79. package/dist/types/assistant-protocol.d.ts +2 -0
  80. package/dist/types/components/assistant/assistant-entry-points.d.ts +18 -0
  81. package/dist/types/components/assistant/assistant-provider.d.ts +19 -0
  82. package/dist/types/components/assistant/assistant-store.d.ts +52 -0
  83. package/dist/types/components/assistant/use-assistant.d.ts +38 -0
  84. package/dist/types/components/index.d.ts +5 -1
  85. package/dist/types/components/surfboard/filter/types.d.ts +5 -2
  86. package/dist/types/index.js +50 -51
  87. package/dist/types/lib/api/invalidate-token.d.ts +7 -0
  88. package/dist/types/lib/charts/cartesian-fields.d.ts +64 -0
  89. package/dist/types/lib/charts/types.d.ts +7 -0
  90. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-storage-transition.d.ts +14 -2
  91. package/dist/types/lib/dashboard-inputs/dashboard-input-target-context.d.ts +5 -6
  92. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +8 -3
  93. package/dist/types/lib/dashboard-inputs/resolve-dashboard-input-context.d.ts +11 -6
  94. package/dist/types/lib/dashboard-pagination/dashboard-card-pagination.d.ts +7 -0
  95. package/dist/types/lib/dashboard-viewer/compatibility-input-storage.d.ts +79 -0
  96. package/dist/types/lib/dashboard-viewer/viewer-state.d.ts +3 -2
  97. package/dist/types/lib/document/document-table-data-policy.d.ts +15 -0
  98. package/dist/types/lib/filter-values/filter-mode.d.ts +22 -0
  99. package/dist/types/lib/hooks/use-calendar-context.d.ts +5 -0
  100. package/dist/types/lib/hooks/use-text-filter.d.ts +7 -0
  101. package/dist/types/lib/print/print-inputs.d.ts +4 -2
  102. package/dist/types/lib/query-context/build-card-query-context.d.ts +12 -4
  103. package/dist/types/lib/query-context/build-dashboard-execution-snapshot.d.ts +93 -0
  104. package/dist/types/lib/query-context/card-server-request.d.ts +72 -0
  105. package/dist/types/lib/query-context/compile-dashboard-card-filters.d.ts +7 -0
  106. package/dist/types/lib/query-context/describe-card-execution-snapshot.d.ts +56 -0
  107. package/dist/types/lib/query-context/document-section-card-query.d.ts +45 -0
  108. package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +17 -2
  109. package/dist/types/lib/stores/dashboard-store.d.ts +34 -11
  110. package/dist/types/lib/stores/editor-store.d.ts +4 -2
  111. package/dist/types/lib/types/token-types.d.ts +11 -0
  112. package/dist/types/lib/utils/card-type-change.d.ts +30 -0
  113. package/dist/types/lib/utils/comparison-window-caption.d.ts +12 -0
  114. package/dist/types/lib/utils/filter-default-value-utils.d.ts +13 -2
  115. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +74 -0
  116. package/dist/types/shared/analytics-protocol/contracts.d.ts +3 -0
  117. package/dist/types/shared/analytics-protocol/filter-field-ownership.d.ts +43 -0
  118. package/dist/types/shared/analytics-protocol/index.d.ts +3 -0
  119. package/dist/types/shared/analytics-protocol/matrix-window-contract.d.ts +1 -1
  120. package/dist/types/shared/analytics-protocol/visual-choice.d.ts +75 -0
  121. package/dist/types/shared/assistant-context/index.d.ts +9 -0
  122. package/dist/types/shared/assistant-context/project-context.d.ts +55 -0
  123. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +130 -0
  124. package/dist/types/shared/assistant-protocol/add-to-dashboard.d.ts +17 -0
  125. package/dist/types/shared/assistant-protocol/artifact.d.ts +63 -0
  126. package/dist/types/shared/assistant-protocol/availability.d.ts +39 -0
  127. package/dist/types/shared/assistant-protocol/context.d.ts +952 -0
  128. package/dist/types/shared/assistant-protocol/conversation.d.ts +38 -0
  129. package/dist/types/shared/assistant-protocol/index.d.ts +16 -0
  130. package/dist/types/shared/assistant-protocol/limits.d.ts +53 -0
  131. package/dist/types/shared/assistant-protocol/parts.d.ts +131 -0
  132. package/dist/types/shared/assistant-protocol/request.d.ts +77 -0
  133. package/dist/types/shared/assistant-protocol/sources.d.ts +27 -0
  134. package/dist/types/shared/assistant-protocol/token-config.d.ts +32 -0
  135. package/dist/types/shared/assistant-protocol/transcript.d.ts +40 -0
  136. package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +112 -0
  137. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +1794 -0
  138. package/dist/types/shared/dashboard-authoring/index.d.ts +5 -0
  139. package/dist/types/shared/dashboard-authoring/new-card.d.ts +10 -0
  140. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +40 -0
  141. package/dist/types/shared/dashboard-authoring/resolved-primary-date-field-validation.d.ts +16 -0
  142. package/dist/types/shared/format-utils/filter-detail.d.ts +70 -0
  143. package/dist/types/shared/format-utils/filter-value-text.d.ts +15 -0
  144. package/dist/types/shared/format-utils/index.d.ts +3 -0
  145. package/dist/types/shared/format-utils/raw-temporal.d.ts +7 -0
  146. package/dist/types/shared/format-utils/temporal-bucket.d.ts +7 -0
  147. package/dist/types/shared/layouts/frame-layouts.d.ts +23 -0
  148. package/dist/types/shared/layouts/index.d.ts +1 -0
  149. package/package.json +12 -2
  150. package/dist/chunks/calculated-field-identity-BptYhyOP.js +0 -1326
  151. package/dist/chunks/calendar-day-equality-BRjN1S9h.js +0 -383
  152. package/dist/chunks/card-config-utils-BOM1dxCk.js +0 -1150
  153. package/dist/chunks/constants-DNWVy8Y3.js +0 -9
  154. package/dist/chunks/dashboard-json-B1dEQu98.js +0 -65
  155. package/dist/chunks/field-aggregations-CoLzYHeL.js +0 -1229
  156. package/dist/chunks/index-DTcTAGGM.js +0 -4101
  157. package/dist/chunks/matrix-continuation-C4sRcjZU.js +0 -72
  158. package/dist/chunks/matrix-control-sources-DTqcA2_L.js +0 -636
  159. package/dist/chunks/matrix-definition-D9iShKZI.js +0 -87
  160. package/dist/chunks/matrix-member-presentation-Ct8GuxHt.js +0 -209
  161. package/dist/chunks/numeric-presentation-CWu3gunq.js +0 -537
  162. package/dist/chunks/pivot-header-presentation-CHs2GFrM.js +0 -753
  163. package/dist/chunks/pivot-result-lifecycle-DQz_gjGu.js +0 -789
  164. package/dist/chunks/raw-temporal-iMXRK-Qz.js +0 -930
  165. package/dist/chunks/report-preferences-dialog-DXPjteCU.js +0 -1623
  166. package/dist/chunks/save-kO6cIaob.js +0 -34
  167. package/dist/chunks/semantic-format-DiqYeKwU.js +0 -192
  168. package/dist/chunks/switch-DO8a0EfJ.js +0 -25004
  169. package/dist/chunks/temporal-input-presentation-BD7YNUzu.js +0 -195
  170. package/dist/chunks/x-CXDkqdur.js +0 -149
  171. package/dist/types/lib/class-utils.d.ts +0 -2
  172. package/dist/types/lib/document/document-input-runtime.d.ts +0 -26
  173. package/dist/types/lib/utils.d.ts +0 -51
@@ -0,0 +1,130 @@
1
+ import { TCard, TDashboard } from '../../lib/types/common-types.js';
2
+ import { CardViewStateMap } from '../../lib/dashboard-view-state/index.js';
3
+ import { SemanticExecutionPayload } from '../../lib/types/semantic-runtime-types.js';
4
+ import { CalendarContext } from '../report-runtime-context/index.js';
5
+ import { ViewerStoreInputValues } from '../../lib/dashboard-viewer/compatibility-input-storage.js';
6
+ import { DashboardCardExecutionSnapshotResult } from '../../lib/query-context/build-dashboard-execution-snapshot.js';
7
+ import { TransientInputContext } from '../../lib/dashboard-inputs/transient-input-context.js';
8
+ import { DashboardCardLocation } from '../dashboard-authoring/document-section-cards.js';
9
+ import { AssistantContext } from '../assistant-protocol/context.js';
10
+ import { AssistantCardRequest, AssistantCardUnavailable, AssistantCardUnavailableReason } from '../assistant-protocol/request.js';
11
+ /**
12
+ * A saved dashboard as a fresh viewer opens it (saved defaults, no bookmark),
13
+ * as the assistant's context: the regression set's dashboard cases
14
+ * (analytics agent Plan 1, ledger D3a-9). Each step is the owner the browser
15
+ * uses: the viewer baseline, the store's input values, the card's location,
16
+ * the card's snapshot where it sits, and the projection.
17
+ */
18
+ /** Where a case puts the viewer. */
19
+ export type SavedDashboardPlace = {
20
+ /** The sheet on screen: by default the asked-about card's sheet, else the first sheet. */
21
+ sheetId?: string;
22
+ /** The card asked about. */
23
+ cardId?: string;
24
+ /** Drill paths by card. */
25
+ cardViewState?: CardViewStateMap;
26
+ };
27
+ /** The store's input values plus drill paths: what a card's snapshot is built from. */
28
+ export type CardRuntimeValues = ViewerStoreInputValues & {
29
+ cardViewState: CardViewStateMap;
30
+ };
31
+ export declare function projectSavedDashboardContext(input: {
32
+ dashboard: TDashboard;
33
+ place: SavedDashboardPlace;
34
+ semanticExecutionPayload: SemanticExecutionPayload | undefined;
35
+ /** The report calendar the dashboard opens with; its zone is the viewer's. */
36
+ calendar: CalendarContext;
37
+ }): AssistantContext;
38
+ /**
39
+ * What a browser opening the saved dashboard at `place` sends with a message:
40
+ * the context and, for an asked-about card, its replay fields, both from the
41
+ * one snapshot (ledger P3-92). The regression set sends exactly this.
42
+ */
43
+ export declare function projectSavedDashboardTurn(input: {
44
+ dashboard: TDashboard;
45
+ place: SavedDashboardPlace;
46
+ semanticExecutionPayload: SemanticExecutionPayload | undefined;
47
+ calendar: CalendarContext;
48
+ }): {
49
+ context: AssistantContext;
50
+ cardReplay?: AssistantCardReplayFields;
51
+ };
52
+ /** The turn request's fields for an asked-about card: its request, or why it has none. */
53
+ export type AssistantCardReplayFields = {
54
+ selectedCardRequest: AssistantCardRequest;
55
+ } | {
56
+ selectedCardUnavailable: AssistantCardUnavailable;
57
+ };
58
+ /**
59
+ * The asked-about card's replay fields, where the card sits on the dashboard,
60
+ * by the rule an external client's saved card follows (`cardReplayOf`). The
61
+ * browser sends these with every message about a card (D3b-2, P3-92).
62
+ */
63
+ export declare function assistantCardReplayFields(input: {
64
+ dashboard: TDashboard | undefined;
65
+ cardId: string;
66
+ snapshot: DashboardCardExecutionSnapshotResult | 'pending';
67
+ /** The card the snapshot runs when it is not the dashboard's copy: the editor's draft (D5-3). */
68
+ card?: Pick<TCard, 'type'>;
69
+ }): AssistantCardReplayFields;
70
+ /**
71
+ * A card's execution snapshot outside the store, where the card sits, with
72
+ * the arguments its store adapter passes: the card is its own override, and a
73
+ * document section card runs as its section does on the page.
74
+ */
75
+ export declare function buildLocatedCardSnapshot(input: {
76
+ dashboard: TDashboard;
77
+ location: DashboardCardLocation;
78
+ runtimeValues: CardRuntimeValues;
79
+ semanticExecutionPayload: SemanticExecutionPayload | undefined;
80
+ /** The report calendar the card runs in. */
81
+ calendar: CalendarContext;
82
+ /** What a drill-through carried onto this dashboard; a fresh viewer has none. */
83
+ transientContexts?: readonly TransientInputContext[];
84
+ /** Also carry the card's request (D3b-2). */
85
+ withRequest?: boolean;
86
+ }): DashboardCardExecutionSnapshotResult;
87
+ /** Why a saved card has no request to replay. */
88
+ export type SavedCardRequestRefusal = 'card_not_found' | Exclude<AssistantCardUnavailableReason, 'pending'>;
89
+ /**
90
+ * A card's request for a server replay, or why it has none: one rule for an
91
+ * external client's saved card (`buildSavedCardRequest`) and the browser's
92
+ * asked-about card (analytics agent Plan 1, D3b-2, ledger P3-92). A card in
93
+ * a Document section runs with its page's inputs, a Matrix card on its window
94
+ * path; a card whose filter mapping is blocked, or with no snapshot, cannot
95
+ * run; a card with no query (text) has nothing to run.
96
+ */
97
+ export declare function cardReplayOf(input: {
98
+ /** The card where it sits; its kind decides before its snapshot does. */
99
+ card: Pick<TCard, 'type'> | undefined;
100
+ snapshot: DashboardCardExecutionSnapshotResult | 'pending';
101
+ documentSection: boolean;
102
+ }): {
103
+ status: 'ready';
104
+ request: AssistantCardRequest;
105
+ } | {
106
+ status: 'unavailable';
107
+ reason: AssistantCardUnavailableReason;
108
+ message?: string;
109
+ };
110
+ /**
111
+ * A saved card's request as a fresh viewer opens it (saved defaults, no
112
+ * bookmark, no drill), for an external client's `fromCard` replay
113
+ * (analytics agent Plan 1, Phase 3b, D3b-2). The same owners as the context:
114
+ * the viewer baseline, the store's input values, the card's snapshot with its
115
+ * request, and the server-request owner CSV export shares. Pure; the caller
116
+ * loads the dashboard, its semantic payload and calendar, and checks access.
117
+ */
118
+ export declare function buildSavedCardRequest(input: {
119
+ dashboard: TDashboard;
120
+ cardId: string;
121
+ semanticExecutionPayload: SemanticExecutionPayload | undefined;
122
+ calendar: CalendarContext;
123
+ }): {
124
+ status: 'ready';
125
+ request: AssistantCardRequest;
126
+ } | {
127
+ status: 'refused';
128
+ reason: SavedCardRequestRefusal;
129
+ message?: string;
130
+ };
@@ -0,0 +1,17 @@
1
+ import { TChartType } from '../../lib/charts/types.js';
2
+ import { TCard } from '../../lib/types/common-types.js';
3
+ import { VisualKind } from '../analytics-protocol/visual-choice.js';
4
+ /**
5
+ * Add to dashboard (analytics agent Plan 1, Phase 7a, D7-4, D7-5): a result
6
+ * carries its card form, the one its execution recorded, and the browser adds
7
+ * it through the dashboard reducer (`applyDashboardOperations`) with no
8
+ * request: the turn that showed the result already checked who may see it.
9
+ */
10
+ /** The card type each chat kind becomes. */
11
+ export declare const ASSISTANT_CARD_TYPES: Record<VisualKind, TChartType>;
12
+ /**
13
+ * A result's card, as its execution recorded it: a governed answer's
14
+ * compiled config and data source, or an advanced SQL answer's statement and
15
+ * Python step. Title, type and ids come at Add.
16
+ */
17
+ export type AssistantArtifactCardForm = Pick<TCard, 'connectionId' | 'config' | 'dataSource' | 'sql' | 'python'>;
@@ -0,0 +1,63 @@
1
+ import { SemaphorDialect, SemaphorResultColumn, SemaphorSourceRef } from '../analytics-protocol/contracts.js';
2
+ import { VisualChoiceInput, VisualKind, VisualSpec } from '../analytics-protocol/visual-choice.js';
3
+ import { AssistantArtifactCardForm } from './add-to-dashboard.js';
4
+ /**
5
+ * An answer's artifact (analytics agent Plan 1, spec 2.5, Phase 4): rows from
6
+ * a governed result the model chose to show (`show_result`), built only on
7
+ * the server from that result, never from model text (D4-2, D4-3). Stored on
8
+ * the turn as an `artifact` part, so history shows it as it streamed. Its
9
+ * visual is decided on the server by `chooseVisual` over the same rows (4b).
10
+ */
11
+ export type AssistantArtifact = {
12
+ version: 1;
13
+ /** Unique within the conversation. */
14
+ artifactId: string;
15
+ title: string;
16
+ /** What it opens as: `chooseVisual`'s default, or the kind the model asked for (D4b-2, D4b-3). */
17
+ visual: VisualSpec;
18
+ /** Kinds the toggle offers, default first. */
19
+ eligible: VisualKind[];
20
+ columns: SemaphorResultColumn[];
21
+ /** At most ASSISTANT_LIMITS.artifactRecords. */
22
+ records: Array<Record<string, unknown>>;
23
+ /** Rows in the whole result. */
24
+ rowCount: number;
25
+ status: {
26
+ /** 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 the query hit its row limit). */
31
+ truncated: boolean;
32
+ };
33
+ /** How it was calculated, for the viewer; display only, never executed. */
34
+ origin: {
35
+ kind: 'fields';
36
+ source?: SemaphorSourceRef;
37
+ measures: string[];
38
+ dimensions: string[];
39
+ filters: string[];
40
+ } | {
41
+ kind: 'sql';
42
+ dialect?: SemaphorDialect;
43
+ sql: string;
44
+ };
45
+ /** The executed query behind it, resolved only on the server against the owner-checked record. */
46
+ queryRef: {
47
+ conversationId: string;
48
+ turnId: string;
49
+ artifactId: string;
50
+ };
51
+ /**
52
+ * Its card, for Add to dashboard (Phase 7a, D7-4): the form its execution
53
+ * recorded. Absent: not addable (a period change, a snapshot, a replay of a
54
+ * card already on the dashboard, a result stored before Phase 7a). For the
55
+ * browser only; the model never reads message parts (AG-INV-5).
56
+ */
57
+ card?: AssistantArtifactCardForm;
58
+ };
59
+ /**
60
+ * What `chooseVisual` reads from an artifact: the server deciding its visual
61
+ * and the toggle asking for another kind read the same input.
62
+ */
63
+ export declare function visualInputOf(artifact: Pick<AssistantArtifact, 'columns' | 'records' | 'rowCount' | 'status'>): VisualChoiceInput;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Whether the assistant is available (analytics agent Plan 1, spec 2.3,
3
+ * module M2). The browser hides every entry point on `available: false`; the
4
+ * server refuses with the same reason (AG-D13, AG-INV-7).
5
+ */
6
+ export type AssistantAvailabilityInput = {
7
+ /** Feature switches: resolved project features (server), or `projectFeatures.features` from the token (browser). */
8
+ features: {
9
+ aiFeatures?: boolean;
10
+ assistant?: boolean;
11
+ /** The deleted assistant's switch, still stored in some policies. */
12
+ dashboardAssistant?: boolean;
13
+ };
14
+ /** The token's `config.assistant.enabled`, as `readAssistantTokenConfig` reads it (the old flag included). */
15
+ config: {
16
+ enabled: boolean | undefined;
17
+ };
18
+ identity: {
19
+ orgUserId?: string;
20
+ tenantId?: string;
21
+ endUserId?: string;
22
+ };
23
+ /** Whether a model key is configured. Server: resolveAssistantModel() !== undefined. Browser: true. */
24
+ modelConfigured: boolean;
25
+ };
26
+ export type AssistantUnavailableReason = 'not_configured' | 'ai_features_off' | 'assistant_off' | 'not_enabled_for_token' | 'no_user_identity';
27
+ export type AssistantAvailability = {
28
+ available: true;
29
+ } | {
30
+ available: false;
31
+ reason: AssistantUnavailableReason;
32
+ };
33
+ /**
34
+ * Pure. Checked in order; the first that fails is the reason: model key,
35
+ * master switch, assistant switch (or the old switch when it is unset), token
36
+ * flag (`config.assistant.enabled`, or the old flag when it is unset), user
37
+ * identity.
38
+ */
39
+ export declare function resolveAssistantAvailability(input: AssistantAvailabilityInput): AssistantAvailability;