@abpjs/ui 0.2.0-next.3 → 0.2.0-next.30

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