@newheap/platform-ai-chat 0.13.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.
package/admin/index.d.ts CHANGED
@@ -1,5 +1,8 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { NhAssistantStore, NhAssistantError, ApplicationContext, ApplicationContextVersion, AdminAgent, ToolCatalogEntry, McpServer, SetAgentStateRequest, AgentShadowMode, AgentSkillState, AgentShadowState, AssistantAutonomy, AgentEvaluation, AgentReplay, AgentEvaluationCost, AgentProposalFeedbackCategory, AgentFeedbackSummaryRow, AgentFeedbackItem, AgentFeedbackCategoryCount, StaleKind, AgentProposalFeedbackGroup, McpServerTestResult, McpAuthMode, McpToolEffect, McpTool } from '@newheap/platform-ai-chat';
2
+ import { OnInit } from '@angular/core';
3
+ import * as _newheap_platform_ai_chat from '@newheap/platform-ai-chat';
4
+ import { NhAssistantStore, NhAssistantError, ApplicationContext, ApplicationContextVersion, AdminAgent, ToolCatalogEntry, McpServer, RunCatalog, SetAgentStateRequest, AgentShadowMode, AgentSkillState, AgentShadowState, AssistantAutonomy, 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, McpToolEffect, McpTool } from '@newheap/platform-ai-chat';
5
+ import { ɵNhAssistantRunNowAgent as _NhAssistantRunNowAgent } from '@newheap/platform-ai-chat/agent-runs';
3
6
 
4
7
  type NhAssistantAdminTab = 'context' | 'agents' | 'mcp-servers';
5
8
  /**
@@ -9,6 +12,7 @@ type NhAssistantAdminTab = 'context' | 'agents' | 'mcp-servers';
9
12
  */
10
13
  declare class NhAssistantAdminComponent {
11
14
  private readonly host;
15
+ private readonly injector;
12
16
  readonly store: NhAssistantStore;
13
17
  /** Tab shown first. */
14
18
  readonly initialTab: _angular_core.InputSignal<NhAssistantAdminTab>;
@@ -19,12 +23,53 @@ declare class NhAssistantAdminComponent {
19
23
  constructor();
20
24
  selected(): NhAssistantAdminTab;
21
25
  select(tab: NhAssistantAdminTab): void;
26
+ /**
27
+ * Shows the MCP servers, for example from an agent's flow that explains why a server is not used in
28
+ * runs without a person, and moves the focus to their tab.
29
+ */
30
+ showMcpServers(): void;
22
31
  /** Arrow keys, Home and End move between tabs as the ARIA tabs pattern describes. */
23
32
  onTabKeydown(event: KeyboardEvent): void;
24
33
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAdminComponent, never>;
25
34
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAdminComponent, "nh-assistant-admin", never, { "initialTab": { "alias": "initialTab"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
26
35
  }
27
36
 
37
+ /**
38
+ * The names the application knows for account ids, for the screens of the administration
39
+ * (internal). A screen shows the name only; it shows the id, labeled as an account ID, only while
40
+ * no name is known. When the lookup fails, `error` says why with the failure's code and `retry` asks
41
+ * for the names that are still missing, so a failure never hides behind the ids. Create it in an
42
+ * injection context, such as a component's field.
43
+ */
44
+ declare class NhAssistantAccountNames {
45
+ private readonly admin;
46
+ private readonly translate;
47
+ private readonly subscriptions;
48
+ /** The ids whose names were asked for, also the ones the application does not know. */
49
+ private readonly asked;
50
+ /** The ids of failed lookups, which `retry` asks for again. */
51
+ private failed;
52
+ /** The names found so far, by account id. */
53
+ readonly names: _angular_core.WritableSignal<ReadonlyMap<string, string>>;
54
+ /** Why the latest lookup failed; `null` while none did. */
55
+ readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
56
+ constructor();
57
+ /**
58
+ * The name of an account for a sentence, or its id labeled as an account ID ("account ID …")
59
+ * while the application knows no name for it.
60
+ */
61
+ nameOf(actorId: string | null | undefined): string;
62
+ /**
63
+ * The account ID as a tooltip for a name shown in its place; `null` while no name is known,
64
+ * because the text shows the id then.
65
+ */
66
+ idTitleOf(actorId: string | null | undefined): string | null;
67
+ /** Looks up the names of the ids that were not asked for yet. */
68
+ load(actorIds: readonly (string | null | undefined)[]): void;
69
+ /** Asks again for the names whose lookup failed. */
70
+ retry(): void;
71
+ }
72
+
28
73
  /** Maximum length of the application context and of agent instructions. */
29
74
  declare const NH_ASSISTANT_MAX_INSTRUCTIONS = 20000;
30
75
  /**
@@ -50,45 +95,119 @@ declare class NhAssistantAdminContextComponent {
50
95
  readonly canSave: _angular_core.Signal<boolean>;
51
96
  readonly errorKeys: _angular_core.Signal<string[]>;
52
97
  readonly history: _angular_core.Signal<ApplicationContextVersion[]>;
98
+ /** The names of the people who changed the context, once known, and why they are not. */
99
+ readonly accountNames: NhAssistantAccountNames;
53
100
  constructor();
54
101
  /** Loads the latest version; with `keepDraft` the user's unsaved text stays in the editor. */
55
102
  load(keepDraft: boolean): void;
103
+ /** A person's name, or the id when the application does not know it. */
104
+ nameOf(actorId: string | null | undefined): string;
105
+ /** The account ID as the tooltip of a name shown in its place. */
106
+ accountTitle(actorId: string | null | undefined): string | null;
56
107
  onInput(event: Event): void;
57
108
  save(): void;
58
109
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAdminContextComponent, never>;
59
110
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAdminContextComponent, "nh-assistant-admin-context", never, {}, {}, never, never, true, never>;
60
111
  }
61
112
 
113
+ /**
114
+ * Translation keys for the texts the administration shows about agents, skills and policies. Each
115
+ * list goes through `nhAssistantTranslate` with the text itself as fallback, so a missing
116
+ * translation shows what the server sent.
117
+ */
118
+ /**
119
+ * The key of a text of an agent in code, which names and describes itself with translation keys;
120
+ * none for an agent created in the administration, whose texts are what the administrator typed.
121
+ */
122
+ declare function codeTextKeys(source: string, text: string | null | undefined): string[];
123
+ /** The key an application may translate a skill's name with. */
124
+ declare function skillNameKeys(agentId: string, skillId: string): string[];
125
+ /**
126
+ * The key an application may translate a skill's description with. Skills in code describe
127
+ * themselves in the language triage reads; the screen shows a translation when there is one.
128
+ */
129
+ declare function skillDescriptionKeys(agentId: string, skillId: string): string[];
130
+ /** The key an application may translate an authorization policy's name with. */
131
+ declare function policyKeys(policy: string | null | undefined): string[];
132
+ /** A readable name for a dash-case id: `task-follow-up` reads "Task follow up". */
133
+ declare function readableId(id: string): string;
134
+ /** What an agent works on, ready to show: object types by name, all objects and the application. */
135
+ interface WorksOnSummary {
136
+ /** The names of the object types it works on; empty with `all`. */
137
+ types: string[];
138
+ /** It works on every object type. */
139
+ all: boolean;
140
+ /** It works on the whole application. */
141
+ application: boolean;
142
+ perDivision: boolean;
143
+ /** An agent in code that does not say what it works on. */
144
+ undeclared: boolean;
145
+ /** The names of the object types it is known to work on, as a hint next to "All objects". */
146
+ known: string[];
147
+ runPolicy: string | null;
148
+ viewPolicy: string | null;
149
+ }
150
+
62
151
  type AgentStateAction = SetAgentStateRequest['state'];
63
152
  /**
64
153
  * Agent administration: code agents (override, reset) and agents created here (edit, delete),
65
154
  * and for every agent its run state with pause, stop and resume, its shadow mode and that of each
66
155
  * skill, and the technical account of an agent that answers to one, each with an optional reason.
67
156
  * Editing opens `nh-assistant-admin-agent-editor`; the feedback action opens
68
- * `nh-assistant-agent-feedback-report` for the agent, and the evaluation action of an agent with
69
- * shadow variants opens `nh-assistant-agent-evaluation`.
157
+ * `nh-assistant-agent-feedback-report` for the agent, the evaluation action of an agent with
158
+ * shadow variants opens `nh-assistant-agent-evaluation`, and the run configuration action opens
159
+ * `nh-assistant-agent-run-configuration` for the skills, triggers and run settings defined as data.
160
+ * "Run now" on an agent that runs on its own opens the run-now dialog: the whole application (or a
161
+ * division of it) or an object of one of its types, and an optional instruction; the receipt opens
162
+ * the agent's conversation in the assistant panel. "Runs" opens `nh-assistant-agent-run-history`, the
163
+ * agent's runs with their results. When the run catalog cannot be read, the page says why with its
164
+ * code and offers to read it again; until then it offers no "Run now" and the editor leaves what an
165
+ * agent works on and its groups as they are. The run configuration opens with the agent's flow, whose
166
+ * entry points open the editor, the runs and the technical account here and return to the run
167
+ * configuration afterwards; `openMcpServers` asks the host to show the MCP servers.
70
168
  */
71
169
  declare class NhAssistantAdminAgentsComponent {
72
170
  private readonly admin;
73
171
  private readonly store;
172
+ private readonly panel;
173
+ private readonly translate;
74
174
  private readonly injector;
75
175
  private readonly host;
76
176
  private readonly backButton;
77
177
  private readonly reasonInput;
78
178
  private subscription?;
79
179
  private actionSubscription?;
180
+ private catalogSubscription?;
80
181
  readonly id: string;
81
182
  readonly loading: _angular_core.WritableSignal<boolean>;
82
183
  readonly loadFailed: _angular_core.WritableSignal<boolean>;
83
184
  readonly agents: _angular_core.WritableSignal<AdminAgent[]>;
84
185
  readonly tools: _angular_core.WritableSignal<ToolCatalogEntry[]>;
85
186
  readonly servers: _angular_core.WritableSignal<McpServer[]>;
187
+ /** The run catalog: object types by name, policies and divisions; `null` when it could not be read. */
188
+ readonly catalog: _angular_core.WritableSignal<RunCatalog | null>;
189
+ /** Why the run catalog could not be read; `null` once it was. */
190
+ readonly catalogError: _angular_core.WritableSignal<NhAssistantError | null>;
191
+ readonly catalogErrorKeys: _angular_core.Signal<string[]>;
192
+ /** The run catalog is being read again after a failure. */
193
+ readonly catalogLoading: _angular_core.WritableSignal<boolean>;
86
194
  /** `undefined`: list; `null`: new agent; an agent: editing that agent. */
87
195
  readonly editing: _angular_core.WritableSignal<AdminAgent | null | undefined>;
88
196
  /** The agent whose feedback report is shown instead of the list. */
89
197
  readonly reporting: _angular_core.WritableSignal<AdminAgent | null>;
90
198
  /** The agent whose comparison with its shadow variants is shown instead of the list. */
91
199
  readonly evaluating: _angular_core.WritableSignal<AdminAgent | null>;
200
+ /** The agent whose run configuration is shown instead of the list. */
201
+ readonly configuring: _angular_core.WritableSignal<AdminAgent | null>;
202
+ /** The agent whose runs are shown instead of the list. */
203
+ readonly viewingRuns: _angular_core.WritableSignal<AdminAgent | null>;
204
+ /**
205
+ * The agent whose run configuration opened the editor or the runs from its flow; closing them
206
+ * returns to its run configuration instead of the list.
207
+ */
208
+ readonly returnTo: _angular_core.WritableSignal<string | null>;
209
+ /** The flow of a run configuration asks to show the MCP servers, whose background use it explains. */
210
+ readonly openMcpServers: _angular_core.OutputEmitterRef<void>;
92
211
  readonly confirming: _angular_core.WritableSignal<{
93
212
  agentId: string;
94
213
  action: "delete" | "reset";
@@ -112,12 +231,40 @@ declare class NhAssistantAdminAgentsComponent {
112
231
  mode: "set" | "code";
113
232
  } | null>;
114
233
  readonly accountId: _angular_core.WritableSignal<string>;
234
+ /** Why the account of the open account form was refused, shown at the account field. */
235
+ readonly accountError: _angular_core.WritableSignal<NhAssistantError | null>;
236
+ /** The text of the account field's error: the refused field value, then the code. */
237
+ readonly accountErrorKeys: _angular_core.Signal<string[]>;
238
+ /** Whether the application offers an account search for the technical account. */
239
+ readonly accountSearch: _angular_core.WritableSignal<boolean>;
240
+ /**
241
+ * The names of the technical accounts and of the people who changed an agent, once known, and why
242
+ * they are not.
243
+ */
244
+ readonly accountNameLookup: NhAssistantAccountNames;
245
+ /** The names of the technical accounts in the list, by account id. */
246
+ readonly accountNames: _angular_core.Signal<ReadonlyMap<string, string>>;
247
+ /** The agent whose last action failed, so its error shows on its card. */
248
+ readonly errorAgentId: _angular_core.WritableSignal<string | null>;
249
+ /** The agent the run-now dialog runs; `null` while it is closed. */
250
+ readonly runningNow: _angular_core.WritableSignal<AdminAgent | null>;
251
+ /** The agent of the run-now dialog as the dialog needs it: its name and what it works on. */
252
+ readonly runNowAgent: _angular_core.Signal<_NhAssistantRunNowAgent | null>;
253
+ /** The run configuration opens with the guided setup, for an agent created to work on its own. */
254
+ readonly setupOnOpen: _angular_core.WritableSignal<boolean>;
115
255
  readonly stateReason: _angular_core.WritableSignal<string>;
116
256
  readonly maxReason = 500;
117
257
  readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
118
258
  readonly errorKeys: _angular_core.Signal<string[]>;
259
+ readonly codeTextKeys: typeof codeTextKeys;
260
+ readonly skillNameKeys: typeof skillNameKeys;
261
+ readonly skillDescriptionKeys: typeof skillDescriptionKeys;
262
+ readonly policyKeys: typeof policyKeys;
263
+ readonly readableId: typeof readableId;
119
264
  constructor();
120
265
  load(): void;
266
+ /** Reads the run catalog again after it could not be read. */
267
+ retryCatalog(): void;
121
268
  create(): void;
122
269
  edit(agent: AdminAgent): void;
123
270
  /** Shows what people said when they rejected the agent's proposals. */
@@ -126,10 +273,60 @@ declare class NhAssistantAdminAgentsComponent {
126
273
  variantsOf(agent: AdminAgent): string[];
127
274
  /** Compares the agent with its shadow variants. */
128
275
  openEvaluation(agent: AdminAgent): void;
276
+ /**
277
+ * Whether the agent can run on its own and so has a run configuration: an agent in code with runs,
278
+ * or any agent created here, which gets run settings as data.
279
+ */
280
+ hasRunConfiguration(agent: AdminAgent): boolean;
281
+ /**
282
+ * Whether the agent can be run now: it runs on its own, so it has a run configuration, it is
283
+ * neither stopped nor disabled in code, and the run catalog names what it can run on. The server
284
+ * decides the rest when the run starts.
285
+ */
286
+ canRunNow(agent: AdminAgent): boolean;
287
+ /** Opens the run-now dialog of the agent. */
288
+ runNow(agent: AdminAgent): void;
289
+ /** Opens the conversation the run works in, in the assistant panel. */
290
+ openConversation(conversationId: string): void;
291
+ /** Shows the agent's skills, triggers and run settings defined as data. */
292
+ openRunConfiguration(agent: AdminAgent, setup?: boolean): void;
293
+ /** Returns to the list, refreshed, and to the run configuration action of the agent. */
294
+ closeRunConfiguration(): void;
295
+ /** Shows the agent's runs with their results. */
296
+ openRuns(agent: AdminAgent): void;
297
+ /**
298
+ * Returns to the run configuration whose flow opened the runs, or to the list and the runs action of
299
+ * the agent whose runs were open.
300
+ */
301
+ closeRuns(): void;
129
302
  /** Returns to the list and to the evaluation action of the agent whose comparison was open. */
130
303
  closeEvaluation(): void;
131
304
  /** Returns to the list and to the feedback action of the agent whose report was open. */
132
305
  closeReport(): void;
306
+ /** A new agent meant to work on its own continues in its run configuration's guided setup. */
307
+ onWorkRequested(agent: AdminAgent): void;
308
+ /** The flow of the agent's run configuration opens the editor; saving or cancelling returns there. */
309
+ editFromRunConfiguration(agent: AdminAgent): void;
310
+ /** The flow of the agent's run configuration opens its runs; going back returns there. */
311
+ runsFromRunConfiguration(agent: AdminAgent): void;
312
+ /** The flow of an agent in code opens the form that replaces its technical account on its card. */
313
+ accountFromRunConfiguration(agent: AdminAgent): void;
314
+ /** The editor saved: back to the run configuration that opened it, or to the list. */
315
+ onEditorSaved(agent: AdminAgent): void;
316
+ /** The editor closed without saving: back to the run configuration that opened it, or to the list. */
317
+ onEditorCancelled(): void;
318
+ /** Opens the run configuration again when its flow opened what closes now; `false` otherwise. */
319
+ private returnToRunConfiguration;
320
+ /** What the agent works on, with its object types named as the run catalog names them. */
321
+ worksOn(agent: AdminAgent): WorksOnSummary & {
322
+ only: 'all' | 'types' | 'application';
323
+ };
324
+ /** The groups the agent is in, named as the run catalog names them; `null` for none. */
325
+ groupNames(agent: AdminAgent): string | null;
326
+ /** The name of an account or person, or the id when the application does not know it. */
327
+ accountName(actorId: string | null | undefined): string;
328
+ /** The account ID as the tooltip of a name shown in its place. */
329
+ accountTitle(actorId: string | null | undefined): string | null;
133
330
  onSaved(agent: AdminAgent): void;
134
331
  /** The state changes the agent allows: none for an agent that is disabled in code. */
135
332
  stateActions(agent: AdminAgent): AgentStateAction[];
@@ -145,11 +342,26 @@ declare class NhAssistantAdminAgentsComponent {
145
342
  shadowActions(shadow: AgentShadowState | null | undefined): AgentShadowMode[];
146
343
  /** Opens the reason form of a shadow mode change of the agent or, with a skill, of that skill. */
147
344
  askShadow(agent: AdminAgent, mode: AgentShadowMode, skill?: AgentSkillState): void;
345
+ /**
346
+ * The label of a shadow action. An agent created here has no code: returning to its "code" mode
347
+ * means returning to the mode it was set up with.
348
+ */
349
+ shadowActionKey(agent: AdminAgent, mode: AgentShadowMode): string;
350
+ /** The explanation of a shadow change of the agent or one of its skills. */
351
+ shadowExplainKey(agent: AdminAgent, mode: AgentShadowMode, skill: boolean): string;
352
+ /** The mode the agent, or one of its skills, was set up with: what returning to it means. */
353
+ ownShadowModeKey(agent: AdminAgent, skillId?: string): string;
148
354
  isChangingShadow(agentId: string, mode: AgentShadowMode, skillId?: string): boolean;
149
355
  applyShadow(agent: AdminAgent): void;
150
356
  /** Opens the form that changes the technical account, or returns to the one in code. */
151
357
  askAccount(agent: AdminAgent, mode: 'set' | 'code'): void;
358
+ /** A changed account clears the error of the one before. */
359
+ onAccountChange(actorId: string): void;
152
360
  isChangingAccount(agentId: string, mode: 'set' | 'code'): boolean;
361
+ /**
362
+ * Changes the technical account. The form stays open while the server decides, so a missing or
363
+ * refused account shows at the account field, which takes the focus.
364
+ */
153
365
  applyAccount(agent: AdminAgent): void;
154
366
  isChangingState(agentId: string, state: AgentStateAction, skillId?: string): boolean;
155
367
  applyState(agent: AdminAgent): void;
@@ -159,30 +371,67 @@ declare class NhAssistantAdminAgentsComponent {
159
371
  reset(agent: AdminAgent): void;
160
372
  remove(agent: AdminAgent): void;
161
373
  private run;
374
+ /** Looks up the names of the technical accounts and of the people who changed an agent's state. */
375
+ private loadAccountNames;
376
+ /** The run catalog, or why it could not be read; it never errors. */
377
+ private readCatalog;
378
+ private applyCatalog;
379
+ private focusAccount;
162
380
  /** Closes the open confirmation and change forms before another opens; one is open at a time. */
163
381
  private closeForms;
164
382
  private replace;
383
+ /**
384
+ * Reloads the agents behind the visible list, for example their skills after the run
385
+ * configuration changed; the list stays as it is when that fails.
386
+ */
387
+ private refreshAgents;
165
388
  /** Agent changes affect the agent picker of the panel. */
166
389
  private refreshChat;
167
390
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAdminAgentsComponent, never>;
168
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAdminAgentsComponent, "nh-assistant-admin-agents", never, {}, {}, never, never, true, never>;
391
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAdminAgentsComponent, "nh-assistant-admin-agents", never, {}, { "openMcpServers": "openMcpServers"; }, never, never, true, never>;
169
392
  }
170
393
 
171
394
  /** True when a tool id matches a selector glob (`*` matches any characters). */
172
395
  declare function nhAssistantSelectorMatches(toolId: string, selector: string): boolean;
396
+ /** How an agent created in the administration is used: chosen in the chat, working on its own, or both. */
397
+ type AgentUse = 'chat' | 'background' | 'both';
398
+ /** Whether an agent created in the administration works on every object type or on chosen ones. */
399
+ type WorksOnScope = 'all' | 'types';
173
400
  /**
174
- * Creates or edits one agent: texts, autonomy, policy, tool selectors chosen from the tool
175
- * catalog or typed as patterns, and assigned MCP servers.
401
+ * Creates or edits one agent: how it is used (offered in the chat, working on its own, or both),
402
+ * what it works on (all objects or chosen object types, the whole application, per division when
403
+ * the application lists divisions, and who may run it and see its results for the whole
404
+ * application), texts, autonomy, policy, tool selectors chosen from the tool catalog or typed as
405
+ * patterns, and assigned MCP servers. A new agent meant to work on its own continues with
406
+ * `workRequested`. An agent in code names and describes itself with translation keys: the editor
407
+ * shows their translation and sends the key back unless the administrator changed the text, so the
408
+ * agent stays translated; what it works on comes from its code and is not edited here.
176
409
  */
177
410
  declare class NhAssistantAdminAgentEditorComponent {
178
411
  private readonly admin;
412
+ private readonly translate;
179
413
  private subscription?;
414
+ private keyedName;
415
+ private keyedDescription;
180
416
  /** The agent to edit, or null for a new agent. */
181
417
  readonly agent: _angular_core.InputSignal<AdminAgent | null>;
182
418
  readonly tools: _angular_core.InputSignal<readonly ToolCatalogEntry[]>;
183
419
  readonly servers: _angular_core.InputSignal<readonly McpServer[]>;
420
+ /** The run catalog: the object types by name, the policies to choose and whether divisions are listed. */
421
+ readonly catalog: _angular_core.InputSignal<RunCatalog | null>;
422
+ /**
423
+ * The run catalog could not be read: the editor then leaves out what the agent works on and its
424
+ * groups, which depend on it, and a save keeps them as they are.
425
+ */
426
+ readonly catalogUnavailable: _angular_core.InputSignal<boolean>;
184
427
  readonly saved: _angular_core.OutputEmitterRef<AdminAgent>;
428
+ /**
429
+ * A new agent meant to work on its own was created; the host continues with its run
430
+ * configuration's guided setup. `saved` is not emitted for it.
431
+ */
432
+ readonly workRequested: _angular_core.OutputEmitterRef<AdminAgent>;
185
433
  readonly cancelled: _angular_core.OutputEmitterRef<void>;
434
+ readonly uses: readonly AgentUse[];
186
435
  readonly id: string;
187
436
  readonly max = 20000;
188
437
  readonly autonomyLevels: readonly AssistantAutonomy[];
@@ -191,19 +440,68 @@ declare class NhAssistantAdminAgentEditorComponent {
191
440
  readonly description: _angular_core.WritableSignal<string>;
192
441
  readonly instructions: _angular_core.WritableSignal<string>;
193
442
  readonly autonomy: _angular_core.WritableSignal<AssistantAutonomy>;
443
+ /** How the agent is used: in the chat, on its own, or both. */
444
+ readonly use: _angular_core.WritableSignal<AgentUse>;
194
445
  readonly requiredPolicy: _angular_core.WritableSignal<string>;
195
446
  readonly toolSelectors: _angular_core.WritableSignal<string[]>;
196
447
  readonly mcpServerIds: _angular_core.WritableSignal<string[]>;
448
+ /** What the agent works on: all objects or the chosen object types. */
449
+ readonly worksOnScope: _angular_core.WritableSignal<WorksOnScope>;
450
+ readonly worksOnTypes: _angular_core.WritableSignal<string[]>;
451
+ readonly worksOnApplication: _angular_core.WritableSignal<boolean>;
452
+ readonly perDivision: _angular_core.WritableSignal<boolean>;
453
+ readonly runPolicy: _angular_core.WritableSignal<string>;
454
+ readonly viewPolicy: _angular_core.WritableSignal<string>;
455
+ /** The groups of agents the agent is in, by id. */
456
+ readonly groups: _angular_core.WritableSignal<string[]>;
197
457
  readonly newSelector: _angular_core.WritableSignal<string>;
198
458
  readonly catalogFilter: _angular_core.WritableSignal<string>;
199
459
  readonly submitted: _angular_core.WritableSignal<boolean>;
200
460
  readonly saving: _angular_core.WritableSignal<boolean>;
201
461
  readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
462
+ /**
463
+ * A new agent that was created while its groups could not be saved yet: the next save completes it
464
+ * as an existing agent.
465
+ */
466
+ private readonly created;
467
+ /** The agent the next save updates; `null` while a new agent is not created yet. */
468
+ private readonly editing;
202
469
  readonly isNew: _angular_core.Signal<boolean>;
470
+ /** Only agents created here choose whether they are offered in the chat; code decides for the others. */
471
+ readonly choosesUse: _angular_core.Signal<boolean>;
203
472
  readonly idInvalid: _angular_core.Signal<boolean>;
204
473
  readonly nameMissing: _angular_core.Signal<boolean>;
205
474
  readonly tooLong: _angular_core.Signal<boolean>;
206
475
  readonly selectorInvalid: _angular_core.Signal<boolean>;
476
+ /**
477
+ * The application's own object types, by name; the platform's types, such as the whole
478
+ * application, are chosen otherwise. A stored type the application no longer registers stays
479
+ * listed by its id, so it can be unticked.
480
+ */
481
+ readonly subjectTypes: _angular_core.Signal<{
482
+ id: string;
483
+ name: string;
484
+ pluralName: string | null;
485
+ }[]>;
486
+ readonly agentPolicies: _angular_core.Signal<_newheap_platform_ai_chat.RunBlock[]>;
487
+ /** The groups of agents the application registers, which boards show. */
488
+ readonly agentGroups: _angular_core.Signal<_newheap_platform_ai_chat.AgentGroup[]>;
489
+ /** The groups the agent joins in code. */
490
+ readonly codeGroups: _angular_core.Signal<string[]>;
491
+ /** A shadow variant works for administrators only and joins no group. */
492
+ readonly isVariant: _angular_core.Signal<boolean>;
493
+ /** The server's refusal of the groups, as a translation key. */
494
+ readonly groupsError: _angular_core.Signal<string | null>;
495
+ /** Per division is offered only when the application lists its divisions. */
496
+ readonly divisionsListed: _angular_core.Signal<boolean>;
497
+ /** The object types the agent is known to work on, by name, as a hint next to "All objects". */
498
+ readonly knownTypes: _angular_core.Signal<string[]>;
499
+ /** What the agent works on is edited here: an agent created here, while the run catalog is known. */
500
+ readonly editsWorksOn: _angular_core.Signal<boolean>;
501
+ /** Chosen object types without a type, and not the application either: the agent would work on nothing. */
502
+ readonly worksOnMissing: _angular_core.Signal<boolean>;
503
+ readonly tooManyTypes: _angular_core.Signal<boolean>;
504
+ readonly policyKeys: typeof policyKeys;
207
505
  readonly valid: _angular_core.Signal<boolean>;
208
506
  readonly errorKeys: _angular_core.Signal<string[]>;
209
507
  readonly filteredTools: _angular_core.Signal<ToolCatalogEntry[]>;
@@ -215,13 +513,21 @@ declare class NhAssistantAdminAgentEditorComponent {
215
513
  addSelector(): void;
216
514
  onSelectorKeydown(event: KeyboardEvent): void;
217
515
  removeSelector(selector: string): void;
516
+ toggleWorksOnType(typeId: string, checked: boolean): void;
517
+ toggleGroup(groupId: string, checked: boolean): void;
218
518
  toggleServer(serverId: string, checked: boolean): void;
219
519
  value(event: Event): string;
220
520
  checked(event: Event): boolean;
521
+ /** The first error the server reported for a field, as a translation key. */
522
+ fieldError(field: string): string | null;
221
523
  save(): void;
524
+ /** What the agent works on, as the six fields the server reads together. */
525
+ private worksOnInput;
222
526
  private reset;
527
+ /** The translation of a key of an agent in code, or `null` when the text is not a key with a translation. */
528
+ private keyed;
223
529
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAdminAgentEditorComponent, never>;
224
- 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; }; }, { "saved": "saved"; "cancelled": "cancelled"; }, never, never, true, never>;
530
+ 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>;
225
531
  }
226
532
 
227
533
  /** Periods the evaluation offers, in days before now; the server allows at most 92. */
@@ -370,17 +676,294 @@ declare class NhAssistantAgentFeedbackReportComponent {
370
676
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentFeedbackReportComponent, "nh-assistant-agent-feedback-report", never, { "agentId": { "alias": "agentId"; "required": true; "isSignal": true; }; "itemsPerPage": { "alias": "itemsPerPage"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
371
677
  }
372
678
 
679
+ /** A filter value as the form holds it: the empty string means "any". */
680
+ interface RunHistoryForm {
681
+ subjectType: string;
682
+ subjectId: string;
683
+ status: AgentRunStatus | '';
684
+ from: string;
685
+ to: string;
686
+ }
687
+ /**
688
+ * The runs view of one agent for administrators (`GET admin/agents/{id}/runs`): every run of the
689
+ * agent, shadow runs marked, newest first, filtered by the kind of object, one object, the whole
690
+ * application, the status and the period. Per run its time, trigger, object, the beginning of its
691
+ * result, its proposals, usage and duration; "Show the result" opens the run's whole result, its
692
+ * proposals and its files in `nh-assistant-run-result`. The administration's agent cards open it with
693
+ * "Runs". A filter the server refuses (`assistant-run-filter-invalid`) shows each refused part at its
694
+ * field, and a run's failure reads as its translated code.
695
+ */
696
+ declare class NhAssistantAgentRunHistoryComponent {
697
+ private readonly admin;
698
+ private readonly injector;
699
+ private readonly host;
700
+ private subscription?;
701
+ /** The agent whose runs are shown. */
702
+ readonly agentId: _angular_core.InputSignal<string>;
703
+ /** The kinds of objects of the application, from the run catalog, to filter by. */
704
+ readonly subjectTypes: _angular_core.InputSignal<readonly AgentSubjectType[]>;
705
+ /** Emits the conversation of a run, so the host can open it in the assistant panel. */
706
+ readonly openConversation: _angular_core.OutputEmitterRef<string>;
707
+ readonly id: string;
708
+ readonly statuses: readonly AgentRunStatus[];
709
+ readonly systemType = "nh-system";
710
+ /** The kinds of objects, the whole application left out: it has an option of its own. */
711
+ readonly objectTypes: _angular_core.Signal<AgentSubjectType[]>;
712
+ readonly form: _angular_core.WritableSignal<RunHistoryForm>;
713
+ /** The period ends before it starts. */
714
+ readonly periodInvalid: _angular_core.WritableSignal<boolean>;
715
+ /** One object can be chosen once a kind of object is. */
716
+ readonly objectChoosable: _angular_core.Signal<boolean>;
717
+ readonly loading: _angular_core.WritableSignal<boolean>;
718
+ readonly loadingMore: _angular_core.WritableSignal<boolean>;
719
+ readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
720
+ readonly errorKeys: _angular_core.Signal<string[]>;
721
+ /** The refused filter fields the form shows, with the server's first value per field. */
722
+ readonly fieldErrors: _angular_core.Signal<Partial<Record<string, string>>>;
723
+ readonly codeKeys: typeof _nhAssistantCodeKeys;
724
+ readonly items: _angular_core.WritableSignal<AgentRunHistoryItem[]>;
725
+ readonly total: _angular_core.WritableSignal<number>;
726
+ readonly page: _angular_core.WritableSignal<number>;
727
+ readonly hasMore: _angular_core.Signal<boolean>;
728
+ /** The run whose whole result is shown instead of the list. */
729
+ readonly opened: _angular_core.WritableSignal<AgentRunHistoryItem | null>;
730
+ private applied;
731
+ constructor();
732
+ /** The text of the server's error of a filter field; a refused end of the period reads as such. */
733
+ fieldErrorKeys(field: string): string[];
734
+ /** The ids a filter field describes itself with: its hint and its error while there is one. */
735
+ describedBy(hintId: string | null, field: string): string | null;
736
+ update(field: keyof RunHistoryForm, event: Event): void;
737
+ /** Reads the runs that match the form, from the first page. */
738
+ apply(): void;
739
+ /** Clears the filters and reads every run again. */
740
+ clear(): void;
741
+ /** Narrows the view to the runs on the object of one run. */
742
+ onlyObject(run: AgentRunHistoryItem): void;
743
+ loadMore(): void;
744
+ open(run: AgentRunHistoryItem): void;
745
+ /** Returns to the list and to the result action of the run that was open. */
746
+ close(): void;
747
+ /** How long the run took, as a text key and its number; `null` while it runs. */
748
+ durationOf(run: AgentRunHistoryItem): {
749
+ key: string;
750
+ value: number;
751
+ } | null;
752
+ /** Moves the focus to the first filter field the server refused. */
753
+ private focusRefusedField;
754
+ private fetch;
755
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAgentRunHistoryComponent, never>;
756
+ 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>;
757
+ }
758
+
759
+ /**
760
+ * What an entry point of the flow opens: the run configuration opens its own forms; the agent editor,
761
+ * the technical account, the runs view and the MCP servers belong to the page that hosts it.
762
+ */
763
+ type AgentFlowEntry = {
764
+ kind: 'setup';
765
+ } | {
766
+ kind: 'settings';
767
+ } | {
768
+ kind: 'add-skill';
769
+ } | {
770
+ kind: 'edit-skill';
771
+ skillId: string;
772
+ } | {
773
+ kind: 'add-trigger';
774
+ } | {
775
+ kind: 'edit-trigger';
776
+ triggerId: string;
777
+ } | {
778
+ kind: 'edit-agent';
779
+ } | {
780
+ kind: 'account';
781
+ } | {
782
+ kind: 'runs';
783
+ } | {
784
+ kind: 'mcp-servers';
785
+ };
786
+
787
+ /** What a saved skill form tells its host. */
788
+ interface SkillFormSaved {
789
+ skill: DataSkill;
790
+ /** The change runs as the skill's candidate in shadow. */
791
+ candidate: boolean;
792
+ added: boolean;
793
+ }
794
+
795
+ type Form = 'setup' | 'settings' | 'skill' | 'trigger';
796
+ /** A removal, promotion or discard that waits for its confirmation. */
797
+ interface Confirmation {
798
+ action: 'remove-settings' | 'remove-skill' | 'remove-trigger' | 'promote' | 'discard';
799
+ id: string;
800
+ }
801
+ /**
802
+ * The run configuration of one agent as data: the run settings of an agent created in the
803
+ * administration, its skills and triggers in code (read only) and as data, and the data that no
804
+ * longer fits the code. It opens with the agent's flow: what it works on, when it runs, how it works,
805
+ * whom it answers to, who approves and its results, each step with its problems and an entry point
806
+ * to the form below that changes it; the agent editor (`editAgent`), the technical account of an
807
+ * agent in code (`changeAccount`), the runs view (`openRuns`) and the MCP servers (`openMcpServers`)
808
+ * belong to the page that hosts it. An agent created here that only chats gets a guided setup that
809
+ * lets it work on its own. Administrators add and change data skills, live at once or as a candidate in shadow that
810
+ * they compare with the live version and promote or discard; they add data triggers on the
811
+ * application's events or on a schedule and put them live; a schedule without a subject set runs for
812
+ * the whole application, or for every division of an agent that works per division. New skills and
813
+ * triggers start in shadow; `changed` tells the agents page to reload the agent's skill states.
814
+ */
815
+ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
816
+ private readonly admin;
817
+ private readonly translate;
818
+ private readonly injector;
819
+ private readonly host;
820
+ private loadSubscription?;
821
+ private actionSubscription?;
822
+ private detailSubscription?;
823
+ /** The flow's entry point that opened the form, which takes the focus back when the form closes. */
824
+ private returnFocus;
825
+ readonly agent: _angular_core.InputSignal<AdminAgent>;
826
+ /** Opens the guided setup at once, for an agent that was just created to work on its own. */
827
+ readonly startSetup: _angular_core.InputSignal<boolean>;
828
+ /** The tool catalog, to show what the agent's tool selectors offer in the skill forms and the flow. */
829
+ readonly tools: _angular_core.InputSignal<readonly ToolCatalogEntry[]>;
830
+ /**
831
+ * The MCP servers, so the flow shows whether the agent's servers are used in runs without a person;
832
+ * `null` while unknown.
833
+ */
834
+ readonly servers: _angular_core.InputSignal<readonly McpServer[] | null>;
835
+ /** A change of the run configuration changed the agent's skills or state. */
836
+ readonly changed: _angular_core.OutputEmitterRef<void>;
837
+ /** The flow asks to open the agent editor: what it works on, its tools, MCP servers and groups. */
838
+ readonly editAgent: _angular_core.OutputEmitterRef<void>;
839
+ /** The flow asks to change the technical account of an agent in code. */
840
+ readonly changeAccount: _angular_core.OutputEmitterRef<void>;
841
+ /** The flow asks to open the agent's runs. */
842
+ readonly openRuns: _angular_core.OutputEmitterRef<void>;
843
+ /** The flow asks to open the MCP servers, whose background use decides what runs without a person use. */
844
+ readonly openMcpServers: _angular_core.OutputEmitterRef<void>;
845
+ readonly id: string;
846
+ readonly maxReason: 500;
847
+ readonly skillNameKeys: typeof skillNameKeys;
848
+ readonly skillDescriptionKeys: typeof skillDescriptionKeys;
849
+ readonly readableId: typeof readableId;
850
+ readonly loading: _angular_core.WritableSignal<boolean>;
851
+ readonly loadFailed: _angular_core.WritableSignal<boolean>;
852
+ readonly busy: _angular_core.WritableSignal<boolean>;
853
+ readonly catalog: _angular_core.WritableSignal<RunCatalog | null>;
854
+ readonly configuration: _angular_core.WritableSignal<AgentRunConfiguration | null>;
855
+ readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
856
+ readonly errorKeys: _angular_core.Signal<string[]>;
857
+ readonly saved: _angular_core.WritableSignal<string | null>;
858
+ readonly form: _angular_core.WritableSignal<Form | null>;
859
+ readonly confirming: _angular_core.WritableSignal<Confirmation | null>;
860
+ readonly reason: _angular_core.WritableSignal<string>;
861
+ /** The item whose action failed, so its error shows next to it: `settings`, `skill:{id}` or `trigger:{id}`. */
862
+ readonly actionTarget: _angular_core.WritableSignal<string | null>;
863
+ /**
864
+ * The names of the account the agent answers to and of the people who changed skills, once known,
865
+ * and why they are not.
866
+ */
867
+ readonly accountNames: NhAssistantAccountNames;
868
+ /**
869
+ * The name of the account the agent answers to, once known: the technical account of its run
870
+ * settings, or of an agent in code.
871
+ */
872
+ readonly accountName: _angular_core.Signal<string | null>;
873
+ /** The agent's name; an agent in code names itself with a translation key. */
874
+ readonly agentName: _angular_core.Signal<string>;
875
+ /** The skill being changed; `null` with the skill form open adds a new skill. */
876
+ readonly editingSkill: _angular_core.WritableSignal<DataSkill | null>;
877
+ /** The trigger being changed; `null` with the trigger form open adds a new trigger. */
878
+ readonly editingTrigger: _angular_core.WritableSignal<DataTrigger | null>;
879
+ readonly comparison: _angular_core.WritableSignal<{
880
+ skillId: string;
881
+ result: SkillComparison | null;
882
+ failed: boolean;
883
+ } | null>;
884
+ readonly versions: _angular_core.WritableSignal<{
885
+ skillId: string;
886
+ items: DataSkillVersion[] | null;
887
+ failed: boolean;
888
+ } | null>;
889
+ private readonly language;
890
+ readonly isAdminAgent: _angular_core.Signal<boolean>;
891
+ /** An agent created in the administration gets skills and triggers once it has run settings. */
892
+ readonly canAddRunData: _angular_core.Signal<boolean>;
893
+ readonly skillOptions: _angular_core.Signal<_NhAssistantPickerOption[]>;
894
+ readonly skillIds: _angular_core.Signal<string[]>;
895
+ readonly triggerIds: _angular_core.Signal<string[]>;
896
+ readonly problems: _angular_core.Signal<_newheap_platform_ai_chat.RunConfigurationProblem[]>;
897
+ /** What the run settings' approval policy means, in a sentence. */
898
+ readonly settingsPolicy: _angular_core.Signal<string | null>;
899
+ constructor();
900
+ ngOnInit(): void;
901
+ load(openSetup?: boolean): void;
902
+ openSetup(): void;
903
+ editSettings(): void;
904
+ removeSettings(): void;
905
+ addSkill(): void;
906
+ editSkill(skill: DataSkill): void;
907
+ removeSkill(skill: DataSkill): void;
908
+ promote(skill: DataSkill): void;
909
+ discard(skill: DataSkill): void;
910
+ /** Shows or hides the comparison of a skill's candidate with its live version. */
911
+ toggleComparison(skill: DataSkill): void;
912
+ /** Shows or hides the version history of a skill. */
913
+ toggleVersions(skill: DataSkill): void;
914
+ addTrigger(): void;
915
+ editTrigger(trigger: DataTrigger): void;
916
+ setTriggerShadow(trigger: DataTrigger, shadow: boolean): void;
917
+ removeTrigger(trigger: DataTrigger): void;
918
+ /** A form saved: show what happened and reload, which every change may affect. */
919
+ onSetupCompleted(live: boolean): void;
920
+ onSettingsSaved(): void;
921
+ onSkillSaved(result: SkillFormSaved): void;
922
+ onTriggerSaved(added: boolean): void;
923
+ confirm(action: Confirmation['action'], id: string): void;
924
+ isConfirming(action: Confirmation['action'], id: string): boolean;
925
+ /**
926
+ * An entry point of the flow: the forms of the run configuration open below with the focus in them;
927
+ * the editor, the account, the runs and the MCP servers belong to the host.
928
+ */
929
+ onFlowEntry(entry: AgentFlowEntry): void;
930
+ cancel(): void;
931
+ value(event: Event): string;
932
+ /** A skill's name: the application's translation, or a readable form of its id. */
933
+ skillName(skillId: string | null | undefined): string;
934
+ /** A person's name, or the id when the application does not know it. */
935
+ nameOf(actorId: string | null | undefined): string;
936
+ /** The account ID as the tooltip of a name shown in its place. */
937
+ accountTitle(actorId: string | null | undefined): string | null;
938
+ /** The first of the keys with a translation, or the fallback. */
939
+ private translated;
940
+ /** Opens a form for the flow and remembers the entry point that opened it. */
941
+ private openFromFlow;
942
+ private finish;
943
+ /** Opens one form at a time and moves the focus into it. */
944
+ private open;
945
+ /** Whether the last failed action concerned this item, so its error shows there. */
946
+ failed(target: string): boolean;
947
+ /** Runs a change and reloads the configuration, which every change may affect. */
948
+ private run;
949
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAgentRunConfigurationComponent, never>;
950
+ 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>;
951
+ }
952
+
373
953
  /** Result of the latest connection test per server. */
374
954
  interface TestState {
375
955
  running: boolean;
376
956
  result: McpServerTestResult | null;
377
957
  }
378
958
  /**
379
- * MCP server administration: list, connection test, tool sync, the server editor and the
380
- * tool table of one server.
959
+ * MCP server administration: list, connection test, tool sync, the organization's OAuth connection,
960
+ * the server editor and the tool table of one server. The personal connections are counted and
961
+ * revoked only for servers each person connects to with OAuth; a count that could not be read shows
962
+ * its translated code at the server.
381
963
  */
382
964
  declare class NhAssistantAdminMcpServersComponent {
383
965
  private readonly admin;
966
+ private readonly connector;
384
967
  private subscription?;
385
968
  private readonly actions;
386
969
  readonly id: string;
@@ -392,6 +975,19 @@ declare class NhAssistantAdminMcpServersComponent {
392
975
  readonly toolsOf: _angular_core.WritableSignal<McpServer | null>;
393
976
  readonly tests: _angular_core.WritableSignal<Record<string, TestState>>;
394
977
  readonly confirmingDelete: _angular_core.WritableSignal<string | null>;
978
+ /** The server whose organization connection is being authorized. */
979
+ readonly connecting: _angular_core.WritableSignal<string | null>;
980
+ readonly confirmingDisconnect: _angular_core.WritableSignal<string | null>;
981
+ readonly confirmingRevokeAll: _angular_core.WritableSignal<string | null>;
982
+ /** The personal connections per status of each server people connect to themselves. */
983
+ readonly summaries: _angular_core.WritableSignal<Record<string, McpConnectionsSummary>>;
984
+ /** Why the personal connections of a server could not be counted, per server. */
985
+ readonly summaryErrors: _angular_core.WritableSignal<Record<string, NhAssistantError>>;
986
+ /** The latest connection result to announce, per server. */
987
+ readonly notice: _angular_core.WritableSignal<{
988
+ serverId: string;
989
+ key: string;
990
+ } | null>;
395
991
  readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
396
992
  readonly errorKeys: _angular_core.Signal<string[]>;
397
993
  constructor();
@@ -404,6 +1000,27 @@ declare class NhAssistantAdminMcpServersComponent {
404
1000
  test(server: McpServer): void;
405
1001
  testState(serverId: string): TestState | null;
406
1002
  testErrorKeys(code: string | null): string[];
1003
+ /** The text of a server's failed count of personal connections. */
1004
+ summaryErrorKeys(serverId: string): string[];
1005
+ /** Whether an administrator connects the organization's account to the server. */
1006
+ authorizesOrganization(server: McpServer): boolean;
1007
+ /** Whether each person connects their own account to the server. */
1008
+ connectsPeople(server: McpServer): boolean;
1009
+ summary(server: McpServer): McpConnectionsSummary | null;
1010
+ /** Revokes every person's connection of the server; each person connects again. */
1011
+ revokeAll(server: McpServer): void;
1012
+ /** Counts the personal connections of the servers each person connects to with OAuth; only those have them. */
1013
+ private loadSummaries;
1014
+ /** Counts the personal connections of one server again. */
1015
+ retrySummary(server: McpServer): void;
1016
+ /**
1017
+ * Authorizes the organization's account, or for a server people connect to themselves the
1018
+ * administrator's own account, in a window opened right away, so popup blockers allow it, and
1019
+ * completes the connection with this administrator's session.
1020
+ */
1021
+ connect(server: McpServer): void;
1022
+ /** Removes the organization connection; the server revokes its tokens. */
1023
+ disconnect(server: McpServer): void;
407
1024
  remove(server: McpServer): void;
408
1025
  private setTest;
409
1026
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAdminMcpServersComponent, never>;
@@ -412,19 +1029,57 @@ declare class NhAssistantAdminMcpServersComponent {
412
1029
 
413
1030
  /**
414
1031
  * What happens to the stored secret on save. `keep` omits `secret`, `replace` sends the
415
- * new value and `clear` sends `""`. The stored value is never shown.
1032
+ * new value and `clear` sends `""`. The stored value is never shown. The editor offers no `clear`:
1033
+ * the API refuses a mode with a secret that has none, so a stored secret goes by choosing a reference
1034
+ * or a mode without a secret.
416
1035
  */
417
1036
  type NhAssistantSecretAction = 'keep' | 'replace' | 'clear';
418
- /** Creates or edits one MCP server with a write-only secret. */
1037
+ /** Where the secret is: stored here, encrypted, or a reference to a secret of the application. */
1038
+ type NhAssistantSecretSource = 'stored' | 'reference';
1039
+ /**
1040
+ * Creates or edits one MCP server: the authentication with a write-only secret or a reference to
1041
+ * one, OAuth with discovery the administrator confirms, an optional client certificate, the
1042
+ * transport and the use in background runs. Every field stops at the length the server accepts; a
1043
+ * refused save shows each of the server's field errors at its field, for example a secret reference
1044
+ * the application cannot resolve (`not-found`), and moves the focus to the first of them.
1045
+ */
419
1046
  declare class NhAssistantAdminMcpServerEditorComponent {
420
1047
  private readonly admin;
1048
+ private readonly host;
1049
+ private readonly injector;
421
1050
  private subscription?;
1051
+ private discoverySubscription?;
1052
+ private modesSubscription?;
1053
+ /** Fields whose server error the administrator changed since the refused save. */
1054
+ private readonly touched;
422
1055
  /** The server to edit, or null for a new server. */
423
1056
  readonly server: _angular_core.InputSignal<McpServer | null>;
424
1057
  readonly saved: _angular_core.OutputEmitterRef<McpServer>;
425
1058
  readonly cancelled: _angular_core.OutputEmitterRef<void>;
426
1059
  readonly id: string;
427
- readonly authModes: readonly McpAuthMode[];
1060
+ readonly limits: {
1061
+ readonly id: 40;
1062
+ readonly displayName: 200;
1063
+ readonly url: 2048;
1064
+ readonly headerName: 128;
1065
+ readonly secret: 2000;
1066
+ readonly secretReference: 233;
1067
+ readonly userName: 256;
1068
+ readonly clientCertificateReference: 100;
1069
+ readonly requiredPolicy: 256;
1070
+ readonly scopes: 1024;
1071
+ readonly clientId: 512;
1072
+ readonly clientSecret: 2000;
1073
+ readonly organizationAccountLabel: 200;
1074
+ };
1075
+ readonly builtInAuthModes: readonly McpBuiltInAuthMode[];
1076
+ /** The modes the application registered in code; none until they are loaded or when loading fails. */
1077
+ readonly customAuthModes: _angular_core.WritableSignal<readonly McpCustomAuthMode[]>;
1078
+ /** The built-in modes, the application's own and, kept selectable, a stored mode no longer registered. */
1079
+ readonly authModes: _angular_core.Signal<readonly McpAuthMode[]>;
1080
+ readonly transports: readonly McpTransport[];
1081
+ readonly secretSources: readonly NhAssistantSecretSource[];
1082
+ readonly connectionScopes: readonly McpConnectionScope[];
428
1083
  readonly serverId: _angular_core.WritableSignal<string>;
429
1084
  readonly displayName: _angular_core.WritableSignal<string>;
430
1085
  readonly url: _angular_core.WritableSignal<string>;
@@ -432,28 +1087,121 @@ declare class NhAssistantAdminMcpServerEditorComponent {
432
1087
  readonly headerName: _angular_core.WritableSignal<string>;
433
1088
  readonly requiredPolicy: _angular_core.WritableSignal<string>;
434
1089
  readonly isEnabled: _angular_core.WritableSignal<boolean>;
1090
+ readonly headlessUse: _angular_core.WritableSignal<McpHeadlessUse>;
1091
+ readonly userName: _angular_core.WritableSignal<string>;
1092
+ readonly secretSource: _angular_core.WritableSignal<NhAssistantSecretSource>;
1093
+ readonly secretReference: _angular_core.WritableSignal<string>;
1094
+ readonly clientCertificateReference: _angular_core.WritableSignal<string>;
1095
+ readonly transport: _angular_core.WritableSignal<McpTransport>;
435
1096
  readonly secretAction: _angular_core.WritableSignal<NhAssistantSecretAction>;
436
1097
  /** The new secret while typing. Never filled from the server. */
437
1098
  readonly secret: _angular_core.WritableSignal<string>;
1099
+ readonly connectionScope: _angular_core.WritableSignal<McpConnectionScope>;
1100
+ readonly oauthClientId: _angular_core.WritableSignal<string>;
1101
+ readonly oauthScopes: _angular_core.WritableSignal<string>;
1102
+ readonly organizationAccountLabel: _angular_core.WritableSignal<string>;
1103
+ readonly oauthSecretSource: _angular_core.WritableSignal<NhAssistantSecretSource>;
1104
+ readonly oauthSecretReference: _angular_core.WritableSignal<string>;
1105
+ readonly oauthSecretAction: _angular_core.WritableSignal<NhAssistantSecretAction>;
1106
+ /** The new client secret while typing. Never filled from the server. */
1107
+ readonly oauthSecret: _angular_core.WritableSignal<string>;
1108
+ /** What discovery found for the address; the administrator confirms it on save. */
1109
+ readonly discovery: _angular_core.WritableSignal<McpDiscovery | null>;
1110
+ readonly discovering: _angular_core.WritableSignal<boolean>;
1111
+ readonly discoveryError: _angular_core.WritableSignal<NhAssistantError | null>;
1112
+ readonly confirmAuthorization: _angular_core.WritableSignal<boolean>;
438
1113
  readonly submitted: _angular_core.WritableSignal<boolean>;
439
1114
  readonly saving: _angular_core.WritableSignal<boolean>;
440
1115
  readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
441
1116
  readonly isNew: _angular_core.Signal<boolean>;
1117
+ /** A stored secret that a save keeps; a reference replaces it. */
442
1118
  readonly hasSecret: _angular_core.Signal<boolean>;
1119
+ /** The server's own secret; OAuth modes have a client secret instead. */
443
1120
  readonly usesSecret: _angular_core.Signal<boolean>;
1121
+ readonly usesReference: _angular_core.Signal<boolean>;
1122
+ /**
1123
+ * The organization's credential may serve background runs; a forwarded user token only as the
1124
+ * short-lived token of the person a run acts for, after that person allowed it.
1125
+ */
1126
+ readonly headlessUses: _angular_core.Signal<readonly McpHeadlessUse[]>;
1127
+ readonly isOAuth: _angular_core.Signal<boolean>;
1128
+ readonly isClientCredentials: _angular_core.Signal<boolean>;
1129
+ /** One authorization of the organization's account that everyone uses. */
1130
+ readonly isOrganizationOAuth: _angular_core.Signal<boolean>;
1131
+ /** Whose credential the application's own mode sends; null for a built-in mode. */
1132
+ readonly customOwnership: _angular_core.Signal<"organization" | "person" | null>;
1133
+ /**
1134
+ * The server runs with each person's own account: a forwarded sign-in, a personal OAuth connection
1135
+ * or a mode of the application that sends a person's credential.
1136
+ */
1137
+ readonly personalCredential: _angular_core.Signal<boolean>;
1138
+ readonly hasOAuthSecret: _angular_core.Signal<boolean>;
1139
+ readonly usesOAuthReference: _angular_core.Signal<boolean>;
1140
+ readonly showOAuthSecretInput: _angular_core.Signal<boolean>;
1141
+ /**
1142
+ * The confirmed authorization server stays valid while the address and the OAuth use stay; a new
1143
+ * server, a new address or a switch to OAuth needs discovery and the administrator's confirmation.
1144
+ */
1145
+ readonly needsConfirmation: _angular_core.Signal<boolean>;
1146
+ readonly pkceMissing: _angular_core.Signal<boolean>;
1147
+ readonly confirmMissing: _angular_core.Signal<boolean>;
1148
+ readonly scopesInvalid: _angular_core.Signal<boolean>;
1149
+ readonly clientIdMissing: _angular_core.Signal<boolean>;
1150
+ readonly labelMissing: _angular_core.Signal<boolean>;
1151
+ readonly oauthReferenceInvalid: _angular_core.Signal<boolean>;
1152
+ /** The registration discovery offers when no client id is entered. */
1153
+ readonly registration: _angular_core.Signal<"manual" | "metadata-document" | "dynamic" | null>;
1154
+ readonly effectiveHeadlessUse: _angular_core.Signal<McpHeadlessUse>;
444
1155
  readonly showSecretInput: _angular_core.Signal<boolean>;
445
1156
  readonly idInvalid: _angular_core.Signal<boolean>;
446
1157
  readonly nameMissing: _angular_core.Signal<boolean>;
447
1158
  readonly urlInvalid: _angular_core.Signal<boolean>;
1159
+ readonly userNameInvalid: _angular_core.Signal<boolean>;
1160
+ readonly secretReferenceInvalid: _angular_core.Signal<boolean>;
1161
+ readonly certificateInvalid: _angular_core.Signal<boolean>;
1162
+ readonly oauthInvalid: _angular_core.Signal<boolean>;
1163
+ readonly headerNameInvalid: _angular_core.Signal<boolean>;
448
1164
  readonly valid: _angular_core.Signal<boolean>;
449
1165
  readonly errorKeys: _angular_core.Signal<string[]>;
1166
+ /** The server's first error per field of the refused save, until the administrator changes the field. */
1167
+ readonly serverErrors: _angular_core.Signal<Readonly<Record<string, string>>>;
1168
+ /** Field errors of fields the editor does not show, listed with the form's error. */
1169
+ readonly otherServerErrors: _angular_core.Signal<{
1170
+ field: string;
1171
+ keys: string[];
1172
+ }[]>;
1173
+ readonly discoveryErrorKeys: _angular_core.Signal<string[]>;
450
1174
  constructor();
451
1175
  value(event: Event): string;
1176
+ /** Whether the server refused the field in the last save. */
1177
+ serverInvalid(field: string): boolean;
1178
+ /** The text of the server's error of a field: the text of its value, then the generic text. */
1179
+ serverErrorKeys(field: string): string[];
1180
+ /** The id of a field's error, for `aria-describedby`. */
1181
+ errorId(field: string): string;
1182
+ /** The ids a control describes itself with: its hint and, while the server refused it, its error. */
1183
+ describedBy(hintId: string | null, field: string): string | null;
1184
+ /** The administrator changed a field; its server error no longer applies. */
1185
+ touch(field: string): void;
452
1186
  checked(event: Event): boolean;
453
1187
  setSecretAction(action: NhAssistantSecretAction): void;
1188
+ setSecretSource(source: NhAssistantSecretSource): void;
454
1189
  onSecretInput(event: Event): void;
1190
+ /** A new address makes earlier discovery meaningless. */
1191
+ onUrlInput(event: Event): void;
1192
+ setOAuthSecretSource(source: NhAssistantSecretSource): void;
1193
+ onOAuthSecretInput(event: Event): void;
1194
+ /** Reads the authorization of the address; the administrator confirms what it found. */
1195
+ discover(): void;
455
1196
  save(): void;
1197
+ private focusFirstInvalid;
1198
+ private valueKeys;
456
1199
  private reset;
1200
+ /**
1201
+ * The OAuth settings as the editor shows them: every value is sent, so an emptied field clears the
1202
+ * stored value. The client secret is write-only: sent only when replaced.
1203
+ */
1204
+ private oauthInput;
457
1205
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAdminMcpServerEditorComponent, never>;
458
1206
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAdminMcpServerEditorComponent, "nh-assistant-admin-mcp-server-editor", never, { "server": { "alias": "server"; "required": false; "isSignal": true; }; }, { "saved": "saved"; "cancelled": "cancelled"; }, never, never, true, never>;
459
1207
  }
@@ -502,5 +1250,5 @@ declare class NhAssistantAdminMcpToolsComponent {
502
1250
  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>;
503
1251
  }
504
1252
 
505
- export { NH_ASSISTANT_MAX_INSTRUCTIONS, NhAssistantAdminAgentEditorComponent, NhAssistantAdminAgentsComponent, NhAssistantAdminComponent, NhAssistantAdminContextComponent, NhAssistantAdminMcpServerEditorComponent, NhAssistantAdminMcpServersComponent, NhAssistantAdminMcpToolsComponent, NhAssistantAgentEvaluationComponent, NhAssistantAgentFeedbackReportComponent, nhAssistantSelectorMatches };
506
- export type { NhAssistantAdminTab, NhAssistantEvaluationPeriod, NhAssistantFeedbackPeriod, NhAssistantSecretAction };
1253
+ export { NH_ASSISTANT_MAX_INSTRUCTIONS, NhAssistantAdminAgentEditorComponent, NhAssistantAdminAgentsComponent, NhAssistantAdminComponent, NhAssistantAdminContextComponent, NhAssistantAdminMcpServerEditorComponent, NhAssistantAdminMcpServersComponent, NhAssistantAdminMcpToolsComponent, NhAssistantAgentEvaluationComponent, NhAssistantAgentFeedbackReportComponent, NhAssistantAgentRunConfigurationComponent, NhAssistantAgentRunHistoryComponent, nhAssistantSelectorMatches };
1254
+ export type { AgentUse, NhAssistantAdminTab, NhAssistantEvaluationPeriod, NhAssistantFeedbackPeriod, NhAssistantSecretAction, NhAssistantSecretSource, WorksOnScope };