react-semaphor 0.1.547 → 0.1.549
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.
- package/dist/analytics-protocol/index.js +1 -1
- package/dist/assistant-context/index.js +1 -1
- package/dist/briefings/index.js +1 -1
- package/dist/chunks/{assistant-chat-CK84cPAB.js → assistant-chat-CUSvuESS.js} +1831 -1846
- package/dist/chunks/{custom-visual-inputs-ChL54gGm.js → custom-visual-inputs-CwAcigQS.js} +1 -1
- package/dist/chunks/{dashboard-DCk26-6i.js → dashboard-Cm7WkARH.js} +1 -1
- package/dist/chunks/{dashboard-briefing-launcher-CQ1eYsGy.js → dashboard-briefing-launcher-X0HzNpS8.js} +627 -629
- package/dist/chunks/{dashboard-controls-BMeZjF7r.js → dashboard-controls-BuX6TMNK.js} +219 -219
- package/dist/chunks/{dashboard-json-BZqCoanC.js → dashboard-json-Cc4u2xvy.js} +1 -1
- package/dist/chunks/{document-dashboard-inputs-tYd7ao0o.js → document-dashboard-inputs-DPQ_wUGD.js} +2 -2
- package/dist/chunks/{edit-dashboard-visual-Bv3MHM_G.js → edit-dashboard-visual-DX2CzibK.js} +606 -606
- package/dist/chunks/{filter-reach-copy-CGWsL_ez.js → filter-reach-copy-Bc-Gei83.js} +4 -4
- package/dist/chunks/{global-date-filter-utils-BhAu8zIM.js → global-date-filter-utils-CnumW4j2.js} +1657 -1652
- package/dist/chunks/{index-DmrLP5Ro.js → index-DzsdV1o4.js} +3 -3
- package/dist/chunks/{raw-temporal-presentation-DypB7sMX.js → raw-temporal-presentation-CBKeEPYA.js} +1 -1
- package/dist/chunks/report-preferences-dialog-B9oYQ6OJ.js +2180 -0
- package/dist/chunks/{resolve-dashboard-input-context-D0JDUa4h.js → resolve-dashboard-input-context-DVWF7p5C.js} +2 -2
- package/dist/chunks/{saved-dashboard-context-BfAH5j4L.js → saved-dashboard-context-BMqMzNAo.js} +4 -4
- package/dist/chunks/{semaphor-ready-indicator-CRm17oIP.js → semaphor-ready-indicator-wWkPH4ue.js} +23405 -23367
- package/dist/chunks/{shelf-drop-preview-context-vy6P9THz.js → shelf-drop-preview-context-B86d8IZO.js} +3 -3
- package/dist/chunks/{source-entity-resolution-BIGRvtbG.js → source-entity-resolution-D195CrYS.js} +221 -192
- package/dist/chunks/{use-create-flow-overlay-state-Csx_Xjsh.js → use-create-flow-overlay-state-DPNjYyi3.js} +2 -2
- package/dist/dashboard/index.js +1 -1
- package/dist/dashboard-authoring/index.js +7 -7
- package/dist/data-app-sdk-validation/index.js +1 -1
- package/dist/index.js +12 -12
- package/dist/live-channel/index.js +124 -0
- package/dist/style.css +1 -1
- package/dist/surfboard/index.js +1 -1
- package/dist/types/components/surfboard/dashboard-plus.d.ts +1 -1
- package/dist/types/lib/dashboard-inputs/dashboard-filter-mapping-authoring.d.ts +42 -6
- package/dist/types/lib/stores/dashboard-store.d.ts +9 -0
- package/dist/types/lib/types/common-types.d.ts +26 -1
- package/dist/types/live-channel.d.ts +2 -0
- package/dist/types/shared/assistant-protocol/parts.d.ts +11 -0
- package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +14 -44
- package/dist/types/shared/live-channel/index.d.ts +1 -0
- package/dist/types/shared/live-channel/live-channel-contract.d.ts +126 -0
- package/package.json +5 -1
- package/dist/chunks/report-preferences-dialog-DoVyriYC.js +0 -1977
package/dist/surfboard/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a, R as s, D as o } from "../chunks/report-preferences-dialog-
|
|
1
|
+
import { a, R as s, D as o } from "../chunks/report-preferences-dialog-B9oYQ6OJ.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,
|
|
@@ -3,5 +3,5 @@ type DashboardPlusProps = {
|
|
|
3
3
|
showControls?: boolean;
|
|
4
4
|
showFooter?: boolean;
|
|
5
5
|
} & DashboardProps;
|
|
6
|
-
export declare function DashboardPlus({ showControls, showFooter, ...rest }: DashboardPlusProps): import("react").JSX.Element;
|
|
6
|
+
export declare function DashboardPlus({ showControls, showFooter, liveScreen, ...rest }: DashboardPlusProps): import("react").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -194,11 +194,15 @@ export type DashboardFilterMappingDraftRow = DashboardFilterCardState & {
|
|
|
194
194
|
export type DashboardFilterMappingRowTrigger = {
|
|
195
195
|
kind: 'notApplied';
|
|
196
196
|
}
|
|
197
|
-
/**
|
|
197
|
+
/**
|
|
198
|
+
* A field, with "Auto ·" or "Suggested ·" before it. `muted`: the field
|
|
199
|
+
* doesn't apply yet (a suggestion), so all of it reads quiet.
|
|
200
|
+
*/
|
|
198
201
|
| {
|
|
199
202
|
kind: 'field';
|
|
200
203
|
target: DashboardFilterFieldTarget;
|
|
201
204
|
prefix?: 'Auto' | 'Suggested';
|
|
205
|
+
muted?: true;
|
|
202
206
|
}
|
|
203
207
|
/** A SQL card's Auto: the field it takes the value by. */
|
|
204
208
|
| {
|
|
@@ -265,11 +269,22 @@ export type DashboardFilterMappingRowView = {
|
|
|
265
269
|
state: DashboardFilterMappingRowState;
|
|
266
270
|
/** The status column of the table review. */
|
|
267
271
|
label: string;
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
+
/**
|
|
273
|
+
* Colour means something needs fixing (relationship filter reach R-31):
|
|
274
|
+
* `review` (amber) a field must be chosen before saving, `invalid` (red) a
|
|
275
|
+
* decision that no longer runs. Everything else is `quiet`, offers too.
|
|
276
|
+
*/
|
|
277
|
+
tone: 'quiet' | 'review' | 'invalid';
|
|
278
|
+
/**
|
|
279
|
+
* How the row counts in the summary: applied, an open offer (a suggested
|
|
280
|
+
* field, a path to choose), not applied, a field to choose, or invalid;
|
|
281
|
+
* none while its source or the server's answer is pending.
|
|
282
|
+
*/
|
|
283
|
+
count?: 'covered' | 'suggested' | 'pathChoice' | 'excluded' | 'needsChoice' | 'invalid';
|
|
284
|
+
/** Something breaks or blocks saving: a field to choose, or invalid. The Cards tab dot and the chip warning. */
|
|
272
285
|
attention: boolean;
|
|
286
|
+
/** A suggested field the row offers to use in one click ("Use"). */
|
|
287
|
+
suggestion?: DashboardFilterFieldTarget;
|
|
273
288
|
/** Accept is refused while the row stands: a decision that can't run, a field to choose, fields not loaded. */
|
|
274
289
|
blocksAccept: boolean;
|
|
275
290
|
/** A menu, or a control that only says why there is nothing to choose. */
|
|
@@ -337,9 +352,15 @@ export type DashboardFilterMappingAcceptance = {
|
|
|
337
352
|
};
|
|
338
353
|
export type DashboardFilterMappingStatusSummary = {
|
|
339
354
|
coveredCount: number;
|
|
340
|
-
|
|
355
|
+
/** Cards with a suggested field to use; they aren't filtered until it's used. */
|
|
356
|
+
suggestedCount: number;
|
|
357
|
+
/** Cards with equally preferred paths; they aren't filtered until one is chosen. */
|
|
358
|
+
pathChoiceCount: number;
|
|
341
359
|
excludedCount: number;
|
|
360
|
+
/** Cards that need a field chosen before the mapping can be saved. */
|
|
361
|
+
needsChoiceCount: number;
|
|
342
362
|
invalidCount: number;
|
|
363
|
+
/** What breaks or blocks saving (needs a field, invalid): the Cards tab dot and the chip warning. */
|
|
343
364
|
attentionCount: number;
|
|
344
365
|
};
|
|
345
366
|
export type DashboardFilterMappingDraft = {
|
|
@@ -409,6 +430,21 @@ export type DashboardFilterMappingRequest = {
|
|
|
409
430
|
* surface uses to decide whether the author needs to act.
|
|
410
431
|
*/
|
|
411
432
|
export declare function summarizeDashboardFilterMappingRows(rows: DashboardFilterMappingDraftRow[]): DashboardFilterMappingStatusSummary;
|
|
433
|
+
/**
|
|
434
|
+
* What breaks or blocks saving, in words, for the chip warning, the Cards
|
|
435
|
+
* tab dot and the popover footer (relationship filter reach R-31). Absent
|
|
436
|
+
* when nothing does.
|
|
437
|
+
*/
|
|
438
|
+
export declare function describeDashboardFilterMappingAttention(summary: DashboardFilterMappingStatusSummary): {
|
|
439
|
+
tone: 'invalid' | 'review';
|
|
440
|
+
text: string;
|
|
441
|
+
} | undefined;
|
|
442
|
+
/**
|
|
443
|
+
* Open offers, in words, for the popover footer: cards that aren't filtered
|
|
444
|
+
* until the author uses a suggestion or chooses a path. Information, not a
|
|
445
|
+
* warning (R-31). Absent when there are none.
|
|
446
|
+
*/
|
|
447
|
+
export declare function describeDashboardFilterMappingOffers(summary: DashboardFilterMappingStatusSummary): string | undefined;
|
|
412
448
|
/**
|
|
413
449
|
* One Cards row for a source-qualified value field that is not a toolbar
|
|
414
450
|
* filter, such as a field a click carries. It is the same decision chain the
|
|
@@ -154,6 +154,13 @@ export type DashboardStore = {
|
|
|
154
154
|
* replacement of the document but a proposal's own Undo, clears them.
|
|
155
155
|
*/
|
|
156
156
|
appliedProposals: AppliedProposal[];
|
|
157
|
+
/**
|
|
158
|
+
* Advances each time an edit session ends: leaving edit mode (Cancel,
|
|
159
|
+
* close) or a successful Save that stays in edit mode. Save keeps the
|
|
160
|
+
* dashboard object (P7-27), so identity alone can't mark it; a live screen
|
|
161
|
+
* drops every kept copy here (embedded live changes LC-D14).
|
|
162
|
+
*/
|
|
163
|
+
editSessionEpoch: number;
|
|
157
164
|
/** The last toolbar Arrange, for its Undo. Cleared by any dashboard load, leaving edit mode, or a successful undo (responsive layouts SPEC §6.4). */
|
|
158
165
|
lastArrange?: LastArrange;
|
|
159
166
|
isVisualEditing: boolean;
|
|
@@ -420,6 +427,8 @@ type Actions = {
|
|
|
420
427
|
removeFrame: (sheetId: string, frameId: string) => void;
|
|
421
428
|
removeCard: (sheetId: string, card: TCard) => void;
|
|
422
429
|
setIsDashboardEditing: (editing: boolean) => void;
|
|
430
|
+
/** The toolbar's Save succeeded: the edit session's changes are saved (LC-D14). */
|
|
431
|
+
markDashboardSaved: () => void;
|
|
423
432
|
/**
|
|
424
433
|
* Applies an assistant proposal to the dashboard on screen (spec 8.1,
|
|
425
434
|
* D7-18, D7-27): only while the dashboard is still `basedOn`, checked and
|
|
@@ -15,6 +15,7 @@ import { DashboardAIContext } from './ai-context-types.js';
|
|
|
15
15
|
import { CardInteractionConfig, InteractionTargetOverride } from './interaction-types.js';
|
|
16
16
|
import { SemanticExecutionPayload } from './semantic-runtime-types.js';
|
|
17
17
|
import { ReportRuntimeContext } from '../../shared/report-runtime-context/index.js';
|
|
18
|
+
import { LiveScreenPort } from '../../shared/live-channel/index.js';
|
|
18
19
|
import { CsvEncoding } from '../../shared/format-utils/exporters/csv-utils.js';
|
|
19
20
|
import { PresentationExecutionSnapshot, TemporalInputPresentation } from '../../shared/format-utils/index.js';
|
|
20
21
|
import { JSX } from 'react';
|
|
@@ -285,6 +286,12 @@ export type DashboardProps = {
|
|
|
285
286
|
onEvent?: (event: TEvent) => void;
|
|
286
287
|
/** Receives dashboard editing lifecycle transitions from the shared runtime. */
|
|
287
288
|
onDashboardLifecycleEvent?: (event: DashboardLifecycleEvent) => void;
|
|
289
|
+
/**
|
|
290
|
+
* Makes this dashboard a live screen: an agent's changes arrive through the
|
|
291
|
+
* port and land unsaved, with Undo in a one-line note (embedded live changes
|
|
292
|
+
* LC-D31). Only Semaphor's embed page passes it.
|
|
293
|
+
*/
|
|
294
|
+
liveScreen?: LiveScreenPort;
|
|
288
295
|
onSave?: (dashboard: TDashboard) => void;
|
|
289
296
|
onFilterValuesChange?: (filterValues: TFilterValue[]) => void;
|
|
290
297
|
LoadingComponent?: (props: LoadingProps) => React.ReactNode;
|
|
@@ -1578,13 +1585,31 @@ export type TEvent = {
|
|
|
1578
1585
|
type: 'success' | 'error' | 'info' | 'warning';
|
|
1579
1586
|
message: any;
|
|
1580
1587
|
};
|
|
1581
|
-
/**
|
|
1588
|
+
/**
|
|
1589
|
+
* Supported lifecycle transitions emitted by an editable dashboard session:
|
|
1590
|
+
* its unsaved state, and an assistant's change applied on a live screen or
|
|
1591
|
+
* undone from its note (embedded live changes LC-D13).
|
|
1592
|
+
*/
|
|
1582
1593
|
export type DashboardLifecycleEvent = {
|
|
1583
1594
|
type: 'dashboard:dirty-state';
|
|
1584
1595
|
dashboardId: string;
|
|
1585
1596
|
payload: {
|
|
1586
1597
|
dirty: boolean;
|
|
1587
1598
|
};
|
|
1599
|
+
} | {
|
|
1600
|
+
type: 'dashboard:change-applied';
|
|
1601
|
+
dashboardId: string;
|
|
1602
|
+
payload: {
|
|
1603
|
+
deliveryId: string;
|
|
1604
|
+
summary: string[];
|
|
1605
|
+
};
|
|
1606
|
+
} | {
|
|
1607
|
+
type: 'dashboard:change-undone';
|
|
1608
|
+
dashboardId: string;
|
|
1609
|
+
payload: {
|
|
1610
|
+
deliveryId: string;
|
|
1611
|
+
summary: string[];
|
|
1612
|
+
};
|
|
1588
1613
|
};
|
|
1589
1614
|
/**
|
|
1590
1615
|
* Style for the dashboard
|
|
@@ -82,12 +82,23 @@ export type AssistantStagePart = {
|
|
|
82
82
|
stageId: string;
|
|
83
83
|
label: string;
|
|
84
84
|
state: 'live' | 'done' | 'skipped';
|
|
85
|
+
/**
|
|
86
|
+
* What kind of work the step does, for its icon: the server picks it with
|
|
87
|
+
* the label, from the same table. Absent on a step with no kind of its own
|
|
88
|
+
* and on turns stored before it.
|
|
89
|
+
*/
|
|
90
|
+
activity?: AssistantStepActivity;
|
|
85
91
|
/**
|
|
86
92
|
* A step that changes the dashboard on screen (Phase 7): what the model
|
|
87
93
|
* wrote before it is the answer, not a working note (P7-23, P7-45).
|
|
88
94
|
*/
|
|
89
95
|
change?: true;
|
|
90
96
|
};
|
|
97
|
+
/**
|
|
98
|
+
* Finding what to use, reading it, running an analysis or SQL, changing the
|
|
99
|
+
* dashboard, or working out another way after a step failed.
|
|
100
|
+
*/
|
|
101
|
+
export type AssistantStepActivity = 'find' | 'read' | 'analyze' | 'sql' | 'change' | 'retry';
|
|
91
102
|
/**
|
|
92
103
|
* Where one answer's time and tokens went (spec 3.9, AG-D25). The server
|
|
93
104
|
* sends it only to people who may see it (a development server, a super
|
|
@@ -7821,56 +7821,26 @@ export type ProposeChangeCaller = {
|
|
|
7821
7821
|
generate: boolean;
|
|
7822
7822
|
/** The SQL query form. */
|
|
7823
7823
|
sql: boolean;
|
|
7824
|
+
/**
|
|
7825
|
+
* A session that changes the dashboard on the user's screen (a live token,
|
|
7826
|
+
* 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).
|
|
7829
|
+
*/
|
|
7830
|
+
onScreen: boolean;
|
|
7824
7831
|
};
|
|
7825
7832
|
/**
|
|
7826
7833
|
* The propose tool's input for one caller (DE-INV-7, design rule 5): only the
|
|
7827
7834
|
* changes and query forms this caller may use. `shape` is what an MCP tool
|
|
7828
|
-
* registers; `schema` parses a call.
|
|
7835
|
+
* registers; `schema` parses a call. This is the one place that decides what
|
|
7836
|
+
* on-screen propose accepts (LC-D17).
|
|
7829
7837
|
*/
|
|
7830
7838
|
export declare function buildProposeChangeInputSchema(caller: ProposeChangeCaller): {
|
|
7831
|
-
shape:
|
|
7832
|
-
|
|
7833
|
-
|
|
7834
|
-
|
|
7835
|
-
|
|
7836
|
-
saveAs: z.ZodOptional<z.ZodEnum<["original", "copy"]>>;
|
|
7837
|
-
preview: z.ZodOptional<z.ZodEnum<["sample", "rows", "none"]>>;
|
|
7838
|
-
include: z.ZodOptional<z.ZodArray<z.ZodLiteral<"outline">, "many">>;
|
|
7839
|
-
rationale: z.ZodOptional<z.ZodString>;
|
|
7840
|
-
};
|
|
7841
|
-
schema: z.ZodObject<{
|
|
7842
|
-
projectId: z.ZodOptional<z.ZodString>;
|
|
7843
|
-
dashboardId: z.ZodOptional<z.ZodString>;
|
|
7844
|
-
domainId: z.ZodOptional<z.ZodString>;
|
|
7845
|
-
changes: z.ZodArray<z.ZodDiscriminatedUnion<"op", [z.ZodDiscriminatedUnionOption<"op">, ...z.ZodDiscriminatedUnionOption<"op">[]]>, "many">;
|
|
7846
|
-
saveAs: z.ZodOptional<z.ZodEnum<["original", "copy"]>>;
|
|
7847
|
-
preview: z.ZodOptional<z.ZodEnum<["sample", "rows", "none"]>>;
|
|
7848
|
-
include: z.ZodOptional<z.ZodArray<z.ZodLiteral<"outline">, "many">>;
|
|
7849
|
-
rationale: z.ZodOptional<z.ZodString>;
|
|
7850
|
-
}, "strict", z.ZodTypeAny, {
|
|
7851
|
-
changes: {
|
|
7852
|
-
[x: string]: any;
|
|
7853
|
-
op?: unknown;
|
|
7854
|
-
}[];
|
|
7855
|
-
domainId?: string | undefined;
|
|
7856
|
-
dashboardId?: string | undefined;
|
|
7857
|
-
projectId?: string | undefined;
|
|
7858
|
-
saveAs?: "original" | "copy" | undefined;
|
|
7859
|
-
preview?: "rows" | "none" | "sample" | undefined;
|
|
7860
|
-
include?: "outline"[] | undefined;
|
|
7861
|
-
rationale?: string | undefined;
|
|
7862
|
-
}, {
|
|
7863
|
-
changes: {
|
|
7864
|
-
[x: string]: any;
|
|
7865
|
-
op?: unknown;
|
|
7866
|
-
}[];
|
|
7867
|
-
domainId?: string | undefined;
|
|
7868
|
-
dashboardId?: string | undefined;
|
|
7869
|
-
projectId?: string | undefined;
|
|
7870
|
-
saveAs?: "original" | "copy" | undefined;
|
|
7871
|
-
preview?: "rows" | "none" | "sample" | undefined;
|
|
7872
|
-
include?: "outline"[] | undefined;
|
|
7873
|
-
rationale?: string | undefined;
|
|
7839
|
+
shape: z.ZodRawShape;
|
|
7840
|
+
schema: z.ZodObject<z.ZodRawShape, "strict", z.ZodTypeAny, {
|
|
7841
|
+
[x: string]: any;
|
|
7842
|
+
}, {
|
|
7843
|
+
[x: string]: any;
|
|
7874
7844
|
}>;
|
|
7875
7845
|
};
|
|
7876
7846
|
export type ProposeChangeInput = {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './live-channel-contract.js';
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { TDashboard } from '../../lib/types/common-types.js';
|
|
2
|
+
import { DashboardOperation, OperationContext } from '../dashboard-authoring/operations/operation-types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The live channel's shared contract (embedded live changes LC-D30, SPEC.md
|
|
5
|
+
* section 2): what travels between Semaphor's server and a live screen (the
|
|
6
|
+
* embedded dashboard), what agents hear back, and every timing. Pure and
|
|
7
|
+
* server-safe; semaphor-app imports it as `react-semaphor/live-channel`, and
|
|
8
|
+
* nothing else in either repo declares these types (LC-INV-30).
|
|
9
|
+
*
|
|
10
|
+
* Every value crossing the wire is parsed by its validator on receipt, on
|
|
11
|
+
* both sides; a value that fails is dropped (an event) or refused 400 (a
|
|
12
|
+
* POST), never half-used (C-1).
|
|
13
|
+
*/
|
|
14
|
+
/** Always the first event on a connection. */
|
|
15
|
+
export type ConnectedEvent = {
|
|
16
|
+
type: 'connected';
|
|
17
|
+
connectionId: string;
|
|
18
|
+
};
|
|
19
|
+
export type ScreenCopyRequest = {
|
|
20
|
+
type: 'copy_request';
|
|
21
|
+
requestId: string;
|
|
22
|
+
/** The dashboard the call asked for. */
|
|
23
|
+
dashboardId: string;
|
|
24
|
+
};
|
|
25
|
+
export type ScreenDelivery = {
|
|
26
|
+
type: 'delivery';
|
|
27
|
+
deliveryId: string;
|
|
28
|
+
/** The revision it was built on. */
|
|
29
|
+
revisionId: string;
|
|
30
|
+
proposalId: string;
|
|
31
|
+
operations: DashboardOperation[];
|
|
32
|
+
context: OperationContext;
|
|
33
|
+
/** Propose's summary sentences. */
|
|
34
|
+
summary: string[];
|
|
35
|
+
/** Positive; the screen never writes after receipt plus this. */
|
|
36
|
+
applyWithinMs: number;
|
|
37
|
+
};
|
|
38
|
+
export type LiveChannelEvent = ConnectedEvent | ScreenCopyRequest | ScreenDelivery;
|
|
39
|
+
export type ScreenCopyAnswer = {
|
|
40
|
+
kind: 'uploaded';
|
|
41
|
+
screenId: string;
|
|
42
|
+
requestId: string;
|
|
43
|
+
revisionId: string;
|
|
44
|
+
dashboard: TDashboard;
|
|
45
|
+
};
|
|
46
|
+
export type ScreenOutcome = {
|
|
47
|
+
status: 'applied';
|
|
48
|
+
} | {
|
|
49
|
+
status: 'not_applied';
|
|
50
|
+
reason: 'dashboard_changed' | 'not_editable' | 'refused' | 'expired';
|
|
51
|
+
message: string;
|
|
52
|
+
};
|
|
53
|
+
export type DeliveryOutcomeReport = {
|
|
54
|
+
screenId: string;
|
|
55
|
+
deliveryId: string;
|
|
56
|
+
outcome: ScreenOutcome;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* A delivery ends when propose returns (plan revision 20): the screen's
|
|
60
|
+
* report, or `not_confirmed` when none came within the outcome wait. The
|
|
61
|
+
* dashboard on screen is the truth; the agent reads it again to see whether
|
|
62
|
+
* the change is there.
|
|
63
|
+
*/
|
|
64
|
+
export type DeliveryOutcome = ScreenOutcome | {
|
|
65
|
+
status: 'not_confirmed';
|
|
66
|
+
};
|
|
67
|
+
export type LiveDelivery = {
|
|
68
|
+
deliveryId: string;
|
|
69
|
+
outcome: DeliveryOutcome;
|
|
70
|
+
};
|
|
71
|
+
export type LiveScreenState = {
|
|
72
|
+
eligible: boolean;
|
|
73
|
+
dashboardId?: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* What the embed page hands the dashboard (LC-D31): semaphor-app owns the
|
|
77
|
+
* transport behind it; react-semaphor's dashboard owns the screen state.
|
|
78
|
+
*/
|
|
79
|
+
export type LiveScreenPort = {
|
|
80
|
+
/** UUID v4, made once per page load. */
|
|
81
|
+
screenId: string;
|
|
82
|
+
setScreenState(state: LiveScreenState): void;
|
|
83
|
+
subscribe(listener: (event: ScreenCopyRequest | ScreenDelivery) => void): () => void;
|
|
84
|
+
/** Once, no retry: the server's wait is short. */
|
|
85
|
+
answerCopyRequest(answer: ScreenCopyAnswer): Promise<void>;
|
|
86
|
+
/** Once, no retry: a report that doesn't arrive is `not_confirmed`. */
|
|
87
|
+
reportOutcome(report: DeliveryOutcomeReport): Promise<void>;
|
|
88
|
+
};
|
|
89
|
+
export declare const LIVE_CHANNEL_TIMINGS: {
|
|
90
|
+
readonly heartbeatMs: 25000;
|
|
91
|
+
/** A screen's record expires this long after its last heartbeat: it is gone. */
|
|
92
|
+
readonly heartbeatExpiryMs: 75000;
|
|
93
|
+
readonly hiddenTabGraceMs: 120000;
|
|
94
|
+
/** Then the last value repeatedly. */
|
|
95
|
+
readonly reconnectBackoffMs: readonly [0, 1000, 2000, 5000];
|
|
96
|
+
/** One per call. */
|
|
97
|
+
readonly copyAnswerWaitMs: 3000;
|
|
98
|
+
readonly outcomeWaitMs: 8000;
|
|
99
|
+
/** applyWithinMs = the outcome wait less this. */
|
|
100
|
+
readonly applyMarginMs: 1000;
|
|
101
|
+
/** A copy answer or an outcome is kept this long past its call's wait. */
|
|
102
|
+
readonly replyRetentionMs: 30000;
|
|
103
|
+
/** Distinct screens; a sixth gets 429. */
|
|
104
|
+
readonly connectionsPerToken: 5;
|
|
105
|
+
};
|
|
106
|
+
/** The shape of the timings; tests pass shorter ones. */
|
|
107
|
+
export type LiveChannelTimings = {
|
|
108
|
+
readonly [K in keyof typeof LIVE_CHANNEL_TIMINGS]: (typeof LIVE_CHANNEL_TIMINGS)[K] extends readonly number[] ? readonly number[] : number;
|
|
109
|
+
};
|
|
110
|
+
export type Parsed<T> = {
|
|
111
|
+
ok: true;
|
|
112
|
+
value: T;
|
|
113
|
+
} | {
|
|
114
|
+
ok: false;
|
|
115
|
+
problem: string;
|
|
116
|
+
};
|
|
117
|
+
/** A screen id: a UUID v4. */
|
|
118
|
+
export declare function isScreenId(value: unknown): value is string;
|
|
119
|
+
export declare function parseLiveChannelEvent(eventName: string, data: string): Parsed<LiveChannelEvent>;
|
|
120
|
+
export declare function parseScreenCopyAnswer(body: unknown, query: {
|
|
121
|
+
screenId: string;
|
|
122
|
+
requestId: string;
|
|
123
|
+
}): Parsed<ScreenCopyAnswer>;
|
|
124
|
+
export declare function parseDeliveryOutcomeReport(body: unknown): Parsed<DeliveryOutcomeReport>;
|
|
125
|
+
/** A screen's outcome, as reported and as stored. */
|
|
126
|
+
export declare function parseScreenOutcome(value: unknown): ScreenOutcome | null;
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"email": "support@semaphor.cloud"
|
|
6
6
|
},
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"version": "0.1.
|
|
8
|
+
"version": "0.1.549",
|
|
9
9
|
"description": "Fully interactive and customizable dashboards for your apps.",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"react",
|
|
@@ -92,6 +92,10 @@
|
|
|
92
92
|
"types": "./dist/types/activity.d.ts",
|
|
93
93
|
"import": "./dist/activity/index.js"
|
|
94
94
|
},
|
|
95
|
+
"./live-channel": {
|
|
96
|
+
"types": "./dist/types/live-channel.d.ts",
|
|
97
|
+
"import": "./dist/live-channel/index.js"
|
|
98
|
+
},
|
|
95
99
|
"./briefings": {
|
|
96
100
|
"types": "./dist/types/briefings.d.ts",
|
|
97
101
|
"import": "./dist/briefings/index.js"
|