react-semaphor 0.1.551 → 0.1.552

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 (42) hide show
  1. package/dist/assistant-context/index.js +1 -1
  2. package/dist/assistant-protocol/index.js +64 -57
  3. package/dist/briefings/index.js +1 -1
  4. package/dist/chunks/{assistant-chat-B8kslmny.js → assistant-chat-sWQaBT61.js} +3197 -2841
  5. package/dist/chunks/{comparison-window-caption-C2xF-eWw.js → comparison-window-caption-CF90-I0i.js} +1 -1
  6. package/dist/chunks/{custom-visual-inputs-CwAcigQS.js → custom-visual-inputs-ByQUyWf4.js} +1 -1
  7. package/dist/chunks/{dashboard-BcAQSgm-.js → dashboard-BjoJI7NN.js} +1 -1
  8. package/dist/chunks/{dashboard-briefing-launcher-DnnvLeAs.js → dashboard-briefing-launcher-DUJQv719.js} +7 -7
  9. package/dist/chunks/{dashboard-controls-BYDt0QZL.js → dashboard-controls-BjnvfcQp.js} +8 -8
  10. package/dist/chunks/{dashboard-json-BligXqcU.js → dashboard-json-BqcLekhd.js} +1 -1
  11. package/dist/chunks/{document-dashboard-inputs-DPQ_wUGD.js → document-dashboard-inputs-PoQihHLu.js} +3 -3
  12. package/dist/chunks/{edit-dashboard-visual-8-Fd4EcE.js → edit-dashboard-visual-KNJQr60W.js} +9 -9
  13. package/dist/chunks/{filter-reach-copy-8vnDYToV.js → filter-reach-copy-zdhUFn6t.js} +4 -4
  14. package/dist/chunks/{global-date-filter-utils-CnumW4j2.js → global-date-filter-utils-C1jCNWdV.js} +8 -1
  15. package/dist/chunks/{index-DzsdV1o4.js → index-Dp0ta6KB.js} +3 -3
  16. package/dist/chunks/{matrix-formatter-DWEeC0_c.js → matrix-formatter-C_EpDP6o.js} +12 -12
  17. package/dist/chunks/model-change-B0rAK-5w.js +230 -0
  18. package/dist/chunks/{raw-temporal-presentation-CBKeEPYA.js → raw-temporal-presentation-D3i0mnUe.js} +1 -1
  19. package/dist/chunks/{report-preferences-dialog-DAQEooIW.js → report-preferences-dialog-C0uGI0v7.js} +7 -7
  20. package/dist/chunks/{resolve-dashboard-input-context-DVWF7p5C.js → resolve-dashboard-input-context-Cm0b7s-d.js} +64 -64
  21. package/dist/chunks/{saved-dashboard-context-BMqMzNAo.js → saved-dashboard-context-DCtGmAWe.js} +4 -4
  22. package/dist/chunks/{semaphor-ready-indicator-Dq1ElALH.js → semaphor-ready-indicator-ChyotaWB.js} +10386 -10388
  23. package/dist/chunks/{shelf-drop-preview-context-CHm8lqfo.js → shelf-drop-preview-context-D09ATIXv.js} +3 -3
  24. package/dist/chunks/{table-export-sheet-4X9mAG3V.js → table-export-sheet-DUS_s8Cj.js} +1 -1
  25. package/dist/chunks/{use-create-flow-overlay-state-b_fGSj_5.js → use-create-flow-overlay-state-t7JLE_LV.js} +2 -2
  26. package/dist/dashboard/index.js +1 -1
  27. package/dist/dashboard-authoring/index.js +7 -7
  28. package/dist/data-app-sdk/index.js +1 -1
  29. package/dist/format-utils/index.js +5 -5
  30. package/dist/index.js +12 -12
  31. package/dist/style.css +1 -1
  32. package/dist/surfboard/index.js +1 -1
  33. package/dist/types/shared/assistant-protocol/answer-text.d.ts +23 -0
  34. package/dist/types/shared/assistant-protocol/conversation-text.d.ts +29 -0
  35. package/dist/types/shared/assistant-protocol/conversation.d.ts +24 -3
  36. package/dist/types/shared/assistant-protocol/index.d.ts +2 -0
  37. package/dist/types/shared/assistant-protocol/model-change.d.ts +19 -0
  38. package/dist/types/shared/assistant-protocol/parts.d.ts +45 -1
  39. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +8 -3
  40. package/dist/types/shared/dashboard-authoring/changes/diagnostics.d.ts +7 -1
  41. package/package.json +1 -1
  42. package/dist/chunks/add-to-dashboard-BQRAAnc3.js +0 -102
@@ -1,4 +1,4 @@
1
- import { a, R as s, D as o } from "../chunks/report-preferences-dialog-DAQEooIW.js";
1
+ import { a, R as s, D as o } from "../chunks/report-preferences-dialog-C0uGI0v7.js";
2
2
  import { C as f, E as D } from "../chunks/table-settings-WysCBj62.js";
3
3
  export {
4
4
  f as CONTROL_CARD_DEFAULT_VALUE,
@@ -14,6 +14,29 @@ import { AssistantPart } from './parts.js';
14
14
  export type AnswerPartKind = 'text' | 'step' | 'other';
15
15
  /** The parts that are working notes: text before the last step that comes before the answer's last text. */
16
16
  export declare function workingNotesOf<T>(parts: readonly T[], kindOf: (part: T) => AnswerPartKind): ReadonlySet<T>;
17
+ /**
18
+ * Where each part kind shows in an answer (assistant joins and panel H-1): in
19
+ * its body, in order (the words that aren't working notes, the blocks); in its
20
+ * details (steps, what it used, the trace); or nowhere (the conversation's id,
21
+ * a proposal's operations). The transcript and the copied text both read it,
22
+ * and a new part kind doesn't compile until it has a place here.
23
+ */
24
+ export declare const ANSWER_PART_PLACEMENT: {
25
+ readonly conversation: "nowhere";
26
+ readonly text: "body";
27
+ readonly stage: "details";
28
+ readonly using: "details";
29
+ readonly clarify: "body";
30
+ readonly artifact: "body";
31
+ readonly refusal: "body";
32
+ readonly trace: "details";
33
+ readonly proposal: "body";
34
+ readonly proposal_operations: "nowhere";
35
+ readonly proposal_refused: "body";
36
+ readonly model_change: "body";
37
+ };
38
+ /** Whether a part kind shows in an answer's body; a kind this build doesn't know (a newer server's) doesn't. */
39
+ export declare function showsInAnswerBody(kind: string): boolean;
17
40
  /** A stored part's kind for `workingNotesOf`. */
18
41
  export declare function storedPartKind(part: AssistantPart): AnswerPartKind;
19
42
  /** A stored answer's text: its text parts after the last step, a paragraph each. */
@@ -0,0 +1,29 @@
1
+ import { AssistantConversationDetail } from './conversation.js';
2
+ /**
3
+ * What the copy does with every field of a conversation and of a turn
4
+ * (assistant joins and panel H-1, P3-08): a field added to either type
5
+ * doesn't compile until it is shown or left out here on purpose.
6
+ */
7
+ export declare const COPIED_CONVERSATION_FIELDS: {
8
+ readonly conversationId: "with tool calls";
9
+ readonly addedSources: "left out";
10
+ readonly allows: "left out";
11
+ readonly turns: "shown";
12
+ };
13
+ export declare const COPIED_TURN_FIELDS: {
14
+ readonly turnId: "left out";
15
+ readonly startedAt: "shown";
16
+ readonly message: "shown";
17
+ readonly taggedFields: "shown";
18
+ readonly parts: "shown";
19
+ readonly outcome: "shown";
20
+ readonly toolCalls: "with tool calls";
21
+ readonly model: "with tool calls";
22
+ readonly instructionsVersion: "with tool calls";
23
+ };
24
+ export declare function conversationText(detail: AssistantConversationDetail, options: {
25
+ assistantName: string;
26
+ toolCalls?: boolean;
27
+ }): string;
28
+ /** A tool's name without the product prefix (AJ-INV-8). */
29
+ export declare function toolName(tool: string): string;
@@ -1,5 +1,5 @@
1
1
  import { SemaphorSourceRef } from '../analytics-protocol/contracts.js';
2
- import { AssistantPart } from './parts.js';
2
+ import { AssistantCallerAllows, AssistantPart } from './parts.js';
3
3
  import { AssistantCardField } from './context.js';
4
4
  /** How a stored turn ended; `running` while it is answering, `interrupted` when its process died. */
5
5
  export type TurnOutcome = 'running' | 'completed' | 'stopped' | 'failed' | 'refused' | 'interrupted';
@@ -15,12 +15,15 @@ export type AssistantConversationSummary = {
15
15
  };
16
16
  /**
17
17
  * What opening a conversation returns (Phase 3c, D3c-5): the turns as the
18
- * transcript shows them. Never the context, tool calls, card request,
19
- * executed queries or provider replay (AG-INV-5).
18
+ * transcript shows them. Never the context, card request, executed queries
19
+ * or provider replay (AG-INV-5); tool calls only when an organization user
20
+ * asks for them to copy (AJ-D11).
20
21
  */
21
22
  export type AssistantConversationDetail = {
22
23
  conversationId: string;
23
24
  addedSources: SemaphorSourceRef[];
25
+ /** What the caller may do (AJ-D14). Absent from a server before it. */
26
+ allows?: AssistantCallerAllows;
24
27
  turns: Array<{
25
28
  turnId: string;
26
29
  startedAt: string;
@@ -30,8 +33,26 @@ export type AssistantConversationDetail = {
30
33
  /** Shown through the one stored-part mapping the stream uses (D3c-6, `transcript.ts`). */
31
34
  parts: AssistantPart[];
32
35
  outcome: TurnOutcome;
36
+ /**
37
+ * Only when asked for and only for an organization user (AJ-D11,
38
+ * AJ-INV-4): each tool call's name, input, row count, time and outcome, never its
39
+ * result, and the model and instructions that answered.
40
+ */
41
+ toolCalls?: AssistantToolCallRecord[];
42
+ model?: string;
43
+ instructionsVersion?: string;
33
44
  }>;
34
45
  };
46
+ /** One tool call as a stored turn keeps it: never its result (it can hold customer rows). */
47
+ export type AssistantToolCallRecord = {
48
+ tool: string;
49
+ input: unknown;
50
+ ok: boolean;
51
+ /** How many rows a query call returned, from its own result (never the rows). */
52
+ rowCount?: number;
53
+ durationMs?: number;
54
+ error?: string;
55
+ };
35
56
  export declare const ASSISTANT_LAYOUTS: readonly ["docked-right", "docked-left", "centered", "full-page"];
36
57
  /** Where the assistant opens. Token config `assistant.layout` sets the embed default (AG-D21). */
37
58
  export type AssistantLayout = (typeof ASSISTANT_LAYOUTS)[number];
@@ -11,8 +11,10 @@ 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 './conversation-text.js';
14
15
  export * from './answer-text.js';
15
16
  export * from './sources.js';
16
17
  export * from './token-config.js';
17
18
  export * from './artifact.js';
18
19
  export * from './add-to-dashboard.js';
20
+ export * from './model-change.js';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Adding a relationship the assistant proposed (assistant joins and panel
3
+ * AJ-D17): what the apply route answers, and the panel's words for each way
4
+ * it can refuse. The route sends the change store's own codes; the person
5
+ * reads these words, never the store's messages (written for agents) and
6
+ * never the product's name (AJ-INV-8).
7
+ */
8
+ /** `POST /api/v1/assistant/proposals/{proposalId}/apply`, answered 200: the relationship is in the domain (or already was). */
9
+ export type AssistantModelChangeApplied = {
10
+ applied: true;
11
+ replayed: boolean;
12
+ };
13
+ /** The route's refusal body: a change store code and the store's message (for logs, not for the person). */
14
+ export type AssistantModelChangeRefusal = {
15
+ code: string;
16
+ message: string;
17
+ };
18
+ /** The panel's words for a refusal code; any other code (a validation failure, a server error) is "couldn't be added". */
19
+ export declare function modelChangeRefusalMessage(code: unknown): string;
@@ -10,10 +10,20 @@ import { CreatedEntity, DashboardOperation, OperationContext } from '../dashboar
10
10
  * Artifacts from Phase 4; proposals in Phase 7.
11
11
  */
12
12
  export declare const ASSISTANT_PARTS_VERSION: 1;
13
+ /**
14
+ * What the person asking may do here, from the server's own caller (assistant
15
+ * joins and panel AJ-D14): whether a copy may include the tool calls
16
+ * (organization users). Fixed for a conversation; the browser decides nothing
17
+ * from the token itself.
18
+ */
19
+ export type AssistantCallerAllows = {
20
+ toolCalls: boolean;
21
+ };
13
22
  export type AssistantPart = {
14
23
  kind: 'conversation';
15
24
  conversationId: string;
16
25
  expiresAt: string;
26
+ allows?: AssistantCallerAllows;
17
27
  } | {
18
28
  kind: 'text';
19
29
  text: string;
@@ -28,7 +38,7 @@ export type AssistantPart = {
28
38
  kind: 'refusal';
29
39
  code: AssistantRefusalCode;
30
40
  message: string;
31
- } | AssistantTracePart | AssistantProposalPart | AssistantProposalOperationsPart;
41
+ } | AssistantTracePart | AssistantProposalPart | AssistantProposalOperationsPart | AssistantProposalRefusedPart | AssistantModelChangePart;
32
42
  /**
33
43
  * A change the assistant made to the dashboard on screen (Phase 7, spec 8.1,
34
44
  * D7-16): what it does in plain sentences, stored with the turn. Its
@@ -61,6 +71,34 @@ export type AssistantProposalOperationsPart = {
61
71
  operations: DashboardOperation[];
62
72
  context: OperationContext;
63
73
  };
74
+ /**
75
+ * A change the assistant asked for and nothing landed, for a reason the
76
+ * person should see (assistant joins and panel AJ-D8): today only a card
77
+ * whose datasets the domain doesn't relate. Stored with the turn; the model
78
+ * gets the refusal as before. `message` is the change problem's own
79
+ * sentence, safe to show an end user.
80
+ */
81
+ export type AssistantProposalRefusedPart = {
82
+ kind: 'proposal_refused';
83
+ code: 'relationship_missing';
84
+ message: string;
85
+ };
86
+ /**
87
+ * A relationship the assistant proposes adding to a domain (assistant joins
88
+ * and panel AJ-D16): what it does in plain sentences, stored with the turn.
89
+ * The assistant never adds it; the person does, by click, through the apply
90
+ * route (AJ-D17, AJ-INV-6).
91
+ */
92
+ export type AssistantModelChangePart = {
93
+ kind: 'model_change';
94
+ proposalId: string;
95
+ domainId: string;
96
+ /** The domain's label: "Every dashboard on the {domainLabel} domain can use it." */
97
+ domainLabel: string;
98
+ /** One per change (`relationship.add`) and its sentence, as propose returned them. */
99
+ changes: AssistantProposalChange[];
100
+ warnings: ChangeDiagnostic[];
101
+ };
64
102
  /**
65
103
  * A question the person answers with a click, ending the answer (ledger
66
104
  * D3d-1): the model's alternatives as data, never parsed from its text. Each
@@ -76,6 +114,12 @@ export type AssistantClarifyPart = {
76
114
  label: string;
77
115
  description?: string;
78
116
  }>;
117
+ /**
118
+ * The choices can be carried out together (assistant joins and panel
119
+ * AJ-D20, AJ-D21): the person ticks any of them and sends them at once.
120
+ * Absent for one answer; a client before it shows the rows as one answer.
121
+ */
122
+ multiple?: true;
79
123
  };
80
124
  export type AssistantStagePart = {
81
125
  kind: 'stage';
@@ -7815,7 +7815,11 @@ export declare const MAX_PROPOSED_CHANGES = 20;
7815
7815
  export type ProposeChangeCaller = {
7816
7816
  /** Dashboard changes (card.*, filter.*). False for a tenant VIEWER: the tool isn't listed at all. */
7817
7817
  dashboards: boolean;
7818
- /** relationship.add: org interactive callers only. */
7818
+ /**
7819
+ * relationship.add: an org Author or higher, on any credential (assistant
7820
+ * joins and panel AJ-D15, AJ-D19). On screen, only for the in-product
7821
+ * assistant, whose person adds it by click (AJ-D16).
7822
+ */
7819
7823
  domains: boolean;
7820
7824
  /** dashboard.generate: callers who may create dashboards. */
7821
7825
  generate: boolean;
@@ -7824,8 +7828,9 @@ export type ProposeChangeCaller = {
7824
7828
  /**
7825
7829
  * A session that changes the dashboard on the user's screen (a live token,
7826
7830
  * Semaphor's own assistant): it changes only the open dashboard, in place,
7827
- * so `saveAs`, `preview` and `domainId` are not offered and, since the schema
7828
- * is strict, are refused if sent (embedded live changes LC-D17).
7831
+ * so `saveAs` and `preview` are not offered and, since the schema is
7832
+ * strict, are refused if sent (embedded live changes LC-D17). `domainId`
7833
+ * is offered only with `domains`, for `relationship.add` (AJ-D16).
7829
7834
  */
7830
7835
  onScreen: boolean;
7831
7836
  };
@@ -4,7 +4,13 @@
4
4
  * warnings. Messages are one sentence a person can read and never name the
5
5
  * product; `fix` tells the agent what to do next.
6
6
  */
7
- export type ChangeProblemCode = 'invalid_change' | 'invalid_change_target' | 'copy_required' | 'not_permitted' | 'change_not_allowed_for_credential' | 'dashboard_not_found' | 'card_not_found' | 'filter_not_found' | 'sheet_not_found' | 'sheet_required' | 'sheet_not_a_grid' | 'field_not_found' | 'card_not_editable' | 'type_not_supported' | 'query_form_mismatch' | 'capability_required' | 'handle_unknown' | 'too_many_changes'
7
+ export type ChangeProblemCode = 'invalid_change' | 'invalid_change_target' | 'copy_required' | 'not_permitted' | 'dashboard_not_found' | 'card_not_found' | 'filter_not_found' | 'sheet_not_found' | 'sheet_required' | 'sheet_not_a_grid' | 'field_not_found'
8
+ /**
9
+ * The card's datasets aren't joined by the domain's relationships, so the
10
+ * card can't run (assistant joins and panel AJ-D4). Details name the base
11
+ * dataset and the ones it can't reach.
12
+ */
13
+ | 'relationship_missing' | 'card_not_editable' | 'type_not_supported' | 'query_form_mismatch' | 'capability_required' | 'handle_unknown' | 'too_many_changes'
8
14
  /** filter.update or filter.bind on a filter the outline marks read only. */
9
15
  | 'filter_not_editable'
10
16
  /** The changed dashboard fails the save's own validation (propose or apply). */
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "support@semaphor.cloud"
6
6
  },
7
7
  "license": "MIT",
8
- "version": "0.1.551",
8
+ "version": "0.1.552",
9
9
  "description": "Fully interactive and customizable dashboards for your apps.",
10
10
  "keywords": [
11
11
  "react",
@@ -1,102 +0,0 @@
1
- import { A as s, h as u, m as d } from "./context-BerEBuFR.js";
2
- function o(e, t) {
3
- return e.role === t.role && e.name === t.name && e.aggregate === t.aggregate && e.granularity === t.granularity;
4
- }
5
- function l(e) {
6
- var n, a;
7
- const t = (n = e.selectedCard) == null ? void 0 : n.description;
8
- return (t == null ? void 0 : t.status) !== "described" || t.sql || ((a = e.editing) == null ? void 0 : a.mode) === "sql" ? [] : t.fields;
9
- }
10
- function S(e, t) {
11
- if (t.length === 0) return [];
12
- if (t.length > s.taggedFields)
13
- return [`taggedFields: at most ${s.taggedFields}`];
14
- const n = l(e);
15
- return t.flatMap((a, i) => n.some((r) => o(r, a)) ? t.slice(0, i).some((r) => o(r, a)) ? [`taggedFields.${i}: tagged twice`] : [] : [`taggedFields.${i}: not a field of the card the context asks about`]);
16
- }
17
- function k(e, t) {
18
- return t != null && t.length ? `Fields of the asked-about card the user tagged in this question: ${t.map(u).join("; ")}.
19
-
20
- ${e}` : e;
21
- }
22
- function f(e) {
23
- if (e.kind === "text") return { type: "text", text: e.text };
24
- const { kind: t, ...n } = e;
25
- return {
26
- type: `data-${t}`,
27
- ...e.kind === "stage" ? { id: e.stageId } : {},
28
- data: n
29
- };
30
- }
31
- function b(e, t) {
32
- return e.kind !== "text" ? [f(e)] : [
33
- { type: "text-start", id: t },
34
- { type: "text-delta", id: t, delta: e.text },
35
- { type: "text-end", id: t }
36
- ];
37
- }
38
- function h(e) {
39
- if (e === "failed" || e === "interrupted")
40
- return { kind: "refusal", code: "model_unavailable", message: d.model_unavailable };
41
- if (e === "running")
42
- return { kind: "refusal", code: "turn_in_progress", message: d.turn_in_progress };
43
- }
44
- function c(e, t) {
45
- let n = -1;
46
- e.forEach((i, r) => {
47
- t(i) === "text" && (n = r);
48
- });
49
- let a = -1;
50
- return e.forEach((i, r) => {
51
- r < n && t(i) === "step" && (a = r);
52
- }), new Set(e.filter((i, r) => r < a && t(i) === "text"));
53
- }
54
- function g(e) {
55
- return e.kind === "text" ? "text" : e.kind === "stage" && !e.change ? "step" : "other";
56
- }
57
- function x(e) {
58
- const t = c(e, g);
59
- return e.flatMap((n) => n.kind === "text" && !t.has(n) ? [n.text] : []).filter((n) => n.trim().length > 0).join(`
60
-
61
- `);
62
- }
63
- function T(e) {
64
- if (e.kind === "semantic") return JSON.stringify(["semantic", e.domainId, e.datasetName]);
65
- if (e.kind === "sql") return JSON.stringify(["sql", e.connectionId]);
66
- }
67
- function F(e) {
68
- return e.label ?? (e.kind === "semantic" ? e.datasetName : e.kind === "physical" ? e.tableName : "SQL");
69
- }
70
- function y(e) {
71
- return {
72
- columns: e.columns,
73
- records: e.records,
74
- rowCount: e.rowCount,
75
- governed: e.status.governed,
76
- complete: e.status.complete,
77
- truncated: e.status.truncated
78
- };
79
- }
80
- const A = {
81
- number: "kpi",
82
- line: "line",
83
- bar: "bar",
84
- stackedBar: "stackedBar",
85
- table: "table"
86
- };
87
- export {
88
- A,
89
- l as a,
90
- f as b,
91
- b as c,
92
- h as d,
93
- g as e,
94
- x as f,
95
- T as g,
96
- F as h,
97
- k as q,
98
- o as s,
99
- S as t,
100
- y as v,
101
- c as w
102
- };