@abpjs/ui 0.2.0-next.4 → 0.2.0-next.40
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/CHANGELOG.md +428 -0
- package/dist/agent.d.ts +800 -0
- package/dist/agent.js +2468 -0
- package/dist/agent.js.map +1 -0
- package/dist/ai.d.ts +1 -1
- package/dist/ai.js +25 -9
- package/dist/ai.js.map +1 -1
- package/dist/guard.d.ts +1686 -0
- package/dist/guard.js +4194 -0
- package/dist/guard.js.map +1 -0
- package/dist/index.d.ts +740 -41
- package/dist/index.js +4060 -1379
- package/dist/index.js.map +1 -1
- package/dist/languages.d.ts +162 -0
- package/dist/languages.js +771 -0
- package/dist/languages.js.map +1 -0
- package/dist/rules.d.ts +23 -1
- package/dist/rules.js +35 -0
- package/dist/rules.js.map +1 -1
- package/dist/storage.d.ts +102 -0
- package/dist/storage.js +315 -0
- package/dist/storage.js.map +1 -0
- package/package.json +24 -1
package/dist/agent.d.ts
ADDED
|
@@ -0,0 +1,800 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { SettingsPage, AbpHost, StatusTone, RegisterSlotSave } from '@abpjs/ui';
|
|
4
|
+
|
|
5
|
+
/** The site's agents page, with its header: what a host's catch-all route draws for `agent.admin`. */
|
|
6
|
+
declare function AgentsAdminPage(): react.JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* The area's settings pages for a host to file under its sections: `agent.admin`, the site's agents (the switch, every
|
|
9
|
+
* agent, a new site agent, one agent's settings). The host gives where it opens and who sees it; the server checks every
|
|
10
|
+
* call anyway. A host that links items passes its own page instead, with `<AgentsAdmin itemHref={…} />`.
|
|
11
|
+
*/
|
|
12
|
+
declare function agentPages(options: {
|
|
13
|
+
section: string;
|
|
14
|
+
href: string;
|
|
15
|
+
weight?: number;
|
|
16
|
+
title?: string;
|
|
17
|
+
about?: string;
|
|
18
|
+
/** Who sees it; by default whoever the host says may `agent.site.admin` (pass the host to ask it). */
|
|
19
|
+
visible?: SettingsPage['visible'];
|
|
20
|
+
host?: Pick<AbpHost, 'can'>;
|
|
21
|
+
}): SettingsPage[];
|
|
22
|
+
|
|
23
|
+
/** Where an item opens in the host (a record's page, an asset's), by its kind and key; none when the host doesn't say. */
|
|
24
|
+
type ItemHref = (kind: string, key: string) => string | null | undefined;
|
|
25
|
+
/** Gives the screens inside where the host's items open: the area's top-level screens take it as `itemHref`. */
|
|
26
|
+
declare function ItemHrefProvider({ value, children }: {
|
|
27
|
+
value?: ItemHref | null;
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
}): react.JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* An item's key, or words about it (`children`): a link where the host says where it opens, plain otherwise. A bare key
|
|
32
|
+
* reads left to right; words keep the page's direction.
|
|
33
|
+
*/
|
|
34
|
+
declare function ItemLink({ kind, itemKey, children, textStyle }: {
|
|
35
|
+
kind: string | null | undefined;
|
|
36
|
+
itemKey: string;
|
|
37
|
+
children?: ReactNode;
|
|
38
|
+
textStyle?: string;
|
|
39
|
+
}): react.JSX.Element;
|
|
40
|
+
/**
|
|
41
|
+
* Which of the host's own groups a tool is in, by what the host knows of it (its skills, an outside server's tools, by
|
|
42
|
+
* their names): a group's id and its heading, or nothing for the area's own groups (the host's tools, plugins',
|
|
43
|
+
* sandbox's). A host's groups follow the area's, in the order their first tools come.
|
|
44
|
+
*/
|
|
45
|
+
type ToolGroupOf = (tool: {
|
|
46
|
+
name: string;
|
|
47
|
+
title: string;
|
|
48
|
+
readsOnly: boolean;
|
|
49
|
+
optIn?: boolean;
|
|
50
|
+
}) => {
|
|
51
|
+
id: string;
|
|
52
|
+
title: string;
|
|
53
|
+
} | null | undefined;
|
|
54
|
+
/** Gives the tools tabs inside the host's own groups of tools. */
|
|
55
|
+
declare function ToolGroupsProvider({ value, children }: {
|
|
56
|
+
value: ToolGroupOf;
|
|
57
|
+
children: ReactNode;
|
|
58
|
+
}): react.JSX.Element;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The site's agents, for its admins: the switch (held by the operator's setting and by safe mode), every agent on the
|
|
62
|
+
* site, a new site agent offered to every scope or to named ones, and the chosen agent to change, limit or pause. The
|
|
63
|
+
* host adds to the switch (`agent.switch.extra`: a cost limit it needs first, a sandbox's state); a save it registers
|
|
64
|
+
* runs before agents go on.
|
|
65
|
+
*/
|
|
66
|
+
declare function AgentsAdmin({ itemHref }: {
|
|
67
|
+
itemHref?: ItemHref;
|
|
68
|
+
}): react.JSX.Element;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* A scope's agents (a project's), for its admins: its own, which they make and change, and the site's offered to it,
|
|
72
|
+
* which they take on with a role for the runs the system starts there, or take off. The host gives the scope's roles
|
|
73
|
+
* an agent may have (never its admins'), and its own header.
|
|
74
|
+
*/
|
|
75
|
+
declare function ScopeAgentsScreen({ scope, roles, header, itemHref, subtitle }: {
|
|
76
|
+
/** The scope's key, as the agents' API names it. */
|
|
77
|
+
scope: string;
|
|
78
|
+
roles: {
|
|
79
|
+
value: string;
|
|
80
|
+
label: string;
|
|
81
|
+
}[];
|
|
82
|
+
header?: ReactNode;
|
|
83
|
+
itemHref?: ItemHref;
|
|
84
|
+
/** The words under the header; the default speaks of a project. */
|
|
85
|
+
subtitle?: string;
|
|
86
|
+
}): react.JSX.Element;
|
|
87
|
+
|
|
88
|
+
interface components {
|
|
89
|
+
schemas: {
|
|
90
|
+
AgentAllowableAgent: {
|
|
91
|
+
agent: components["schemas"]["AskableAgent"];
|
|
92
|
+
tools: components["schemas"]["AgentAllowableTool"][];
|
|
93
|
+
};
|
|
94
|
+
AgentAllowablePlace: {
|
|
95
|
+
scope: components["schemas"]["AgentScopeRef"];
|
|
96
|
+
agents: components["schemas"]["AgentAllowableAgent"][];
|
|
97
|
+
};
|
|
98
|
+
AgentAllowableTool: {
|
|
99
|
+
name: string;
|
|
100
|
+
title: string;
|
|
101
|
+
given: boolean;
|
|
102
|
+
};
|
|
103
|
+
AgentAnswerInput: {
|
|
104
|
+
answer: string;
|
|
105
|
+
};
|
|
106
|
+
AgentAskInput: {
|
|
107
|
+
/** Format: uuid */
|
|
108
|
+
agentId: string;
|
|
109
|
+
prompt: null | string;
|
|
110
|
+
};
|
|
111
|
+
AgentChange: {
|
|
112
|
+
key?: null | string;
|
|
113
|
+
names?: null | {
|
|
114
|
+
[key: string]: string;
|
|
115
|
+
};
|
|
116
|
+
titles?: null | {
|
|
117
|
+
[key: string]: string;
|
|
118
|
+
};
|
|
119
|
+
instructions?: null | string;
|
|
120
|
+
modelAlias?: null | string;
|
|
121
|
+
/** Format: uuid */
|
|
122
|
+
responsibleId?: null | string;
|
|
123
|
+
offerAll?: null | boolean;
|
|
124
|
+
offeredTo?: null | string[];
|
|
125
|
+
roleKey?: null | string;
|
|
126
|
+
tools?: null | {
|
|
127
|
+
[key: string]: string;
|
|
128
|
+
};
|
|
129
|
+
/** Format: int32 */
|
|
130
|
+
transcriptDays?: null | number | string;
|
|
131
|
+
limits?: null | components["schemas"]["AgentRunLimits"];
|
|
132
|
+
memory?: null | boolean;
|
|
133
|
+
};
|
|
134
|
+
AgentChatInfo: {
|
|
135
|
+
chat: components["schemas"]["AgentChatSummary"];
|
|
136
|
+
runs: components["schemas"]["AgentRunInfo"][];
|
|
137
|
+
canSend: boolean;
|
|
138
|
+
postable: string[];
|
|
139
|
+
};
|
|
140
|
+
AgentChatMessageInput: {
|
|
141
|
+
prompt: string;
|
|
142
|
+
};
|
|
143
|
+
AgentChatPlace: {
|
|
144
|
+
scope: components["schemas"]["AgentScopeRef"];
|
|
145
|
+
agents: components["schemas"]["AskableAgent"][];
|
|
146
|
+
};
|
|
147
|
+
AgentChatsDeleted: {
|
|
148
|
+
/** Format: int32 */
|
|
149
|
+
deleted: number | string;
|
|
150
|
+
/** Format: int32 */
|
|
151
|
+
stillGoing: number | string;
|
|
152
|
+
};
|
|
153
|
+
AgentChatStartInput: {
|
|
154
|
+
/** Format: uuid */
|
|
155
|
+
agentId: string;
|
|
156
|
+
prompt: string;
|
|
157
|
+
scope?: null | string;
|
|
158
|
+
kind?: null | string;
|
|
159
|
+
key?: null | string;
|
|
160
|
+
};
|
|
161
|
+
AgentChatSummary: {
|
|
162
|
+
/** Format: uuid */
|
|
163
|
+
id: string;
|
|
164
|
+
/** Format: uuid */
|
|
165
|
+
agentId: string;
|
|
166
|
+
agentKey: string;
|
|
167
|
+
agent: null | components["schemas"]["AgentPerson"];
|
|
168
|
+
/** Format: uuid */
|
|
169
|
+
scopeId: string;
|
|
170
|
+
scopeKey: null | string;
|
|
171
|
+
itemKind: null | string;
|
|
172
|
+
itemKey: null | string;
|
|
173
|
+
title: string;
|
|
174
|
+
/** Format: date-time */
|
|
175
|
+
createdAt: string;
|
|
176
|
+
/** Format: date-time */
|
|
177
|
+
lastAt: string;
|
|
178
|
+
going: boolean;
|
|
179
|
+
};
|
|
180
|
+
AgentGraphLink: {
|
|
181
|
+
id: string;
|
|
182
|
+
from: string;
|
|
183
|
+
to: string;
|
|
184
|
+
relation: string;
|
|
185
|
+
fact: string;
|
|
186
|
+
memories: string[];
|
|
187
|
+
/** Format: date-time */
|
|
188
|
+
validAt: null | string;
|
|
189
|
+
/** Format: date-time */
|
|
190
|
+
invalidAt: null | string;
|
|
191
|
+
/** Format: date-time */
|
|
192
|
+
createdAt: string;
|
|
193
|
+
};
|
|
194
|
+
AgentGraphNote: {
|
|
195
|
+
/** Format: uuid */
|
|
196
|
+
id: string;
|
|
197
|
+
itemKind: string;
|
|
198
|
+
itemKey: string;
|
|
199
|
+
text: string;
|
|
200
|
+
outside: boolean;
|
|
201
|
+
/** Format: date-time */
|
|
202
|
+
createdAt: string;
|
|
203
|
+
};
|
|
204
|
+
AgentGraphPage: {
|
|
205
|
+
on: boolean;
|
|
206
|
+
why: null | string;
|
|
207
|
+
view: components["schemas"]["AgentGraphView"];
|
|
208
|
+
notes: components["schemas"]["AgentGraphNote"][];
|
|
209
|
+
/** Format: int32 */
|
|
210
|
+
waiting: number | string;
|
|
211
|
+
};
|
|
212
|
+
AgentGraphThing: {
|
|
213
|
+
id: string;
|
|
214
|
+
name: string;
|
|
215
|
+
summary: null | string;
|
|
216
|
+
/** Format: int32 */
|
|
217
|
+
facts: number | string;
|
|
218
|
+
/** Format: date-time */
|
|
219
|
+
createdAt: string;
|
|
220
|
+
};
|
|
221
|
+
AgentGraphView: {
|
|
222
|
+
things: components["schemas"]["AgentGraphThing"][];
|
|
223
|
+
thing: null | components["schemas"]["AgentGraphThing"];
|
|
224
|
+
facts: components["schemas"]["AgentGraphLink"][];
|
|
225
|
+
around: components["schemas"]["AgentGraphThing"][];
|
|
226
|
+
/** Format: int32 */
|
|
227
|
+
hidden: number | string;
|
|
228
|
+
};
|
|
229
|
+
AgentInfo: {
|
|
230
|
+
/** Format: uuid */
|
|
231
|
+
id: string;
|
|
232
|
+
key: string;
|
|
233
|
+
account: components["schemas"]["AgentPerson"];
|
|
234
|
+
scopeKey: null | string;
|
|
235
|
+
names: {
|
|
236
|
+
[key: string]: string;
|
|
237
|
+
};
|
|
238
|
+
titles: {
|
|
239
|
+
[key: string]: string;
|
|
240
|
+
};
|
|
241
|
+
instructions: string;
|
|
242
|
+
modelAlias: string;
|
|
243
|
+
responsible: null | components["schemas"]["AgentPerson"];
|
|
244
|
+
state: string;
|
|
245
|
+
/** Format: date-time */
|
|
246
|
+
pausedAt: null | string;
|
|
247
|
+
offerAll: boolean;
|
|
248
|
+
offeredTo: string[];
|
|
249
|
+
scopes: components["schemas"]["AgentScopeInfo"][];
|
|
250
|
+
templateKey: null | string;
|
|
251
|
+
templateVersion: null | string;
|
|
252
|
+
/** Format: date-time */
|
|
253
|
+
createdAt: string;
|
|
254
|
+
/** Format: date-time */
|
|
255
|
+
updatedAt: string;
|
|
256
|
+
tools: {
|
|
257
|
+
[key: string]: string;
|
|
258
|
+
};
|
|
259
|
+
/** Format: int32 */
|
|
260
|
+
transcriptDays: null | number | string;
|
|
261
|
+
limits?: components["schemas"]["AgentRunLimits"];
|
|
262
|
+
siteLimits?: components["schemas"]["AgentRunLimits"];
|
|
263
|
+
memory?: boolean;
|
|
264
|
+
};
|
|
265
|
+
AgentMemoryInfo: {
|
|
266
|
+
/** Format: uuid */
|
|
267
|
+
id: string;
|
|
268
|
+
scopeKey: null | string;
|
|
269
|
+
itemKind: string;
|
|
270
|
+
itemKey: null | string;
|
|
271
|
+
text: string;
|
|
272
|
+
outside: boolean;
|
|
273
|
+
rememberedBy: null | components["schemas"]["AgentPerson"];
|
|
274
|
+
/** Format: uuid */
|
|
275
|
+
runId: string;
|
|
276
|
+
/** Format: date-time */
|
|
277
|
+
createdAt: string;
|
|
278
|
+
/** Format: date-time */
|
|
279
|
+
lastUsedAt: string;
|
|
280
|
+
/** Format: int32 */
|
|
281
|
+
uses: number | string;
|
|
282
|
+
};
|
|
283
|
+
AgentPermissionGive: {
|
|
284
|
+
/** Format: uuid */
|
|
285
|
+
agentId: string;
|
|
286
|
+
/** Format: uuid */
|
|
287
|
+
scopeId: string;
|
|
288
|
+
tools: string[];
|
|
289
|
+
};
|
|
290
|
+
AgentPermissionInfo: {
|
|
291
|
+
person: null | components["schemas"]["AgentPerson"];
|
|
292
|
+
/** Format: uuid */
|
|
293
|
+
personId: string;
|
|
294
|
+
/** Format: uuid */
|
|
295
|
+
agentId: string;
|
|
296
|
+
agentKey: string;
|
|
297
|
+
agent: null | components["schemas"]["AgentPerson"];
|
|
298
|
+
tool: string;
|
|
299
|
+
/** Format: uuid */
|
|
300
|
+
scopeId: string;
|
|
301
|
+
scopeKey: null | string;
|
|
302
|
+
/** Format: date-time */
|
|
303
|
+
createdAt: string;
|
|
304
|
+
/** Format: date-time */
|
|
305
|
+
lastUsedAt: null | string;
|
|
306
|
+
toolTitle?: null | string;
|
|
307
|
+
madeBy?: null | components["schemas"]["AgentPerson"];
|
|
308
|
+
agentNames?: {
|
|
309
|
+
[key: string]: string;
|
|
310
|
+
};
|
|
311
|
+
};
|
|
312
|
+
AgentPermissionRemoveInput: {
|
|
313
|
+
/** Format: uuid */
|
|
314
|
+
personId: string;
|
|
315
|
+
/** Format: uuid */
|
|
316
|
+
agentId: string;
|
|
317
|
+
tool: null | string;
|
|
318
|
+
/** Format: uuid */
|
|
319
|
+
scopeId: string;
|
|
320
|
+
};
|
|
321
|
+
AgentPerson: {
|
|
322
|
+
/** Format: uuid */
|
|
323
|
+
id: string;
|
|
324
|
+
username: string;
|
|
325
|
+
displayName: string;
|
|
326
|
+
isActive: boolean;
|
|
327
|
+
kind?: string;
|
|
328
|
+
picture?: null | string;
|
|
329
|
+
};
|
|
330
|
+
AgentQuestionInfo: {
|
|
331
|
+
/** Format: uuid */
|
|
332
|
+
id: string;
|
|
333
|
+
/** Format: uuid */
|
|
334
|
+
runId: string;
|
|
335
|
+
agentKey: string;
|
|
336
|
+
agent: null | components["schemas"]["AgentPerson"];
|
|
337
|
+
itemKind: null | string;
|
|
338
|
+
itemKey: null | string;
|
|
339
|
+
tool: string;
|
|
340
|
+
target: null | string;
|
|
341
|
+
input: null | string;
|
|
342
|
+
why: string;
|
|
343
|
+
askedOf: null | components["schemas"]["AgentPerson"];
|
|
344
|
+
/** Format: date-time */
|
|
345
|
+
createdAt: string;
|
|
346
|
+
/** Format: date-time */
|
|
347
|
+
expiresAt: string;
|
|
348
|
+
canAnswer: boolean;
|
|
349
|
+
canAlways: boolean;
|
|
350
|
+
};
|
|
351
|
+
AgentRunInfo: {
|
|
352
|
+
/** Format: uuid */
|
|
353
|
+
id: string;
|
|
354
|
+
/** Format: uuid */
|
|
355
|
+
agentId: string;
|
|
356
|
+
agentKey: string;
|
|
357
|
+
agent: null | components["schemas"]["AgentPerson"];
|
|
358
|
+
itemKind: null | string;
|
|
359
|
+
itemKey: null | string;
|
|
360
|
+
trigger: string;
|
|
361
|
+
startedBy: null | components["schemas"]["AgentPerson"];
|
|
362
|
+
state: string;
|
|
363
|
+
outside: boolean;
|
|
364
|
+
wide: boolean;
|
|
365
|
+
/** Format: uuid */
|
|
366
|
+
changeSetId: string;
|
|
367
|
+
/** Format: int32 */
|
|
368
|
+
turns: number | string;
|
|
369
|
+
/** Format: int32 */
|
|
370
|
+
toolCalls: number | string;
|
|
371
|
+
/** Format: double */
|
|
372
|
+
cost: number | string;
|
|
373
|
+
answer: null | string;
|
|
374
|
+
error: null | string;
|
|
375
|
+
/** Format: date-time */
|
|
376
|
+
createdAt: string;
|
|
377
|
+
/** Format: date-time */
|
|
378
|
+
startedAt: null | string;
|
|
379
|
+
/** Format: date-time */
|
|
380
|
+
endedAt: null | string;
|
|
381
|
+
transcript: boolean;
|
|
382
|
+
steps: components["schemas"]["AgentRunStepInfo"][];
|
|
383
|
+
question?: null | components["schemas"]["AgentQuestionInfo"];
|
|
384
|
+
prompt?: null | string;
|
|
385
|
+
/** Format: uuid */
|
|
386
|
+
chatId?: null | string;
|
|
387
|
+
errorCode?: null | string;
|
|
388
|
+
/** Format: date-time */
|
|
389
|
+
postedAt?: null | string;
|
|
390
|
+
};
|
|
391
|
+
AgentRunLimits: {
|
|
392
|
+
/** Format: int32 */
|
|
393
|
+
maxTurns: null | number | string;
|
|
394
|
+
/** Format: int32 */
|
|
395
|
+
maxToolCalls: null | number | string;
|
|
396
|
+
/** Format: int32 */
|
|
397
|
+
maxMinutes: null | number | string;
|
|
398
|
+
/** Format: double */
|
|
399
|
+
maxRunCost: null | number | string;
|
|
400
|
+
};
|
|
401
|
+
AgentRunStepInfo: {
|
|
402
|
+
/** Format: int32 */
|
|
403
|
+
number: number | string;
|
|
404
|
+
kind: string;
|
|
405
|
+
name: string;
|
|
406
|
+
target: null | string;
|
|
407
|
+
outcome: string;
|
|
408
|
+
input: null | string;
|
|
409
|
+
output: null | string;
|
|
410
|
+
/** Format: date-time */
|
|
411
|
+
startedAt: string;
|
|
412
|
+
/** Format: date-time */
|
|
413
|
+
endedAt: null | string;
|
|
414
|
+
allowed?: null | string;
|
|
415
|
+
writes?: boolean;
|
|
416
|
+
};
|
|
417
|
+
AgentScopeInfo: {
|
|
418
|
+
scopeKey: string;
|
|
419
|
+
roleKey: string;
|
|
420
|
+
/** Format: date-time */
|
|
421
|
+
takenAt: string;
|
|
422
|
+
};
|
|
423
|
+
AgentScopeRef: {
|
|
424
|
+
/** Format: uuid */
|
|
425
|
+
id: string;
|
|
426
|
+
key: string;
|
|
427
|
+
};
|
|
428
|
+
AgentSwitch: {
|
|
429
|
+
enabled: boolean;
|
|
430
|
+
adminsMayEnable: boolean;
|
|
431
|
+
safeMode: boolean;
|
|
432
|
+
};
|
|
433
|
+
AgentSwitchInput: {
|
|
434
|
+
enabled: boolean;
|
|
435
|
+
};
|
|
436
|
+
AgentTakeInput: {
|
|
437
|
+
roleKey: string;
|
|
438
|
+
};
|
|
439
|
+
AgentTool: {
|
|
440
|
+
name: string;
|
|
441
|
+
title: string;
|
|
442
|
+
description: string;
|
|
443
|
+
inputSchema: components["schemas"]["JsonElement"];
|
|
444
|
+
readsOnly: boolean;
|
|
445
|
+
fromPlugin: boolean;
|
|
446
|
+
reach?: components["schemas"]["AgentToolReach"];
|
|
447
|
+
itemKind?: null | string;
|
|
448
|
+
alwaysAsks?: boolean;
|
|
449
|
+
optIn?: boolean;
|
|
450
|
+
};
|
|
451
|
+
/** @default 0 */
|
|
452
|
+
AgentToolReach: number;
|
|
453
|
+
AgentUsage: {
|
|
454
|
+
today: components["schemas"]["AgentUsagePeriod"];
|
|
455
|
+
month: components["schemas"]["AgentUsagePeriod"];
|
|
456
|
+
};
|
|
457
|
+
AgentUsagePeriod: {
|
|
458
|
+
/** Format: int32 */
|
|
459
|
+
runs: number | string;
|
|
460
|
+
/** Format: int32 */
|
|
461
|
+
failed: number | string;
|
|
462
|
+
/** Format: int32 */
|
|
463
|
+
stopped: number | string;
|
|
464
|
+
/** Format: int64 */
|
|
465
|
+
tokens: number | string;
|
|
466
|
+
/** Format: double */
|
|
467
|
+
cost: number | string;
|
|
468
|
+
};
|
|
469
|
+
AskableAgent: {
|
|
470
|
+
/** Format: uuid */
|
|
471
|
+
id: string;
|
|
472
|
+
key: string;
|
|
473
|
+
account: components["schemas"]["AgentPerson"];
|
|
474
|
+
names: {
|
|
475
|
+
[key: string]: string;
|
|
476
|
+
};
|
|
477
|
+
titles: {
|
|
478
|
+
[key: string]: string;
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
JsonElement: unknown;
|
|
482
|
+
ScopeAgentInfo: {
|
|
483
|
+
agent: components["schemas"]["AgentInfo"];
|
|
484
|
+
own: boolean;
|
|
485
|
+
roleKey: null | string;
|
|
486
|
+
};
|
|
487
|
+
};
|
|
488
|
+
responses: never;
|
|
489
|
+
parameters: never;
|
|
490
|
+
requestBodies: never;
|
|
491
|
+
headers: never;
|
|
492
|
+
pathItems: never;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
type Schemas = components['schemas'];
|
|
496
|
+
/** AbpAgent.HttpApi's types, as its OpenAPI document gives them (`api.d.ts`). */
|
|
497
|
+
type AgentTypes = Schemas;
|
|
498
|
+
type AgentSwitch = Schemas['AgentSwitch'];
|
|
499
|
+
type AgentInfo = Schemas['AgentInfo'];
|
|
500
|
+
type AgentChange = Schemas['AgentChange'];
|
|
501
|
+
type AgentPerson = Schemas['AgentPerson'];
|
|
502
|
+
type AgentRunLimits = Schemas['AgentRunLimits'];
|
|
503
|
+
type ScopeAgentInfo = Schemas['ScopeAgentInfo'];
|
|
504
|
+
type AgentTool = Schemas['AgentTool'];
|
|
505
|
+
type AgentUsage = Schemas['AgentUsage'];
|
|
506
|
+
type AgentUsagePeriod = Schemas['AgentUsagePeriod'];
|
|
507
|
+
type AgentMemoryInfo = Schemas['AgentMemoryInfo'];
|
|
508
|
+
type AgentGraphPage = Schemas['AgentGraphPage'];
|
|
509
|
+
type AgentGraphThing = Schemas['AgentGraphThing'];
|
|
510
|
+
type AgentGraphLink = Schemas['AgentGraphLink'];
|
|
511
|
+
type AgentGraphNote = Schemas['AgentGraphNote'];
|
|
512
|
+
type AgentPermissionInfo = Schemas['AgentPermissionInfo'];
|
|
513
|
+
type AskableAgent = Schemas['AskableAgent'];
|
|
514
|
+
type AgentRunInfo = Schemas['AgentRunInfo'];
|
|
515
|
+
type AgentRunStepInfo = Schemas['AgentRunStepInfo'];
|
|
516
|
+
type AgentQuestionInfo = Schemas['AgentQuestionInfo'];
|
|
517
|
+
type AgentChatPlace = Schemas['AgentChatPlace'];
|
|
518
|
+
type AgentChatSummary = Schemas['AgentChatSummary'];
|
|
519
|
+
type AgentChatInfo = Schemas['AgentChatInfo'];
|
|
520
|
+
/** A number the API may give as a string (its 64-bit counts and decimals). */
|
|
521
|
+
declare const num: (value: number | string | null | undefined) => number;
|
|
522
|
+
/** A run's states that are still going: it may be stopped, and a screen keeps itself current while one is. */
|
|
523
|
+
declare const GOING: ReadonlySet<string>;
|
|
524
|
+
/** A run's state as a pill's tone. */
|
|
525
|
+
declare const RUN_TONES: Record<string, StatusTone>;
|
|
526
|
+
/** Where a chat or a run is about: an item of a kind (a record, an asset, a ticket), or a scope. */
|
|
527
|
+
type AgentTarget = {
|
|
528
|
+
kind: string;
|
|
529
|
+
key: string;
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* One agent, for whoever administers it: who it is, what it does, its tools, limits and memory, and the standing
|
|
534
|
+
* permissions people gave it. What's the host's goes in its slots: `agent.picture` (the agent's picture),
|
|
535
|
+
* `agent.connections` (outside servers it may use; `onChanged` makes the tools ask again).
|
|
536
|
+
*/
|
|
537
|
+
declare function AgentEditor({ agent, onSaved, permissions, variant }: {
|
|
538
|
+
agent: AgentInfo;
|
|
539
|
+
onSaved: (agent: AgentInfo) => void;
|
|
540
|
+
/** The standing permissions people gave it (its admins'); off where they're someone else's to see. */
|
|
541
|
+
permissions?: boolean;
|
|
542
|
+
/** `site`: with who it is (key, account, responsible, where it's taken on); `scope`: a scope's own agent, its settings alone. */
|
|
543
|
+
variant?: 'site' | 'scope';
|
|
544
|
+
}): react.JSX.Element;
|
|
545
|
+
|
|
546
|
+
/** An agent's state, as a pill: on, or paused. */
|
|
547
|
+
declare function AgentState({ agent }: {
|
|
548
|
+
agent: AgentInfo;
|
|
549
|
+
}): react.JSX.Element;
|
|
550
|
+
/**
|
|
551
|
+
* Agents in a table: name and what it does, where it belongs (the site, or a scope's own), who answers for it, its
|
|
552
|
+
* state. A row opens the agent; `extra` adds columns (a scope's take-on actions).
|
|
553
|
+
*/
|
|
554
|
+
declare function AgentsTable({ rows, loading, onOpen, selected, extra }: {
|
|
555
|
+
rows: AgentInfo[] | undefined;
|
|
556
|
+
loading: boolean;
|
|
557
|
+
onOpen: (agent: AgentInfo) => void;
|
|
558
|
+
selected?: string | null;
|
|
559
|
+
extra?: {
|
|
560
|
+
id: string;
|
|
561
|
+
header: string;
|
|
562
|
+
cell: (agent: AgentInfo) => ReactNode;
|
|
563
|
+
}[];
|
|
564
|
+
}): react.JSX.Element;
|
|
565
|
+
/**
|
|
566
|
+
* Makes an agent or changes one. A site agent says which scopes it's offered to; a scope's own says its role there
|
|
567
|
+
* (`roles`). Its name and what it does are given in every language the site offers: the reader's inline, the others
|
|
568
|
+
* behind "Other languages".
|
|
569
|
+
*/
|
|
570
|
+
declare function AgentForm({ agent, scope, roles, onSaved }: {
|
|
571
|
+
/** The agent to change; none to make one. */
|
|
572
|
+
agent?: AgentInfo;
|
|
573
|
+
/** The scope a new one is made in (its key); none for a site agent. */
|
|
574
|
+
scope?: string;
|
|
575
|
+
/** The scope's roles to pick from, for a new agent of its own. */
|
|
576
|
+
roles?: {
|
|
577
|
+
value: string;
|
|
578
|
+
label: string;
|
|
579
|
+
}[];
|
|
580
|
+
onSaved: (agent: AgentInfo) => void;
|
|
581
|
+
}): react.JSX.Element;
|
|
582
|
+
/** Pause, or put back on: an agent's admins, and its responsible person may pause it. */
|
|
583
|
+
declare function AgentPause({ agent, onChanged }: {
|
|
584
|
+
agent: AgentInfo;
|
|
585
|
+
onChanged: (agent: AgentInfo) => void;
|
|
586
|
+
}): react.JSX.Element;
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* What an agent may do with each tool the host offers it (`agents/{id}/tools`): the host's own, its plugins', and the
|
|
590
|
+
* sandbox's while one is available. A tool that only reads runs; one that changes things asks unless it's set to run;
|
|
591
|
+
* one that always asks (a change in another system) asks every time; an opt-in tool is off until it's turned on.
|
|
592
|
+
* Whatever is set here, a run that has read outside content or beyond its scope asks before every change. The host adds
|
|
593
|
+
* its own groups below (`agent.tools.extra`): its skills, its outside servers' tools.
|
|
594
|
+
*/
|
|
595
|
+
declare function AgentToolsPanel({ agent, onSaved, version }: {
|
|
596
|
+
agent: AgentInfo;
|
|
597
|
+
onSaved: (agent: AgentInfo) => void;
|
|
598
|
+
/** Bumped by the host when what the agent may use changed (its connections), so the list asks again. */
|
|
599
|
+
version?: number;
|
|
600
|
+
}): react.JSX.Element;
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* What an agent may do and what it spent, for its admins: its runs and their cost today and this month, and each run's
|
|
604
|
+
* most turns, tool calls, working minutes and cost (the site's where a field is left empty). What it may spend on AI
|
|
605
|
+
* (a gateway's limits) is the host's: `agent.limits.extra`, which joins this Save.
|
|
606
|
+
*/
|
|
607
|
+
declare function AgentLimitsPanel({ agent, onSaved }: {
|
|
608
|
+
agent: AgentInfo;
|
|
609
|
+
onSaved: (agent: AgentInfo) => void;
|
|
610
|
+
}): react.JSX.Element;
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* What an agent learned, for its admins: whether it keeps memories, and each it kept, newest first, with the item it's
|
|
614
|
+
* about, whose run kept it, when, how often it's been used since, and whether it was kept after outside content. Only
|
|
615
|
+
* memories about items the reader may read are listed. Forgetting one lets it go for good. The graph shows the same
|
|
616
|
+
* notes read into things and the facts between them, per scope.
|
|
617
|
+
*/
|
|
618
|
+
declare function AgentMemoriesPanel({ agent, onSaved }: {
|
|
619
|
+
agent: AgentInfo;
|
|
620
|
+
onSaved: (agent: AgentInfo) => void;
|
|
621
|
+
}): react.JSX.Element;
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* What an agent knows, as a graph, for its admins: in one scope, the things its notes name (most connected first, or
|
|
625
|
+
* those whose names or facts have the words), and around the one picked, a picture of it and the things its facts
|
|
626
|
+
* reach, and its facts with the notes they came from. Only what comes from notes the reader may read shows. Reading it
|
|
627
|
+
* calls no model. The picture is React Flow's: a host imports '@xyflow/react/dist/style.css' once.
|
|
628
|
+
*/
|
|
629
|
+
declare function AgentGraph({ agentId, scopes }: {
|
|
630
|
+
agentId: string;
|
|
631
|
+
scopes: string[];
|
|
632
|
+
}): react.JSX.Element;
|
|
633
|
+
|
|
634
|
+
/**
|
|
635
|
+
* Standing permissions: the tools a person lets an agent use without asking, in the runs they start in one scope,
|
|
636
|
+
* given by "Always allow" in a run or ahead of time. On the person's page, their own (no `agentId`), one row per agent
|
|
637
|
+
* and scope, with "Allow an agent"; on an agent's page, the ones people gave it, for its admins, one row per person and
|
|
638
|
+
* scope. Removing a row takes back all its tools: they ask again from their next call.
|
|
639
|
+
*/
|
|
640
|
+
declare function AgentPermissionsPanel({ agentId }: {
|
|
641
|
+
agentId?: string;
|
|
642
|
+
}): react.JSX.Element;
|
|
643
|
+
|
|
644
|
+
/**
|
|
645
|
+
* An agent's words (its reply, a chat's text as it's written), which are Markdown: drawn by the host's own renderer
|
|
646
|
+
* (`agent.markdown`, `{ source }`), which keeps its own rules on links and remote images; as plain text otherwise.
|
|
647
|
+
*/
|
|
648
|
+
declare function AgentText({ source, testId }: {
|
|
649
|
+
source: string;
|
|
650
|
+
testId?: string;
|
|
651
|
+
}): react.JSX.Element;
|
|
652
|
+
/**
|
|
653
|
+
* What a waiting run asks: the tool, the item, why, and what it would be given. Whoever it asks answers: allow it once,
|
|
654
|
+
* for the rest of the run, always (their own runs of this agent with this tool in this scope), or refuse it. Others see
|
|
655
|
+
* that it waits, and for whom.
|
|
656
|
+
*/
|
|
657
|
+
declare function AgentQuestionCard({ question, onAnswered }: {
|
|
658
|
+
question: AgentQuestionInfo;
|
|
659
|
+
onAnswered: () => Promise<void> | void;
|
|
660
|
+
}): react.JSX.Element;
|
|
661
|
+
/**
|
|
662
|
+
* Agents' runs on an item (a record, an asset, a ticket), newest first: who asked, how it went, its answer, and each
|
|
663
|
+
* step, with what it gave back for whoever may read the transcript. A run still going can be stopped; after it ends, the
|
|
664
|
+
* host's actions (`agent.run.actions`: "Undo this run"). It keeps itself current while a run goes, and nothing shows
|
|
665
|
+
* while there are none. `version` asks again when the host bumps it; `onChanged` tells it a run ended (the item may
|
|
666
|
+
* have changed).
|
|
667
|
+
*/
|
|
668
|
+
declare function ItemAgentRuns({ kind, itemKey, version, onChanged, title, description }: {
|
|
669
|
+
kind: string;
|
|
670
|
+
itemKey: string;
|
|
671
|
+
version?: number;
|
|
672
|
+
onChanged?: () => void;
|
|
673
|
+
title?: string;
|
|
674
|
+
description?: string;
|
|
675
|
+
}): react.JSX.Element | null;
|
|
676
|
+
|
|
677
|
+
/** What the chat opens on: a chat by its id, a new one about an item or in a scope (with an agent and words to start), or the list. */
|
|
678
|
+
type AgentChatOpen = {
|
|
679
|
+
chat?: string;
|
|
680
|
+
item?: AgentTarget;
|
|
681
|
+
scope?: string;
|
|
682
|
+
agent?: string;
|
|
683
|
+
prompt?: string;
|
|
684
|
+
};
|
|
685
|
+
/**
|
|
686
|
+
* Where the chat lives in a host's shell: wrap the shell once, place `<AgentChatPanel />` inside it, and open it from
|
|
687
|
+
* anywhere with `useAgentChat().open(…)`. `onItemChanged` hears when a chat's run about an item ended or a reply was
|
|
688
|
+
* posted on it, so the host can show the item afresh.
|
|
689
|
+
*/
|
|
690
|
+
declare function AgentChatProvider({ children, onItemChanged }: {
|
|
691
|
+
children: ReactNode;
|
|
692
|
+
onItemChanged?: (item: AgentTarget) => void;
|
|
693
|
+
}): react.JSX.Element;
|
|
694
|
+
/** Opens the chat beside the page: on the list, on a chat, or on a new chat about an item or in a scope. */
|
|
695
|
+
declare function useAgentChat(): {
|
|
696
|
+
open: (target?: AgentChatOpen) => void;
|
|
697
|
+
close: () => void;
|
|
698
|
+
isOpen: boolean;
|
|
699
|
+
};
|
|
700
|
+
/** The top bar's way into the chat: shown when the person may chat with an agent somewhere. */
|
|
701
|
+
declare function AgentChatButton(): react.JSX.Element | null;
|
|
702
|
+
/**
|
|
703
|
+
* "Ask an agent" in an item's header: the chat beside the page, on a new chat about it, with the agents its scope took
|
|
704
|
+
* on, for whoever reads it. Nothing shows when there's no agent to ask.
|
|
705
|
+
*/
|
|
706
|
+
declare function AskAgentButton({ kind, itemKey }: {
|
|
707
|
+
kind: string;
|
|
708
|
+
itemKey: string;
|
|
709
|
+
}): react.JSX.Element | null;
|
|
710
|
+
/**
|
|
711
|
+
* The chat with an agent, beside whatever page is open: the person's chats, a new one (in a scope, or about the item it
|
|
712
|
+
* was opened on), and one chat with its messages and replies. It leaves the page usable behind it.
|
|
713
|
+
*/
|
|
714
|
+
declare function AgentChatPanel({ itemHref }: {
|
|
715
|
+
itemHref?: ItemHref;
|
|
716
|
+
}): react.JSX.Element | null;
|
|
717
|
+
|
|
718
|
+
/**
|
|
719
|
+
* Asks, then deletes every chat of the person's own (AbpAgent's `DELETE chats`): their messages and replies go for good;
|
|
720
|
+
* their runs keep who, when and what changed. Resolves true when it deleted.
|
|
721
|
+
*/
|
|
722
|
+
declare function useDeleteAllChats(): () => Promise<boolean>;
|
|
723
|
+
/** A person's chats with agents on their own account's privacy page: deleting them all at once, as they may at any time. */
|
|
724
|
+
declare function MyAgentChatsPanel(): react.JSX.Element;
|
|
725
|
+
/**
|
|
726
|
+
* On someone's account, for a site admin (an account they're deactivating or deleting without erasing it): deletes
|
|
727
|
+
* every chat of theirs with agents, after asking (AbpAgent's `DELETE people/{id}/chats`, audited). Erasing a person
|
|
728
|
+
* takes their chats anyway.
|
|
729
|
+
*/
|
|
730
|
+
declare function PersonAgentChatsAction({ accountId, name }: {
|
|
731
|
+
accountId: string;
|
|
732
|
+
name?: string;
|
|
733
|
+
}): react.JSX.Element;
|
|
734
|
+
/**
|
|
735
|
+
* In a dialog that deactivates or deletes an account (the slots `guard.account.deactivate.options` and
|
|
736
|
+
* `guard.account.delete.options`): "Also delete their chats with agents". Ticked, it joins the dialog's save, which runs
|
|
737
|
+
* it only after the account was deactivated or deleted; a failure shows in the dialog.
|
|
738
|
+
*/
|
|
739
|
+
declare function ForgetChatsOption({ accountId, register }: {
|
|
740
|
+
accountId: string;
|
|
741
|
+
register: RegisterSlotSave;
|
|
742
|
+
}): react.JSX.Element;
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* Picks an agent by its key, for a workflow step or a rule that asks one: the agents a scope has taken on. A key kept
|
|
746
|
+
* from before that isn't there any more stays shown, so nothing changes until someone picks again. Where the list can't
|
|
747
|
+
* be read (the reader doesn't manage the scope), the key is typed.
|
|
748
|
+
*/
|
|
749
|
+
declare function AgentSelect({ scope, value, onChange, disabled, anyLabel }: {
|
|
750
|
+
scope: string;
|
|
751
|
+
value: string;
|
|
752
|
+
onChange: (key: string | undefined) => void;
|
|
753
|
+
disabled?: boolean;
|
|
754
|
+
/** The empty choice's label when empty means any agent (a trigger); otherwise empty is "choose one". */
|
|
755
|
+
anyLabel?: string;
|
|
756
|
+
}): react.JSX.Element;
|
|
757
|
+
/**
|
|
758
|
+
* Says an account is an agent's, wherever a person's name is shown (pickers, history), so nobody mistakes an agent for
|
|
759
|
+
* a colleague. Nothing for a person or a service account. The label is the host's (`label`), "Agent" by default.
|
|
760
|
+
*/
|
|
761
|
+
declare function AgentBadge({ person, label }: {
|
|
762
|
+
person: {
|
|
763
|
+
kind?: string | null;
|
|
764
|
+
} | null | undefined;
|
|
765
|
+
label?: string;
|
|
766
|
+
}): react.JSX.Element | null;
|
|
767
|
+
/** The questions agents' runs wait for the person to answer, oldest first, each with its item and its answers. */
|
|
768
|
+
declare function AgentQuestionsPanel({ itemHref }: {
|
|
769
|
+
itemHref?: ItemHref;
|
|
770
|
+
}): react.JSX.Element;
|
|
771
|
+
|
|
772
|
+
/** Names by language, as an agent's are kept: `{ en: 'Triage', ar: 'الفرز' }`. */
|
|
773
|
+
type Names = Record<string, string>;
|
|
774
|
+
/**
|
|
775
|
+
* The name to show from names by language: the reader's language, then its base (ar for ar-SA), then the site's first
|
|
776
|
+
* language, then any, then the fallback (an agent's key).
|
|
777
|
+
*/
|
|
778
|
+
declare function useNameOf(): (names: Names | null | undefined, fallback: string) => string;
|
|
779
|
+
/** Names by language with the empty ones left out, as they're saved. */
|
|
780
|
+
declare const filledIn: (names: Names) => Names;
|
|
781
|
+
/**
|
|
782
|
+
* A name in every language the site offers: the reader's inline, the others behind "Other languages". A host that
|
|
783
|
+
* names no languages gets one field, in the reader's. A host with its own field for names by language puts it in the
|
|
784
|
+
* slot `agent.names` (`{ label, value, onChange, placeholder, fallback, kind }`).
|
|
785
|
+
*/
|
|
786
|
+
declare function NamesField(props: {
|
|
787
|
+
value: Names;
|
|
788
|
+
onChange: (value: Names) => void;
|
|
789
|
+
label: string;
|
|
790
|
+
placeholder?: string;
|
|
791
|
+
/** What shows where no language has a name (an agent's key). */
|
|
792
|
+
fallback?: string;
|
|
793
|
+
/** Which name it is: an agent's name, or what it does (`title`). */
|
|
794
|
+
kind?: 'name' | 'title';
|
|
795
|
+
}): react.JSX.Element;
|
|
796
|
+
|
|
797
|
+
/** The area's words, in English and Arabic; a host overrides any key through `AbpHost.texts.agent`. */
|
|
798
|
+
declare const useAgentTexts: () => (key: string, values?: Record<string, string | number>) => string;
|
|
799
|
+
|
|
800
|
+
export { AgentBadge, type AgentChange, AgentChatButton, type AgentChatInfo, type AgentChatOpen, AgentChatPanel, type AgentChatPlace, AgentChatProvider, type AgentChatSummary, AgentEditor, AgentForm, AgentGraph, type AgentGraphLink, type AgentGraphNote, type AgentGraphPage, type AgentGraphThing, type AgentInfo, AgentLimitsPanel, AgentMemoriesPanel, type AgentMemoryInfo, AgentPause, type AgentPermissionInfo, AgentPermissionsPanel, type AgentPerson, AgentQuestionCard, type AgentQuestionInfo, AgentQuestionsPanel, type AgentRunInfo, type AgentRunLimits, type AgentRunStepInfo, AgentSelect, AgentState, type AgentSwitch, type AgentTarget, AgentText, type AgentTool, AgentToolsPanel, type AgentTypes, type AgentUsage, type AgentUsagePeriod, AgentsAdmin, AgentsAdminPage, AgentsTable, AskAgentButton, type AskableAgent, ForgetChatsOption, GOING, ItemAgentRuns, type ItemHref, ItemHrefProvider, ItemLink, MyAgentChatsPanel, type Names, NamesField, PersonAgentChatsAction, RUN_TONES, type ScopeAgentInfo, ScopeAgentsScreen, type ToolGroupOf, ToolGroupsProvider, agentPages, filledIn, num, useAgentChat, useAgentTexts, useDeleteAllChats, useNameOf };
|