@applica-software-guru/persona-sdk 0.0.1-preview2 → 0.0.1-preview4

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.
Files changed (76) hide show
  1. package/dist/bundle.cjs.js.map +1 -1
  2. package/dist/bundle.es.js.map +1 -1
  3. package/dist/bundle.iife.js.map +1 -1
  4. package/dist/bundle.umd.js.map +1 -1
  5. package/dist/playground/src/app.d.ts +3 -0
  6. package/dist/playground/src/app.d.ts.map +1 -0
  7. package/dist/playground/src/app.js +5 -0
  8. package/dist/playground/src/chat.d.ts +3 -0
  9. package/dist/playground/src/chat.d.ts.map +1 -0
  10. package/dist/playground/src/chat.js +33 -0
  11. package/dist/playground/src/components/assistant-ui/assistant-modal.d.ts +3 -0
  12. package/dist/playground/src/components/assistant-ui/assistant-modal.d.ts.map +1 -0
  13. package/dist/playground/src/components/assistant-ui/assistant-modal.js +15 -0
  14. package/dist/playground/src/components/assistant-ui/markdown-text.d.ts +3 -0
  15. package/dist/playground/src/components/assistant-ui/markdown-text.d.ts.map +1 -0
  16. package/dist/playground/src/components/assistant-ui/markdown-text.js +59 -0
  17. package/dist/playground/src/components/assistant-ui/thread-list.d.ts +3 -0
  18. package/dist/playground/src/components/assistant-ui/thread-list.d.ts.map +1 -0
  19. package/dist/playground/src/components/assistant-ui/thread-list.js +23 -0
  20. package/dist/playground/src/components/assistant-ui/thread.d.ts +3 -0
  21. package/dist/playground/src/components/assistant-ui/thread.d.ts.map +1 -0
  22. package/dist/playground/src/components/assistant-ui/thread.js +75 -0
  23. package/dist/playground/src/components/assistant-ui/tool-fallback.d.ts +3 -0
  24. package/dist/playground/src/components/assistant-ui/tool-fallback.d.ts.map +1 -0
  25. package/dist/playground/src/components/assistant-ui/tool-fallback.js +8 -0
  26. package/dist/playground/src/components/assistant-ui/tooltip-icon-button.d.ts +11 -0
  27. package/dist/playground/src/components/assistant-ui/tooltip-icon-button.d.ts.map +1 -0
  28. package/dist/playground/src/components/assistant-ui/tooltip-icon-button.js +13 -0
  29. package/dist/playground/src/components/ui/avatar.d.ts +7 -0
  30. package/dist/playground/src/components/ui/avatar.d.ts.map +1 -0
  31. package/dist/playground/src/components/ui/avatar.js +12 -0
  32. package/dist/playground/src/components/ui/button.d.ts +12 -0
  33. package/dist/playground/src/components/ui/button.d.ts.map +1 -0
  34. package/dist/playground/src/components/ui/button.js +33 -0
  35. package/dist/playground/src/components/ui/tooltip.d.ts +8 -0
  36. package/dist/playground/src/components/ui/tooltip.d.ts.map +1 -0
  37. package/dist/playground/src/components/ui/tooltip.js +11 -0
  38. package/dist/playground/src/lib/utils.d.ts +3 -0
  39. package/dist/playground/src/lib/utils.d.ts.map +1 -0
  40. package/dist/playground/src/lib/utils.js +5 -0
  41. package/dist/playground/src/main.d.ts +2 -0
  42. package/dist/playground/src/main.d.ts.map +1 -0
  43. package/dist/playground/src/main.js +5 -0
  44. package/dist/runtime.d.ts.map +1 -1
  45. package/dist/src/index.d.ts +5 -0
  46. package/dist/src/index.d.ts.map +1 -0
  47. package/dist/src/index.js +4 -0
  48. package/dist/src/logging.d.ts +18 -0
  49. package/dist/src/logging.d.ts.map +1 -0
  50. package/dist/src/logging.js +19 -0
  51. package/dist/src/messages.d.ts +7 -0
  52. package/dist/src/messages.d.ts.map +1 -0
  53. package/dist/src/messages.js +73 -0
  54. package/dist/src/protocol/base.d.ts +23 -0
  55. package/dist/src/protocol/base.d.ts.map +1 -0
  56. package/dist/src/protocol/base.js +37 -0
  57. package/dist/src/protocol/index.d.ts +5 -0
  58. package/dist/src/protocol/index.d.ts.map +1 -0
  59. package/dist/src/protocol/index.js +4 -0
  60. package/dist/src/protocol/rest.d.ts +22 -0
  61. package/dist/src/protocol/rest.d.ts.map +1 -0
  62. package/dist/src/protocol/rest.js +48 -0
  63. package/dist/src/protocol/webrtc.d.ts +56 -0
  64. package/dist/src/protocol/webrtc.d.ts.map +1 -0
  65. package/dist/src/protocol/webrtc.js +267 -0
  66. package/dist/src/protocol/websocket.d.ts +22 -0
  67. package/dist/src/protocol/websocket.d.ts.map +1 -0
  68. package/dist/src/protocol/websocket.js +84 -0
  69. package/dist/src/runtime.d.ts +21 -0
  70. package/dist/src/runtime.d.ts.map +1 -0
  71. package/dist/src/runtime.js +160 -0
  72. package/dist/src/types.d.ts +79 -0
  73. package/dist/src/types.d.ts.map +1 -0
  74. package/dist/src/types.js +1 -0
  75. package/package.json +3 -5
  76. package/src/runtime.tsx +3 -0
@@ -0,0 +1,21 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { PersonaConfig, PersonaMessage, PersonaProtocol, PersonaResponse, ProtocolStatus } from './types';
3
+ import { PersonaWebRTCProtocol } from './protocol';
4
+ type PersonaRuntimeContextType = {
5
+ protocols: PersonaProtocol[];
6
+ protocolsStatus: Map<string, ProtocolStatus>;
7
+ };
8
+ declare function PersonaRuntimeProvider({ children, ...config }: PropsWithChildren<PersonaConfig>): import("react/jsx-runtime").JSX.Element;
9
+ declare function usePersonaRuntime(): PersonaRuntimeContextType;
10
+ /**
11
+ * Retrieves a specific protocol instance from the PersonaRuntimeContext.
12
+ *
13
+ * @param protocol - The name of the protocol to use.
14
+ * @returns {PersonaProtocol | null} - The protocol instance or null if not found.
15
+ * @throws {Error} - If the hook is used outside of a PersonaRuntimeProvider.
16
+ */
17
+ declare function usePersonaRuntimeProtocol(protocol: string): PersonaProtocol | null;
18
+ declare function usePersonaRuntimeWebRTCProtocol(): PersonaWebRTCProtocol | null;
19
+ export { PersonaRuntimeProvider, usePersonaRuntime, usePersonaRuntimeProtocol, usePersonaRuntimeWebRTCProtocol };
20
+ export type { PersonaMessage, PersonaResponse };
21
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/runtime.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAoC,iBAAiB,EAA8C,MAAM,OAAO,CAAC;AAExH,OAAO,EACL,aAAa,EACb,cAAc,EACd,eAAe,EAEf,eAAe,EACf,cAAc,EAEf,MAAM,SAAS,CAAC;AAEjB,OAAO,EAGL,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;CAC9C,CAAC;AA0IF,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,+BAA+B,IAAI,qBAAqB,GAAG,IAAI,CAEvE;AAED,OAAO,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,+BAA+B,EAAE,CAAC;AACjH,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,160 @@
1
+ 'use strict';
2
+ 'use client';
3
+ import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { useState, useEffect, useCallback, createContext, useContext, useMemo, useRef } from 'react';
5
+ import { useExternalStoreRuntime, AssistantRuntimeProvider } from '@assistant-ui/react';
6
+ import { parseMessages, convertMessage } from './messages';
7
+ import { PersonaRESTProtocol, PersonaWebRTCProtocol, PersonaWebSocketProtocol, } from './protocol';
8
+ const PersonaRuntimeContext = createContext(undefined);
9
+ function PersonaRuntimeProviderInner({ dev = false, protocols: _protocols, logger, children, session: defaultSession = 'new', ...config }) {
10
+ const [isRunning, setIsRunning] = useState(false);
11
+ const [messages, setMessages] = useState([]);
12
+ const [session, setSession] = useState(defaultSession);
13
+ const [protocolsStatus, setProtocolsStatus] = useState(new Map());
14
+ const didMount = useRef(false);
15
+ const protocols = useMemo(() => {
16
+ if (Array.isArray(_protocols)) {
17
+ return _protocols;
18
+ }
19
+ if (typeof _protocols === 'object' && _protocols !== null) {
20
+ const baseEndpoint = dev ? 'localhost:8000' : 'persona.applica.guru/api';
21
+ const baseEndpointProtocol = dev ? 'http' : 'https';
22
+ const baseWebSocketProtocol = dev ? 'ws' : 'wss';
23
+ const availableProtocols = Object.keys(_protocols).map((key) => {
24
+ switch (key) {
25
+ case 'rest':
26
+ const restConfig = _protocols[key];
27
+ if (restConfig === true) {
28
+ return new PersonaRESTProtocol({
29
+ apiUrl: `${baseEndpointProtocol}://${baseEndpoint}`,
30
+ apiKey: config.apiKey,
31
+ agentId: config.agentId,
32
+ logger,
33
+ });
34
+ }
35
+ return new PersonaRESTProtocol(restConfig);
36
+ case 'webrtc':
37
+ const webrtcConfig = _protocols[key];
38
+ if (webrtcConfig === true) {
39
+ return new PersonaWebRTCProtocol({
40
+ webrtcUrl: `${baseWebSocketProtocol}://${baseEndpoint}/webrtc`,
41
+ apiKey: config.apiKey,
42
+ agentId: config.agentId,
43
+ logger,
44
+ });
45
+ }
46
+ return new PersonaWebRTCProtocol(webrtcConfig);
47
+ case 'websocket':
48
+ const websocketConfig = _protocols[key];
49
+ if (websocketConfig === true) {
50
+ return new PersonaWebSocketProtocol({
51
+ webSocketUrl: `${baseWebSocketProtocol}://${baseEndpoint}/websocket`,
52
+ apiKey: config.apiKey,
53
+ agentId: config.agentId,
54
+ logger,
55
+ });
56
+ }
57
+ return new PersonaWebSocketProtocol(websocketConfig);
58
+ default:
59
+ throw new Error(`Unknown protocol: ${key}`);
60
+ }
61
+ });
62
+ return availableProtocols;
63
+ }
64
+ throw new Error('Invalid protocols configuration');
65
+ }, []);
66
+ useEffect(() => {
67
+ if (didMount.current)
68
+ return;
69
+ didMount.current = true;
70
+ logger?.debug('Initializing protocols: ', protocols.map((protocol) => protocol.getName()));
71
+ protocols.forEach((protocol) => {
72
+ protocol.setSession(session);
73
+ protocol.clearListeners();
74
+ protocol.addStatusChangeListener((status) => {
75
+ logger?.debug(`${protocol.getName()} has notified new status: ${status}`);
76
+ protocolsStatus.set(protocol.getName(), status);
77
+ setProtocolsStatus(new Map(protocolsStatus));
78
+ });
79
+ protocol.addMessageListener((message) => {
80
+ setMessages((currentConversation) => parseMessages([...currentConversation, ...[{ ...message, protocol: protocol.getName() }]]));
81
+ });
82
+ if (protocol.autostart && protocol.status === 'disconnected') {
83
+ logger?.debug(`Connecting to protocol: ${protocol.getName()}`);
84
+ protocol.connect(session);
85
+ }
86
+ });
87
+ }, [session, protocols, logger, protocolsStatus]);
88
+ const onNew = async (message) => {
89
+ if (message.content[0]?.type !== 'text')
90
+ throw new Error('Only text messages are supported');
91
+ const input = message.content[0].text;
92
+ setMessages((currentConversation) => [...currentConversation, { role: 'user', type: 'text', text: input }]);
93
+ setIsRunning(true);
94
+ const protocol = protocols.sort((a, b) => b.getPriority() - a.getPriority()).find((protocol) => protocol.status === 'connected');
95
+ await protocol?.send(input);
96
+ setIsRunning(false);
97
+ };
98
+ const onCancel = useCallback(() => {
99
+ setIsRunning(false);
100
+ setMessages([]);
101
+ setSession('new');
102
+ return Promise.resolve();
103
+ }, []);
104
+ const onReload = useCallback(() => {
105
+ return Promise.resolve();
106
+ }, []);
107
+ const runtime = useExternalStoreRuntime({
108
+ isRunning,
109
+ messages,
110
+ convertMessage,
111
+ onNew,
112
+ onCancel,
113
+ onReload,
114
+ });
115
+ return (_jsx(PersonaRuntimeContext.Provider, { value: { protocols, protocolsStatus }, children: _jsx(AssistantRuntimeProvider, { runtime: runtime, children: children }) }));
116
+ }
117
+ function PersonaRuntimeProvider({ children, ...config }) {
118
+ return _jsx(PersonaRuntimeProviderInner, { ...config, children: children });
119
+ }
120
+ function usePersonaRuntime() {
121
+ const context = useContext(PersonaRuntimeContext);
122
+ if (!context) {
123
+ throw new Error('usePersonaRuntime must be used within a PersonaRuntimeProvider');
124
+ }
125
+ return context;
126
+ }
127
+ /**
128
+ * Retrieves a specific protocol instance from the PersonaRuntimeContext.
129
+ *
130
+ * @param protocol - The name of the protocol to use.
131
+ * @returns {PersonaProtocol | null} - The protocol instance or null if not found.
132
+ * @throws {Error} - If the hook is used outside of a PersonaRuntimeProvider.
133
+ */
134
+ function usePersonaRuntimeProtocol(protocol) {
135
+ const context = useContext(PersonaRuntimeContext);
136
+ if (!context) {
137
+ throw new Error('usePersonaRuntimeProtocol must be used within a PersonaRuntimeProvider');
138
+ }
139
+ const protocolInstance = context.protocols.find((p) => p.getName() === protocol);
140
+ if (!protocolInstance) {
141
+ return null;
142
+ }
143
+ const status = context.protocolsStatus.get(protocolInstance.getName());
144
+ return {
145
+ ...protocolInstance,
146
+ connect: protocolInstance.connect.bind(protocolInstance),
147
+ disconnect: protocolInstance.disconnect.bind(protocolInstance),
148
+ send: protocolInstance.send.bind(protocolInstance),
149
+ setSession: protocolInstance.setSession.bind(protocolInstance),
150
+ addStatusChangeListener: protocolInstance.addStatusChangeListener.bind(protocolInstance),
151
+ addMessageListener: protocolInstance.addMessageListener.bind(protocolInstance),
152
+ getName: protocolInstance.getName.bind(protocolInstance),
153
+ getPriority: protocolInstance.getPriority.bind(protocolInstance),
154
+ status: status || protocolInstance.status,
155
+ };
156
+ }
157
+ function usePersonaRuntimeWebRTCProtocol() {
158
+ return usePersonaRuntimeProtocol('webrtc');
159
+ }
160
+ export { PersonaRuntimeProvider, usePersonaRuntime, usePersonaRuntimeProtocol, usePersonaRuntimeWebRTCProtocol };
@@ -0,0 +1,79 @@
1
+ import { PersonaLogger } from './logging';
2
+ import { ReactNode } from 'react';
3
+ export type ReadonlyJSONObject = {
4
+ readonly [key: string]: string | number | boolean | null | ReadonlyJSONObject | ReadonlyArray<ReadonlyJSONObject>;
5
+ };
6
+ export type FunctionCall = {
7
+ id?: string;
8
+ name: string;
9
+ args: ReadonlyJSONObject;
10
+ };
11
+ export type FunctionResponse = {
12
+ name: string;
13
+ result: unknown;
14
+ function_call_id: string;
15
+ };
16
+ export type PersonaMessage = {
17
+ id?: string | null;
18
+ protocol?: string;
19
+ text: string;
20
+ type: 'reasoning' | 'text';
21
+ role: 'user' | 'assistant' | 'function';
22
+ sessionId?: string;
23
+ finishReason?: 'stop' | 'function_call';
24
+ functionCalls?: FunctionCall[];
25
+ functionResponse?: FunctionResponse;
26
+ };
27
+ export type ModelResponse = {
28
+ messages: PersonaMessage[];
29
+ };
30
+ export type PersonaResponse = {
31
+ sessionId: string;
32
+ response: ModelResponse;
33
+ };
34
+ export type PersonaBaseConfig = {
35
+ logger?: PersonaLogger;
36
+ };
37
+ export type PersonaWebRTCConfig = PersonaBaseConfig & {
38
+ webrtcUrl: string;
39
+ iceServers?: RTCIceServer[];
40
+ onDataMessage?: (msg: MessageEvent) => void;
41
+ };
42
+ export type Session = string | null | undefined;
43
+ export type Message = string;
44
+ export type MessageListenerCallback = (message: PersonaMessage) => void;
45
+ export type StatusChangeCallback = (status: ProtocolStatus) => void;
46
+ export type ProtocolStatus = 'disconnected' | 'connecting' | 'connected';
47
+ export type PersonaProtocolBaseConfig = {
48
+ logger?: PersonaLogger;
49
+ apiKey: string;
50
+ agentId: string;
51
+ };
52
+ export interface PersonaProtocol {
53
+ status: ProtocolStatus;
54
+ autostart: boolean;
55
+ getName: () => string;
56
+ getPriority: () => number;
57
+ connect: (session?: Session) => Promise<Session>;
58
+ disconnect: () => Promise<void>;
59
+ setSession: (session: Session) => Promise<void>;
60
+ send: (message: Message) => Promise<void>;
61
+ clearListeners: () => void;
62
+ addStatusChangeListener: (callback: StatusChangeCallback) => void;
63
+ addMessageListener: (callback: MessageListenerCallback) => void;
64
+ }
65
+ export type PersonaConfig = PersonaBaseConfig & PersonaProtocolBaseConfig & {
66
+ /**
67
+ * In 'dev' mode the endpoint is set to localhost:8000,
68
+ * use it only for development purposes.
69
+ */
70
+ dev?: boolean;
71
+ session?: Session;
72
+ children: ReactNode;
73
+ protocols: PersonaProtocol[] | {
74
+ rest?: PersonaProtocolBaseConfig | true;
75
+ webrtc?: PersonaProtocolBaseConfig | true;
76
+ websocket?: PersonaProtocol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O,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1C,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,uBAAuB,EAAE,CAAC,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAAC;IAClE,kBAAkB,EAAE,CAAC,QAAQ,EAAE,uBAAuB,KAAK,IAAI,CAAC;CACjE;AAED,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAC3C,yBAAyB,GAAG;IAC1B;;;OAGG;IACH,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;IACpB,SAAS,EACL,eAAe,EAAE,GACjB;QACE,IAAI,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAC;QACxC,MAAM,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAC;QAC1C,SAAS,CAAC,EAAE,yBAAyB,GAAG,IAAI,CAAC;KAC9C,CAAC;CACP,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@applica-software-guru/persona-sdk",
3
3
  "private": false,
4
- "version": "0.0.1-preview2",
4
+ "version": "0.0.1-preview4",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",
@@ -19,8 +19,6 @@
19
19
  "@types/inflection": "^1.13.2",
20
20
  "@types/lodash": "^4.17.15",
21
21
  "@types/node": "^20.12.13",
22
- "@types/react": "^18.3.3",
23
- "@types/react-dom": "^18.3.0",
24
22
  "@typescript-eslint/eslint-plugin": "^7.18.0",
25
23
  "@typescript-eslint/parser": "^7.18.0",
26
24
  "@vitejs/plugin-react": "^4.3.0",
@@ -58,8 +56,8 @@
58
56
  "tailwindcss": "^4.0.17"
59
57
  },
60
58
  "peerDependencies": {
61
- "react": ">=19",
62
- "react-dom": ">=19"
59
+ "@assistant-ui/react": "0.8.17",
60
+ "react": "^18 || ^19 || ^19.0.0-rc"
63
61
  },
64
62
  "keywords": [
65
63
  "persona-sdk"
package/src/runtime.tsx CHANGED
@@ -1,3 +1,6 @@
1
+ 'use strict';
2
+ 'use client';
3
+
1
4
  import { useState, useEffect, useCallback, PropsWithChildren, createContext, useContext, useMemo, useRef } from 'react';
2
5
  import { useExternalStoreRuntime, AppendMessage, AssistantRuntimeProvider } from '@assistant-ui/react';
3
6
  import {