@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.
package/README.md CHANGED
@@ -148,7 +148,9 @@ caller may decide each one. `NhAssistantStore.approvalRights` turns that into a
148
148
  approval card, `decide(decision, reason, approvalId)` decides a run's proposal with its
149
149
  proposal hash through `POST approvals/{id}/decisions` and reloads the thread, and cards
150
150
  the caller may not decide say who does (`waitingFor`: an approver, or another approver
151
- under four-eyes). Messages a trigger wrote (`authorKind: 'trigger'`) read as an event.
151
+ under four-eyes). Messages a trigger wrote (`authorKind: 'trigger'`) read as an event, and
152
+ messages the application posted (`role: 'application'`) as the application's, with their sender,
153
+ title, Markdown text and a link within the application or to an `https` address.
152
154
  Custom layouts pass `[approvalRights]` to `nh-assistant-thread` and handle
153
155
  `(approvalChoice)`, which carries the approval id.
154
156
 
@@ -328,6 +330,14 @@ run for the whole application instead of a set of objects (sent as `subjectSet:
328
330
  division for an agent that works per division); the trigger list names it, and subject links name the
329
331
  whole application (`nh-system`, `isSystem` in the run catalog) once.
330
332
 
333
+ An agent's run configuration lists its consultations: those in code read only, and those defined as
334
+ data, which administrators add, change and remove within the agent's `consultationCeiling`
335
+ (`saveDataConsultation`, `removeDataConsultation`), with only the routes, requests and limits that
336
+ ceiling and the agent allow. Each consultation names the agents that ask it, with a link to their
337
+ editors, and its problems; the route switches turn a route off for all consultations of the agent, and
338
+ the flow's "When it runs" step names them. The mock API plays them with the scenario's
339
+ `consultationsAsData`, an agent's `consultableAsData` and its `dataConsultations`.
340
+
331
341
  With live updates the inbox, the thread view and its tabs reload by themselves when the hub
332
342
  reports `AgentWorkChanged` for work they show, debounced, and after every reconnect. The
333
343
  update names the thread, its subject (`subjectType`, `subjectId`) and whether a run, a
package/admin/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { OnInit } from '@angular/core';
2
+ import { InjectionToken, Type, Signal, EnvironmentProviders, Injector, OnInit } from '@angular/core';
3
3
  import * as _newheap_platform_ai_chat from '@newheap/platform-ai-chat';
4
- import { NhAssistantStore, NhAssistantError, ApplicationContext, ApplicationContextVersion, AdminAgent, ToolCatalogEntry, McpServer, RunCatalog, SetAgentStateRequest, AgentSkillState, AgentShadowMode, AgentShadowState, AssistantAutonomy, AssistantDataClassification, AgentEvaluation, AgentReplay, AgentEvaluationCost, AgentProposalFeedbackCategory, AgentFeedbackSummaryRow, AgentFeedbackItem, AgentFeedbackCategoryCount, StaleKind, AgentProposalFeedbackGroup, AgentSubjectType, AgentRunStatus, ɵnhAssistantCodeKeys as _nhAssistantCodeKeys, AgentRunHistoryItem, DataSkill, AgentRunConfiguration, DataTrigger, SkillComparison, DataSkillVersion, ɵNhAssistantPickerOption as _NhAssistantPickerOption, McpServerTestResult, McpConnectionsSummary, McpBuiltInAuthMode, McpCustomAuthMode, McpAuthMode, McpTransport, McpConnectionScope, McpHeadlessUse, McpDiscovery, McpTool, McpToolEffect } from '@newheap/platform-ai-chat';
4
+ import { NhAssistantStore, NhAssistantError, ApplicationContext, ApplicationContextVersion, AdminAgent, PackagePartLink, ToolCatalogEntry, McpServer, RunCatalog, SetAgentStateRequest, AgentSkillState, AgentShadowMode, AgentShadowState, AssistantAutonomy, AssistantDataClassification, InstructionAssetReference, AgentMetadata, AgentMetadataEntry, NhAssistantAdminApiService, ɵnhAssistantErrorKeys as _nhAssistantErrorKeys, AgentEvaluation, AgentReplay, AgentEvaluationCost, AgentProposalFeedbackCategory, AgentFeedbackSummaryRow, AgentFeedbackItem, AgentFeedbackCategoryCount, StaleKind, AgentProposalFeedbackGroup, AgentSubjectType, AgentRunStatus, ɵnhAssistantCodeKeys as _nhAssistantCodeKeys, AgentRunHistoryItem, NhAssistantConsultationRoute, DataConsultation, CodeConsultation, DataTriggerVersion, DataSkill, AgentRunConfiguration, DataTrigger, SkillComparison, DataSkillVersion, TriggerComparison, ɵNhAssistantPickerOption as _NhAssistantPickerOption, McpServerTestResult, McpConnectionsSummary, McpBuiltInAuthMode, McpCustomAuthMode, McpAuthMode, McpTransport, McpConnectionScope, McpHeadlessUse, McpDiscovery, McpTool, McpToolEffect } from '@newheap/platform-ai-chat';
5
5
  import { ɵNhAssistantRunNowAgent as _NhAssistantRunNowAgent } from '@newheap/platform-ai-chat/agent-runs';
6
6
 
7
7
  type NhAssistantAdminTab = 'context' | 'agents' | 'mcp-servers';
@@ -153,6 +153,27 @@ interface WorksOnSummary {
153
153
  viewPolicy: string | null;
154
154
  }
155
155
 
156
+ /** How a package links one part on this host, as the forms and lists show it. */
157
+ interface PackageLockView {
158
+ packageId: string;
159
+ packageVersion: number;
160
+ /** The whole part is locked. */
161
+ whole: boolean;
162
+ /** The locked fields by their names in the format; empty while the whole part or nothing is locked. */
163
+ fields: readonly string[];
164
+ /** The part changed here after its import; the next upgrade overwrites its unlocked fields. */
165
+ changedLocally: boolean;
166
+ }
167
+ /** The lock a part's link shows, or `null` for a part no package links. */
168
+ declare function packageLockOf(link: PackagePartLink | null | undefined): PackageLockView | null;
169
+ /**
170
+ * The package an agent belongs to, as the notice of the whole agent shows it: the package's id and
171
+ * the version this host has, without locks of its own.
172
+ */
173
+ declare function agentPackageOf(agent: AdminAgent | null | undefined): PackageLockView | null;
174
+ /** Whether a lock keeps anything of its part from changing, so the part cannot be removed. */
175
+ declare function isPackageLocked(lock: PackageLockView | null | undefined): boolean;
176
+
156
177
  type AgentStateAction = SetAgentStateRequest['state'];
157
178
  /** A state change being entered, of the agent or one of its skills, with the state it changes from. */
158
179
  interface StateChange {
@@ -177,7 +198,11 @@ interface StateChange {
177
198
  * code and offers to read it again; until then it offers no "Run now" and the editor leaves what an
178
199
  * agent works on and its groups as they are. The run configuration opens with the agent's flow, whose
179
200
  * entry points open the editor, the runs and the technical account here and return to the run
180
- * configuration afterwards; `openMcpServers` asks the host to show the MCP servers.
201
+ * configuration afterwards; `openMcpServers` asks the host to show the MCP servers. "Import package"
202
+ * opens the import dialog of agent packages, and "Export as package" on an agent the export dialog
203
+ * with that agent chosen. An agent that belongs to a package says so on its card with "Unlink the
204
+ * agent"; it cannot be deleted until it is unlinked, nor reset while its package locks fields of
205
+ * its definition.
181
206
  */
182
207
  declare class NhAssistantAdminAgentsComponent {
183
208
  private readonly admin;
@@ -255,6 +280,11 @@ declare class NhAssistantAdminAgentsComponent {
255
280
  readonly accountNames: _angular_core.Signal<ReadonlyMap<string, string>>;
256
281
  /** The agent whose last action failed, so its error shows on its card. */
257
282
  readonly errorAgentId: _angular_core.WritableSignal<string | null>;
283
+ /** The agent whose export dialog is open, chosen in it; `null` while it is closed. */
284
+ readonly exporting: _angular_core.WritableSignal<AdminAgent | null>;
285
+ /** Whether the import dialog of agent packages is open. */
286
+ readonly importing: _angular_core.WritableSignal<boolean>;
287
+ readonly agentPackageOf: typeof agentPackageOf;
258
288
  /** The agent the run-now dialog runs; `null` while it is closed. */
259
289
  readonly runningNow: _angular_core.WritableSignal<AdminAgent | null>;
260
290
  /** The agent of the run-now dialog as the dialog needs it: its name and what it works on. */
@@ -294,6 +324,18 @@ declare class NhAssistantAdminAgentsComponent {
294
324
  * that is off still runs for a person. The server decides the rest when the run starts.
295
325
  */
296
326
  canRunNow(agent: AdminAgent): boolean;
327
+ /** Opens the export dialog with the agent chosen. */
328
+ exportPackage(agent: AdminAgent): void;
329
+ /** Opens the import dialog of agent packages. */
330
+ importPackage(): void;
331
+ /** A package was imported: its agents and their parts are read again. */
332
+ onPackageImported(): void;
333
+ /** The agent or a part of it was unlinked from its package. */
334
+ onPackageUnlinked(): void;
335
+ /** A package the agent belongs to keeps it from being deleted until it is unlinked. */
336
+ deleteLocked(agent: AdminAgent): boolean;
337
+ /** A reset would give fields the package locks the code's values, which the server refuses. */
338
+ resetLocked(agent: AdminAgent): boolean;
297
339
  /** Opens the run-now dialog of the agent. */
298
340
  runNow(agent: AdminAgent): void;
299
341
  /** Opens the conversation the run works in, in the assistant panel. */
@@ -317,6 +359,19 @@ declare class NhAssistantAdminAgentsComponent {
317
359
  onWorkRequested(agent: AdminAgent): void;
318
360
  /** The flow of the agent's run configuration opens the editor; saving or cancelling returns there. */
319
361
  editFromRunConfiguration(agent: AdminAgent): void;
362
+ /**
363
+ * A consultation of the agent's run configuration opens the editor of an agent that asks it, whose
364
+ * tool selectors are the consultation's second key; saving or cancelling returns to the run
365
+ * configuration it came from.
366
+ */
367
+ askerFromRunConfiguration(agent: AdminAgent, askerId: string): void;
368
+ /**
369
+ * A data shadow variant created in the agent's run configuration continues in its own run
370
+ * configuration's guided setup, since it receives the live agent's events only with run settings.
371
+ */
372
+ onVariantCreated(variant: AdminAgent): void;
373
+ /** The run configuration of a data shadow variant of the agent whose run configuration is open. */
374
+ variantFromRunConfiguration(variantId: string): void;
320
375
  /** The flow of the agent's run configuration opens its runs; going back returns there. */
321
376
  runsFromRunConfiguration(agent: AdminAgent): void;
322
377
  /** The flow of an agent in code opens the form that replaces its technical account on its card. */
@@ -325,7 +380,11 @@ declare class NhAssistantAdminAgentsComponent {
325
380
  onEditorSaved(agent: AdminAgent): void;
326
381
  /** The editor closed without saving: back to the run configuration that opened it, or to the list. */
327
382
  onEditorCancelled(): void;
328
- /** Opens the run configuration again when its flow opened what closes now; `false` otherwise. */
383
+ /**
384
+ * Opens the run configuration again when its flow, or one of its consultations, opened what closes
385
+ * now; `false` otherwise. The editor of an agent that asks a consultation returns to the consulted
386
+ * agent's run configuration.
387
+ */
329
388
  private returnToRunConfiguration;
330
389
  /** What the agent works on, with its object types named as the run catalog names them. */
331
390
  worksOn(agent: AdminAgent): WorksOnSummary & {
@@ -408,6 +467,15 @@ declare class NhAssistantAdminAgentsComponent {
408
467
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAdminAgentsComponent, "nh-assistant-admin-agents", never, {}, { "openMcpServers": "openMcpServers"; }, never, never, true, never>;
409
468
  }
410
469
 
470
+ /** A field error: a code such as `required`, with its translation parameters. */
471
+ interface RunConfigFieldError {
472
+ code: string;
473
+ params?: Record<string, unknown>;
474
+ }
475
+
476
+ /** Where the instructions of a skill version or an agent created here come from. */
477
+ type InstructionsSource = 'inline' | 'asset';
478
+
411
479
  /** True when a tool id matches a selector glob (`*` matches any characters). */
412
480
  declare function nhAssistantSelectorMatches(toolId: string, selector: string): boolean;
413
481
  /** How an agent created in the administration is used: chosen in the chat, working on its own, or both. */
@@ -422,7 +490,12 @@ type WorksOnScope = 'all' | 'types';
422
490
  * patterns, and assigned MCP servers. A new agent meant to work on its own continues with
423
491
  * `workRequested`. An agent in code names and describes itself with translation keys: the editor
424
492
  * shows their translation and sends the key back unless the administrator changed the text, so the
425
- * agent stays translated; what it works on comes from its code and is not edited here.
493
+ * agent stays translated; what it works on comes from its code and is not edited here. Below the form,
494
+ * an existing agent shows the application's fields (`nh-assistant-agent-metadata`): one slot per entry
495
+ * of agent metadata, where the application's own editor saves the value; a change of a field of an
496
+ * agent created here is its next version, which the next save of the definition continues on. Fields
497
+ * of the definition that the agent's package locks show read-only with a lock and the package's id and
498
+ * version, with "Unlink" for the definition; a save keeps their values.
426
499
  */
427
500
  declare class NhAssistantAdminAgentEditorComponent {
428
501
  private readonly admin;
@@ -457,11 +530,20 @@ declare class NhAssistantAdminAgentEditorComponent {
457
530
  readonly displayName: _angular_core.WritableSignal<string>;
458
531
  readonly description: _angular_core.WritableSignal<string>;
459
532
  readonly instructions: _angular_core.WritableSignal<string>;
533
+ /** Whether the instructions of an agent created here are written here or come from an asset of the application. */
534
+ readonly instructionsSource: _angular_core.WritableSignal<InstructionsSource>;
535
+ /** The application's asset the agent names, once chosen and read. */
536
+ readonly instructionsAsset: _angular_core.WritableSignal<InstructionAssetReference | null>;
460
537
  readonly autonomy: _angular_core.WritableSignal<AssistantAutonomy>;
461
538
  /** How the agent is used: in the chat, on its own, or both. */
462
539
  readonly use: _angular_core.WritableSignal<AgentUse>;
463
540
  /** A new agent takes its triggers at once; without it, it starts off until someone switches it on. */
464
541
  readonly switchOnNow: _angular_core.WritableSignal<boolean>;
542
+ /**
543
+ * A new agent starts in shadow: once it has run settings its runs work in its shadow threads, where
544
+ * nobody is notified and nothing executes, until someone puts it live.
545
+ */
546
+ readonly startsInShadow: _angular_core.WritableSignal<boolean>;
465
547
  /** The model profile of an agent created here; empty uses the application's chat profile. */
466
548
  readonly profile: _angular_core.WritableSignal<string>;
467
549
  /** The classification of the model calls of an agent created here; `internal` when it has none. */
@@ -490,12 +572,36 @@ declare class NhAssistantAdminAgentEditorComponent {
490
572
  private readonly created;
491
573
  /** The agent the next save updates; `null` while a new agent is not created yet. */
492
574
  private readonly editing;
575
+ /**
576
+ * The agent's version after one of its application fields changed, which made its next version;
577
+ * `null` while no field changed.
578
+ */
579
+ private readonly fieldsVersion;
580
+ /** The definition was unlinked from its package here, so it no longer locks. */
581
+ private readonly unlinked;
582
+ /** What the agent's package locks of its definition (part `agent`); `null` without a link. */
583
+ readonly lock: _angular_core.Signal<PackageLockView | null>;
584
+ /** The agent whose application fields show below the form; `null` for a new agent. */
585
+ readonly metadataAgent: _angular_core.Signal<AdminAgent | null>;
586
+ /** The entries of agent metadata the application registers, for a new agent. */
587
+ readonly metadataEntries: _angular_core.Signal<_newheap_platform_ai_chat.AgentMetadataEntry[]>;
493
588
  readonly isNew: _angular_core.Signal<boolean>;
494
589
  /** Only agents created here choose whether they are offered in the chat; code decides for the others. */
495
590
  readonly choosesUse: _angular_core.Signal<boolean>;
496
591
  readonly idInvalid: _angular_core.Signal<boolean>;
497
592
  readonly nameMissing: _angular_core.Signal<boolean>;
498
593
  readonly tooLong: _angular_core.Signal<boolean>;
594
+ /**
595
+ * Only an agent created here takes its instructions from an asset, when the application offers its
596
+ * assets; one that names an asset keeps showing it.
597
+ */
598
+ readonly assetsAvailable: _angular_core.Signal<boolean>;
599
+ /** An asset is the source, but none is chosen and read yet. */
600
+ readonly assetMissing: _angular_core.Signal<boolean>;
601
+ /** The problem of the asset the saved agent names, while it is still the choice. */
602
+ readonly assetProblem: _angular_core.Signal<_newheap_platform_ai_chat.InstructionAssetProblem | null>;
603
+ /** The error of the asset choice: chosen none, or the save's refusal of the reference. */
604
+ readonly assetError: _angular_core.Signal<RunConfigFieldError | null>;
499
605
  readonly selectorInvalid: _angular_core.Signal<boolean>;
500
606
  /**
501
607
  * The application's own object types, by name; the platform's types, such as the whole
@@ -549,8 +655,16 @@ declare class NhAssistantAdminAgentEditorComponent {
549
655
  toggleServer(serverId: string, checked: boolean): void;
550
656
  value(event: Event): string;
551
657
  checked(event: Event): boolean;
658
+ /** Whether the agent's package locks a field of its definition, which then shows read-only. */
659
+ locked(field: string): boolean;
660
+ /** The lock the mark next to a field's label shows; `null` for a field that changes here. */
661
+ lockOf(field: string): PackageLockView | null;
662
+ /** The definition was unlinked from its package: its fields change here again. */
663
+ onUnlinked(): void;
552
664
  /** The first error the server reported for a field, as a translation key. */
553
665
  fieldError(field: string): string | null;
666
+ /** An application field of an agent created here made the agent's next version. */
667
+ fieldsChanged(agentVersion: number): void;
554
668
  save(): void;
555
669
  /** What the agent works on, as the six fields the server reads together. */
556
670
  private worksOnInput;
@@ -561,6 +675,140 @@ declare class NhAssistantAdminAgentEditorComponent {
561
675
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAdminAgentEditorComponent, "nh-assistant-admin-agent-editor", never, { "agent": { "alias": "agent"; "required": false; "isSignal": true; }; "tools": { "alias": "tools"; "required": false; "isSignal": true; }; "servers": { "alias": "servers"; "required": false; "isSignal": true; }; "catalog": { "alias": "catalog"; "required": false; "isSignal": true; }; "catalogUnavailable": { "alias": "catalogUnavailable"; "required": false; "isSignal": true; }; }, { "saved": "saved"; "workRequested": "workRequested"; "cancelled": "cancelled"; }, never, never, true, never>;
562
676
  }
563
677
 
678
+ /**
679
+ * The application's editor of one entry of agent metadata (`AddAgentMetadata`): a standalone
680
+ * component that the agent editor renders in the entry's slot. It injects
681
+ * `NhAssistantAgentMetadataSlot` for the entry's value and saves the value with it; the library has no
682
+ * generic form for metadata.
683
+ */
684
+ interface NhAssistantAgentMetadataEditor {
685
+ /** The entry's name, as the application registers it with `AddAgentMetadata`. */
686
+ name: string;
687
+ /** The application's standalone component that shows and edits the value. */
688
+ component: Type<unknown>;
689
+ /** A translation key of the slot's title; the entry's name without one. */
690
+ label?: string;
691
+ }
692
+ /** The editors the application registers for its entries of agent metadata, by entry name. */
693
+ declare const NH_ASSISTANT_AGENT_METADATA_EDITORS: InjectionToken<NhAssistantAgentMetadataEditor[]>;
694
+ /**
695
+ * Registers the application's editors of agent metadata, where the administration is provided (in
696
+ * the application's configuration or the providers of its administration route). The agent editor
697
+ * renders one slot per registered entry; an entry without an editor shows that the application shows
698
+ * none. Several calls add their editors.
699
+ */
700
+ declare function provideNhAssistantAgentMetadataEditors(...editors: NhAssistantAgentMetadataEditor[]): EnvironmentProviders;
701
+ /** What the last change of an entry did, for the slot's status line. */
702
+ type NhAssistantAgentMetadataStatus = 'saved' | 'removed';
703
+ /**
704
+ * The slot of one entry of agent metadata, which an application's editor injects: the entry's value
705
+ * as the server answered it, whether it may change, and `save` and `remove`, which go through
706
+ * `NhAssistantAdminApiService` with the entry's version and keep the slot up to date. A refusal shows
707
+ * in `error`, with the validator's codes in `fieldErrors`.
708
+ */
709
+ declare abstract class NhAssistantAgentMetadataSlot {
710
+ /** The agent's id. */
711
+ abstract readonly agentId: string;
712
+ /** The entry with its value in effect, where it comes from and its version. */
713
+ abstract readonly entry: Signal<AgentMetadata>;
714
+ /**
715
+ * Whether the value is read-only here: an entry of an agent in code that is not editable, or one
716
+ * whose value the agent's package locks until an administrator unlinks it.
717
+ */
718
+ abstract readonly readOnly: Signal<boolean>;
719
+ /** Whether a change is being saved. */
720
+ abstract readonly saving: Signal<boolean>;
721
+ /** The refusal of the last change, or `null`. */
722
+ abstract readonly error: Signal<NhAssistantError | null>;
723
+ /** What the last change did, until the next one starts. */
724
+ abstract readonly status: Signal<NhAssistantAgentMetadataStatus | null>;
725
+ /**
726
+ * Saves `value`, in the shape of the entry's type, with the entry's version: an agent created here
727
+ * gets its next version, an agent in code an override. Ignored while read-only or saving.
728
+ */
729
+ abstract save(value: unknown): void;
730
+ /** Removes the stored value: an agent in code uses its value in code again. */
731
+ abstract remove(): void;
732
+ /**
733
+ * The codes the server reported for the whole value, or for one of its fields by camelCase path
734
+ * such as `code`; empty without a refusal.
735
+ */
736
+ abstract fieldErrors(field?: string): readonly string[];
737
+ }
738
+
739
+ /**
740
+ * The slot of one entry: its state as the server answered it, saved through the administration API
741
+ * with the entry's version.
742
+ */
743
+ declare class NhAssistantAgentMetadataSlotRef extends NhAssistantAgentMetadataSlot {
744
+ readonly agentId: string;
745
+ private readonly admin;
746
+ private readonly changed;
747
+ private subscription?;
748
+ readonly entry: _angular_core.WritableSignal<AgentMetadata>;
749
+ readonly saving: _angular_core.WritableSignal<boolean>;
750
+ readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
751
+ readonly status: _angular_core.WritableSignal<NhAssistantAgentMetadataStatus | null>;
752
+ /** The lock of the entry's package link (part `metadata:{name}`); `null` without one. */
753
+ readonly lock: _angular_core.Signal<PackageLockView | null>;
754
+ readonly readOnly: _angular_core.Signal<boolean>;
755
+ constructor(agentId: string, entry: AgentMetadata, admin: NhAssistantAdminApiService, changed: (entry: AgentMetadata) => void);
756
+ save(value: unknown): void;
757
+ remove(): void;
758
+ fieldErrors(field?: string): readonly string[];
759
+ /** The agent's next version after another entry of an agent created here changed. */
760
+ followAgentVersion(agentVersion: number): void;
761
+ dispose(): void;
762
+ private run;
763
+ }
764
+ /** One slot as the frame shows it. */
765
+ interface NhAssistantAgentMetadataSlotView {
766
+ name: string;
767
+ label: string | null;
768
+ component: Type<unknown> | null;
769
+ slot: NhAssistantAgentMetadataSlotRef;
770
+ injector: Injector;
771
+ }
772
+ /**
773
+ * The application fields of an agent in the agent editor (MD3): one slot per entry of agent
774
+ * metadata the application registers with `AddAgentMetadata`, where the application's own editor,
775
+ * registered with `provideNhAssistantAgentMetadataEditors`, shows the value and saves it through
776
+ * `NhAssistantAgentMetadataSlot`. The frame names the entry, says where its value comes from, marks
777
+ * an entry of an agent in code that only code changes, and shows what a save did. A change of an
778
+ * agent created here is its next version: `agentVersionChanged` tells the agent editor. A new agent
779
+ * shows its entries once it is saved. An entry the agent's package locks is read-only for its editor,
780
+ * with the package's id and version and "Unlink".
781
+ */
782
+ declare class NhAssistantAgentMetadataComponent {
783
+ private readonly admin;
784
+ private readonly injector;
785
+ private readonly editors;
786
+ private subscription?;
787
+ /** The agent whose fields are shown; `null` for a new agent, which is saved first. */
788
+ readonly agent: _angular_core.InputSignal<AdminAgent | null>;
789
+ /** The run catalog's `agentMetadata`: the entries a new agent will have. */
790
+ readonly entries: _angular_core.InputSignal<readonly AgentMetadataEntry[]>;
791
+ /** The agent's version after a field of an agent created here changed. */
792
+ readonly agentVersionChanged: _angular_core.OutputEmitterRef<number>;
793
+ readonly id: string;
794
+ readonly loading: _angular_core.WritableSignal<boolean>;
795
+ readonly loadFailed: _angular_core.WritableSignal<boolean>;
796
+ readonly slots: _angular_core.WritableSignal<readonly NhAssistantAgentMetadataSlotView[]>;
797
+ readonly sourceKey: (entry: AgentMetadata) => string;
798
+ readonly errorKeys: typeof _nhAssistantErrorKeys;
799
+ constructor();
800
+ load(): void;
801
+ private slotOf;
802
+ /**
803
+ * A field of an agent created here made the agent's next version: the other fields and the agent
804
+ * editor continue on it. An override of an agent in code has a version of its own.
805
+ */
806
+ private onChanged;
807
+ private disposeSlots;
808
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAgentMetadataComponent, never>;
809
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentMetadataComponent, "nh-assistant-agent-metadata", never, { "agent": { "alias": "agent"; "required": false; "isSignal": true; }; "entries": { "alias": "entries"; "required": false; "isSignal": true; }; }, { "agentVersionChanged": "agentVersionChanged"; }, never, never, true, never>;
810
+ }
811
+
564
812
  /** Periods the evaluation offers, in days before now; the server allows at most 92. */
565
813
  type NhAssistantEvaluationPeriod = 7 | 30 | 90;
566
814
  /** One row of the cost comparison: a measure of the live agent next to the variant's. */
@@ -787,6 +1035,59 @@ declare class NhAssistantAgentRunHistoryComponent {
787
1035
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentRunHistoryComponent, "nh-assistant-agent-run-history", never, { "agentId": { "alias": "agentId"; "required": true; "isSignal": true; }; "subjectTypes": { "alias": "subjectTypes"; "required": false; "isSignal": true; }; }, { "openConversation": "openConversation"; }, never, never, true, never>;
788
1036
  }
789
1037
 
1038
+ /** One consultation as the section and the flow list it: in code or defined as data. */
1039
+ interface ConsultationRow {
1040
+ subjectType: string;
1041
+ origin: 'code' | 'data';
1042
+ description: string | null;
1043
+ /** The routes in effect: those code allows, or those of the data that still fit. */
1044
+ routes: NhAssistantConsultationRoute[];
1045
+ /** It generates the request tool now. */
1046
+ requests: boolean;
1047
+ /** MCP clients see its tools. */
1048
+ mcp: boolean;
1049
+ consultToolId: string;
1050
+ /** The agents whose tool selectors select its consult tool now. */
1051
+ askingAgents: string[];
1052
+ inEffect: boolean;
1053
+ /**
1054
+ * The consultation defined as data is switched off: it is not offered until an administrator switches
1055
+ * it on. Its routes and tools are then those it was saved with, which it offers once it is on.
1056
+ */
1057
+ off: boolean;
1058
+ problems: string[];
1059
+ /**
1060
+ * The tools the consulted agent is offered: the selection in code, or the one of the data that the
1061
+ * agent's own selectors still cover. `null` offers every tool of the agent; empty offers none.
1062
+ */
1063
+ toolSelectors: string[] | null;
1064
+ /** The consultation defined as data; `null` for one in code. */
1065
+ data: DataConsultation | null;
1066
+ code: CodeConsultation | null;
1067
+ }
1068
+ /**
1069
+ * Why administrators cannot add a consultation to the agent now, or `null` when they can:
1070
+ * `application` when the application does not let them define consultations, `agent` when the agent
1071
+ * is in code and not consultable as data, `needs-settings` while an agent created here has no run
1072
+ * settings, `limit` when it has as many as the ceiling allows, and `no-types` when every kind of
1073
+ * object it works on already has a consultation.
1074
+ */
1075
+ type ConsultationsClosed = 'application' | 'agent' | 'needs-settings' | 'limit' | 'no-types';
1076
+
1077
+ /** A part of a trigger's definition that a candidate changes. */
1078
+ type TriggerField = 'source' | 'event' | 'filters' | 'debounce' | 'cron' | 'time-zone' | 'subject-set' | 'message' | 'skill' | 'conflict';
1079
+ /**
1080
+ * One difference between the live version of a trigger and its candidate, with the values as stored:
1081
+ * a skill id, a conflict or a source the page names in the reader's language, `null` for none.
1082
+ */
1083
+ interface TriggerChange {
1084
+ field: TriggerField;
1085
+ live: string | null;
1086
+ candidate: string | null;
1087
+ }
1088
+ /** The short definition of a version in the history: what starts it and when. */
1089
+ declare function versionSummary(version: DataTriggerVersion): string;
1090
+
790
1091
  /**
791
1092
  * What an entry point of the flow opens: the run configuration opens its own forms; the agent editor,
792
1093
  * the technical account, the runs view and the MCP servers belong to the page that hosts it.
@@ -805,6 +1106,11 @@ type AgentFlowEntry = {
805
1106
  } | {
806
1107
  kind: 'edit-trigger';
807
1108
  triggerId: string;
1109
+ } | {
1110
+ kind: 'add-consultation';
1111
+ } | {
1112
+ kind: 'edit-consultation';
1113
+ subjectType: string;
808
1114
  } | {
809
1115
  kind: 'edit-agent';
810
1116
  } | {
@@ -815,6 +1121,12 @@ type AgentFlowEntry = {
815
1121
  kind: 'mcp-servers';
816
1122
  };
817
1123
 
1124
+ /** What a saved consultation form tells its host. */
1125
+ interface ConsultationFormSaved {
1126
+ consultation: DataConsultation;
1127
+ added: boolean;
1128
+ }
1129
+
818
1130
  /** What a saved skill form tells its host. */
819
1131
  interface SkillFormSaved {
820
1132
  skill: DataSkill;
@@ -823,10 +1135,10 @@ interface SkillFormSaved {
823
1135
  added: boolean;
824
1136
  }
825
1137
 
826
- type Form = 'setup' | 'settings' | 'skill' | 'trigger';
1138
+ type Form = 'setup' | 'settings' | 'skill' | 'trigger' | 'consultation';
827
1139
  /** A removal, promotion or discard that waits for its confirmation. */
828
1140
  interface Confirmation {
829
- action: 'remove-settings' | 'remove-skill' | 'remove-trigger' | 'promote' | 'discard';
1141
+ action: 'remove-settings' | 'remove-skill' | 'remove-trigger' | 'remove-consultation' | 'promote' | 'discard' | 'promote-trigger' | 'discard-trigger';
830
1142
  id: string;
831
1143
  }
832
1144
  /**
@@ -841,7 +1153,14 @@ interface Confirmation {
841
1153
  * they compare with the live version and promote or discard; they add data triggers on the
842
1154
  * application's events or on a schedule and put them live; a schedule without a subject set runs for
843
1155
  * the whole application, or for every division of an agent that works per division. New skills and
844
- * triggers start in shadow; `changed` tells the agents page to reload the agent's skill states.
1156
+ * triggers start in shadow; a change of a trigger applies at once or fires as a candidate in shadow next
1157
+ * to the live version, which they compare, promote or discard, and every trigger shows its history.
1158
+ * `changed` tells the agents page to reload the agent's skill states. Its
1159
+ * consultations (AC20) show what other assistants may consult it about: those in code read only, and
1160
+ * those defined as data, which administrators add, change and remove within the agent's ceiling in
1161
+ * code, each with the agents that ask it (`openAgent` opens the editor of one) and its problems, and
1162
+ * switch on or off (a new one may start off), followed by the switches that turn a route off for all of
1163
+ * its consultations.
845
1164
  */
846
1165
  declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
847
1166
  private readonly admin;
@@ -863,6 +1182,8 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
863
1182
  * `null` while unknown.
864
1183
  */
865
1184
  readonly servers: _angular_core.InputSignal<readonly McpServer[] | null>;
1185
+ /** Every agent of the administration, to name the agents that ask the agent's consultations. */
1186
+ readonly agents: _angular_core.InputSignal<readonly AdminAgent[]>;
866
1187
  /** A change of the run configuration changed the agent's skills or state. */
867
1188
  readonly changed: _angular_core.OutputEmitterRef<void>;
868
1189
  /** The flow asks to open the agent editor: what it works on, its tools, MCP servers and groups. */
@@ -873,6 +1194,8 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
873
1194
  readonly openRuns: _angular_core.OutputEmitterRef<void>;
874
1195
  /** The flow asks to open the MCP servers, whose background use decides what runs without a person use. */
875
1196
  readonly openMcpServers: _angular_core.OutputEmitterRef<void>;
1197
+ /** Opens the editor of an agent that asks one of the agent's consultations, by its id. */
1198
+ readonly openAgent: _angular_core.OutputEmitterRef<string>;
876
1199
  readonly id: string;
877
1200
  readonly maxReason: 500;
878
1201
  readonly skillNameKeys: typeof skillNameKeys;
@@ -910,6 +1233,10 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
910
1233
  readonly editingSkill: _angular_core.WritableSignal<DataSkill | null>;
911
1234
  /** The trigger being changed; `null` with the trigger form open adds a new trigger. */
912
1235
  readonly editingTrigger: _angular_core.WritableSignal<DataTrigger | null>;
1236
+ /** The consultation being changed; `null` with the consultation form open adds a new one. */
1237
+ readonly editingConsultation: _angular_core.WritableSignal<DataConsultation | null>;
1238
+ /** Counts the loads, so the route switches read the agent's routes again after a change. */
1239
+ readonly loads: _angular_core.WritableSignal<number>;
913
1240
  readonly comparison: _angular_core.WritableSignal<{
914
1241
  skillId: string;
915
1242
  result: SkillComparison | null;
@@ -920,6 +1247,18 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
920
1247
  items: DataSkillVersion[] | null;
921
1248
  failed: boolean;
922
1249
  } | null>;
1250
+ readonly triggerComparison: _angular_core.WritableSignal<{
1251
+ triggerId: string;
1252
+ result: TriggerComparison | null;
1253
+ failed: boolean;
1254
+ } | null>;
1255
+ readonly triggerVersions: _angular_core.WritableSignal<{
1256
+ triggerId: string;
1257
+ items: DataTriggerVersion[] | null;
1258
+ failed: boolean;
1259
+ } | null>;
1260
+ readonly triggerFieldKeys: Record<TriggerField, string>;
1261
+ readonly versionSummary: typeof versionSummary;
923
1262
  private readonly language;
924
1263
  readonly isAdminAgent: _angular_core.Signal<boolean>;
925
1264
  /** An agent created in the administration gets skills and triggers once it has run settings. */
@@ -928,10 +1267,26 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
928
1267
  readonly skillIds: _angular_core.Signal<string[]>;
929
1268
  readonly triggerIds: _angular_core.Signal<string[]>;
930
1269
  readonly problems: _angular_core.Signal<_newheap_platform_ai_chat.RunConfigurationProblem[]>;
1270
+ /** The consultations in code and as data, by subject type. */
1271
+ readonly consultationRows: _angular_core.Signal<ConsultationRow[]>;
1272
+ readonly showConsultations: _angular_core.Signal<boolean>;
1273
+ /** The ceiling within which administrators may define the agent's consultations; `null` for none. */
1274
+ readonly consultationCeiling: _angular_core.Signal<_newheap_platform_ai_chat.ConsultationCeiling | null>;
1275
+ /** Why administrators cannot add a consultation now, or `null` when they can. */
1276
+ readonly consultationsClosed: _angular_core.Signal<ConsultationsClosed | null>;
1277
+ /** The subject types the agent already has a consultation about. */
1278
+ readonly consultationTypes: _angular_core.Signal<string[]>;
1279
+ /** Whom the agent answers to, which decides whether a consultation may lend its rights. */
1280
+ readonly accountability: _angular_core.Signal<_newheap_platform_ai_chat.AgentAccountability | null>;
1281
+ readonly approvalPolicy: _angular_core.Signal<string | null>;
931
1282
  /** What the run settings' approval policy means, in a sentence. */
932
1283
  readonly settingsPolicy: _angular_core.Signal<string | null>;
933
1284
  constructor();
934
1285
  ngOnInit(): void;
1286
+ /** The lock a part's package link shows, for the lists and the forms. */
1287
+ readonly packageLockOf: typeof packageLockOf;
1288
+ /** Whether a part's package locks it, so it cannot be removed until it is unlinked. */
1289
+ readonly isPackageLocked: typeof isPackageLocked;
935
1290
  load(openSetup?: boolean): void;
936
1291
  openSetup(): void;
937
1292
  editSettings(): void;
@@ -946,14 +1301,41 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
946
1301
  /** Shows or hides the version history of a skill. */
947
1302
  toggleVersions(skill: DataSkill): void;
948
1303
  addTrigger(): void;
1304
+ /** What a trigger's candidate changes against its live version. */
1305
+ triggerChanges(trigger: DataTrigger): TriggerChange[];
1306
+ /** A value of a changed field as people read it: a skill's name, a conflict, a source, or none. */
1307
+ changeValue(change: TriggerChange, value: string | null): string;
1308
+ promoteTrigger(trigger: DataTrigger): void;
1309
+ discardTrigger(trigger: DataTrigger): void;
1310
+ /** Shows or hides the comparison of a trigger's candidate with its live version. */
1311
+ toggleTriggerComparison(trigger: DataTrigger): void;
1312
+ /** Shows or hides the version history of a trigger. */
1313
+ toggleTriggerVersions(trigger: DataTrigger): void;
949
1314
  editTrigger(trigger: DataTrigger): void;
950
1315
  setTriggerShadow(trigger: DataTrigger, shadow: boolean): void;
951
1316
  removeTrigger(trigger: DataTrigger): void;
1317
+ addConsultation(): void;
1318
+ editConsultation(consultation: DataConsultation): void;
1319
+ /** Switches a consultation defined as data on or off; off, asking agents get none of its tools. */
1320
+ setConsultationState(consultation: DataConsultation, on: boolean): void;
1321
+ removeConsultation(consultation: DataConsultation): void;
1322
+ onConsultationSaved(result: ConsultationFormSaved): void;
1323
+ /** The name of a subject type, as the run catalog names it in the reader's language. */
1324
+ typeName(subjectType: string): string;
1325
+ /** An agent's name: the translation of an agent in code, the administrator's text, or its id. */
1326
+ agentNameOf(agentId: string): string;
1327
+ /** Who may ask a consultation defined as data, in a sentence; `null` for one in code, whose code says it. */
1328
+ askSentence(row: ConsultationRow): string | null;
1329
+ /** What the consultation may do and who decides its proposals, by the routes in effect. */
1330
+ decideSentence(row: ConsultationRow): string;
952
1331
  /** A form saved: show what happened and reload, which every change may affect. */
953
1332
  onSetupCompleted(live: boolean): void;
954
1333
  onSettingsSaved(): void;
955
1334
  onSkillSaved(result: SkillFormSaved): void;
956
- onTriggerSaved(added: boolean): void;
1335
+ onTriggerSaved(result: {
1336
+ added: boolean;
1337
+ candidate: boolean;
1338
+ }): void;
957
1339
  confirm(action: Confirmation['action'], id: string): void;
958
1340
  isConfirming(action: Confirmation['action'], id: string): boolean;
959
1341
  /**
@@ -976,12 +1358,14 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
976
1358
  private finish;
977
1359
  /** Opens one form at a time and moves the focus into it. */
978
1360
  private open;
1361
+ /** One comparison or history is shown at a time. */
1362
+ private closeDetails;
979
1363
  /** Whether the last failed action concerned this item, so its error shows there. */
980
1364
  failed(target: string): boolean;
981
1365
  /** Runs a change and reloads the configuration, which every change may affect. */
982
1366
  private run;
983
1367
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAgentRunConfigurationComponent, never>;
984
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentRunConfigurationComponent, "nh-assistant-agent-run-configuration", never, { "agent": { "alias": "agent"; "required": true; "isSignal": true; }; "startSetup": { "alias": "startSetup"; "required": false; "isSignal": true; }; "tools": { "alias": "tools"; "required": false; "isSignal": true; }; "servers": { "alias": "servers"; "required": false; "isSignal": true; }; }, { "changed": "changed"; "editAgent": "editAgent"; "changeAccount": "changeAccount"; "openRuns": "openRuns"; "openMcpServers": "openMcpServers"; }, never, never, true, never>;
1368
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentRunConfigurationComponent, "nh-assistant-agent-run-configuration", never, { "agent": { "alias": "agent"; "required": true; "isSignal": true; }; "startSetup": { "alias": "startSetup"; "required": false; "isSignal": true; }; "tools": { "alias": "tools"; "required": false; "isSignal": true; }; "servers": { "alias": "servers"; "required": false; "isSignal": true; }; "agents": { "alias": "agents"; "required": false; "isSignal": true; }; }, { "changed": "changed"; "editAgent": "editAgent"; "changeAccount": "changeAccount"; "openRuns": "openRuns"; "openMcpServers": "openMcpServers"; "openAgent": "openAgent"; }, never, never, true, never>;
985
1369
  }
986
1370
 
987
1371
  /** Result of the latest connection test per server. */
@@ -1343,5 +1727,5 @@ declare class NhAssistantAdminMcpToolsComponent {
1343
1727
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAdminMcpToolsComponent, "nh-assistant-admin-mcp-tools", never, { "server": { "alias": "server"; "required": true; "isSignal": true; }; }, { "closed": "closed"; "synced": "synced"; }, never, never, true, never>;
1344
1728
  }
1345
1729
 
1346
- export { NH_ASSISTANT_MAX_INSTRUCTIONS, NhAssistantAdminAgentEditorComponent, NhAssistantAdminAgentsComponent, NhAssistantAdminComponent, NhAssistantAdminContextComponent, NhAssistantAdminMcpServerEditorComponent, NhAssistantAdminMcpServersComponent, NhAssistantAdminMcpToolsComponent, NhAssistantAgentEvaluationComponent, NhAssistantAgentFeedbackReportComponent, NhAssistantAgentRunConfigurationComponent, NhAssistantAgentRunHistoryComponent, nhAssistantSelectorMatches };
1347
- export type { AgentUse, NhAssistantAdminTab, NhAssistantEvaluationPeriod, NhAssistantFeedbackPeriod, NhAssistantReaderDraft, NhAssistantSecretAction, NhAssistantSecretSource, WorksOnScope };
1730
+ export { NH_ASSISTANT_AGENT_METADATA_EDITORS, NH_ASSISTANT_MAX_INSTRUCTIONS, NhAssistantAdminAgentEditorComponent, NhAssistantAdminAgentsComponent, NhAssistantAdminComponent, NhAssistantAdminContextComponent, NhAssistantAdminMcpServerEditorComponent, NhAssistantAdminMcpServersComponent, NhAssistantAdminMcpToolsComponent, NhAssistantAgentEvaluationComponent, NhAssistantAgentFeedbackReportComponent, NhAssistantAgentMetadataComponent, NhAssistantAgentMetadataSlot, NhAssistantAgentRunConfigurationComponent, NhAssistantAgentRunHistoryComponent, nhAssistantSelectorMatches, provideNhAssistantAgentMetadataEditors };
1731
+ export type { AgentUse, NhAssistantAdminTab, NhAssistantAgentMetadataEditor, NhAssistantAgentMetadataStatus, NhAssistantEvaluationPeriod, NhAssistantFeedbackPeriod, NhAssistantReaderDraft, NhAssistantSecretAction, NhAssistantSecretSource, WorksOnScope };