@newheap/platform-ai-chat 0.15.0 → 0.17.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 +13 -0
- package/admin/index.d.ts +106 -13
- package/agent-runs/index.d.ts +147 -4
- package/fesm2022/newheap-platform-ai-chat-admin.mjs +496 -40
- package/fesm2022/newheap-platform-ai-chat-admin.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat-agent-runs.mjs +297 -30
- package/fesm2022/newheap-platform-ai-chat-agent-runs.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat-testing.mjs +696 -56
- package/fesm2022/newheap-platform-ai-chat-testing.mjs.map +1 -1
- package/fesm2022/newheap-platform-ai-chat.mjs +1110 -66
- package/fesm2022/newheap-platform-ai-chat.mjs.map +1 -1
- package/i18n/en.json +148 -9
- package/i18n/nl.json +148 -9
- package/index.d.ts +535 -39
- package/package.json +1 -1
- package/testing/index.d.ts +75 -7
package/package.json
CHANGED
package/testing/index.d.ts
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { AssistantStatus, AgentSummary, Conversation, ClientContext, AssistantPreferences, ToolCatalogEntry, AdminAgentInput, CodeRunSettings, AgentRunSettingsRequest, DataSkillRequest, DataTriggerRequest, McpServerInput, McpCustomAuthMode, McpDiscovery, RunCatalog, AssistantAccount, AgentRunStatus, AgentTriggerReceipt, AgentRunMcpSkip, ApprovalPresentation, AgentProposalStatus, AgentProposalOrigin, NhAssistantMcpAuthorizationWindow, NhAssistantMcpAuthorizationOutcome, NhAssistantMcpAuthorizationHandle, LiveConversationChanged, LiveConversationRead, LiveConversationRemoved, LiveConversationEvent, LiveAgentWorkChanged, NhAssistantLiveService, NhAssistantLiveState } from '@newheap/platform-ai-chat';
|
|
1
|
+
import { AssistantStatus, AgentSummary, Conversation, ClientContext, AssistantPreferences, ToolCatalogEntry, AdminAgentInput, CodeRunSettings, AgentRunSettingsRequest, DataSkillRequest, DataTriggerRequest, McpServerInput, McpCustomAuthMode, McpDiscovery, RunCatalog, AssistantDataClassification, AssistantAccount, AgentRunStatus, AgentTriggerReceipt, AgentRunMcpSkip, ApprovalPresentation, AgentProposalStatus, AgentProposalOrigin, AgentProposalParent, NhAssistantMcpAuthorizationWindow, NhAssistantMcpAuthorizationOutcome, NhAssistantMcpAuthorizationHandle, LiveConversationChanged, LiveConversationRead, LiveConversationRemoved, LiveConversationEvent, LiveAgentWorkChanged, FileReference, NhAssistantUploadRequest, NhAssistantLiveService, NhAssistantLiveState } from '@newheap/platform-ai-chat';
|
|
2
2
|
import * as _angular_core from '@angular/core';
|
|
3
3
|
import { InjectionToken, EnvironmentProviders } from '@angular/core';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
|
|
6
|
+
/** An upload as the application's file source receives it, after the assistant's checks. */
|
|
7
|
+
interface NhAssistantMockUpload {
|
|
8
|
+
conversationId: string;
|
|
9
|
+
name: string;
|
|
10
|
+
mediaType: string;
|
|
11
|
+
size: number;
|
|
12
|
+
}
|
|
13
|
+
|
|
6
14
|
/** Streams text as `message.delta` events, split into word-sized pieces. */
|
|
7
15
|
interface NhAssistantMockTextStep {
|
|
8
16
|
/** Fixed text, or text built from the page context the client sent with the message. */
|
|
@@ -107,14 +115,21 @@ interface NhAssistantMockMcpServer extends McpServerInput {
|
|
|
107
115
|
/** A server each person connects to starts with the caller's own account connected. */
|
|
108
116
|
personalConnected?: boolean;
|
|
109
117
|
}
|
|
110
|
-
/**
|
|
118
|
+
/**
|
|
119
|
+
* A preconfigured agent. Code agents default to the scenario's chat agents. `startsOff` starts it
|
|
120
|
+
* off, as `StartsOff()` in code does for an agent in code.
|
|
121
|
+
*/
|
|
111
122
|
interface NhAssistantMockAdminAgent extends AdminAgentInput {
|
|
112
123
|
source: 'code' | 'admin';
|
|
113
|
-
/**
|
|
124
|
+
/**
|
|
125
|
+
* The skills of a code agent, by id and description; they start active, in shadow with `shadow`
|
|
126
|
+
* and off with `startsOff`, as `StartsOff()` in code.
|
|
127
|
+
*/
|
|
114
128
|
skills?: {
|
|
115
129
|
skillId: string;
|
|
116
130
|
description: string;
|
|
117
131
|
shadow?: boolean;
|
|
132
|
+
startsOff?: boolean;
|
|
118
133
|
}[];
|
|
119
134
|
/** The live agent this code agent is a shadow variant of. */
|
|
120
135
|
shadowOf?: string;
|
|
@@ -212,6 +227,13 @@ interface NhAssistantMockAdminScenario {
|
|
|
212
227
|
* administration work per division, as an application that lists its divisions does.
|
|
213
228
|
*/
|
|
214
229
|
runCatalog?: Partial<RunCatalog>;
|
|
230
|
+
/**
|
|
231
|
+
* The data classifications each model profile and its fallbacks permit together, by profile name.
|
|
232
|
+
* An agent or skill whose classification its profile does not permit is saved with the warning
|
|
233
|
+
* `classification-not-permitted`, as on the server. A profile that is not listed permits every
|
|
234
|
+
* classification. Default: none.
|
|
235
|
+
*/
|
|
236
|
+
profileClassifications?: Record<string, AssistantDataClassification[]>;
|
|
215
237
|
/**
|
|
216
238
|
* Triggers in code, per agent; they cannot change in the administration. `subjectType` is the type
|
|
217
239
|
* a trigger names up front, `nh-system` for a schedule for the whole application.
|
|
@@ -432,6 +454,21 @@ interface NhAssistantMockScenario {
|
|
|
432
454
|
* the approval inbox, their thread and their subject's work list them, and people decide them.
|
|
433
455
|
*/
|
|
434
456
|
proposals?: NhAssistantMockProposal[];
|
|
457
|
+
/**
|
|
458
|
+
* The application's own answer to an upload that passed the assistant's checks: `null` stores it,
|
|
459
|
+
* a code refuses it as the server passes the file source's refusal on, for example
|
|
460
|
+
* `'application-virus-found'` as `assistant-file-upload-refused`. People attach files to messages for
|
|
461
|
+
* the agents whose summary in `agents` lists `uploads`; without such an agent the application keeps
|
|
462
|
+
* no files for the assistant. Default: every upload is stored.
|
|
463
|
+
*/
|
|
464
|
+
refuseUpload?: (upload: NhAssistantMockUpload) => string | null;
|
|
465
|
+
/**
|
|
466
|
+
* The application's upload scanner (`INhAssistantUploadScanner`), which the server runs after the
|
|
467
|
+
* checks of type, size and signature and before the file source: `'refused'` refuses the upload with
|
|
468
|
+
* `assistant-file-scan-refused`, `'failed'` with `assistant-file-upload-failed`, `null` lets it pass.
|
|
469
|
+
* Default: no scanner, as on a server without one.
|
|
470
|
+
*/
|
|
471
|
+
scanUpload?: (upload: NhAssistantMockUpload) => 'refused' | 'failed' | null;
|
|
435
472
|
}
|
|
436
473
|
/**
|
|
437
474
|
* A proposal an agent left, as the mock serves it; the mock fills what it leaves out. With
|
|
@@ -454,6 +491,17 @@ interface NhAssistantMockProposal {
|
|
|
454
491
|
status?: AgentProposalStatus;
|
|
455
492
|
rationale?: string | null;
|
|
456
493
|
placedBy?: AgentProposalOrigin | null;
|
|
494
|
+
/**
|
|
495
|
+
* The subject the proposal's subject belonged to when it was made, such as the project of a task;
|
|
496
|
+
* the grouped inbox groups by it. Default none.
|
|
497
|
+
*/
|
|
498
|
+
parent?: AgentProposalParent | null;
|
|
499
|
+
/** The division of the proposal's subject, which the inbox's `divisionId` filter matches. Default none. */
|
|
500
|
+
divisionId?: string | null;
|
|
501
|
+
/** When the proposal was made, an ISO date. Default when the mock started. */
|
|
502
|
+
createdAt?: string;
|
|
503
|
+
/** When the proposal expires, an ISO date. Default three days after it was made. */
|
|
504
|
+
expiresAt?: string;
|
|
457
505
|
/**
|
|
458
506
|
* Whether the signed-in user may decide it. Default `true`. A proposal of the whole application
|
|
459
507
|
* (`nh-system`) exists only for its approvers who pass the agent's view policy, by default its
|
|
@@ -536,6 +584,7 @@ declare class NhAssistantMockBackend {
|
|
|
536
584
|
private readonly shareTokens;
|
|
537
585
|
private readonly activeActors;
|
|
538
586
|
private readonly liveSubject;
|
|
587
|
+
private readonly files;
|
|
539
588
|
private pushEnabled;
|
|
540
589
|
private sequence;
|
|
541
590
|
/** Requests received so far, oldest first. */
|
|
@@ -569,6 +618,19 @@ declare class NhAssistantMockBackend {
|
|
|
569
618
|
* (`reauthorization-required`) or another authorization server (`issuer-changed`).
|
|
570
619
|
*/
|
|
571
620
|
setMcpConnectionStatus(serverId: string, status: 'reauthorization-required' | 'issuer-changed'): void;
|
|
621
|
+
/** The files people uploaded, oldest first, as the application's file source stored them. */
|
|
622
|
+
get uploads(): readonly {
|
|
623
|
+
conversationId: string;
|
|
624
|
+
name: string;
|
|
625
|
+
mediaType: string;
|
|
626
|
+
size: number;
|
|
627
|
+
reference: FileReference;
|
|
628
|
+
}[];
|
|
629
|
+
/**
|
|
630
|
+
* An upload implementation (`NH_ASSISTANT_UPLOAD`) that answers `POST conversations/{id}/files` with
|
|
631
|
+
* the server's checks, after reporting the progress in four steps.
|
|
632
|
+
*/
|
|
633
|
+
readonly upload: (request: NhAssistantUploadRequest) => Promise<Response>;
|
|
572
634
|
/** A `fetch` implementation that answers the assistant endpoints below `apiBaseUrl`. */
|
|
573
635
|
readonly fetch: (input: string, init: RequestInit) => Promise<Response>;
|
|
574
636
|
private route;
|
|
@@ -603,6 +665,12 @@ declare class NhAssistantMockBackend {
|
|
|
603
665
|
private maxParticipants;
|
|
604
666
|
/** A contract error with the one status the server gives its code. */
|
|
605
667
|
private error;
|
|
668
|
+
/** The path below `apiBaseUrl`, or `null` for another URL. */
|
|
669
|
+
private pathOf;
|
|
670
|
+
/** Whether the application keeps files for the assistant: an agent of the scenario takes uploads. */
|
|
671
|
+
private offersFiles;
|
|
672
|
+
/** What people may attach to a message to the agent, as its summary says. */
|
|
673
|
+
private uploadsOf;
|
|
606
674
|
/**
|
|
607
675
|
* Whether the caller decides the agent's proposals of the whole application: an approver of the whole
|
|
608
676
|
* application (an administrator in the mock) who passes the agent's view policy, by default its
|
|
@@ -662,11 +730,11 @@ declare class NhAssistantMockLiveService implements NhAssistantLiveSurface {
|
|
|
662
730
|
* Replaces the assistant transport with an in-memory back-end that plays `script`.
|
|
663
731
|
* Register it after `provideNhAssistant(...)` in the same injector. Every client feature
|
|
664
732
|
* (status, agents, conversations, streamed turns, approvals, cancellation, sharing, read
|
|
665
|
-
* state, live updates and MCP authorizations) then works without a
|
|
666
|
-
* `NhAssistantMockBackend` to switch the feature flag, simulate a colleague or
|
|
667
|
-
* received requests.
|
|
733
|
+
* state, live updates, uploads with their progress and MCP authorizations) then works without a
|
|
734
|
+
* server. Inject `NhAssistantMockBackend` to switch the feature flag, simulate a colleague or
|
|
735
|
+
* inspect the received requests and uploads.
|
|
668
736
|
*/
|
|
669
737
|
declare function provideNhAssistantMockApi(script: NhAssistantMockScenario): EnvironmentProviders;
|
|
670
738
|
|
|
671
739
|
export { NH_ASSISTANT_MOCK_HUB_PATH, NH_ASSISTANT_MOCK_SCENARIO, NhAssistantMockAuthorizationWindow, NhAssistantMockBackend, NhAssistantMockLiveService, provideNhAssistantMockApi };
|
|
672
|
-
export type { NhAssistantMockAdminAgent, NhAssistantMockAdminScenario, NhAssistantMockAgentGroup, NhAssistantMockApprovalStep, NhAssistantMockCollaboration, NhAssistantMockConnectionStep, NhAssistantMockDataSkill, NhAssistantMockDataTrigger, NhAssistantMockDivision, NhAssistantMockErrorStep, NhAssistantMockFailStep, NhAssistantMockLiveMessage, NhAssistantMockMcpServer, NhAssistantMockPerson, NhAssistantMockProposal, NhAssistantMockRemoteTool, NhAssistantMockRequest, NhAssistantMockRun, NhAssistantMockRunConfigurationPreset, NhAssistantMockRunNow, NhAssistantMockScenario, NhAssistantMockStep, NhAssistantMockSubject, NhAssistantMockSubjectType, NhAssistantMockTextStep, NhAssistantMockTiming, NhAssistantMockToolStep, NhAssistantMockTurn };
|
|
740
|
+
export type { NhAssistantMockAdminAgent, NhAssistantMockAdminScenario, NhAssistantMockAgentGroup, NhAssistantMockApprovalStep, NhAssistantMockCollaboration, NhAssistantMockConnectionStep, NhAssistantMockDataSkill, NhAssistantMockDataTrigger, NhAssistantMockDivision, NhAssistantMockErrorStep, NhAssistantMockFailStep, NhAssistantMockLiveMessage, NhAssistantMockMcpServer, NhAssistantMockPerson, NhAssistantMockProposal, NhAssistantMockRemoteTool, NhAssistantMockRequest, NhAssistantMockRun, NhAssistantMockRunConfigurationPreset, NhAssistantMockRunNow, NhAssistantMockScenario, NhAssistantMockStep, NhAssistantMockSubject, NhAssistantMockSubjectType, NhAssistantMockTextStep, NhAssistantMockTiming, NhAssistantMockToolStep, NhAssistantMockTurn, NhAssistantMockUpload };
|