@personaai/react 0.8.0 → 0.8.1
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/README.md +34 -10
- package/dist/index.cjs +7 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -241,6 +241,9 @@ type PersonaStreamingEvent = {
|
|
|
241
241
|
message: string;
|
|
242
242
|
retryable?: boolean;
|
|
243
243
|
providerName?: string;
|
|
244
|
+
} | {
|
|
245
|
+
type: "title";
|
|
246
|
+
title: string;
|
|
244
247
|
} | {
|
|
245
248
|
type: "CUSTOM";
|
|
246
249
|
name: "hitl_request";
|
|
@@ -284,6 +287,8 @@ interface UseChatOptions {
|
|
|
284
287
|
onEvent?: (event: PersonaStreamingEvent) => void;
|
|
285
288
|
/** Called when a fake/ephemeral chat mints a real thread on first send. Use to sync sidebar state (e.g. setThreadId(id)). */
|
|
286
289
|
onThreadCreated?: (threadId: string) => void;
|
|
290
|
+
/** Called when the backend auto-generates a thread title (3-4 word LLM summary of first user message). */
|
|
291
|
+
onTitle?: (title: string) => void;
|
|
287
292
|
/**
|
|
288
293
|
* Pass the object returned by `useVoice()` (sharing the same `threadId`) to have `useChat`
|
|
289
294
|
* merge live voice turns into `messages` automatically — one bubble per utterance, deduped
|
|
@@ -684,6 +689,6 @@ declare function supportsStreamingFetch(): boolean;
|
|
|
684
689
|
*/
|
|
685
690
|
declare function openSSEStream(opts: OpenSSEOptions): Promise<SSEStream>;
|
|
686
691
|
|
|
687
|
-
declare const VERSION = "0.8.
|
|
692
|
+
declare const VERSION = "0.8.1";
|
|
688
693
|
|
|
689
694
|
export { type OpenSSEOptions, type PersonaAgentSummary, type PersonaClarificationQuestion, type PersonaFileItem, type PersonaHealthInfo, type PersonaHitlActionRequest, type PersonaInterrupt, type PersonaMcpConnection, type PersonaMemoryAgentGroup, type PersonaMemoryFile, type PersonaMemoryList, type PersonaMessage, type PersonaPresentedFile, PersonaProvider, type PersonaProviderProps, type PersonaResumeValue, type PersonaRole, type PersonaSandboxCommand, type PersonaStreamingEvent, type PersonaSubagentActivityEntry, type PersonaThread, type PersonaTodo, type PersonaToolCall, type PersonaVoiceEndReason, type PersonaVoiceState, type PersonaVoiceToolCall, type PersonaVoiceTranscriptLine, type PersonaWorkspaceFile, type SSEReader, type SSEStream, type SendMessageOverride, type UseChatOptions, type UseMcpConnectionsOptions, type UseMcpOptions, type UseVoiceOptions, type UseVoiceResult, VERSION, openSSEStream, supportsStreamingFetch, useAgents, useChat, useConnection, useFiles, useMcp, useMcpConnections, useMemory, usePersonaContext, useThreads, useVoice };
|
package/dist/index.d.ts
CHANGED
|
@@ -241,6 +241,9 @@ type PersonaStreamingEvent = {
|
|
|
241
241
|
message: string;
|
|
242
242
|
retryable?: boolean;
|
|
243
243
|
providerName?: string;
|
|
244
|
+
} | {
|
|
245
|
+
type: "title";
|
|
246
|
+
title: string;
|
|
244
247
|
} | {
|
|
245
248
|
type: "CUSTOM";
|
|
246
249
|
name: "hitl_request";
|
|
@@ -284,6 +287,8 @@ interface UseChatOptions {
|
|
|
284
287
|
onEvent?: (event: PersonaStreamingEvent) => void;
|
|
285
288
|
/** Called when a fake/ephemeral chat mints a real thread on first send. Use to sync sidebar state (e.g. setThreadId(id)). */
|
|
286
289
|
onThreadCreated?: (threadId: string) => void;
|
|
290
|
+
/** Called when the backend auto-generates a thread title (3-4 word LLM summary of first user message). */
|
|
291
|
+
onTitle?: (title: string) => void;
|
|
287
292
|
/**
|
|
288
293
|
* Pass the object returned by `useVoice()` (sharing the same `threadId`) to have `useChat`
|
|
289
294
|
* merge live voice turns into `messages` automatically — one bubble per utterance, deduped
|
|
@@ -684,6 +689,6 @@ declare function supportsStreamingFetch(): boolean;
|
|
|
684
689
|
*/
|
|
685
690
|
declare function openSSEStream(opts: OpenSSEOptions): Promise<SSEStream>;
|
|
686
691
|
|
|
687
|
-
declare const VERSION = "0.8.
|
|
692
|
+
declare const VERSION = "0.8.1";
|
|
688
693
|
|
|
689
694
|
export { type OpenSSEOptions, type PersonaAgentSummary, type PersonaClarificationQuestion, type PersonaFileItem, type PersonaHealthInfo, type PersonaHitlActionRequest, type PersonaInterrupt, type PersonaMcpConnection, type PersonaMemoryAgentGroup, type PersonaMemoryFile, type PersonaMemoryList, type PersonaMessage, type PersonaPresentedFile, PersonaProvider, type PersonaProviderProps, type PersonaResumeValue, type PersonaRole, type PersonaSandboxCommand, type PersonaStreamingEvent, type PersonaSubagentActivityEntry, type PersonaThread, type PersonaTodo, type PersonaToolCall, type PersonaVoiceEndReason, type PersonaVoiceState, type PersonaVoiceToolCall, type PersonaVoiceTranscriptLine, type PersonaWorkspaceFile, type SSEReader, type SSEStream, type SendMessageOverride, type UseChatOptions, type UseMcpConnectionsOptions, type UseMcpOptions, type UseVoiceOptions, type UseVoiceResult, VERSION, openSSEStream, supportsStreamingFetch, useAgents, useChat, useConnection, useFiles, useMcp, useMcpConnections, useMemory, usePersonaContext, useThreads, useVoice };
|
package/dist/index.js
CHANGED
|
@@ -930,6 +930,12 @@ function useChat(options = {}) {
|
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
932
|
}
|
|
933
|
+
} else if (event.type === "title") {
|
|
934
|
+
const title = event.title;
|
|
935
|
+
if (typeof title === "string" && title.trim()) {
|
|
936
|
+
chatLogger.info("auto title", { title });
|
|
937
|
+
options.onTitle?.(title);
|
|
938
|
+
}
|
|
933
939
|
} else if (event.type === "RUN_ERROR") {
|
|
934
940
|
chatLogger.warn("run error", { message: event.message, code: event.code });
|
|
935
941
|
chatLogger.error("stream run error", { code: event.code, message: event.message });
|
|
@@ -2061,7 +2067,7 @@ import {
|
|
|
2061
2067
|
getLogLevel,
|
|
2062
2068
|
isLevelEnabled
|
|
2063
2069
|
} from "@personaai/logger";
|
|
2064
|
-
var VERSION = "0.8.
|
|
2070
|
+
var VERSION = "0.8.1";
|
|
2065
2071
|
export {
|
|
2066
2072
|
PersonaProvider,
|
|
2067
2073
|
VERSION,
|