@newheap/platform-ai-chat 0.3.0 → 0.5.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/i18n/en.json CHANGED
@@ -49,7 +49,8 @@
49
49
  "assistant": "Assistant",
50
50
  "tool": "Tool",
51
51
  "working": "The assistant is working",
52
- "loading": "Loading conversation"
52
+ "loading": "Loading conversation",
53
+ "elapsed": "{{seconds}}s"
53
54
  },
54
55
  "composer": {
55
56
  "label": "Message",
@@ -80,6 +81,16 @@
80
81
  "rejected": "Rejected"
81
82
  }
82
83
  },
84
+ "tool-group": {
85
+ "running": "Calling {{name}}…",
86
+ "awaiting-approval": "Waiting for approval: {{name}}",
87
+ "used-one": "Used 1 tool",
88
+ "used-many": "Used {{count}} tools",
89
+ "progress": "{{finished}} of {{total}} done",
90
+ "failed": "{{count}} failed",
91
+ "show-calls": "Show tool calls",
92
+ "hide-calls": "Hide tool calls"
93
+ },
83
94
  "approval": {
84
95
  "title": "Approval required",
85
96
  "fallback-summary": "Review this action before it runs.",
@@ -159,6 +170,9 @@
159
170
  "assistant-turn-failed": "The assistant could not finish the answer. Try again.",
160
171
  "assistant-turn-timeout": "The answer took too long and was stopped. Try again or ask a narrower question."
161
172
  },
173
+ "notices": {
174
+ "no-answer": "The assistant finished without an answer. Try again or rephrase your question."
175
+ },
162
176
  "preferences": {
163
177
  "title": "Your preferences",
164
178
  "description": "Choose how the assistant answers you. Preferences change the style only; they never change what the assistant may do or which actions need your approval.",
package/i18n/nl.json CHANGED
@@ -49,7 +49,8 @@
49
49
  "assistant": "Assistent",
50
50
  "tool": "Tool",
51
51
  "working": "De assistent is bezig",
52
- "loading": "Gesprek laden"
52
+ "loading": "Gesprek laden",
53
+ "elapsed": "{{seconds}} s"
53
54
  },
54
55
  "composer": {
55
56
  "label": "Bericht",
@@ -80,6 +81,16 @@
80
81
  "rejected": "Afgewezen"
81
82
  }
82
83
  },
84
+ "tool-group": {
85
+ "running": "Roept {{name}} aan…",
86
+ "awaiting-approval": "Wacht op goedkeuring: {{name}}",
87
+ "used-one": "1 tool gebruikt",
88
+ "used-many": "{{count}} tools gebruikt",
89
+ "progress": "{{finished}} van {{total}} klaar",
90
+ "failed": "{{count}} mislukt",
91
+ "show-calls": "Tool-aanroepen tonen",
92
+ "hide-calls": "Tool-aanroepen verbergen"
93
+ },
83
94
  "approval": {
84
95
  "title": "Goedkeuring nodig",
85
96
  "fallback-summary": "Controleer deze actie voordat ze wordt uitgevoerd.",
@@ -159,6 +170,9 @@
159
170
  "assistant-turn-failed": "De assistent kon het antwoord niet afmaken. Probeer het opnieuw.",
160
171
  "assistant-turn-timeout": "Het antwoord duurde te lang en is gestopt. Probeer het opnieuw of stel een gerichtere vraag."
161
172
  },
173
+ "notices": {
174
+ "no-answer": "De assistent is klaar zonder antwoord. Probeer het opnieuw of stel je vraag anders."
175
+ },
162
176
  "preferences": {
163
177
  "title": "Je voorkeuren",
164
178
  "description": "Kies hoe de assistent je antwoordt. Voorkeuren veranderen alleen de stijl; ze veranderen nooit wat de assistent mag of welke acties je goedkeuring nodig hebben.",
package/index.d.ts CHANGED
@@ -513,6 +513,11 @@ declare class NhAssistantAdminApiService {
513
513
  declare function applyNhAssistantEvent(conversation: Conversation, event: NhAssistantSseEvent, clientMessageId?: string): Conversation;
514
514
  /** Records the user's approval decision locally until the server state is reloaded. */
515
515
  declare function applyNhAssistantApprovalDecision(conversation: Conversation, approvalId: string, decision: 'approve' | 'reject'): Conversation;
516
+ /**
517
+ * True when an assistant message after the latest user message contains non-blank text,
518
+ * so the latest turn produced a visible answer. Tool calls and approvals alone do not count.
519
+ */
520
+ declare function nhAssistantLatestTurnHasText(conversation: Conversation): boolean;
516
521
 
517
522
  /** Limits of the page context (contract 15.2). */
518
523
  declare const NH_ASSISTANT_PAGE_CONTEXT_LIMITS: {
@@ -538,6 +543,13 @@ interface NhAssistantError {
538
543
  code: string;
539
544
  messageKey: string;
540
545
  }
546
+ /**
547
+ * A non-blocking remark about a turn that completed normally, for example a limit that cut the
548
+ * answer short. The conversation stays usable; the notice only explains the answer.
549
+ */
550
+ type NhAssistantNotice = NhAssistantError;
551
+ /** Notice code for a completed turn that produced no answer text and no server code. */
552
+ declare const NH_ASSISTANT_NO_ANSWER_NOTICE_CODE = "assistant-no-answer";
541
553
  /**
542
554
  * Signal-based state of one assistant scope: availability, agents, the conversation list
543
555
  * and the active conversation with its streamed turn.
@@ -560,6 +572,7 @@ declare class NhAssistantStore {
560
572
  private readonly streamingState;
561
573
  private readonly decidingState;
562
574
  private readonly errorState;
575
+ private readonly noticeState;
563
576
  private readonly lastUsageState;
564
577
  private readonly restoredDraftState;
565
578
  private readonly pageContextState;
@@ -594,6 +607,8 @@ declare class NhAssistantStore {
594
607
  readonly pendingApproval: _angular_core.Signal<ApprovalPart | null>;
595
608
  readonly deciding: _angular_core.Signal<boolean>;
596
609
  readonly error: _angular_core.Signal<NhAssistantError | null>;
610
+ /** Non-blocking remark about the latest completed turn; shown only while no error is shown. */
611
+ readonly notice: _angular_core.Signal<NhAssistantError | null>;
597
612
  readonly lastUsage: _angular_core.Signal<TurnUsage | null>;
598
613
  /** Text of a message the server did not accept, so the composer can offer it again. */
599
614
  readonly restoredDraft: _angular_core.Signal<string | null>;
@@ -629,6 +644,7 @@ declare class NhAssistantStore {
629
644
  /** Asks the server to stop the running turn or to abandon a waiting approval. */
630
645
  cancel(): Promise<void>;
631
646
  clearError(): void;
647
+ clearNotice(): void;
632
648
  /** Persists only drawer visibility, never the page context or a message draft. */
633
649
  setPanelOpen(open: boolean): void;
634
650
  /** Reads the host's page context again so the chip shows what the next message sends. */
@@ -648,6 +664,8 @@ declare class NhAssistantStore {
648
664
  private runStream;
649
665
  private stopLocalTurn;
650
666
  private applyEvent;
667
+ /** A completed turn with a server code, or without any answer text, explains itself with a notice. */
668
+ private completionNotice;
651
669
  private afterTurn;
652
670
  private reloadActiveConversation;
653
671
  private updateActive;
@@ -751,6 +769,7 @@ declare class NhAssistantPanelComponent implements AfterViewInit, OnDestroy {
751
769
  readonly composerDisabled: _angular_core.Signal<boolean>;
752
770
  readonly composerStatus: _angular_core.Signal<"running" | "waiting-for-approval" | null>;
753
771
  readonly errorKeys: _angular_core.Signal<string[]>;
772
+ readonly noticeKeys: _angular_core.Signal<string[]>;
754
773
  constructor();
755
774
  ngAfterViewInit(): void;
756
775
  ngOnDestroy(): void;
@@ -786,8 +805,9 @@ declare class NhAssistantConversationListComponent {
786
805
  declare const NH_ASSISTANT_VIRTUAL_SCROLL_THRESHOLD = 200;
787
806
  /**
788
807
  * The messages of a conversation as a live log. Assistant text renders as sanitized
789
- * Markdown, tool calls and approvals as cards. The thread follows new content while the
790
- * user is at the bottom.
808
+ * Markdown, consecutive tool calls as one collapsible group that counts along, and
809
+ * approvals as cards. While a turn runs without visible progress, a working indicator
810
+ * shows the elapsed time. The thread follows new content while the user is at the bottom.
791
811
  */
792
812
  declare class NhAssistantThreadComponent {
793
813
  private readonly injector;
@@ -798,7 +818,16 @@ declare class NhAssistantThreadComponent {
798
818
  readonly approvalDecision: _angular_core.OutputEmitterRef<ApprovalDecision>;
799
819
  readonly virtualThreshold = 200;
800
820
  readonly virtual: _angular_core.Signal<boolean>;
821
+ /**
822
+ * True while the turn runs and nothing else shows progress: before the first part and
823
+ * between tool calls while the model decides what to do next. Streaming text and a
824
+ * running tool group show their own progress; an approval waits for the user.
825
+ */
801
826
  readonly working: _angular_core.Signal<boolean>;
827
+ /** Whole seconds since the running turn started. */
828
+ readonly elapsedSeconds: _angular_core.Signal<number>;
829
+ private readonly turnStartedAt;
830
+ private readonly now;
802
831
  private readonly scroller;
803
832
  private readonly viewport;
804
833
  constructor();
@@ -863,6 +892,29 @@ declare class NhAssistantToolCallCardComponent {
863
892
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantToolCallCardComponent, "nh-assistant-tool-call-card", never, { "part": { "alias": "part"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
864
893
  }
865
894
 
895
+ /** Overall state of a run of tool calls, from most to least urgent. */
896
+ type NhAssistantToolCallGroupState = 'awaiting-approval' | 'running' | 'failed' | 'succeeded';
897
+ /**
898
+ * Summarizes consecutive tool calls in one collapsed line that counts along live: the
899
+ * tool that runs now while the assistant works, and how many tools were used and failed
900
+ * afterwards. Expanding it shows every call as a card.
901
+ */
902
+ declare class NhAssistantToolCallGroupComponent {
903
+ readonly calls: _angular_core.InputSignal<readonly ToolCallPart[]>;
904
+ readonly callsId: string;
905
+ readonly expanded: _angular_core.WritableSignal<boolean>;
906
+ /** The call that currently needs attention or runs; the latest one when several do. */
907
+ readonly current: _angular_core.Signal<ToolCallPart | null>;
908
+ readonly total: _angular_core.Signal<number>;
909
+ readonly finished: _angular_core.Signal<number>;
910
+ readonly failed: _angular_core.Signal<number>;
911
+ readonly state: _angular_core.Signal<NhAssistantToolCallGroupState>;
912
+ readonly stateIcon: _angular_core.Signal<NhAssistantIconName>;
913
+ toggle(): void;
914
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantToolCallGroupComponent, never>;
915
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantToolCallGroupComponent, "nh-assistant-tool-call-group", never, { "calls": { "alias": "calls"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
916
+ }
917
+
866
918
  /** Formats remaining milliseconds as `m:ss`, or `h:mm:ss` above one hour. */
867
919
  declare function formatNhAssistantCountdown(milliseconds: number): string;
868
920
  /**
@@ -977,5 +1029,5 @@ declare function nhAssistantErrorKeys(error: NhAssistantError | null): string[];
977
1029
  /** Dash-case identifiers as the contract requires for agent and MCP server ids. */
978
1030
  declare const NH_ASSISTANT_DASH_CASE: RegExp;
979
1031
 
980
- export { NH_ASSISTANT_ACCESS_POLICY, NH_ASSISTANT_CONFIG, NH_ASSISTANT_FETCH, NH_ASSISTANT_ICONS, NH_ASSISTANT_MAX_CUSTOM_INSTRUCTIONS, NH_ASSISTANT_PAGE_CONTEXT_LIMITS, NH_ASSISTANT_PANEL_MOBILE_QUERY, NH_ASSISTANT_PANEL_WIDTH, NH_ASSISTANT_SSE_EVENT_TYPES, NH_ASSISTANT_TRANSLATIONS, NH_ASSISTANT_VIRTUAL_SCROLL_THRESHOLD, NhAssistantAdminApiService, NhAssistantAgentPickerComponent, NhAssistantAllowAllAccessPolicy, NhAssistantApiError, NhAssistantApiService, NhAssistantApprovalCardComponent, NhAssistantClientErrorCodes, NhAssistantComposerComponent, NhAssistantConversationListComponent, NhAssistantLauncherComponent, NhAssistantPanelComponent, NhAssistantPanelService, NhAssistantPreferencesComponent, NhAssistantSseParser, NhAssistantStore, NhAssistantThreadComponent, NhAssistantToolCallCardComponent, NhAssistantTranslationMerger, applyNhAssistantApprovalDecision, applyNhAssistantEvent, describeNhAssistantClientContext, formatNhAssistantCountdown, nhAssistantCodeForStatus, nhAssistantErrorMessageKey, normalizeNhAssistantClientContext, provideNhAssistant, NH_ASSISTANT_DASH_CASE as ɵNH_ASSISTANT_DASH_CASE, NhAssistantIconComponent as ɵNhAssistantIconComponent, NhAssistantTranslatePipe as ɵNhAssistantTranslatePipe, nhAssistantErrorKeys as ɵnhAssistantErrorKeys, toNhAssistantError as ɵtoNhAssistantError };
981
- export type { AdminAgent, AdminAgentInput, AgentSummary, ApplicationContext, ApplicationContextVersion, ApprovalDecision, ApprovalPart, ApprovalPresentation, ApprovalPresentationField, ApprovalRequiredEvent, ApprovalStatus, AssistantAddressForm, AssistantAutonomy, AssistantErrorEvent, AssistantPreferences, AssistantResponseLength, AssistantStatus, AssistantStyle, ClientContext, ClientContextEntity, Conversation, ConversationPage, ConversationStatus, ConversationSummary, CreateConversationRequest, DecideApprovalRequest, McpAuthMode, McpServer, McpServerInput, McpServerTestResult, McpTool, McpToolEffect, McpToolStatus, Message, MessageDeltaEvent, MessagePart, NhAssistantAccessPolicy, NhAssistantClientContext, NhAssistantClientErrorCode, NhAssistantConfig, NhAssistantError, NhAssistantFetch, NhAssistantIconName, NhAssistantRawSseMessage, NhAssistantSseEvent, NhAssistantSseEventMap, NhAssistantSseEventType, NhAssistantStatusCodes, SendMessageRequest, TextPart, ToolCallPart, ToolCallStatus, ToolCatalogEffect, ToolCatalogEntry, ToolCompletedEvent, ToolStartedEvent, TurnCompletedEvent, TurnCompletionStatus, TurnStartedEvent, TurnUsage, UpdateAdminAgentRequest, UpdateApplicationContextRequest, UpdateMcpToolRequest };
1032
+ export { NH_ASSISTANT_ACCESS_POLICY, NH_ASSISTANT_CONFIG, NH_ASSISTANT_FETCH, NH_ASSISTANT_ICONS, NH_ASSISTANT_MAX_CUSTOM_INSTRUCTIONS, NH_ASSISTANT_NO_ANSWER_NOTICE_CODE, NH_ASSISTANT_PAGE_CONTEXT_LIMITS, NH_ASSISTANT_PANEL_MOBILE_QUERY, NH_ASSISTANT_PANEL_WIDTH, NH_ASSISTANT_SSE_EVENT_TYPES, NH_ASSISTANT_TRANSLATIONS, NH_ASSISTANT_VIRTUAL_SCROLL_THRESHOLD, NhAssistantAdminApiService, NhAssistantAgentPickerComponent, NhAssistantAllowAllAccessPolicy, NhAssistantApiError, NhAssistantApiService, NhAssistantApprovalCardComponent, NhAssistantClientErrorCodes, NhAssistantComposerComponent, NhAssistantConversationListComponent, NhAssistantLauncherComponent, NhAssistantPanelComponent, NhAssistantPanelService, NhAssistantPreferencesComponent, NhAssistantSseParser, NhAssistantStore, NhAssistantThreadComponent, NhAssistantToolCallCardComponent, NhAssistantToolCallGroupComponent, NhAssistantTranslationMerger, applyNhAssistantApprovalDecision, applyNhAssistantEvent, describeNhAssistantClientContext, formatNhAssistantCountdown, nhAssistantCodeForStatus, nhAssistantErrorMessageKey, nhAssistantLatestTurnHasText, normalizeNhAssistantClientContext, provideNhAssistant, NH_ASSISTANT_DASH_CASE as ɵNH_ASSISTANT_DASH_CASE, NhAssistantIconComponent as ɵNhAssistantIconComponent, NhAssistantTranslatePipe as ɵNhAssistantTranslatePipe, nhAssistantErrorKeys as ɵnhAssistantErrorKeys, toNhAssistantError as ɵtoNhAssistantError };
1033
+ export type { AdminAgent, AdminAgentInput, AgentSummary, ApplicationContext, ApplicationContextVersion, ApprovalDecision, ApprovalPart, ApprovalPresentation, ApprovalPresentationField, ApprovalRequiredEvent, ApprovalStatus, AssistantAddressForm, AssistantAutonomy, AssistantErrorEvent, AssistantPreferences, AssistantResponseLength, AssistantStatus, AssistantStyle, ClientContext, ClientContextEntity, Conversation, ConversationPage, ConversationStatus, ConversationSummary, CreateConversationRequest, DecideApprovalRequest, McpAuthMode, McpServer, McpServerInput, McpServerTestResult, McpTool, McpToolEffect, McpToolStatus, Message, MessageDeltaEvent, MessagePart, NhAssistantAccessPolicy, NhAssistantClientContext, NhAssistantClientErrorCode, NhAssistantConfig, NhAssistantError, NhAssistantFetch, NhAssistantIconName, NhAssistantNotice, NhAssistantRawSseMessage, NhAssistantSseEvent, NhAssistantSseEventMap, NhAssistantSseEventType, NhAssistantStatusCodes, NhAssistantToolCallGroupState, SendMessageRequest, TextPart, ToolCallPart, ToolCallStatus, ToolCatalogEffect, ToolCatalogEntry, ToolCompletedEvent, ToolStartedEvent, TurnCompletedEvent, TurnCompletionStatus, TurnStartedEvent, TurnUsage, UpdateAdminAgentRequest, UpdateApplicationContextRequest, UpdateMcpToolRequest };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newheap/platform-ai-chat",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^20.2.14",
6
6
  "@angular/common": "^20.3.28",