@applica-software-guru/persona-sdk 0.1.103 → 0.1.105

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.d.ts CHANGED
@@ -651,23 +651,6 @@ export declare interface KnowledgeConfiguration {
651
651
 
652
652
  export declare type KnowledgeType = 'multi_hop' | 'simple';
653
653
 
654
- export declare interface KnownModel {
655
- id?: string;
656
- provider?: string;
657
- modelName?: string;
658
- label?: string;
659
- deprecated?: boolean;
660
- }
661
-
662
- export declare class KnownModelsApi extends HttpApi {
663
- constructor(baseUrl: string, auth: string | AuthenticationProvider);
664
- list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnownModel>>;
665
- get(id: string): Promise<KnownModel>;
666
- create(knownModel: KnownModel): Promise<KnownModel>;
667
- update(id: string, knownModel: KnownModel): Promise<KnownModel>;
668
- remove(id: string): Promise<void>;
669
- }
670
-
671
654
  export declare type LanguageCode = 'en-US' | 'it-IT' | 'es-ES' | 'fr-FR' | 'de-DE' | 'pt-BR';
672
655
 
673
656
  export declare interface LineItem {
@@ -679,6 +662,28 @@ export declare interface LineItem {
679
662
  periodEnd?: string;
680
663
  }
681
664
 
665
+ export declare interface MarkupRule {
666
+ id?: string;
667
+ pattern?: string;
668
+ percentage?: number;
669
+ /** null/undefined => global; set => per-project override. */
670
+ projectId?: string | null;
671
+ }
672
+
673
+ /**
674
+ * Markup rules (super admin only). Markup no longer lives on the ServicePrice:
675
+ * rules are {pattern, percentage}, global or per-project, matched against usage
676
+ * service codes (most-specific-wins, "*" fallback).
677
+ */
678
+ export declare class MarkupRulesApi extends HttpApi {
679
+ constructor(baseUrl: string, auth: string | AuthenticationProvider);
680
+ list(projectId?: string | null, keyword?: string | null, page?: number, size?: number): Promise<Paginated<MarkupRule>>;
681
+ get(id: string): Promise<MarkupRule>;
682
+ create(markupRule: MarkupRule): Promise<MarkupRule>;
683
+ update(id: string, markupRule: MarkupRule): Promise<MarkupRule>;
684
+ remove(id: string): Promise<void>;
685
+ }
686
+
682
687
  export declare interface McpServerConfiguration {
683
688
  type?: string;
684
689
  name?: string;
@@ -885,8 +890,10 @@ export declare class PersonaSdk {
885
890
  triggers(authProvider: AuthenticationProvider): TriggersApi;
886
891
  servicePrices(apiKey: string): ServicePricesApi;
887
892
  servicePrices(authProvider: AuthenticationProvider): ServicePricesApi;
888
- knownModels(apiKey: string): KnownModelsApi;
889
- knownModels(authProvider: AuthenticationProvider): KnownModelsApi;
893
+ markupRules(apiKey: string): MarkupRulesApi;
894
+ markupRules(authProvider: AuthenticationProvider): MarkupRulesApi;
895
+ providers(apiKey: string): ProvidersApi;
896
+ providers(authProvider: AuthenticationProvider): ProvidersApi;
890
897
  sessions(apiKey: string): SessionsApi;
891
898
  sessions(authProvider: AuthenticationProvider): SessionsApi;
892
899
  missions(apiKey: string): MissionsApi;
@@ -960,6 +967,51 @@ export declare interface ProjectUpdateRequest {
960
967
  tag?: string;
961
968
  }
962
969
 
970
+ export declare interface Provider {
971
+ id?: string;
972
+ /** litellm provider name, e.g. "openai", "anthropic", "vertex_ai". */
973
+ name?: string;
974
+ /** null/undefined => global; set => per-project override. */
975
+ projectId?: string | null;
976
+ /** Write-only; returned masked ("********") on reads. */
977
+ apiKey?: string;
978
+ baseUrl?: string;
979
+ /** Provider-specific extras (e.g. vertexProject, vertexLocation, vertexCredentials). */
980
+ config?: Record<string, unknown>;
981
+ }
982
+
983
+ /** A model suggestion for a provider, with litellm capability flags. */
984
+ export declare interface ProviderModel {
985
+ id: string;
986
+ contextWindow?: number;
987
+ supportsVision?: boolean;
988
+ supportsFunctionCalling?: boolean;
989
+ supportsAudioInput?: boolean;
990
+ supportsPdfInput?: boolean;
991
+ supportsReasoning?: boolean;
992
+ }
993
+
994
+ /**
995
+ * Managed LLM providers (super admin only). Providers bind a litellm provider
996
+ * name to its credentials; global or per-project (override). API keys are stored
997
+ * encrypted and returned masked.
998
+ */
999
+ export declare class ProvidersApi extends HttpApi {
1000
+ constructor(baseUrl: string, auth: string | AuthenticationProvider);
1001
+ list(projectId?: string | null, keyword?: string | null, page?: number, size?: number): Promise<Paginated<Provider>>;
1002
+ get(id: string): Promise<Provider>;
1003
+ create(provider: Provider): Promise<Provider>;
1004
+ update(id: string, provider: Provider): Promise<Provider>;
1005
+ remove(id: string): Promise<void>;
1006
+ /** Provider names litellm supports (for the "add provider" picker). Admin. */
1007
+ available(): Promise<string[]>;
1008
+ /** Names of providers configured for the caller (global + their project), no
1009
+ * credentials. Authenticated (not admin) — for the model selector. */
1010
+ names(): Promise<string[]>;
1011
+ /** Model suggestions (chat, with capabilities) for a provider, from litellm. */
1012
+ models(provider: string): Promise<ProviderModel[]>;
1013
+ }
1014
+
963
1015
  export declare type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high';
964
1016
 
965
1017
  export declare interface Ref {
@@ -1003,7 +1055,6 @@ export declare interface ServicePrice {
1003
1055
  service?: string;
1004
1056
  cost?: number;
1005
1057
  unit?: string;
1006
- markupPercentage?: number;
1007
1058
  fixedPrice?: number;
1008
1059
  }
1009
1060
 
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@applica-software-guru/persona-sdk",
3
3
  "description": "Official TypeScript SDK for the Persona API — manage agents, sessions, projects, knowledge bases, workflows, triggers and more.",
4
4
  "private": false,
5
- "version": "0.1.103",
5
+ "version": "0.1.105",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "dev": "vite",
package/src/index.ts CHANGED
@@ -152,8 +152,10 @@ export { MissionsApi } from './missions/missions-api';
152
152
  export type { Mission, MissionStatus } from './missions/types';
153
153
  export { ServicePricesApi } from './service-prices/service-prices-api';
154
154
  export type { ServicePrice } from './service-prices/types';
155
- export { KnownModelsApi } from './known-models/known-models-api';
156
- export type { KnownModel } from './known-models/types';
155
+ export { MarkupRulesApi } from './markup-rules/markup-rules-api';
156
+ export type { MarkupRule } from './markup-rules/types';
157
+ export { ProvidersApi } from './providers/providers-api';
158
+ export type { Provider, ProviderModel } from './providers/types';
157
159
  export type { Revision as RevisionType } from './revisions/types';
158
160
  export { BillingClient } from './billing/billing-client';
159
161
  export { ValuesApi } from './values/values-api';
@@ -0,0 +1,39 @@
1
+ import { HttpApi } from '../http-api';
2
+ import { Paginated } from '../paginated';
3
+ import { AuthenticationProvider } from '../auth/authentication-provider';
4
+ import { MarkupRule } from './types';
5
+
6
+ /**
7
+ * Markup rules (super admin only). Markup no longer lives on the ServicePrice:
8
+ * rules are {pattern, percentage}, global or per-project, matched against usage
9
+ * service codes (most-specific-wins, "*" fallback).
10
+ */
11
+ export class MarkupRulesApi extends HttpApi {
12
+ constructor(baseUrl: string, auth: string | AuthenticationProvider) {
13
+ super(baseUrl, auth);
14
+ }
15
+
16
+ async list(projectId?: string | null, keyword?: string | null, page?: number, size?: number): Promise<Paginated<MarkupRule>> {
17
+ const { page: p, size: s } = this.normalizePageParams(page, size);
18
+ const params: Record<string, unknown> = { page: p, size: s };
19
+ if (projectId) params.projectId = projectId;
20
+ if (keyword) params.keyword = keyword;
21
+ return this.httpGet<Paginated<MarkupRule>>('/markup-rules', params);
22
+ }
23
+
24
+ async get(id: string): Promise<MarkupRule> {
25
+ return this.httpGet<MarkupRule>('/markup-rules/' + id);
26
+ }
27
+
28
+ async create(markupRule: MarkupRule): Promise<MarkupRule> {
29
+ return this.httpPost<MarkupRule>('/markup-rules', markupRule);
30
+ }
31
+
32
+ async update(id: string, markupRule: MarkupRule): Promise<MarkupRule> {
33
+ return this.httpPut<MarkupRule>('/markup-rules/' + id, markupRule);
34
+ }
35
+
36
+ async remove(id: string): Promise<void> {
37
+ await this.httpDelete('/markup-rules/' + id);
38
+ }
39
+ }
@@ -0,0 +1,7 @@
1
+ export interface MarkupRule {
2
+ id?: string;
3
+ pattern?: string;
4
+ percentage?: number;
5
+ /** null/undefined => global; set => per-project override. */
6
+ projectId?: string | null;
7
+ }
@@ -7,7 +7,8 @@ import { CredentialsApi } from './credentials/credentials-api';
7
7
  import { FeaturesApi } from './features/features-api';
8
8
  import { TriggersApi } from './triggers/triggers-api';
9
9
  import { ServicePricesApi } from './service-prices/service-prices-api';
10
- import { KnownModelsApi } from './known-models/known-models-api';
10
+ import { MarkupRulesApi } from './markup-rules/markup-rules-api';
11
+ import { ProvidersApi } from './providers/providers-api';
11
12
  import { SessionsApi } from './sessions/sessions-api';
12
13
  import { MissionsApi } from './missions/missions-api';
13
14
  import { BillingClient } from './billing/billing-client';
@@ -72,10 +73,16 @@ export class PersonaSdk {
72
73
  return new ServicePricesApi(this.baseUrl, auth);
73
74
  }
74
75
 
75
- knownModels(apiKey: string): KnownModelsApi;
76
- knownModels(authProvider: AuthenticationProvider): KnownModelsApi;
77
- knownModels(auth: string | AuthenticationProvider): KnownModelsApi {
78
- return new KnownModelsApi(this.baseUrl, auth);
76
+ markupRules(apiKey: string): MarkupRulesApi;
77
+ markupRules(authProvider: AuthenticationProvider): MarkupRulesApi;
78
+ markupRules(auth: string | AuthenticationProvider): MarkupRulesApi {
79
+ return new MarkupRulesApi(this.baseUrl, auth);
80
+ }
81
+
82
+ providers(apiKey: string): ProvidersApi;
83
+ providers(authProvider: AuthenticationProvider): ProvidersApi;
84
+ providers(auth: string | AuthenticationProvider): ProvidersApi {
85
+ return new ProvidersApi(this.baseUrl, auth);
79
86
  }
80
87
 
81
88
  sessions(apiKey: string): SessionsApi;
@@ -0,0 +1,55 @@
1
+ import { HttpApi } from '../http-api';
2
+ import { Paginated } from '../paginated';
3
+ import { AuthenticationProvider } from '../auth/authentication-provider';
4
+ import { Provider, ProviderModel } from './types';
5
+
6
+ /**
7
+ * Managed LLM providers (super admin only). Providers bind a litellm provider
8
+ * name to its credentials; global or per-project (override). API keys are stored
9
+ * encrypted and returned masked.
10
+ */
11
+ export class ProvidersApi extends HttpApi {
12
+ constructor(baseUrl: string, auth: string | AuthenticationProvider) {
13
+ super(baseUrl, auth);
14
+ }
15
+
16
+ async list(projectId?: string | null, keyword?: string | null, page?: number, size?: number): Promise<Paginated<Provider>> {
17
+ const { page: p, size: s } = this.normalizePageParams(page, size);
18
+ const params: Record<string, unknown> = { page: p, size: s };
19
+ if (projectId) params.projectId = projectId;
20
+ if (keyword) params.keyword = keyword;
21
+ return this.httpGet<Paginated<Provider>>('/providers', params);
22
+ }
23
+
24
+ async get(id: string): Promise<Provider> {
25
+ return this.httpGet<Provider>('/providers/' + id);
26
+ }
27
+
28
+ async create(provider: Provider): Promise<Provider> {
29
+ return this.httpPost<Provider>('/providers', provider);
30
+ }
31
+
32
+ async update(id: string, provider: Provider): Promise<Provider> {
33
+ return this.httpPut<Provider>('/providers/' + id, provider);
34
+ }
35
+
36
+ async remove(id: string): Promise<void> {
37
+ await this.httpDelete('/providers/' + id);
38
+ }
39
+
40
+ /** Provider names litellm supports (for the "add provider" picker). Admin. */
41
+ async available(): Promise<string[]> {
42
+ return this.httpGet<string[]>('/providers/available');
43
+ }
44
+
45
+ /** Names of providers configured for the caller (global + their project), no
46
+ * credentials. Authenticated (not admin) — for the model selector. */
47
+ async names(): Promise<string[]> {
48
+ return this.httpGet<string[]>('/provider-names');
49
+ }
50
+
51
+ /** Model suggestions (chat, with capabilities) for a provider, from litellm. */
52
+ async models(provider: string): Promise<ProviderModel[]> {
53
+ return this.httpGet<ProviderModel[]>('/provider-models', { provider });
54
+ }
55
+ }
@@ -0,0 +1,23 @@
1
+ export interface Provider {
2
+ id?: string;
3
+ /** litellm provider name, e.g. "openai", "anthropic", "vertex_ai". */
4
+ name?: string;
5
+ /** null/undefined => global; set => per-project override. */
6
+ projectId?: string | null;
7
+ /** Write-only; returned masked ("********") on reads. */
8
+ apiKey?: string;
9
+ baseUrl?: string;
10
+ /** Provider-specific extras (e.g. vertexProject, vertexLocation, vertexCredentials). */
11
+ config?: Record<string, unknown>;
12
+ }
13
+
14
+ /** A model suggestion for a provider, with litellm capability flags. */
15
+ export interface ProviderModel {
16
+ id: string;
17
+ contextWindow?: number;
18
+ supportsVision?: boolean;
19
+ supportsFunctionCalling?: boolean;
20
+ supportsAudioInput?: boolean;
21
+ supportsPdfInput?: boolean;
22
+ supportsReasoning?: boolean;
23
+ }
@@ -3,6 +3,5 @@ export interface ServicePrice {
3
3
  service?: string;
4
4
  cost?: number;
5
5
  unit?: string;
6
- markupPercentage?: number;
7
6
  fixedPrice?: number;
8
7
  }
@@ -1,33 +0,0 @@
1
- import { HttpApi } from '../http-api';
2
- import { Paginated } from '../paginated';
3
- import { AuthenticationProvider } from '../auth/authentication-provider';
4
- import { KnownModel } from './types';
5
-
6
- export class KnownModelsApi extends HttpApi {
7
- constructor(baseUrl: string, auth: string | AuthenticationProvider) {
8
- super(baseUrl, auth);
9
- }
10
-
11
- async list(keyword?: string | null, page?: number, size?: number, extraParams?: Record<string, string>): Promise<Paginated<KnownModel>> {
12
- const { page: p, size: s } = this.normalizePageParams(page, size);
13
- const params: Record<string, unknown> = { page: p, size: s, ...extraParams };
14
- if (keyword) params.keyword = keyword;
15
- return this.httpGet<Paginated<KnownModel>>('/known-models', params);
16
- }
17
-
18
- async get(id: string): Promise<KnownModel> {
19
- return this.httpGet<KnownModel>('/known-models/' + id);
20
- }
21
-
22
- async create(knownModel: KnownModel): Promise<KnownModel> {
23
- return this.httpPost<KnownModel>('/known-models', knownModel);
24
- }
25
-
26
- async update(id: string, knownModel: KnownModel): Promise<KnownModel> {
27
- return this.httpPut<KnownModel>('/known-models/' + id, knownModel);
28
- }
29
-
30
- async remove(id: string): Promise<void> {
31
- await this.httpDelete('/known-models/' + id);
32
- }
33
- }
@@ -1,7 +0,0 @@
1
- export interface KnownModel {
2
- id?: string;
3
- provider?: string;
4
- modelName?: string;
5
- label?: string;
6
- deprecated?: boolean;
7
- }