@nexface/chat 0.1.1-alpha.4 → 0.1.1-alpha.6
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/client-entry.d.ts +2 -0
- package/dist/client-entry.js +2 -0
- package/dist/client-entry.js.map +1 -0
- package/dist/client.d.ts +89 -0
- package/dist/client.js +490 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +1 -1
- package/dist/default-chat.js +3 -2
- package/dist/default-chat.js.map +1 -1
- package/dist/messages.d.ts +27 -0
- package/dist/messages.js +121 -0
- package/dist/messages.js.map +1 -0
- package/dist/page-confirmation.d.ts +2 -4
- package/dist/protocol-messages.d.ts +8 -0
- package/dist/protocol-messages.js +236 -0
- package/dist/protocol-messages.js.map +1 -0
- package/dist/react.d.ts +22 -39
- package/dist/react.js +172 -713
- package/dist/react.js.map +1 -1
- package/dist/storage.js +2 -2
- package/dist/storage.js.map +1 -1
- package/dist/types.d.ts +3 -1
- package/package.json +14 -12
package/dist/react.d.ts
CHANGED
|
@@ -1,38 +1,14 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
|
-
import type { AgentModelConfig, AgentModelInfo,
|
|
2
|
+
import type { AgentModelConfig, AgentModelInfo, AgentRunResult } from "@nexface/agent";
|
|
3
3
|
import { type ToolRuntime } from "@nexface/tools";
|
|
4
4
|
import { type ToolApprovalInterruptDescriptor } from "./page-confirmation.js";
|
|
5
|
-
import { type
|
|
5
|
+
import { type ChatClientStatus, type RunHandler } from "./client.js";
|
|
6
|
+
import type { NexfaceAgentConfig } from "./config.js";
|
|
6
7
|
import type { ChatRunResult } from "./types.js";
|
|
7
8
|
import type { Attachment } from "./attachments.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} | {
|
|
12
|
-
type: "tool";
|
|
13
|
-
toolCallId: string;
|
|
14
|
-
name: string;
|
|
15
|
-
arguments: string;
|
|
16
|
-
input?: unknown;
|
|
17
|
-
parseError?: string;
|
|
18
|
-
result?: string;
|
|
19
|
-
isError?: boolean;
|
|
20
|
-
errorMessage?: string;
|
|
21
|
-
};
|
|
22
|
-
export interface UIMessage {
|
|
23
|
-
id: string;
|
|
24
|
-
role: "user" | "assistant";
|
|
25
|
-
parts: UIMessagePart[];
|
|
26
|
-
attachments?: Attachment[];
|
|
27
|
-
revisionOf?: string;
|
|
28
|
-
state?: "running" | "success" | "error";
|
|
29
|
-
}
|
|
30
|
-
interface ChatSessionSummary {
|
|
31
|
-
id: string;
|
|
32
|
-
title: string;
|
|
33
|
-
messageCount: number;
|
|
34
|
-
}
|
|
35
|
-
type ChatStatus = "idle" | "running" | "cancelling" | "switching-model";
|
|
9
|
+
import type { UIMessage } from "./messages.js";
|
|
10
|
+
export { applyEvent } from "./messages.js";
|
|
11
|
+
export type { UIMessage, UIMessagePart } from "./messages.js";
|
|
36
12
|
export type ChatCommandErrorCode = "CHAT_MODEL_SWITCH_BLOCKED" | "CHAT_RUNTIME_CHANGED" | "CHAT_RUN_ACTIVE" | "CHAT_SESSION_CREATE_BLOCKED" | "CHAT_SESSION_SWITCH_BLOCKED" | "INVALID_INPUT" | "UNKNOWN_SESSION";
|
|
37
13
|
export interface ChatError {
|
|
38
14
|
readonly type: "chat_error";
|
|
@@ -41,10 +17,14 @@ export interface ChatError {
|
|
|
41
17
|
}
|
|
42
18
|
export declare function isChatError(error: unknown): error is ChatError;
|
|
43
19
|
interface UseChatResult {
|
|
44
|
-
readonly sessions: readonly
|
|
20
|
+
readonly sessions: readonly {
|
|
21
|
+
id: string;
|
|
22
|
+
title: string;
|
|
23
|
+
messageCount: number;
|
|
24
|
+
}[];
|
|
45
25
|
readonly activeSessionId: string;
|
|
46
26
|
readonly messages: readonly UIMessage[];
|
|
47
|
-
readonly status:
|
|
27
|
+
readonly status: ChatClientStatus | "cancelling" | "switching-model";
|
|
48
28
|
readonly storageWarning?: string;
|
|
49
29
|
readonly error?: ChatError;
|
|
50
30
|
readonly model: AgentModelInfo;
|
|
@@ -63,16 +43,19 @@ interface UseChatResult {
|
|
|
63
43
|
confirmInterrupt(): void;
|
|
64
44
|
rejectInterrupt(): void;
|
|
65
45
|
createSession(): string;
|
|
66
|
-
switchSession(
|
|
46
|
+
switchSession(id: string): void;
|
|
67
47
|
switchModel(model: AgentModelConfig): Promise<void>;
|
|
68
48
|
}
|
|
69
|
-
export
|
|
49
|
+
export type NexfaceProviderProps = {
|
|
70
50
|
children: ReactNode;
|
|
71
|
-
agent: NexfaceAgentConfig;
|
|
72
51
|
toolRuntime: ToolRuntime;
|
|
73
52
|
webMcp?: boolean;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
|
|
53
|
+
} & ({
|
|
54
|
+
agent: NexfaceAgentConfig;
|
|
55
|
+
run?: never;
|
|
56
|
+
} | {
|
|
57
|
+
run: RunHandler;
|
|
58
|
+
agent?: never;
|
|
59
|
+
});
|
|
60
|
+
export declare function NexfaceProvider(props: NexfaceProviderProps): import("react").JSX.Element;
|
|
77
61
|
export declare function useChat(): UseChatResult;
|
|
78
|
-
export {};
|