react-semaphor 0.1.538 → 0.1.540

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 (41) 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/chunks/add-to-dashboard-BuAqfA2Y.js +80 -0
  5. package/dist/chunks/{aggregate-table-row-presentation-Qgpv6_G8.js → aggregate-table-row-presentation-BjK9YfMI.js} +1 -1
  6. package/dist/chunks/{assistant-chat-BAqUIFp5.js → assistant-chat-ya7xopaC.js} +2700 -2363
  7. package/dist/chunks/{context-HD9usB1P.js → context-ClREvqCZ.js} +101 -102
  8. package/dist/chunks/{dashboard-DTDDFQsS.js → dashboard-B6Bithfl.js} +1 -1
  9. package/dist/chunks/{dashboard-briefing-launcher-Bb2QUqOa.js → dashboard-briefing-launcher-DJI-zfEq.js} +364 -364
  10. package/dist/chunks/{dashboard-controls-FpONU8QV.js → dashboard-controls-Dh7HqoKy.js} +7 -7
  11. package/dist/chunks/{dashboard-json-DazPhBU_.js → dashboard-json-BnmlB71h.js} +2 -2
  12. package/dist/chunks/{document-dashboard-inputs-D96rlU7S.js → document-dashboard-inputs-BrYYlRVo.js} +9 -9
  13. package/dist/chunks/{edit-dashboard-visual-CIhZodVH.js → edit-dashboard-visual-CydOkSko.js} +6 -6
  14. package/dist/chunks/{matrix-formatter-Bgw32tb3.js → matrix-formatter-DQ8avoIQ.js} +8 -8
  15. package/dist/chunks/report-preferences-dialog-neMDolLg.js +1950 -0
  16. package/dist/chunks/{saved-dashboard-context-BrTkjcod.js → saved-dashboard-context-CCrLpfSQ.js} +2 -2
  17. package/dist/chunks/{semaphor-ready-indicator-CHHoWhil.js → semaphor-ready-indicator--4DWtVBu.js} +23779 -23712
  18. package/dist/chunks/{shelf-drop-preview-context-EsayECEC.js → shelf-drop-preview-context-CpdB5ois.js} +3 -3
  19. package/dist/chunks/{switch-CvItuC1Q.js → switch-DWEWiv1J.js} +53 -52
  20. package/dist/chunks/{use-create-flow-overlay-state-BqA92GkX.js → use-create-flow-overlay-state-8g6Zhphh.js} +3 -3
  21. package/dist/dashboard/index.js +1 -1
  22. package/dist/data-app-sdk/index.js +1 -1
  23. package/dist/format-utils/index.js +2 -2
  24. package/dist/index.js +10 -10
  25. package/dist/style.css +1 -1
  26. package/dist/surfboard/index.js +1 -1
  27. package/dist/types/components/assistant/assistant-entry-points.d.ts +3 -0
  28. package/dist/types/components/assistant/assistant-store.d.ts +49 -1
  29. package/dist/types/components/assistant/use-assistant.d.ts +10 -1
  30. package/dist/types/lib/hooks/use-filter-option-browse.d.ts +5 -0
  31. package/dist/types/lib/hooks/use-text-filter.d.ts +2 -0
  32. package/dist/types/shared/assistant-protocol/context.d.ts +88 -66
  33. package/dist/types/shared/assistant-protocol/conversation.d.ts +3 -0
  34. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  35. package/dist/types/shared/assistant-protocol/limits.d.ts +2 -0
  36. package/dist/types/shared/assistant-protocol/parts.d.ts +17 -8
  37. package/dist/types/shared/assistant-protocol/request.d.ts +6 -1
  38. package/dist/types/shared/assistant-protocol/tagged-fields.d.ts +29 -0
  39. package/package.json +2 -1
  40. package/dist/chunks/add-to-dashboard-CxtTfISD.js +0 -56
  41. package/dist/chunks/report-preferences-dialog-BCGs4-AE.js +0 -1808
@@ -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;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.538",
8
+ "version": "0.1.540",
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
- };