@newheap/platform-ai-chat 0.13.0 → 0.14.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 +5 -0
- package/admin/index.d.ts +164 -4
- package/fesm2022/newheap-platform-ai-chat-admin.mjs +468 -15
- package/fesm2022/newheap-platform-ai-chat-admin.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat-testing.mjs +564 -2
- package/fesm2022/newheap-platform-ai-chat-testing.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat.mjs +514 -28
- package/fesm2022/newheap-platform-ai-chat.mjs.map +1 -1
- package/i18n/en.json +189 -3
- package/i18n/nl.json +189 -3
- package/index.d.ts +336 -6
- package/package.json +1 -1
- package/testing/index.d.ts +13 -1
package/README.md
CHANGED
|
@@ -125,6 +125,11 @@ conversation opens, and live only in this tab's memory. They clear on account ch
|
|
|
125
125
|
loss of access, deletion or leaving a conversation. Standalone composers preserve their
|
|
126
126
|
default behavior; opt into the extra send button with `[queueWhileBusy]="true"` and
|
|
127
127
|
connect it to `NhAssistantStore.submit` using `canSubmit`.
|
|
128
|
+
A failed turn leaves the conversation open, as on the server: the error bar keeps the
|
|
129
|
+
translated failure and the next message starts a new turn in the same conversation or agent
|
|
130
|
+
thread. While nothing is queued, that message is sent directly even with the error bar shown.
|
|
131
|
+
A reopened conversation whose last turn failed says that the last answer could not be
|
|
132
|
+
completed. Only an archived conversation is closed for new messages.
|
|
128
133
|
Explicit send returns focus to the
|
|
129
134
|
editor. Automatic focus restoration happens only when a disappearing composer control
|
|
130
135
|
owned focus, never after the user chose another control, and is skipped for coarse
|
package/admin/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import {
|
|
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, SetAgentStateRequest, AgentShadowMode, AgentSkillState, AgentShadowState, AssistantAutonomy, AgentEvaluation, AgentReplay, AgentEvaluationCost, AgentProposalFeedbackCategory, AgentFeedbackSummaryRow, AgentFeedbackItem, AgentFeedbackCategoryCount, StaleKind, AgentProposalFeedbackGroup, AgentAccountability, AgentElevatedReads, TriggerConflict, RunCatalog, AgentRunConfiguration, DataSkill, DataTrigger, SkillComparison, DataSkillVersion, SkillApplyMode, McpServerTestResult, McpAuthMode, McpToolEffect, McpTool } from '@newheap/platform-ai-chat';
|
|
3
5
|
|
|
4
6
|
type NhAssistantAdminTab = 'context' | 'agents' | 'mcp-servers';
|
|
5
7
|
/**
|
|
@@ -65,8 +67,9 @@ type AgentStateAction = SetAgentStateRequest['state'];
|
|
|
65
67
|
* and for every agent its run state with pause, stop and resume, its shadow mode and that of each
|
|
66
68
|
* skill, and the technical account of an agent that answers to one, each with an optional reason.
|
|
67
69
|
* Editing opens `nh-assistant-admin-agent-editor`; the feedback action opens
|
|
68
|
-
* `nh-assistant-agent-feedback-report` for the agent,
|
|
69
|
-
* shadow variants opens `nh-assistant-agent-evaluation
|
|
70
|
+
* `nh-assistant-agent-feedback-report` for the agent, the evaluation action of an agent with
|
|
71
|
+
* shadow variants opens `nh-assistant-agent-evaluation`, and the run configuration action opens
|
|
72
|
+
* `nh-assistant-agent-run-configuration` for the skills, triggers and run settings defined as data.
|
|
70
73
|
*/
|
|
71
74
|
declare class NhAssistantAdminAgentsComponent {
|
|
72
75
|
private readonly admin;
|
|
@@ -89,6 +92,8 @@ declare class NhAssistantAdminAgentsComponent {
|
|
|
89
92
|
readonly reporting: _angular_core.WritableSignal<AdminAgent | null>;
|
|
90
93
|
/** The agent whose comparison with its shadow variants is shown instead of the list. */
|
|
91
94
|
readonly evaluating: _angular_core.WritableSignal<AdminAgent | null>;
|
|
95
|
+
/** The agent whose run configuration is shown instead of the list. */
|
|
96
|
+
readonly configuring: _angular_core.WritableSignal<AdminAgent | null>;
|
|
92
97
|
readonly confirming: _angular_core.WritableSignal<{
|
|
93
98
|
agentId: string;
|
|
94
99
|
action: "delete" | "reset";
|
|
@@ -126,6 +131,15 @@ declare class NhAssistantAdminAgentsComponent {
|
|
|
126
131
|
variantsOf(agent: AdminAgent): string[];
|
|
127
132
|
/** Compares the agent with its shadow variants. */
|
|
128
133
|
openEvaluation(agent: AdminAgent): void;
|
|
134
|
+
/**
|
|
135
|
+
* Whether the agent can run on its own and so has a run configuration: an agent in code with runs,
|
|
136
|
+
* or any agent created here, which gets run settings as data.
|
|
137
|
+
*/
|
|
138
|
+
hasRunConfiguration(agent: AdminAgent): boolean;
|
|
139
|
+
/** Shows the agent's skills, triggers and run settings defined as data. */
|
|
140
|
+
openRunConfiguration(agent: AdminAgent): void;
|
|
141
|
+
/** Returns to the list, refreshed, and to the run configuration action of the agent. */
|
|
142
|
+
closeRunConfiguration(): void;
|
|
129
143
|
/** Returns to the list and to the evaluation action of the agent whose comparison was open. */
|
|
130
144
|
closeEvaluation(): void;
|
|
131
145
|
/** Returns to the list and to the feedback action of the agent whose report was open. */
|
|
@@ -162,6 +176,11 @@ declare class NhAssistantAdminAgentsComponent {
|
|
|
162
176
|
/** Closes the open confirmation and change forms before another opens; one is open at a time. */
|
|
163
177
|
private closeForms;
|
|
164
178
|
private replace;
|
|
179
|
+
/**
|
|
180
|
+
* Reloads the agents behind the visible list, for example their skills after the run
|
|
181
|
+
* configuration changed; the list stays as it is when that fails.
|
|
182
|
+
*/
|
|
183
|
+
private refreshAgents;
|
|
165
184
|
/** Agent changes affect the agent picker of the panel. */
|
|
166
185
|
private refreshChat;
|
|
167
186
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAdminAgentsComponent, never>;
|
|
@@ -370,6 +389,147 @@ declare class NhAssistantAgentFeedbackReportComponent {
|
|
|
370
389
|
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
390
|
}
|
|
372
391
|
|
|
392
|
+
type Form = 'settings' | 'skill' | 'trigger';
|
|
393
|
+
/** A removal, promotion or discard that waits for its confirmation. */
|
|
394
|
+
interface Confirmation {
|
|
395
|
+
action: 'remove-settings' | 'remove-skill' | 'remove-trigger' | 'promote' | 'discard';
|
|
396
|
+
id: string;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* The run configuration of one agent as data: the run settings of an agent created in the
|
|
400
|
+
* administration, its skills and triggers in code (read only) and as data, and the data that no
|
|
401
|
+
* longer fits the code. Administrators add and change data skills, live at once or as a candidate in
|
|
402
|
+
* shadow that they compare with the live version and promote or discard; they add data triggers on
|
|
403
|
+
* the application's events or on a schedule and put them live. New skills and triggers start in
|
|
404
|
+
* shadow; `changed` tells the agents page to reload the agent's skill states.
|
|
405
|
+
*/
|
|
406
|
+
declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
|
|
407
|
+
private readonly admin;
|
|
408
|
+
private readonly injector;
|
|
409
|
+
private readonly host;
|
|
410
|
+
private loadSubscription?;
|
|
411
|
+
private actionSubscription?;
|
|
412
|
+
private detailSubscription?;
|
|
413
|
+
readonly agent: _angular_core.InputSignal<AdminAgent>;
|
|
414
|
+
/** A change of the run configuration changed the agent's skills or state. */
|
|
415
|
+
readonly changed: _angular_core.OutputEmitterRef<void>;
|
|
416
|
+
readonly id: string;
|
|
417
|
+
readonly maxReason = 500;
|
|
418
|
+
readonly maxDescription = 300;
|
|
419
|
+
readonly maxInstructions = 20000;
|
|
420
|
+
readonly maxMessage = 2000;
|
|
421
|
+
readonly accountabilities: AgentAccountability[];
|
|
422
|
+
readonly elevatedReadModes: AgentElevatedReads[];
|
|
423
|
+
readonly conflicts: TriggerConflict[];
|
|
424
|
+
readonly loading: _angular_core.WritableSignal<boolean>;
|
|
425
|
+
readonly loadFailed: _angular_core.WritableSignal<boolean>;
|
|
426
|
+
readonly busy: _angular_core.WritableSignal<boolean>;
|
|
427
|
+
readonly catalog: _angular_core.WritableSignal<RunCatalog | null>;
|
|
428
|
+
readonly configuration: _angular_core.WritableSignal<AgentRunConfiguration | null>;
|
|
429
|
+
readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
|
|
430
|
+
readonly errorKeys: _angular_core.Signal<string[]>;
|
|
431
|
+
readonly saved: _angular_core.WritableSignal<string | null>;
|
|
432
|
+
readonly form: _angular_core.WritableSignal<Form | null>;
|
|
433
|
+
readonly confirming: _angular_core.WritableSignal<Confirmation | null>;
|
|
434
|
+
readonly reason: _angular_core.WritableSignal<string>;
|
|
435
|
+
/** The skill being changed; `null` with the skill form open adds a new skill. */
|
|
436
|
+
readonly editingSkill: _angular_core.WritableSignal<DataSkill | null>;
|
|
437
|
+
/** The trigger being changed; `null` with the trigger form open adds a new trigger. */
|
|
438
|
+
readonly editingTrigger: _angular_core.WritableSignal<DataTrigger | null>;
|
|
439
|
+
readonly comparison: _angular_core.WritableSignal<{
|
|
440
|
+
skillId: string;
|
|
441
|
+
result: SkillComparison | null;
|
|
442
|
+
failed: boolean;
|
|
443
|
+
} | null>;
|
|
444
|
+
readonly versions: _angular_core.WritableSignal<{
|
|
445
|
+
skillId: string;
|
|
446
|
+
items: DataSkillVersion[] | null;
|
|
447
|
+
failed: boolean;
|
|
448
|
+
} | null>;
|
|
449
|
+
readonly accountability: _angular_core.WritableSignal<AgentAccountability>;
|
|
450
|
+
readonly serviceAccount: _angular_core.WritableSignal<string>;
|
|
451
|
+
readonly approvalPolicy: _angular_core.WritableSignal<string>;
|
|
452
|
+
readonly ruleHandler: _angular_core.WritableSignal<string>;
|
|
453
|
+
readonly triageProfile: _angular_core.WritableSignal<string>;
|
|
454
|
+
readonly retryCount: _angular_core.WritableSignal<string>;
|
|
455
|
+
readonly maxConcurrentRuns: _angular_core.WritableSignal<string>;
|
|
456
|
+
readonly maxRunsPerSubjectPerDay: _angular_core.WritableSignal<string>;
|
|
457
|
+
readonly maxTokensPerRun: _angular_core.WritableSignal<string>;
|
|
458
|
+
readonly dailyToolCalls: _angular_core.WritableSignal<string>;
|
|
459
|
+
readonly dailyTokens: _angular_core.WritableSignal<string>;
|
|
460
|
+
readonly allowGatewayReads: _angular_core.WritableSignal<boolean>;
|
|
461
|
+
readonly delegateFromInitiator: _angular_core.WritableSignal<boolean>;
|
|
462
|
+
readonly elevatedReads: _angular_core.WritableSignal<AgentElevatedReads>;
|
|
463
|
+
readonly skillId: _angular_core.WritableSignal<string>;
|
|
464
|
+
readonly skillDescription: _angular_core.WritableSignal<string>;
|
|
465
|
+
readonly skillInstructions: _angular_core.WritableSignal<string>;
|
|
466
|
+
readonly skillTools: _angular_core.WritableSignal<string[]>;
|
|
467
|
+
readonly skillProfile: _angular_core.WritableSignal<string>;
|
|
468
|
+
readonly skillRuleHandler: _angular_core.WritableSignal<string>;
|
|
469
|
+
readonly skillApprovalPolicy: _angular_core.WritableSignal<string>;
|
|
470
|
+
readonly skillMaxTokens: _angular_core.WritableSignal<string>;
|
|
471
|
+
readonly skillDailyToolCalls: _angular_core.WritableSignal<string>;
|
|
472
|
+
readonly skillDailyTokens: _angular_core.WritableSignal<string>;
|
|
473
|
+
readonly skillApply: _angular_core.WritableSignal<SkillApplyMode>;
|
|
474
|
+
readonly triggerId: _angular_core.WritableSignal<string>;
|
|
475
|
+
readonly triggerSource: _angular_core.WritableSignal<"event" | "schedule">;
|
|
476
|
+
readonly triggerEvent: _angular_core.WritableSignal<string>;
|
|
477
|
+
readonly triggerCron: _angular_core.WritableSignal<string>;
|
|
478
|
+
readonly triggerTimeZone: _angular_core.WritableSignal<string>;
|
|
479
|
+
readonly triggerSubjectSet: _angular_core.WritableSignal<string>;
|
|
480
|
+
readonly triggerMessage: _angular_core.WritableSignal<string>;
|
|
481
|
+
readonly triggerSkill: _angular_core.WritableSignal<string>;
|
|
482
|
+
readonly triggerConflict: _angular_core.WritableSignal<TriggerConflict>;
|
|
483
|
+
readonly triggerDebounce: _angular_core.WritableSignal<string>;
|
|
484
|
+
readonly isAdminAgent: _angular_core.Signal<boolean>;
|
|
485
|
+
/** An agent created in the administration gets skills and triggers once it has run settings. */
|
|
486
|
+
readonly canAddRunData: _angular_core.Signal<boolean>;
|
|
487
|
+
readonly skillOptions: _angular_core.Signal<string[]>;
|
|
488
|
+
readonly problems: _angular_core.Signal<_newheap_platform_ai_chat.RunConfigurationProblem[]>;
|
|
489
|
+
readonly skillIdInvalid: _angular_core.Signal<boolean>;
|
|
490
|
+
readonly triggerIdInvalid: _angular_core.Signal<boolean>;
|
|
491
|
+
readonly descriptionInvalid: _angular_core.Signal<boolean>;
|
|
492
|
+
constructor();
|
|
493
|
+
ngOnInit(): void;
|
|
494
|
+
load(): void;
|
|
495
|
+
/** The first error of a field from the last failed save, as a translation key. */
|
|
496
|
+
fieldError(field: string): string | null;
|
|
497
|
+
editSettings(): void;
|
|
498
|
+
saveSettings(): void;
|
|
499
|
+
removeSettings(): void;
|
|
500
|
+
addSkill(): void;
|
|
501
|
+
editSkill(skill: DataSkill): void;
|
|
502
|
+
toggleTool(selector: string, selected: boolean): void;
|
|
503
|
+
saveSkill(): void;
|
|
504
|
+
removeSkill(skill: DataSkill): void;
|
|
505
|
+
promote(skill: DataSkill): void;
|
|
506
|
+
discard(skill: DataSkill): void;
|
|
507
|
+
/** Shows or hides the comparison of a skill's candidate with its live version. */
|
|
508
|
+
toggleComparison(skill: DataSkill): void;
|
|
509
|
+
/** Shows or hides the version history of a skill. */
|
|
510
|
+
toggleVersions(skill: DataSkill): void;
|
|
511
|
+
addTrigger(): void;
|
|
512
|
+
editTrigger(trigger: DataTrigger): void;
|
|
513
|
+
/** A schedule skips a tick while a run is busy by default; an event coalesces. */
|
|
514
|
+
setTriggerSource(source: 'event' | 'schedule'): void;
|
|
515
|
+
saveTrigger(): void;
|
|
516
|
+
setTriggerShadow(trigger: DataTrigger, shadow: boolean): void;
|
|
517
|
+
removeTrigger(trigger: DataTrigger): void;
|
|
518
|
+
confirm(action: Confirmation['action'], id: string): void;
|
|
519
|
+
isConfirming(action: Confirmation['action'], id: string): boolean;
|
|
520
|
+
cancel(): void;
|
|
521
|
+
value(event: Event): string;
|
|
522
|
+
checked(event: Event): boolean;
|
|
523
|
+
private fillSkill;
|
|
524
|
+
private fillTrigger;
|
|
525
|
+
/** Opens one form at a time and moves the focus into it. */
|
|
526
|
+
private open;
|
|
527
|
+
/** Runs a change and reloads the configuration, which every change may affect. */
|
|
528
|
+
private run;
|
|
529
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAgentRunConfigurationComponent, never>;
|
|
530
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentRunConfigurationComponent, "nh-assistant-agent-run-configuration", never, { "agent": { "alias": "agent"; "required": true; "isSignal": true; }; }, { "changed": "changed"; }, never, never, true, never>;
|
|
531
|
+
}
|
|
532
|
+
|
|
373
533
|
/** Result of the latest connection test per server. */
|
|
374
534
|
interface TestState {
|
|
375
535
|
running: boolean;
|
|
@@ -502,5 +662,5 @@ declare class NhAssistantAdminMcpToolsComponent {
|
|
|
502
662
|
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
663
|
}
|
|
504
664
|
|
|
505
|
-
export { NH_ASSISTANT_MAX_INSTRUCTIONS, NhAssistantAdminAgentEditorComponent, NhAssistantAdminAgentsComponent, NhAssistantAdminComponent, NhAssistantAdminContextComponent, NhAssistantAdminMcpServerEditorComponent, NhAssistantAdminMcpServersComponent, NhAssistantAdminMcpToolsComponent, NhAssistantAgentEvaluationComponent, NhAssistantAgentFeedbackReportComponent, nhAssistantSelectorMatches };
|
|
665
|
+
export { NH_ASSISTANT_MAX_INSTRUCTIONS, NhAssistantAdminAgentEditorComponent, NhAssistantAdminAgentsComponent, NhAssistantAdminComponent, NhAssistantAdminContextComponent, NhAssistantAdminMcpServerEditorComponent, NhAssistantAdminMcpServersComponent, NhAssistantAdminMcpToolsComponent, NhAssistantAgentEvaluationComponent, NhAssistantAgentFeedbackReportComponent, NhAssistantAgentRunConfigurationComponent, nhAssistantSelectorMatches };
|
|
506
666
|
export type { NhAssistantAdminTab, NhAssistantEvaluationPeriod, NhAssistantFeedbackPeriod, NhAssistantSecretAction };
|