@newheap/platform-ai-chat 0.1.1 → 0.2.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
@@ -58,7 +58,11 @@
58
58
  "send": "Send message",
59
59
  "stop": "Stop the assistant",
60
60
  "characters": "{{count}} of {{max}} characters",
61
- "too-long": "The message is too long."
61
+ "too-long": "The message is too long.",
62
+ "status": {
63
+ "running": "You can keep typing while the assistant works. Sending is temporarily unavailable.",
64
+ "waiting-for-approval": "You can keep typing while an action waits for your approval. Sending is temporarily unavailable."
65
+ }
62
66
  },
63
67
  "tool-call": {
64
68
  "label": "Tool call: {{name}}",
@@ -67,6 +71,7 @@
67
71
  "arguments": "Input",
68
72
  "result": "Result",
69
73
  "result-code": "Result",
74
+ "tool-id": "Technical tool id",
70
75
  "status": {
71
76
  "running": "Running",
72
77
  "succeeded": "Completed",
@@ -77,6 +82,9 @@
77
82
  },
78
83
  "approval": {
79
84
  "title": "Approval required",
85
+ "fallback-summary": "Review this action before it runs.",
86
+ "technical-details": "Technical details",
87
+ "tool-id": "Tool id",
80
88
  "targets": "Affects",
81
89
  "arguments": "Proposed change",
82
90
  "expires-in": "Expires in {{time}}",
package/i18n/nl.json CHANGED
@@ -58,7 +58,11 @@
58
58
  "send": "Bericht versturen",
59
59
  "stop": "Assistent stoppen",
60
60
  "characters": "{{count}} van {{max}} tekens",
61
- "too-long": "Het bericht is te lang."
61
+ "too-long": "Het bericht is te lang.",
62
+ "status": {
63
+ "running": "Je kunt verder typen terwijl de assistent bezig is. Versturen is tijdelijk niet mogelijk.",
64
+ "waiting-for-approval": "Je kunt verder typen terwijl een actie op je goedkeuring wacht. Versturen is tijdelijk niet mogelijk."
65
+ }
62
66
  },
63
67
  "tool-call": {
64
68
  "label": "Toolaanroep: {{name}}",
@@ -67,6 +71,7 @@
67
71
  "arguments": "Invoer",
68
72
  "result": "Resultaat",
69
73
  "result-code": "Resultaat",
74
+ "tool-id": "Technisch tool-id",
70
75
  "status": {
71
76
  "running": "Bezig",
72
77
  "succeeded": "Voltooid",
@@ -77,6 +82,9 @@
77
82
  },
78
83
  "approval": {
79
84
  "title": "Goedkeuring nodig",
85
+ "fallback-summary": "Controleer deze actie voordat ze wordt uitgevoerd.",
86
+ "technical-details": "Technische details",
87
+ "tool-id": "Tool-id",
80
88
  "targets": "Betreft",
81
89
  "arguments": "Voorgestelde wijziging",
82
90
  "expires-in": "Verloopt over {{time}}",
package/index.d.ts CHANGED
@@ -59,6 +59,16 @@ interface ToolCallPart {
59
59
  resultCode: string | null;
60
60
  }
61
61
  type ApprovalStatus = 'pending' | 'approved' | 'rejected' | 'expired';
62
+ interface ApprovalPresentationField {
63
+ label: string;
64
+ value: string;
65
+ }
66
+ interface ApprovalPresentation {
67
+ toolDisplayName: string;
68
+ summary: string;
69
+ fields: ApprovalPresentationField[];
70
+ notice: string | null;
71
+ }
62
72
  interface ApprovalPart {
63
73
  type: 'approval';
64
74
  approvalId: string;
@@ -66,6 +76,8 @@ interface ApprovalPart {
66
76
  proposalHash: string;
67
77
  toolId: string;
68
78
  summary: string;
79
+ /** Trusted server-side presentation. Missing on old events and when no presenter handled the tool. */
80
+ presentation?: ApprovalPresentation | null;
69
81
  argumentsPreview: string;
70
82
  targets: string[];
71
83
  expiresAt: string;
@@ -719,6 +731,7 @@ declare class NhAssistantPanelComponent implements AfterViewInit, OnDestroy {
719
731
  readonly closed: _angular_core.Signal<boolean>;
720
732
  readonly busy: _angular_core.Signal<boolean>;
721
733
  readonly composerDisabled: _angular_core.Signal<boolean>;
734
+ readonly composerStatus: _angular_core.Signal<"running" | "waiting-for-approval" | null>;
722
735
  readonly errorKeys: _angular_core.Signal<string[]>;
723
736
  constructor();
724
737
  ngAfterViewInit(): void;
@@ -779,20 +792,28 @@ declare class NhAssistantThreadComponent {
779
792
  }
780
793
 
781
794
  /**
782
- * Message input. Enter sends, Shift+Enter inserts a new line. While the assistant runs
783
- * the send button becomes a stop button.
795
+ * Message input. Enter sends when sending is available; Shift+Enter inserts a new line.
796
+ * Drafting remains available while the assistant runs or waits for approval.
784
797
  */
785
798
  declare class NhAssistantComposerComponent {
786
- /** Disables typing and sending, for example while a turn runs or waits for approval. */
799
+ /** Disables the editor only when the conversation itself cannot accept a draft. */
787
800
  readonly disabled: _angular_core.InputSignal<boolean>;
801
+ /** Blocks sending without disabling the editor or clearing its draft. */
802
+ readonly sendDisabled: _angular_core.InputSignal<boolean>;
788
803
  /** Shows the stop button instead of the send button. */
789
804
  readonly busy: _angular_core.InputSignal<boolean>;
805
+ /** Announces why sending is temporarily unavailable. */
806
+ readonly status: _angular_core.InputSignal<"running" | "waiting-for-approval" | null>;
790
807
  readonly maxLength: _angular_core.InputSignal<number | null>;
791
808
  /** Text to put back into the input, for example a message the server did not accept. */
792
809
  readonly restore: _angular_core.InputSignal<string | null>;
793
810
  readonly send: _angular_core.OutputEmitterRef<string>;
794
811
  readonly cancel: _angular_core.OutputEmitterRef<void>;
795
812
  readonly restored: _angular_core.OutputEmitterRef<void>;
813
+ private readonly host;
814
+ private readonly textarea;
815
+ private ownedFocus;
816
+ private previousBusy;
796
817
  readonly inputId: string;
797
818
  readonly hintId: string;
798
819
  readonly text: _angular_core.WritableSignal<string>;
@@ -801,11 +822,15 @@ declare class NhAssistantComposerComponent {
801
822
  readonly showCounter: _angular_core.Signal<boolean>;
802
823
  readonly canSend: _angular_core.Signal<boolean>;
803
824
  constructor();
825
+ onFocusIn(): void;
826
+ onFocusOut(event: FocusEvent): void;
804
827
  onInput(event: Event): void;
805
828
  onKeydown(event: KeyboardEvent): void;
829
+ onSubmit(event: SubmitEvent): void;
806
830
  submit(): void;
831
+ private restoreOwnedFocus;
807
832
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantComposerComponent, never>;
808
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantComposerComponent, "nh-assistant-composer", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "busy": { "alias": "busy"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "restore": { "alias": "restore"; "required": false; "isSignal": true; }; }, { "send": "send"; "cancel": "cancel"; "restored": "restored"; }, never, never, true, never>;
833
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantComposerComponent, "nh-assistant-composer", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "sendDisabled": { "alias": "sendDisabled"; "required": false; "isSignal": true; }; "busy": { "alias": "busy"; "required": false; "isSignal": true; }; "status": { "alias": "status"; "required": false; "isSignal": true; }; "maxLength": { "alias": "maxLength"; "required": false; "isSignal": true; }; "restore": { "alias": "restore"; "required": false; "isSignal": true; }; }, { "send": "send"; "cancel": "cancel"; "restored": "restored"; }, never, never, true, never>;
809
834
  }
810
835
 
811
836
  /** Shows one tool invocation with its status and expandable input and result previews. */
@@ -840,6 +865,7 @@ declare class NhAssistantApprovalCardComponent {
840
865
  readonly actionable: _angular_core.Signal<boolean>;
841
866
  readonly disabled: _angular_core.Signal<boolean>;
842
867
  readonly countdown: _angular_core.Signal<string>;
868
+ readonly presentedSummary: _angular_core.Signal<string | null>;
843
869
  constructor();
844
870
  choose(decision: ApprovalDecision): void;
845
871
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantApprovalCardComponent, never>;
@@ -934,4 +960,4 @@ declare function nhAssistantErrorKeys(error: NhAssistantError | null): string[];
934
960
  declare const NH_ASSISTANT_DASH_CASE: RegExp;
935
961
 
936
962
  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 };
937
- export type { AdminAgent, AdminAgentInput, AgentSummary, ApplicationContext, ApplicationContextVersion, ApprovalDecision, ApprovalPart, 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 };
963
+ 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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newheap/platform-ai-chat",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^20.2.14",
6
6
  "@angular/common": "^20.3.28",
@@ -31,6 +31,15 @@ interface NhAssistantMockApprovalStep {
31
31
  displayName: string;
32
32
  toolVersion?: number;
33
33
  summary: string;
34
+ presentation?: {
35
+ toolDisplayName: string;
36
+ summary: string;
37
+ fields: {
38
+ label: string;
39
+ value: string;
40
+ }[];
41
+ notice: string | null;
42
+ } | null;
34
43
  argumentsPreview: string;
35
44
  targets: string[];
36
45
  /** Default 300 seconds. */