@applica-software-guru/persona-sdk 0.1.100 → 0.1.101

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 (170) hide show
  1. package/.eslintrc.cjs +6 -5
  2. package/.nvmrc +1 -1
  3. package/.prettierignore +3 -5
  4. package/.prettierrc +3 -5
  5. package/README.md +360 -20
  6. package/bitbucket-pipelines.yml +6 -5
  7. package/dist/bundle.cjs.js +1 -27
  8. package/dist/bundle.cjs.js.map +1 -1
  9. package/dist/bundle.es.js +700 -5086
  10. package/dist/bundle.es.js.map +1 -1
  11. package/dist/index.d.ts +1442 -8
  12. package/package.json +9 -51
  13. package/src/agents/agents-api.ts +66 -0
  14. package/src/agents/types.ts +349 -0
  15. package/src/auth/api-key-auth.ts +13 -0
  16. package/src/auth/authentication-provider.ts +4 -0
  17. package/src/auth/bearer-token-auth.ts +13 -0
  18. package/src/auth/index.ts +3 -0
  19. package/src/billing/billing-client.ts +182 -0
  20. package/src/billing/types.ts +166 -0
  21. package/src/credentials/credentials-api.ts +40 -0
  22. package/src/credentials/types.ts +67 -0
  23. package/src/exceptions.ts +10 -0
  24. package/src/features/feature-templates-api.ts +43 -0
  25. package/src/features/features-api.ts +16 -0
  26. package/src/features/types.ts +25 -0
  27. package/src/http-api.ts +102 -0
  28. package/src/index.ts +179 -7
  29. package/src/knowledges/knowledge-base-documents-api.ts +39 -0
  30. package/src/knowledges/knowledge-bases-api.ts +48 -0
  31. package/src/knowledges/types.ts +70 -0
  32. package/src/known-models/known-models-api.ts +33 -0
  33. package/src/known-models/types.ts +7 -0
  34. package/src/missions/missions-api.ts +62 -0
  35. package/src/missions/types.ts +25 -0
  36. package/src/paginated.ts +6 -0
  37. package/src/persona-sdk.ts +104 -0
  38. package/src/projects/projects-api.ts +90 -0
  39. package/src/projects/types.ts +52 -0
  40. package/src/revisions/types.ts +9 -0
  41. package/src/service-prices/service-prices-api.ts +33 -0
  42. package/src/service-prices/types.ts +8 -0
  43. package/src/sessions/sessions-api.ts +90 -0
  44. package/src/sessions/types.ts +150 -0
  45. package/src/triggers/trigger-executions-api.ts +28 -0
  46. package/src/triggers/triggers-api.ts +38 -0
  47. package/src/triggers/types.ts +50 -0
  48. package/src/values/values-api.ts +84 -0
  49. package/src/workflows/types.ts +150 -0
  50. package/src/workflows/workflow-executions-api.ts +28 -0
  51. package/src/workflows/workflows-api.ts +52 -0
  52. package/tsconfig.json +20 -28
  53. package/vite.config.ts +20 -67
  54. package/.github/copilot-instructions.md +0 -3
  55. package/CLAUDE.md +0 -3
  56. package/GEMINI.md +0 -3
  57. package/components.json +0 -24
  58. package/dist/bundle.iife.js +0 -28
  59. package/dist/bundle.iife.js.map +0 -1
  60. package/dist/bundle.umd.js +0 -28
  61. package/dist/bundle.umd.js.map +0 -1
  62. package/dist/index.d.ts.map +0 -1
  63. package/dist/logging.d.ts +0 -18
  64. package/dist/logging.d.ts.map +0 -1
  65. package/dist/messages.d.ts +0 -9
  66. package/dist/messages.d.ts.map +0 -1
  67. package/dist/projects.d.ts +0 -17
  68. package/dist/projects.d.ts.map +0 -1
  69. package/dist/protocol/base.d.ts +0 -25
  70. package/dist/protocol/base.d.ts.map +0 -1
  71. package/dist/protocol/index.d.ts +0 -6
  72. package/dist/protocol/index.d.ts.map +0 -1
  73. package/dist/protocol/rest.d.ts +0 -25
  74. package/dist/protocol/rest.d.ts.map +0 -1
  75. package/dist/protocol/transaction.d.ts +0 -56
  76. package/dist/protocol/transaction.d.ts.map +0 -1
  77. package/dist/protocol/webrtc.d.ts +0 -60
  78. package/dist/protocol/webrtc.d.ts.map +0 -1
  79. package/dist/protocol/websocket.d.ts +0 -22
  80. package/dist/protocol/websocket.d.ts.map +0 -1
  81. package/dist/runtime/context.d.ts +0 -34
  82. package/dist/runtime/context.d.ts.map +0 -1
  83. package/dist/runtime/file-attachment-adapter.d.ts +0 -15
  84. package/dist/runtime/file-attachment-adapter.d.ts.map +0 -1
  85. package/dist/runtime/handlers.d.ts +0 -21
  86. package/dist/runtime/handlers.d.ts.map +0 -1
  87. package/dist/runtime/listeners.d.ts +0 -6
  88. package/dist/runtime/listeners.d.ts.map +0 -1
  89. package/dist/runtime/protocols.d.ts +0 -17
  90. package/dist/runtime/protocols.d.ts.map +0 -1
  91. package/dist/runtime/threads.d.ts +0 -34
  92. package/dist/runtime/threads.d.ts.map +0 -1
  93. package/dist/runtime/utils.d.ts +0 -10
  94. package/dist/runtime/utils.d.ts.map +0 -1
  95. package/dist/runtime.d.ts +0 -6
  96. package/dist/runtime.d.ts.map +0 -1
  97. package/dist/storage/base.d.ts +0 -9
  98. package/dist/storage/base.d.ts.map +0 -1
  99. package/dist/storage/index.d.ts +0 -3
  100. package/dist/storage/index.d.ts.map +0 -1
  101. package/dist/storage/persona.d.ts +0 -29
  102. package/dist/storage/persona.d.ts.map +0 -1
  103. package/dist/tools.d.ts +0 -72
  104. package/dist/tools.d.ts.map +0 -1
  105. package/dist/types.d.ts +0 -237
  106. package/dist/types.d.ts.map +0 -1
  107. package/docs/README.md +0 -13
  108. package/docs/api-reference.md +0 -16
  109. package/docs/contributing.md +0 -21
  110. package/docs/customization.md +0 -74
  111. package/docs/features.md +0 -7
  112. package/docs/installation.md +0 -9
  113. package/docs/messages.md +0 -214
  114. package/docs/protocols.md +0 -39
  115. package/docs/transactions.md +0 -121
  116. package/docs/usage.md +0 -40
  117. package/jsconfig.node.json +0 -10
  118. package/playground/index.html +0 -14
  119. package/playground/src/app.tsx +0 -10
  120. package/playground/src/chat.tsx +0 -117
  121. package/playground/src/components/assistant-ui/assistant-modal.tsx +0 -57
  122. package/playground/src/components/assistant-ui/attachment.tsx +0 -197
  123. package/playground/src/components/assistant-ui/markdown-text.tsx +0 -228
  124. package/playground/src/components/assistant-ui/thread-list.tsx +0 -91
  125. package/playground/src/components/assistant-ui/thread.tsx +0 -302
  126. package/playground/src/components/assistant-ui/threadlist-sidebar.tsx +0 -59
  127. package/playground/src/components/assistant-ui/tool-fallback.tsx +0 -93
  128. package/playground/src/components/assistant-ui/tooltip-icon-button.tsx +0 -42
  129. package/playground/src/components/chat/logging.tsx +0 -53
  130. package/playground/src/components/ui/avatar.tsx +0 -51
  131. package/playground/src/components/ui/button.tsx +0 -60
  132. package/playground/src/components/ui/dialog.tsx +0 -141
  133. package/playground/src/components/ui/input.tsx +0 -21
  134. package/playground/src/components/ui/separator.tsx +0 -26
  135. package/playground/src/components/ui/sheet.tsx +0 -139
  136. package/playground/src/components/ui/sidebar.tsx +0 -619
  137. package/playground/src/components/ui/skeleton.tsx +0 -13
  138. package/playground/src/components/ui/tooltip.tsx +0 -59
  139. package/playground/src/hooks/theme.ts +0 -70
  140. package/playground/src/hooks/use-mobile.ts +0 -19
  141. package/playground/src/lib/utils.ts +0 -6
  142. package/playground/src/main.tsx +0 -10
  143. package/playground/src/styles.css +0 -120
  144. package/playground/src/tools.ts +0 -149
  145. package/playground/src/vite-env.d.ts +0 -1
  146. package/preview-build.sh +0 -23
  147. package/src/logging.ts +0 -34
  148. package/src/messages.ts +0 -202
  149. package/src/projects.ts +0 -57
  150. package/src/protocol/base.ts +0 -73
  151. package/src/protocol/index.ts +0 -5
  152. package/src/protocol/rest.ts +0 -107
  153. package/src/protocol/transaction.ts +0 -182
  154. package/src/protocol/webrtc.ts +0 -379
  155. package/src/protocol/websocket.ts +0 -111
  156. package/src/runtime/context.ts +0 -88
  157. package/src/runtime/file-attachment-adapter.ts +0 -48
  158. package/src/runtime/handlers.ts +0 -322
  159. package/src/runtime/index.ts +0 -6
  160. package/src/runtime/listeners.ts +0 -79
  161. package/src/runtime/protocols.ts +0 -169
  162. package/src/runtime/threads.ts +0 -105
  163. package/src/runtime/utils.ts +0 -46
  164. package/src/runtime.tsx +0 -334
  165. package/src/storage/base.ts +0 -13
  166. package/src/storage/index.ts +0 -2
  167. package/src/storage/persona.ts +0 -138
  168. package/src/tools.ts +0 -211
  169. package/src/types.ts +0 -284
  170. package/tsconfig.node.json +0 -15
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "@applica-software-guru/persona-sdk",
3
+ "description": "Official TypeScript SDK for the Persona API — manage agents, sessions, projects, knowledge bases, workflows, triggers and more.",
3
4
  "private": false,
4
- "version": "0.1.100",
5
+ "version": "0.1.101",
5
6
  "type": "module",
6
7
  "scripts": {
7
8
  "dev": "vite",
@@ -12,68 +13,25 @@
12
13
  "format": "prettier --write ."
13
14
  },
14
15
  "devDependencies": {
15
- "@assistant-ui/react-markdown": "^0.11.6",
16
- "@radix-ui/react-avatar": "^1.1.11",
17
- "@radix-ui/react-tooltip": "^1.2.8",
18
- "@radix-ui/react-separator": "^1.1.8",
19
- "@tailwindcss/vite": "^4.0.17",
20
- "@types/inflection": "^1.13.2",
21
- "@types/lodash": "^4.17.15",
22
16
  "@types/node": "^20.12.13",
23
- "@types/react-dom": "^19.1.1",
24
17
  "@typescript-eslint/eslint-plugin": "^7.18.0",
25
18
  "@typescript-eslint/parser": "^7.18.0",
26
19
  "@vitejs/plugin-react": "^4.3.0",
27
- "class-variance-authority": "^0.7.1",
28
- "clsx": "^2.1.1",
29
20
  "eslint": "^8.25.0",
30
21
  "eslint-config-prettier": "^8.10.0",
31
- "eslint-config-react-app": "7.0.1",
32
- "eslint-plugin-export": "^0.1.2",
33
- "eslint-plugin-filenames": "^1.3.2",
34
- "eslint-plugin-import": "^2.26.0",
35
- "eslint-plugin-jsx-a11y": "^6.6.1",
36
22
  "eslint-plugin-prettier": "^4.2.1",
37
- "eslint-plugin-react": "^7.31.10",
38
- "eslint-plugin-react-hooks": "^4.6.0",
39
- "eslint-plugin-react-refresh": "^0.4.19",
40
- "eslint-plugin-sort-exports": "^0.9.1",
41
- "husky": "^9.0.11",
42
- "jsdom": "^22.1.0",
43
- "lodash": "^4.17.21",
44
- "lucide-react": "^0.485.0",
45
23
  "prettier": "^2.8.8",
46
- "react": "^19.0.0",
47
- "react-dom": "^19.0.0",
48
- "react-markdown": "^10.0.1",
49
- "remark-gfm": "^4.0.1",
50
- "tailwind-merge": "^3.2.0",
51
- "tailwindcss": "^4.0.17",
52
- "tw-animate-css": "^1.2.8",
53
24
  "typescript": "^5.4.5",
54
25
  "vite": "^5.2.12",
55
- "vite-plugin-compression": "^0.5.1",
56
- "vite-plugin-dts": "^2.3.0",
57
- "vite-plugin-linter": "^2.0.2",
58
- "vitest": "^1.6.0"
26
+ "vite-plugin-dts": "^4.5.4"
59
27
  },
60
- "peerDependencies": {
61
- "@assistant-ui/react": "^0.11.47",
62
- "@radix-ui/react-dialog": "^1.1.15",
63
- "@radix-ui/react-slot": "^1.2.4",
64
- "react": "^18 || ^19 || ^19.0.0-rc",
65
- "react-dom": "^18 || ^19 || ^19.0.0-rc",
66
- "rehype-raw": "^7.0.0",
67
- "zustand": "^5.0.9"
68
- },
69
- "peerDependenciesMeta": {
70
- "react-dom": {
71
- "optional": false
72
- }
73
- },
74
- "dependencies": {},
75
28
  "keywords": [
76
- "persona-sdk"
29
+ "persona-sdk",
30
+ "persona",
31
+ "ai",
32
+ "sdk",
33
+ "chatbot",
34
+ "agents"
77
35
  ],
78
36
  "main": "dist/bundle.cjs.js",
79
37
  "module": "dist/bundle.es.js",
@@ -0,0 +1,66 @@
1
+ import { HttpApi } from '../http-api';
2
+ import { Paginated } from '../paginated';
3
+ import { AuthenticationProvider } from '../auth/authentication-provider';
4
+ import {
5
+ Agent,
6
+ AgentCreateRequest,
7
+ AgentUpdateRequest,
8
+ SynthesizerVoice,
9
+ Revision,
10
+ } from './types';
11
+
12
+ export class AgentsApi extends HttpApi {
13
+ constructor(baseUrl: string, auth: string | AuthenticationProvider) {
14
+ super(baseUrl, auth);
15
+ }
16
+
17
+ async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<Agent>> {
18
+ const { page: p, size: s } = this.normalizePageParams(page, size);
19
+ const params: Record<string, unknown> = { page: p, size: s, ...extraParams };
20
+ if (keyword) params.keyword = keyword;
21
+ return this.httpGet<Paginated<Agent>>('/agents', params);
22
+ }
23
+
24
+ async get(agentId: string): Promise<Agent> {
25
+ return this.httpGet<Agent>('/agents/' + agentId);
26
+ }
27
+
28
+ async create(request: AgentCreateRequest): Promise<Agent> {
29
+ return this.httpPost<Agent>('/agents', request);
30
+ }
31
+
32
+ async update(request: AgentUpdateRequest): Promise<Agent> {
33
+ return this.httpPut<Agent>('/agents/' + request.id, request);
34
+ }
35
+
36
+ async remove(agentId: string): Promise<void> {
37
+ await this.httpDelete('/agents/' + agentId);
38
+ }
39
+
40
+ async getSynthesizerSupportedVoices(synthesizerName: string): Promise<SynthesizerVoice[]> {
41
+ return this.httpGet<SynthesizerVoice[]>('/values/synthesizers/' + synthesizerName + '/voices');
42
+ }
43
+
44
+ async listRevisions(agentId: string): Promise<Revision[]> {
45
+ return this.httpGet<Revision[]>('/agents/' + agentId + '/revisions');
46
+ }
47
+
48
+ async getRevision(agentId: string, revisionId: string): Promise<Revision> {
49
+ return this.httpGet<Revision>('/agents/' + agentId + '/revisions/' + revisionId);
50
+ }
51
+
52
+ async rollback(agentId: string, revisionId: string): Promise<Agent> {
53
+ return this.httpPost<Agent>('/agents/' + agentId + '/revisions/' + revisionId + '/rollback', {});
54
+ }
55
+
56
+ async generateSystemInstructions(prompt: string, sessionId?: string): Promise<string> {
57
+ const body: Record<string, unknown> = { prompt };
58
+ if (sessionId) body.sessionId = sessionId;
59
+ const result = await this.httpPost<{ instructions: string }>('/agents/system-instructions', body);
60
+ return result.instructions;
61
+ }
62
+
63
+ async getArchitect(): Promise<Agent> {
64
+ return this.httpGet<Agent>('/agents/architect');
65
+ }
66
+ }
@@ -0,0 +1,349 @@
1
+ export type AgentProtocol = 'webrtc' | 'twilio' | 'rest' | 'websocket' | 'telegram';
2
+
3
+ export type KnowledgeType = 'multi_hop' | 'simple';
4
+
5
+ export type LanguageCode = 'en-US' | 'it-IT' | 'es-ES' | 'fr-FR' | 'de-DE' | 'pt-BR';
6
+
7
+
8
+ export type SynthesizerName = 'gcloud' | 'elevenlabs' | 'gtts' | 'openai';
9
+
10
+ export type TranscriberName = 'gcloud' | 'deepgram' | 'vosk';
11
+
12
+ export type StmType = 'simple' | 'summary' | 'compact';
13
+
14
+ export type ToolType = 'remote' | 'local';
15
+
16
+ export type CollaborationMode = 'delegate_and_return' | 'persistent_transfer' | 'consult_then_respond';
17
+
18
+ export type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high';
19
+
20
+ export type ModelProvider = 'google' | 'openai' | 'grok' | 'fireworks' | 'together' | 'ollama' | 'openai_compatible' | 'openrouter';
21
+
22
+ export type AgentType = 'agent';
23
+
24
+ export interface VariableSource {
25
+ type?: string;
26
+ tool?: string;
27
+ args?: Record<string, unknown>;
28
+ property?: string;
29
+ mcpServer?: string;
30
+ resourceUri?: string;
31
+ }
32
+
33
+ export interface Variable {
34
+ name?: string;
35
+ source?: VariableSource;
36
+ defaultValue?: unknown;
37
+ }
38
+
39
+ export interface ModelConfiguration {
40
+ /** litellm-style "<provider>/<model>" string (e.g. "fireworks/accounts/fireworks/models/minimax-m3"). Use the known-models API for the current list. */
41
+ modelName?: string;
42
+ temperature?: number;
43
+ reasoningEffort?: ReasoningEffort;
44
+ /** Maximum number of output tokens to generate. Undefined = provider default. */
45
+ maxOutputTokens?: number;
46
+ /** Override the per-provider default API key (env var) when set. */
47
+ apiKey?: string;
48
+ /** Override the per-provider default base URL when set. */
49
+ baseUrl?: string;
50
+ /** Passed verbatim as extra_body to the underlying LLM request (e.g. { service_tier: "priority" }). */
51
+ extraBody?: Record<string, unknown>;
52
+ /** @deprecated use `baseUrl`. Kept for backward compatibility. */
53
+ url?: string;
54
+ /** @deprecated use litellm `modelName` (e.g. "ollama/llama3.1"). */
55
+ ollamaModelName?: string;
56
+ /** @deprecated use litellm `modelName` (e.g. "openai_compatible/gpt-4o"). */
57
+ openaiCompatibleModelName?: string;
58
+ /** @deprecated use `apiKey`. */
59
+ openaiCompatibleApiKey?: string;
60
+ /** @deprecated use litellm `modelName` (e.g. "openrouter/anthropic/claude-3"). */
61
+ openrouterModelName?: string;
62
+ }
63
+
64
+ export type AttachmentsPreprocessorImageHandling = 'drop' | 'describe' | 'keep';
65
+
66
+ export interface AttachmentsPreprocessorConfiguration {
67
+ enabled?: boolean;
68
+ imageHandling?: AttachmentsPreprocessorImageHandling;
69
+ standalonePassthrough?: boolean;
70
+ secondaryModel?: ModelConfiguration;
71
+ llmPrompt?: string;
72
+ pdfImageDpi?: number;
73
+ maxPages?: number;
74
+ failOpen?: boolean;
75
+ }
76
+
77
+ export interface SynthesizerVoice {
78
+ id?: string;
79
+ name?: string;
80
+ languageCodes?: string[];
81
+ gender?: string;
82
+ }
83
+
84
+ export interface SynthesizerConfiguration {
85
+ enabled?: boolean;
86
+ synthesizerName?: SynthesizerName;
87
+ languageCode?: LanguageCode;
88
+ voice?: string;
89
+ sampleRateHertz?: number;
90
+ speed?: number;
91
+ similarityBoost?: number;
92
+ stability?: number;
93
+ style?: number;
94
+ voiceInstructions?: string;
95
+ }
96
+
97
+ export interface TranscriberConfiguration {
98
+ enabled?: boolean;
99
+ transcriberName?: TranscriberName;
100
+ languageCode?: LanguageCode;
101
+ sampleRateHertz?: number;
102
+ }
103
+
104
+ export interface KnowledgeConfiguration {
105
+ enabled?: boolean;
106
+ knowledgeType?: KnowledgeType;
107
+ namespace?: string[];
108
+ numberOfEntries?: number;
109
+ args?: Record<string, unknown>;
110
+ knowledgeBaseId?: string;
111
+ }
112
+
113
+ export interface CollaborationConfiguration {
114
+ enabled?: boolean;
115
+ collaborators?: Collaborator[];
116
+ mode?: CollaborationMode;
117
+ maxNumberOfIterations?: number;
118
+ }
119
+
120
+ export interface Collaborator {
121
+ name?: string;
122
+ agent?: string;
123
+ scope?: string;
124
+ }
125
+
126
+ export interface OrchestrationAgent {
127
+ name?: string;
128
+ agent?: string;
129
+ scope?: string;
130
+ }
131
+
132
+ export interface OrchestrationConfiguration {
133
+ enabled?: boolean;
134
+ agents?: OrchestrationAgent[];
135
+ maxParallelCalls?: number;
136
+ }
137
+
138
+ export interface NetworkConfiguration {
139
+ allowedWebsites?: string[];
140
+ allowedIps?: string[];
141
+ }
142
+
143
+ export interface WakeupConfiguration {
144
+ enabled?: boolean;
145
+ wakeupWords?: string[];
146
+ sleepWords?: string[];
147
+ sleepInEachRequest?: boolean;
148
+ sleepDelaySeconds?: number;
149
+ }
150
+
151
+ export interface TelegramConfiguration {
152
+ enabled?: boolean;
153
+ botToken?: string;
154
+ enabledUsers?: string[];
155
+ }
156
+
157
+ export interface TwilioConfiguration {
158
+ phoneNumber?: string;
159
+ }
160
+
161
+ export interface WhatsAppConfiguration {
162
+ phoneNumberId?: string;
163
+ enabledUsers?: string[];
164
+ }
165
+
166
+ export interface SkillResource {
167
+ path?: string;
168
+ content?: string;
169
+ contentType?: string;
170
+ }
171
+
172
+ export interface SkillConfiguration {
173
+ name?: string;
174
+ description?: string;
175
+ instructions?: string;
176
+ allowedTools?: string[];
177
+ metadata?: Record<string, unknown>;
178
+ resources?: SkillResource[];
179
+ }
180
+
181
+ export interface McpServerConfiguration {
182
+ type?: string;
183
+ name?: string;
184
+ transport?: Transport;
185
+ enabledTools?: string[];
186
+ disabledTools?: string[];
187
+ }
188
+
189
+ export interface FlagConfiguration {
190
+ type?: string;
191
+ flag?: string;
192
+ }
193
+
194
+ export type FeatureConfiguration = McpServerConfiguration | FlagConfiguration | SkillConfiguration;
195
+
196
+ export interface HttpTransport {
197
+ url?: string;
198
+ enablePersonaAuth?: boolean;
199
+ headers?: Record<string, string>;
200
+ }
201
+
202
+ export interface StdioTransport {
203
+ command?: string;
204
+ args?: string[];
205
+ env?: Record<string, string>;
206
+ cwd?: string;
207
+ }
208
+
209
+ export type Transport = HttpTransport | StdioTransport;
210
+
211
+ export interface Feature {
212
+ id?: string;
213
+ templateId?: string;
214
+ credentialsId?: string;
215
+ }
216
+
217
+ export interface ToolLocalConfig {
218
+ parameters?: Record<string, unknown>;
219
+ output?: Record<string, unknown>;
220
+ }
221
+
222
+ export interface ToolRemoteConfig {
223
+ serviceUrl?: string;
224
+ secret?: string;
225
+ timeout?: number;
226
+ }
227
+
228
+ export type ToolConfig = ToolLocalConfig | ToolRemoteConfig;
229
+
230
+ export interface ToolDefinition {
231
+ name?: string;
232
+ description?: string;
233
+ parameters?: Record<string, unknown>;
234
+ output?: Record<string, unknown>;
235
+ }
236
+
237
+ export interface Tool {
238
+ type?: ToolType;
239
+ name?: string;
240
+ description?: string;
241
+ config?: ToolConfig;
242
+ }
243
+
244
+ export interface ToolkitConfiguration {
245
+ tools?: Tool[];
246
+ }
247
+
248
+ export interface StmConfiguration {
249
+ type?: StmType;
250
+ maxMessages?: number;
251
+ includeToolCalls?: boolean;
252
+ model?: ModelConfiguration;
253
+ maxNumberOfWords?: number;
254
+ keepLastNObservations?: number;
255
+ maskingThreshold?: number;
256
+ summaryThreshold?: number;
257
+ maxContextTokens?: number;
258
+ }
259
+
260
+ export interface ContextManagementConfiguration {
261
+ enabled?: boolean;
262
+ maxContextTokens?: number;
263
+ summarizationThreshold?: number;
264
+ keepLastNIterations?: number;
265
+ keepFirstMessage?: boolean;
266
+ maxToolCallsBeforeCompaction?: number;
267
+ useLlmCompaction?: boolean;
268
+ maxSummaryWords?: number;
269
+ truncationEnabled?: boolean;
270
+ maxObservationTokens?: number;
271
+ compactionModel?: ModelConfiguration;
272
+ }
273
+
274
+ export interface Revision {
275
+ id?: string;
276
+ entityId?: string;
277
+ projectId?: string;
278
+ revisionNumber?: number;
279
+ createdAt?: string;
280
+ snapshot?: Record<string, unknown>;
281
+ }
282
+
283
+ export interface Agent {
284
+ id?: string;
285
+ projectId?: string;
286
+ apiKey?: string;
287
+ code?: string;
288
+ name?: string;
289
+ description?: string;
290
+ type?: AgentType;
291
+ synthesizer?: SynthesizerConfiguration;
292
+ transcriber?: TranscriberConfiguration;
293
+ model?: ModelConfiguration;
294
+ systemInstructions?: string;
295
+ variables?: Variable[];
296
+ enabledProtocols?: AgentProtocol[];
297
+ twilio?: TwilioConfiguration;
298
+ languageCode?: LanguageCode;
299
+ initialMessage?: string;
300
+ initialMessageMode?: "processed" | "static";
301
+ knowledge?: KnowledgeConfiguration;
302
+ wakeup?: WakeupConfiguration;
303
+ telegram?: TelegramConfiguration;
304
+ whatsapp?: WhatsAppConfiguration;
305
+ collaboration?: CollaborationConfiguration;
306
+ orchestration?: OrchestrationConfiguration;
307
+ network?: NetworkConfiguration;
308
+ features?: Feature[];
309
+ toolkit?: ToolkitConfiguration;
310
+ shortTermMemory?: StmConfiguration;
311
+ contextManagement?: ContextManagementConfiguration;
312
+ attachmentsPreprocessor?: AttachmentsPreprocessorConfiguration;
313
+ responseSchema?: Record<string, unknown>;
314
+ verboseErrors?: boolean;
315
+ }
316
+
317
+ export interface AgentCreateRequest {
318
+ projectId?: string;
319
+ code?: string;
320
+ name?: string;
321
+ description?: string;
322
+ type?: AgentType;
323
+ synthesizer?: SynthesizerConfiguration;
324
+ transcriber?: TranscriberConfiguration;
325
+ model?: ModelConfiguration;
326
+ systemInstructions?: string;
327
+ variables?: Variable[];
328
+ enabledProtocols?: AgentProtocol[];
329
+ twilio?: TwilioConfiguration;
330
+ languageCode?: LanguageCode;
331
+ initialMessage?: string;
332
+ initialMessageMode?: "processed" | "static";
333
+ knowledge?: KnowledgeConfiguration;
334
+ wakeup?: WakeupConfiguration;
335
+ telegram?: TelegramConfiguration;
336
+ whatsapp?: WhatsAppConfiguration;
337
+ collaboration?: CollaborationConfiguration;
338
+ orchestration?: OrchestrationConfiguration;
339
+ network?: NetworkConfiguration;
340
+ features?: Feature[];
341
+ toolkit?: ToolkitConfiguration;
342
+ shortTermMemory?: StmConfiguration;
343
+ contextManagement?: ContextManagementConfiguration;
344
+ attachmentsPreprocessor?: AttachmentsPreprocessorConfiguration;
345
+ responseSchema?: Record<string, unknown>;
346
+ verboseErrors?: boolean;
347
+ }
348
+
349
+ export interface AgentUpdateRequest extends Agent {}
@@ -0,0 +1,13 @@
1
+ import { AuthenticationProvider } from './authentication-provider';
2
+
3
+ export class ApiKeyAuthenticationProvider implements AuthenticationProvider {
4
+ constructor(private readonly apiKey: string) {}
5
+
6
+ applyHeaders(headers: Headers): void {
7
+ headers.set('x-persona-apikey', this.apiKey);
8
+ }
9
+
10
+ getCredentials(): string {
11
+ return this.apiKey;
12
+ }
13
+ }
@@ -0,0 +1,4 @@
1
+ export interface AuthenticationProvider {
2
+ applyHeaders(headers: Headers): void;
3
+ getCredentials(): string;
4
+ }
@@ -0,0 +1,13 @@
1
+ import { AuthenticationProvider } from './authentication-provider';
2
+
3
+ export class BearerTokenAuthenticationProvider implements AuthenticationProvider {
4
+ constructor(private readonly token: string) {}
5
+
6
+ applyHeaders(headers: Headers): void {
7
+ headers.set('Authorization', `Bearer ${this.token}`);
8
+ }
9
+
10
+ getCredentials(): string {
11
+ return this.token;
12
+ }
13
+ }
@@ -0,0 +1,3 @@
1
+ export type { AuthenticationProvider } from './authentication-provider';
2
+ export { ApiKeyAuthenticationProvider } from './api-key-auth';
3
+ export { BearerTokenAuthenticationProvider } from './bearer-token-auth';