@simfinity/constellation-ui 1.0.7 → 1.0.8
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/index.cjs +7 -6
- package/dist/index.d.cts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js +7 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -43,12 +43,15 @@ var ConstellationContext = import_react.default.createContext(null);
|
|
|
43
43
|
function ConstellationProvider({ client, children }) {
|
|
44
44
|
const [sessionId, setSessionId] = (0, import_react.useState)(null);
|
|
45
45
|
const [connected, setConnected] = (0, import_react.useState)(false);
|
|
46
|
+
const [voiceEnabled, setVoiceEnabled] = (0, import_react.useState)(false);
|
|
46
47
|
const value = {
|
|
47
48
|
client,
|
|
48
49
|
sessionId,
|
|
49
50
|
connected,
|
|
51
|
+
voiceEnabled,
|
|
50
52
|
setSessionId,
|
|
51
|
-
setConnected
|
|
53
|
+
setConnected,
|
|
54
|
+
setVoiceEnabled
|
|
52
55
|
};
|
|
53
56
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ConstellationContext.Provider, { value, children });
|
|
54
57
|
}
|
|
@@ -56,11 +59,9 @@ function useConstellationClient() {
|
|
|
56
59
|
const ctx = (0, import_react.useContext)(ConstellationContext);
|
|
57
60
|
if (!ctx) throw new Error("Must be used inside ConstellationProvider");
|
|
58
61
|
return {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
startSession: async () => {
|
|
63
|
-
await ctx.client.startSession();
|
|
62
|
+
startSession: async (voiceEnabled, voiceName) => {
|
|
63
|
+
await ctx.client.startSession(voiceEnabled, voiceName);
|
|
64
|
+
ctx.setVoiceEnabled(voiceEnabled);
|
|
64
65
|
},
|
|
65
66
|
endSession: async () => {
|
|
66
67
|
await ctx.client.endSession();
|
package/dist/index.d.cts
CHANGED
|
@@ -26,7 +26,6 @@ import { WebClient } from '@simfinity/constellation-client';
|
|
|
26
26
|
* key: "YOUR_SECRET_KEY",
|
|
27
27
|
* llm: "openai",
|
|
28
28
|
* model: "gpt-4o-realtime-preview-2024-12-17",
|
|
29
|
-
* voiceEnabled: false,
|
|
30
29
|
* });
|
|
31
30
|
*
|
|
32
31
|
* function App() {
|
|
@@ -52,7 +51,7 @@ declare function ConstellationProvider({ client, children, }: {
|
|
|
52
51
|
*
|
|
53
52
|
* IMPORTANT SESSION ORDER:
|
|
54
53
|
*
|
|
55
|
-
* 1) startSession()
|
|
54
|
+
* 1) startSession(voiceEnabled, voiceName)
|
|
56
55
|
* → Creates a persistent server-side session (REST)
|
|
57
56
|
* → A session remains alive and can be re-joined within 5 minutes of inactivity
|
|
58
57
|
*
|
|
@@ -120,7 +119,7 @@ declare function ConstellationProvider({ client, children, }: {
|
|
|
120
119
|
* endSession
|
|
121
120
|
* } = useConstellationClient();
|
|
122
121
|
*
|
|
123
|
-
* await startSession();
|
|
122
|
+
* await startSession(false);
|
|
124
123
|
* await joinSession(false, {
|
|
125
124
|
* onStreamClosed: console.log,
|
|
126
125
|
* onTranscriptResponse: (text) => console.log(text),
|
package/dist/index.d.ts
CHANGED
|
@@ -26,7 +26,6 @@ import { WebClient } from '@simfinity/constellation-client';
|
|
|
26
26
|
* key: "YOUR_SECRET_KEY",
|
|
27
27
|
* llm: "openai",
|
|
28
28
|
* model: "gpt-4o-realtime-preview-2024-12-17",
|
|
29
|
-
* voiceEnabled: false,
|
|
30
29
|
* });
|
|
31
30
|
*
|
|
32
31
|
* function App() {
|
|
@@ -52,7 +51,7 @@ declare function ConstellationProvider({ client, children, }: {
|
|
|
52
51
|
*
|
|
53
52
|
* IMPORTANT SESSION ORDER:
|
|
54
53
|
*
|
|
55
|
-
* 1) startSession()
|
|
54
|
+
* 1) startSession(voiceEnabled, voiceName)
|
|
56
55
|
* → Creates a persistent server-side session (REST)
|
|
57
56
|
* → A session remains alive and can be re-joined within 5 minutes of inactivity
|
|
58
57
|
*
|
|
@@ -120,7 +119,7 @@ declare function ConstellationProvider({ client, children, }: {
|
|
|
120
119
|
* endSession
|
|
121
120
|
* } = useConstellationClient();
|
|
122
121
|
*
|
|
123
|
-
* await startSession();
|
|
122
|
+
* await startSession(false);
|
|
124
123
|
* await joinSession(false, {
|
|
125
124
|
* onStreamClosed: console.log,
|
|
126
125
|
* onTranscriptResponse: (text) => console.log(text),
|
package/dist/index.js
CHANGED
|
@@ -5,12 +5,15 @@ var ConstellationContext = React.createContext(null);
|
|
|
5
5
|
function ConstellationProvider({ client, children }) {
|
|
6
6
|
const [sessionId, setSessionId] = useState(null);
|
|
7
7
|
const [connected, setConnected] = useState(false);
|
|
8
|
+
const [voiceEnabled, setVoiceEnabled] = useState(false);
|
|
8
9
|
const value = {
|
|
9
10
|
client,
|
|
10
11
|
sessionId,
|
|
11
12
|
connected,
|
|
13
|
+
voiceEnabled,
|
|
12
14
|
setSessionId,
|
|
13
|
-
setConnected
|
|
15
|
+
setConnected,
|
|
16
|
+
setVoiceEnabled
|
|
14
17
|
};
|
|
15
18
|
return /* @__PURE__ */ jsx(ConstellationContext.Provider, { value, children });
|
|
16
19
|
}
|
|
@@ -18,11 +21,9 @@ function useConstellationClient() {
|
|
|
18
21
|
const ctx = useContext(ConstellationContext);
|
|
19
22
|
if (!ctx) throw new Error("Must be used inside ConstellationProvider");
|
|
20
23
|
return {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
startSession: async () => {
|
|
25
|
-
await ctx.client.startSession();
|
|
24
|
+
startSession: async (voiceEnabled, voiceName) => {
|
|
25
|
+
await ctx.client.startSession(voiceEnabled, voiceName);
|
|
26
|
+
ctx.setVoiceEnabled(voiceEnabled);
|
|
26
27
|
},
|
|
27
28
|
endSession: async () => {
|
|
28
29
|
await ctx.client.endSession();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simfinity/constellation-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"author": "Simfinity",
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@simfinity/constellation-client": "^1.0.
|
|
28
|
+
"@simfinity/constellation-client": "^1.0.15"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/react": "^19.2.11",
|