@newheap/platform-ai-chat 0.2.0 → 0.3.0

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/index.d.ts CHANGED
@@ -336,6 +336,12 @@ interface NhAssistantConfig {
336
336
  * failing getter or an invalid shape only leaves the context out. Default: none.
337
337
  */
338
338
  getPageContext?: () => ClientContext | null | Promise<ClientContext | null>;
339
+ /**
340
+ * Stable, non-secret identity for browser UI state (for example a user id plus tenant id).
341
+ * Runs in the assistant injection context. Return null on sign-out. Without this callback
342
+ * the assistant keeps UI state in memory only. Never return an access token.
343
+ */
344
+ getStateScope?: () => string | null | Promise<string | null>;
339
345
  /** Injectable access policy. Default: always allowed. */
340
346
  accessPolicy?: Type<NhAssistantAccessPolicy>;
341
347
  /** Agent selected when the user has not chosen one. Default: the first agent the server lists. */
@@ -541,6 +547,7 @@ declare class NhAssistantStore {
541
547
  private readonly config;
542
548
  private readonly injector;
543
549
  private readonly accessPolicy;
550
+ private readonly uiState;
544
551
  private readonly accessGrantedState;
545
552
  private readonly statusState;
546
553
  private readonly statusLoadingState;
@@ -557,10 +564,14 @@ declare class NhAssistantStore {
557
564
  private readonly restoredDraftState;
558
565
  private readonly pageContextState;
559
566
  private readonly pageContextExcludedState;
567
+ private readonly restorePanelOpenState;
560
568
  private accessSubscription?;
561
569
  private streamSubscription?;
562
570
  private cancelTimer?;
563
571
  private initialization?;
572
+ private statusRevision;
573
+ private accountRevision;
574
+ private pendingSendResolve?;
564
575
  /** True when the access policy allows the user and the server reports the assistant as enabled. */
565
576
  readonly enabled: _angular_core.Signal<boolean>;
566
577
  readonly accessGranted: _angular_core.Signal<boolean | null>;
@@ -590,6 +601,8 @@ declare class NhAssistantStore {
590
601
  readonly pageContext: _angular_core.Signal<ClientContext | null>;
591
602
  /** True when the user left the page context out of the next message. */
592
603
  readonly pageContextExcluded: _angular_core.Signal<boolean>;
604
+ /** Whether the drawer was open when this account last left the application. */
605
+ readonly restorePanelOpen: _angular_core.Signal<boolean>;
593
606
  /** True while the user can send: enabled, an agent is chosen and no turn runs or waits. */
594
607
  readonly canSend: _angular_core.Signal<boolean>;
595
608
  constructor();
@@ -603,6 +616,7 @@ declare class NhAssistantStore {
603
616
  /** Leaves the active conversation; the next message creates a new one. */
604
617
  startNewConversation(): void;
605
618
  openConversation(conversationId: string): Promise<void>;
619
+ private loadConversation;
606
620
  deleteConversation(conversationId: string): Promise<void>;
607
621
  /**
608
622
  * Sends a user message. Creates a conversation with the selected agent when none is
@@ -615,6 +629,8 @@ declare class NhAssistantStore {
615
629
  /** Asks the server to stop the running turn or to abandon a waiting approval. */
616
630
  cancel(): Promise<void>;
617
631
  clearError(): void;
632
+ /** Persists only drawer visibility, never the page context or a message draft. */
633
+ setPanelOpen(open: boolean): void;
618
634
  /** Reads the host's page context again so the chip shows what the next message sends. */
619
635
  refreshPageContext(): Promise<void>;
620
636
  /** Leaves the page context out of the next message only, or includes it again. */
@@ -630,6 +646,7 @@ declare class NhAssistantStore {
630
646
  private startInitialization;
631
647
  private createConversation;
632
648
  private runStream;
649
+ private stopLocalTurn;
633
650
  private applyEvent;
634
651
  private afterTurn;
635
652
  private reloadActiveConversation;
@@ -664,6 +681,7 @@ declare class NhAssistantPanelService {
664
681
  readonly isOpen: Signal<boolean>;
665
682
  constructor();
666
683
  open(conversationId?: string): void;
684
+ private showPanel;
667
685
  close(): void;
668
686
  toggle(): void;
669
687
  /** Called by `nh-assistant-panel`; hosts should place that component once instead. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newheap/platform-ai-chat",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^20.2.14",
6
6
  "@angular/common": "^20.3.28",