react-semaphor 0.1.545 → 0.1.547

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 (159) hide show
  1. package/dist/analytics-protocol/index.js +408 -442
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +100 -76
  4. package/dist/brand-studio/index.js +4 -4
  5. package/dist/briefings/index.js +6 -6
  6. package/dist/chunks/{add-to-dashboard-BuAqfA2Y.js → add-to-dashboard-BQRAAnc3.js} +55 -33
  7. package/dist/chunks/{analytics-base-schemas-BFAoRlkU.js → analytics-base-schemas-BKs3flFS.js} +2 -2
  8. package/dist/chunks/applied-constraints-DU-wndZ7.js +47 -0
  9. package/dist/chunks/{assistant-chat-D7sWTypJ.js → assistant-chat-CK84cPAB.js} +2826 -2595
  10. package/dist/chunks/{bookmark-state-CXw7lZ50.js → bookmark-state-Cu-a5ie_.js} +8 -15
  11. package/dist/chunks/comparison-window-caption-C2xF-eWw.js +1433 -0
  12. package/dist/chunks/{context-ClREvqCZ.js → context-BerEBuFR.js} +11 -6
  13. package/dist/chunks/custom-visual-inputs-ChL54gGm.js +295 -0
  14. package/dist/chunks/{dashboard-B1tMju0u.js → dashboard-DCk26-6i.js} +1 -1
  15. package/dist/chunks/{dashboard-briefing-launcher-CePgIu0Z.js → dashboard-briefing-launcher-CQ1eYsGy.js} +1291 -1277
  16. package/dist/chunks/dashboard-controls-BMeZjF7r.js +2307 -0
  17. package/dist/chunks/{dashboard-json-CoYRPqxx.js → dashboard-json-BZqCoanC.js} +5 -5
  18. package/dist/chunks/{document-dashboard-inputs-BesAHZvB.js → document-dashboard-inputs-tYd7ao0o.js} +877 -979
  19. package/dist/chunks/{edit-dashboard-visual-JPtNfJRb.js → edit-dashboard-visual-Bv3MHM_G.js} +2157 -2243
  20. package/dist/chunks/filter-reach-copy-CGWsL_ez.js +3480 -0
  21. package/dist/chunks/{filter-value-text-ff7osJr7.js → filter-value-text-Ddf55Ku1.js} +9 -9
  22. package/dist/chunks/global-date-filter-utils-BhAu8zIM.js +12137 -0
  23. package/dist/chunks/index-CtoK1Lgu.js +586 -0
  24. package/dist/chunks/{index-DRWiuqyd.js → index-DmrLP5Ro.js} +105 -104
  25. package/dist/chunks/list-filter-DsaTbM3J.js +15 -0
  26. package/dist/chunks/matrix-analytical-definition-B9vW-osb.js +717 -0
  27. package/dist/chunks/{matrix-card-DjwWcCo8.js → matrix-card-LiMEipvq.js} +3 -3
  28. package/dist/chunks/{matrix-formatter-DnCyRXJE.js → matrix-formatter-DWEeC0_c.js} +44 -44
  29. package/dist/chunks/{matrix-member-presentation-CQGdVks6.js → matrix-member-presentation-DqzG-UhQ.js} +1 -1
  30. package/dist/chunks/{matrix-operation-contract-8OIO4gob.js → matrix-operation-contract-D6vYkZK4.js} +72 -72
  31. package/dist/chunks/{metric-comparison-DEwi9uc2.js → metric-comparison-zpGw4lD6.js} +2 -2
  32. package/dist/chunks/normalize-dashboard-for-dirty-check-XKgH3GFX.js +119 -0
  33. package/dist/chunks/{pivot-header-presentation-DHcx1XGQ.js → pivot-header-presentation-CQnIDtUv.js} +1 -1
  34. package/dist/chunks/{pivot-result-identity-DJhXXcns.js → pivot-result-identity-C-Q1j1Wb.js} +1 -1
  35. package/dist/chunks/{pivot-result-lifecycle-DM4CyGKs.js → pivot-result-lifecycle-pwq3b7LC.js} +571 -380
  36. package/dist/chunks/{raw-temporal-contract-C51YG48G.js → raw-temporal-contract-WuXA8jBP.js} +1 -1
  37. package/dist/chunks/{raw-temporal-presentation-C3mUgnEx.js → raw-temporal-presentation-DypB7sMX.js} +8 -8
  38. package/dist/chunks/{report-preferences-dialog-DUtuUL_5.js → report-preferences-dialog-DoVyriYC.js} +154 -155
  39. package/dist/chunks/{report-runtime-context-Dq8XyODK.js → report-runtime-context-hWiTCzFV.js} +2 -2
  40. package/dist/chunks/resolve-dashboard-input-context-D0JDUa4h.js +5576 -0
  41. package/dist/chunks/{saved-dashboard-context-LrF_kW0l.js → saved-dashboard-context-BfAH5j4L.js} +34 -34
  42. package/dist/chunks/{selection-reducer-Dj_8xD69.js → selection-reducer-CJzkTZio.js} +15 -15
  43. package/dist/chunks/{semaphor-ready-indicator-BxF96Yhv.js → semaphor-ready-indicator-CRm17oIP.js} +51771 -52574
  44. package/dist/chunks/{shelf-drop-preview-context-CNaM_Gmh.js → shelf-drop-preview-context-vy6P9THz.js} +7 -7
  45. package/dist/chunks/{source-entity-resolution-BYn9giz3.js → source-entity-resolution-BIGRvtbG.js} +13 -13
  46. package/dist/chunks/{switch-uDtPgQlQ.js → switch-CEBOR4n7.js} +3 -3
  47. package/dist/chunks/{table-export-sheet-YzMioA7Y.js → table-export-sheet-4X9mAG3V.js} +1 -1
  48. package/dist/chunks/table-settings-WysCBj62.js +614 -0
  49. package/dist/chunks/{temporal-bucket-D7NBrrtL.js → temporal-bucket-CQOSbv9-.js} +26 -26
  50. package/dist/chunks/{token-types-DBbZVQsm.js → token-types-BMqRmT-C.js} +1 -1
  51. package/dist/chunks/{use-create-flow-overlay-state-CjB7ig1o.js → use-create-flow-overlay-state-Csx_Xjsh.js} +101 -101
  52. package/dist/chunks/{validators-DMHTpf7a.js → validators-C-aOQlTB.js} +713 -658
  53. package/dist/chunks/{relative-date-label-Bk2j94pA.js → zoned-wall-clock-MulfA26h.js} +64 -21
  54. package/dist/dashboard/index.js +2 -2
  55. package/dist/dashboard-authoring/index.js +1895 -1163
  56. package/dist/data-app-sdk/index.js +6 -6
  57. package/dist/data-app-sdk-adapters/index.js +3 -3
  58. package/dist/data-app-sdk-validation/index.js +14 -14
  59. package/dist/format-utils/index.js +133 -133
  60. package/dist/index.js +192 -186
  61. package/dist/layouts/index.js +5 -242
  62. package/dist/report-runtime-context/index.js +2 -2
  63. package/dist/shared/index.js +4 -5
  64. package/dist/style.css +1 -1
  65. package/dist/surfboard/index.js +2 -2
  66. package/dist/types/components/index.d.ts +2 -0
  67. package/dist/types/components/surfboard/arrange-layout-button.d.ts +8 -0
  68. package/dist/types/components/surfboard/filter/types.d.ts +7 -0
  69. package/dist/types/components/surfboard/screen-size-preview-button.d.ts +10 -0
  70. package/dist/types/components/visual/matrix-table/matrix-card-view.d.ts +3 -0
  71. package/dist/types/index.js +6 -6
  72. package/dist/types/lib/charts/table-chart-types.d.ts +4 -0
  73. package/dist/types/lib/charts/types.d.ts +2 -2
  74. package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +346 -21
  75. package/dist/types/lib/dashboard-inputs/dashboard-filter-value-identity.d.ts +65 -0
  76. package/dist/types/lib/dashboard-inputs/dashboard-input-values.d.ts +6 -0
  77. package/dist/types/lib/dashboard-inputs/filter-settings.d.ts +2 -0
  78. package/dist/types/lib/dashboard-inputs/prepare-loaded-dashboard.d.ts +15 -0
  79. package/dist/types/lib/dashboard-inputs/resolve-selection-input.d.ts +3 -3
  80. package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
  81. package/dist/types/lib/matrix-table/matrix-delivery-policy.d.ts +1 -1
  82. package/dist/types/lib/matrix-table/matrix-editor.d.ts +52 -0
  83. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +9 -1
  84. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +5 -1
  85. package/dist/types/lib/query-context/dashboard-filter-mapping-resolution.d.ts +149 -10
  86. package/dist/types/lib/stores/dashboard-store.d.ts +137 -6
  87. package/dist/types/lib/types/common-types.d.ts +8 -0
  88. package/dist/types/lib/types/explorer-types.d.ts +10 -0
  89. package/dist/types/lib/types/semantic-types.d.ts +84 -0
  90. package/dist/types/lib/utils/build-saved-editor-card.d.ts +20 -0
  91. package/dist/types/lib/utils/card-type-change.d.ts +16 -0
  92. package/dist/types/lib/utils/field-availability-context.d.ts +25 -0
  93. package/dist/types/lib/utils/field-placement.d.ts +96 -0
  94. package/dist/types/lib/utils/field-state-calculator.d.ts +161 -0
  95. package/dist/types/lib/utils/qualified-entity-name.d.ts +2 -0
  96. package/dist/types/shared/analytics-protocol/applied-constraints.d.ts +57 -1
  97. package/dist/types/shared/analytics-protocol/field-provenance.d.ts +89 -0
  98. package/dist/types/shared/analytics-protocol/index.d.ts +2 -0
  99. package/dist/types/shared/analytics-protocol/query-policies.d.ts +52 -0
  100. package/dist/types/shared/analytics-protocol/time-window-schema.d.ts +1 -1
  101. package/dist/types/shared/analytics-protocol/time-window.d.ts +40 -1
  102. package/dist/types/shared/assistant-context/saved-dashboard-context.d.ts +4 -1
  103. package/dist/types/shared/assistant-protocol/answer-text.d.ts +20 -0
  104. package/dist/types/shared/assistant-protocol/context.d.ts +29 -29
  105. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  106. package/dist/types/shared/assistant-protocol/limits.d.ts +6 -1
  107. package/dist/types/shared/assistant-protocol/parts.d.ts +43 -3
  108. package/dist/types/shared/assistant-protocol/request.d.ts +14 -2
  109. package/dist/types/shared/dashboard-authoring/calculated-field-identity.d.ts +3 -0
  110. package/dist/types/shared/dashboard-authoring/changes/card-query-part.d.ts +487 -0
  111. package/dist/types/shared/dashboard-authoring/changes/card-types.d.ts +34 -0
  112. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +7886 -0
  113. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +45 -0
  114. package/dist/types/shared/dashboard-authoring/changes/read-card-query.d.ts +54 -0
  115. package/dist/types/shared/dashboard-authoring/changes/resolve-dashboard-changes.d.ts +96 -0
  116. package/dist/types/shared/dashboard-authoring/click-to-filter-settings.d.ts +3 -3
  117. package/dist/types/shared/dashboard-authoring/column-catalog.d.ts +32 -0
  118. package/dist/types/shared/dashboard-authoring/contracts.d.ts +0 -55
  119. package/dist/types/shared/dashboard-authoring/control-execution-contract.d.ts +24 -14
  120. package/dist/types/shared/dashboard-authoring/dashboard-card-source-index.d.ts +9 -1
  121. package/dist/types/shared/dashboard-authoring/dashboard-filter-automatic-target.d.ts +4 -4
  122. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +3 -1
  123. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-types.d.ts +27 -1
  124. package/dist/types/shared/dashboard-authoring/dashboard-filter-value-compatibility.d.ts +12 -3
  125. package/dist/types/shared/dashboard-authoring/dashboard-input-scope.d.ts +26 -0
  126. package/dist/types/shared/dashboard-authoring/filter-applicability.d.ts +75 -0
  127. package/dist/types/shared/dashboard-authoring/filter-reach-copy.d.ts +18 -0
  128. package/dist/types/shared/dashboard-authoring/filter-reach-preview.d.ts +97 -0
  129. package/dist/types/shared/dashboard-authoring/index.d.ts +22 -2
  130. package/dist/types/shared/dashboard-authoring/operations/apply-dashboard-operations.d.ts +10 -37
  131. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +189 -0
  132. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +101 -0
  133. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +100 -0
  134. package/dist/types/shared/dashboard-authoring/semantic-auto-join-card.d.ts +22 -0
  135. package/dist/types/shared/dashboard-authoring/validators.d.ts +1 -2
  136. package/dist/types/shared/layouts/engine/grid.d.ts +25 -0
  137. package/dist/types/shared/layouts/engine/index.d.ts +4 -0
  138. package/dist/types/shared/layouts/engine/sheet-layout.d.ts +7 -0
  139. package/dist/types/shared/layouts/engine/types.d.ts +125 -0
  140. package/dist/types/shared/layouts/index.d.ts +1 -2
  141. package/package.json +2 -2
  142. package/dist/chunks/apply-dashboard-operations-CZEMsx8E.js +0 -2080
  143. package/dist/chunks/calendar-day-equality-dvoQp1xW.js +0 -410
  144. package/dist/chunks/comparison-window-caption-D4E6IHPD.js +0 -1624
  145. package/dist/chunks/custom-visual-inputs-DLCD9Y5V.js +0 -329
  146. package/dist/chunks/dashboard-controls-Cq05n3e0.js +0 -2315
  147. package/dist/chunks/dashboard-filter-value-compatibility-CwQ_iSNb.js +0 -108
  148. package/dist/chunks/matrix-analytical-definition-C7Gb0e12.js +0 -117
  149. package/dist/chunks/normalize-dashboard-for-dirty-check-Bk3VYv_q.js +0 -67
  150. package/dist/chunks/numeric-presentation-7X_IrD58.js +0 -5226
  151. package/dist/chunks/resolve-dashboard-input-context-DJ2tICwz.js +0 -9415
  152. package/dist/chunks/stable-serialize-CfqXeiBP.js +0 -6
  153. package/dist/chunks/table-settings-CLZocegs.js +0 -501
  154. package/dist/chunks/use-debounced-dirty-check-BwAbnX_5.js +0 -59
  155. package/dist/chunks/zoned-wall-clock-BkxV9jS2.js +0 -46
  156. package/dist/types/shared/dashboard-authoring/change-compiler.d.ts +0 -7
  157. package/dist/types/shared/dashboard-authoring/layout-compiler.d.ts +0 -2
  158. package/dist/types/shared/layouts/create-frame-layouts.d.ts +0 -27
  159. package/dist/types/shared/layouts/frame-layouts.d.ts +0 -23
@@ -160,7 +160,7 @@ export declare function semaphorTimeWindowSchemas(options?: {
160
160
  start: string;
161
161
  end: string;
162
162
  }>;
163
- timeWindow: z.ZodUnion<[z.ZodEffects<z.ZodObject<{
163
+ timeWindow: z.ZodUnion<readonly [z.ZodEffects<z.ZodObject<{
164
164
  kind: z.ZodOptional<z.ZodLiteral<"relative">>;
165
165
  unit: z.ZodEnum<["second", "minute", "hour", "day", "week", "month", "quarter", "year"]>;
166
166
  value: z.ZodNumber;
@@ -1,4 +1,5 @@
1
- import { SemaphorRelativeTimeWindow, SemaphorTimeGrain } from './contracts.js';
1
+ import { SemaphorCalendarTimeWindow, SemaphorRelativeTimeWindow, SemaphorTimeGrain, SemaphorTimeWindow } from './contracts.js';
2
+ import { RelativeDateFilter } from './relative-date-filter.js';
2
3
  /** Units a calendar window ("this month", "previous quarter") can name. */
3
4
  export declare const SEMAPHOR_CALENDAR_TIME_WINDOW_UNITS: readonly ["day", "week", "month", "quarter", "year"];
4
5
  export declare const SEMAPHOR_CALENDAR_TIME_WINDOW_PERIODS: readonly ["this", "previous"];
@@ -11,3 +12,41 @@ export declare const SEMAPHOR_TIME_WINDOW_MAX_VALUE: Readonly<Record<SemaphorTim
11
12
  * latest available data; a saved card that should keep rolling states "now".
12
13
  */
13
14
  export declare function resolveTimeWindowAnchor(timeWindow: Pick<SemaphorRelativeTimeWindow, 'anchor'>): 'now' | 'latest_available';
15
+ /** A rolling "last N units" window (`kind` "relative" or omitted). */
16
+ export declare function isRelativeTimeWindow(timeWindow: SemaphorTimeWindow | null | undefined): timeWindow is SemaphorRelativeTimeWindow;
17
+ /** A whole calendar period, such as this month or the previous quarter. */
18
+ export declare function isCalendarTimeWindow(timeWindow: SemaphorTimeWindow | null | undefined): timeWindow is SemaphorCalendarTimeWindow;
19
+ /**
20
+ * A window as a dashboard filter's default. Filter defaults run to now (the
21
+ * editor's presets and the filter runtime have no latest-data anchor), so a
22
+ * rolling window without an anchor is anchored at now, and one anchored to
23
+ * the latest available data is not a filter default (null), never quietly
24
+ * moved to now. The one conversion every writer and checker of a filter
25
+ * default uses.
26
+ */
27
+ export declare function timeWindowToFilterDefault(timeWindow: SemaphorTimeWindow): RelativeDateFilter | null;
28
+ /** A rolling week, month, quarter or year that includes the current, partial one: no filter preset holds it. */
29
+ export declare function isPartialRollingPeriod(timeWindow: SemaphorTimeWindow): boolean;
30
+ /**
31
+ * The time window a filter default states, the inverse of
32
+ * `timeWindowToFilterDefault`, so what an agent reads back is what it would
33
+ * write: the last N days with today (`between` days from 1-N to 0), complete
34
+ * periods, this or the previous period; a rolling window saved before is
35
+ * read as rolling. Null for any other stored default, such as `between` on
36
+ * whole weeks or months, which no time window states.
37
+ */
38
+ export declare function filterDefaultToTimeWindow(meta: RelativeDateFilter): SemaphorTimeWindow | null;
39
+ /**
40
+ * The relative date an agent time window persists as (plan D10, amended by
41
+ * analytics kernel K11), or null when it can't stay relative: absolute
42
+ * windows, second units, and complete minute or hour periods. A window
43
+ * anchored to the latest available data (an omitted anchor included) counts
44
+ * back from its own field's data anchor (`relativeTo: 'latest_data'`).
45
+ * `completeness` is the completeness the run used, when it was inferred.
46
+ * Moved from semaphor-app's query-spec-filters so a card's date window and a
47
+ * dashboard filter's default period convert through one owner (MCP dashboard
48
+ * editing, ledger P3-04).
49
+ */
50
+ export declare function timeWindowToRelativeDateFilter(timeWindow: SemaphorTimeWindow, options?: {
51
+ completeness?: 'include_partial' | 'complete_periods';
52
+ }): RelativeDateFilter | null;
@@ -35,7 +35,9 @@ export declare function projectSavedDashboardContext(input: {
35
35
  /**
36
36
  * What a browser opening the saved dashboard at `place` sends with a message:
37
37
  * the context and, for an asked-about card, its replay fields, both from the
38
- * one snapshot (ledger P3-92). The regression set sends exactly this.
38
+ * one snapshot (ledger P3-92), and the dashboard it projected, which a person
39
+ * who may change it sends as `openDashboard` (Phase 7, D7-29). The regression
40
+ * set sends exactly this.
39
41
  */
40
42
  export declare function projectSavedDashboardTurn(input: {
41
43
  dashboard: TDashboard;
@@ -45,6 +47,7 @@ export declare function projectSavedDashboardTurn(input: {
45
47
  }): {
46
48
  context: AssistantContext;
47
49
  cardReplay?: AssistantCardReplayFields;
50
+ openDashboard: TDashboard;
48
51
  };
49
52
  /** The turn request's fields for an asked-about card: its request, or why it has none. */
50
53
  export type AssistantCardReplayFields = {
@@ -0,0 +1,20 @@
1
+ import { AssistantPart } from './parts.js';
2
+ /**
3
+ * Which of an answer's text is the answer (analytics agent Plan 1, P7-23):
4
+ * its last run of text, the text after the last step that more text follows.
5
+ * Text the model wrote before such a step ("Need the domain and fields.") is
6
+ * a working note: the transcript shows it while the assistant works, and not
7
+ * as the answer once more text follows a later step. An answer followed by a
8
+ * last query and nothing after it keeps its text, so no answer that wrote
9
+ * anything comes out empty. A step is a stage that reads data (a query, a
10
+ * lookup); a change to the dashboard, showing a result or asking the person a
11
+ * question is not one, so an answer written before its change stays the
12
+ * answer (P7-45). One rule for the transcript, the turn record and the eval.
13
+ */
14
+ export type AnswerPartKind = 'text' | 'step' | 'other';
15
+ /** The parts that are working notes: text before the last step that comes before the answer's last text. */
16
+ export declare function workingNotesOf<T>(parts: readonly T[], kindOf: (part: T) => AnswerPartKind): ReadonlySet<T>;
17
+ /** A stored part's kind for `workingNotesOf`. */
18
+ export declare function storedPartKind(part: AssistantPart): AnswerPartKind;
19
+ /** A stored answer's text: its text parts after the last step, a paragraph each. */
20
+ export declare function answerTextOf(parts: readonly AssistantPart[]): string;
@@ -247,14 +247,14 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
247
247
  kind: "set";
248
248
  text: string;
249
249
  fingerprint: string;
250
- omittedValues?: number | undefined;
251
250
  notApplied?: "opened_from_another_dashboard" | undefined;
251
+ omittedValues?: number | undefined;
252
252
  }, {
253
253
  kind: "set";
254
254
  text: string;
255
255
  fingerprint: string;
256
- omittedValues?: number | undefined;
257
256
  notApplied?: "opened_from_another_dashboard" | undefined;
257
+ omittedValues?: number | undefined;
258
258
  }>, z.ZodObject<{
259
259
  kind: z.ZodLiteral<"varies">;
260
260
  }, "strict", z.ZodTypeAny, {
@@ -268,8 +268,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
268
268
  kind: "set";
269
269
  text: string;
270
270
  fingerprint: string;
271
- omittedValues?: number | undefined;
272
271
  notApplied?: "opened_from_another_dashboard" | undefined;
272
+ omittedValues?: number | undefined;
273
273
  } | {
274
274
  kind: "varies";
275
275
  };
@@ -281,8 +281,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
281
281
  kind: "set";
282
282
  text: string;
283
283
  fingerprint: string;
284
- omittedValues?: number | undefined;
285
284
  notApplied?: "opened_from_another_dashboard" | undefined;
285
+ omittedValues?: number | undefined;
286
286
  } | {
287
287
  kind: "varies";
288
288
  };
@@ -335,11 +335,11 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
335
335
  omittedValues: z.ZodOptional<z.ZodNumber>;
336
336
  }, "strict", z.ZodTypeAny, {
337
337
  text: string;
338
- origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
338
+ origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
339
339
  omittedValues?: number | undefined;
340
340
  }, {
341
341
  text: string;
342
- origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
342
+ origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
343
343
  omittedValues?: number | undefined;
344
344
  }>, "many">;
345
345
  controls: z.ZodArray<z.ZodObject<{
@@ -379,26 +379,26 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
379
379
  text: string;
380
380
  }>>;
381
381
  comparisons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
382
- omitted: z.ZodOptional<z.ZodObject<Record<"filters" | "controls" | "fields" | "comparisons" | "drillSteps" | "sqlParameters", z.ZodOptional<z.ZodNumber>>, "strict", z.ZodTypeAny, {
382
+ omitted: z.ZodOptional<z.ZodObject<Record<"filters" | "controls" | "fields" | "drillSteps" | "comparisons" | "sqlParameters", z.ZodOptional<z.ZodNumber>>, "strict", z.ZodTypeAny, {
383
383
  filters?: number | undefined;
384
384
  controls?: number | undefined;
385
385
  fields?: number | undefined;
386
- comparisons?: number | undefined;
387
386
  drillSteps?: number | undefined;
387
+ comparisons?: number | undefined;
388
388
  sqlParameters?: number | undefined;
389
389
  }, {
390
390
  filters?: number | undefined;
391
391
  controls?: number | undefined;
392
392
  fields?: number | undefined;
393
- comparisons?: number | undefined;
394
393
  drillSteps?: number | undefined;
394
+ comparisons?: number | undefined;
395
395
  sqlParameters?: number | undefined;
396
396
  }>>;
397
397
  }, "strict", z.ZodTypeAny, {
398
398
  status: "described";
399
399
  filters: {
400
400
  text: string;
401
- origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
401
+ origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
402
402
  omittedValues?: number | undefined;
403
403
  }[];
404
404
  controls: {
@@ -425,15 +425,15 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
425
425
  filters?: number | undefined;
426
426
  controls?: number | undefined;
427
427
  fields?: number | undefined;
428
- comparisons?: number | undefined;
429
428
  drillSteps?: number | undefined;
429
+ comparisons?: number | undefined;
430
430
  sqlParameters?: number | undefined;
431
431
  } | undefined;
432
432
  }, {
433
433
  status: "described";
434
434
  filters: {
435
435
  text: string;
436
- origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
436
+ origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
437
437
  omittedValues?: number | undefined;
438
438
  }[];
439
439
  controls: {
@@ -460,8 +460,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
460
460
  filters?: number | undefined;
461
461
  controls?: number | undefined;
462
462
  fields?: number | undefined;
463
- comparisons?: number | undefined;
464
463
  drillSteps?: number | undefined;
464
+ comparisons?: number | undefined;
465
465
  sqlParameters?: number | undefined;
466
466
  } | undefined;
467
467
  }>, z.ZodObject<{
@@ -487,7 +487,7 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
487
487
  status: "described";
488
488
  filters: {
489
489
  text: string;
490
- origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
490
+ origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
491
491
  omittedValues?: number | undefined;
492
492
  }[];
493
493
  controls: {
@@ -514,8 +514,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
514
514
  filters?: number | undefined;
515
515
  controls?: number | undefined;
516
516
  fields?: number | undefined;
517
- comparisons?: number | undefined;
518
517
  drillSteps?: number | undefined;
518
+ comparisons?: number | undefined;
519
519
  sqlParameters?: number | undefined;
520
520
  } | undefined;
521
521
  } | {
@@ -533,7 +533,7 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
533
533
  status: "described";
534
534
  filters: {
535
535
  text: string;
536
- origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
536
+ origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
537
537
  omittedValues?: number | undefined;
538
538
  }[];
539
539
  controls: {
@@ -560,8 +560,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
560
560
  filters?: number | undefined;
561
561
  controls?: number | undefined;
562
562
  fields?: number | undefined;
563
- comparisons?: number | undefined;
564
563
  drillSteps?: number | undefined;
564
+ comparisons?: number | undefined;
565
565
  sqlParameters?: number | undefined;
566
566
  } | undefined;
567
567
  } | {
@@ -610,8 +610,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
610
610
  kind: "set";
611
611
  text: string;
612
612
  fingerprint: string;
613
- omittedValues?: number | undefined;
614
613
  notApplied?: "opened_from_another_dashboard" | undefined;
614
+ omittedValues?: number | undefined;
615
615
  } | {
616
616
  kind: "varies";
617
617
  };
@@ -639,7 +639,7 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
639
639
  status: "described";
640
640
  filters: {
641
641
  text: string;
642
- origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
642
+ origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
643
643
  omittedValues?: number | undefined;
644
644
  }[];
645
645
  controls: {
@@ -666,8 +666,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
666
666
  filters?: number | undefined;
667
667
  controls?: number | undefined;
668
668
  fields?: number | undefined;
669
- comparisons?: number | undefined;
670
669
  drillSteps?: number | undefined;
670
+ comparisons?: number | undefined;
671
671
  sqlParameters?: number | undefined;
672
672
  } | undefined;
673
673
  } | {
@@ -702,8 +702,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
702
702
  kind: "set";
703
703
  text: string;
704
704
  fingerprint: string;
705
- omittedValues?: number | undefined;
706
705
  notApplied?: "opened_from_another_dashboard" | undefined;
706
+ omittedValues?: number | undefined;
707
707
  } | {
708
708
  kind: "varies";
709
709
  };
@@ -731,7 +731,7 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
731
731
  status: "described";
732
732
  filters: {
733
733
  text: string;
734
- origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
734
+ origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
735
735
  omittedValues?: number | undefined;
736
736
  }[];
737
737
  controls: {
@@ -758,8 +758,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
758
758
  filters?: number | undefined;
759
759
  controls?: number | undefined;
760
760
  fields?: number | undefined;
761
- comparisons?: number | undefined;
762
761
  drillSteps?: number | undefined;
762
+ comparisons?: number | undefined;
763
763
  sqlParameters?: number | undefined;
764
764
  } | undefined;
765
765
  } | {
@@ -794,8 +794,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
794
794
  kind: "set";
795
795
  text: string;
796
796
  fingerprint: string;
797
- omittedValues?: number | undefined;
798
797
  notApplied?: "opened_from_another_dashboard" | undefined;
798
+ omittedValues?: number | undefined;
799
799
  } | {
800
800
  kind: "varies";
801
801
  };
@@ -823,7 +823,7 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
823
823
  status: "described";
824
824
  filters: {
825
825
  text: string;
826
- origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
826
+ origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
827
827
  omittedValues?: number | undefined;
828
828
  }[];
829
829
  controls: {
@@ -850,8 +850,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
850
850
  filters?: number | undefined;
851
851
  controls?: number | undefined;
852
852
  fields?: number | undefined;
853
- comparisons?: number | undefined;
854
853
  drillSteps?: number | undefined;
854
+ comparisons?: number | undefined;
855
855
  sqlParameters?: number | undefined;
856
856
  } | undefined;
857
857
  } | {
@@ -886,8 +886,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
886
886
  kind: "set";
887
887
  text: string;
888
888
  fingerprint: string;
889
- omittedValues?: number | undefined;
890
889
  notApplied?: "opened_from_another_dashboard" | undefined;
890
+ omittedValues?: number | undefined;
891
891
  } | {
892
892
  kind: "varies";
893
893
  };
@@ -915,7 +915,7 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
915
915
  status: "described";
916
916
  filters: {
917
917
  text: string;
918
- origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
918
+ origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
919
919
  omittedValues?: number | undefined;
920
920
  }[];
921
921
  controls: {
@@ -942,8 +942,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
942
942
  filters?: number | undefined;
943
943
  controls?: number | undefined;
944
944
  fields?: number | undefined;
945
- comparisons?: number | undefined;
946
945
  drillSteps?: number | undefined;
946
+ comparisons?: number | undefined;
947
947
  sqlParameters?: number | undefined;
948
948
  } | undefined;
949
949
  } | {
@@ -11,6 +11,7 @@ export * from './availability.js';
11
11
  export * from './parts.js';
12
12
  export * from './conversation.js';
13
13
  export * from './transcript.js';
14
+ export * from './answer-text.js';
14
15
  export * from './sources.js';
15
16
  export * from './token-config.js';
16
17
  export * from './artifact.js';
@@ -9,8 +9,13 @@ export declare const ASSISTANT_LIMITS: {
9
9
  readonly messageChars: 4000;
10
10
  /** The whole serialized AssistantContext, in UTF-8 bytes. */
11
11
  readonly contextBytes: number;
12
- /** The whole request body (context, message, added sources), in UTF-8 bytes. */
12
+ /** The whole request body (context, message, added sources) except `openDashboard`, in UTF-8 bytes. */
13
13
  readonly requestBytes: number;
14
+ /**
15
+ * The dashboard on screen sent with a question (Phase 7, D7-12), alone, in
16
+ * UTF-8 bytes of its JSON. Over it the browser sends the question without it.
17
+ */
18
+ readonly openDashboardBytes: number;
14
19
  readonly summaryCards: 30;
15
20
  readonly otherSheets: 50;
16
21
  readonly activeInputs: 50;
@@ -1,10 +1,13 @@
1
1
  import { SemaphorDialect, SemaphorSourceRef } from '../analytics-protocol/contracts.js';
2
2
  import { AssistantArtifact } from './artifact.js';
3
+ import { ChangeDiagnostic } from '../dashboard-authoring/changes/diagnostics.js';
4
+ import { CreatedEntity, DashboardOperation, OperationContext } from '../dashboard-authoring/operations/operation-types.js';
3
5
  /**
4
6
  * The parts of an answer (analytics agent Plan 1, spec 2.4). Streamed as AI
5
7
  * SDK `data-${kind}` parts (text uses the SDK's own text parts) and stored on
6
- * the turn as they are. Never a card config (AG-INV-5). Artifacts from
7
- * Phase 4; proposals in Phase 7.
8
+ * the turn as they are, except the trace and a proposal's operations, which
9
+ * are streamed and never stored. The model never reads a part (AG-INV-5).
10
+ * Artifacts from Phase 4; proposals in Phase 7.
8
11
  */
9
12
  export declare const ASSISTANT_PARTS_VERSION: 1;
10
13
  export type AssistantPart = {
@@ -25,7 +28,39 @@ export type AssistantPart = {
25
28
  kind: 'refusal';
26
29
  code: AssistantRefusalCode;
27
30
  message: string;
28
- } | AssistantTracePart;
31
+ } | AssistantTracePart | AssistantProposalPart | AssistantProposalOperationsPart;
32
+ /**
33
+ * A change the assistant made to the dashboard on screen (Phase 7, spec 8.1,
34
+ * D7-16): what it does in plain sentences, stored with the turn. Its
35
+ * operations come in the stream-only part beside it.
36
+ */
37
+ export type AssistantProposalPart = {
38
+ kind: 'proposal';
39
+ proposalId: string;
40
+ dashboardId: string;
41
+ /** This answer's proposal it builds on; null: the dashboard sent with the question (D7-15). */
42
+ buildsOn: string | null;
43
+ /** One per change: its operation (`card.add`, `filter.update`...) and its sentence, as propose returned them. */
44
+ changes: AssistantProposalChange[];
45
+ warnings: ChangeDiagnostic[];
46
+ risk: 'low' | 'medium';
47
+ created: CreatedEntity[];
48
+ };
49
+ export type AssistantProposalChange = {
50
+ op: string;
51
+ sentence: string;
52
+ };
53
+ /**
54
+ * A proposal's operations, for the browser to apply to the dashboard it was
55
+ * built from (D7-16, D7-18). Written to the stream only and never stored,
56
+ * as the trace part: a reopened conversation has nothing to apply.
57
+ */
58
+ export type AssistantProposalOperationsPart = {
59
+ kind: 'proposal_operations';
60
+ proposalId: string;
61
+ operations: DashboardOperation[];
62
+ context: OperationContext;
63
+ };
29
64
  /**
30
65
  * A question the person answers with a click, ending the answer (ledger
31
66
  * D3d-1): the model's alternatives as data, never parsed from its text. Each
@@ -47,6 +82,11 @@ export type AssistantStagePart = {
47
82
  stageId: string;
48
83
  label: string;
49
84
  state: 'live' | 'done' | 'skipped';
85
+ /**
86
+ * A step that changes the dashboard on screen (Phase 7): what the model
87
+ * wrote before it is the answer, not a working note (P7-23, P7-45).
88
+ */
89
+ change?: true;
50
90
  };
51
91
  /**
52
92
  * Where one answer's time and tokens went (spec 3.9, AG-D25). The server
@@ -1,6 +1,7 @@
1
1
  import { SemaphorSourceRef } from '../analytics-protocol/contracts.js';
2
2
  import { CardQueryRequestExtras, DashboardCardQueryRequestPayloadBase } from '../dashboard-authoring/card-query-request.js';
3
3
  import { DataSource } from '../../lib/types/explorer-types.js';
4
+ import { TDashboard } from '../../lib/types/common-types.js';
4
5
  import { AssistantCardField, AssistantContext } from './context.js';
5
6
  export { ASSISTANT_LIMITS } from './limits.js';
6
7
  /**
@@ -37,6 +38,14 @@ export type AssistantTurnRequest = {
37
38
  * `tagged-fields.ts`): each one of the fields its description lists.
38
39
  */
39
40
  taggedFields?: AssistantCardField[];
41
+ /**
42
+ * The dashboard document on screen, as the store holds it (Phase 7,
43
+ * D7-11, D7-12): propose works from it, so a change is made to what the
44
+ * person sees, unsaved edits included. Sent on the dashboard surface where
45
+ * the person may change it (`useCanChangeOpenDashboard`). Outside
46
+ * `requestBytes`, with its own cap; never read by the model, never stored.
47
+ */
48
+ openDashboard?: TDashboard;
40
49
  };
41
50
  /**
42
51
  * Why a card has no request to replay: the reasons the external path's saved
@@ -73,9 +82,12 @@ export type AssistantTurnRequestParseResult = {
73
82
  code: 'context_too_large' | 'context_invalid';
74
83
  issues: string[];
75
84
  };
85
+ /** The most a turn request body may be: the request and the dashboard on screen, each at its cap. */
86
+ export declare const ASSISTANT_TURN_BODY_BYTES: number;
76
87
  /**
77
- * Parses a turn request body as received (text). Size first, before any
78
- * parsing: a body over `requestBytes` or a context over `contextBytes` is
88
+ * Parses a turn request body as received (text). Size first: a body over
89
+ * `ASSISTANT_TURN_BODY_BYTES`, an `openDashboard` over `openDashboardBytes`,
90
+ * the rest of the body over `requestBytes` or a context over `contextBytes` is
79
91
  * `context_too_large`. Then the schema (strict) and the context version: a
80
92
  * failure is `context_invalid`.
81
93
  */
@@ -19,4 +19,7 @@ export declare function readExactDomainCalculatedFieldReference(field: Calculate
19
19
  resultRole?: string;
20
20
  };
21
21
  }): string | undefined;
22
+ /** The field list group calculated fields are listed under (the editor's constants re-export these). */
23
+ export declare const CALCULATED_FIELDS_GROUP_ID = "semaphor_calculated_fields";
24
+ export declare const CALCULATED_FIELDS_GROUP_NAME = "calculated_fields";
22
25
  export {};