@progress/kendo-react-conversational-ui 15.2.0-develop.2 → 15.2.0-develop.4
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/dist/cdn/js/kendo-react-conversational-ui.js +1 -1
- package/index.d.mts +1 -0
- package/index.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +34 -24
- package/llm-kit/AgentStep.d.ts +14 -0
- package/llm-kit/AgentStep.js +8 -0
- package/llm-kit/AgentStep.mjs +100 -0
- package/llm-kit/ChainOfThought.d.ts +10 -0
- package/llm-kit/ChainOfThought.js +8 -0
- package/llm-kit/ChainOfThought.mjs +67 -0
- package/llm-kit/Checkpoint.d.ts +10 -0
- package/llm-kit/Checkpoint.js +8 -0
- package/llm-kit/Checkpoint.mjs +45 -0
- package/llm-kit/Citation.d.ts +14 -0
- package/llm-kit/Citation.js +8 -0
- package/llm-kit/Citation.mjs +171 -0
- package/llm-kit/Events.d.ts +69 -0
- package/llm-kit/Reasoning.d.ts +10 -0
- package/llm-kit/Reasoning.js +8 -0
- package/llm-kit/Reasoning.mjs +48 -0
- package/llm-kit/Thought.d.ts +16 -0
- package/llm-kit/Thought.js +8 -0
- package/llm-kit/Thought.mjs +47 -0
- package/llm-kit/ToolCall.d.ts +10 -0
- package/llm-kit/ToolCall.js +8 -0
- package/llm-kit/ToolCall.mjs +100 -0
- package/llm-kit/defaults/DefaultCitationBody.d.ts +11 -0
- package/llm-kit/defaults/DefaultCitationBody.js +8 -0
- package/llm-kit/defaults/DefaultCitationBody.mjs +27 -0
- package/llm-kit/defaults/DefaultToolError.d.ts +11 -0
- package/llm-kit/defaults/DefaultToolError.js +8 -0
- package/llm-kit/defaults/DefaultToolError.mjs +12 -0
- package/llm-kit/defaults/DefaultToolInput.d.ts +11 -0
- package/llm-kit/defaults/DefaultToolInput.js +8 -0
- package/llm-kit/defaults/DefaultToolInput.mjs +13 -0
- package/llm-kit/defaults/DefaultToolOutput.d.ts +11 -0
- package/llm-kit/defaults/DefaultToolOutput.js +8 -0
- package/llm-kit/defaults/DefaultToolOutput.mjs +13 -0
- package/llm-kit/index.d.ts +32 -0
- package/llm-kit/interfaces/AgentStepBodyTemplateProps.d.ts +26 -0
- package/llm-kit/interfaces/AgentStepHeaderTemplateProps.d.ts +40 -0
- package/llm-kit/interfaces/AgentStepProps.d.ts +123 -0
- package/llm-kit/interfaces/ChainOfThoughtProps.d.ts +102 -0
- package/llm-kit/interfaces/CheckpointProps.d.ts +48 -0
- package/llm-kit/interfaces/CheckpointState.d.ts +20 -0
- package/llm-kit/interfaces/CheckpointTemplateProps.d.ts +19 -0
- package/llm-kit/interfaces/CitationBodyTemplateProps.d.ts +18 -0
- package/llm-kit/interfaces/CitationProps.d.ts +81 -0
- package/llm-kit/interfaces/CitationShowOn.d.ts +13 -0
- package/llm-kit/interfaces/CitationSource.d.ts +26 -0
- package/llm-kit/interfaces/ReasoningContentTemplateProps.d.ts +18 -0
- package/llm-kit/interfaces/ReasoningProps.d.ts +90 -0
- package/llm-kit/interfaces/Thought.d.ts +55 -0
- package/llm-kit/interfaces/ThoughtProps.d.ts +82 -0
- package/llm-kit/interfaces/ThoughtTemplateProps.d.ts +19 -0
- package/llm-kit/interfaces/ToolCallActionType.d.ts +14 -0
- package/llm-kit/interfaces/ToolCallApprovalTemplateProps.d.ts +20 -0
- package/llm-kit/interfaces/ToolCallErrorTemplateProps.d.ts +16 -0
- package/llm-kit/interfaces/ToolCallParamsTemplateProps.d.ts +16 -0
- package/llm-kit/interfaces/ToolCallProps.d.ts +119 -0
- package/llm-kit/interfaces/ToolCallResultTemplateProps.d.ts +16 -0
- package/llm-kit/interfaces/ToolCallState.d.ts +16 -0
- package/llm-kit/utils.d.ts +12 -0
- package/llm-kit/utils.js +8 -0
- package/llm-kit/utils.mjs +11 -0
- package/messages/index.d.ts +60 -0
- package/messages/index.js +1 -1
- package/messages/index.mjs +88 -64
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -11
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { SVGIcon } from '@progress/kendo-react-common';
|
|
9
|
+
import { ChainOfThoughtExpandedChangeEvent } from '../Events';
|
|
10
|
+
import { Thought } from './Thought';
|
|
11
|
+
import { ThoughtTemplateProps } from './ThoughtTemplateProps';
|
|
12
|
+
import * as React from 'react';
|
|
13
|
+
/**
|
|
14
|
+
* Defines the props for the `ChainOfThought` component.
|
|
15
|
+
*
|
|
16
|
+
* `ChainOfThought` groups an ordered sequence of `Thought` rows under one
|
|
17
|
+
* collapsible summary.
|
|
18
|
+
*
|
|
19
|
+
* Extends `React.HTMLAttributes<HTMLDivElement>` to allow passing standard HTML
|
|
20
|
+
* attributes (e.g. `className`, `style`, `id`) directly to the root element.
|
|
21
|
+
*/
|
|
22
|
+
export interface ChainOfThoughtProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
/**
|
|
24
|
+
* Group summary label.
|
|
25
|
+
*/
|
|
26
|
+
label?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Summary context, rendered next to `label`.
|
|
29
|
+
* Include timing text here when needed.
|
|
30
|
+
*/
|
|
31
|
+
secondaryLabel?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Group icon.
|
|
34
|
+
* Pass an icon object from `@progress/kendo-svg-icons`.
|
|
35
|
+
*
|
|
36
|
+
* @default sparklesIcon
|
|
37
|
+
*/
|
|
38
|
+
svgIcon?: SVGIcon;
|
|
39
|
+
/**
|
|
40
|
+
* Semantic lifecycle state of the group as a whole.
|
|
41
|
+
*
|
|
42
|
+
* @default false
|
|
43
|
+
*/
|
|
44
|
+
completed?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Controls whether thought rows are visible, in controlled mode.
|
|
47
|
+
*/
|
|
48
|
+
expanded?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Initial expanded state in uncontrolled mode. Ignored when `expanded` is provided.
|
|
51
|
+
*
|
|
52
|
+
* @default false
|
|
53
|
+
*/
|
|
54
|
+
defaultExpanded?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Sets whether the expandable header supports expanding and collapsing the thought rows.
|
|
57
|
+
* Forced to `false` whenever `thoughts` is empty, regardless of the value supplied.
|
|
58
|
+
*
|
|
59
|
+
* @default false
|
|
60
|
+
*/
|
|
61
|
+
expandable?: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* The ordered list of thought rows rendered inside the body.
|
|
64
|
+
*
|
|
65
|
+
* @default []
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```tsx
|
|
69
|
+
* const thoughts: Thought[] = [{ label: 'Read', content: 'Read package.json' }];
|
|
70
|
+
* <ChainOfThought thoughts={thoughts} />
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
thoughts?: Thought[];
|
|
74
|
+
/**
|
|
75
|
+
* Number of lines added across the group.
|
|
76
|
+
*/
|
|
77
|
+
linesAdded?: number;
|
|
78
|
+
/**
|
|
79
|
+
* Number of lines removed across the group.
|
|
80
|
+
*/
|
|
81
|
+
linesRemoved?: number;
|
|
82
|
+
/**
|
|
83
|
+
* A custom component that replaces the default rendering of each `Thought` row.
|
|
84
|
+
* Receives the `Thought` item and its index via `ThoughtTemplateProps`.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```tsx
|
|
88
|
+
* const MyThought = ({ thought }: ThoughtTemplateProps) => <div>{thought.label}</div>;
|
|
89
|
+
* <ChainOfThought thoughts={thoughts} thoughtTemplate={MyThought} />
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
thoughtTemplate?: React.ComponentType<ThoughtTemplateProps>;
|
|
93
|
+
/**
|
|
94
|
+
* Callback fired when the user toggles the chain body.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```tsx
|
|
98
|
+
* <ChainOfThought onExpandedChange={(e) => setExpanded(e.expanded)} />
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
onExpandedChange?: (event: ChainOfThoughtExpandedChangeEvent) => void;
|
|
102
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { CheckpointState } from './CheckpointState';
|
|
9
|
+
import { CheckpointTemplateProps } from './CheckpointTemplateProps';
|
|
10
|
+
import { CheckpointActionEvent } from '../Events';
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
/**
|
|
13
|
+
* Defines the props for the `Checkpoint` component.
|
|
14
|
+
*
|
|
15
|
+
* `Checkpoint` marks a point in the transcript the user can restore to, or redo
|
|
16
|
+
* past, after a restore. It renders a built-in default action driven by `state`,
|
|
17
|
+
* which can be entirely replaced by supplying `template`.
|
|
18
|
+
*
|
|
19
|
+
* Extends `React.HTMLAttributes<HTMLDivElement>` to allow passing standard HTML
|
|
20
|
+
* attributes (e.g. `className`, `style`, `id`) directly to the root element.
|
|
21
|
+
*/
|
|
22
|
+
export interface CheckpointProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
/**
|
|
24
|
+
* When `true`, the checkpoint strip is always visible.
|
|
25
|
+
* When `false` or omitted, the strip is only revealed on hover.
|
|
26
|
+
*
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
visible?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The current lifecycle state of the checkpoint, driving the default
|
|
32
|
+
* built-in action rendered in the checkpoint content area.
|
|
33
|
+
* When omitted, no default action is rendered.
|
|
34
|
+
*/
|
|
35
|
+
state?: CheckpointState;
|
|
36
|
+
/**
|
|
37
|
+
* A custom component that replaces the default per-state action entirely
|
|
38
|
+
* when supplied — e.g. a timestamp, version label, author, or
|
|
39
|
+
* restore-confirmation/failure content.
|
|
40
|
+
*/
|
|
41
|
+
template?: React.ComponentType<CheckpointTemplateProps>;
|
|
42
|
+
/**
|
|
43
|
+
* Callback fired when the user activates the current checkpoint action
|
|
44
|
+
* (e.g. clicks "Restore Checkpoint" or "Redo"). The payload always
|
|
45
|
+
* mirrors the `state` prop's value at the time of activation.
|
|
46
|
+
*/
|
|
47
|
+
onAction?: (event: CheckpointActionEvent) => void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Represents the current state of a `Checkpoint`.
|
|
10
|
+
*
|
|
11
|
+
* - `'startOver'` — marks the start of a conversation; the user can restore to the beginning of the conversation.
|
|
12
|
+
* - `'restore'` — the checkpoint marks a point the user can restore to.
|
|
13
|
+
* - `'redo'` — the checkpoint has been restored and a redo action is available.
|
|
14
|
+
*
|
|
15
|
+
* `Checkpoint` renders a built-in default action for each of these states
|
|
16
|
+
* (`'startOver'` renders a "Start Over" button, `'restore'` renders a "Restore Checkpoint" button; `'redo'`
|
|
17
|
+
* renders a restored-state stamp followed by a "Redo" button). The `template`
|
|
18
|
+
* prop, when supplied, replaces that default action entirely.
|
|
19
|
+
*/
|
|
20
|
+
export type CheckpointState = 'startOver' | 'restore' | 'redo';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { CheckpointState } from './CheckpointState';
|
|
9
|
+
/**
|
|
10
|
+
* The props passed to a custom `template` component for the `Checkpoint` component.
|
|
11
|
+
*
|
|
12
|
+
* When a `template` is provided, it replaces the default per-state action
|
|
13
|
+
* entirely — e.g. to render a timestamp, version label, author, or
|
|
14
|
+
* restore-confirmation/failure content.
|
|
15
|
+
*/
|
|
16
|
+
export interface CheckpointTemplateProps {
|
|
17
|
+
/** The current lifecycle state of the checkpoint. */
|
|
18
|
+
state?: CheckpointState;
|
|
19
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { CitationSource } from './CitationSource';
|
|
9
|
+
/**
|
|
10
|
+
* The props passed to a custom `bodyTemplate` component for the `Citation` component.
|
|
11
|
+
*
|
|
12
|
+
* When a `bodyTemplate` is provided, it replaces the default rendering of the
|
|
13
|
+
* resource details body (title, description, URL) for each source.
|
|
14
|
+
*/
|
|
15
|
+
export interface CitationBodyTemplateProps {
|
|
16
|
+
/** The citation sources to render. */
|
|
17
|
+
sources: CitationSource[];
|
|
18
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { SVGIcon } from '@progress/kendo-react-common';
|
|
9
|
+
import { CitationOpenEvent } from '../Events';
|
|
10
|
+
import { CitationSource } from './CitationSource';
|
|
11
|
+
import { CitationBodyTemplateProps } from './CitationBodyTemplateProps';
|
|
12
|
+
import { CitationShowOn } from './CitationShowOn';
|
|
13
|
+
import * as React from 'react';
|
|
14
|
+
/**
|
|
15
|
+
* Defines the props for the `Citation` component.
|
|
16
|
+
*
|
|
17
|
+
* `Citation` renders as an inline chip-like element that represents one or more
|
|
18
|
+
* source references. It is fully self-contained: hovering, clicking, or
|
|
19
|
+
* activating (`Enter`/`Space`, or touch) the citation shows its own resource
|
|
20
|
+
* details popover automatically — no separate popover component needs to be
|
|
21
|
+
* rendered or wired up by the host. `onOpen` is an informational event fired
|
|
22
|
+
* alongside a click/keyboard activation.
|
|
23
|
+
*
|
|
24
|
+
* Extends `React.HTMLAttributes<HTMLDivElement>` to allow passing standard HTML
|
|
25
|
+
* attributes (e.g. `className`, `style`, `id`) directly to the root element.
|
|
26
|
+
* Does NOT extend `ChipProps` — `Chip` is used internally.
|
|
27
|
+
*/
|
|
28
|
+
export interface CitationProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
/**
|
|
30
|
+
* Source resources associated with the citation, in display order.
|
|
31
|
+
*
|
|
32
|
+
* @default []
|
|
33
|
+
*/
|
|
34
|
+
sources?: CitationSource[];
|
|
35
|
+
/**
|
|
36
|
+
* Inline chip label. When omitted, derived from the first source's URL/domain.
|
|
37
|
+
*/
|
|
38
|
+
label?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Chip icon.
|
|
41
|
+
* Pass an icon object from `@progress/kendo-svg-icons`.
|
|
42
|
+
*
|
|
43
|
+
* @default globeIcon
|
|
44
|
+
*/
|
|
45
|
+
svgIcon?: SVGIcon;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to show the `+N` additional-sources indicator next to the label,
|
|
48
|
+
* where `N` is `sources.length - 1`. Does not affect which source is used
|
|
49
|
+
* to derive the default `label`.
|
|
50
|
+
*
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
additionalCount?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* A custom component that replaces the default rendering of the resource
|
|
56
|
+
* details body (title, description, URL for each source).
|
|
57
|
+
*/
|
|
58
|
+
bodyTemplate?: React.ComponentType<CitationBodyTemplateProps>;
|
|
59
|
+
/**
|
|
60
|
+
* Callback fired when the citation's resource details are about to be
|
|
61
|
+
* shown, after a click or keyboard/touch activation. This event is
|
|
62
|
+
* informational — `Citation` shows its own popover automatically and
|
|
63
|
+
* does not require the host to open or close anything in response.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```tsx
|
|
67
|
+
* <Citation sources={sources} onOpen={(e) => console.log(e.sources)} />
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
onOpen?: (event: CitationOpenEvent) => void;
|
|
71
|
+
/**
|
|
72
|
+
* Specifies when the Citation popover becomes visible.
|
|
73
|
+
*
|
|
74
|
+
* The available options are:
|
|
75
|
+
* - `hover` — Displays the popover when the mouse hovers over the chip.
|
|
76
|
+
* - `click` — Displays the popover when the chip is clicked.
|
|
77
|
+
*
|
|
78
|
+
* @default 'hover'
|
|
79
|
+
*/
|
|
80
|
+
showOn?: CitationShowOn;
|
|
81
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Specifies when the Citation popover is displayed.
|
|
10
|
+
* - `hover` — Shows the popover when the mouse hovers over the chip (default).
|
|
11
|
+
* - `click` — Shows the popover when the chip is clicked.
|
|
12
|
+
*/
|
|
13
|
+
export type CitationShowOn = 'hover' | 'click';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* A single source reference associated with a `Citation`. Each `CitationSource`
|
|
10
|
+
* in `Citation.sources` corresponds to one page/view in the citation's own
|
|
11
|
+
* paginated resource details popover.
|
|
12
|
+
*/
|
|
13
|
+
export interface CitationSource {
|
|
14
|
+
/**
|
|
15
|
+
* The title of the source document or web page.
|
|
16
|
+
*/
|
|
17
|
+
title?: string;
|
|
18
|
+
/**
|
|
19
|
+
* A short description or excerpt of the source.
|
|
20
|
+
*/
|
|
21
|
+
description?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The full URL of the source.
|
|
24
|
+
*/
|
|
25
|
+
url?: string;
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import * as React from 'react';
|
|
9
|
+
/**
|
|
10
|
+
* The props passed to a custom `contentTemplate` component for the `Reasoning` component.
|
|
11
|
+
*
|
|
12
|
+
* When a `contentTemplate` is provided, it replaces the default rendering of the
|
|
13
|
+
* reasoning body content.
|
|
14
|
+
*/
|
|
15
|
+
export interface ReasoningContentTemplateProps {
|
|
16
|
+
/** The reasoning body content supplied by the host, forwarded from `children`. */
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { SVGIcon } from '@progress/kendo-react-common';
|
|
9
|
+
import { ReasoningExpandedChangeEvent } from '../Events';
|
|
10
|
+
import { ReasoningContentTemplateProps } from './ReasoningContentTemplateProps';
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
/**
|
|
13
|
+
* Defines the props for the `Reasoning` component.
|
|
14
|
+
*
|
|
15
|
+
* `Reasoning` displays a single reasoning/explanation step with an optional
|
|
16
|
+
* collapsible body. Body content (`children`) follows React convention;
|
|
17
|
+
* `contentTemplate` overrides its rendering.
|
|
18
|
+
*
|
|
19
|
+
* Extends `React.HTMLAttributes<HTMLDivElement>` to allow passing standard HTML
|
|
20
|
+
* attributes (e.g. `className`, `style`, `id`) directly to the root element.
|
|
21
|
+
*/
|
|
22
|
+
export interface ReasoningProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
/**
|
|
24
|
+
* Summary label in the head.
|
|
25
|
+
*
|
|
26
|
+
* @default "Reasoning"
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <Reasoning label="Thinking" />
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
label?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Secondary descriptive text (subtle), rendered next to `label`.
|
|
36
|
+
* Include timing text here when needed.
|
|
37
|
+
*/
|
|
38
|
+
secondaryLabel?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Head icon.
|
|
41
|
+
* Pass an icon object from `@progress/kendo-svg-icons`.
|
|
42
|
+
*
|
|
43
|
+
* @default sparklesIcon
|
|
44
|
+
*/
|
|
45
|
+
svgIcon?: SVGIcon;
|
|
46
|
+
/**
|
|
47
|
+
* Semantic lifecycle state. `false` renders active/in-progress treatment;
|
|
48
|
+
* `true` renders the finished, reduced-emphasis treatment.
|
|
49
|
+
*
|
|
50
|
+
* @default false
|
|
51
|
+
*/
|
|
52
|
+
completed?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Controls the expanded state of the body in controlled mode.
|
|
55
|
+
* Use together with `onExpandedChange`.
|
|
56
|
+
*/
|
|
57
|
+
expanded?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* The initial expanded state in uncontrolled mode. Ignored when `expanded` is provided.
|
|
60
|
+
*
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
defaultExpanded?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Whether the head exposes disclosure behavior (a toggle affordance).
|
|
66
|
+
*
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
expandable?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* A custom component that replaces the default body content rendering.
|
|
72
|
+
* Receives the reasoning `children` via `ReasoningContentTemplateProps`.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```tsx
|
|
76
|
+
* const MyContent = ({ children }: ReasoningContentTemplateProps) => <div>{children}</div>;
|
|
77
|
+
* <Reasoning contentTemplate={MyContent}>Reasoning body text</Reasoning>
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
contentTemplate?: React.ComponentType<ReasoningContentTemplateProps>;
|
|
81
|
+
/**
|
|
82
|
+
* Callback fired when the user toggles the reasoning body.
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```tsx
|
|
86
|
+
* <Reasoning onExpandedChange={(e) => setExpanded(e.expanded)} />
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
onExpandedChange?: (event: ReasoningExpandedChangeEvent) => void;
|
|
90
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { SVGIcon } from '@progress/kendo-react-common';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
/**
|
|
11
|
+
* A single row rendered inside a `ChainOfThought`, supplied via the `thoughts` prop.
|
|
12
|
+
*
|
|
13
|
+
* `Thought` is a public data type — it is not a separately rendered component.
|
|
14
|
+
*/
|
|
15
|
+
export interface Thought {
|
|
16
|
+
/**
|
|
17
|
+
* Short name for the thought step, such as `"Read"` or `"Edited"`.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```tsx
|
|
21
|
+
* const thoughts: Thought[] = [{ label: 'Read', content: 'Read package.json' }];
|
|
22
|
+
* <ChainOfThought thoughts={thoughts} />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
label: string;
|
|
26
|
+
/**
|
|
27
|
+
* Supporting context, such as a file name, command, or line range.
|
|
28
|
+
*/
|
|
29
|
+
secondaryLabel?: string;
|
|
30
|
+
/**
|
|
31
|
+
* The body of the thought — the detailed explanation or result associated with the step.
|
|
32
|
+
* Accepts plain text or a custom `ReactNode`, such as a `Citation` list.
|
|
33
|
+
*/
|
|
34
|
+
content: React.ReactNode;
|
|
35
|
+
/**
|
|
36
|
+
* Icon that identifies the thought operation or category.
|
|
37
|
+
* Pass an icon object from `@progress/kendo-svg-icons`.
|
|
38
|
+
*/
|
|
39
|
+
svgIcon?: SVGIcon;
|
|
40
|
+
/**
|
|
41
|
+
* Semantic lifecycle state of the thought row. `false`/omitted renders the
|
|
42
|
+
* active/in-progress treatment; `true` renders the finished treatment.
|
|
43
|
+
*
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
completed?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Number of lines added by the thought, when the step represents an edit.
|
|
49
|
+
*/
|
|
50
|
+
linesAdded?: number;
|
|
51
|
+
/**
|
|
52
|
+
* Number of lines removed by the thought, when the step represents an edit.
|
|
53
|
+
*/
|
|
54
|
+
linesRemoved?: number;
|
|
55
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { SVGIcon } from '@progress/kendo-react-common';
|
|
9
|
+
import * as React from 'react';
|
|
10
|
+
/**
|
|
11
|
+
* Defines the props for the `Thought` component.
|
|
12
|
+
*
|
|
13
|
+
* `Thought` is a non-expandable sub-step item rendered inside a `ChainOfThought`.
|
|
14
|
+
* It displays an icon, label, optional metadata (diff counts, timestamp, status),
|
|
15
|
+
* and an optional completed indicator.
|
|
16
|
+
*
|
|
17
|
+
* Extends `React.HTMLAttributes<HTMLDivElement>` to allow passing standard HTML
|
|
18
|
+
* attributes (e.g. `className`, `style`, `id`) directly to the root element.
|
|
19
|
+
*
|
|
20
|
+
* @hidden
|
|
21
|
+
*/
|
|
22
|
+
export interface ThoughtProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
23
|
+
/**
|
|
24
|
+
* The SVG icon displayed at the start of the thought row.
|
|
25
|
+
* Pass an icon object from `@progress/kendo-svg-icons`.
|
|
26
|
+
*/
|
|
27
|
+
svgIcon?: SVGIcon;
|
|
28
|
+
/**
|
|
29
|
+
* The primary label text displayed in the thought row.
|
|
30
|
+
*/
|
|
31
|
+
label?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Additional CSS class name(s) applied to the label element.
|
|
34
|
+
* Use to override or augment the default label styling.
|
|
35
|
+
*/
|
|
36
|
+
labelClassName?: string;
|
|
37
|
+
/**
|
|
38
|
+
* An optional secondary label displayed alongside the primary label,
|
|
39
|
+
* typically used for a brief contextual note or sub-title.
|
|
40
|
+
* Duration information should be included here when needed.
|
|
41
|
+
*/
|
|
42
|
+
secondaryLabel?: string;
|
|
43
|
+
/**
|
|
44
|
+
* The number of lines added in this thought, shown as a green diff indicator.
|
|
45
|
+
*/
|
|
46
|
+
linesAdded?: number;
|
|
47
|
+
/**
|
|
48
|
+
* The number of lines removed in this thought, shown as a red diff indicator.
|
|
49
|
+
*/
|
|
50
|
+
linesRemoved?: number;
|
|
51
|
+
/**
|
|
52
|
+
* A text label for the status badge rendered in the thought row.
|
|
53
|
+
*/
|
|
54
|
+
status?: string;
|
|
55
|
+
/**
|
|
56
|
+
* The theme color applied to the status badge.
|
|
57
|
+
* Maps to the Kendo theme color palette.
|
|
58
|
+
*
|
|
59
|
+
* - `'base'` — neutral/default
|
|
60
|
+
* - `'success'` — green, used for completed states
|
|
61
|
+
* - `'warning'` — yellow/orange, used for pending states
|
|
62
|
+
* - `'error'` — red, used for failure states
|
|
63
|
+
* - `'info'` — blue, used for informational states
|
|
64
|
+
*/
|
|
65
|
+
statusThemeColor?: 'base' | 'success' | 'warning' | 'error' | 'info';
|
|
66
|
+
/**
|
|
67
|
+
* An SVG icon displayed alongside the status badge.
|
|
68
|
+
* Pass an icon object from `@progress/kendo-svg-icons`.
|
|
69
|
+
*/
|
|
70
|
+
statusSvgIcon?: SVGIcon;
|
|
71
|
+
/**
|
|
72
|
+
* When `true`, the thought row is marked as completed.
|
|
73
|
+
* Completed thoughts render with a distinct visual treatment (no shimmer).
|
|
74
|
+
* When `false` or omitted, the thought renders as active (with shimmer animation).
|
|
75
|
+
*/
|
|
76
|
+
completed?: boolean;
|
|
77
|
+
/**
|
|
78
|
+
* An optional description text rendered below the primary label.
|
|
79
|
+
* Use for additional context about what the thought represents.
|
|
80
|
+
*/
|
|
81
|
+
description?: string;
|
|
82
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { Thought } from './Thought';
|
|
9
|
+
/**
|
|
10
|
+
* The props passed to a custom `thoughtTemplate` component for the `ChainOfThought` component.
|
|
11
|
+
*
|
|
12
|
+
* When a `thoughtTemplate` is provided, it replaces the default rendering of each `Thought` row.
|
|
13
|
+
*/
|
|
14
|
+
export interface ThoughtTemplateProps {
|
|
15
|
+
/** The `Thought` data item being rendered. */
|
|
16
|
+
thought: Thought;
|
|
17
|
+
/** The zero-based index of the thought within the `thoughts` array. */
|
|
18
|
+
index: number;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The action a user took in response to a `ToolCall` awaiting approval.
|
|
10
|
+
*
|
|
11
|
+
* - `'approve'` — the user approved the tool invocation.
|
|
12
|
+
* - `'reject'` — the user rejected the tool invocation.
|
|
13
|
+
*/
|
|
14
|
+
export type ToolCallActionType = 'approve' | 'reject';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { ToolCallState } from './ToolCallState';
|
|
9
|
+
/**
|
|
10
|
+
* The props passed to a custom `approvalTemplate` component for the `ToolCall` component.
|
|
11
|
+
*
|
|
12
|
+
* When an `approvalTemplate` is provided, it replaces the default approval
|
|
13
|
+
* explanation and Approve/Reject actions rendered when `state` is `'awaitingApproval'`.
|
|
14
|
+
*/
|
|
15
|
+
export interface ToolCallApprovalTemplateProps {
|
|
16
|
+
/** The current lifecycle state of the tool call. */
|
|
17
|
+
state?: ToolCallState;
|
|
18
|
+
/** The approval explanation text supplied via `approvalText`. */
|
|
19
|
+
approvalText?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The props passed to a custom `errorTemplate` component for the `ToolCall` component.
|
|
10
|
+
*
|
|
11
|
+
* When an `errorTemplate` is provided, it replaces the default error message rendering.
|
|
12
|
+
*/
|
|
13
|
+
export interface ToolCallErrorTemplateProps {
|
|
14
|
+
/** The error message text. */
|
|
15
|
+
errorText?: string;
|
|
16
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The props passed to a custom `paramsTemplate` component for the `ToolCall` component.
|
|
10
|
+
*
|
|
11
|
+
* When a `paramsTemplate` is provided, it replaces the default JSON parameters rendering.
|
|
12
|
+
*/
|
|
13
|
+
export interface ToolCallParamsTemplateProps {
|
|
14
|
+
/** The raw tool input / parameter data. */
|
|
15
|
+
parameters: unknown;
|
|
16
|
+
}
|