@newheap/platform-ai-chat 0.15.0 → 0.16.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 +106 -13
- package/fesm2022/newheap-platform-ai-chat-admin.mjs +446 -36
- package/fesm2022/newheap-platform-ai-chat-admin.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat-testing.mjs +522 -43
- package/fesm2022/newheap-platform-ai-chat-testing.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat.mjs +1054 -63
- package/fesm2022/newheap-platform-ai-chat.mjs.map +1 -1
- package/i18n/en.json +127 -8
- package/i18n/nl.json +127 -8
- package/index.d.ts +424 -38
- package/package.json +1 -1
- package/testing/index.d.ts +64 -7
package/admin/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
2
|
import { 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,
|
|
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';
|
|
5
5
|
import { ɵNhAssistantRunNowAgent as _NhAssistantRunNowAgent } from '@newheap/platform-ai-chat/agent-runs';
|
|
6
6
|
|
|
7
7
|
type NhAssistantAdminTab = 'context' | 'agents' | 'mcp-servers';
|
|
@@ -127,6 +127,11 @@ declare function skillNameKeys(agentId: string, skillId: string): string[];
|
|
|
127
127
|
* themselves in the language triage reads; the screen shows a translation when there is one.
|
|
128
128
|
*/
|
|
129
129
|
declare function skillDescriptionKeys(agentId: string, skillId: string): string[];
|
|
130
|
+
/**
|
|
131
|
+
* The key of a warning about an agent or a skill that is saved and in effect but may not work as
|
|
132
|
+
* configured, such as `classification-not-permitted`; a code the screen does not know shows as sent.
|
|
133
|
+
*/
|
|
134
|
+
declare function warningKeys(kind: 'agent' | 'skill', code: string): string[];
|
|
130
135
|
/** The key an application may translate an authorization policy's name with. */
|
|
131
136
|
declare function policyKeys(policy: string | null | undefined): string[];
|
|
132
137
|
/** A readable name for a dash-case id: `task-follow-up` reads "Task follow up". */
|
|
@@ -149,9 +154,17 @@ interface WorksOnSummary {
|
|
|
149
154
|
}
|
|
150
155
|
|
|
151
156
|
type AgentStateAction = SetAgentStateRequest['state'];
|
|
157
|
+
/** A state change being entered, of the agent or one of its skills, with the state it changes from. */
|
|
158
|
+
interface StateChange {
|
|
159
|
+
agentId: string;
|
|
160
|
+
skillId?: string;
|
|
161
|
+
state: AgentStateAction;
|
|
162
|
+
from: AdminAgent['runState'] | AgentSkillState['runState'];
|
|
163
|
+
}
|
|
152
164
|
/**
|
|
153
165
|
* Agent administration: code agents (override, reset) and agents created here (edit, delete),
|
|
154
|
-
* and for every agent its run state with pause,
|
|
166
|
+
* and for every agent and skill its run state with pause, switch off, stop and resume (switch on
|
|
167
|
+
* for one that is off), its shadow mode and that of each
|
|
155
168
|
* skill, and the technical account of an agent that answers to one, each with an optional reason.
|
|
156
169
|
* Editing opens `nh-assistant-admin-agent-editor`; the feedback action opens
|
|
157
170
|
* `nh-assistant-agent-feedback-report` for the agent, the evaluation action of an agent with
|
|
@@ -214,11 +227,7 @@ declare class NhAssistantAdminAgentsComponent {
|
|
|
214
227
|
} | null>;
|
|
215
228
|
readonly busyAgentId: _angular_core.WritableSignal<string | null>;
|
|
216
229
|
/** The state change whose reason is being entered, of the agent or one of its skills. */
|
|
217
|
-
readonly changingState: _angular_core.WritableSignal<
|
|
218
|
-
agentId: string;
|
|
219
|
-
skillId?: string;
|
|
220
|
-
state: AgentStateAction;
|
|
221
|
-
} | null>;
|
|
230
|
+
readonly changingState: _angular_core.WritableSignal<StateChange | null>;
|
|
222
231
|
/** The shadow mode change whose reason is being entered, of the agent or one of its skills. */
|
|
223
232
|
readonly changingShadow: _angular_core.WritableSignal<{
|
|
224
233
|
agentId: string;
|
|
@@ -258,6 +267,7 @@ declare class NhAssistantAdminAgentsComponent {
|
|
|
258
267
|
readonly errorKeys: _angular_core.Signal<string[]>;
|
|
259
268
|
readonly codeTextKeys: typeof codeTextKeys;
|
|
260
269
|
readonly skillNameKeys: typeof skillNameKeys;
|
|
270
|
+
readonly warningKeys: typeof warningKeys;
|
|
261
271
|
readonly skillDescriptionKeys: typeof skillDescriptionKeys;
|
|
262
272
|
readonly policyKeys: typeof policyKeys;
|
|
263
273
|
readonly readableId: typeof readableId;
|
|
@@ -280,8 +290,8 @@ declare class NhAssistantAdminAgentsComponent {
|
|
|
280
290
|
hasRunConfiguration(agent: AdminAgent): boolean;
|
|
281
291
|
/**
|
|
282
292
|
* 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.
|
|
284
|
-
* decides the rest when the run starts.
|
|
293
|
+
* neither stopped nor disabled in code, and the run catalog names what it can run on. An agent
|
|
294
|
+
* that is off still runs for a person. The server decides the rest when the run starts.
|
|
285
295
|
*/
|
|
286
296
|
canRunNow(agent: AdminAgent): boolean;
|
|
287
297
|
/** Opens the run-now dialog of the agent. */
|
|
@@ -332,6 +342,13 @@ declare class NhAssistantAdminAgentsComponent {
|
|
|
332
342
|
stateActions(agent: AdminAgent): AgentStateAction[];
|
|
333
343
|
/** The state changes a skill allows. */
|
|
334
344
|
skillActions(skill: AgentSkillState): AgentStateAction[];
|
|
345
|
+
/**
|
|
346
|
+
* The key of a state change's label, explanation or confirmation: making an agent or skill that is
|
|
347
|
+
* off active again switches it on, which replays nothing, unlike a resume.
|
|
348
|
+
*/
|
|
349
|
+
stateKey(part: 'action' | 'explain' | 'confirm', from: string, action: AgentStateAction): string;
|
|
350
|
+
/** The explanation of a state change of one skill. */
|
|
351
|
+
skillStateExplainKey(change: StateChange): string;
|
|
335
352
|
/** Opens the reason form of a state change of the agent or, with a skill, of that skill. */
|
|
336
353
|
askState(agent: AdminAgent, state: AgentStateAction, skill?: AgentSkillState): void;
|
|
337
354
|
/**
|
|
@@ -435,6 +452,7 @@ declare class NhAssistantAdminAgentEditorComponent {
|
|
|
435
452
|
readonly id: string;
|
|
436
453
|
readonly max = 20000;
|
|
437
454
|
readonly autonomyLevels: readonly AssistantAutonomy[];
|
|
455
|
+
readonly classifications: readonly AssistantDataClassification[];
|
|
438
456
|
readonly agentId: _angular_core.WritableSignal<string>;
|
|
439
457
|
readonly displayName: _angular_core.WritableSignal<string>;
|
|
440
458
|
readonly description: _angular_core.WritableSignal<string>;
|
|
@@ -442,6 +460,12 @@ declare class NhAssistantAdminAgentEditorComponent {
|
|
|
442
460
|
readonly autonomy: _angular_core.WritableSignal<AssistantAutonomy>;
|
|
443
461
|
/** How the agent is used: in the chat, on its own, or both. */
|
|
444
462
|
readonly use: _angular_core.WritableSignal<AgentUse>;
|
|
463
|
+
/** A new agent takes its triggers at once; without it, it starts off until someone switches it on. */
|
|
464
|
+
readonly switchOnNow: _angular_core.WritableSignal<boolean>;
|
|
465
|
+
/** The model profile of an agent created here; empty uses the application's chat profile. */
|
|
466
|
+
readonly profile: _angular_core.WritableSignal<string>;
|
|
467
|
+
/** The classification of the model calls of an agent created here; `internal` when it has none. */
|
|
468
|
+
readonly dataClassification: _angular_core.WritableSignal<AssistantDataClassification>;
|
|
445
469
|
readonly requiredPolicy: _angular_core.WritableSignal<string>;
|
|
446
470
|
readonly toolSelectors: _angular_core.WritableSignal<string[]>;
|
|
447
471
|
readonly mcpServerIds: _angular_core.WritableSignal<string[]>;
|
|
@@ -498,10 +522,17 @@ declare class NhAssistantAdminAgentEditorComponent {
|
|
|
498
522
|
readonly knownTypes: _angular_core.Signal<string[]>;
|
|
499
523
|
/** What the agent works on is edited here: an agent created here, while the run catalog is known. */
|
|
500
524
|
readonly editsWorksOn: _angular_core.Signal<boolean>;
|
|
525
|
+
/** An agent created here chooses its profile from those the run catalog offers. */
|
|
526
|
+
readonly choosesProfile: _angular_core.Signal<boolean>;
|
|
527
|
+
/** The profiles the run catalog offers, and the agent's own when the catalog no longer lists it. */
|
|
528
|
+
readonly profileChoices: _angular_core.Signal<string[]>;
|
|
501
529
|
/** Chosen object types without a type, and not the application either: the agent would work on nothing. */
|
|
502
530
|
readonly worksOnMissing: _angular_core.Signal<boolean>;
|
|
503
531
|
readonly tooManyTypes: _angular_core.Signal<boolean>;
|
|
504
532
|
readonly policyKeys: typeof policyKeys;
|
|
533
|
+
readonly warningKeys: typeof warningKeys;
|
|
534
|
+
/** The warnings of the agent as it was saved, until this editor saves it again. */
|
|
535
|
+
readonly warnings: _angular_core.Signal<_newheap_platform_ai_chat.AssistantConfigurationWarning[]>;
|
|
505
536
|
readonly valid: _angular_core.Signal<boolean>;
|
|
506
537
|
readonly errorKeys: _angular_core.Signal<string[]>;
|
|
507
538
|
readonly filteredTools: _angular_core.Signal<ToolCatalogEntry[]>;
|
|
@@ -845,6 +876,7 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
|
|
|
845
876
|
readonly id: string;
|
|
846
877
|
readonly maxReason: 500;
|
|
847
878
|
readonly skillNameKeys: typeof skillNameKeys;
|
|
879
|
+
readonly warningKeys: typeof warningKeys;
|
|
848
880
|
readonly skillDescriptionKeys: typeof skillDescriptionKeys;
|
|
849
881
|
readonly readableId: typeof readableId;
|
|
850
882
|
readonly loading: _angular_core.WritableSignal<boolean>;
|
|
@@ -855,6 +887,8 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
|
|
|
855
887
|
readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
|
|
856
888
|
readonly errorKeys: _angular_core.Signal<string[]>;
|
|
857
889
|
readonly saved: _angular_core.WritableSignal<string | null>;
|
|
890
|
+
/** The warnings of the skill that was just saved, shown with the saved message. */
|
|
891
|
+
readonly savedWarnings: _angular_core.WritableSignal<readonly string[]>;
|
|
858
892
|
readonly form: _angular_core.WritableSignal<Form | null>;
|
|
859
893
|
readonly confirming: _angular_core.WritableSignal<Confirmation | null>;
|
|
860
894
|
readonly reason: _angular_core.WritableSignal<string>;
|
|
@@ -1036,12 +1070,35 @@ declare class NhAssistantAdminMcpServersComponent {
|
|
|
1036
1070
|
type NhAssistantSecretAction = 'keep' | 'replace' | 'clear';
|
|
1037
1071
|
/** Where the secret is: stored here, encrypted, or a reference to a secret of the application. */
|
|
1038
1072
|
type NhAssistantSecretSource = 'stored' | 'reference';
|
|
1073
|
+
/**
|
|
1074
|
+
* One reader as the editor shows it: the tool, the media types as typed (separated by commas, spaces
|
|
1075
|
+
* or new lines), the highest classification and the priority as typed. `key` keeps a row's controls
|
|
1076
|
+
* when another row is removed.
|
|
1077
|
+
*/
|
|
1078
|
+
interface NhAssistantReaderDraft {
|
|
1079
|
+
key: number;
|
|
1080
|
+
toolName: string;
|
|
1081
|
+
mediaTypes: string;
|
|
1082
|
+
maxClassification: AssistantDataClassification | '';
|
|
1083
|
+
priority: string;
|
|
1084
|
+
}
|
|
1085
|
+
/** What is wrong with one reader before it is saved. */
|
|
1086
|
+
interface ReaderProblems {
|
|
1087
|
+
types: boolean;
|
|
1088
|
+
tool: boolean;
|
|
1089
|
+
duplicate: boolean;
|
|
1090
|
+
classification: boolean;
|
|
1091
|
+
priority: boolean;
|
|
1092
|
+
}
|
|
1039
1093
|
/**
|
|
1040
1094
|
* Creates or edits one MCP server: the authentication with a write-only secret or a reference to
|
|
1041
1095
|
* one, OAuth with discovery the administrator confirms, an optional client certificate, the
|
|
1042
|
-
* transport
|
|
1043
|
-
*
|
|
1044
|
-
*
|
|
1096
|
+
* transport, the use in background runs and, for a server that exists, its readers: per reader the
|
|
1097
|
+
* synced tool that turns files into text, the media types it reads, the highest classification that
|
|
1098
|
+
* may be sent to it and its priority, with readers to add and remove. Every field stops at the length
|
|
1099
|
+
* the server accepts; a refused save shows each of the server's field errors at its field, those of a
|
|
1100
|
+
* reader at that reader (`readers[0].toolName`), for example a secret reference the application cannot
|
|
1101
|
+
* resolve (`not-found`), and moves the focus to the first of them.
|
|
1045
1102
|
*/
|
|
1046
1103
|
declare class NhAssistantAdminMcpServerEditorComponent {
|
|
1047
1104
|
private readonly admin;
|
|
@@ -1050,6 +1107,7 @@ declare class NhAssistantAdminMcpServerEditorComponent {
|
|
|
1050
1107
|
private subscription?;
|
|
1051
1108
|
private discoverySubscription?;
|
|
1052
1109
|
private modesSubscription?;
|
|
1110
|
+
private toolsSubscription?;
|
|
1053
1111
|
/** Fields whose server error the administrator changed since the refused save. */
|
|
1054
1112
|
private readonly touched;
|
|
1055
1113
|
/** The server to edit, or null for a new server. */
|
|
@@ -1080,6 +1138,7 @@ declare class NhAssistantAdminMcpServerEditorComponent {
|
|
|
1080
1138
|
readonly transports: readonly McpTransport[];
|
|
1081
1139
|
readonly secretSources: readonly NhAssistantSecretSource[];
|
|
1082
1140
|
readonly connectionScopes: readonly McpConnectionScope[];
|
|
1141
|
+
readonly classifications: readonly AssistantDataClassification[];
|
|
1083
1142
|
readonly serverId: _angular_core.WritableSignal<string>;
|
|
1084
1143
|
readonly displayName: _angular_core.WritableSignal<string>;
|
|
1085
1144
|
readonly url: _angular_core.WritableSignal<string>;
|
|
@@ -1110,6 +1169,15 @@ declare class NhAssistantAdminMcpServerEditorComponent {
|
|
|
1110
1169
|
readonly discovering: _angular_core.WritableSignal<boolean>;
|
|
1111
1170
|
readonly discoveryError: _angular_core.WritableSignal<NhAssistantError | null>;
|
|
1112
1171
|
readonly confirmAuthorization: _angular_core.WritableSignal<boolean>;
|
|
1172
|
+
/** The readers of the server as the editor shows them, in their order. */
|
|
1173
|
+
readonly readers: _angular_core.WritableSignal<readonly NhAssistantReaderDraft[]>;
|
|
1174
|
+
readonly maxReaders = 16;
|
|
1175
|
+
readonly readerPriority: {
|
|
1176
|
+
readonly min: -1000;
|
|
1177
|
+
readonly max: 1000;
|
|
1178
|
+
};
|
|
1179
|
+
/** The server's synced tools, which can read files; empty until they are loaded. */
|
|
1180
|
+
readonly readerTools: _angular_core.WritableSignal<readonly McpTool[]>;
|
|
1113
1181
|
readonly submitted: _angular_core.WritableSignal<boolean>;
|
|
1114
1182
|
readonly saving: _angular_core.WritableSignal<boolean>;
|
|
1115
1183
|
readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
|
|
@@ -1161,6 +1229,13 @@ declare class NhAssistantAdminMcpServerEditorComponent {
|
|
|
1161
1229
|
readonly certificateInvalid: _angular_core.Signal<boolean>;
|
|
1162
1230
|
readonly oauthInvalid: _angular_core.Signal<boolean>;
|
|
1163
1231
|
readonly headerNameInvalid: _angular_core.Signal<boolean>;
|
|
1232
|
+
/** The tool names to choose from, keeping the stored tools the list no longer holds selectable. */
|
|
1233
|
+
readonly readerToolNames: _angular_core.Signal<string[]>;
|
|
1234
|
+
/** What is wrong with each reader, in the order of `readers`. */
|
|
1235
|
+
readonly readerProblems: _angular_core.Signal<readonly ReaderProblems[]>;
|
|
1236
|
+
/** Why a reader can or cannot be added: the server's tools are not synced, or it has the most. */
|
|
1237
|
+
readonly readerAddHint: _angular_core.Signal<"nh-assistant.admin.server-editor.reader.tool-sync" | "nh-assistant.admin.server-editor.reader.limit" | "nh-assistant.admin.server-editor.reader.add-hint">;
|
|
1238
|
+
readonly readerInvalid: _angular_core.Signal<boolean>;
|
|
1164
1239
|
readonly valid: _angular_core.Signal<boolean>;
|
|
1165
1240
|
readonly errorKeys: _angular_core.Signal<string[]>;
|
|
1166
1241
|
/** The server's first error per field of the refused save, until the administrator changes the field. */
|
|
@@ -1179,6 +1254,17 @@ declare class NhAssistantAdminMcpServerEditorComponent {
|
|
|
1179
1254
|
serverErrorKeys(field: string): string[];
|
|
1180
1255
|
/** The id of a field's error, for `aria-describedby`. */
|
|
1181
1256
|
errorId(field: string): string;
|
|
1257
|
+
/** The name of a reader's field in the server's errors, such as `readers[0].toolName`. */
|
|
1258
|
+
readerField(index: number, field: 'mediaTypes' | 'toolName' | 'maxClassification' | 'priority'): string;
|
|
1259
|
+
/** Adds an empty reader at the end, at priority 0, and moves the focus to its tool. */
|
|
1260
|
+
addReader(): void;
|
|
1261
|
+
/**
|
|
1262
|
+
* Removes a reader and moves the focus to the button that adds one; the server's errors of the
|
|
1263
|
+
* readers no longer match their positions.
|
|
1264
|
+
*/
|
|
1265
|
+
removeReader(index: number): void;
|
|
1266
|
+
/** Changes one field of a reader as the administrator typed or chose it. */
|
|
1267
|
+
updateReader(index: number, field: 'toolName' | 'mediaTypes' | 'maxClassification' | 'priority', value: string): void;
|
|
1182
1268
|
/** The ids a control describes itself with: its hint and, while the server refused it, its error. */
|
|
1183
1269
|
describedBy(hintId: string | null, field: string): string | null;
|
|
1184
1270
|
/** The administrator changed a field; its server error no longer applies. */
|
|
@@ -1195,8 +1281,15 @@ declare class NhAssistantAdminMcpServerEditorComponent {
|
|
|
1195
1281
|
discover(): void;
|
|
1196
1282
|
save(): void;
|
|
1197
1283
|
private focusFirstInvalid;
|
|
1284
|
+
private focusById;
|
|
1198
1285
|
private valueKeys;
|
|
1286
|
+
/** Whether the editor shows a field error at a reader's own field. */
|
|
1287
|
+
private showsReaderField;
|
|
1288
|
+
/** The server's errors of the readers no longer apply once a reader is added or removed. */
|
|
1289
|
+
private forgetReaderErrors;
|
|
1199
1290
|
private reset;
|
|
1291
|
+
/** The synced tools of an existing server, to choose the reading tool from. */
|
|
1292
|
+
private loadReaderTools;
|
|
1200
1293
|
/**
|
|
1201
1294
|
* The OAuth settings as the editor shows them: every value is sent, so an emptied field clears the
|
|
1202
1295
|
* stored value. The client secret is write-only: sent only when replaced.
|
|
@@ -1251,4 +1344,4 @@ declare class NhAssistantAdminMcpToolsComponent {
|
|
|
1251
1344
|
}
|
|
1252
1345
|
|
|
1253
1346
|
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 };
|
|
1347
|
+
export type { AgentUse, NhAssistantAdminTab, NhAssistantEvaluationPeriod, NhAssistantFeedbackPeriod, NhAssistantReaderDraft, NhAssistantSecretAction, NhAssistantSecretSource, WorksOnScope };
|