react-semaphor 0.1.539 → 0.1.541

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 (51) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/assistant-protocol/index.js +63 -54
  3. package/dist/brand-studio/index.js +1 -1
  4. package/dist/briefings/index.js +41 -38
  5. package/dist/chunks/add-to-dashboard-BuAqfA2Y.js +80 -0
  6. package/dist/chunks/{aggregate-table-row-presentation-BjK9YfMI.js → aggregate-table-row-presentation-B_vQjYR3.js} +319 -302
  7. package/dist/chunks/{assistant-chat-DgiSuFT4.js → assistant-chat-D1fDZD6O.js} +2448 -2228
  8. package/dist/chunks/{context-HD9usB1P.js → context-ClREvqCZ.js} +101 -102
  9. package/dist/chunks/{dashboard-y5BwcvzT.js → dashboard-B6IrON_Q.js} +1 -1
  10. package/dist/chunks/{dashboard-briefing-launcher-Bl3gCeBR.js → dashboard-briefing-launcher-DwjFpewq.js} +117 -117
  11. package/dist/chunks/{dashboard-controls-0EX0HiJt.js → dashboard-controls-C_BI28ME.js} +6 -6
  12. package/dist/chunks/{dashboard-json-6X_2BDiL.js → dashboard-json-DDY15Trn.js} +2 -2
  13. package/dist/chunks/{document-dashboard-inputs-BrYYlRVo.js → document-dashboard-inputs-DP_Op5mu.js} +1168 -1166
  14. package/dist/chunks/{edit-dashboard-visual-Bzchfgga.js → edit-dashboard-visual-CH2dzWW-.js} +5 -5
  15. package/dist/chunks/{index-CqMiAkay.js → index-DaQlghLY.js} +547 -511
  16. package/dist/chunks/report-preferences-dialog-DpNkFfQO.js +1950 -0
  17. package/dist/chunks/{saved-dashboard-context-Dqve2jlB.js → saved-dashboard-context-CJ2WpoMF.js} +2 -2
  18. package/dist/chunks/{semaphor-ready-indicator-ldcwmLoY.js → semaphor-ready-indicator-KT598QJq.js} +33482 -33334
  19. package/dist/chunks/{shelf-drop-preview-context-BWxunXTq.js → shelf-drop-preview-context-BxV3Fl8h.js} +3 -3
  20. package/dist/chunks/{switch-CvItuC1Q.js → switch-DWEWiv1J.js} +53 -52
  21. package/dist/chunks/{use-create-flow-overlay-state-RHgzVfcz.js → use-create-flow-overlay-state-DdD12SMY.js} +3 -3
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/dashboard-authoring/index.js +582 -568
  24. package/dist/format-utils/index.js +117 -114
  25. package/dist/index.js +11 -11
  26. package/dist/pdf-export-policy/index.js +20 -10
  27. package/dist/style.css +1 -1
  28. package/dist/surfboard/index.js +1 -1
  29. package/dist/types/briefings/attachment-outcomes.d.ts +23 -0
  30. package/dist/types/briefings/index.d.ts +1 -0
  31. package/dist/types/components/assistant/assistant-entry-points.d.ts +3 -0
  32. package/dist/types/components/assistant/assistant-store.d.ts +49 -1
  33. package/dist/types/components/assistant/use-assistant.d.ts +10 -1
  34. package/dist/types/lib/hooks/use-dashboard-card.d.ts +2 -0
  35. package/dist/types/lib/query-context/card-server-request.d.ts +5 -1
  36. package/dist/types/lib/types/common-types.d.ts +7 -0
  37. package/dist/types/lib/types/explorer-types.d.ts +2 -2
  38. package/dist/types/shared/assistant-protocol/context.d.ts +88 -66
  39. package/dist/types/shared/assistant-protocol/conversation.d.ts +3 -0
  40. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  41. package/dist/types/shared/assistant-protocol/limits.d.ts +2 -0
  42. package/dist/types/shared/assistant-protocol/request.d.ts +6 -1
  43. package/dist/types/shared/assistant-protocol/tagged-fields.d.ts +29 -0
  44. package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +20 -0
  45. package/dist/types/shared/format-utils/attachment-filter-line.d.ts +14 -0
  46. package/dist/types/shared/format-utils/filter-line.d.ts +7 -0
  47. package/dist/types/shared/format-utils/index.d.ts +1 -0
  48. package/dist/types/shared/format-utils/pdf-export-policy.d.ts +9 -0
  49. package/package.json +2 -1
  50. package/dist/chunks/add-to-dashboard-CxtTfISD.js +0 -56
  51. package/dist/chunks/report-preferences-dialog-CWhSbc5_.js +0 -1808
@@ -1,5 +1,6 @@
1
1
  import { SemaphorSourceRef } from '../analytics-protocol/contracts.js';
2
2
  import { AssistantPart } from './parts.js';
3
+ import { AssistantCardField } from './context.js';
3
4
  /** How a stored turn ended; `running` while it is answering, `interrupted` when its process died. */
4
5
  export type TurnOutcome = 'running' | 'completed' | 'stopped' | 'failed' | 'refused' | 'interrupted';
5
6
  /** For the full page: one of the caller's conversations from the last 24 hours. */
@@ -24,6 +25,8 @@ export type AssistantConversationDetail = {
24
25
  turnId: string;
25
26
  startedAt: string;
26
27
  message: string;
28
+ /** Fields tagged in the question (Phase 11), shown as chips with it. */
29
+ taggedFields?: AssistantCardField[];
27
30
  /** Shown through the one stored-part mapping the stream uses (D3c-6, `transcript.ts`). */
28
31
  parts: AssistantPart[];
29
32
  outcome: TurnOutcome;
@@ -6,6 +6,7 @@
6
6
  export * from './request.js';
7
7
  export { assistantJsonBytes, fitAssistantText, AssistantContextTooLargeError, } from './limits.js';
8
8
  export * from './context.js';
9
+ export * from './tagged-fields.js';
9
10
  export * from './availability.js';
10
11
  export * from './parts.js';
11
12
  export * from './conversation.js';
@@ -18,6 +18,8 @@ export declare const ASSISTANT_LIMITS: {
18
18
  readonly inputValues: 50;
19
19
  readonly addedSources: 50;
20
20
  readonly cardFields: 60;
21
+ /** Fields of the asked-about card tagged in one question (Phase 11). */
22
+ readonly taggedFields: 5;
21
23
  readonly cardFilters: 40;
22
24
  readonly cardControls: 40;
23
25
  readonly drillSteps: 10;
@@ -1,7 +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 { AssistantContext } from './context.js';
4
+ import { AssistantCardField, AssistantContext } from './context.js';
5
5
  export { ASSISTANT_LIMITS } from './limits.js';
6
6
  /**
7
7
  * The assistant's turn request (analytics agent Plan 1, spec 2.1). The browser
@@ -32,6 +32,11 @@ export type AssistantTurnRequest = {
32
32
  * about or why it cannot run.
33
33
  */
34
34
  selectedCardUnavailable?: AssistantCardUnavailable;
35
+ /**
36
+ * Fields of the asked-about card tagged in this question (Phase 11,
37
+ * `tagged-fields.ts`): each one of the fields its description lists.
38
+ */
39
+ taggedFields?: AssistantCardField[];
35
40
  };
36
41
  /**
37
42
  * Why a card has no request to replay: the reasons the external path's saved
@@ -0,0 +1,29 @@
1
+ import { AssistantCardField, AssistantContext } from './context.js';
2
+ /**
3
+ * Fields tagged in a question (analytics agent Plan 1, Phase 11, AG-D27): a
4
+ * person points at a field of the card they are asking about instead of
5
+ * typing its name. A tag is one of the fields the asked-about card's
6
+ * description lists, by the description's own identity (role, name,
7
+ * aggregate, date grain), never a card config (AG-INV-5). Only a card with
8
+ * described fields can be tagged: a SQL card's columns have no fields here,
9
+ * so a question about one is plain words, which the model reads beside the
10
+ * card's SQL (D11-1). One owner of the rule, used by the browser before it
11
+ * sends and by the server's turn parser.
12
+ */
13
+ /** The same field of a card: everything that tells two fields apart but the label. */
14
+ export declare function sameCardField(left: AssistantCardField, right: AssistantCardField): boolean;
15
+ /**
16
+ * The fields a question about this context can tag: the asked-about card's
17
+ * described fields, else none. A card that runs SQL, or a draft in SQL mode,
18
+ * has none (D11-1): what it returns is its SQL's columns, and the visual
19
+ * shelves it may still carry (a draft keeps the other mode's) are not run.
20
+ */
21
+ export declare function taggableFields(context: AssistantContext): AssistantCardField[];
22
+ /** What is wrong with a question's tags against the context it is sent with; empty when they hold. */
23
+ export declare function taggedFieldIssues(context: AssistantContext, tags: AssistantCardField[]): string[];
24
+ /**
25
+ * The question as the model reads it: the tagged fields first, described as
26
+ * the card's description describes them, then the words. The one writer for
27
+ * the question being asked and for the conversation's history.
28
+ */
29
+ export declare function questionForModel(message: string, tags: AssistantCardField[] | undefined): string;
@@ -70,7 +70,27 @@ export type CardQueryRequestExtras = {
70
70
  pageSize: number;
71
71
  };
72
72
  tableTotalsRequest?: TableTotalsRequest;
73
+ /** Strict table print only; never sent with `pagination`. */
74
+ sourceRowProbe?: CardQuerySourceRowProbe;
73
75
  };
76
+ /**
77
+ * Ask acquisition whether the source had more rows than `limit`, counted
78
+ * before any Python step or pivot (report attachment delivery RA-D15, RA-D17).
79
+ */
80
+ export type CardQuerySourceRowProbe = {
81
+ limit: number;
82
+ };
83
+ /**
84
+ * What acquisition reports for a `CardQuerySourceRowProbe`: `true` when the
85
+ * source had more rows than the limit, `false` when not. Absent when nobody
86
+ * asked or the answer is unknown, and never read as `false`.
87
+ */
88
+ export type CardQuerySourceRowEvidence = {
89
+ sourceRowOverflow?: boolean;
90
+ };
91
+ type DecidedExtrasField = 'pagination' | 'tableTotalsRequest' | 'sourceRowProbe';
92
+ /** Every extras field is parsed here and built by `resolveCardRequestExtras`. */
93
+ export type CardQueryRequestExtrasDecided = AssertNever<Exclude<keyof CardQueryRequestExtras, DecidedExtrasField>>;
74
94
  /** The context fields any query body may carry, checked the same way for every reader. */
75
95
  export type CardQueryRequestContext = Pick<CardQueryRequest, 'calendarContext' | 'resolvedPrimaryDateField' | 'globalDateComparison'>;
76
96
  /**
@@ -0,0 +1,14 @@
1
+ import { FilterLineValue } from './filter-line.js';
2
+ /**
3
+ * The filter values a scheduled attachment's filter line is made of, read
4
+ * from its saved settings: values with a name and a values list, each saved
5
+ * relative date read through the shared reader (a malformed one is dropped so
6
+ * the value keeps its fixed dates, as the dashboard's own replay does).
7
+ *
8
+ * One owner for the run's PDF header (semaphor-app `buildRunFilterLine`) and
9
+ * the schedule dialog. It ignores `includeFilters`: that switch only hides the
10
+ * printed line, and the filters still apply to the data.
11
+ */
12
+ export declare function readAttachmentFilterLineValues(settings: {
13
+ filterValues?: readonly unknown[];
14
+ } | undefined): FilterLineValue[];
@@ -13,6 +13,13 @@ export type FilterLineValue = {
13
13
  };
14
14
  type FormatFilterLineOptions = {
15
15
  timezone?: string;
16
+ /**
17
+ * 'label': every relative window prints by its label ("Last 7 days"), for a
18
+ * reader that shows saved values rather than a run's resolved dates (the
19
+ * schedule dialog). Absent: quarter, year and latest-data windows print by
20
+ * name and every other window prints its dates, as a run's PDF header does.
21
+ */
22
+ relativeDates?: 'label';
16
23
  };
17
24
  type FormatFilterConditionOptions = FormatFilterLineOptions & {
18
25
  /** The filter's display name; defaults to its column name in title case. */
@@ -31,6 +31,7 @@ export * from './raw-temporal.js';
31
31
  export * from './temporal-input-presentation.js';
32
32
  export * from './flat-table-export-totals.js';
33
33
  export * from './filter-line.js';
34
+ export * from './attachment-filter-line.js';
34
35
  export { describeFilterValueInFullDetail, type FullDetailFilterValue, } from './filter-value-text.js';
35
36
  export { describeConditionInFullDetail, type FilterClauseText } from './filter-detail.js';
36
37
  export { formatCanonicalComparisonRange } from '../../lib/utils/comparison-window-caption.js';
@@ -12,6 +12,15 @@ export declare const FAST_PDF_POLICY: Readonly<{
12
12
  maxOutputBytes: 52428800;
13
13
  }>;
14
14
  export declare const PDF_SAFETY_LIMIT_EXCEEDED: "PDF_SAFETY_LIMIT_EXCEEDED";
15
+ /**
16
+ * Card types a PDF prints as a table, across pages, in table mode. The one
17
+ * list every reader uses: the interactive download and export dialog, the
18
+ * fast path, the print views and scheduled attachments (report attachment
19
+ * delivery RA-D1).
20
+ */
21
+ export declare const PDF_TABLE_CARD_TYPES: readonly ["table", "detailTable", "aggregateTable", "pivotTable"];
22
+ export type PdfTableCardType = (typeof PDF_TABLE_CARD_TYPES)[number];
23
+ export declare function isPdfTableCardType(cardType: unknown): cardType is PdfTableCardType;
15
24
  /** Exact UTF-8 bytes used by the structured POST body. */
16
25
  export declare function getUtf8ByteLength(value: string): number;
17
26
  export declare function isFastPdfRowCountEligible(rowCount: number): boolean;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.539",
8
+ "version": "0.1.541",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -152,6 +152,7 @@
152
152
  "@dnd-kit/core": "^6.3.1",
153
153
  "@dnd-kit/sortable": "^10.0.0",
154
154
  "@dnd-kit/utilities": "^3.2.2",
155
+ "@floating-ui/react-dom": "^2.1.8",
155
156
  "@headlessui/react": "^2.2.0",
156
157
  "@lexical/history": "^0.43.0",
157
158
  "@lexical/link": "^0.43.0",
@@ -1,56 +0,0 @@
1
- import { k as t } from "./context-HD9usB1P.js";
2
- function a(e) {
3
- if (e.kind === "text") return { type: "text", text: e.text };
4
- const { kind: n, ...i } = e;
5
- return {
6
- type: `data-${n}`,
7
- ...e.kind === "stage" ? { id: e.stageId } : {},
8
- data: i
9
- };
10
- }
11
- function s(e, n) {
12
- return e.kind !== "text" ? [a(e)] : [
13
- { type: "text-start", id: n },
14
- { type: "text-delta", id: n, delta: e.text },
15
- { type: "text-end", id: n }
16
- ];
17
- }
18
- function d(e) {
19
- if (e === "failed" || e === "interrupted")
20
- return { kind: "refusal", code: "model_unavailable", message: t.model_unavailable };
21
- if (e === "running")
22
- return { kind: "refusal", code: "turn_in_progress", message: t.turn_in_progress };
23
- }
24
- function u(e) {
25
- if (e.kind === "semantic") return JSON.stringify(["semantic", e.domainId, e.datasetName]);
26
- if (e.kind === "sql") return JSON.stringify(["sql", e.connectionId]);
27
- }
28
- function l(e) {
29
- return e.label ?? (e.kind === "semantic" ? e.datasetName : e.kind === "physical" ? e.tableName : "SQL");
30
- }
31
- function o(e) {
32
- return {
33
- columns: e.columns,
34
- records: e.records,
35
- rowCount: e.rowCount,
36
- governed: e.status.governed,
37
- complete: e.status.complete,
38
- truncated: e.status.truncated
39
- };
40
- }
41
- const c = {
42
- number: "kpi",
43
- line: "line",
44
- bar: "bar",
45
- stackedBar: "stackedBar",
46
- table: "table"
47
- };
48
- export {
49
- c as A,
50
- s as a,
51
- u as b,
52
- l as c,
53
- d as s,
54
- a as t,
55
- o as v
56
- };