@newheap/platform-ai-chat 0.14.0 → 0.15.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,7 @@
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, AgentThreadLookup, AgentTriggerReceipt, NhAssistantError, AgentProposalDecisionRight, AgentProposalFeedback, AgentProposalDecision, AgentExecutionResolution, AgentSubjectRole, AgentRun, AgentRunRetryMode, AgentThreadMemory, AgentArtifact, AgentConsultation, AgentSubjectWork, AgentSubjectWorkAgent } from '@newheap/platform-ai-chat';
3
+ import { AgentProposal, 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';
4
+ import { Observable } from 'rxjs';
4
5
 
5
6
  /**
6
7
  * The approval inbox: pending agent proposals across subjects that the signed-in person may
@@ -8,9 +9,11 @@ import { AgentProposal, AgentThreadLookup, AgentTriggerReceipt, NhAssistantError
8
9
  * server checks each decision against the proposal's approval policy again. After a rejection the
9
10
  * inbox asks, optionally, what was wrong, also when the rejected proposals have left the list.
10
11
  * With live updates the inbox reloads by itself when agent work changes, for example when a
11
- * colleague decided a proposal or a run proposed a new one. A proposal that closes because it no
12
+ * colleague decided a proposal or a run proposed a new one; it watches the work of agents for the
13
+ * whole application, whose approvers are no members of it, while it is shown. A proposal that closes because it no
12
14
  * longer fits, for example because someone did the work by hand, stays as a closed card with the
13
- * reason until it is dismissed.
15
+ * reason until it is dismissed. A proposal a run placed at its object from another subject, such as a
16
+ * run for the whole application, names that run; `openConversation` emits its conversation.
14
17
  */
15
18
  declare class NhAssistantAgentInboxComponent {
16
19
  private readonly api;
@@ -21,6 +24,11 @@ declare class NhAssistantAgentInboxComponent {
21
24
  /** Limits the inbox to one kind of subject, for example `project`. */
22
25
  readonly subjectType: _angular_core.InputSignal<string | undefined>;
23
26
  readonly itemsPerPage: _angular_core.InputSignal<number>;
27
+ /**
28
+ * Emits the conversation of the run that placed a proposal at its object from another subject, so
29
+ * the host opens it, for example in the assistant panel.
30
+ */
31
+ readonly openConversation: _angular_core.OutputEmitterRef<string>;
24
32
  readonly page: _angular_core.WritableSignal<number>;
25
33
  readonly loading: _angular_core.WritableSignal<boolean>;
26
34
  /** True after the first successful load; later loads keep the list, and an open feedback question, in place. */
@@ -40,7 +48,7 @@ declare class NhAssistantAgentInboxComponent {
40
48
  private refresh;
41
49
  private fetch;
42
50
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAgentInboxComponent, never>;
43
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentInboxComponent, "nh-assistant-agent-inbox", never, { "agentId": { "alias": "agentId"; "required": false; "isSignal": true; }; "subjectType": { "alias": "subjectType"; "required": false; "isSignal": true; }; "itemsPerPage": { "alias": "itemsPerPage"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
51
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentInboxComponent, "nh-assistant-agent-inbox", never, { "agentId": { "alias": "agentId"; "required": false; "isSignal": true; }; "subjectType": { "alias": "subjectType"; "required": false; "isSignal": true; }; "itemsPerPage": { "alias": "itemsPerPage"; "required": false; "isSignal": true; }; }, { "openConversation": "openConversation"; }, never, never, true, never>;
44
52
  }
45
53
 
46
54
  type NhAssistantAgentThreadTab = 'proposals' | 'runs' | 'consultations' | 'memory' | 'artifacts';
@@ -60,7 +68,10 @@ declare class NhAssistantAgentThreadViewComponent {
60
68
  readonly agentId: _angular_core.InputSignal<string>;
61
69
  readonly subjectType: _angular_core.InputSignal<string>;
62
70
  readonly subjectId: _angular_core.InputSignal<string>;
63
- /** Emits the thread's conversation id, so the host can open it in the assistant panel. */
71
+ /**
72
+ * Emits the thread's conversation id, so the host can open it in the assistant panel; also the
73
+ * conversation of a run that placed one of the thread's proposals here from another subject.
74
+ */
64
75
  readonly openConversation: _angular_core.OutputEmitterRef<string>;
65
76
  readonly tab: _angular_core.WritableSignal<NhAssistantAgentThreadTab>;
66
77
  readonly loading: _angular_core.WritableSignal<boolean>;
@@ -120,7 +131,8 @@ interface NhAssistantFeedbackRequest {
120
131
  * With `holdClosedCards`, a list of open proposals keeps such a proposal, or one a newer proposal
121
132
  * replaced, as a closed card when it closes while shown, or when an approval is refused because of
122
133
  * it, until the person dismisses it. It reads those proposals by id with one lookup, never through
123
- * their threads.
134
+ * their threads. A proposal that a run placed here from another subject, such as a run for the whole
135
+ * application, says so and offers that run's conversation through `openConversation`.
124
136
  */
125
137
  declare class NhAssistantAgentProposalsComponent {
126
138
  private readonly api;
@@ -144,6 +156,11 @@ declare class NhAssistantAgentProposalsComponent {
144
156
  readonly holdClosedCards: _angular_core.InputSignal<boolean>;
145
157
  /** Emits after a proposal or its feedback changed, so the host reloads its list. */
146
158
  readonly changed: _angular_core.OutputEmitterRef<void>;
159
+ /**
160
+ * Emits the conversation of the run that placed a proposal here from another subject, so the host
161
+ * opens it, for example in the assistant panel. The server checks the reader's access again.
162
+ */
163
+ readonly openConversation: _angular_core.OutputEmitterRef<string>;
147
164
  readonly busy: _angular_core.WritableSignal<boolean>;
148
165
  readonly selected: _angular_core.WritableSignal<ReadonlySet<string>>;
149
166
  readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
@@ -164,6 +181,14 @@ declare class NhAssistantAgentProposalsComponent {
164
181
  * superseded one, otherwise its status.
165
182
  */
166
183
  statusKey(proposal: AgentProposal): string;
184
+ /**
185
+ * The translation key and parameters that say where a placed proposal came from: the whole
186
+ * application, a division of it, or another object, named only by its kind.
187
+ */
188
+ originText(origin: AgentProposalOrigin): {
189
+ key: string;
190
+ params: Record<string, string>;
191
+ };
167
192
  /** True when the newer proposal that replaced this one is in the list. */
168
193
  hasSuccessor(proposal: AgentProposal): boolean;
169
194
  /** Moves focus to the newer proposal that replaced this one. */
@@ -207,14 +232,16 @@ declare class NhAssistantAgentProposalsComponent {
207
232
  private holdStale;
208
233
  private run;
209
234
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAgentProposalsComponent, never>;
210
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentProposalsComponent, "nh-assistant-agent-proposals", never, { "proposals": { "alias": "proposals"; "required": true; "isSignal": true; }; "canDecide": { "alias": "canDecide"; "required": false; "isSignal": true; }; "decisionRights": { "alias": "decisionRights"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "holdClosedCards": { "alias": "holdClosedCards"; "required": false; "isSignal": true; }; }, { "changed": "changed"; }, never, never, true, never>;
235
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentProposalsComponent, "nh-assistant-agent-proposals", never, { "proposals": { "alias": "proposals"; "required": true; "isSignal": true; }; "canDecide": { "alias": "canDecide"; "required": false; "isSignal": true; }; "decisionRights": { "alias": "decisionRights"; "required": false; "isSignal": true; }; "selectable": { "alias": "selectable"; "required": false; "isSignal": true; }; "holdClosedCards": { "alias": "holdClosedCards"; "required": false; "isSignal": true; }; }, { "changed": "changed"; "openConversation": "openConversation"; }, never, never, true, never>;
211
236
  }
212
237
 
213
238
  /**
214
239
  * The runs of an agent thread, newest first: trigger, status, failure, usage, proposals and the
215
- * summary the next run starts from, and the agent that handed a run its work. Participants cancel
216
- * an open run; approvers resume or restart a failed or cancelled one. With live updates it reloads
217
- * by itself when a run or proposal of the thread changes.
240
+ * summary the next run starts from, and the agent that handed a run its work. "Show the result"
241
+ * opens a run's whole result, proposals and files in `nh-assistant-run-result`. Participants cancel
242
+ * an open run; approvers resume or restart a failed or cancelled one, and a restart shows what became
243
+ * of it like a start by hand. A run's failure reads as its translated code. With live updates it
244
+ * reloads by itself when a run or proposal of the thread changes.
218
245
  */
219
246
  declare class NhAssistantRunTimelineComponent {
220
247
  private readonly api;
@@ -226,16 +253,23 @@ declare class NhAssistantRunTimelineComponent {
226
253
  readonly changed: _angular_core.OutputEmitterRef<void>;
227
254
  /** Emits the thread of the agent that handed a run its work, so the host can open it. */
228
255
  readonly openConversation: _angular_core.OutputEmitterRef<string>;
256
+ readonly id: string;
229
257
  readonly loading: _angular_core.WritableSignal<boolean>;
230
258
  readonly loadFailed: _angular_core.WritableSignal<boolean>;
231
259
  readonly runs: _angular_core.WritableSignal<AgentRun[]>;
260
+ /** The run whose result is shown; one at a time. */
261
+ readonly openedRunId: _angular_core.WritableSignal<string | null>;
232
262
  readonly busyRunId: _angular_core.WritableSignal<string | null>;
233
263
  readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
234
264
  readonly errorKeys: _angular_core.Signal<string[]>;
265
+ /** What became of the latest restart. */
266
+ readonly receipt: _angular_core.WritableSignal<AgentTriggerReceipt | null>;
267
+ readonly codeKeys: typeof _nhAssistantCodeKeys;
235
268
  readonly canCancel: _angular_core.Signal<boolean>;
236
269
  readonly canRetry: _angular_core.Signal<boolean>;
237
270
  constructor();
238
271
  load(): void;
272
+ toggleResult(run: AgentRun): void;
239
273
  isOpen(run: AgentRun): boolean;
240
274
  canRetryRun(run: AgentRun): boolean;
241
275
  cancel(run: AgentRun): void;
@@ -280,7 +314,12 @@ declare class NhAssistantAgentArtifactsComponent {
280
314
  readonly conversationId: _angular_core.InputSignal<string>;
281
315
  readonly loading: _angular_core.WritableSignal<boolean>;
282
316
  readonly loadFailed: _angular_core.WritableSignal<boolean>;
283
- readonly downloadFailed: _angular_core.WritableSignal<boolean>;
317
+ /** Why the latest download failed, as a code and translation key; `null` after one that worked. */
318
+ readonly downloadError: _angular_core.WritableSignal<NhAssistantError | null>;
319
+ /** Whether the latest download failed. */
320
+ readonly downloadFailed: _angular_core.Signal<boolean>;
321
+ /** The text of the download's failure, then the text that a file could not be downloaded. */
322
+ readonly downloadErrorKeys: _angular_core.Signal<string[]>;
284
323
  readonly artifacts: _angular_core.WritableSignal<AgentArtifact[]>;
285
324
  readonly downloadingId: _angular_core.WritableSignal<string | null>;
286
325
  constructor();
@@ -306,6 +345,7 @@ declare class NhAssistantAgentConsultationsComponent {
306
345
  readonly loadFailed: _angular_core.WritableSignal<boolean>;
307
346
  readonly consultations: _angular_core.WritableSignal<AgentConsultation[]>;
308
347
  readonly total: _angular_core.WritableSignal<number>;
348
+ readonly codeKeys: typeof _nhAssistantCodeKeys;
309
349
  constructor();
310
350
  load(): void;
311
351
  /** A quiet load, after a live update, shows no loading state and keeps the list when it fails. */
@@ -327,7 +367,8 @@ interface NhAssistantStartedAgent {
327
367
  * whose conversation the host offers also before it worked on the subject. With live updates the
328
368
  * view reloads by itself when agent work on its subject changes; a proposal that closes because it
329
369
  * no longer fits stays as a closed card with the reason until it is dismissed. Opening a
330
- * conversation uses `NhAssistantPanelService.openSubject` and emits `conversationOpened` afterwards.
370
+ * conversation uses `NhAssistantPanelService.openSubject` and emits `conversationOpened` afterwards;
371
+ * opening the conversation of a run that placed a proposal here emits `runConversationOpened`.
331
372
  */
332
373
  declare class NhAssistantSubjectSuggestionsComponent {
333
374
  private readonly api;
@@ -344,6 +385,11 @@ declare class NhAssistantSubjectSuggestionsComponent {
344
385
  readonly agentId: _angular_core.InputSignal<string | undefined>;
345
386
  /** Emits once the panel opens the conversation, so a host in a dialog can make room for it. */
346
387
  readonly conversationOpened: _angular_core.OutputEmitterRef<AgentThreadLookup>;
388
+ /**
389
+ * Emits once the panel opens the conversation of a run that placed a proposal here from another
390
+ * subject, so a host in a dialog can make room for it.
391
+ */
392
+ readonly runConversationOpened: _angular_core.OutputEmitterRef<string>;
347
393
  readonly headingId: string;
348
394
  readonly loading: _angular_core.WritableSignal<boolean>;
349
395
  /** True after the first successful load; later loads keep the list, and an open feedback question, in place. */
@@ -365,10 +411,19 @@ declare class NhAssistantSubjectSuggestionsComponent {
365
411
  readonly decisionRights: _angular_core.Signal<ReadonlyMap<string, AgentProposalDecisionRight>>;
366
412
  constructor();
367
413
  load(): void;
368
- /** The translation keys of an agent's name: from the server's status, then the convention. */
369
- agentNameKeys(agentId: string): string[];
414
+ /**
415
+ * The translation keys of an agent's name: the name the subject's work gives, which names an agent
416
+ * kept out of the chat as well (the text itself for an agent created in the administration), then
417
+ * the server's status, then the convention.
418
+ */
419
+ agentNameKeys(agent: AgentSubjectWorkAgent): string[];
370
420
  /** Readers may open an existing conversation; creating one needs the participant role. */
371
421
  canOpen(agent: AgentSubjectWorkAgent): boolean;
422
+ /**
423
+ * Opens the conversation of the run that placed a proposal here, such as a run for the whole
424
+ * application, in the assistant panel; the server checks the reader's access to it.
425
+ */
426
+ openRunConversation(conversationId: string): void;
372
427
  open(agent: AgentSubjectWorkAgent): Promise<void>;
373
428
  start(agent: AgentSubjectWorkAgent): void;
374
429
  /**
@@ -379,8 +434,386 @@ declare class NhAssistantSubjectSuggestionsComponent {
379
434
  private refresh;
380
435
  private fetch;
381
436
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantSubjectSuggestionsComponent, never>;
382
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantSubjectSuggestionsComponent, "nh-assistant-subject-suggestions", never, { "subjectType": { "alias": "subjectType"; "required": true; "isSignal": true; }; "subjectId": { "alias": "subjectId"; "required": true; "isSignal": true; }; "agentId": { "alias": "agentId"; "required": false; "isSignal": true; }; }, { "conversationOpened": "conversationOpened"; }, never, never, true, never>;
437
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantSubjectSuggestionsComponent, "nh-assistant-subject-suggestions", never, { "subjectType": { "alias": "subjectType"; "required": true; "isSignal": true; }; "subjectId": { "alias": "subjectId"; "required": true; "isSignal": true; }; "agentId": { "alias": "agentId"; "required": false; "isSignal": true; }; }, { "conversationOpened": "conversationOpened"; "runConversationOpened": "runConversationOpened"; }, never, never, true, never>;
438
+ }
439
+
440
+ /** A subject chosen in the subject picker, with the name the application gives it. */
441
+ interface NhAssistantChosenSubject {
442
+ type: string;
443
+ id: string;
444
+ displayName: string | null;
445
+ }
446
+ /**
447
+ * The search of the picker for the subjects of one type: the subjects the caller may read whose
448
+ * name matches, from `GET subjects/{type}/search` (internal).
449
+ */
450
+ declare function nhAssistantSubjectSearch(api: NhAssistantAgentRunApiService, subjectType: string, limit?: number): (query: string) => Observable<_NhAssistantPickerOption[]>;
451
+ /**
452
+ * Chooses one subject of a type (internal). A searchable type is a combobox that searches the
453
+ * caller's readable subjects by name; for any other type people give the id, and the picker shows
454
+ * the name the application gives that subject, or why it was not found, below the field, with
455
+ * the translated code and, when asking again can help, a button that looks it up again. The
456
+ * platform's type of the whole application (`isSystem`) is "The whole application" itself for an
457
+ * app-wide agent, chosen as soon as the type is, and a search of the divisions by name for an agent
458
+ * that works per division (`perDivision`).
459
+ */
460
+ declare class NhAssistantSubjectPickerComponent {
461
+ private readonly api;
462
+ private lookup?;
463
+ /** The id of the field, for the label's `for`. */
464
+ readonly inputId: _angular_core.InputSignal<string>;
465
+ readonly subjectType: _angular_core.InputSignal<AgentSubjectType>;
466
+ /**
467
+ * For the whole application: choose one of the application's divisions, for an agent that works
468
+ * per division, instead of the whole application app-wide.
469
+ */
470
+ readonly perDivision: _angular_core.InputSignal<boolean>;
471
+ /** The chosen subject's id. */
472
+ readonly value: _angular_core.InputSignal<string | null>;
473
+ /** The name of the chosen subject, when the host knows it. */
474
+ readonly selectedLabel: _angular_core.InputSignal<string | null>;
475
+ readonly invalid: _angular_core.InputSignal<boolean>;
476
+ readonly describedBy: _angular_core.InputSignal<string | null>;
477
+ readonly disabled: _angular_core.InputSignal<boolean>;
478
+ /** The chosen subject, or `null` when the choice was cleared or the id was not found. */
479
+ readonly subjectChange: _angular_core.OutputEmitterRef<NhAssistantChosenSubject | null>;
480
+ readonly hintId: string;
481
+ /** The whole application app-wide: nothing to choose beyond the type itself. */
482
+ readonly wholeApplication: _angular_core.Signal<boolean>;
483
+ readonly search: _angular_core.Signal<((query: string) => Observable<_NhAssistantPickerOption[]>) | null>;
484
+ readonly placeholderKey: _angular_core.Signal<"nh-assistant.subject-picker.division-placeholder" | "nh-assistant.subject-picker.search-placeholder">;
485
+ readonly typedId: _angular_core.WritableSignal<string>;
486
+ readonly lookingUp: _angular_core.WritableSignal<boolean>;
487
+ readonly found: _angular_core.WritableSignal<NhAssistantChosenSubject | null>;
488
+ /** Why the typed id could not be looked up; `null` while there is no failure. */
489
+ readonly lookupError: _angular_core.WritableSignal<NhAssistantError | null>;
490
+ /** An unknown subject reads as such; any other failure with its own text and the generic fallback. */
491
+ readonly lookupErrorKeys: _angular_core.Signal<string[]>;
492
+ /** Looking the same id up again can help after a failure of the connection or the server. */
493
+ readonly lookupRetryable: _angular_core.Signal<boolean>;
494
+ readonly fieldDescribedBy: _angular_core.Signal<string>;
495
+ constructor();
496
+ choose(option: _NhAssistantPickerOption | null): void;
497
+ onIdInput(event: Event): void;
498
+ /** Looks the typed id up again after a failure that asking again may resolve. */
499
+ lookUpAgain(): void;
500
+ /** Looks the typed id up; the server names the subject when the caller may read it. */
501
+ lookUp(): void;
502
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantSubjectPickerComponent, never>;
503
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantSubjectPickerComponent, "nh-assistant-subject-picker", never, { "inputId": { "alias": "inputId"; "required": true; "isSignal": true; }; "subjectType": { "alias": "subjectType"; "required": true; "isSignal": true; }; "perDivision": { "alias": "perDivision"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "selectedLabel": { "alias": "selectedLabel"; "required": false; "isSignal": true; }; "invalid": { "alias": "invalid"; "required": false; "isSignal": true; }; "describedBy": { "alias": "describedBy"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, { "subjectChange": "subjectChange"; }, never, never, true, never>;
504
+ }
505
+
506
+ /** The agent the dialog runs: its id, its name as people read it and what it works on. */
507
+ interface NhAssistantRunNowAgent {
508
+ id: string;
509
+ /** The agent's name in the reader's language, or the text an administrator gave it. */
510
+ name: string;
511
+ /** The object types it works on; with `worksOnAllSubjects` every type the application registers. */
512
+ worksOnSubjectTypes?: readonly string[] | null;
513
+ worksOnAllSubjects?: boolean | null;
514
+ /** It works on the whole application. */
515
+ worksOnApplication?: boolean | null;
516
+ /** Its work for the whole application exists per division. */
517
+ perDivision?: boolean | null;
518
+ }
519
+ /** A subject the dialog runs the agent on without asking, such as the object of the page. */
520
+ interface NhAssistantRunNowSubject {
521
+ type: string;
522
+ id: string;
523
+ displayName?: string | null;
524
+ typeName?: string | null;
525
+ link?: string | null;
526
+ }
527
+ /** What a run by hand was started on, with the receipt of `POST threads/start`. */
528
+ interface NhAssistantRunNowStarted {
529
+ receipt: AgentTriggerReceipt;
530
+ subject: NhAssistantChosenSubject;
531
+ }
532
+ /** One answer to "What should the agent work on?". */
533
+ interface RunNowTarget {
534
+ key: string;
535
+ type: AgentSubjectType;
536
+ /** For the whole application: the agent works per division, so a division is chosen. */
537
+ perDivision: boolean;
538
+ }
539
+ /** The longest instruction the dialog sends with a run. */
540
+ declare const NH_ASSISTANT_RUN_NOW_MAX_MESSAGE = 4000;
541
+ /**
542
+ * Runs an agent now, by hand (internal to the library; the administration's "Run now", the run now
543
+ * of `nh-assistant-object-agents` and the board's tile use it, so it lives in the `agent-runs` entry
544
+ * point and stays out of the chat's initial bundle). A modal dialog asks what the agent
545
+ * works on this time, unless the host gives the subject: the whole application, in a division for an
546
+ * agent that works per division, or an object of one of its types through the subject picker; and an
547
+ * optional instruction. It sends `POST threads/start` with the caller as initiator, shows the
548
+ * server's refusal at the form with its translated code, and ends with the receipt: what happens
549
+ * now (a warning while the agent or its skill is paused, information while the start waits for the
550
+ * application's change to be saved), the subject and the conversation to open. The server decides
551
+ * who may run the agent: on an object the participant role, on the whole application the agent's
552
+ * run policy.
553
+ *
554
+ * The host renders it when people ask to run the agent; it opens itself and emits `closed` when it
555
+ * closes, after which the host removes it. Escape closes it, and focus returns to what opened it.
556
+ */
557
+ declare class NhAssistantRunNowDialogComponent {
558
+ private readonly api;
559
+ private readonly translate;
560
+ private readonly injector;
561
+ private readonly host;
562
+ private readonly dialog;
563
+ private subscription?;
564
+ readonly agent: _angular_core.InputSignal<NhAssistantRunNowAgent>;
565
+ /** The application's subject types from the run catalog, for choosing an object type. */
566
+ readonly subjectTypes: _angular_core.InputSignal<readonly AgentSubjectType[]>;
567
+ /** Whether the application lists its divisions, so a per-division agent can be run in one. */
568
+ readonly divisions: _angular_core.InputSignal<boolean>;
569
+ /** Runs the agent on this subject without asking, such as the object of the page. */
570
+ readonly subject: _angular_core.InputSignal<NhAssistantRunNowSubject | null>;
571
+ /** The run started, with its receipt. */
572
+ readonly started: _angular_core.OutputEmitterRef<NhAssistantRunNowStarted>;
573
+ /** People want to open the agent's conversation; the dialog has closed. */
574
+ readonly openConversation: _angular_core.OutputEmitterRef<string>;
575
+ /** The dialog closed; the host removes it. */
576
+ readonly closed: _angular_core.OutputEmitterRef<void>;
577
+ readonly id: string;
578
+ readonly maxMessage = 4000;
579
+ readonly targetKey: _angular_core.WritableSignal<string | null>;
580
+ readonly chosen: _angular_core.WritableSignal<NhAssistantChosenSubject | null>;
581
+ readonly message: _angular_core.WritableSignal<string>;
582
+ readonly starting: _angular_core.WritableSignal<boolean>;
583
+ readonly subjectMissing: _angular_core.WritableSignal<boolean>;
584
+ readonly receipt: _angular_core.WritableSignal<NhAssistantRunNowStarted | null>;
585
+ readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
586
+ /** A refusal of the start explained for running an agent, then as the server names it. */
587
+ readonly errorKeys: _angular_core.Signal<string[]>;
588
+ /** The whole application as the run catalog names it, or in the reader's language without one. */
589
+ private readonly systemType;
590
+ /** What the agent can be run on: the whole application when it works on it, then its object types. */
591
+ readonly targets: _angular_core.Signal<RunNowTarget[]>;
592
+ /** The chosen answer, by default the first: the whole application when the agent works on it. */
593
+ readonly target: _angular_core.Signal<RunNowTarget>;
594
+ /** A per-division agent cannot be run while the application lists no divisions. */
595
+ readonly divisionUnavailable: _angular_core.Signal<boolean>;
596
+ readonly subjectFieldId: _angular_core.Signal<string>;
597
+ readonly subjectErrorId: _angular_core.Signal<string>;
598
+ constructor();
599
+ chooseTarget(key: string): void;
600
+ onSubject(subject: NhAssistantChosenSubject | null): void;
601
+ onMessage(event: Event): void;
602
+ /** The subject the run is for: the host's, or the one chosen in the form. */
603
+ subjectOfRun(): NhAssistantChosenSubject | null;
604
+ submit(): void;
605
+ open(conversationId: string): void;
606
+ close(): void;
607
+ /** The native dialog closed, by a button or by Escape. */
608
+ onClosed(): void;
609
+ /** The name of the subject in the receipt, when the server's type name adds something. */
610
+ receiptTypeName(started: NhAssistantRunNowStarted): string | null;
611
+ receiptLink(started: NhAssistantRunNowStarted): string | null;
612
+ private focusFirst;
613
+ private focusSubject;
614
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantRunNowDialogComponent, never>;
615
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantRunNowDialogComponent, "nh-assistant-run-now-dialog", never, { "agent": { "alias": "agent"; "required": true; "isSignal": true; }; "subjectTypes": { "alias": "subjectTypes"; "required": false; "isSignal": true; }; "divisions": { "alias": "divisions"; "required": false; "isSignal": true; }; "subject": { "alias": "subject"; "required": false; "isSignal": true; }; }, { "started": "started"; "openConversation": "openConversation"; "closed": "closed"; }, never, never, true, never>;
616
+ }
617
+
618
+ /**
619
+ * The agents that work on one object, for the object's page, for example on a project: per agent its
620
+ * latest run with the beginning of its result, the whole result on demand in `nh-assistant-run-result`,
621
+ * its open proposals, "Run now" for people who may run it (the participants of the object; for the
622
+ * whole application, `nh-system`, the agent's run policy), and on demand its work on the object in
623
+ * `nh-assistant-agent-thread-view`. The server lists only the agents that work on the object and that
624
+ * the person may use, and checks every start again. A failed load reads as its translated code, such as
625
+ * an object that does not exist or that the person may not see, with "Try again" where asking again
626
+ * can help. With live updates the list reloads by itself when an agent's work on the object changes.
627
+ */
628
+ declare class NhAssistantObjectAgentsComponent {
629
+ private readonly api;
630
+ private readonly translate;
631
+ private subscription?;
632
+ /** The object's type, such as `project`, or `nh-system` for the whole application. */
633
+ readonly subjectType: _angular_core.InputSignal<string>;
634
+ /** The object's id, or `global` (or `division-…`) for the whole application. */
635
+ readonly subjectId: _angular_core.InputSignal<string>;
636
+ /** Emits the conversation id of an agent's thread, so the host can open it in the assistant panel. */
637
+ readonly openConversation: _angular_core.OutputEmitterRef<string>;
638
+ readonly id: string;
639
+ readonly loading: _angular_core.WritableSignal<boolean>;
640
+ readonly loadFailed: _angular_core.WritableSignal<boolean>;
641
+ /** Why the agents could not be read; `null` after a load that worked. */
642
+ readonly loadError: _angular_core.WritableSignal<NhAssistantError | null>;
643
+ readonly loadErrorKeys: _angular_core.Signal<string[]>;
644
+ /** Loading again can help after a failure of the connection or the server, not of the object. */
645
+ readonly loadRetryable: _angular_core.Signal<boolean>;
646
+ readonly codeKeys: typeof _nhAssistantCodeKeys;
647
+ readonly listing: _angular_core.WritableSignal<AgentObjectAgents | null>;
648
+ readonly agents: _angular_core.Signal<AgentObjectAgent[]>;
649
+ /** The agent whose work on the object is shown; one at a time. */
650
+ readonly expanded: _angular_core.WritableSignal<string | null>;
651
+ /** The agent whose latest result is shown in full; one at a time. */
652
+ readonly resultShown: _angular_core.WritableSignal<string | null>;
653
+ /** The agent the run-now dialog runs; `null` while it is closed. */
654
+ readonly runningNow: _angular_core.WritableSignal<AgentObjectAgent | null>;
655
+ readonly runNowAgent: _angular_core.Signal<NhAssistantRunNowAgent | null>;
656
+ /** The object of the page: the run-now dialog runs on it without asking. */
657
+ readonly runNowSubject: _angular_core.Signal<NhAssistantRunNowSubject | null>;
658
+ constructor();
659
+ load(): void;
660
+ /** The agent's name: a translation key of an agent in code, or the text of one created as data. */
661
+ nameOf(agent: AgentObjectAgent): string;
662
+ toggleResult(agent: AgentObjectAgent): void;
663
+ toggleWork(agent: AgentObjectAgent): void;
664
+ runNow(agent: AgentObjectAgent): void;
665
+ /** A run started: the list shows it as the agent's latest run. */
666
+ onStarted(): void;
667
+ proposalsKey(count: number): string;
668
+ /** Whether a live update concerns the object: its runs, proposals or feedback changed. */
669
+ private concerns;
670
+ /**
671
+ * Reads the agents. A quiet reload, after a live update or a start, keeps what is shown when it
672
+ * fails and shows no loading state.
673
+ */
674
+ private fetch;
675
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantObjectAgentsComponent, never>;
676
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantObjectAgentsComponent, "nh-assistant-object-agents", never, { "subjectType": { "alias": "subjectType"; "required": true; "isSignal": true; }; "subjectId": { "alias": "subjectId"; "required": true; "isSignal": true; }; }, { "openConversation": "openConversation"; }, never, never, true, never>;
677
+ }
678
+
679
+ /** How long a run took, for people to read: a text key and its number. */
680
+ interface RunDuration {
681
+ key: string;
682
+ value: number;
683
+ }
684
+ /**
685
+ * One run of an agent with its result: what it worked on, how it was started and ended, its usage
686
+ * and duration, its whole answer, the proposals it made (also those it placed at other objects the
687
+ * reader may read) and the files it saved. The answer is model output: it is rendered with the
688
+ * assistant's safe Markdown rendering, which shows inline HTML as text and keeps only a strict set
689
+ * of tags and links, never as HTML. The server decides who sees a run (`GET runs/{id}`): readers of
690
+ * its object, for the whole application the agent's view policy, administrators every run. The
691
+ * thread view's run timeline and the administration's runs view open it; an application may show
692
+ * it anywhere with a run id. With live updates it reloads by itself while the run works.
693
+ */
694
+ declare class NhAssistantRunResultComponent {
695
+ private readonly api;
696
+ private readonly document;
697
+ private subscription?;
698
+ /** The run to show. */
699
+ readonly runId: _angular_core.InputSignal<string>;
700
+ /**
701
+ * Whether to offer the run's conversation; leave it off where that conversation is already shown,
702
+ * as in its thread's run timeline.
703
+ */
704
+ readonly conversationLink: _angular_core.InputSignal<boolean>;
705
+ /** Emits the run's thread conversation, or the one of a run that placed a proposal, so the host can open it. */
706
+ readonly openConversation: _angular_core.OutputEmitterRef<string>;
707
+ readonly id: string;
708
+ readonly loading: _angular_core.WritableSignal<boolean>;
709
+ readonly loadFailed: _angular_core.WritableSignal<boolean>;
710
+ /** The run does not exist or the reader may not see it. */
711
+ readonly notFound: _angular_core.WritableSignal<boolean>;
712
+ readonly detail: _angular_core.WritableSignal<AgentRunResult | null>;
713
+ readonly downloadingId: _angular_core.WritableSignal<string | null>;
714
+ /** Why the latest download failed, as a code and translation key; `null` after one that worked. */
715
+ readonly downloadError: _angular_core.WritableSignal<NhAssistantError | null>;
716
+ /** Whether the latest download failed. */
717
+ readonly downloadFailed: _angular_core.Signal<boolean>;
718
+ /** The text of the download's failure, then the text that a file could not be downloaded. */
719
+ readonly downloadErrorKeys: _angular_core.Signal<string[]>;
720
+ readonly codeKeys: typeof _nhAssistantCodeKeys;
721
+ readonly duration: _angular_core.Signal<RunDuration | null>;
722
+ readonly tokens: _angular_core.Signal<number>;
723
+ constructor();
724
+ load(): void;
725
+ download(artifact: AgentArtifact): Promise<void>;
726
+ /**
727
+ * Reads the run. A quiet reload, after a live update, keeps what is shown when it fails and shows
728
+ * no loading state.
729
+ */
730
+ private fetch;
731
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantRunResultComponent, never>;
732
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantRunResultComponent, "nh-assistant-run-result", never, { "runId": { "alias": "runId"; "required": true; "isSignal": true; }; "conversationLink": { "alias": "conversationLink"; "required": false; "isSignal": true; }; }, { "openConversation": "openConversation"; }, never, never, true, never>;
733
+ }
734
+
735
+ /** What a board tile shows below the agent: its latest result, its proposals or its history. */
736
+ type NhAssistantBoardPanel = 'result' | 'proposals' | 'history';
737
+ /**
738
+ * The board of one group of agents, for a page of the application such as "Project management"
739
+ * (K15): per agent a tile with what it works on, its latest result for the whole application rendered
740
+ * with the assistant's safe Markdown rendering, "New" for what arrived since the person's last visit
741
+ * (K16), "Run now" for people who may run it, its open proposals in the inbox, and its history with
742
+ * every result on demand. Showing the board records the visit, so the next visit marks what is new
743
+ * after this one. The server decides which agents the person sees: an agent that works on the whole
744
+ * application by its view policy, by default its required policy. With `divisionId` the board shows
745
+ * the work of agents that work per division in that division. With live updates the board reloads by
746
+ * itself when its agents' work changes.
747
+ */
748
+ declare class NhAssistantAgentBoardComponent {
749
+ private readonly api;
750
+ private readonly translate;
751
+ private subscription?;
752
+ private visitSubscription?;
753
+ /** The board and scope whose visit this view recorded; the visit is recorded once per board shown. */
754
+ private visited;
755
+ /**
756
+ * What the first read of the shown board found: the visit before this one and the agents that were
757
+ * new then. Later reads, after live updates or a start, compare with the visit this view recorded,
758
+ * so the view keeps both: what was new when the board was opened stays new while it is shown.
759
+ */
760
+ private opened;
761
+ /** The group whose board is shown, such as `project-management`, as the application registered it. */
762
+ readonly group: _angular_core.InputSignal<string>;
763
+ /** The division whose board is shown; without it the board of the whole application. */
764
+ readonly divisionId: _angular_core.InputSignal<string | null>;
765
+ /** Emits a conversation a result or proposal offers to open, so the host can open it in the assistant panel. */
766
+ readonly openConversation: _angular_core.OutputEmitterRef<string>;
767
+ readonly id: string;
768
+ readonly codeKeys: typeof _nhAssistantCodeKeys;
769
+ readonly loading: _angular_core.WritableSignal<boolean>;
770
+ readonly loadFailed: _angular_core.WritableSignal<boolean>;
771
+ /** The board does not exist or the person sees none of its agents. */
772
+ readonly notFound: _angular_core.WritableSignal<boolean>;
773
+ /** The board as shown: new since the visit before this one, also after the visit was recorded. */
774
+ readonly board: _angular_core.WritableSignal<AgentBoard | null>;
775
+ readonly agents: _angular_core.Signal<AgentBoardAgent[]>;
776
+ /** Per agent what its tile shows below it; one panel per tile. */
777
+ readonly panels: _angular_core.WritableSignal<Readonly<Record<string, NhAssistantBoardPanel>>>;
778
+ /** The agent the run-now dialog runs; `null` while it is closed. */
779
+ readonly runningNow: _angular_core.WritableSignal<AgentBoardAgent | null>;
780
+ readonly runNowAgent: _angular_core.Signal<NhAssistantRunNowAgent | null>;
781
+ /** The whole application in the board's scope: the run-now dialog runs on it without asking. */
782
+ readonly runNowSubject: _angular_core.Signal<NhAssistantRunNowSubject | null>;
783
+ constructor();
784
+ load(): void;
785
+ /** The agent's name: a translation key of an agent in code, or the text of one created as data. */
786
+ nameOf(agent: AgentBoardAgent): string;
787
+ /** What the agent works on, in the reader's language. */
788
+ worksOnOf(agent: AgentBoardAgent): string;
789
+ panelOf(agent: AgentBoardAgent): NhAssistantBoardPanel | null;
790
+ toggle(agent: AgentBoardAgent, panel: NhAssistantBoardPanel): void;
791
+ runNow(agent: AgentBoardAgent): void;
792
+ /** A run started: the board shows it as the agent's latest run. */
793
+ onStarted(): void;
794
+ proposalsKey(count: number): string;
795
+ /** The beginning of a result as Markdown, marked when the result goes on. */
796
+ previewOf(result: string, truncated: boolean): string;
797
+ /**
798
+ * Whether a live update concerns the board: the work in one of its agents' threads, or a run of the
799
+ * whole application that may have started an agent's first thread.
800
+ */
801
+ private concerns;
802
+ /**
803
+ * Reads the board. A quiet reload, after a live update or a start, keeps what is shown when it
804
+ * fails and shows no loading state. The first time a board is shown, its visit is recorded after it
805
+ * was read, so it still marks what arrived since the visit before.
806
+ */
807
+ private fetch;
808
+ /**
809
+ * The board read compared with the visit before the board was opened: the first read of a board
810
+ * keeps its previous visit and new agents; later reads keep showing them as new.
811
+ */
812
+ private asOpened;
813
+ private recordVisit;
814
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAgentBoardComponent, never>;
815
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentBoardComponent, "nh-assistant-agent-board", never, { "group": { "alias": "group"; "required": true; "isSignal": true; }; "divisionId": { "alias": "divisionId"; "required": false; "isSignal": true; }; }, { "openConversation": "openConversation"; }, never, never, true, never>;
383
816
  }
384
817
 
385
- export { NhAssistantAgentArtifactsComponent, NhAssistantAgentConsultationsComponent, NhAssistantAgentInboxComponent, NhAssistantAgentMemoryComponent, NhAssistantAgentProposalsComponent, NhAssistantAgentThreadViewComponent, NhAssistantRunTimelineComponent, NhAssistantSubjectSuggestionsComponent };
386
- export type { NhAssistantAgentThreadTab };
818
+ export { NhAssistantAgentArtifactsComponent, NhAssistantAgentBoardComponent, NhAssistantAgentConsultationsComponent, NhAssistantAgentInboxComponent, NhAssistantAgentMemoryComponent, NhAssistantAgentProposalsComponent, NhAssistantAgentThreadViewComponent, NhAssistantObjectAgentsComponent, NhAssistantRunResultComponent, NhAssistantRunTimelineComponent, NhAssistantSubjectSuggestionsComponent, NH_ASSISTANT_RUN_NOW_MAX_MESSAGE as ɵNH_ASSISTANT_RUN_NOW_MAX_MESSAGE, NhAssistantRunNowDialogComponent as ɵNhAssistantRunNowDialogComponent, NhAssistantSubjectPickerComponent as ɵNhAssistantSubjectPickerComponent, nhAssistantSubjectSearch as ɵnhAssistantSubjectSearch };
819
+ export type { NhAssistantAgentThreadTab, NhAssistantBoardPanel, NhAssistantChosenSubject as ɵNhAssistantChosenSubject, NhAssistantRunNowAgent as ɵNhAssistantRunNowAgent, NhAssistantRunNowStarted as ɵNhAssistantRunNowStarted, NhAssistantRunNowSubject as ɵNhAssistantRunNowSubject };