@newheap/platform-ai-chat 0.17.0 → 0.19.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.
@@ -1,6 +1,6 @@
1
1
  import * as _angular_core from '@angular/core';
2
2
  import * as _newheap_platform_ai_chat from '@newheap/platform-ai-chat';
3
- import { AgentProposal, AgentInboxGroup, AgentThreadLookup, AgentTriggerReceipt, NhAssistantError, AgentProposalDecisionRight, AgentProposalFeedback, AgentProposalOrigin, AgentProposalDecision, AgentExecutionResolution, AgentSubjectRole, AgentRun, ɵnhAssistantCodeKeys as _nhAssistantCodeKeys, AgentRunRetryMode, AgentThreadMemory, AgentArtifact, AgentConsultation, AgentSubjectWork, AgentSubjectWorkAgent, AgentSubjectType, ɵNhAssistantPickerOption as _NhAssistantPickerOption, NhAssistantAgentRunApiService, AgentObjectAgents, AgentObjectAgent, AgentRunResult, AgentBoard, AgentBoardAgent } from '@newheap/platform-ai-chat';
3
+ import { AgentProposal, AgentInboxGroup, AgentThreadLookup, AgentProposalDecisionRight, AgentTriggerReceipt, NhAssistantError, AgentProposalFeedback, AgentProposalOrigin, AgentProposalDecision, AgentExecutionResolution, AgentSubjectRole, AgentRun, ɵnhAssistantCodeKeys as _nhAssistantCodeKeys, AgentRunRetryMode, AgentThreadMemory, AgentArtifact, AgentConsultation, NhAssistantConsultationRoute, AgentSubjectWork, AgentSubjectWorkAgent, AgentSubjectType, ɵNhAssistantPickerOption as _NhAssistantPickerOption, NhAssistantAgentRunApiService, AgentObjectAgents, AgentObjectAgent, AgentRunResult, AgentBoard, AgentBoardAgent } from '@newheap/platform-ai-chat';
4
4
  import { Observable } from 'rxjs';
5
5
 
6
6
  /**
@@ -118,6 +118,7 @@ declare class NhAssistantAgentThreadViewComponent {
118
118
  private readonly proposalList;
119
119
  private subscription?;
120
120
  private proposalSubscription?;
121
+ private rightsSubscription?;
121
122
  private startSubscription?;
122
123
  readonly agentId: _angular_core.InputSignal<string>;
123
124
  readonly subjectType: _angular_core.InputSignal<string>;
@@ -132,6 +133,13 @@ declare class NhAssistantAgentThreadViewComponent {
132
133
  readonly loadFailed: _angular_core.WritableSignal<boolean>;
133
134
  readonly lookup: _angular_core.WritableSignal<AgentThreadLookup | null>;
134
135
  readonly proposals: _angular_core.WritableSignal<AgentProposal[]>;
136
+ /**
137
+ * The caller's live right to decide each pending proposal, as the server checks it for the decision:
138
+ * four-eyes keeps the person who asked for a consultation's proposal out, also as an approver, and
139
+ * nobody decides here what the asker decides in their own chat. Without an answer the caller's role
140
+ * decides what is offered; the server checks every decision again.
141
+ */
142
+ readonly rights: _angular_core.WritableSignal<ReadonlyMap<string, AgentProposalDecisionRight> | null>;
135
143
  readonly message: _angular_core.WritableSignal<string>;
136
144
  readonly starting: _angular_core.WritableSignal<boolean>;
137
145
  readonly receipt: _angular_core.WritableSignal<AgentTriggerReceipt | null>;
@@ -159,6 +167,11 @@ declare class NhAssistantAgentThreadViewComponent {
159
167
  private refresh;
160
168
  private fetch;
161
169
  private fetchProposals;
170
+ /**
171
+ * Reads the caller's live right to decide each pending proposal, in batches of
172
+ * `NH_ASSISTANT_MAX_PROPOSAL_LOOKUP`, as the run result and the subject's work do.
173
+ */
174
+ private readRights;
162
175
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAgentThreadViewComponent, never>;
163
176
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentThreadViewComponent, "nh-assistant-agent-thread-view", never, { "agentId": { "alias": "agentId"; "required": true; "isSignal": true; }; "subjectType": { "alias": "subjectType"; "required": true; "isSignal": true; }; "subjectId": { "alias": "subjectId"; "required": true; "isSignal": true; }; }, { "openConversation": "openConversation"; }, never, never, true, never>;
164
177
  }
@@ -228,7 +241,10 @@ interface NhAssistantFeedbackRequest {
228
241
  * application, says so and offers that run's conversation through `openConversation`. With `groups`
229
242
  * from the grouped inbox the list shows a header per group and per subject, optionally per run
230
243
  * (`groupByRun`), and "Select group" selects only the group's pending proposals in this list that
231
- * the caller may decide, never those on another page. `newIds` marks proposals as new.
244
+ * the caller may decide, never those on another page. `newIds` marks proposals as new. A proposal of
245
+ * a consultation names who asked and its route: one the person who asked decides in their own chat
246
+ * (`asker-decides`) waits for them without actions here; one that runs with the agent's own rights
247
+ * (`subject-agent-rights`) says so, and the person who asked reads why another approver decides.
232
248
  */
233
249
  declare class NhAssistantAgentProposalsComponent {
234
250
  private readonly api;
@@ -323,18 +339,38 @@ declare class NhAssistantAgentProposalsComponent {
323
339
  * the shown pending proposals that left the list because they closed as stale or were replaced.
324
340
  */
325
341
  holdClosed(previous: readonly AgentProposal[], next: readonly AgentProposal[]): void;
326
- /** Whether the caller may decide this proposal: its own right when one was given, otherwise `canDecide`. */
342
+ /**
343
+ * Whether the caller may decide this proposal: its own right when one was given, otherwise
344
+ * `canDecide`. Nobody decides a proposal here that the person who asked decides in their own chat.
345
+ */
327
346
  mayDecide(proposal: AgentProposal): boolean;
347
+ /**
348
+ * Whether a pending proposal of a consultation waits for the person who asked, who decides it in
349
+ * their own chat: its route says so, or the server's reason for the caller's right.
350
+ */
351
+ waitsForAsker(proposal: AgentProposal): boolean;
328
352
  /**
329
353
  * Who decides a pending proposal that has a right the caller lacks: another approver when
330
- * four-eyes keeps out the person who started the work, otherwise an approver.
354
+ * four-eyes keeps out the person who started the work, which for a consultation's proposal that
355
+ * runs with the agent's own rights is the person who asked, otherwise an approver. A proposal that
356
+ * waits for the person who asked says so on its own (`waitsForAsker`).
331
357
  */
332
358
  waitingForKey(proposal: AgentProposal): string | null;
359
+ /**
360
+ * The badge of a consultation's proposal that runs with the agent's own rights: those of a technical
361
+ * account when the agent answers to one, otherwise the agent's own; `null` for other proposals.
362
+ */
363
+ agentRightsKey(proposal: AgentProposal): string | null;
333
364
  toggle(proposal: AgentProposal): void;
334
365
  toggleAll(): void;
335
366
  decide(proposal: AgentProposal, decision: AgentProposalDecision): void;
336
367
  decideSelected(decision: AgentProposalDecision): void;
337
368
  resolve(proposal: AgentProposal, action: AgentExecutionResolution): void;
369
+ /**
370
+ * Whether the application executes the proposal: it was handed to the application, so an approver
371
+ * resolves an unknown outcome by handing it to the application again instead of running it.
372
+ */
373
+ executedByApplication(proposal: AgentProposal): boolean;
338
374
  /** Opens the feedback question in the card of a closed proposal, with the caller's own feedback. */
339
375
  giveFeedback(proposal: AgentProposal): void;
340
376
  /** True while the feedback question for this proposal is open, above the list or in its card. */
@@ -455,9 +491,9 @@ declare class NhAssistantAgentArtifactsComponent {
455
491
 
456
492
  /**
457
493
  * Who consulted the thread's agent through another assistant, newest first: the person whose rights
458
- * were used, the asking assistant, the outcome, the usage and the proposals left for approvers. The
459
- * question and the answer stay in the asking conversation and are never shown here. With live
460
- * updates the list reloads by itself when a run or proposal of the thread changes.
494
+ * were used, the asking assistant, the outcome, the usage and the proposals it left, with their
495
+ * number per route. The question and the answer stay in the asking conversation and are never shown
496
+ * here. With live updates the list reloads by itself when a run or proposal of the thread changes.
461
497
  */
462
498
  declare class NhAssistantAgentConsultationsComponent {
463
499
  private readonly api;
@@ -470,6 +506,11 @@ declare class NhAssistantAgentConsultationsComponent {
470
506
  readonly codeKeys: typeof _nhAssistantCodeKeys;
471
507
  constructor();
472
508
  load(): void;
509
+ /** The proposals the consultation left per route, in a fixed order; routes without proposals are left out. */
510
+ routeCounts(consultation: AgentConsultation): {
511
+ route: NhAssistantConsultationRoute;
512
+ count: number;
513
+ }[];
473
514
  /** A quiet load, after a live update, shows no loading state and keeps the list when it fails. */
474
515
  private fetch;
475
516
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAgentConsultationsComponent, never>;