@newheap/platform-ai-chat 0.3.0 → 0.4.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
@@ -159,6 +159,9 @@
159
159
  "assistant-turn-failed": "The assistant could not finish the answer. Try again.",
160
160
  "assistant-turn-timeout": "The answer took too long and was stopped. Try again or ask a narrower question."
161
161
  },
162
+ "notices": {
163
+ "no-answer": "The assistant finished without an answer. Try again or rephrase your question."
164
+ },
162
165
  "preferences": {
163
166
  "title": "Your preferences",
164
167
  "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
@@ -159,6 +159,9 @@
159
159
  "assistant-turn-failed": "De assistent kon het antwoord niet afmaken. Probeer het opnieuw.",
160
160
  "assistant-turn-timeout": "Het antwoord duurde te lang en is gestopt. Probeer het opnieuw of stel een gerichtere vraag."
161
161
  },
162
+ "notices": {
163
+ "no-answer": "De assistent is klaar zonder antwoord. Probeer het opnieuw of stel je vraag anders."
164
+ },
162
165
  "preferences": {
163
166
  "title": "Je voorkeuren",
164
167
  "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;
@@ -977,5 +996,5 @@ declare function nhAssistantErrorKeys(error: NhAssistantError | null): string[];
977
996
  /** Dash-case identifiers as the contract requires for agent and MCP server ids. */
978
997
  declare const NH_ASSISTANT_DASH_CASE: RegExp;
979
998
 
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 };
999
+ 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, 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 };
1000
+ 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, 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.4.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^20.2.14",
6
6
  "@angular/common": "^20.3.28",