@itechchoice/prime-chatkit 0.1.0-alpha.0 → 0.1.0-alpha.10
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/LICENSE +20 -0
- package/dist/index.js +10129 -8842
- package/dist/style.css +1 -1
- package/dist/types/adapters/bff/controller.d.ts +3 -0
- package/dist/types/components/agent-thread.d.ts +758 -0
- package/dist/types/components/app-shell.d.ts +478 -0
- package/dist/types/components/ui/chat-composer-clean.d.ts +6 -1
- package/dist/types/components/ui/command-menu-clean.d.ts +3 -1
- package/dist/types/components/ui/decision-card-clean.d.ts +1 -0
- package/dist/types/components/ui/dropzone-clean.d.ts +5 -1
- package/dist/types/components/ui/filter-menu-clean.d.ts +28 -0
- package/dist/types/components/ui/message-actions-clean.d.ts +85 -0
- package/dist/types/components/ui/setup-guide-clean.d.ts +22 -0
- package/dist/types/components/ui/text-field-clean.d.ts +28 -0
- package/dist/types/components/ui/thinking-loader-clean.d.ts +19 -0
- package/dist/types/core/history.d.ts +2 -0
- package/dist/types/core/run.d.ts +2 -0
- package/dist/types/layout/constants.d.ts +3 -1
- package/dist/types/ui/blocks/BlocksPanel.d.ts +4 -1
- package/dist/types/ui/blocks/LiveStatus.d.ts +12 -0
- package/dist/types/ui/blocks/useFollowLatest.d.ts +2 -1
- package/dist/types/ui/i18n.d.ts +20 -78
- package/dist/types/ui/thread.d.ts +3 -0
- package/package.json +3 -3
- package/dist/types/ui/blocks/Process.d.ts +0 -7
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type SetupTask = {
|
|
2
|
+
id: string;
|
|
3
|
+
label: string;
|
|
4
|
+
done?: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type SetupGroup = {
|
|
7
|
+
id: string;
|
|
8
|
+
title: string;
|
|
9
|
+
tasks: SetupTask[];
|
|
10
|
+
};
|
|
11
|
+
export type SetupGuideProps = {
|
|
12
|
+
title?: string;
|
|
13
|
+
groups: SetupGroup[];
|
|
14
|
+
/** Shows an "Edit" link in the header */
|
|
15
|
+
onEdit?: () => void;
|
|
16
|
+
/** Shows a close button in the header */
|
|
17
|
+
onClose?: () => void;
|
|
18
|
+
/** Called with the ids of all finished tasks */
|
|
19
|
+
onChange?: (done: string[]) => void;
|
|
20
|
+
className?: string;
|
|
21
|
+
};
|
|
22
|
+
export declare function SetupGuide({ title, groups, onEdit, onClose, onChange, className }: SetupGuideProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
|
+
export type TextFieldProps = Omit<ComponentPropsWithRef<"input">, "size" | "prefix"> & {
|
|
3
|
+
/** Shown above the field and tied to it */
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
/** A quiet line under the field – the error takes its place while there is one */
|
|
6
|
+
hint?: ReactNode;
|
|
7
|
+
/** Marks the field invalid and shows this under it, in place of the hint */
|
|
8
|
+
error?: ReactNode;
|
|
9
|
+
/** Text or an icon inside the field, before the value – e.g. "https://" or a search icon */
|
|
10
|
+
prefix?: ReactNode;
|
|
11
|
+
/** Text or an icon inside the field, after the value – e.g. ".acme.app" or "USD" */
|
|
12
|
+
suffix?: ReactNode;
|
|
13
|
+
/** sm 28 · md 32 · lg 36 high */
|
|
14
|
+
size?: "sm" | "md" | "lg";
|
|
15
|
+
/** "Optional" next to the label */
|
|
16
|
+
optional?: boolean;
|
|
17
|
+
/** A small × that empties the field while it has a value */
|
|
18
|
+
clearable?: boolean;
|
|
19
|
+
/** A copy button – for API keys, links and IDs, usually with readOnly */
|
|
20
|
+
copyable?: boolean;
|
|
21
|
+
/** Shows "12/40" under the field; needs maxLength */
|
|
22
|
+
counter?: boolean;
|
|
23
|
+
/** Called after the × emptied the field (onChange fires too) */
|
|
24
|
+
onClear?: () => void;
|
|
25
|
+
/** Extra class on the input itself; className goes on the wrapper */
|
|
26
|
+
inputClassName?: string;
|
|
27
|
+
};
|
|
28
|
+
export declare function TextField({ label, hint, error, prefix, suffix, size, optional, clearable, copyable, counter, onClear, onKeyDown, className, inputClassName, id, type, value, defaultValue, onChange, disabled, readOnly, maxLength, ref, "aria-describedby": describedBy, ...rest }: TextFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type ThinkingLoaderProps = {
|
|
2
|
+
/** Labels to walk through, one after another */
|
|
3
|
+
phases?: string[];
|
|
4
|
+
/** Time per phase, in ms */
|
|
5
|
+
interval?: number;
|
|
6
|
+
/** Show a specific phase instead of advancing on a timer – e.g. from your stream events */
|
|
7
|
+
phase?: number;
|
|
8
|
+
/** Start over after the last phase instead of holding it */
|
|
9
|
+
loop?: boolean;
|
|
10
|
+
/** Finished: the spinner turns into a check and the label into doneLabel */
|
|
11
|
+
done?: boolean;
|
|
12
|
+
/** Label once done – a string, or a function that gets the seconds since the loader started */
|
|
13
|
+
doneLabel?: string | ((seconds: number) => string);
|
|
14
|
+
size?: "sm" | "md";
|
|
15
|
+
/** "pill" = bordered capsule, "plain" = just the spinner and the label, e.g. inside a chat bubble */
|
|
16
|
+
variant?: "pill" | "plain";
|
|
17
|
+
className?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare function ThinkingLoader({ phases: phasesProp, interval: intervalProp, phase, loop, done, doneLabel, size, variant, className, }: ThinkingLoaderProps): import("react").JSX.Element;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { ChatMessage } from "./types";
|
|
2
|
+
/** Only the last assistant segment for each task may remain running or waiting. */
|
|
3
|
+
export declare function settleEarlierSegments(messages: ChatMessage[]): ChatMessage[];
|
|
2
4
|
/** Map a chronological history page without mutating records or consulting the clock. */
|
|
3
5
|
export declare function messagesFromHistory(records: unknown[]): ChatMessage[];
|
package/dist/types/core/run.d.ts
CHANGED
|
@@ -12,6 +12,8 @@ export declare function idGreater(a: string, b: string): boolean;
|
|
|
12
12
|
export declare function createRun(taskId: string, now?: number): Run;
|
|
13
13
|
/** Text the user should read as the answer right now: the confirmed final text, else the newest turn still writing */
|
|
14
14
|
export declare function answerText(run: Run): string;
|
|
15
|
+
/** The backend joins reasoning sections without separators; restore blank lines before their headings. */
|
|
16
|
+
export declare function reasoningText(text: string): string;
|
|
15
17
|
export type AnswerSource = {
|
|
16
18
|
label: string;
|
|
17
19
|
href?: string;
|
|
@@ -10,11 +10,13 @@ export declare const SPLIT_BREAKPOINT = 1440;
|
|
|
10
10
|
export declare const MIN_SPLIT_WIDTH = 1280;
|
|
11
11
|
export declare const DOCK_INTERACTIVE_BREAKPOINT = 768;
|
|
12
12
|
export declare const MIN_SPLIT_CONTENT_WIDTH = 620;
|
|
13
|
+
export declare const SPLIT_PANEL_MIN_WIDTH = 480;
|
|
14
|
+
export declare const SPLIT_PANEL_MAX_WIDTH = 720;
|
|
13
15
|
export declare const HEADER_HEIGHT_FALLBACK = 64;
|
|
14
16
|
export declare const DOCK_EDGE_GAP = 12;
|
|
15
|
-
export declare const DOCK_DEFAULT_WIDTH = 720;
|
|
16
17
|
export declare const DOCK_DEFAULT_HEIGHT = 760;
|
|
17
18
|
export declare const DOCK_MIN_WIDTH = 420;
|
|
19
|
+
export declare const DOCK_DEFAULT_WIDTH = 420;
|
|
18
20
|
export declare const DOCK_MIN_HEIGHT = 620;
|
|
19
21
|
export declare const DOCK_MAX_WIDTH = 960;
|
|
20
22
|
export declare const DOCK_GEOMETRY_STORAGE_KEY = "abcPrimeDockGeometry:v1";
|
|
@@ -7,6 +7,8 @@ import { type OlderMessages } from "./useFollowLatest";
|
|
|
7
7
|
import { type GetAttachmentUrls } from "./useAttachmentDownload";
|
|
8
8
|
export type BlocksPanelProps = {
|
|
9
9
|
messages: ChatMessage[];
|
|
10
|
+
loading?: boolean;
|
|
11
|
+
title?: string;
|
|
10
12
|
history?: {
|
|
11
13
|
sessions?: ControllerState["sessions"];
|
|
12
14
|
currentId?: string;
|
|
@@ -51,6 +53,7 @@ export type BlocksPanelProps = {
|
|
|
51
53
|
onSend: (text: string, attachments: UploadedAttachment[]) => void;
|
|
52
54
|
onStop?: () => void;
|
|
53
55
|
onNewChat?: () => void;
|
|
56
|
+
layout?: "split" | "float";
|
|
54
57
|
onToggleLayout?: () => void;
|
|
55
58
|
onClose?: () => void;
|
|
56
59
|
onCreditsClick?: () => void;
|
|
@@ -67,4 +70,4 @@ export type BlocksPanelProps = {
|
|
|
67
70
|
};
|
|
68
71
|
getAttachmentUrls?: GetAttachmentUrls;
|
|
69
72
|
};
|
|
70
|
-
export declare function BlocksPanel({ messages, history, start, availability, provisioning, older, suspension, onAnswerSuspension, onCancelSuspension, error, locale, credits, branding, onSend, onStop, onNewChat, onToggleLayout, onClose, onCreditsClick, onHeaderPointerDown, processView, onRegenerate, onFeedback, onNavigate, upload, attachmentLimits, getAttachmentUrls, className }: BlocksPanelProps): import("react").JSX.Element;
|
|
73
|
+
export declare function BlocksPanel({ messages, loading, title, history, start, availability, provisioning, older, suspension, onAnswerSuspension, onCancelSuspension, error, locale, credits, branding, onSend, onStop, onNewChat, layout, onToggleLayout, onClose, onCreditsClick, onHeaderPointerDown, processView, onRegenerate, onFeedback, onNavigate, upload, attachmentLimits, getAttachmentUrls, className }: BlocksPanelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Run } from "../../core/types";
|
|
2
|
+
import type { BlocksCopy, ThreadCopy } from "../i18n";
|
|
3
|
+
/** The prototype's phase precedence, preferring concise tool names for the live status. */
|
|
4
|
+
export declare function phaseLabel(run: Run, live: BlocksCopy["live"], copy: ThreadCopy, options?: {
|
|
5
|
+
hideTools?: boolean;
|
|
6
|
+
}): string;
|
|
7
|
+
export declare function LiveStatus({ run, live, copy, hideTools }: {
|
|
8
|
+
run: Run;
|
|
9
|
+
live: BlocksCopy["live"];
|
|
10
|
+
copy: ThreadCopy;
|
|
11
|
+
hideTools?: boolean;
|
|
12
|
+
}): import("react").JSX.Element | null;
|
|
@@ -3,10 +3,11 @@ export type OlderMessages = {
|
|
|
3
3
|
loading: boolean;
|
|
4
4
|
onLoad: () => void;
|
|
5
5
|
};
|
|
6
|
-
/** Layout glue:
|
|
6
|
+
/** Layout glue: follow at the bottom and resume when the reader sends or explicitly jumps. */
|
|
7
7
|
export declare function useFollowLatest({ messages, older, active }: {
|
|
8
8
|
messages: readonly {
|
|
9
9
|
id: string;
|
|
10
|
+
role: "user" | "assistant";
|
|
10
11
|
}[];
|
|
11
12
|
older?: OlderMessages;
|
|
12
13
|
active?: boolean;
|
package/dist/types/ui/i18n.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { ThreadLabels, ThreadLabelsFull } from "../components/agent-thread";
|
|
1
2
|
import type { ChatComposerLabels } from "../components/ui/chat-composer-clean";
|
|
3
|
+
import type { MessageActionsLabels } from "../components/ui/message-actions-clean";
|
|
2
4
|
import type { ToolCallLabels } from "../components/ui/tool-call-card-clean";
|
|
3
5
|
/** Copy used only by the view-model → thread mapping. */
|
|
4
6
|
export type ThreadCopy = {
|
|
@@ -12,85 +14,10 @@ export type ThreadCopy = {
|
|
|
12
14
|
export declare const zhThreadCopy: ThreadCopy;
|
|
13
15
|
export declare const enThreadCopy: ThreadCopy;
|
|
14
16
|
export declare const zhComposerLabels: ChatComposerLabels;
|
|
17
|
+
export declare const zhMessageActionsLabels: MessageActionsLabels;
|
|
15
18
|
export declare const zhToolCallLabels: ToolCallLabels;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
toolCall?: Partial<ToolCallLabels>;
|
|
19
|
-
};
|
|
20
|
-
export declare const zhThreadLabels: {
|
|
21
|
-
composer: {
|
|
22
|
-
placeholder: string;
|
|
23
|
-
requestApproval: string;
|
|
24
|
-
requestApprovalDescription: string;
|
|
25
|
-
approveForMe: string;
|
|
26
|
-
approveForMeDescription: string;
|
|
27
|
-
fullAccess: string;
|
|
28
|
-
fullAccessDescription: string;
|
|
29
|
-
add: string;
|
|
30
|
-
files: string;
|
|
31
|
-
attachClaude: string;
|
|
32
|
-
workInFolder: string;
|
|
33
|
-
chooseFolder: string;
|
|
34
|
-
goal: string;
|
|
35
|
-
goalDescription: string;
|
|
36
|
-
planMode: string;
|
|
37
|
-
planOnDescription: string;
|
|
38
|
-
recordSkill: string;
|
|
39
|
-
draw: string;
|
|
40
|
-
drawDescription: string;
|
|
41
|
-
plugins: string;
|
|
42
|
-
documents: string;
|
|
43
|
-
documentsDescription: string;
|
|
44
|
-
pdf: string;
|
|
45
|
-
pdfDescription: string;
|
|
46
|
-
noFolder: string;
|
|
47
|
-
planOff: string;
|
|
48
|
-
planOn: string;
|
|
49
|
-
recording: string;
|
|
50
|
-
recordingAdded: string;
|
|
51
|
-
recordingDiscarded: string;
|
|
52
|
-
messageSent: string;
|
|
53
|
-
composer: string;
|
|
54
|
-
message: string;
|
|
55
|
-
voiceInput: string;
|
|
56
|
-
sendMessage: string;
|
|
57
|
-
discardRecording: string;
|
|
58
|
-
useRecording: string;
|
|
59
|
-
connectApps: string;
|
|
60
|
-
addToChat: string;
|
|
61
|
-
planOffDescription: string;
|
|
62
|
-
approvalQuestion: string;
|
|
63
|
-
learnMore: string;
|
|
64
|
-
selectModel: string;
|
|
65
|
-
apps: string;
|
|
66
|
-
workingIn: (folder: string) => string;
|
|
67
|
-
appConnection: (name: string | undefined, connected: boolean) => string;
|
|
68
|
-
selected: (name: string | undefined) => string;
|
|
69
|
-
connectedCount: (n: number) => string;
|
|
70
|
-
};
|
|
71
|
-
toolCall: {
|
|
72
|
-
failed: string;
|
|
73
|
-
error: string;
|
|
74
|
-
retry: string;
|
|
75
|
-
arguments: string;
|
|
76
|
-
result: string;
|
|
77
|
-
waiting: string;
|
|
78
|
-
empty: string;
|
|
79
|
-
showAll: string;
|
|
80
|
-
showLess: string;
|
|
81
|
-
copied: string;
|
|
82
|
-
copyArguments: string;
|
|
83
|
-
copyResult: string;
|
|
84
|
-
running: (name: string) => string;
|
|
85
|
-
finished: (name: string) => string;
|
|
86
|
-
failedAnnouncement: (name: string, error?: string) => string;
|
|
87
|
-
duration: (ms: number, live: boolean) => string;
|
|
88
|
-
usingTools: string;
|
|
89
|
-
usedTools: (n: number) => string;
|
|
90
|
-
failedTools: (n: number) => string;
|
|
91
|
-
groupAnnouncement: (count: string, failed: number) => string;
|
|
92
|
-
};
|
|
93
|
-
};
|
|
19
|
+
export declare const zhThreadLabels: ThreadLabelsFull;
|
|
20
|
+
export declare const enThreadLabels: Pick<ThreadLabelsFull, "toolsRunning" | "toolsStopped" | "toolsRan" | "toolsFailed">;
|
|
94
21
|
export declare function threadLabelsFor(locale?: string): {
|
|
95
22
|
labels: ThreadLabels;
|
|
96
23
|
copy: ThreadCopy;
|
|
@@ -99,13 +26,20 @@ export declare function threadLabelsFor(locale?: string): {
|
|
|
99
26
|
export type PanelCopy = {
|
|
100
27
|
credits: (balance: number, locale: string) => string;
|
|
101
28
|
history: string;
|
|
29
|
+
backToChat: string;
|
|
30
|
+
historyTitle: string;
|
|
31
|
+
loadingSession: string;
|
|
102
32
|
newChat: string;
|
|
103
33
|
switchLayout: string;
|
|
34
|
+
layoutFloat: string;
|
|
35
|
+
layoutSplit: string;
|
|
104
36
|
close: string;
|
|
105
37
|
placeholder: string;
|
|
106
38
|
unavailable: string;
|
|
107
39
|
provisionTitle: string;
|
|
108
40
|
provisionAction: string;
|
|
41
|
+
startGreeting: string;
|
|
42
|
+
startBody: string;
|
|
109
43
|
};
|
|
110
44
|
export declare const zhPanelCopy: PanelCopy;
|
|
111
45
|
export declare const enPanelCopy: PanelCopy;
|
|
@@ -155,6 +89,14 @@ export declare function historyLabelsFor(locale?: string): Partial<import("../co
|
|
|
155
89
|
import { type AIAnswerLabels } from "../components/ui/ai-answer-clean";
|
|
156
90
|
import { type DropzoneLabels } from "../components/ui/dropzone-clean";
|
|
157
91
|
export type BlocksCopy = {
|
|
92
|
+
live: {
|
|
93
|
+
ready: string;
|
|
94
|
+
thinking: string;
|
|
95
|
+
tool: (name: string) => string;
|
|
96
|
+
writing: string;
|
|
97
|
+
waiting: string;
|
|
98
|
+
working: string;
|
|
99
|
+
};
|
|
158
100
|
attachments: {
|
|
159
101
|
dropzone: DropzoneLabels;
|
|
160
102
|
collapse: string;
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itechchoice/prime-chatkit",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.10",
|
|
4
4
|
"description": "PrimeChatKit: React chat UI for products built on the prime-chatkit SDK BFF contract. Shows the agent's work: thinking, tool calls, approvals, sources and cost.",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"publishConfig": {
|
|
7
|
-
"access": "
|
|
7
|
+
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"module": "./dist/index.js",
|