@charivo/core 0.25.0 → 0.26.0
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 +39 -9
- package/dist/index.cjs +35 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +38 -20
- package/dist/index.d.ts +38 -20
- package/dist/index.js +35 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -37,25 +37,6 @@ interface Message {
|
|
|
37
37
|
characterId?: string;
|
|
38
38
|
type: "user" | "character" | "system";
|
|
39
39
|
}
|
|
40
|
-
interface Conversation {
|
|
41
|
-
id: string;
|
|
42
|
-
messages: Message[];
|
|
43
|
-
characterId?: string;
|
|
44
|
-
createdAt: Date;
|
|
45
|
-
updatedAt: Date;
|
|
46
|
-
}
|
|
47
|
-
interface Plugin {
|
|
48
|
-
id: string;
|
|
49
|
-
name: string;
|
|
50
|
-
version: string;
|
|
51
|
-
enabled: boolean;
|
|
52
|
-
}
|
|
53
|
-
interface CharivoConfig {
|
|
54
|
-
characters: Character[];
|
|
55
|
-
plugins: Plugin[];
|
|
56
|
-
llmProvider?: string;
|
|
57
|
-
renderProvider?: string;
|
|
58
|
-
}
|
|
59
40
|
type RealtimeTransportKind = "webrtc" | "websocket";
|
|
60
41
|
type RealtimeToolChoice = "auto" | "none" | "required";
|
|
61
42
|
declare const OPENAI_REALTIME_ADAPTER = "openai-webrtc";
|
|
@@ -795,6 +776,14 @@ declare class Charivo {
|
|
|
795
776
|
* Get the current render manager instance.
|
|
796
777
|
*/
|
|
797
778
|
getRenderManager(): RenderManager | undefined;
|
|
779
|
+
/**
|
|
780
|
+
* Get the current TTS manager instance.
|
|
781
|
+
*/
|
|
782
|
+
getTTSManager(): TTSManager | undefined;
|
|
783
|
+
/**
|
|
784
|
+
* Get the current LLM manager instance.
|
|
785
|
+
*/
|
|
786
|
+
getLLMManager(): LLMManager | undefined;
|
|
798
787
|
/**
|
|
799
788
|
* Attach a Realtime manager to handle real-time conversation.
|
|
800
789
|
* Automatically connects the event emitter and enables Realtime mode.
|
|
@@ -831,5 +820,34 @@ declare class Charivo {
|
|
|
831
820
|
dispose(): Promise<void>;
|
|
832
821
|
private finishDispose;
|
|
833
822
|
}
|
|
823
|
+
/**
|
|
824
|
+
* Managers and character to wire into a new {@link Charivo}.
|
|
825
|
+
*
|
|
826
|
+
* Every field is optional — an instance with no managers is valid, and each
|
|
827
|
+
* modality is attached only when supplied. `null` is accepted alongside
|
|
828
|
+
* `undefined` so callers can pass a manager they hold as nullable state (a
|
|
829
|
+
* React ref, a feature-flagged modality) without converting it first.
|
|
830
|
+
*/
|
|
831
|
+
interface CharivoOptions {
|
|
832
|
+
llm?: LLMManager | null;
|
|
833
|
+
tts?: TTSManager | null;
|
|
834
|
+
stt?: STTManager | null;
|
|
835
|
+
realtime?: RealtimeManager | null;
|
|
836
|
+
renderer?: RenderManager | null;
|
|
837
|
+
character?: Character | null;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Create a Charivo instance with its managers already attached.
|
|
841
|
+
*
|
|
842
|
+
* Equivalent to `new Charivo()` followed by the matching `attach*` calls, then
|
|
843
|
+
* `setCharacter()`. The character is applied last so it reaches every
|
|
844
|
+
* character-aware manager supplied above it — the LLM, renderer, and realtime
|
|
845
|
+
* managers. Hand-wiring works in either order only because `attach*` re-applies
|
|
846
|
+
* an already-set character, and that coupling is easy to miss.
|
|
847
|
+
*
|
|
848
|
+
* Note that supplying `realtime` also enables realtime mode, exactly as
|
|
849
|
+
* `attachRealtime()` does.
|
|
850
|
+
*/
|
|
851
|
+
declare function createCharivo(options?: CharivoOptions): Charivo;
|
|
834
852
|
|
|
835
|
-
export { type AvatarControlCatalog, type BrowserLifecycleCallbacks, type Character, Charivo,
|
|
853
|
+
export { type AvatarControlCatalog, type BrowserLifecycleCallbacks, type Character, Charivo, CharivoDisposeError, CharivoError, type CharivoErrorCode, type CharivoErrorKind, type CharivoErrorOptions, type CharivoEventBus, type CharivoEventEmitter, type CharivoOptions, CharivoProviderError, CharivoStateError, CharivoTimeoutError, CharivoTransportError, type EventMap, type GazeCoordinates, type GenerateResponseOptions, type HistoryRollback, type LLMAdapter, type LLMClient, type LLMManager, type LLMManagerWithTools, type LLMMessage, type LLMProvider, type LLMToolCall, type LLMToolResponse, type LipSyncAnalyzer, type LipSyncAnalyzerOptions, type Message, type MotionSelection, OPENAI_REALTIME_ADAPTER, OPENAI_REALTIME_AGENTS_ADAPTER, type RealtimeConnectionState, type RealtimeManager, type RealtimeProvider, type RealtimeReconnectCause, type RealtimeResponseStatus, type RealtimeSessionBootstrap, type RealtimeSessionConfig, type RealtimeSessionRequest, type RealtimeSessionStatus, type RealtimeSessionTransitionReason, type RealtimeState, type RealtimeToolChoice, type RealtimeTransportKind, type RealtimeUsageEvent, type RenderManager, type Renderer, type STTManager, type STTOptions, type STTProvider, type STTTranscriber, type TTSManager, type TTSOptions, type TTSPlaybackMode, type TTSPlayer, type TTSProvider, type ToolContext, type ToolDefinition, type ToolHandler, type ToolRegistration, type ToolRegistry, type ToolResultProjector, type ToolResultProjectorContext, type ToolResultSnapshot, assertToolResultObject, createCharivo, createLipSyncAnalyzer, createToolFailureOutput, createToolRegistry, getErrorMessage, isCharivoError, snapshotToolResult, subscribeBrowserLifecycle, toCharivoError, validateToolArguments, withToolTimeout };
|
package/dist/index.d.ts
CHANGED
|
@@ -37,25 +37,6 @@ interface Message {
|
|
|
37
37
|
characterId?: string;
|
|
38
38
|
type: "user" | "character" | "system";
|
|
39
39
|
}
|
|
40
|
-
interface Conversation {
|
|
41
|
-
id: string;
|
|
42
|
-
messages: Message[];
|
|
43
|
-
characterId?: string;
|
|
44
|
-
createdAt: Date;
|
|
45
|
-
updatedAt: Date;
|
|
46
|
-
}
|
|
47
|
-
interface Plugin {
|
|
48
|
-
id: string;
|
|
49
|
-
name: string;
|
|
50
|
-
version: string;
|
|
51
|
-
enabled: boolean;
|
|
52
|
-
}
|
|
53
|
-
interface CharivoConfig {
|
|
54
|
-
characters: Character[];
|
|
55
|
-
plugins: Plugin[];
|
|
56
|
-
llmProvider?: string;
|
|
57
|
-
renderProvider?: string;
|
|
58
|
-
}
|
|
59
40
|
type RealtimeTransportKind = "webrtc" | "websocket";
|
|
60
41
|
type RealtimeToolChoice = "auto" | "none" | "required";
|
|
61
42
|
declare const OPENAI_REALTIME_ADAPTER = "openai-webrtc";
|
|
@@ -795,6 +776,14 @@ declare class Charivo {
|
|
|
795
776
|
* Get the current render manager instance.
|
|
796
777
|
*/
|
|
797
778
|
getRenderManager(): RenderManager | undefined;
|
|
779
|
+
/**
|
|
780
|
+
* Get the current TTS manager instance.
|
|
781
|
+
*/
|
|
782
|
+
getTTSManager(): TTSManager | undefined;
|
|
783
|
+
/**
|
|
784
|
+
* Get the current LLM manager instance.
|
|
785
|
+
*/
|
|
786
|
+
getLLMManager(): LLMManager | undefined;
|
|
798
787
|
/**
|
|
799
788
|
* Attach a Realtime manager to handle real-time conversation.
|
|
800
789
|
* Automatically connects the event emitter and enables Realtime mode.
|
|
@@ -831,5 +820,34 @@ declare class Charivo {
|
|
|
831
820
|
dispose(): Promise<void>;
|
|
832
821
|
private finishDispose;
|
|
833
822
|
}
|
|
823
|
+
/**
|
|
824
|
+
* Managers and character to wire into a new {@link Charivo}.
|
|
825
|
+
*
|
|
826
|
+
* Every field is optional — an instance with no managers is valid, and each
|
|
827
|
+
* modality is attached only when supplied. `null` is accepted alongside
|
|
828
|
+
* `undefined` so callers can pass a manager they hold as nullable state (a
|
|
829
|
+
* React ref, a feature-flagged modality) without converting it first.
|
|
830
|
+
*/
|
|
831
|
+
interface CharivoOptions {
|
|
832
|
+
llm?: LLMManager | null;
|
|
833
|
+
tts?: TTSManager | null;
|
|
834
|
+
stt?: STTManager | null;
|
|
835
|
+
realtime?: RealtimeManager | null;
|
|
836
|
+
renderer?: RenderManager | null;
|
|
837
|
+
character?: Character | null;
|
|
838
|
+
}
|
|
839
|
+
/**
|
|
840
|
+
* Create a Charivo instance with its managers already attached.
|
|
841
|
+
*
|
|
842
|
+
* Equivalent to `new Charivo()` followed by the matching `attach*` calls, then
|
|
843
|
+
* `setCharacter()`. The character is applied last so it reaches every
|
|
844
|
+
* character-aware manager supplied above it — the LLM, renderer, and realtime
|
|
845
|
+
* managers. Hand-wiring works in either order only because `attach*` re-applies
|
|
846
|
+
* an already-set character, and that coupling is easy to miss.
|
|
847
|
+
*
|
|
848
|
+
* Note that supplying `realtime` also enables realtime mode, exactly as
|
|
849
|
+
* `attachRealtime()` does.
|
|
850
|
+
*/
|
|
851
|
+
declare function createCharivo(options?: CharivoOptions): Charivo;
|
|
834
852
|
|
|
835
|
-
export { type AvatarControlCatalog, type BrowserLifecycleCallbacks, type Character, Charivo,
|
|
853
|
+
export { type AvatarControlCatalog, type BrowserLifecycleCallbacks, type Character, Charivo, CharivoDisposeError, CharivoError, type CharivoErrorCode, type CharivoErrorKind, type CharivoErrorOptions, type CharivoEventBus, type CharivoEventEmitter, type CharivoOptions, CharivoProviderError, CharivoStateError, CharivoTimeoutError, CharivoTransportError, type EventMap, type GazeCoordinates, type GenerateResponseOptions, type HistoryRollback, type LLMAdapter, type LLMClient, type LLMManager, type LLMManagerWithTools, type LLMMessage, type LLMProvider, type LLMToolCall, type LLMToolResponse, type LipSyncAnalyzer, type LipSyncAnalyzerOptions, type Message, type MotionSelection, OPENAI_REALTIME_ADAPTER, OPENAI_REALTIME_AGENTS_ADAPTER, type RealtimeConnectionState, type RealtimeManager, type RealtimeProvider, type RealtimeReconnectCause, type RealtimeResponseStatus, type RealtimeSessionBootstrap, type RealtimeSessionConfig, type RealtimeSessionRequest, type RealtimeSessionStatus, type RealtimeSessionTransitionReason, type RealtimeState, type RealtimeToolChoice, type RealtimeTransportKind, type RealtimeUsageEvent, type RenderManager, type Renderer, type STTManager, type STTOptions, type STTProvider, type STTTranscriber, type TTSManager, type TTSOptions, type TTSPlaybackMode, type TTSPlayer, type TTSProvider, type ToolContext, type ToolDefinition, type ToolHandler, type ToolRegistration, type ToolRegistry, type ToolResultProjector, type ToolResultProjectorContext, type ToolResultSnapshot, assertToolResultObject, createCharivo, createLipSyncAnalyzer, createToolFailureOutput, createToolRegistry, getErrorMessage, isCharivoError, snapshotToolResult, subscribeBrowserLifecycle, toCharivoError, validateToolArguments, withToolTimeout };
|
package/dist/index.js
CHANGED
|
@@ -934,6 +934,18 @@ var Charivo = class {
|
|
|
934
934
|
getRenderManager() {
|
|
935
935
|
return this.renderManager;
|
|
936
936
|
}
|
|
937
|
+
/**
|
|
938
|
+
* Get the current TTS manager instance.
|
|
939
|
+
*/
|
|
940
|
+
getTTSManager() {
|
|
941
|
+
return this.ttsManager;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Get the current LLM manager instance.
|
|
945
|
+
*/
|
|
946
|
+
getLLMManager() {
|
|
947
|
+
return this.llmManager;
|
|
948
|
+
}
|
|
937
949
|
/**
|
|
938
950
|
* Attach a Realtime manager to handle real-time conversation.
|
|
939
951
|
* Automatically connects the event emitter and enables Realtime mode.
|
|
@@ -1058,7 +1070,29 @@ var Charivo = class {
|
|
|
1058
1070
|
}
|
|
1059
1071
|
}
|
|
1060
1072
|
};
|
|
1073
|
+
function createCharivo(options = {}) {
|
|
1074
|
+
const charivo = new Charivo();
|
|
1075
|
+
if (options.renderer) {
|
|
1076
|
+
charivo.attachRenderer(options.renderer);
|
|
1077
|
+
}
|
|
1078
|
+
if (options.llm) {
|
|
1079
|
+
charivo.attachLLM(options.llm);
|
|
1080
|
+
}
|
|
1081
|
+
if (options.tts) {
|
|
1082
|
+
charivo.attachTTS(options.tts);
|
|
1083
|
+
}
|
|
1084
|
+
if (options.stt) {
|
|
1085
|
+
charivo.attachSTT(options.stt);
|
|
1086
|
+
}
|
|
1087
|
+
if (options.realtime) {
|
|
1088
|
+
charivo.attachRealtime(options.realtime);
|
|
1089
|
+
}
|
|
1090
|
+
if (options.character) {
|
|
1091
|
+
charivo.setCharacter(options.character);
|
|
1092
|
+
}
|
|
1093
|
+
return charivo;
|
|
1094
|
+
}
|
|
1061
1095
|
|
|
1062
|
-
export { Charivo, CharivoDisposeError, CharivoError, CharivoProviderError, CharivoStateError, CharivoTimeoutError, CharivoTransportError, OPENAI_REALTIME_ADAPTER, OPENAI_REALTIME_AGENTS_ADAPTER, assertToolResultObject, createLipSyncAnalyzer, createToolFailureOutput, createToolRegistry, getErrorMessage, isCharivoError, snapshotToolResult, subscribeBrowserLifecycle, toCharivoError, validateToolArguments, withToolTimeout };
|
|
1096
|
+
export { Charivo, CharivoDisposeError, CharivoError, CharivoProviderError, CharivoStateError, CharivoTimeoutError, CharivoTransportError, OPENAI_REALTIME_ADAPTER, OPENAI_REALTIME_AGENTS_ADAPTER, assertToolResultObject, createCharivo, createLipSyncAnalyzer, createToolFailureOutput, createToolRegistry, getErrorMessage, isCharivoError, snapshotToolResult, subscribeBrowserLifecycle, toCharivoError, validateToolArguments, withToolTimeout };
|
|
1063
1097
|
//# sourceMappingURL=index.js.map
|
|
1064
1098
|
//# sourceMappingURL=index.js.map
|