@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newheap/platform-ai-chat",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": "^20.2.14",
6
6
  "@angular/common": "^20.3.28",
@@ -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, 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
- /** A preconfigured agent. Code agents default to the scenario's chat agents. */
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
- /** The skills of a code agent, by id and description; they start active, and in shadow with `shadow`. */
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
@@ -536,6 +573,7 @@ declare class NhAssistantMockBackend {
536
573
  private readonly shareTokens;
537
574
  private readonly activeActors;
538
575
  private readonly liveSubject;
576
+ private readonly files;
539
577
  private pushEnabled;
540
578
  private sequence;
541
579
  /** Requests received so far, oldest first. */
@@ -569,6 +607,19 @@ declare class NhAssistantMockBackend {
569
607
  * (`reauthorization-required`) or another authorization server (`issuer-changed`).
570
608
  */
571
609
  setMcpConnectionStatus(serverId: string, status: 'reauthorization-required' | 'issuer-changed'): void;
610
+ /** The files people uploaded, oldest first, as the application's file source stored them. */
611
+ get uploads(): readonly {
612
+ conversationId: string;
613
+ name: string;
614
+ mediaType: string;
615
+ size: number;
616
+ reference: FileReference;
617
+ }[];
618
+ /**
619
+ * An upload implementation (`NH_ASSISTANT_UPLOAD`) that answers `POST conversations/{id}/files` with
620
+ * the server's checks, after reporting the progress in four steps.
621
+ */
622
+ readonly upload: (request: NhAssistantUploadRequest) => Promise<Response>;
572
623
  /** A `fetch` implementation that answers the assistant endpoints below `apiBaseUrl`. */
573
624
  readonly fetch: (input: string, init: RequestInit) => Promise<Response>;
574
625
  private route;
@@ -603,6 +654,12 @@ declare class NhAssistantMockBackend {
603
654
  private maxParticipants;
604
655
  /** A contract error with the one status the server gives its code. */
605
656
  private error;
657
+ /** The path below `apiBaseUrl`, or `null` for another URL. */
658
+ private pathOf;
659
+ /** Whether the application keeps files for the assistant: an agent of the scenario takes uploads. */
660
+ private offersFiles;
661
+ /** What people may attach to a message to the agent, as its summary says. */
662
+ private uploadsOf;
606
663
  /**
607
664
  * Whether the caller decides the agent's proposals of the whole application: an approver of the whole
608
665
  * application (an administrator in the mock) who passes the agent's view policy, by default its
@@ -662,11 +719,11 @@ declare class NhAssistantMockLiveService implements NhAssistantLiveSurface {
662
719
  * Replaces the assistant transport with an in-memory back-end that plays `script`.
663
720
  * Register it after `provideNhAssistant(...)` in the same injector. Every client feature
664
721
  * (status, agents, conversations, streamed turns, approvals, cancellation, sharing, read
665
- * state, live updates and MCP authorizations) then works without a server. Inject
666
- * `NhAssistantMockBackend` to switch the feature flag, simulate a colleague or inspect the
667
- * received requests.
722
+ * state, live updates, uploads with their progress and MCP authorizations) then works without a
723
+ * server. Inject `NhAssistantMockBackend` to switch the feature flag, simulate a colleague or
724
+ * inspect the received requests and uploads.
668
725
  */
669
726
  declare function provideNhAssistantMockApi(script: NhAssistantMockScenario): EnvironmentProviders;
670
727
 
671
728
  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 };
729
+ 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 };