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

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,26 @@ 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
+ }
670
+
671
+ /**
672
+ * Global markup rules (super admin only). Markup no longer lives on the
673
+ * ServicePrice: there is a single platform-wide list of {pattern, percentage}
674
+ * rules matched against usage service codes (most-specific-wins, "*" fallback).
675
+ */
676
+ export declare class MarkupRulesApi extends HttpApi {
677
+ constructor(baseUrl: string, auth: string | AuthenticationProvider);
678
+ list(keyword?: string | null, page?: number, size?: number): Promise<Paginated<MarkupRule>>;
679
+ get(id: string): Promise<MarkupRule>;
680
+ create(markupRule: MarkupRule): Promise<MarkupRule>;
681
+ update(id: string, markupRule: MarkupRule): Promise<MarkupRule>;
682
+ remove(id: string): Promise<void>;
683
+ }
684
+
682
685
  export declare interface McpServerConfiguration {
683
686
  type?: string;
684
687
  name?: string;
@@ -885,8 +888,10 @@ export declare class PersonaSdk {
885
888
  triggers(authProvider: AuthenticationProvider): TriggersApi;
886
889
  servicePrices(apiKey: string): ServicePricesApi;
887
890
  servicePrices(authProvider: AuthenticationProvider): ServicePricesApi;
888
- knownModels(apiKey: string): KnownModelsApi;
889
- knownModels(authProvider: AuthenticationProvider): KnownModelsApi;
891
+ markupRules(apiKey: string): MarkupRulesApi;
892
+ markupRules(authProvider: AuthenticationProvider): MarkupRulesApi;
893
+ providers(apiKey: string): ProvidersApi;
894
+ providers(authProvider: AuthenticationProvider): ProvidersApi;
890
895
  sessions(apiKey: string): SessionsApi;
891
896
  sessions(authProvider: AuthenticationProvider): SessionsApi;
892
897
  missions(apiKey: string): MissionsApi;
@@ -960,6 +965,51 @@ export declare interface ProjectUpdateRequest {
960
965
  tag?: string;
961
966
  }
962
967
 
968
+ export declare interface Provider {
969
+ id?: string;
970
+ /** litellm provider name, e.g. "openai", "anthropic", "vertex_ai". */
971
+ name?: string;
972
+ /** null/undefined => global; set => per-project override. */
973
+ projectId?: string | null;
974
+ /** Write-only; returned masked ("********") on reads. */
975
+ apiKey?: string;
976
+ baseUrl?: string;
977
+ /** Provider-specific extras (e.g. vertexProject, vertexLocation, vertexCredentials). */
978
+ config?: Record<string, unknown>;
979
+ }
980
+
981
+ /** A model suggestion for a provider, with litellm capability flags. */
982
+ export declare interface ProviderModel {
983
+ id: string;
984
+ contextWindow?: number;
985
+ supportsVision?: boolean;
986
+ supportsFunctionCalling?: boolean;
987
+ supportsAudioInput?: boolean;
988
+ supportsPdfInput?: boolean;
989
+ supportsReasoning?: boolean;
990
+ }
991
+
992
+ /**
993
+ * Managed LLM providers (super admin only). Providers bind a litellm provider
994
+ * name to its credentials; global or per-project (override). API keys are stored
995
+ * encrypted and returned masked.
996
+ */
997
+ export declare class ProvidersApi extends HttpApi {
998
+ constructor(baseUrl: string, auth: string | AuthenticationProvider);
999
+ list(projectId?: string | null, keyword?: string | null, page?: number, size?: number): Promise<Paginated<Provider>>;
1000
+ get(id: string): Promise<Provider>;
1001
+ create(provider: Provider): Promise<Provider>;
1002
+ update(id: string, provider: Provider): Promise<Provider>;
1003
+ remove(id: string): Promise<void>;
1004
+ /** Provider names litellm supports (for the "add provider" picker). Admin. */
1005
+ available(): Promise<string[]>;
1006
+ /** Names of providers configured for the caller (global + their project), no
1007
+ * credentials. Authenticated (not admin) — for the model selector. */
1008
+ names(): Promise<string[]>;
1009
+ /** Model suggestions (chat, with capabilities) for a provider, from litellm. */
1010
+ models(provider: string): Promise<ProviderModel[]>;
1011
+ }
1012
+
963
1013
  export declare type ReasoningEffort = 'minimal' | 'low' | 'medium' | 'high';
964
1014
 
965
1015
  export declare interface Ref {
@@ -1003,7 +1053,6 @@ export declare interface ServicePrice {
1003
1053
  service?: string;
1004
1054
  cost?: number;
1005
1055
  unit?: string;
1006
- markupPercentage?: number;
1007
1056
  fixedPrice?: number;
1008
1057
  }
1009
1058
 
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.104",
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,38 @@
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
+ * Global markup rules (super admin only). Markup no longer lives on the
8
+ * ServicePrice: there is a single platform-wide list of {pattern, percentage}
9
+ * rules matched against usage 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(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 (keyword) params.keyword = keyword;
20
+ return this.httpGet<Paginated<MarkupRule>>('/markup-rules', params);
21
+ }
22
+
23
+ async get(id: string): Promise<MarkupRule> {
24
+ return this.httpGet<MarkupRule>('/markup-rules/' + id);
25
+ }
26
+
27
+ async create(markupRule: MarkupRule): Promise<MarkupRule> {
28
+ return this.httpPost<MarkupRule>('/markup-rules', markupRule);
29
+ }
30
+
31
+ async update(id: string, markupRule: MarkupRule): Promise<MarkupRule> {
32
+ return this.httpPut<MarkupRule>('/markup-rules/' + id, markupRule);
33
+ }
34
+
35
+ async remove(id: string): Promise<void> {
36
+ await this.httpDelete('/markup-rules/' + id);
37
+ }
38
+ }
@@ -0,0 +1,5 @@
1
+ export interface MarkupRule {
2
+ id?: string;
3
+ pattern?: string;
4
+ percentage?: number;
5
+ }
@@ -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
- }