@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/package.json
CHANGED
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
* It shows a notification only when no window of the application is focused; otherwise it
|
|
9
9
|
* forwards the message to the open windows, which already show the conversation live. A click
|
|
10
10
|
* focuses an open window and opens the conversation there, or opens `app` with the conversation
|
|
11
|
-
* in the URL fragment.
|
|
11
|
+
* in the URL fragment. A notification about the proposals of a run also carries the run, which the
|
|
12
|
+
* click forwards, so the application can open its inbox of the run (`openRun$`). Notifications
|
|
13
|
+
* carry a conversation id, a run id and short texts only.
|
|
12
14
|
*/
|
|
13
15
|
const settings = new URL(self.location.href).searchParams;
|
|
14
16
|
const appUrl = settings.get('app') || '/';
|
|
@@ -27,12 +29,13 @@ self.addEventListener('push', event => {
|
|
|
27
29
|
if (!payload || payload.type !== 'nh-assistant' || typeof payload.conversationId !== 'string') {
|
|
28
30
|
return;
|
|
29
31
|
}
|
|
32
|
+
const runId = typeof payload.runId === 'string' ? payload.runId : undefined;
|
|
30
33
|
|
|
31
34
|
event.waitUntil((async () => {
|
|
32
35
|
const windows = await self.clients.matchAll({ type: 'window', includeUncontrolled: true });
|
|
33
36
|
if (windows.some(client => client.focused && client.visibilityState === 'visible')) {
|
|
34
37
|
for (const client of windows) {
|
|
35
|
-
client.postMessage({ type: 'nh-assistant.push', kind: payload.kind, conversationId: payload.conversationId });
|
|
38
|
+
client.postMessage({ type: 'nh-assistant.push', kind: payload.kind, conversationId: payload.conversationId, runId });
|
|
36
39
|
}
|
|
37
40
|
return;
|
|
38
41
|
}
|
|
@@ -42,29 +45,33 @@ self.addEventListener('push', event => {
|
|
|
42
45
|
tag: String(payload.tag || `nh-assistant:${payload.conversationId}`),
|
|
43
46
|
renotify: true,
|
|
44
47
|
icon: iconUrl,
|
|
45
|
-
data: { conversationId: payload.conversationId }
|
|
48
|
+
data: { conversationId: payload.conversationId, runId }
|
|
46
49
|
});
|
|
47
50
|
})());
|
|
48
51
|
});
|
|
49
52
|
|
|
50
53
|
self.addEventListener('notificationclick', event => {
|
|
51
54
|
event.notification.close();
|
|
52
|
-
const
|
|
55
|
+
const data = event.notification.data || {};
|
|
56
|
+
const conversationId = data.conversationId;
|
|
53
57
|
if (typeof conversationId !== 'string') {
|
|
54
58
|
return;
|
|
55
59
|
}
|
|
60
|
+
const runId = typeof data.runId === 'string' ? data.runId : undefined;
|
|
56
61
|
|
|
57
62
|
event.waitUntil((async () => {
|
|
58
63
|
const windows = await self.clients.matchAll({ type: 'window', includeUncontrolled: true });
|
|
59
64
|
const target = windows.find(client => client.focused) || windows[0];
|
|
60
65
|
if (target) {
|
|
61
66
|
await target.focus();
|
|
62
|
-
target.postMessage({ type: 'nh-assistant.open-conversation', conversationId });
|
|
67
|
+
target.postMessage({ type: 'nh-assistant.open-conversation', conversationId, runId });
|
|
63
68
|
return;
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
const url = new URL(appUrl, self.location.origin);
|
|
67
|
-
url.hash =
|
|
72
|
+
url.hash = runId
|
|
73
|
+
? `nh-assistant-run=${encodeURIComponent(runId)}.${encodeURIComponent(conversationId)}`
|
|
74
|
+
: `nh-assistant-conversation=${encodeURIComponent(conversationId)}`;
|
|
68
75
|
await self.clients.openWindow(url.href);
|
|
69
76
|
})());
|
|
70
77
|
});
|
package/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AssistantStatus, AgentSummary, Conversation, ClientContext, NhAssistantConsultationLeaveRoute, AssistantPreferences, ToolCatalogEntry, AdminAgentInput, NhAssistantConsultationRoute, DataConsultationRequest, CodeRunSettings, AgentRunSettingsRequest, DataSkillRequest, DataTriggerRequest, McpServerInput, McpCustomAuthMode, McpDiscovery, RunCatalog, AssistantDataClassification, AssistantAccount, AgentRunStatus, AgentTriggerReceipt, AgentRunMcpSkip, ApprovalPresentation, AgentProposalStatus, AgentProposalOrigin, AgentProposalParent, AgentGrantSource, AgentConsultationStatus, NhAssistantMcpAuthorizationWindow, NhAssistantMcpAuthorizationOutcome, NhAssistantMcpAuthorizationHandle, LiveConversationChanged, LiveConversationRead, LiveConversationRemoved, LiveConversationEvent, LiveAgentWorkChanged, ApplicationMessageDetails, Message, FileReference, NhAssistantUploadRequest, NhAssistantLiveService, NhAssistantLiveState } from '@newheap/platform-ai-chat';
|
|
1
|
+
import { AssistantStatus, AgentSummary, Conversation, ClientContext, NhAssistantConsultationLeaveRoute, AssistantPreferences, ToolCatalogEntry, AdminAgentInput, NhAssistantConsultationRoute, DataConsultationRequest, CodeRunSettings, AgentRunSettingsRequest, DataSkillRequest, DataTriggerRequest, McpServerInput, McpCustomAuthMode, McpDiscovery, RunCatalog, AssistantDataClassification, AssistantAccount, AgentPackage, AgentRunStatus, AgentTriggerReceipt, AgentRunMcpSkip, ApprovalPresentation, AgentProposalStatus, AgentProposalOrigin, AgentProposalParent, AgentGrantSource, AgentConsultationStatus, NhAssistantMcpAuthorizationWindow, NhAssistantMcpAuthorizationOutcome, NhAssistantMcpAuthorizationHandle, LiveConversationChanged, LiveConversationRead, LiveConversationRemoved, LiveConversationEvent, LiveAgentWorkChanged, ApplicationMessageDetails, Message, 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';
|
|
@@ -80,6 +80,24 @@ interface NhAssistantMockApprovalConsultation {
|
|
|
80
80
|
/** The consulted agent's answer. Default none. */
|
|
81
81
|
answer?: string | null;
|
|
82
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Asks a question with `ask_question`: `tool.started`, `question.asked` and `turn.completed` with
|
|
85
|
+
* status `waiting-for-approval`, as the server's `run.AllowQuestions()` does. Only the addressee
|
|
86
|
+
* answers, with `POST conversations/{id}/questions/{questionId}/answer`; the answer resumes the turn
|
|
87
|
+
* with the `answered` steps, or with the steps that function returns for the chosen answer.
|
|
88
|
+
*/
|
|
89
|
+
interface NhAssistantMockQuestionStep {
|
|
90
|
+
question: {
|
|
91
|
+
question: string;
|
|
92
|
+
/** Two to six answers. */
|
|
93
|
+
choices: string[];
|
|
94
|
+
/** The person who answers; default the person whose turn asks. */
|
|
95
|
+
addresseeActorId?: string;
|
|
96
|
+
/** Default 900 seconds, the server's default wait. */
|
|
97
|
+
expiresInSeconds?: number;
|
|
98
|
+
answered: NhAssistantMockStep[] | ((answer: string, choice: number) => NhAssistantMockStep[]);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
83
101
|
/** Ends the stream with an `error` event. */
|
|
84
102
|
interface NhAssistantMockErrorStep {
|
|
85
103
|
error: {
|
|
@@ -104,7 +122,7 @@ interface NhAssistantMockConnectionStep {
|
|
|
104
122
|
text?: string;
|
|
105
123
|
};
|
|
106
124
|
}
|
|
107
|
-
type NhAssistantMockStep = NhAssistantMockTextStep | NhAssistantMockToolStep | NhAssistantMockApprovalStep | NhAssistantMockErrorStep | NhAssistantMockFailStep | NhAssistantMockConnectionStep;
|
|
125
|
+
type NhAssistantMockStep = NhAssistantMockTextStep | NhAssistantMockToolStep | NhAssistantMockApprovalStep | NhAssistantMockQuestionStep | NhAssistantMockErrorStep | NhAssistantMockFailStep | NhAssistantMockConnectionStep;
|
|
108
126
|
/** A scripted assistant turn, chosen by matching the user's message. */
|
|
109
127
|
interface NhAssistantMockTurn {
|
|
110
128
|
/** Case-insensitive substring, regular expression or predicate. Omit to match every message. */
|
|
@@ -136,6 +154,36 @@ interface NhAssistantMockMcpServer extends McpServerInput {
|
|
|
136
154
|
/** A server each person connects to starts with the caller's own account connected. */
|
|
137
155
|
personalConnected?: boolean;
|
|
138
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* An entry of agent metadata as the application registers it with `AddAgentMetadata`: its name,
|
|
159
|
+
* whether administrators may override it on agents in code, its size limit, its searchable value and
|
|
160
|
+
* its checks.
|
|
161
|
+
*/
|
|
162
|
+
interface NhAssistantMockAgentMetadataEntry {
|
|
163
|
+
/** The entry's dash-case name. */
|
|
164
|
+
name: string;
|
|
165
|
+
/** Administrators may override it on agents in code, as `Editable()`. */
|
|
166
|
+
editable?: boolean;
|
|
167
|
+
/** The largest value in bytes of its JSON; 4,096 by default. */
|
|
168
|
+
maxBytes?: number;
|
|
169
|
+
/** The field of the value whose text is its searchable value, as `IndexBy`. */
|
|
170
|
+
indexBy?: string;
|
|
171
|
+
/**
|
|
172
|
+
* The field of the value whose texts are its searchable values, as `IndexByEach`; an entry names
|
|
173
|
+
* `indexBy` or `indexByEach`.
|
|
174
|
+
*/
|
|
175
|
+
indexByEach?: string;
|
|
176
|
+
/**
|
|
177
|
+
* The fields of the entry's type: a value with another field is refused with `value: invalid`, as
|
|
178
|
+
* the server refuses JSON that does not fit the type. Without it every field is accepted.
|
|
179
|
+
*/
|
|
180
|
+
fields?: string[];
|
|
181
|
+
/**
|
|
182
|
+
* Checks a value as the application's validators do: codes by field path, `''` for the whole value,
|
|
183
|
+
* such as `{ code: ['unknown-code'] }`; `null` or an empty record accepts it.
|
|
184
|
+
*/
|
|
185
|
+
validate?: (value: Record<string, unknown>) => Record<string, string[]> | null;
|
|
186
|
+
}
|
|
139
187
|
/**
|
|
140
188
|
* A preconfigured agent. Code agents default to the scenario's chat agents. `startsOff` starts it
|
|
141
189
|
* off, as `StartsOff()` in code does for an agent in code.
|
|
@@ -152,8 +200,11 @@ interface NhAssistantMockAdminAgent extends AdminAgentInput {
|
|
|
152
200
|
shadow?: boolean;
|
|
153
201
|
startsOff?: boolean;
|
|
154
202
|
}[];
|
|
155
|
-
/**
|
|
156
|
-
|
|
203
|
+
/**
|
|
204
|
+
* The live agent this code agent is a shadow variant of, as `ShadowOf` in code. A data variant is
|
|
205
|
+
* created with `POST admin/agents` and `shadowOf` instead.
|
|
206
|
+
*/
|
|
207
|
+
shadowOf?: string | null;
|
|
157
208
|
/** The agent starts in shadow, as with `Shadow()` in code. */
|
|
158
209
|
shadow?: boolean;
|
|
159
210
|
/** The technical account in code, as with `ServiceAccount(actorId)`. */
|
|
@@ -171,6 +222,11 @@ interface NhAssistantMockAdminAgent extends AdminAgentInput {
|
|
|
171
222
|
* code that only answers.
|
|
172
223
|
*/
|
|
173
224
|
consultationDescriptions?: Record<string, string>;
|
|
225
|
+
/**
|
|
226
|
+
* The tool selections of a code agent's consultations in code, by subject type, as `Tools` in
|
|
227
|
+
* `AllowConsultation`; a type without one offers every tool of the agent.
|
|
228
|
+
*/
|
|
229
|
+
consultationTools?: Record<string, string[]>;
|
|
174
230
|
/**
|
|
175
231
|
* The ceiling of a code agent that administrators may make consultable as data, as
|
|
176
232
|
* `ConsultableAsData` in code; it applies together with the scenario's `consultationsAsData`. `{}`
|
|
@@ -203,6 +259,47 @@ interface NhAssistantMockAdminAgent extends AdminAgentInput {
|
|
|
203
259
|
* the administration offers the guided setup.
|
|
204
260
|
*/
|
|
205
261
|
runConfiguration?: NhAssistantMockRunConfigurationPreset;
|
|
262
|
+
/**
|
|
263
|
+
* The hand-offs a code agent accepts in code, as `AcceptHandOffs`; they cannot change in the
|
|
264
|
+
* administration, and a hand-off as data about the same type is refused.
|
|
265
|
+
*/
|
|
266
|
+
codeHandOffs?: NhAssistantMockCodeHandOff[];
|
|
267
|
+
}
|
|
268
|
+
/** A hand-off a code agent of the scenario accepts in code. */
|
|
269
|
+
interface NhAssistantMockCodeHandOff {
|
|
270
|
+
subjectType: string;
|
|
271
|
+
sources: string[];
|
|
272
|
+
description?: string;
|
|
273
|
+
notifySource?: boolean;
|
|
274
|
+
/** 5 by default, as in code. */
|
|
275
|
+
maxPerSubjectPerDay?: number;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* The ceiling in code of hand-offs defined as data, as `UseHandOffsAsData`: per subject type the
|
|
279
|
+
* agents that may accept them as data and the agents that may hand off, and the highest daily limit
|
|
280
|
+
* (100 by default).
|
|
281
|
+
*/
|
|
282
|
+
interface NhAssistantMockHandOffCeiling {
|
|
283
|
+
rules: NhAssistantMockHandOffRule[];
|
|
284
|
+
maxPerSubjectPerDay?: number;
|
|
285
|
+
}
|
|
286
|
+
/** One connection of the ceiling, as `Allow(subjectType, rule => rule.To(...).From(...))`. */
|
|
287
|
+
interface NhAssistantMockHandOffRule {
|
|
288
|
+
subjectType: string;
|
|
289
|
+
to?: string[];
|
|
290
|
+
toAgentsCreatedInAdministration?: boolean;
|
|
291
|
+
from?: string[];
|
|
292
|
+
fromAgentsCreatedInAdministration?: boolean;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* The ceiling in code of shadow variants created as data, as `UseShadowVariantsAsData`: the live agents
|
|
296
|
+
* in code that may get them, whether agents created in the administration may too, and how many each
|
|
297
|
+
* (3 by default).
|
|
298
|
+
*/
|
|
299
|
+
interface NhAssistantMockShadowVariantCeiling {
|
|
300
|
+
of?: string[];
|
|
301
|
+
ofAgentsCreatedInAdministration?: boolean;
|
|
302
|
+
maxPerAgent?: number;
|
|
206
303
|
}
|
|
207
304
|
/**
|
|
208
305
|
* A ceiling in code of consultations defined as data, as `NhAssistantConsultationCeilingBuilder`
|
|
@@ -219,6 +316,8 @@ interface NhAssistantMockConsultationCeiling {
|
|
|
219
316
|
maxTimeoutSeconds?: number;
|
|
220
317
|
maxAnswerChars?: number;
|
|
221
318
|
maxHistoryMessages?: number;
|
|
319
|
+
/** Every new consultation defined as data starts off until an administrator switches it on (`StartOff()`). */
|
|
320
|
+
startsOff?: boolean;
|
|
222
321
|
}
|
|
223
322
|
/** A consultation defined as data an agent of the scenario starts with. */
|
|
224
323
|
interface NhAssistantMockDataConsultation extends DataConsultationRequest {
|
|
@@ -294,6 +393,12 @@ interface NhAssistantMockAdminScenario {
|
|
|
294
393
|
* administration work per division, as an application that lists its divisions does.
|
|
295
394
|
*/
|
|
296
395
|
runCatalog?: Partial<RunCatalog>;
|
|
396
|
+
/**
|
|
397
|
+
* The entries of agent metadata the application registers in code with `AddAgentMetadata`, which
|
|
398
|
+
* the run catalog lists as `agentMetadata`; the scenario's agents give their values in
|
|
399
|
+
* `metadata`, in code for an agent in code and stored for an agent created as data. Default none.
|
|
400
|
+
*/
|
|
401
|
+
agentMetadata?: NhAssistantMockAgentMetadataEntry[];
|
|
297
402
|
/**
|
|
298
403
|
* Lets administrators define consultations as data within this ceiling, as `UseConsultationsAsData`
|
|
299
404
|
* in code: agents created in the administration with run settings get it, and code agents with
|
|
@@ -301,6 +406,16 @@ interface NhAssistantMockAdminScenario {
|
|
|
301
406
|
* `consultationCeiling`. Without it consultations exist in code only.
|
|
302
407
|
*/
|
|
303
408
|
consultationsAsData?: NhAssistantMockConsultationCeiling;
|
|
409
|
+
/**
|
|
410
|
+
* Lets administrators define hand-offs as data within this ceiling, as `UseHandOffsAsData` in code.
|
|
411
|
+
* Without it hand-offs exist in code only.
|
|
412
|
+
*/
|
|
413
|
+
handOffsAsData?: NhAssistantMockHandOffCeiling;
|
|
414
|
+
/**
|
|
415
|
+
* Lets administrators create shadow variants as data within this ceiling, as
|
|
416
|
+
* `UseShadowVariantsAsData` in code. Without it shadow variants exist in code only.
|
|
417
|
+
*/
|
|
418
|
+
shadowVariantsAsData?: NhAssistantMockShadowVariantCeiling;
|
|
304
419
|
/**
|
|
305
420
|
* The data classifications each model profile and its fallbacks permit together, by profile name.
|
|
306
421
|
* An agent or skill whose classification its profile does not permit is saved with the warning
|
|
@@ -325,6 +440,36 @@ interface NhAssistantMockAdminScenario {
|
|
|
325
440
|
* unavailable and any id that does not start with `unknown` is accepted.
|
|
326
441
|
*/
|
|
327
442
|
accounts?: AssistantAccount[];
|
|
443
|
+
/**
|
|
444
|
+
* The application's text assets for instructions, as its `INhAiTextAssetSource` supplies them
|
|
445
|
+
* (`UseTextAssetSource`): the run catalog reports `instructionAssets`, `GET admin/instruction-assets`
|
|
446
|
+
* lists them, and skills and agents created in the administration may name one instead of inline
|
|
447
|
+
* instructions. Without it the application offers none. Change them afterwards with
|
|
448
|
+
* `NhAssistantMockBackend.setInstructionAsset` and `removeInstructionAsset`.
|
|
449
|
+
*/
|
|
450
|
+
instructionAssets?: NhAssistantMockInstructionAsset[];
|
|
451
|
+
/**
|
|
452
|
+
* Agent packages the host imported before the mock starts, in order, as `POST
|
|
453
|
+
* admin/agent-packages/import` imports them after the scenario's agents and run configurations:
|
|
454
|
+
* their parts are linked and the parts they lock show read-only. A package the import refuses fails
|
|
455
|
+
* the scenario at once.
|
|
456
|
+
*/
|
|
457
|
+
agentPackages?: NhAssistantMockAgentPackage[];
|
|
458
|
+
}
|
|
459
|
+
/** An agent package the mock's host imported, with the options of its import. */
|
|
460
|
+
interface NhAssistantMockAgentPackage {
|
|
461
|
+
package: AgentPackage;
|
|
462
|
+
/** The technical account per agent whose run settings answer to one. */
|
|
463
|
+
serviceAccounts?: Record<string, string>;
|
|
464
|
+
}
|
|
465
|
+
/** One version of a text asset of the mock's application. */
|
|
466
|
+
interface NhAssistantMockInstructionAsset {
|
|
467
|
+
assetId: string;
|
|
468
|
+
version: number;
|
|
469
|
+
content: string;
|
|
470
|
+
/** The asset that replaces it, when the application deprecated it. */
|
|
471
|
+
replacedByAssetId?: string;
|
|
472
|
+
deprecatedAt?: string;
|
|
328
473
|
}
|
|
329
474
|
/** A person in the simulated organization. */
|
|
330
475
|
interface NhAssistantMockPerson {
|
|
@@ -619,6 +764,20 @@ interface NhAssistantMockProposal {
|
|
|
619
764
|
* with the asker's rights.
|
|
620
765
|
*/
|
|
621
766
|
grantSource?: AgentGrantSource;
|
|
767
|
+
/**
|
|
768
|
+
* Whether the application executes the proposal's tool (`ExecuteInApplication` on the server).
|
|
769
|
+
* Default `false`. Approved, such a proposal waits as `awaiting-application` until its report is due,
|
|
770
|
+
* four hours later; an `execution-unknown` one is handed to the application again
|
|
771
|
+
* (`POST approvals/{id}/resolve` with `hand-to-application`) instead of running again.
|
|
772
|
+
*/
|
|
773
|
+
executedByApplication?: boolean;
|
|
774
|
+
/**
|
|
775
|
+
* When the application's report is due, an ISO date, for a proposal listed as `awaiting-application`
|
|
776
|
+
* or `execution-unknown` that the application executes. Default four hours after it was made.
|
|
777
|
+
*/
|
|
778
|
+
executionReportDueAt?: string | null;
|
|
779
|
+
/** The execution's result code, such as `report-overdue`. Default none. */
|
|
780
|
+
executionResultCode?: string | null;
|
|
622
781
|
}
|
|
623
782
|
/** One request the mock API received, for assertions in tests. */
|
|
624
783
|
interface NhAssistantMockRequest {
|
|
@@ -677,6 +836,7 @@ declare class NhAssistantMockBackend {
|
|
|
677
836
|
private readonly config;
|
|
678
837
|
private readonly conversations;
|
|
679
838
|
private readonly pendingApprovals;
|
|
839
|
+
private readonly pendingQuestions;
|
|
680
840
|
private readonly runs;
|
|
681
841
|
/** Page context of the latest message per conversation, as the server stores it. */
|
|
682
842
|
private readonly pageContexts;
|
|
@@ -687,6 +847,9 @@ declare class NhAssistantMockBackend {
|
|
|
687
847
|
private readonly subjects;
|
|
688
848
|
private readonly agentRuns;
|
|
689
849
|
private readonly boards;
|
|
850
|
+
private readonly agentMetadata;
|
|
851
|
+
/** Agent packages: their endpoints, and the locks and links of every other administration request. */
|
|
852
|
+
private readonly agentPackages;
|
|
690
853
|
private readonly canAdministerState;
|
|
691
854
|
private readonly members;
|
|
692
855
|
private readonly readPositions;
|
|
@@ -734,6 +897,13 @@ declare class NhAssistantMockBackend {
|
|
|
734
897
|
* (`reauthorization-required`) or another authorization server (`issuer-changed`).
|
|
735
898
|
*/
|
|
736
899
|
setMcpConnectionStatus(serverId: string, status: 'reauthorization-required' | 'issuer-changed'): void;
|
|
900
|
+
/**
|
|
901
|
+
* Publishes or changes one version of a text asset of the application. A skill or agent that names
|
|
902
|
+
* this version with another hash then reports `asset-changed`, as after the server's next load.
|
|
903
|
+
*/
|
|
904
|
+
setInstructionAsset(asset: NhAssistantMockInstructionAsset): void;
|
|
905
|
+
/** Removes one version of a text asset; what names it reports `asset-missing`. */
|
|
906
|
+
removeInstructionAsset(assetId: string, version: number): void;
|
|
737
907
|
/** The files people uploaded, oldest first, as the application's file source stored them. */
|
|
738
908
|
get uploads(): readonly {
|
|
739
909
|
conversationId: string;
|
|
@@ -760,9 +930,26 @@ declare class NhAssistantMockBackend {
|
|
|
760
930
|
* (`consultation.movedToApprovalId`) and resumes the turn with the step's `left` steps.
|
|
761
931
|
*/
|
|
762
932
|
private decide;
|
|
933
|
+
/**
|
|
934
|
+
* `POST conversations/{id}/approvals/{approvalId}/resolve`: the person who approved a proposal in this
|
|
935
|
+
* chat resolves its uncertain hand-off (`canResolve`), as the server does: `hand-to-application` hands
|
|
936
|
+
* it to the application again with a new report deadline, `mark-resolved` confirms it. Another action
|
|
937
|
+
* is refused, as are an approval in another status and one the caller may not resolve. Returns the
|
|
938
|
+
* conversation.
|
|
939
|
+
*/
|
|
940
|
+
private resolve;
|
|
941
|
+
/**
|
|
942
|
+
* `POST conversations/{id}/questions/{questionId}/answer`: the addressee answers the question the
|
|
943
|
+
* turn waits for with the index of a choice, as on the server. Anyone else is refused, as are a
|
|
944
|
+
* choice the question does not offer and a question whose wait ended, which releases the
|
|
945
|
+
* conversation. The answer resumes the turn with the step's answered steps.
|
|
946
|
+
*/
|
|
947
|
+
private answer;
|
|
763
948
|
private cancel;
|
|
764
949
|
private playSteps;
|
|
765
950
|
private pauseForApproval;
|
|
951
|
+
/** Records the `ask_question` call and posts the question; the turn then waits for its answer. */
|
|
952
|
+
private pauseForQuestion;
|
|
766
953
|
private stream;
|
|
767
954
|
private findTurn;
|
|
768
955
|
private update;
|
|
@@ -807,6 +994,13 @@ declare class NhAssistantMockBackend {
|
|
|
807
994
|
*/
|
|
808
995
|
private consultationsOf;
|
|
809
996
|
private nextId;
|
|
997
|
+
/**
|
|
998
|
+
* The answer of an administration endpoint (`admin/...`) as its area gives it, with the groups of
|
|
999
|
+
* agents and the run catalog in the request's language, without the package locks and links.
|
|
1000
|
+
*/
|
|
1001
|
+
private adminResult;
|
|
1002
|
+
/** An administration request of the agent packages, as `adminResult` answers it, for a path with its query. */
|
|
1003
|
+
private adminCall;
|
|
810
1004
|
/** An administration answer about agents with each agent's groups, as the server answers it. */
|
|
811
1005
|
private withGroups;
|
|
812
1006
|
private groupsOf;
|
|
@@ -864,4 +1058,4 @@ declare class NhAssistantMockLiveService implements NhAssistantLiveSurface {
|
|
|
864
1058
|
declare function provideNhAssistantMockApi(script: NhAssistantMockScenario): EnvironmentProviders;
|
|
865
1059
|
|
|
866
1060
|
export { NH_ASSISTANT_MOCK_HUB_PATH, NH_ASSISTANT_MOCK_SCENARIO, NhAssistantMockAuthorizationWindow, NhAssistantMockBackend, NhAssistantMockLiveService, provideNhAssistantMockApi };
|
|
867
|
-
export type { NhAssistantMockAdminAgent, NhAssistantMockAdminScenario, NhAssistantMockAgentGroup, NhAssistantMockApprovalConsultation, NhAssistantMockApprovalStep, NhAssistantMockCollaboration, NhAssistantMockConnectionStep, NhAssistantMockConsultation, NhAssistantMockConsultationCeiling, NhAssistantMockDataConsultation, NhAssistantMockDataSkill, NhAssistantMockDataTrigger, NhAssistantMockDivision, NhAssistantMockErrorStep, NhAssistantMockFailStep, NhAssistantMockLiveMessage, NhAssistantMockMcpServer, NhAssistantMockPerson, NhAssistantMockProposal, NhAssistantMockRemoteTool, NhAssistantMockRequest, NhAssistantMockRun, NhAssistantMockRunConfigurationPreset, NhAssistantMockRunNow, NhAssistantMockScenario, NhAssistantMockStep, NhAssistantMockSubject, NhAssistantMockSubjectType, NhAssistantMockTextStep, NhAssistantMockTiming, NhAssistantMockToolStep, NhAssistantMockTurn, NhAssistantMockUpload };
|
|
1061
|
+
export type { NhAssistantMockAdminAgent, NhAssistantMockAdminScenario, NhAssistantMockAgentGroup, NhAssistantMockAgentMetadataEntry, NhAssistantMockAgentPackage, NhAssistantMockApprovalConsultation, NhAssistantMockApprovalStep, NhAssistantMockCodeHandOff, NhAssistantMockCollaboration, NhAssistantMockConnectionStep, NhAssistantMockConsultation, NhAssistantMockConsultationCeiling, NhAssistantMockDataConsultation, NhAssistantMockDataSkill, NhAssistantMockDataTrigger, NhAssistantMockDivision, NhAssistantMockErrorStep, NhAssistantMockFailStep, NhAssistantMockHandOffCeiling, NhAssistantMockHandOffRule, NhAssistantMockInstructionAsset, NhAssistantMockLiveMessage, NhAssistantMockMcpServer, NhAssistantMockPerson, NhAssistantMockProposal, NhAssistantMockQuestionStep, NhAssistantMockRemoteTool, NhAssistantMockRequest, NhAssistantMockRun, NhAssistantMockRunConfigurationPreset, NhAssistantMockRunNow, NhAssistantMockScenario, NhAssistantMockShadowVariantCeiling, NhAssistantMockStep, NhAssistantMockSubject, NhAssistantMockSubjectType, NhAssistantMockTextStep, NhAssistantMockTiming, NhAssistantMockToolStep, NhAssistantMockTurn, NhAssistantMockUpload };
|