@newheap/platform-ai-chat 0.9.0 → 0.11.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
@@ -12,7 +12,14 @@ import { TemplatePortal } from '@angular/cdk/portal';
12
12
  type AgentSubjectRole = 'none' | 'reader' | 'participant' | 'approver';
13
13
  type AgentRunStatus = 'queued' | 'running' | 'waiting-for-approval' | 'completed' | 'failed' | 'cancelled';
14
14
  type AgentProposalStatus = 'pending' | 'approved' | 'rejected' | 'expired' | 'withdrawn' | 'stale' | 'executing' | 'executed' | 'execution-failed' | 'execution-unknown' | 'resolved' | 'shadow';
15
- type AgentGrantSource = 'none' | 'delegated' | 'agent';
15
+ type AgentGrantSource = 'none' | 'delegated' | 'agent' | 'delegated-read';
16
+ /**
17
+ * How a run worked: `model` through the language model, `rule` through the agent's rules without a
18
+ * model, `rule-then-model` when the rules handed the run over to the model.
19
+ */
20
+ type AgentRunKind = 'model' | 'rule' | 'rule-then-model';
21
+ /** Who chose the skill a run worked in. */
22
+ type AgentSkillChooser = 'trigger' | 'rules' | 'triage' | 'model';
16
23
  interface AgentRun {
17
24
  id: string;
18
25
  conversationId: string;
@@ -34,6 +41,20 @@ interface AgentRun {
34
41
  startedAt: string | null;
35
42
  endedAt: string | null;
36
43
  backgroundOperationId: string | null;
44
+ /** How the run worked. Missing on older servers, which only ran the model. */
45
+ kind?: AgentRunKind;
46
+ /** The skill of the agent the run worked in; missing or null for the agent's own tools. */
47
+ skill?: string | null;
48
+ skillChosenBy?: AgentSkillChooser | null;
49
+ /** The agent that handed the run's work off; missing or null for a run no agent asked for. */
50
+ requestedByAgentId?: string | null;
51
+ /**
52
+ * The thread of the run that handed the work off, only in a thread's run list and only when the
53
+ * reader may open it.
54
+ */
55
+ requestedByConversationId?: string | null;
56
+ /** How many hand-offs led to the run; 0 or missing for a run no agent asked for. */
57
+ handOffDepth?: number;
37
58
  }
38
59
  interface AgentRunList {
39
60
  items: AgentRun[];
@@ -71,10 +92,22 @@ interface AgentSubjectWorkAgent {
71
92
  thread: AgentThread | null;
72
93
  canStart: boolean;
73
94
  }
74
- /** An open proposal on a subject with the caller's live decision right. */
95
+ /**
96
+ * A proposal on a subject with the caller's live decision right. Only a pending proposal can be
97
+ * decided; for every other status `canDecide` is `false` and `reasonCode` is `null`.
98
+ */
75
99
  interface AgentSubjectWorkProposal extends AgentProposalDecisionRight {
76
100
  proposal: AgentProposal;
77
101
  }
102
+ /** The most proposals one `POST approvals/lookup` reads. */
103
+ declare const NH_ASSISTANT_MAX_PROPOSAL_LOOKUP = 100;
104
+ /**
105
+ * Response of `POST approvals/lookup`: the requested proposals the caller may see, in the order of
106
+ * the request. Ids the caller may not see, or that do not exist, are left out.
107
+ */
108
+ interface AgentProposalLookup {
109
+ items: AgentSubjectWorkProposal[];
110
+ }
78
111
  /**
79
112
  * All agent work on one subject as the caller may see it (`GET subjects/{type}/{id}/work`): every
80
113
  * agent with a thread on the subject plus the requested agent, and the pending proposals of all
@@ -166,6 +199,43 @@ interface AgentProposal {
166
199
  * closed as stale, and the caller decided it or is an approver of the subject. Missing on older servers.
167
200
  */
168
201
  canGiveFeedback?: boolean;
202
+ /**
203
+ * Why a stale proposal no longer fits; `null` for other statuses. Its reason code is
204
+ * `executionResultCode`. Missing on older servers.
205
+ */
206
+ staleKind?: StaleKind | null;
207
+ /**
208
+ * The application's explanation of a stale proposal in the caller's language, such as who already
209
+ * did the work; `null` when it gave none. Missing on older servers.
210
+ */
211
+ staleExplanation?: string | null;
212
+ /**
213
+ * Who made the proposal stale, when the application's guard named them; `null` otherwise.
214
+ * Missing on older servers.
215
+ */
216
+ staleByActorId?: string | null;
217
+ /** The name of `staleByActorId` from the subject's member snapshot; `null` when unknown. */
218
+ staleByDisplayName?: string | null;
219
+ /**
220
+ * The application objects the proposal changes, as its guards named them, so lists can group
221
+ * proposals by object. `targets` holds execution scopes instead. Missing on older servers.
222
+ */
223
+ objects?: AgentProposalObject[];
224
+ /**
225
+ * The newer proposal for the same objects that replaced this withdrawn one; `null` otherwise.
226
+ * Missing on older servers.
227
+ */
228
+ supersededByApprovalId?: string | null;
229
+ /**
230
+ * Why the agent's rules proposed it, in the caller's language; `null` for proposals of the model.
231
+ * Missing on older servers.
232
+ */
233
+ rationale?: string | null;
234
+ }
235
+ /** An application object a proposal changes, such as `{ type: 'project-task', id: '4711' }`. */
236
+ interface AgentProposalObject {
237
+ type: string;
238
+ id: string;
169
239
  }
170
240
  /**
171
241
  * Why a person rejected a proposal. `incorrect`, `wrong-value` and `not-needed` say the agent was
@@ -384,11 +454,17 @@ interface Message {
384
454
  sequence?: number;
385
455
  /** The writer of a user message. */
386
456
  authorActorId?: string | null;
387
- /** Who wrote a user message: a person or a trigger of an agent; missing on old servers. */
457
+ /**
458
+ * Who wrote the message: a person or a trigger of an agent for user messages, `rule` for the
459
+ * summary an agent's rules wrote instead of the model; missing on old servers.
460
+ */
388
461
  authorKind?: MessageAuthorKind | null;
389
462
  }
390
- /** `person` for a message a person wrote; `trigger` for one a trigger wrote into an agent thread. */
391
- type MessageAuthorKind = 'person' | 'trigger';
463
+ /**
464
+ * `person` for a message a person wrote; `trigger` for one a trigger wrote into an agent thread;
465
+ * `rule` for an assistant message the agent's rules wrote without a model.
466
+ */
467
+ type MessageAuthorKind = 'person' | 'trigger' | 'rule';
392
468
  type MessagePart = TextPart | ToolCallPart | ApprovalPart;
393
469
  interface TextPart {
394
470
  type: 'text';
@@ -411,9 +487,12 @@ interface ToolCallPart {
411
487
  argumentsPreview: string | null;
412
488
  resultPreview: string | null;
413
489
  resultCode: string | null;
414
- /** `delegated` or `agent` when an agent used rights beyond the caller's own. */
415
- grantSource?: 'delegated' | 'agent' | null;
416
- /** The result came from the agent's own grant and is shielded from this viewer. */
490
+ /**
491
+ * `delegated`, `agent` or `delegated-read` when an agent used rights beyond the caller's own:
492
+ * the initiator's, its own grant, or a person's through a gateway read.
493
+ */
494
+ grantSource?: 'delegated' | 'agent' | 'delegated-read' | null;
495
+ /** The result came from rights this viewer does not have and is shielded from them. */
417
496
  restricted?: boolean;
418
497
  }
419
498
  /**
@@ -432,6 +511,11 @@ interface ApprovalPresentation {
432
511
  fields: ApprovalPresentationField[];
433
512
  notice: string | null;
434
513
  }
514
+ /**
515
+ * Why a stale proposal no longer fits: the work was already done another way, what it was based on
516
+ * changed, or it no longer applies.
517
+ */
518
+ type StaleKind = 'already-done' | 'changed' | 'not-applicable';
435
519
  interface ApprovalPart {
436
520
  type: 'approval';
437
521
  approvalId: string;
@@ -445,6 +529,14 @@ interface ApprovalPart {
445
529
  targets: string[];
446
530
  expiresAt: string;
447
531
  status: ApprovalStatus;
532
+ /** Why a stale proposal no longer fits. Only sent for stale proposals; missing on older servers. */
533
+ staleKind?: StaleKind;
534
+ /** The application's explanation of a stale proposal in the reader's language, such as who did the work. */
535
+ staleExplanation?: string;
536
+ /** Why the agent's rules proposed it, in the reader's language. Only sent for rule proposals. */
537
+ rationale?: string;
538
+ /** The newer proposal for the same objects that replaced this withdrawn one. Only sent then. */
539
+ supersededByApprovalId?: string;
448
540
  }
449
541
  /** Response of `GET conversations?page=&itemsPerPage=`. */
450
542
  interface ConversationPage {
@@ -694,18 +786,81 @@ interface AdminAgentInput {
694
786
  mcpServerIds: string[];
695
787
  requiredPolicy: string | null;
696
788
  autonomy: AssistantAutonomy;
697
- isEnabled: boolean;
789
+ /**
790
+ * @deprecated Accepted and ignored by the server until the next major version: pause, stop and
791
+ * resume an agent with `setAgentState`. A new agent starts active.
792
+ */
793
+ isEnabled?: boolean;
698
794
  }
699
795
  /** Body of `PUT admin/agents/{id}`. */
700
796
  type UpdateAdminAgentRequest = AdminAgentInput & {
701
797
  expectedVersion: number;
702
798
  };
799
+ /**
800
+ * The run state of an agent. `paused`: no new runs; events wait and run after the resume.
801
+ * `stopped`: active runs were cancelled and events are refused. `configured-off`: disabled in the
802
+ * application's code until the next deployment; it cannot be resumed here.
803
+ */
804
+ type AgentRunState = 'active' | 'paused' | 'stopped' | 'configured-off';
703
805
  interface AdminAgent extends AdminAgentInput {
806
+ /** `false` while the agent is stopped; read `runState` for the full state. */
807
+ isEnabled: boolean;
704
808
  version: number;
705
809
  source: 'code' | 'admin';
706
810
  isOverridden: boolean;
707
811
  instructionsHash: string;
708
812
  updatedAt: string;
813
+ runState: AgentRunState;
814
+ stateChangedAt: string | null;
815
+ stateChangedBy: string | null;
816
+ stateReason: string | null;
817
+ /** Events that wait while the agent is paused. */
818
+ waitingInputs: number;
819
+ /** The agent's skills with their states and today's usage; missing or empty without skills. */
820
+ skills?: AgentSkillState[];
821
+ /** The live agent this agent is a shadow variant of; missing or null for an agent that is no variant. */
822
+ shadowOf?: string | null;
823
+ }
824
+ /** One skill of an agent with its own state and today's usage across scopes. */
825
+ interface AgentSkillState {
826
+ skillId: string;
827
+ description: string;
828
+ runState: 'active' | 'paused' | 'stopped';
829
+ changedAt: string | null;
830
+ changedBy: string | null;
831
+ reason: string | null;
832
+ /** Events that wait for the skill while it is paused. */
833
+ waitingInputs: number;
834
+ toolCallsToday: number;
835
+ tokensToday: number;
836
+ /** The skill's daily budget per scope, when it has one. */
837
+ dailyToolCalls: number | null;
838
+ dailyTokens: number | null;
839
+ cancelledRuns: number;
840
+ startedRuns: number;
841
+ }
842
+ /** Response of `GET` and `POST admin/agents/{id}/state`. */
843
+ interface AgentState {
844
+ agentId: string;
845
+ runState: AgentRunState;
846
+ /** Whether the agent works now: active, enabled in code and the assistant enabled. */
847
+ active: boolean;
848
+ changedAt: string | null;
849
+ changedBy: string | null;
850
+ reason: string | null;
851
+ waitingInputs: number;
852
+ /** The runs this change cancelled by stopping the agent. */
853
+ cancelledRuns: number;
854
+ /** The runs this change started for waiting events by resuming the agent. */
855
+ startedRuns: number;
856
+ skills?: AgentSkillState[];
857
+ shadowOf?: string | null;
858
+ }
859
+ /** Body of `POST admin/agents/{id}/state`. `active` resumes the agent. */
860
+ interface SetAgentStateRequest {
861
+ state: 'active' | 'paused' | 'stopped';
862
+ /** Optional, at most 500 characters. */
863
+ reason?: string | null;
709
864
  }
710
865
  type McpAuthMode = 'none' | 'bearer' | 'api-key' | 'forward-user-token';
711
866
  interface McpServerInput {
@@ -778,6 +933,126 @@ interface AgentFeedbackListFilter extends AgentFeedbackFilter {
778
933
  itemsPerPage?: number;
779
934
  }
780
935
  /** Filter of `GET admin/agents/{id}/feedback/export`. */
936
+ /** Query of `GET admin/agents/{id}/evaluation` and its export. */
937
+ interface AgentEvaluationFilter {
938
+ /** The shadow variant to compare with the agent. */
939
+ variant: string;
940
+ /** Start of the period as an ISO 8601 date-time; seven days before `to` by default. */
941
+ from?: string;
942
+ /** End of the period, exclusive; now by default. The period spans at most 92 days. */
943
+ to?: string;
944
+ }
945
+ /**
946
+ * Response of `GET admin/agents/{id}/evaluation`: how a shadow variant compared with its live
947
+ * agent. Counts, identifiers and links only; no messages or arguments.
948
+ */
949
+ interface AgentEvaluation {
950
+ agentId: string;
951
+ variantId: string;
952
+ from: string;
953
+ to: string;
954
+ runs: AgentEvaluationRuns;
955
+ tools: AgentEvaluationTool[];
956
+ liveCost: AgentEvaluationCost;
957
+ variantCost: AgentEvaluationCost;
958
+ routing: AgentEvaluationRouting[];
959
+ /** Proposals only one of the two made, with the runs and threads to read; at most 50. */
960
+ differences: AgentEvaluationDifference[];
961
+ }
962
+ interface AgentEvaluationRuns {
963
+ live: number;
964
+ variant: number;
965
+ /** Pairs of runs that handled the same event or that a replay repeated. */
966
+ paired: number;
967
+ /** Pairs whose variant run replayed the live run; it saw today's state of the subject. */
968
+ replayed: number;
969
+ liveUnpaired: number;
970
+ variantUnpaired: number;
971
+ /** The period held more runs than one evaluation reads; it covers the oldest. */
972
+ truncated: boolean;
973
+ }
974
+ interface AgentEvaluationTool {
975
+ toolId: string;
976
+ agreed: number;
977
+ liveOnly: number;
978
+ variantOnly: number;
979
+ liveDecisions: AgentEvaluationDecisions;
980
+ /** Live proposals people rejected that the variant did not make. */
981
+ rejectedLiveNotProposed: number;
982
+ /** Live proposals people rejected that the variant made too. */
983
+ rejectedLiveAlsoProposed: number;
984
+ /** Live proposals people approved that the variant did not make. */
985
+ approvedLiveMissed: number;
986
+ }
987
+ interface AgentEvaluationDecisions {
988
+ pending: number;
989
+ approved: number;
990
+ /** Executed, including failed and uncertain executions. */
991
+ executed: number;
992
+ rejected: number;
993
+ stale: number;
994
+ /** Expired and withdrawn proposals. */
995
+ other: number;
996
+ /** Feedback categories of rejected proposals and how often people chose them. */
997
+ rejectionCategories: Record<string, number>;
998
+ }
999
+ interface AgentEvaluationCost {
1000
+ runs: number;
1001
+ modelCalls: number;
1002
+ tokens: number;
1003
+ toolCalls: number;
1004
+ averageModelCalls: number;
1005
+ averageTokens: number;
1006
+ averageToolCalls: number;
1007
+ p95ModelCalls: number;
1008
+ p95Tokens: number;
1009
+ p95ToolCalls: number;
1010
+ }
1011
+ interface AgentEvaluationRouting {
1012
+ /** `null` is the agent's own tools. */
1013
+ liveSkill: string | null;
1014
+ variantSkill: string | null;
1015
+ runs: number;
1016
+ }
1017
+ interface AgentEvaluationDifference {
1018
+ toolId: string;
1019
+ kind: 'live-only' | 'variant-only';
1020
+ /** What people decided about a live-only proposal. */
1021
+ liveStatus: string | null;
1022
+ liveRunId: string;
1023
+ liveConversationId: string;
1024
+ variantRunId: string;
1025
+ variantConversationId: string;
1026
+ replayed: boolean;
1027
+ }
1028
+ /** Body of `POST admin/agents/{id}/replay`. */
1029
+ interface AgentReplayRequest {
1030
+ /** The agent whose runs to replay; the variant's live agent by default. */
1031
+ sourceAgentId?: string | null;
1032
+ from?: string | null;
1033
+ to?: string | null;
1034
+ /** 1 to 500; 100 by default. */
1035
+ maxRuns?: number | null;
1036
+ }
1037
+ /** A replay of recorded runs into a shadow variant. */
1038
+ interface AgentReplay {
1039
+ id: string;
1040
+ variantAgentId: string;
1041
+ sourceAgentId: string;
1042
+ from: string;
1043
+ to: string;
1044
+ maxRuns: number;
1045
+ status: 'running' | 'completed' | 'stopped';
1046
+ /** Why a stopped replay stopped, such as `assistant-budget-exhausted`. */
1047
+ stopReason: string | null;
1048
+ runsReplayed: number;
1049
+ runsSkipped: number;
1050
+ createdAt: string;
1051
+ endedAt: string | null;
1052
+ }
1053
+ interface AgentReplayList {
1054
+ items: AgentReplay[];
1055
+ }
781
1056
  interface AgentFeedbackExportFilter extends AgentFeedbackFilter {
782
1057
  category?: AgentProposalFeedbackCategory;
783
1058
  /** Maximum number of records; the server defaults to 10,000 and allows at most 50,000. */
@@ -799,7 +1074,7 @@ interface AgentFeedbackSummaryRow {
799
1074
  rejected: number;
800
1075
  expired: number;
801
1076
  withdrawn: number;
802
- /** Approved proposals closed because the subject changed; part of `approved`. */
1077
+ /** Approved proposals closed right before execution because they no longer fit; part of `approved`. */
803
1078
  stale: number;
804
1079
  /** Approved proposals whose execution failed; part of `approved`. */
805
1080
  executionFailed: number;
@@ -812,6 +1087,22 @@ interface AgentFeedbackSummaryRow {
812
1087
  /** Different people who gave feedback, so one critical approver counts as one. */
813
1088
  feedbackAuthors: number;
814
1089
  categories: AgentFeedbackCategoryCount[];
1090
+ /**
1091
+ * Open proposals closed before anyone decided because they no longer fit, such as work a person
1092
+ * already did. Neither approved nor rejected, and not part of `rejectionRate`. Missing on older servers.
1093
+ */
1094
+ invalidated?: number;
1095
+ /** Why proposals closed as stale, per kind and reason code. Missing on older servers. */
1096
+ invalidations?: AgentInvalidationCount[];
1097
+ }
1098
+ /** Proposals of one tool and agent version that closed as stale for one kind and reason. */
1099
+ interface AgentInvalidationCount {
1100
+ kind: StaleKind;
1101
+ /** The application guard's reason code. */
1102
+ reasonCode: string;
1103
+ /** True when the proposal closed right before execution, after its approval. */
1104
+ afterApproval: boolean;
1105
+ count: number;
815
1106
  }
816
1107
  /** Response of `GET admin/agents/{id}/feedback/summary`. */
817
1108
  interface AgentFeedbackSummary {
@@ -1106,9 +1397,19 @@ declare class NhAssistantAdminApiService {
1106
1397
  getAgents(): Observable<AdminAgent[]>;
1107
1398
  createAgent(input: AdminAgentInput): Observable<AdminAgent>;
1108
1399
  updateAgent(agentId: string, request: UpdateAdminAgentRequest): Observable<AdminAgent>;
1109
- /** Restores a code agent to its definition in code. */
1400
+ /** Restores a code agent to its definition in code. The run state stays as it is. */
1110
1401
  resetAgent(agentId: string): Observable<AdminAgent>;
1111
- /** Deletes an admin agent. Code agents cannot be deleted; disable them instead. */
1402
+ getAgentState(agentId: string): Observable<AgentState>;
1403
+ /**
1404
+ * Pauses, stops or resumes an agent without changing its definition. A code-disabled agent
1405
+ * cannot be resumed (`assistant-agent-configured-off`).
1406
+ */
1407
+ setAgentState(agentId: string, request: SetAgentStateRequest): Observable<AgentState>;
1408
+ /**
1409
+ * Pauses, stops or resumes one skill of an agent; its other skills keep working.
1410
+ */
1411
+ setSkillState(agentId: string, skillId: string, request: SetAgentStateRequest): Observable<AgentSkillState>;
1412
+ /** Deletes an admin agent. Code agents cannot be deleted; stop them instead. */
1112
1413
  deleteAgent(agentId: string): Observable<void>;
1113
1414
  getMcpServers(): Observable<McpServer[]>;
1114
1415
  createMcpServer(input: McpServerInput): Observable<McpServer>;
@@ -1132,6 +1433,24 @@ declare class NhAssistantAdminApiService {
1132
1433
  * subject data and the server audits the export. Rejects with `NhAssistantApiError`.
1133
1434
  */
1134
1435
  exportAgentFeedback(agentId: string, filter?: AgentFeedbackExportFilter): Promise<Blob>;
1436
+ /**
1437
+ * Compares a shadow variant with its live agent over a period: the runs that handled the same
1438
+ * events, the proposals per tool with what people decided about the live ones, cost and routing.
1439
+ */
1440
+ getAgentEvaluation(agentId: string, filter: AgentEvaluationFilter): Observable<AgentEvaluation>;
1441
+ /**
1442
+ * Downloads the paired runs of the comparison as JSON Lines: identifiers, statuses, usage and
1443
+ * proposal identities, no content. The server audits the export. Rejects with `NhAssistantApiError`.
1444
+ */
1445
+ exportAgentEvaluation(agentId: string, filter: AgentEvaluationFilter): Promise<Blob>;
1446
+ /**
1447
+ * Replays the recorded runs of another agent in a period into a shadow variant, against today's
1448
+ * state of each subject. One replay runs per variant (`assistant-replay-active`).
1449
+ */
1450
+ startAgentReplay(variantId: string, request: AgentReplayRequest): Observable<AgentReplay>;
1451
+ /** The latest replays into a shadow variant, newest first. */
1452
+ getAgentReplays(variantId: string): Observable<AgentReplayList>;
1453
+ private download;
1135
1454
  private request;
1136
1455
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAdminApiService, never>;
1137
1456
  static ɵprov: _angular_core.ɵɵInjectableDeclaration<NhAssistantAdminApiService>;
@@ -1170,6 +1489,17 @@ declare class NhAssistantAgentRunApiService {
1170
1489
  /** Who consulted the thread's agent through another assistant, newest first. */
1171
1490
  getConsultations(conversationId: string, page?: number, itemsPerPage?: number): Observable<AgentConsultationList>;
1172
1491
  getProposals(conversationId: string): Observable<AgentProposal[]>;
1492
+ /**
1493
+ * One proposal of an agent thread in any status, with the caller's live right to decide it, for
1494
+ * example the one an `AgentWorkChanged` update names. Fails with `assistant-approval-not-found`
1495
+ * for an unknown proposal and for one the caller may not see.
1496
+ */
1497
+ getProposal(approvalId: string): Observable<AgentSubjectWorkProposal>;
1498
+ /**
1499
+ * The proposals among at most `NH_ASSISTANT_MAX_PROPOSAL_LOOKUP` ids that the caller may see, in
1500
+ * the order of the ids, each with the caller's live right to decide it. The others are left out.
1501
+ */
1502
+ lookupProposals(approvalIds: readonly string[]): Observable<AgentProposalLookup>;
1173
1503
  getMemory(conversationId: string): Observable<AgentThreadMemory>;
1174
1504
  getArtifacts(conversationId: string): Observable<AgentArtifact[]>;
1175
1505
  /** Downloads one artifact version with the host's credentials. */
@@ -1891,6 +2221,8 @@ declare class NhAssistantThreadComponent {
1891
2221
  trackMessage(_index: number, message: Message): string;
1892
2222
  /** True for a user message a trigger wrote into an agent thread. */
1893
2223
  isTrigger(message: Message): boolean;
2224
+ /** True for an assistant message the agent's rules wrote without a model. */
2225
+ isRule(message: Message): boolean;
1894
2226
  /** True for a user message written by another person in a shared conversation. */
1895
2227
  isOthers(message: Message): boolean;
1896
2228
  /** Whether and why the current user may decide an approval card. */
@@ -2093,7 +2425,8 @@ declare function formatNhAssistantCountdown(milliseconds: number): string;
2093
2425
  * Asks the user to approve or reject a proposed mutation. Shows the summary, targets,
2094
2426
  * proposed arguments and a countdown to expiry. A decision is emitted at most once until
2095
2427
  * the host reports that it is no longer deciding. After the user rejected an agent's proposal
2096
- * (`canGiveFeedback`), a low-key action asks what was wrong.
2428
+ * (`canGiveFeedback`), a low-key action asks what was wrong. A proposal that closed because it no
2429
+ * longer fits shows why, such as "Already done", with the application's explanation.
2097
2430
  */
2098
2431
  declare class NhAssistantApprovalCardComponent {
2099
2432
  readonly approval: _angular_core.InputSignal<ApprovalPart>;
@@ -2128,6 +2461,15 @@ declare class NhAssistantApprovalCardComponent {
2128
2461
  readonly remainingMs: _angular_core.Signal<number>;
2129
2462
  readonly expired: _angular_core.Signal<boolean>;
2130
2463
  readonly effectiveStatus: _angular_core.Signal<ApprovalStatus>;
2464
+ /**
2465
+ * Translation key of the status: the kind of a stale proposal, "replaced" for a superseded one,
2466
+ * otherwise the status itself.
2467
+ */
2468
+ readonly statusKey: _angular_core.Signal<string>;
2469
+ /** Why the agent's rules proposed it; model proposals have none. */
2470
+ readonly rationale: _angular_core.Signal<string | null>;
2471
+ /** The application's explanation of a stale proposal, such as who already did the work. */
2472
+ readonly staleExplanation: _angular_core.Signal<string | null>;
2131
2473
  readonly actionable: _angular_core.Signal<boolean>;
2132
2474
  readonly succeeded: _angular_core.Signal<boolean>;
2133
2475
  readonly disabled: _angular_core.Signal<boolean>;
@@ -2390,5 +2732,5 @@ declare function nhAssistantErrorKeys(error: NhAssistantError | null): string[];
2390
2732
  /** Dash-case identifiers as the contract requires for agent and MCP server ids. */
2391
2733
  declare const NH_ASSISTANT_DASH_CASE: RegExp;
2392
2734
 
2393
- export { NH_ASSISTANT_ACCESS_POLICY, NH_ASSISTANT_CONFIG, NH_ASSISTANT_CONVERSATION_FRAGMENT, NH_ASSISTANT_FEEDBACK_CATEGORIES, NH_ASSISTANT_FEEDBACK_GROUPS, NH_ASSISTANT_FETCH, NH_ASSISTANT_ICONS, NH_ASSISTANT_JOIN_FRAGMENT, NH_ASSISTANT_MAX_BULK_FEEDBACK, NH_ASSISTANT_MAX_CUSTOM_INSTRUCTIONS, NH_ASSISTANT_MAX_FEEDBACK_TEXT, NH_ASSISTANT_MAX_SUBJECT_SUMMARY, 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, NhAssistantActivityComponent, NhAssistantAdminApiService, NhAssistantAgentPickerComponent, NhAssistantAgentRunApiService, NhAssistantAllowAllAccessPolicy, NhAssistantApiError, NhAssistantApiService, NhAssistantApprovalCardComponent, NhAssistantClientErrorCodes, NhAssistantComposerComponent, NhAssistantConversationListComponent, NhAssistantLauncherComponent, NhAssistantLiveService, NhAssistantPanelComponent, NhAssistantPanelService, NhAssistantPreferencesComponent, NhAssistantProposalFeedbackComponent, NhAssistantPushService, NhAssistantShareComponent, NhAssistantSseParser, NhAssistantStore, NhAssistantSubjectBadgeComponent, NhAssistantSubjectSummaryService, NhAssistantThreadComponent, NhAssistantToolCallCardComponent, NhAssistantToolCallGroupComponent, NhAssistantTranslationMerger, applyNhAssistantApprovalDecision, applyNhAssistantConversationChange, applyNhAssistantEvent, applyNhAssistantLiveEvent, describeNhAssistantClientContext, formatNhAssistantCountdown, nhAssistantCodeForStatus, nhAssistantErrorMessageKey, nhAssistantIsUnread, nhAssistantLatestTurnHasText, nhAssistantShareLink, normalizeNhAssistantClientContext, provideNhAssistant, NH_ASSISTANT_DASH_CASE as ɵNH_ASSISTANT_DASH_CASE, NhAssistantIconComponent as ɵNhAssistantIconComponent, NhAssistantTranslatePipe as ɵNhAssistantTranslatePipe, nhAssistantErrorKeys as ɵnhAssistantErrorKeys, nhAssistantReloadOnAgentWork as ɵnhAssistantReloadOnAgentWork, toNhAssistantError as ɵtoNhAssistantError };
2394
- export type { AdminAgent, AdminAgentInput, AgentArtifact, AgentConsultation, AgentConsultationList, AgentConsultationStatus, AgentDecisionOutcome, AgentExecutionResolution, AgentFeedbackCategoryCount, AgentFeedbackExportFilter, AgentFeedbackFilter, AgentFeedbackItem, AgentFeedbackList, AgentFeedbackListFilter, AgentFeedbackOutcome, AgentFeedbackSummary, AgentFeedbackSummaryRow, AgentGrantSource, AgentInbox, AgentInboxFilter, AgentProposal, AgentProposalDecision, AgentProposalDecisionRight, AgentProposalFeedback, AgentProposalFeedbackCategory, AgentProposalFeedbackGroup, AgentProposalStatus, AgentRun, AgentRunList, AgentRunRetryMode, AgentRunStatus, AgentSubjectRole, AgentSubjectSummary, AgentSubjectSummaryList, AgentSubjectWork, AgentSubjectWorkAgent, AgentSubjectWorkProposal, AgentSummary, AgentThread, AgentThreadLookup, AgentThreadMemory, AgentTriggerReceipt, ApplicationContext, ApplicationContextVersion, ApprovalDecision, ApprovalPart, ApprovalPresentation, ApprovalPresentationField, ApprovalRequiredEvent, ApprovalStatus, AssistantAddressForm, AssistantAutonomy, AssistantCollaboration, AssistantErrorEvent, AssistantPreferences, AssistantResponseLength, AssistantStatus, AssistantStyle, ClientContext, ClientContextEntity, Conversation, ConversationKind, ConversationMember, ConversationPage, ConversationRole, ConversationStatus, ConversationSummary, ConversationThread, ConversationThreadDecision, CreateConversationRequest, DecideApprovalRequest, DirectoryEntry, LiveAgentWorkChanged, LiveAgentWorkReason, LiveConversationChanged, LiveConversationEvent, LiveConversationRead, LiveConversationRemoved, McpAuthMode, McpServer, McpServerInput, McpServerTestResult, McpTool, McpToolEffect, McpToolStatus, Message, MessageAuthorKind, MessageDeltaEvent, MessagePart, NhAssistantAccessPolicy, NhAssistantActivity, NhAssistantApprovalChoice, NhAssistantApprovalRight, NhAssistantApprovalWaitingFor, NhAssistantClientContext, NhAssistantClientErrorCode, NhAssistantConfig, NhAssistantError, NhAssistantFetch, NhAssistantIconName, NhAssistantLiveState, NhAssistantNotice, NhAssistantProposalFeedbackSaved, NhAssistantPushConfig, NhAssistantPushState, NhAssistantQueuedMessage, NhAssistantRawSseMessage, NhAssistantSseEvent, NhAssistantSseEventMap, NhAssistantSseEventType, NhAssistantStatusCodes, NhAssistantToolCallGroupState, NotificationSettings, PushSubscriptionRequest, SendMessageRequest, ShareLink, StartAgentRequest, TextPart, ToolCallPart, ToolCallStatus, ToolCatalogEffect, ToolCatalogEntry, ToolCompletedEvent, ToolStartedEvent, TurnCompletedEvent, TurnCompletionStatus, TurnStartedEvent, TurnUsage, UpdateAdminAgentRequest, UpdateApplicationContextRequest, UpdateMcpToolRequest };
2735
+ export { NH_ASSISTANT_ACCESS_POLICY, NH_ASSISTANT_CONFIG, NH_ASSISTANT_CONVERSATION_FRAGMENT, NH_ASSISTANT_FEEDBACK_CATEGORIES, NH_ASSISTANT_FEEDBACK_GROUPS, NH_ASSISTANT_FETCH, NH_ASSISTANT_ICONS, NH_ASSISTANT_JOIN_FRAGMENT, NH_ASSISTANT_MAX_BULK_FEEDBACK, NH_ASSISTANT_MAX_CUSTOM_INSTRUCTIONS, NH_ASSISTANT_MAX_FEEDBACK_TEXT, NH_ASSISTANT_MAX_PROPOSAL_LOOKUP, NH_ASSISTANT_MAX_SUBJECT_SUMMARY, 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, NhAssistantActivityComponent, NhAssistantAdminApiService, NhAssistantAgentPickerComponent, NhAssistantAgentRunApiService, NhAssistantAllowAllAccessPolicy, NhAssistantApiError, NhAssistantApiService, NhAssistantApprovalCardComponent, NhAssistantClientErrorCodes, NhAssistantComposerComponent, NhAssistantConversationListComponent, NhAssistantLauncherComponent, NhAssistantLiveService, NhAssistantPanelComponent, NhAssistantPanelService, NhAssistantPreferencesComponent, NhAssistantProposalFeedbackComponent, NhAssistantPushService, NhAssistantShareComponent, NhAssistantSseParser, NhAssistantStore, NhAssistantSubjectBadgeComponent, NhAssistantSubjectSummaryService, NhAssistantThreadComponent, NhAssistantToolCallCardComponent, NhAssistantToolCallGroupComponent, NhAssistantTranslationMerger, applyNhAssistantApprovalDecision, applyNhAssistantConversationChange, applyNhAssistantEvent, applyNhAssistantLiveEvent, describeNhAssistantClientContext, formatNhAssistantCountdown, nhAssistantCodeForStatus, nhAssistantErrorMessageKey, nhAssistantIsUnread, nhAssistantLatestTurnHasText, nhAssistantShareLink, normalizeNhAssistantClientContext, provideNhAssistant, NH_ASSISTANT_DASH_CASE as ɵNH_ASSISTANT_DASH_CASE, NhAssistantIconComponent as ɵNhAssistantIconComponent, NhAssistantTranslatePipe as ɵNhAssistantTranslatePipe, nhAssistantErrorKeys as ɵnhAssistantErrorKeys, nhAssistantReloadOnAgentWork as ɵnhAssistantReloadOnAgentWork, toNhAssistantError as ɵtoNhAssistantError };
2736
+ export type { AdminAgent, AdminAgentInput, AgentArtifact, AgentConsultation, AgentConsultationList, AgentConsultationStatus, AgentDecisionOutcome, AgentEvaluation, AgentEvaluationCost, AgentEvaluationDecisions, AgentEvaluationDifference, AgentEvaluationFilter, AgentEvaluationRouting, AgentEvaluationRuns, AgentEvaluationTool, AgentExecutionResolution, AgentFeedbackCategoryCount, AgentFeedbackExportFilter, AgentFeedbackFilter, AgentFeedbackItem, AgentFeedbackList, AgentFeedbackListFilter, AgentFeedbackOutcome, AgentFeedbackSummary, AgentFeedbackSummaryRow, AgentGrantSource, AgentInbox, AgentInboxFilter, AgentInvalidationCount, AgentProposal, AgentProposalDecision, AgentProposalDecisionRight, AgentProposalFeedback, AgentProposalFeedbackCategory, AgentProposalFeedbackGroup, AgentProposalLookup, AgentProposalObject, AgentProposalStatus, AgentReplay, AgentReplayList, AgentReplayRequest, AgentRun, AgentRunKind, AgentRunList, AgentRunRetryMode, AgentRunState, AgentRunStatus, AgentSkillChooser, AgentSkillState, AgentState, AgentSubjectRole, AgentSubjectSummary, AgentSubjectSummaryList, AgentSubjectWork, AgentSubjectWorkAgent, AgentSubjectWorkProposal, AgentSummary, AgentThread, AgentThreadLookup, AgentThreadMemory, AgentTriggerReceipt, ApplicationContext, ApplicationContextVersion, ApprovalDecision, ApprovalPart, ApprovalPresentation, ApprovalPresentationField, ApprovalRequiredEvent, ApprovalStatus, AssistantAddressForm, AssistantAutonomy, AssistantCollaboration, AssistantErrorEvent, AssistantPreferences, AssistantResponseLength, AssistantStatus, AssistantStyle, ClientContext, ClientContextEntity, Conversation, ConversationKind, ConversationMember, ConversationPage, ConversationRole, ConversationStatus, ConversationSummary, ConversationThread, ConversationThreadDecision, CreateConversationRequest, DecideApprovalRequest, DirectoryEntry, LiveAgentWorkChanged, LiveAgentWorkReason, LiveConversationChanged, LiveConversationEvent, LiveConversationRead, LiveConversationRemoved, McpAuthMode, McpServer, McpServerInput, McpServerTestResult, McpTool, McpToolEffect, McpToolStatus, Message, MessageAuthorKind, MessageDeltaEvent, MessagePart, NhAssistantAccessPolicy, NhAssistantActivity, NhAssistantApprovalChoice, NhAssistantApprovalRight, NhAssistantApprovalWaitingFor, NhAssistantClientContext, NhAssistantClientErrorCode, NhAssistantConfig, NhAssistantError, NhAssistantFetch, NhAssistantIconName, NhAssistantLiveState, NhAssistantNotice, NhAssistantProposalFeedbackSaved, NhAssistantPushConfig, NhAssistantPushState, NhAssistantQueuedMessage, NhAssistantRawSseMessage, NhAssistantSseEvent, NhAssistantSseEventMap, NhAssistantSseEventType, NhAssistantStatusCodes, NhAssistantToolCallGroupState, NotificationSettings, PushSubscriptionRequest, SendMessageRequest, SetAgentStateRequest, ShareLink, StaleKind, StartAgentRequest, 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.9.0",
3
+ "version": "0.11.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^20.2.14",
6
6
  "@angular/common": "^20.3.28",
@@ -95,6 +95,13 @@ interface NhAssistantMockMcpServer extends McpServerInput {
95
95
  /** A preconfigured agent. Code agents default to the scenario's chat agents. */
96
96
  interface NhAssistantMockAdminAgent extends AdminAgentInput {
97
97
  source: 'code' | 'admin';
98
+ /** The skills of a code agent, by id and description; they start active. */
99
+ skills?: {
100
+ skillId: string;
101
+ description: string;
102
+ }[];
103
+ /** The live agent this code agent is a shadow variant of. */
104
+ shadowOf?: string;
98
105
  }
99
106
  /**
100
107
  * Administration data of the mock. Hosts without an admin scenario still get working