react-semaphor 0.1.539 → 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 (33) 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/{assistant-chat-DgiSuFT4.js → assistant-chat-ya7xopaC.js} +2448 -2228
  6. package/dist/chunks/{context-HD9usB1P.js → context-ClREvqCZ.js} +101 -102
  7. package/dist/chunks/{dashboard-y5BwcvzT.js → dashboard-B6Bithfl.js} +1 -1
  8. package/dist/chunks/{dashboard-briefing-launcher-Bl3gCeBR.js → dashboard-briefing-launcher-DJI-zfEq.js} +116 -116
  9. package/dist/chunks/{dashboard-controls-0EX0HiJt.js → dashboard-controls-Dh7HqoKy.js} +5 -5
  10. package/dist/chunks/{dashboard-json-6X_2BDiL.js → dashboard-json-BnmlB71h.js} +2 -2
  11. package/dist/chunks/{edit-dashboard-visual-Bzchfgga.js → edit-dashboard-visual-CydOkSko.js} +4 -4
  12. package/dist/chunks/report-preferences-dialog-neMDolLg.js +1950 -0
  13. package/dist/chunks/{saved-dashboard-context-Dqve2jlB.js → saved-dashboard-context-CCrLpfSQ.js} +1 -1
  14. package/dist/chunks/{semaphor-ready-indicator-ldcwmLoY.js → semaphor-ready-indicator--4DWtVBu.js} +20103 -20048
  15. package/dist/chunks/{shelf-drop-preview-context-BWxunXTq.js → shelf-drop-preview-context-CpdB5ois.js} +2 -2
  16. package/dist/chunks/{switch-CvItuC1Q.js → switch-DWEWiv1J.js} +53 -52
  17. package/dist/chunks/{use-create-flow-overlay-state-RHgzVfcz.js → use-create-flow-overlay-state-8g6Zhphh.js} +2 -2
  18. package/dist/dashboard/index.js +1 -1
  19. package/dist/index.js +9 -9
  20. package/dist/style.css +1 -1
  21. package/dist/surfboard/index.js +1 -1
  22. package/dist/types/components/assistant/assistant-entry-points.d.ts +3 -0
  23. package/dist/types/components/assistant/assistant-store.d.ts +49 -1
  24. package/dist/types/components/assistant/use-assistant.d.ts +10 -1
  25. package/dist/types/shared/assistant-protocol/context.d.ts +88 -66
  26. package/dist/types/shared/assistant-protocol/conversation.d.ts +3 -0
  27. package/dist/types/shared/assistant-protocol/index.d.ts +1 -0
  28. package/dist/types/shared/assistant-protocol/limits.d.ts +2 -0
  29. package/dist/types/shared/assistant-protocol/request.d.ts +6 -1
  30. package/dist/types/shared/assistant-protocol/tagged-fields.d.ts +29 -0
  31. package/package.json +2 -1
  32. package/dist/chunks/add-to-dashboard-CxtTfISD.js +0 -56
  33. package/dist/chunks/report-preferences-dialog-CWhSbc5_.js +0 -1808
@@ -1,4 +1,4 @@
1
- import { a, R as s, D as o } from "../chunks/report-preferences-dialog-CWhSbc5_.js";
1
+ import { a, R as s, D as o } from "../chunks/report-preferences-dialog-neMDolLg.js";
2
2
  import { C as f, E as D } from "../chunks/common-types-CUf03Htv.js";
3
3
  export {
4
4
  f as CONTROL_CARD_DEFAULT_VALUE,
@@ -1,5 +1,8 @@
1
+ import { AssistantLayout } from '../../shared/assistant-protocol/conversation.js';
1
2
  /** Where the panel is: beside a dashboard, or on a page with no dashboard in view. */
2
3
  export type AssistantPanelSurface = 'dashboard' | 'none';
4
+ /** Where the panel shows now: the viewer's layout, or beside the asked-about card (Phase 10, D10-1). */
5
+ export type AssistantPlacement = AssistantLayout | 'beside-card';
3
6
  /** Opens and closes the panel. Named after the assistant; no other wording. */
4
7
  export declare function AssistantToolbarButton(): import("react").JSX.Element | null;
5
8
  /**
@@ -24,23 +24,71 @@ export type AssistantPanelState = {
24
24
  layout: AssistantLayout;
25
25
  /** The docked panel's width in pixels: the viewer's saved choice, else the default. */
26
26
  width: number;
27
+ /**
28
+ * Asked from a card's own controls with the panel closed: shown beside that
29
+ * card until left (Phase 10, D10-1, D10-7). Never saved, never a layout.
30
+ */
31
+ beside: boolean;
32
+ /** The size beside a card: the viewer's saved choice, else the default (D10-4). */
33
+ besideSize: AssistantBesideSize;
34
+ /**
35
+ * The Ask that moved the panel beside another card, by `askCount`: the
36
+ * conversation there starts afresh (D10-6). The chat reacts to it once.
37
+ */
38
+ freshConversationAt: number | undefined;
39
+ };
40
+ export type AssistantBesideSize = {
41
+ width: number;
42
+ height: number;
27
43
  };
28
44
  export type AssistantStore = {
29
45
  store: StoreApi<AssistantPanelState>;
30
46
  toggle(): void;
31
47
  close(): void;
32
- askAbout(focus: AssistantFocus): void;
48
+ /**
49
+ * `beside`: from the card's own controls (D10-5). With the panel closed it
50
+ * opens beside the card; beside another card it moves; open in a layout,
51
+ * the panel takes the question as without it.
52
+ */
53
+ askAbout(focus: AssistantFocus, options?: {
54
+ beside?: boolean;
55
+ }): void;
56
+ /** Ends asking beside the card (Open in assistant, Show all, the card leaving the view): the stored layout from here on. */
57
+ leaveBeside(): void;
58
+ /** Also ends asking beside the card: there is no card to be beside. */
33
59
  clearFocus(): void;
34
60
  setLayout(layout: AssistantLayout): void;
35
61
  /** Sets the docked width, clamped; `save` keeps it in this browser (at the end of a drag, on each key). */
36
62
  setWidth(width: number, options?: {
37
63
  save?: boolean;
38
64
  }): void;
65
+ /** Sets the size beside a card, clamped; `save` keeps it in this browser. */
66
+ setBesideSize(size: AssistantBesideSize, options?: {
67
+ save?: boolean;
68
+ }): void;
39
69
  };
40
70
  /** The viewer's layout choice, kept in this browser (AG-D21). */
41
71
  export declare const ASSISTANT_LAYOUT_STORAGE_KEY = "semaphor.assistant.layout";
42
72
  /** The viewer's docked width, kept in this browser. */
43
73
  export declare const ASSISTANT_WIDTH_STORAGE_KEY = "semaphor.assistant.width";
74
+ /** The viewer's size beside a card, kept in this browser (D10-4). */
75
+ export declare const ASSISTANT_BESIDE_SIZE_STORAGE_KEY = "semaphor.assistant.besideSize";
76
+ /** The size beside a card: the default, and the range a viewer can resize it within (D10-4). */
77
+ export declare const ASSISTANT_BESIDE_SIZE: {
78
+ readonly default: {
79
+ readonly width: 360;
80
+ readonly height: 440;
81
+ };
82
+ readonly min: {
83
+ readonly width: 320;
84
+ readonly height: 280;
85
+ };
86
+ readonly max: {
87
+ readonly width: 560;
88
+ readonly height: 640;
89
+ };
90
+ };
91
+ export declare function clampAssistantBesideSize(size: AssistantBesideSize): AssistantBesideSize;
44
92
  /** The docked panel's width: the default, and the range a viewer can resize it within. */
45
93
  export declare const ASSISTANT_WIDTH: {
46
94
  readonly default: 360;
@@ -26,7 +26,10 @@ export type UseAssistantResult = {
26
26
  toggle(): void;
27
27
  close(): void;
28
28
  setLayout(layout: AssistantLayout): void;
29
- askAbout(cardId: string): void;
29
+ /** `beside`: the card's own controls ask beside the card (Phase 10, D10-5); a host's call without it opens the panel. */
30
+ askAbout(cardId: string, options?: {
31
+ beside?: boolean;
32
+ }): void;
30
33
  clearSelectedCard(): void;
31
34
  };
32
35
  /** Read where there is no provider; never written. */
@@ -36,3 +39,9 @@ export declare const NO_ASSISTANT_STORE: import('zustand').StoreApi<import('./as
36
39
  * is unavailable, `available` is false and every entry point renders nothing.
37
40
  */
38
41
  export declare function useAssistant(): UseAssistantResult;
42
+ /**
43
+ * Whether the assistant is asking beside a card in this frame (Phase 10,
44
+ * AG-D26): the frame shows a quiet outline, so the conversation reads as
45
+ * about it. False outside a provider.
46
+ */
47
+ export declare function useAssistantBesideFrame(cardIds: readonly string[]): boolean;
@@ -177,6 +177,26 @@ export type AssistantContextChange = {
177
177
  kind: 'inputs_changed';
178
178
  inputIds: string[];
179
179
  };
180
+ /** One field of a card's description; a question's tags (Phase 11) are the same shape. */
181
+ export declare const assistantCardFieldSchema: z.ZodObject<{
182
+ role: z.ZodEnum<["row", "column", "measure", "detail"]>;
183
+ label: z.ZodString;
184
+ name: z.ZodString;
185
+ aggregate: z.ZodOptional<z.ZodString>;
186
+ granularity: z.ZodOptional<z.ZodString>;
187
+ }, "strict", z.ZodTypeAny, {
188
+ label: string;
189
+ name: string;
190
+ role: "measure" | "row" | "detail" | "column";
191
+ granularity?: string | undefined;
192
+ aggregate?: string | undefined;
193
+ }, {
194
+ label: string;
195
+ name: string;
196
+ role: "measure" | "row" | "detail" | "column";
197
+ granularity?: string | undefined;
198
+ aggregate?: string | undefined;
199
+ }>;
180
200
  /** The strict schema the server parses a turn's context with. */
181
201
  export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
182
202
  version: z.ZodLiteral<1>;
@@ -315,11 +335,11 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
315
335
  omittedValues: z.ZodOptional<z.ZodNumber>;
316
336
  }, "strict", z.ZodTypeAny, {
317
337
  text: string;
318
- origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
338
+ origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
319
339
  omittedValues?: number | undefined;
320
340
  }, {
321
341
  text: string;
322
- origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
342
+ origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
323
343
  omittedValues?: number | undefined;
324
344
  }>, "many">;
325
345
  controls: z.ZodArray<z.ZodObject<{
@@ -359,26 +379,26 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
359
379
  text: string;
360
380
  }>>;
361
381
  comparisons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
362
- omitted: z.ZodOptional<z.ZodObject<Record<"filters" | "controls" | "fields" | "drillSteps" | "comparisons" | "sqlParameters", z.ZodOptional<z.ZodNumber>>, "strict", z.ZodTypeAny, {
382
+ omitted: z.ZodOptional<z.ZodObject<Record<"filters" | "controls" | "fields" | "comparisons" | "drillSteps" | "sqlParameters", z.ZodOptional<z.ZodNumber>>, "strict", z.ZodTypeAny, {
363
383
  filters?: number | undefined;
364
384
  controls?: number | undefined;
365
385
  fields?: number | undefined;
366
- drillSteps?: number | undefined;
367
386
  comparisons?: number | undefined;
387
+ drillSteps?: number | undefined;
368
388
  sqlParameters?: number | undefined;
369
389
  }, {
370
390
  filters?: number | undefined;
371
391
  controls?: number | undefined;
372
392
  fields?: number | undefined;
373
- drillSteps?: number | undefined;
374
393
  comparisons?: number | undefined;
394
+ drillSteps?: number | undefined;
375
395
  sqlParameters?: number | undefined;
376
396
  }>>;
377
397
  }, "strict", z.ZodTypeAny, {
378
398
  status: "described";
379
399
  filters: {
380
400
  text: string;
381
- origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
401
+ origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
382
402
  omittedValues?: number | undefined;
383
403
  }[];
384
404
  controls: {
@@ -405,15 +425,15 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
405
425
  filters?: number | undefined;
406
426
  controls?: number | undefined;
407
427
  fields?: number | undefined;
408
- drillSteps?: number | undefined;
409
428
  comparisons?: number | undefined;
429
+ drillSteps?: number | undefined;
410
430
  sqlParameters?: number | undefined;
411
431
  } | undefined;
412
432
  }, {
413
433
  status: "described";
414
434
  filters: {
415
435
  text: string;
416
- origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
436
+ origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
417
437
  omittedValues?: number | undefined;
418
438
  }[];
419
439
  controls: {
@@ -440,8 +460,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
440
460
  filters?: number | undefined;
441
461
  controls?: number | undefined;
442
462
  fields?: number | undefined;
443
- drillSteps?: number | undefined;
444
463
  comparisons?: number | undefined;
464
+ drillSteps?: number | undefined;
445
465
  sqlParameters?: number | undefined;
446
466
  } | undefined;
447
467
  }>, z.ZodObject<{
@@ -467,7 +487,7 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
467
487
  status: "described";
468
488
  filters: {
469
489
  text: string;
470
- origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
490
+ origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
471
491
  omittedValues?: number | undefined;
472
492
  }[];
473
493
  controls: {
@@ -494,8 +514,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
494
514
  filters?: number | undefined;
495
515
  controls?: number | undefined;
496
516
  fields?: number | undefined;
497
- drillSteps?: number | undefined;
498
517
  comparisons?: number | undefined;
518
+ drillSteps?: number | undefined;
499
519
  sqlParameters?: number | undefined;
500
520
  } | undefined;
501
521
  } | {
@@ -504,8 +524,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
504
524
  message?: string | undefined;
505
525
  };
506
526
  title: string;
507
- visualType: string;
508
527
  fingerprint: string;
528
+ visualType: string;
509
529
  source?: SemaphorSourceRef | undefined;
510
530
  }, {
511
531
  id: string;
@@ -513,7 +533,7 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
513
533
  status: "described";
514
534
  filters: {
515
535
  text: string;
516
- origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
536
+ origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
517
537
  omittedValues?: number | undefined;
518
538
  }[];
519
539
  controls: {
@@ -540,8 +560,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
540
560
  filters?: number | undefined;
541
561
  controls?: number | undefined;
542
562
  fields?: number | undefined;
543
- drillSteps?: number | undefined;
544
563
  comparisons?: number | undefined;
564
+ drillSteps?: number | undefined;
545
565
  sqlParameters?: number | undefined;
546
566
  } | undefined;
547
567
  } | {
@@ -550,8 +570,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
550
570
  message?: string | undefined;
551
571
  };
552
572
  title: string;
553
- visualType: string;
554
573
  fingerprint: string;
574
+ visualType: string;
555
575
  source?: SemaphorSourceRef | undefined;
556
576
  }>>;
557
577
  editing: z.ZodOptional<z.ZodObject<{
@@ -561,14 +581,14 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
561
581
  }, {
562
582
  mode: "sql" | "visual";
563
583
  }>>;
564
- omitted: z.ZodOptional<z.ZodObject<Record<"cards" | "activeInputs" | "otherSheets", z.ZodOptional<z.ZodNumber>>, "strict", z.ZodTypeAny, {
584
+ omitted: z.ZodOptional<z.ZodObject<Record<"cards" | "otherSheets" | "activeInputs", z.ZodOptional<z.ZodNumber>>, "strict", z.ZodTypeAny, {
565
585
  cards?: number | undefined;
566
- activeInputs?: number | undefined;
567
586
  otherSheets?: number | undefined;
587
+ activeInputs?: number | undefined;
568
588
  }, {
569
589
  cards?: number | undefined;
570
- activeInputs?: number | undefined;
571
590
  otherSheets?: number | undefined;
591
+ activeInputs?: number | undefined;
572
592
  }>>;
573
593
  timeZone: z.ZodString;
574
594
  }, "strict", z.ZodTypeAny, {
@@ -581,6 +601,10 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
581
601
  source?: SemaphorSourceRef | undefined;
582
602
  }[];
583
603
  surface: "none" | "dashboard" | "editor";
604
+ otherSheets: {
605
+ id: string;
606
+ title: string;
607
+ }[];
584
608
  activeInputs: {
585
609
  value: {
586
610
  kind: "set";
@@ -595,10 +619,6 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
595
619
  inputId: string;
596
620
  globalDate?: true | undefined;
597
621
  }[];
598
- otherSheets: {
599
- id: string;
600
- title: string;
601
- }[];
602
622
  sheet?: {
603
623
  id: string;
604
624
  title: string;
@@ -608,13 +628,18 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
608
628
  title: string;
609
629
  unsavedEdits: boolean;
610
630
  } | undefined;
631
+ omitted?: {
632
+ cards?: number | undefined;
633
+ otherSheets?: number | undefined;
634
+ activeInputs?: number | undefined;
635
+ } | undefined;
611
636
  selectedCard?: {
612
637
  id: string;
613
638
  description: {
614
639
  status: "described";
615
640
  filters: {
616
641
  text: string;
617
- origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
642
+ origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
618
643
  omittedValues?: number | undefined;
619
644
  }[];
620
645
  controls: {
@@ -641,8 +666,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
641
666
  filters?: number | undefined;
642
667
  controls?: number | undefined;
643
668
  fields?: number | undefined;
644
- drillSteps?: number | undefined;
645
669
  comparisons?: number | undefined;
670
+ drillSteps?: number | undefined;
646
671
  sqlParameters?: number | undefined;
647
672
  } | undefined;
648
673
  } | {
@@ -651,15 +676,10 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
651
676
  message?: string | undefined;
652
677
  };
653
678
  title: string;
654
- visualType: string;
655
679
  fingerprint: string;
680
+ visualType: string;
656
681
  source?: SemaphorSourceRef | undefined;
657
682
  } | undefined;
658
- omitted?: {
659
- cards?: number | undefined;
660
- activeInputs?: number | undefined;
661
- otherSheets?: number | undefined;
662
- } | undefined;
663
683
  editing?: {
664
684
  mode: "sql" | "visual";
665
685
  } | undefined;
@@ -673,6 +693,10 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
673
693
  source?: SemaphorSourceRef | undefined;
674
694
  }[];
675
695
  surface: "none" | "dashboard" | "editor";
696
+ otherSheets: {
697
+ id: string;
698
+ title: string;
699
+ }[];
676
700
  activeInputs: {
677
701
  value: {
678
702
  kind: "set";
@@ -687,10 +711,6 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
687
711
  inputId: string;
688
712
  globalDate?: true | undefined;
689
713
  }[];
690
- otherSheets: {
691
- id: string;
692
- title: string;
693
- }[];
694
714
  sheet?: {
695
715
  id: string;
696
716
  title: string;
@@ -700,13 +720,18 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
700
720
  title: string;
701
721
  unsavedEdits: boolean;
702
722
  } | undefined;
723
+ omitted?: {
724
+ cards?: number | undefined;
725
+ otherSheets?: number | undefined;
726
+ activeInputs?: number | undefined;
727
+ } | undefined;
703
728
  selectedCard?: {
704
729
  id: string;
705
730
  description: {
706
731
  status: "described";
707
732
  filters: {
708
733
  text: string;
709
- origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
734
+ origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
710
735
  omittedValues?: number | undefined;
711
736
  }[];
712
737
  controls: {
@@ -733,8 +758,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
733
758
  filters?: number | undefined;
734
759
  controls?: number | undefined;
735
760
  fields?: number | undefined;
736
- drillSteps?: number | undefined;
737
761
  comparisons?: number | undefined;
762
+ drillSteps?: number | undefined;
738
763
  sqlParameters?: number | undefined;
739
764
  } | undefined;
740
765
  } | {
@@ -743,15 +768,10 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
743
768
  message?: string | undefined;
744
769
  };
745
770
  title: string;
746
- visualType: string;
747
771
  fingerprint: string;
772
+ visualType: string;
748
773
  source?: SemaphorSourceRef | undefined;
749
774
  } | undefined;
750
- omitted?: {
751
- cards?: number | undefined;
752
- activeInputs?: number | undefined;
753
- otherSheets?: number | undefined;
754
- } | undefined;
755
775
  editing?: {
756
776
  mode: "sql" | "visual";
757
777
  } | undefined;
@@ -765,6 +785,10 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
765
785
  source?: SemaphorSourceRef | undefined;
766
786
  }[];
767
787
  surface: "none" | "dashboard" | "editor";
788
+ otherSheets: {
789
+ id: string;
790
+ title: string;
791
+ }[];
768
792
  activeInputs: {
769
793
  value: {
770
794
  kind: "set";
@@ -779,10 +803,6 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
779
803
  inputId: string;
780
804
  globalDate?: true | undefined;
781
805
  }[];
782
- otherSheets: {
783
- id: string;
784
- title: string;
785
- }[];
786
806
  sheet?: {
787
807
  id: string;
788
808
  title: string;
@@ -792,13 +812,18 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
792
812
  title: string;
793
813
  unsavedEdits: boolean;
794
814
  } | undefined;
815
+ omitted?: {
816
+ cards?: number | undefined;
817
+ otherSheets?: number | undefined;
818
+ activeInputs?: number | undefined;
819
+ } | undefined;
795
820
  selectedCard?: {
796
821
  id: string;
797
822
  description: {
798
823
  status: "described";
799
824
  filters: {
800
825
  text: string;
801
- origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
826
+ origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
802
827
  omittedValues?: number | undefined;
803
828
  }[];
804
829
  controls: {
@@ -825,8 +850,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
825
850
  filters?: number | undefined;
826
851
  controls?: number | undefined;
827
852
  fields?: number | undefined;
828
- drillSteps?: number | undefined;
829
853
  comparisons?: number | undefined;
854
+ drillSteps?: number | undefined;
830
855
  sqlParameters?: number | undefined;
831
856
  } | undefined;
832
857
  } | {
@@ -835,15 +860,10 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
835
860
  message?: string | undefined;
836
861
  };
837
862
  title: string;
838
- visualType: string;
839
863
  fingerprint: string;
864
+ visualType: string;
840
865
  source?: SemaphorSourceRef | undefined;
841
866
  } | undefined;
842
- omitted?: {
843
- cards?: number | undefined;
844
- activeInputs?: number | undefined;
845
- otherSheets?: number | undefined;
846
- } | undefined;
847
867
  editing?: {
848
868
  mode: "sql" | "visual";
849
869
  } | undefined;
@@ -857,6 +877,10 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
857
877
  source?: SemaphorSourceRef | undefined;
858
878
  }[];
859
879
  surface: "none" | "dashboard" | "editor";
880
+ otherSheets: {
881
+ id: string;
882
+ title: string;
883
+ }[];
860
884
  activeInputs: {
861
885
  value: {
862
886
  kind: "set";
@@ -871,10 +895,6 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
871
895
  inputId: string;
872
896
  globalDate?: true | undefined;
873
897
  }[];
874
- otherSheets: {
875
- id: string;
876
- title: string;
877
- }[];
878
898
  sheet?: {
879
899
  id: string;
880
900
  title: string;
@@ -884,13 +904,18 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
884
904
  title: string;
885
905
  unsavedEdits: boolean;
886
906
  } | undefined;
907
+ omitted?: {
908
+ cards?: number | undefined;
909
+ otherSheets?: number | undefined;
910
+ activeInputs?: number | undefined;
911
+ } | undefined;
887
912
  selectedCard?: {
888
913
  id: string;
889
914
  description: {
890
915
  status: "described";
891
916
  filters: {
892
917
  text: string;
893
- origin: "card" | "selection" | "drill" | "dashboard_input" | "card_input";
918
+ origin: "card" | "selection" | "dashboard_input" | "card_input" | "drill";
894
919
  omittedValues?: number | undefined;
895
920
  }[];
896
921
  controls: {
@@ -917,8 +942,8 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
917
942
  filters?: number | undefined;
918
943
  controls?: number | undefined;
919
944
  fields?: number | undefined;
920
- drillSteps?: number | undefined;
921
945
  comparisons?: number | undefined;
946
+ drillSteps?: number | undefined;
922
947
  sqlParameters?: number | undefined;
923
948
  } | undefined;
924
949
  } | {
@@ -927,15 +952,10 @@ export declare const assistantContextSchema: z.ZodEffects<z.ZodObject<{
927
952
  message?: string | undefined;
928
953
  };
929
954
  title: string;
930
- visualType: string;
931
955
  fingerprint: string;
956
+ visualType: string;
932
957
  source?: SemaphorSourceRef | undefined;
933
958
  } | undefined;
934
- omitted?: {
935
- cards?: number | undefined;
936
- activeInputs?: number | undefined;
937
- otherSheets?: number | undefined;
938
- } | undefined;
939
959
  editing?: {
940
960
  mode: "sql" | "visual";
941
961
  } | undefined;
@@ -948,5 +968,7 @@ export declare function compareAssistantContexts(previous: AssistantContext | un
948
968
  * since the last turn. Never a card config or rows.
949
969
  */
950
970
  export declare function renderContextForModel(context: AssistantContext, changes: AssistantContextChange[], addedSources: SemaphorSourceRef[]): string;
971
+ /** One field of a card, as the model reads it: the card's description and a question's tags (Phase 11) both use it. */
972
+ export declare function describeCardField(field: AssistantCardField): string;
951
973
  /** A source in words, with the identifiers the tools take. */
952
974
  export declare function describeSource(source: SemaphorSourceRef): string;
@@ -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;
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.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",