@newheap/platform-ai-chat 0.18.0 → 0.20.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 +7 -0
- package/admin/index.d.ts +320 -11
- package/agent-runs/index.d.ts +5 -0
- package/fesm2022/newheap-platform-ai-chat-admin.mjs +5792 -3527
- package/fesm2022/newheap-platform-ai-chat-admin.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat-agent-runs.mjs +9 -2
- package/fesm2022/newheap-platform-ai-chat-agent-runs.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat-testing.mjs +2989 -139
- package/fesm2022/newheap-platform-ai-chat-testing.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat.mjs +2237 -90
- package/fesm2022/newheap-platform-ai-chat.mjs.map +1 -1
- package/i18n/en.json +470 -10
- package/i18n/nl.json +470 -10
- package/index.d.ts +1272 -26
- package/package.json +1 -1
- package/push/nh-assistant-push-worker.js +13 -6
- package/testing/index.d.ts +199 -5
package/README.md
CHANGED
|
@@ -154,6 +154,13 @@ title, Markdown text and a link within the application or to an `https` address.
|
|
|
154
154
|
Custom layouts pass `[approvalRights]` to `nh-assistant-thread` and handle
|
|
155
155
|
`(approvalChoice)`, which carries the approval id.
|
|
156
156
|
|
|
157
|
+
A question an agent asked with `ask_question` (`run.AllowQuestions()` on the server) shows as
|
|
158
|
+
`nh-assistant-question-card`: the person it is addressed to gets a button per choice, everyone else
|
|
159
|
+
reads it with whom it waits for. The turn waits for the answer as for an approval
|
|
160
|
+
(`conversation.pendingQuestion`); the thread emits `(questionAnswer)` for the addressee and the panel
|
|
161
|
+
calls `NhAssistantStore.answerQuestion`, which streams the resumed turn. An agent message of a chat
|
|
162
|
+
with `run.SkillsInChat()` names the skill it worked in (`message.skillId`).
|
|
163
|
+
|
|
157
164
|
A tool call whose agent proposal closed without running no longer waits: it ends as
|
|
158
165
|
`rejected`, as `not-executed` when the proposal expired, was withdrawn or became stale, or as
|
|
159
166
|
`failed` when its execution failed before it started, with the result code
|
package/admin/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { OnInit } from '@angular/core';
|
|
2
|
+
import { InjectionToken, Type, Signal, EnvironmentProviders, Injector, OnInit } from '@angular/core';
|
|
3
3
|
import * as _newheap_platform_ai_chat from '@newheap/platform-ai-chat';
|
|
4
|
-
import { NhAssistantStore, NhAssistantError, ApplicationContext, ApplicationContextVersion, AdminAgent, ToolCatalogEntry, McpServer, RunCatalog, SetAgentStateRequest, AgentSkillState, AgentShadowMode, AgentShadowState, AssistantAutonomy, AssistantDataClassification, AgentEvaluation, AgentReplay, AgentEvaluationCost, AgentProposalFeedbackCategory, AgentFeedbackSummaryRow, AgentFeedbackItem, AgentFeedbackCategoryCount, StaleKind, AgentProposalFeedbackGroup, AgentSubjectType, AgentRunStatus, ɵnhAssistantCodeKeys as _nhAssistantCodeKeys, AgentRunHistoryItem, NhAssistantConsultationRoute, DataConsultation, CodeConsultation, DataSkill, AgentRunConfiguration, DataTrigger, SkillComparison, DataSkillVersion, ɵNhAssistantPickerOption as _NhAssistantPickerOption, McpServerTestResult, McpConnectionsSummary, McpBuiltInAuthMode, McpCustomAuthMode, McpAuthMode, McpTransport, McpConnectionScope, McpHeadlessUse, McpDiscovery, McpTool, McpToolEffect } from '@newheap/platform-ai-chat';
|
|
4
|
+
import { NhAssistantStore, NhAssistantError, ApplicationContext, ApplicationContextVersion, AdminAgent, PackagePartLink, ToolCatalogEntry, McpServer, RunCatalog, SetAgentStateRequest, AgentSkillState, AgentShadowMode, ShadowVariantPromotion, AgentShadowState, AssistantAutonomy, AssistantDataClassification, InstructionAssetReference, AgentMetadata, AgentMetadataEntry, NhAssistantAdminApiService, ɵnhAssistantErrorKeys as _nhAssistantErrorKeys, AgentEvaluation, AgentReplay, AgentEvaluationCost, AgentProposalFeedbackCategory, AgentFeedbackSummaryRow, AgentFeedbackItem, AgentFeedbackCategoryCount, StaleKind, AgentProposalFeedbackGroup, AgentSubjectType, AgentRunStatus, ɵnhAssistantCodeKeys as _nhAssistantCodeKeys, AgentRunHistoryItem, NhAssistantConsultationRoute, DataConsultation, CodeConsultation, DataTriggerVersion, DataSkill, AgentRunConfiguration, DataTrigger, SkillComparison, DataSkillVersion, TriggerComparison, ɵNhAssistantPickerOption as _NhAssistantPickerOption, McpServerTestResult, McpConnectionsSummary, McpBuiltInAuthMode, McpCustomAuthMode, McpAuthMode, McpTransport, McpConnectionScope, McpHeadlessUse, McpDiscovery, McpTool, McpToolEffect } from '@newheap/platform-ai-chat';
|
|
5
5
|
import { ɵNhAssistantRunNowAgent as _NhAssistantRunNowAgent } from '@newheap/platform-ai-chat/agent-runs';
|
|
6
6
|
|
|
7
7
|
type NhAssistantAdminTab = 'context' | 'agents' | 'mcp-servers';
|
|
@@ -153,6 +153,27 @@ interface WorksOnSummary {
|
|
|
153
153
|
viewPolicy: string | null;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
/** How a package links one part on this host, as the forms and lists show it. */
|
|
157
|
+
interface PackageLockView {
|
|
158
|
+
packageId: string;
|
|
159
|
+
packageVersion: number;
|
|
160
|
+
/** The whole part is locked. */
|
|
161
|
+
whole: boolean;
|
|
162
|
+
/** The locked fields by their names in the format; empty while the whole part or nothing is locked. */
|
|
163
|
+
fields: readonly string[];
|
|
164
|
+
/** The part changed here after its import; the next upgrade overwrites its unlocked fields. */
|
|
165
|
+
changedLocally: boolean;
|
|
166
|
+
}
|
|
167
|
+
/** The lock a part's link shows, or `null` for a part no package links. */
|
|
168
|
+
declare function packageLockOf(link: PackagePartLink | null | undefined): PackageLockView | null;
|
|
169
|
+
/**
|
|
170
|
+
* The package an agent belongs to, as the notice of the whole agent shows it: the package's id and
|
|
171
|
+
* the version this host has, without locks of its own.
|
|
172
|
+
*/
|
|
173
|
+
declare function agentPackageOf(agent: AdminAgent | null | undefined): PackageLockView | null;
|
|
174
|
+
/** Whether a lock keeps anything of its part from changing, so the part cannot be removed. */
|
|
175
|
+
declare function isPackageLocked(lock: PackageLockView | null | undefined): boolean;
|
|
176
|
+
|
|
156
177
|
type AgentStateAction = SetAgentStateRequest['state'];
|
|
157
178
|
/** A state change being entered, of the agent or one of its skills, with the state it changes from. */
|
|
158
179
|
interface StateChange {
|
|
@@ -177,7 +198,11 @@ interface StateChange {
|
|
|
177
198
|
* code and offers to read it again; until then it offers no "Run now" and the editor leaves what an
|
|
178
199
|
* agent works on and its groups as they are. The run configuration opens with the agent's flow, whose
|
|
179
200
|
* entry points open the editor, the runs and the technical account here and return to the run
|
|
180
|
-
* configuration afterwards; `openMcpServers` asks the host to show the MCP servers.
|
|
201
|
+
* configuration afterwards; `openMcpServers` asks the host to show the MCP servers. "Import package"
|
|
202
|
+
* opens the import dialog of agent packages, and "Export as package" on an agent the export dialog
|
|
203
|
+
* with that agent chosen. An agent that belongs to a package says so on its card with "Unlink the
|
|
204
|
+
* agent"; it cannot be deleted until it is unlinked, nor reset while its package locks fields of
|
|
205
|
+
* its definition.
|
|
181
206
|
*/
|
|
182
207
|
declare class NhAssistantAdminAgentsComponent {
|
|
183
208
|
private readonly admin;
|
|
@@ -255,6 +280,11 @@ declare class NhAssistantAdminAgentsComponent {
|
|
|
255
280
|
readonly accountNames: _angular_core.Signal<ReadonlyMap<string, string>>;
|
|
256
281
|
/** The agent whose last action failed, so its error shows on its card. */
|
|
257
282
|
readonly errorAgentId: _angular_core.WritableSignal<string | null>;
|
|
283
|
+
/** The agent whose export dialog is open, chosen in it; `null` while it is closed. */
|
|
284
|
+
readonly exporting: _angular_core.WritableSignal<AdminAgent | null>;
|
|
285
|
+
/** Whether the import dialog of agent packages is open. */
|
|
286
|
+
readonly importing: _angular_core.WritableSignal<boolean>;
|
|
287
|
+
readonly agentPackageOf: typeof agentPackageOf;
|
|
258
288
|
/** The agent the run-now dialog runs; `null` while it is closed. */
|
|
259
289
|
readonly runningNow: _angular_core.WritableSignal<AdminAgent | null>;
|
|
260
290
|
/** The agent of the run-now dialog as the dialog needs it: its name and what it works on. */
|
|
@@ -294,6 +324,18 @@ declare class NhAssistantAdminAgentsComponent {
|
|
|
294
324
|
* that is off still runs for a person. The server decides the rest when the run starts.
|
|
295
325
|
*/
|
|
296
326
|
canRunNow(agent: AdminAgent): boolean;
|
|
327
|
+
/** Opens the export dialog with the agent chosen. */
|
|
328
|
+
exportPackage(agent: AdminAgent): void;
|
|
329
|
+
/** Opens the import dialog of agent packages. */
|
|
330
|
+
importPackage(): void;
|
|
331
|
+
/** A package was imported: its agents and their parts are read again. */
|
|
332
|
+
onPackageImported(): void;
|
|
333
|
+
/** The agent or a part of it was unlinked from its package. */
|
|
334
|
+
onPackageUnlinked(): void;
|
|
335
|
+
/** A package the agent belongs to keeps it from being deleted until it is unlinked. */
|
|
336
|
+
deleteLocked(agent: AdminAgent): boolean;
|
|
337
|
+
/** A reset would give fields the package locks the code's values, which the server refuses. */
|
|
338
|
+
resetLocked(agent: AdminAgent): boolean;
|
|
297
339
|
/** Opens the run-now dialog of the agent. */
|
|
298
340
|
runNow(agent: AdminAgent): void;
|
|
299
341
|
/** Opens the conversation the run works in, in the assistant panel. */
|
|
@@ -323,6 +365,18 @@ declare class NhAssistantAdminAgentsComponent {
|
|
|
323
365
|
* configuration it came from.
|
|
324
366
|
*/
|
|
325
367
|
askerFromRunConfiguration(agent: AdminAgent, askerId: string): void;
|
|
368
|
+
/**
|
|
369
|
+
* A data shadow variant created in the agent's run configuration continues in its own run
|
|
370
|
+
* configuration's guided setup, since it receives the live agent's events only with run settings.
|
|
371
|
+
*/
|
|
372
|
+
onVariantCreated(variant: AdminAgent): void;
|
|
373
|
+
/**
|
|
374
|
+
* A data shadow variant promoted onto the agent whose run configuration is open: the agent shows its
|
|
375
|
+
* new version there and in the list, and the variant, which was removed, leaves the list.
|
|
376
|
+
*/
|
|
377
|
+
onVariantPromoted(promotion: ShadowVariantPromotion): void;
|
|
378
|
+
/** The run configuration of a data shadow variant of the agent whose run configuration is open. */
|
|
379
|
+
variantFromRunConfiguration(variantId: string): void;
|
|
326
380
|
/** The flow of the agent's run configuration opens its runs; going back returns there. */
|
|
327
381
|
runsFromRunConfiguration(agent: AdminAgent): void;
|
|
328
382
|
/** The flow of an agent in code opens the form that replaces its technical account on its card. */
|
|
@@ -418,6 +472,15 @@ declare class NhAssistantAdminAgentsComponent {
|
|
|
418
472
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAdminAgentsComponent, "nh-assistant-admin-agents", never, {}, { "openMcpServers": "openMcpServers"; }, never, never, true, never>;
|
|
419
473
|
}
|
|
420
474
|
|
|
475
|
+
/** A field error: a code such as `required`, with its translation parameters. */
|
|
476
|
+
interface RunConfigFieldError {
|
|
477
|
+
code: string;
|
|
478
|
+
params?: Record<string, unknown>;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/** Where the instructions of a skill version or an agent created here come from. */
|
|
482
|
+
type InstructionsSource = 'inline' | 'asset';
|
|
483
|
+
|
|
421
484
|
/** True when a tool id matches a selector glob (`*` matches any characters). */
|
|
422
485
|
declare function nhAssistantSelectorMatches(toolId: string, selector: string): boolean;
|
|
423
486
|
/** How an agent created in the administration is used: chosen in the chat, working on its own, or both. */
|
|
@@ -432,7 +495,12 @@ type WorksOnScope = 'all' | 'types';
|
|
|
432
495
|
* patterns, and assigned MCP servers. A new agent meant to work on its own continues with
|
|
433
496
|
* `workRequested`. An agent in code names and describes itself with translation keys: the editor
|
|
434
497
|
* shows their translation and sends the key back unless the administrator changed the text, so the
|
|
435
|
-
* agent stays translated; what it works on comes from its code and is not edited here.
|
|
498
|
+
* agent stays translated; what it works on comes from its code and is not edited here. Below the form,
|
|
499
|
+
* an existing agent shows the application's fields (`nh-assistant-agent-metadata`): one slot per entry
|
|
500
|
+
* of agent metadata, where the application's own editor saves the value; a change of a field of an
|
|
501
|
+
* agent created here is its next version, which the next save of the definition continues on. Fields
|
|
502
|
+
* of the definition that the agent's package locks show read-only with a lock and the package's id and
|
|
503
|
+
* version, with "Unlink" for the definition; a save keeps their values.
|
|
436
504
|
*/
|
|
437
505
|
declare class NhAssistantAdminAgentEditorComponent {
|
|
438
506
|
private readonly admin;
|
|
@@ -460,6 +528,12 @@ declare class NhAssistantAdminAgentEditorComponent {
|
|
|
460
528
|
readonly cancelled: _angular_core.OutputEmitterRef<void>;
|
|
461
529
|
readonly uses: readonly AgentUse[];
|
|
462
530
|
readonly id: string;
|
|
531
|
+
private readonly language;
|
|
532
|
+
/**
|
|
533
|
+
* The agent's name in the title, as the agent list shows it: an agent in code names itself with a
|
|
534
|
+
* translation key, which reads in the reader's language.
|
|
535
|
+
*/
|
|
536
|
+
readonly titleName: _angular_core.Signal<string>;
|
|
463
537
|
readonly max = 20000;
|
|
464
538
|
readonly autonomyLevels: readonly AssistantAutonomy[];
|
|
465
539
|
readonly classifications: readonly AssistantDataClassification[];
|
|
@@ -467,11 +541,20 @@ declare class NhAssistantAdminAgentEditorComponent {
|
|
|
467
541
|
readonly displayName: _angular_core.WritableSignal<string>;
|
|
468
542
|
readonly description: _angular_core.WritableSignal<string>;
|
|
469
543
|
readonly instructions: _angular_core.WritableSignal<string>;
|
|
544
|
+
/** Whether the instructions of an agent created here are written here or come from an asset of the application. */
|
|
545
|
+
readonly instructionsSource: _angular_core.WritableSignal<InstructionsSource>;
|
|
546
|
+
/** The application's asset the agent names, once chosen and read. */
|
|
547
|
+
readonly instructionsAsset: _angular_core.WritableSignal<InstructionAssetReference | null>;
|
|
470
548
|
readonly autonomy: _angular_core.WritableSignal<AssistantAutonomy>;
|
|
471
549
|
/** How the agent is used: in the chat, on its own, or both. */
|
|
472
550
|
readonly use: _angular_core.WritableSignal<AgentUse>;
|
|
473
551
|
/** A new agent takes its triggers at once; without it, it starts off until someone switches it on. */
|
|
474
552
|
readonly switchOnNow: _angular_core.WritableSignal<boolean>;
|
|
553
|
+
/**
|
|
554
|
+
* A new agent starts in shadow: once it has run settings its runs work in its shadow threads, where
|
|
555
|
+
* nobody is notified and nothing executes, until someone puts it live.
|
|
556
|
+
*/
|
|
557
|
+
readonly startsInShadow: _angular_core.WritableSignal<boolean>;
|
|
475
558
|
/** The model profile of an agent created here; empty uses the application's chat profile. */
|
|
476
559
|
readonly profile: _angular_core.WritableSignal<string>;
|
|
477
560
|
/** The classification of the model calls of an agent created here; `internal` when it has none. */
|
|
@@ -500,12 +583,36 @@ declare class NhAssistantAdminAgentEditorComponent {
|
|
|
500
583
|
private readonly created;
|
|
501
584
|
/** The agent the next save updates; `null` while a new agent is not created yet. */
|
|
502
585
|
private readonly editing;
|
|
586
|
+
/**
|
|
587
|
+
* The agent's version after one of its application fields changed, which made its next version;
|
|
588
|
+
* `null` while no field changed.
|
|
589
|
+
*/
|
|
590
|
+
private readonly fieldsVersion;
|
|
591
|
+
/** The definition was unlinked from its package here, so it no longer locks. */
|
|
592
|
+
private readonly unlinked;
|
|
593
|
+
/** What the agent's package locks of its definition (part `agent`); `null` without a link. */
|
|
594
|
+
readonly lock: _angular_core.Signal<PackageLockView | null>;
|
|
595
|
+
/** The agent whose application fields show below the form; `null` for a new agent. */
|
|
596
|
+
readonly metadataAgent: _angular_core.Signal<AdminAgent | null>;
|
|
597
|
+
/** The entries of agent metadata the application registers, for a new agent. */
|
|
598
|
+
readonly metadataEntries: _angular_core.Signal<_newheap_platform_ai_chat.AgentMetadataEntry[]>;
|
|
503
599
|
readonly isNew: _angular_core.Signal<boolean>;
|
|
504
600
|
/** Only agents created here choose whether they are offered in the chat; code decides for the others. */
|
|
505
601
|
readonly choosesUse: _angular_core.Signal<boolean>;
|
|
506
602
|
readonly idInvalid: _angular_core.Signal<boolean>;
|
|
507
603
|
readonly nameMissing: _angular_core.Signal<boolean>;
|
|
508
604
|
readonly tooLong: _angular_core.Signal<boolean>;
|
|
605
|
+
/**
|
|
606
|
+
* Only an agent created here takes its instructions from an asset, when the application offers its
|
|
607
|
+
* assets; one that names an asset keeps showing it.
|
|
608
|
+
*/
|
|
609
|
+
readonly assetsAvailable: _angular_core.Signal<boolean>;
|
|
610
|
+
/** An asset is the source, but none is chosen and read yet. */
|
|
611
|
+
readonly assetMissing: _angular_core.Signal<boolean>;
|
|
612
|
+
/** The problem of the asset the saved agent names, while it is still the choice. */
|
|
613
|
+
readonly assetProblem: _angular_core.Signal<_newheap_platform_ai_chat.InstructionAssetProblem | null>;
|
|
614
|
+
/** The error of the asset choice: chosen none, or the save's refusal of the reference. */
|
|
615
|
+
readonly assetError: _angular_core.Signal<RunConfigFieldError | null>;
|
|
509
616
|
readonly selectorInvalid: _angular_core.Signal<boolean>;
|
|
510
617
|
/**
|
|
511
618
|
* The application's own object types, by name; the platform's types, such as the whole
|
|
@@ -559,8 +666,16 @@ declare class NhAssistantAdminAgentEditorComponent {
|
|
|
559
666
|
toggleServer(serverId: string, checked: boolean): void;
|
|
560
667
|
value(event: Event): string;
|
|
561
668
|
checked(event: Event): boolean;
|
|
669
|
+
/** Whether the agent's package locks a field of its definition, which then shows read-only. */
|
|
670
|
+
locked(field: string): boolean;
|
|
671
|
+
/** The lock the mark next to a field's label shows; `null` for a field that changes here. */
|
|
672
|
+
lockOf(field: string): PackageLockView | null;
|
|
673
|
+
/** The definition was unlinked from its package: its fields change here again. */
|
|
674
|
+
onUnlinked(): void;
|
|
562
675
|
/** The first error the server reported for a field, as a translation key. */
|
|
563
676
|
fieldError(field: string): string | null;
|
|
677
|
+
/** An application field of an agent created here made the agent's next version. */
|
|
678
|
+
fieldsChanged(agentVersion: number): void;
|
|
564
679
|
save(): void;
|
|
565
680
|
/** What the agent works on, as the six fields the server reads together. */
|
|
566
681
|
private worksOnInput;
|
|
@@ -571,6 +686,140 @@ declare class NhAssistantAdminAgentEditorComponent {
|
|
|
571
686
|
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>;
|
|
572
687
|
}
|
|
573
688
|
|
|
689
|
+
/**
|
|
690
|
+
* The application's editor of one entry of agent metadata (`AddAgentMetadata`): a standalone
|
|
691
|
+
* component that the agent editor renders in the entry's slot. It injects
|
|
692
|
+
* `NhAssistantAgentMetadataSlot` for the entry's value and saves the value with it; the library has no
|
|
693
|
+
* generic form for metadata.
|
|
694
|
+
*/
|
|
695
|
+
interface NhAssistantAgentMetadataEditor {
|
|
696
|
+
/** The entry's name, as the application registers it with `AddAgentMetadata`. */
|
|
697
|
+
name: string;
|
|
698
|
+
/** The application's standalone component that shows and edits the value. */
|
|
699
|
+
component: Type<unknown>;
|
|
700
|
+
/** A translation key of the slot's title; the entry's name without one. */
|
|
701
|
+
label?: string;
|
|
702
|
+
}
|
|
703
|
+
/** The editors the application registers for its entries of agent metadata, by entry name. */
|
|
704
|
+
declare const NH_ASSISTANT_AGENT_METADATA_EDITORS: InjectionToken<NhAssistantAgentMetadataEditor[]>;
|
|
705
|
+
/**
|
|
706
|
+
* Registers the application's editors of agent metadata, where the administration is provided (in
|
|
707
|
+
* the application's configuration or the providers of its administration route). The agent editor
|
|
708
|
+
* renders one slot per registered entry; an entry without an editor shows that the application shows
|
|
709
|
+
* none. Several calls add their editors.
|
|
710
|
+
*/
|
|
711
|
+
declare function provideNhAssistantAgentMetadataEditors(...editors: NhAssistantAgentMetadataEditor[]): EnvironmentProviders;
|
|
712
|
+
/** What the last change of an entry did, for the slot's status line. */
|
|
713
|
+
type NhAssistantAgentMetadataStatus = 'saved' | 'removed';
|
|
714
|
+
/**
|
|
715
|
+
* The slot of one entry of agent metadata, which an application's editor injects: the entry's value
|
|
716
|
+
* as the server answered it, whether it may change, and `save` and `remove`, which go through
|
|
717
|
+
* `NhAssistantAdminApiService` with the entry's version and keep the slot up to date. A refusal shows
|
|
718
|
+
* in `error`, with the validator's codes in `fieldErrors`.
|
|
719
|
+
*/
|
|
720
|
+
declare abstract class NhAssistantAgentMetadataSlot {
|
|
721
|
+
/** The agent's id. */
|
|
722
|
+
abstract readonly agentId: string;
|
|
723
|
+
/** The entry with its value in effect, where it comes from and its version. */
|
|
724
|
+
abstract readonly entry: Signal<AgentMetadata>;
|
|
725
|
+
/**
|
|
726
|
+
* Whether the value is read-only here: an entry of an agent in code that is not editable, or one
|
|
727
|
+
* whose value the agent's package locks until an administrator unlinks it.
|
|
728
|
+
*/
|
|
729
|
+
abstract readonly readOnly: Signal<boolean>;
|
|
730
|
+
/** Whether a change is being saved. */
|
|
731
|
+
abstract readonly saving: Signal<boolean>;
|
|
732
|
+
/** The refusal of the last change, or `null`. */
|
|
733
|
+
abstract readonly error: Signal<NhAssistantError | null>;
|
|
734
|
+
/** What the last change did, until the next one starts. */
|
|
735
|
+
abstract readonly status: Signal<NhAssistantAgentMetadataStatus | null>;
|
|
736
|
+
/**
|
|
737
|
+
* Saves `value`, in the shape of the entry's type, with the entry's version: an agent created here
|
|
738
|
+
* gets its next version, an agent in code an override. Ignored while read-only or saving.
|
|
739
|
+
*/
|
|
740
|
+
abstract save(value: unknown): void;
|
|
741
|
+
/** Removes the stored value: an agent in code uses its value in code again. */
|
|
742
|
+
abstract remove(): void;
|
|
743
|
+
/**
|
|
744
|
+
* The codes the server reported for the whole value, or for one of its fields by camelCase path
|
|
745
|
+
* such as `code`; empty without a refusal.
|
|
746
|
+
*/
|
|
747
|
+
abstract fieldErrors(field?: string): readonly string[];
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
/**
|
|
751
|
+
* The slot of one entry: its state as the server answered it, saved through the administration API
|
|
752
|
+
* with the entry's version.
|
|
753
|
+
*/
|
|
754
|
+
declare class NhAssistantAgentMetadataSlotRef extends NhAssistantAgentMetadataSlot {
|
|
755
|
+
readonly agentId: string;
|
|
756
|
+
private readonly admin;
|
|
757
|
+
private readonly changed;
|
|
758
|
+
private subscription?;
|
|
759
|
+
readonly entry: _angular_core.WritableSignal<AgentMetadata>;
|
|
760
|
+
readonly saving: _angular_core.WritableSignal<boolean>;
|
|
761
|
+
readonly error: _angular_core.WritableSignal<NhAssistantError | null>;
|
|
762
|
+
readonly status: _angular_core.WritableSignal<NhAssistantAgentMetadataStatus | null>;
|
|
763
|
+
/** The lock of the entry's package link (part `metadata:{name}`); `null` without one. */
|
|
764
|
+
readonly lock: _angular_core.Signal<PackageLockView | null>;
|
|
765
|
+
readonly readOnly: _angular_core.Signal<boolean>;
|
|
766
|
+
constructor(agentId: string, entry: AgentMetadata, admin: NhAssistantAdminApiService, changed: (entry: AgentMetadata) => void);
|
|
767
|
+
save(value: unknown): void;
|
|
768
|
+
remove(): void;
|
|
769
|
+
fieldErrors(field?: string): readonly string[];
|
|
770
|
+
/** The agent's next version after another entry of an agent created here changed. */
|
|
771
|
+
followAgentVersion(agentVersion: number): void;
|
|
772
|
+
dispose(): void;
|
|
773
|
+
private run;
|
|
774
|
+
}
|
|
775
|
+
/** One slot as the frame shows it. */
|
|
776
|
+
interface NhAssistantAgentMetadataSlotView {
|
|
777
|
+
name: string;
|
|
778
|
+
label: string | null;
|
|
779
|
+
component: Type<unknown> | null;
|
|
780
|
+
slot: NhAssistantAgentMetadataSlotRef;
|
|
781
|
+
injector: Injector;
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* The application fields of an agent in the agent editor (MD3): one slot per entry of agent
|
|
785
|
+
* metadata the application registers with `AddAgentMetadata`, where the application's own editor,
|
|
786
|
+
* registered with `provideNhAssistantAgentMetadataEditors`, shows the value and saves it through
|
|
787
|
+
* `NhAssistantAgentMetadataSlot`. The frame names the entry, says where its value comes from, marks
|
|
788
|
+
* an entry of an agent in code that only code changes, and shows what a save did. A change of an
|
|
789
|
+
* agent created here is its next version: `agentVersionChanged` tells the agent editor. A new agent
|
|
790
|
+
* shows its entries once it is saved. An entry the agent's package locks is read-only for its editor,
|
|
791
|
+
* with the package's id and version and "Unlink".
|
|
792
|
+
*/
|
|
793
|
+
declare class NhAssistantAgentMetadataComponent {
|
|
794
|
+
private readonly admin;
|
|
795
|
+
private readonly injector;
|
|
796
|
+
private readonly editors;
|
|
797
|
+
private subscription?;
|
|
798
|
+
/** The agent whose fields are shown; `null` for a new agent, which is saved first. */
|
|
799
|
+
readonly agent: _angular_core.InputSignal<AdminAgent | null>;
|
|
800
|
+
/** The run catalog's `agentMetadata`: the entries a new agent will have. */
|
|
801
|
+
readonly entries: _angular_core.InputSignal<readonly AgentMetadataEntry[]>;
|
|
802
|
+
/** The agent's version after a field of an agent created here changed. */
|
|
803
|
+
readonly agentVersionChanged: _angular_core.OutputEmitterRef<number>;
|
|
804
|
+
readonly id: string;
|
|
805
|
+
readonly loading: _angular_core.WritableSignal<boolean>;
|
|
806
|
+
readonly loadFailed: _angular_core.WritableSignal<boolean>;
|
|
807
|
+
readonly slots: _angular_core.WritableSignal<readonly NhAssistantAgentMetadataSlotView[]>;
|
|
808
|
+
readonly sourceKey: (entry: AgentMetadata) => string;
|
|
809
|
+
readonly errorKeys: typeof _nhAssistantErrorKeys;
|
|
810
|
+
constructor();
|
|
811
|
+
load(): void;
|
|
812
|
+
private slotOf;
|
|
813
|
+
/**
|
|
814
|
+
* A field of an agent created here made the agent's next version: the other fields and the agent
|
|
815
|
+
* editor continue on it. An override of an agent in code has a version of its own.
|
|
816
|
+
*/
|
|
817
|
+
private onChanged;
|
|
818
|
+
private disposeSlots;
|
|
819
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<NhAssistantAgentMetadataComponent, never>;
|
|
820
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<NhAssistantAgentMetadataComponent, "nh-assistant-agent-metadata", never, { "agent": { "alias": "agent"; "required": false; "isSignal": true; }; "entries": { "alias": "entries"; "required": false; "isSignal": true; }; }, { "agentVersionChanged": "agentVersionChanged"; }, never, never, true, never>;
|
|
821
|
+
}
|
|
822
|
+
|
|
574
823
|
/** Periods the evaluation offers, in days before now; the server allows at most 92. */
|
|
575
824
|
type NhAssistantEvaluationPeriod = 7 | 30 | 90;
|
|
576
825
|
/** One row of the cost comparison: a measure of the live agent next to the variant's. */
|
|
@@ -812,7 +1061,17 @@ interface ConsultationRow {
|
|
|
812
1061
|
/** The agents whose tool selectors select its consult tool now. */
|
|
813
1062
|
askingAgents: string[];
|
|
814
1063
|
inEffect: boolean;
|
|
1064
|
+
/**
|
|
1065
|
+
* The consultation defined as data is switched off: it is not offered until an administrator switches
|
|
1066
|
+
* it on. Its routes and tools are then those it was saved with, which it offers once it is on.
|
|
1067
|
+
*/
|
|
1068
|
+
off: boolean;
|
|
815
1069
|
problems: string[];
|
|
1070
|
+
/**
|
|
1071
|
+
* The tools the consulted agent is offered: the selection in code, or the one of the data that the
|
|
1072
|
+
* agent's own selectors still cover. `null` offers every tool of the agent; empty offers none.
|
|
1073
|
+
*/
|
|
1074
|
+
toolSelectors: string[] | null;
|
|
816
1075
|
/** The consultation defined as data; `null` for one in code. */
|
|
817
1076
|
data: DataConsultation | null;
|
|
818
1077
|
code: CodeConsultation | null;
|
|
@@ -826,6 +1085,20 @@ interface ConsultationRow {
|
|
|
826
1085
|
*/
|
|
827
1086
|
type ConsultationsClosed = 'application' | 'agent' | 'needs-settings' | 'limit' | 'no-types';
|
|
828
1087
|
|
|
1088
|
+
/** A part of a trigger's definition that a candidate changes. */
|
|
1089
|
+
type TriggerField = 'source' | 'event' | 'filters' | 'debounce' | 'cron' | 'time-zone' | 'subject-set' | 'message' | 'skill' | 'conflict';
|
|
1090
|
+
/**
|
|
1091
|
+
* One difference between the live version of a trigger and its candidate, with the values as stored:
|
|
1092
|
+
* a skill id, a conflict or a source the page names in the reader's language, `null` for none.
|
|
1093
|
+
*/
|
|
1094
|
+
interface TriggerChange {
|
|
1095
|
+
field: TriggerField;
|
|
1096
|
+
live: string | null;
|
|
1097
|
+
candidate: string | null;
|
|
1098
|
+
}
|
|
1099
|
+
/** The short definition of a version in the history: what starts it and when. */
|
|
1100
|
+
declare function versionSummary(version: DataTriggerVersion): string;
|
|
1101
|
+
|
|
829
1102
|
/**
|
|
830
1103
|
* What an entry point of the flow opens: the run configuration opens its own forms; the agent editor,
|
|
831
1104
|
* the technical account, the runs view and the MCP servers belong to the page that hosts it.
|
|
@@ -876,7 +1149,7 @@ interface SkillFormSaved {
|
|
|
876
1149
|
type Form = 'setup' | 'settings' | 'skill' | 'trigger' | 'consultation';
|
|
877
1150
|
/** A removal, promotion or discard that waits for its confirmation. */
|
|
878
1151
|
interface Confirmation {
|
|
879
|
-
action: 'remove-settings' | 'remove-skill' | 'remove-trigger' | 'remove-consultation' | 'promote' | 'discard';
|
|
1152
|
+
action: 'remove-settings' | 'remove-skill' | 'remove-trigger' | 'remove-consultation' | 'promote' | 'discard' | 'promote-trigger' | 'discard-trigger';
|
|
880
1153
|
id: string;
|
|
881
1154
|
}
|
|
882
1155
|
/**
|
|
@@ -891,11 +1164,14 @@ interface Confirmation {
|
|
|
891
1164
|
* they compare with the live version and promote or discard; they add data triggers on the
|
|
892
1165
|
* application's events or on a schedule and put them live; a schedule without a subject set runs for
|
|
893
1166
|
* the whole application, or for every division of an agent that works per division. New skills and
|
|
894
|
-
* triggers start in shadow;
|
|
1167
|
+
* triggers start in shadow; a change of a trigger applies at once or fires as a candidate in shadow next
|
|
1168
|
+
* to the live version, which they compare, promote or discard, and every trigger shows its history.
|
|
1169
|
+
* `changed` tells the agents page to reload the agent's skill states. Its
|
|
895
1170
|
* consultations (AC20) show what other assistants may consult it about: those in code read only, and
|
|
896
1171
|
* those defined as data, which administrators add, change and remove within the agent's ceiling in
|
|
897
|
-
* code, each with the agents that ask it (`openAgent` opens the editor of one) and its problems,
|
|
898
|
-
* followed by the switches that turn a route off for all of
|
|
1172
|
+
* code, each with the agents that ask it (`openAgent` opens the editor of one) and its problems, and
|
|
1173
|
+
* switch on or off (a new one may start off), followed by the switches that turn a route off for all of
|
|
1174
|
+
* its consultations.
|
|
899
1175
|
*/
|
|
900
1176
|
declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
|
|
901
1177
|
private readonly admin;
|
|
@@ -982,6 +1258,18 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
|
|
|
982
1258
|
items: DataSkillVersion[] | null;
|
|
983
1259
|
failed: boolean;
|
|
984
1260
|
} | null>;
|
|
1261
|
+
readonly triggerComparison: _angular_core.WritableSignal<{
|
|
1262
|
+
triggerId: string;
|
|
1263
|
+
result: TriggerComparison | null;
|
|
1264
|
+
failed: boolean;
|
|
1265
|
+
} | null>;
|
|
1266
|
+
readonly triggerVersions: _angular_core.WritableSignal<{
|
|
1267
|
+
triggerId: string;
|
|
1268
|
+
items: DataTriggerVersion[] | null;
|
|
1269
|
+
failed: boolean;
|
|
1270
|
+
} | null>;
|
|
1271
|
+
readonly triggerFieldKeys: Record<TriggerField, string>;
|
|
1272
|
+
readonly versionSummary: typeof versionSummary;
|
|
985
1273
|
private readonly language;
|
|
986
1274
|
readonly isAdminAgent: _angular_core.Signal<boolean>;
|
|
987
1275
|
/** An agent created in the administration gets skills and triggers once it has run settings. */
|
|
@@ -1006,6 +1294,10 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
|
|
|
1006
1294
|
readonly settingsPolicy: _angular_core.Signal<string | null>;
|
|
1007
1295
|
constructor();
|
|
1008
1296
|
ngOnInit(): void;
|
|
1297
|
+
/** The lock a part's package link shows, for the lists and the forms. */
|
|
1298
|
+
readonly packageLockOf: typeof packageLockOf;
|
|
1299
|
+
/** Whether a part's package locks it, so it cannot be removed until it is unlinked. */
|
|
1300
|
+
readonly isPackageLocked: typeof isPackageLocked;
|
|
1009
1301
|
load(openSetup?: boolean): void;
|
|
1010
1302
|
openSetup(): void;
|
|
1011
1303
|
editSettings(): void;
|
|
@@ -1020,11 +1312,23 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
|
|
|
1020
1312
|
/** Shows or hides the version history of a skill. */
|
|
1021
1313
|
toggleVersions(skill: DataSkill): void;
|
|
1022
1314
|
addTrigger(): void;
|
|
1315
|
+
/** What a trigger's candidate changes against its live version. */
|
|
1316
|
+
triggerChanges(trigger: DataTrigger): TriggerChange[];
|
|
1317
|
+
/** A value of a changed field as people read it: a skill's name, a conflict, a source, or none. */
|
|
1318
|
+
changeValue(change: TriggerChange, value: string | null): string;
|
|
1319
|
+
promoteTrigger(trigger: DataTrigger): void;
|
|
1320
|
+
discardTrigger(trigger: DataTrigger): void;
|
|
1321
|
+
/** Shows or hides the comparison of a trigger's candidate with its live version. */
|
|
1322
|
+
toggleTriggerComparison(trigger: DataTrigger): void;
|
|
1323
|
+
/** Shows or hides the version history of a trigger. */
|
|
1324
|
+
toggleTriggerVersions(trigger: DataTrigger): void;
|
|
1023
1325
|
editTrigger(trigger: DataTrigger): void;
|
|
1024
1326
|
setTriggerShadow(trigger: DataTrigger, shadow: boolean): void;
|
|
1025
1327
|
removeTrigger(trigger: DataTrigger): void;
|
|
1026
1328
|
addConsultation(): void;
|
|
1027
1329
|
editConsultation(consultation: DataConsultation): void;
|
|
1330
|
+
/** Switches a consultation defined as data on or off; off, asking agents get none of its tools. */
|
|
1331
|
+
setConsultationState(consultation: DataConsultation, on: boolean): void;
|
|
1028
1332
|
removeConsultation(consultation: DataConsultation): void;
|
|
1029
1333
|
onConsultationSaved(result: ConsultationFormSaved): void;
|
|
1030
1334
|
/** The name of a subject type, as the run catalog names it in the reader's language. */
|
|
@@ -1039,7 +1343,10 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
|
|
|
1039
1343
|
onSetupCompleted(live: boolean): void;
|
|
1040
1344
|
onSettingsSaved(): void;
|
|
1041
1345
|
onSkillSaved(result: SkillFormSaved): void;
|
|
1042
|
-
onTriggerSaved(
|
|
1346
|
+
onTriggerSaved(result: {
|
|
1347
|
+
added: boolean;
|
|
1348
|
+
candidate: boolean;
|
|
1349
|
+
}): void;
|
|
1043
1350
|
confirm(action: Confirmation['action'], id: string): void;
|
|
1044
1351
|
isConfirming(action: Confirmation['action'], id: string): boolean;
|
|
1045
1352
|
/**
|
|
@@ -1062,6 +1369,8 @@ declare class NhAssistantAgentRunConfigurationComponent implements OnInit {
|
|
|
1062
1369
|
private finish;
|
|
1063
1370
|
/** Opens one form at a time and moves the focus into it. */
|
|
1064
1371
|
private open;
|
|
1372
|
+
/** One comparison or history is shown at a time. */
|
|
1373
|
+
private closeDetails;
|
|
1065
1374
|
/** Whether the last failed action concerned this item, so its error shows there. */
|
|
1066
1375
|
failed(target: string): boolean;
|
|
1067
1376
|
/** Runs a change and reloads the configuration, which every change may affect. */
|
|
@@ -1429,5 +1738,5 @@ declare class NhAssistantAdminMcpToolsComponent {
|
|
|
1429
1738
|
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>;
|
|
1430
1739
|
}
|
|
1431
1740
|
|
|
1432
|
-
export { NH_ASSISTANT_MAX_INSTRUCTIONS, NhAssistantAdminAgentEditorComponent, NhAssistantAdminAgentsComponent, NhAssistantAdminComponent, NhAssistantAdminContextComponent, NhAssistantAdminMcpServerEditorComponent, NhAssistantAdminMcpServersComponent, NhAssistantAdminMcpToolsComponent, NhAssistantAgentEvaluationComponent, NhAssistantAgentFeedbackReportComponent, NhAssistantAgentRunConfigurationComponent, NhAssistantAgentRunHistoryComponent, nhAssistantSelectorMatches };
|
|
1433
|
-
export type { AgentUse, NhAssistantAdminTab, NhAssistantEvaluationPeriod, NhAssistantFeedbackPeriod, NhAssistantReaderDraft, NhAssistantSecretAction, NhAssistantSecretSource, WorksOnScope };
|
|
1741
|
+
export { NH_ASSISTANT_AGENT_METADATA_EDITORS, NH_ASSISTANT_MAX_INSTRUCTIONS, NhAssistantAdminAgentEditorComponent, NhAssistantAdminAgentsComponent, NhAssistantAdminComponent, NhAssistantAdminContextComponent, NhAssistantAdminMcpServerEditorComponent, NhAssistantAdminMcpServersComponent, NhAssistantAdminMcpToolsComponent, NhAssistantAgentEvaluationComponent, NhAssistantAgentFeedbackReportComponent, NhAssistantAgentMetadataComponent, NhAssistantAgentMetadataSlot, NhAssistantAgentRunConfigurationComponent, NhAssistantAgentRunHistoryComponent, nhAssistantSelectorMatches, provideNhAssistantAgentMetadataEditors };
|
|
1742
|
+
export type { AgentUse, NhAssistantAdminTab, NhAssistantAgentMetadataEditor, NhAssistantAgentMetadataStatus, NhAssistantEvaluationPeriod, NhAssistantFeedbackPeriod, NhAssistantReaderDraft, NhAssistantSecretAction, NhAssistantSecretSource, WorksOnScope };
|
package/agent-runs/index.d.ts
CHANGED
|
@@ -366,6 +366,11 @@ declare class NhAssistantAgentProposalsComponent {
|
|
|
366
366
|
decide(proposal: AgentProposal, decision: AgentProposalDecision): void;
|
|
367
367
|
decideSelected(decision: AgentProposalDecision): void;
|
|
368
368
|
resolve(proposal: AgentProposal, action: AgentExecutionResolution): void;
|
|
369
|
+
/**
|
|
370
|
+
* Whether the application executes the proposal: it was handed to the application, so an approver
|
|
371
|
+
* resolves an unknown outcome by handing it to the application again instead of running it.
|
|
372
|
+
*/
|
|
373
|
+
executedByApplication(proposal: AgentProposal): boolean;
|
|
369
374
|
/** Opens the feedback question in the card of a closed proposal, with the caller's own feedback. */
|
|
370
375
|
giveFeedback(proposal: AgentProposal): void;
|
|
371
376
|
/** True while the feedback question for this proposal is open, above the list or in its card. */
|