@applica-software-guru/persona-sdk 0.1.74 → 0.1.76
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/bundle.cjs.js +14 -16
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.es.js +1033 -1041
- package/dist/bundle.es.js.map +1 -1
- package/dist/bundle.iife.js +13 -15
- package/dist/bundle.iife.js.map +1 -1
- package/dist/bundle.umd.js +13 -15
- package/dist/bundle.umd.js.map +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/runtime.tsx +6 -7
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,iBAAiB,EAA8C,MAAM,OAAO,CAAC;AAQxH,OAAO,EACL,aAAa,EACb,cAAc,EAEd,eAAe,EAGf,eAAe,EAEf,cAAc,EAEf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAIL,qBAAqB,EAItB,MAAM,YAAY,CAAC;AAEpB,KAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC7C,WAAW,EAAE,MAAM,cAAc,EAAE,CAAC;CACrC,CAAC;
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoC,iBAAiB,EAA8C,MAAM,OAAO,CAAC;AAQxH,OAAO,EACL,aAAa,EACb,cAAc,EAEd,eAAe,EAGf,eAAe,EAEf,cAAc,EAEf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAIL,qBAAqB,EAItB,MAAM,YAAY,CAAC;AAEpB,KAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,eAAe,EAAE,CAAC;IAC7B,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC7C,WAAW,EAAE,MAAM,cAAc,EAAE,CAAC;CACrC,CAAC;AAkSF,iBAAS,sBAAsB,CAAC,EAAE,QAAQ,EAAE,GAAG,MAAM,EAAE,EAAE,iBAAiB,CAAC,aAAa,CAAC,2CAExF;AAED,iBAAS,iBAAiB,IAAI,yBAAyB,CAMtD;AAED;;;;;;GAMG;AACH,iBAAS,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,GAAG,IAAI,CAyB3E;AAED,iBAAS,yBAAyB,IAAI,MAAM,GAAG,IAAI,CAOlD;AAED,iBAAS,+BAA+B,IAAI,qBAAqB,GAAG,IAAI,CAEvE;AAED,iBAAS,yBAAyB,IAAI,cAAc,EAAE,CAMrD;AAED,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,iBAAiB,EACjB,yBAAyB,EACzB,+BAA+B,EAC/B,yBAAyB,GAC1B,CAAC;AACF,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/runtime.tsx
CHANGED
|
@@ -176,7 +176,6 @@ function PersonaRuntimeProviderInner({
|
|
|
176
176
|
'Initializing protocols: ',
|
|
177
177
|
protocols.map((protocol) => protocol.getName()),
|
|
178
178
|
);
|
|
179
|
-
const endpoint = getFirstAvailableProtocolEndpoint(protocols);
|
|
180
179
|
protocols.forEach((protocol) => {
|
|
181
180
|
protocol.setSession(session);
|
|
182
181
|
protocol.clearListeners();
|
|
@@ -210,18 +209,18 @@ function PersonaRuntimeProviderInner({
|
|
|
210
209
|
protocol.addPacketListener((message: PersonaPacket) => {
|
|
211
210
|
if (message.type === 'message') {
|
|
212
211
|
const personaMessage = message.payload as PersonaMessage;
|
|
212
|
+
|
|
213
|
+
if (personaMessage.thought) {
|
|
214
|
+
personaMessage.type = 'reasoning';
|
|
215
|
+
}
|
|
216
|
+
|
|
213
217
|
setMessages((currentConversation) => {
|
|
214
218
|
const newMessages = parseMessages([...currentConversation, ...[{ ...personaMessage, protocol: protocol.getName() }]]);
|
|
215
219
|
return transformMessages ? transformMessages(newMessages) : newMessages;
|
|
216
220
|
});
|
|
217
221
|
} else if (message.type === 'reasoning') {
|
|
218
222
|
const reasoning = message.payload as PersonaReasoning;
|
|
219
|
-
|
|
220
|
-
let text = reasoning.thought;
|
|
221
|
-
if (reasoning.imageUrl) {
|
|
222
|
-
text += `\n\n`;
|
|
223
|
-
}
|
|
224
|
-
const personaMessage: PersonaMessage = { type: 'reasoning', text: text, role: 'assistant', finishReason: 'stop' };
|
|
223
|
+
const personaMessage: PersonaMessage = { type: 'reasoning', text: reasoning.thought, role: 'assistant', finishReason: 'stop' };
|
|
225
224
|
|
|
226
225
|
setMessages((currentConversation) => {
|
|
227
226
|
const newMessages = parseMessages([...currentConversation, ...[{ ...personaMessage, protocol: protocol.getName() }]]);
|