@applica-software-guru/persona-sdk 0.1.115 → 0.1.116
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 +1 -1
- package/dist/bundle.cjs.js.map +1 -1
- package/dist/bundle.es.js +39 -23
- package/dist/bundle.es.js.map +1 -1
- package/dist/index.d.ts +111 -0
- package/package.json +1 -1
- package/src/decisions/decisions-api.ts +23 -0
- package/src/decisions/types.ts +94 -0
- package/src/index.ts +17 -0
- package/src/persona-sdk.ts +7 -0
- package/tests/decisions-api.test.mjs +57 -0
package/dist/bundle.es.js
CHANGED
|
@@ -98,7 +98,7 @@ class c {
|
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
|
-
class
|
|
101
|
+
class b extends c {
|
|
102
102
|
constructor(e, s, r) {
|
|
103
103
|
super(e, s);
|
|
104
104
|
h(this, "billingBaseUrl");
|
|
@@ -154,7 +154,7 @@ class f extends c {
|
|
|
154
154
|
return i ? JSON.parse(i) : void 0;
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
class
|
|
157
|
+
class f extends c {
|
|
158
158
|
constructor(t, e) {
|
|
159
159
|
super(t, e);
|
|
160
160
|
}
|
|
@@ -414,7 +414,7 @@ class S extends c {
|
|
|
414
414
|
await this.httpDelete("/credentials/all/" + t);
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
|
-
class
|
|
417
|
+
class A extends c {
|
|
418
418
|
constructor(t, e) {
|
|
419
419
|
super(t, e);
|
|
420
420
|
}
|
|
@@ -442,14 +442,14 @@ class T extends c {
|
|
|
442
442
|
return this.httpPost("/features/templates/mcp/available-tools", t, s);
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
class
|
|
445
|
+
class T {
|
|
446
446
|
constructor(t, e) {
|
|
447
447
|
h(this, "baseUrl");
|
|
448
448
|
h(this, "auth");
|
|
449
449
|
this.baseUrl = t, this.auth = e;
|
|
450
450
|
}
|
|
451
451
|
templates() {
|
|
452
|
-
return new
|
|
452
|
+
return new A(this.baseUrl, this.auth);
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
455
|
class C extends c {
|
|
@@ -919,7 +919,19 @@ class N extends c {
|
|
|
919
919
|
await this.httpPost("/notifications/read-all", void 0, t ? { projectId: t } : void 0);
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
|
-
class
|
|
922
|
+
class M extends c {
|
|
923
|
+
constructor(t, e) {
|
|
924
|
+
super(t, e);
|
|
925
|
+
}
|
|
926
|
+
async decide(t) {
|
|
927
|
+
return this.httpPost("/decisions", t);
|
|
928
|
+
}
|
|
929
|
+
/** The decision models persona-core knows (`id` is what `decide` takes). */
|
|
930
|
+
async listModels() {
|
|
931
|
+
return this.httpGet("/decision-models");
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
class L {
|
|
923
935
|
constructor(t, e, s) {
|
|
924
936
|
h(this, "baseUrl");
|
|
925
937
|
h(this, "workflowsBaseUrl");
|
|
@@ -927,10 +939,10 @@ class _ {
|
|
|
927
939
|
this.baseUrl = t, this.workflowsBaseUrl = e, this.billingBaseUrl = s || "https://persona.applica.guru/billing";
|
|
928
940
|
}
|
|
929
941
|
projects(t) {
|
|
930
|
-
return new
|
|
942
|
+
return new b(this.baseUrl, t, this.billingBaseUrl);
|
|
931
943
|
}
|
|
932
944
|
agents(t) {
|
|
933
|
-
return new
|
|
945
|
+
return new f(this.baseUrl, t);
|
|
934
946
|
}
|
|
935
947
|
knowledgeBases(t) {
|
|
936
948
|
return new k(this.baseUrl, t);
|
|
@@ -942,7 +954,7 @@ class _ {
|
|
|
942
954
|
return new S(this.baseUrl, t);
|
|
943
955
|
}
|
|
944
956
|
features(t) {
|
|
945
|
-
return new
|
|
957
|
+
return new T(this.baseUrl, t);
|
|
946
958
|
}
|
|
947
959
|
triggers(t) {
|
|
948
960
|
return new R(this.baseUrl, t);
|
|
@@ -971,11 +983,14 @@ class _ {
|
|
|
971
983
|
notifications(t) {
|
|
972
984
|
return new N(this.baseUrl, t);
|
|
973
985
|
}
|
|
986
|
+
decisions(t) {
|
|
987
|
+
return new M(this.baseUrl, t);
|
|
988
|
+
}
|
|
974
989
|
values(t) {
|
|
975
990
|
return new D(this.baseUrl, t);
|
|
976
991
|
}
|
|
977
992
|
}
|
|
978
|
-
class
|
|
993
|
+
class $ {
|
|
979
994
|
constructor(t) {
|
|
980
995
|
this.token = t;
|
|
981
996
|
}
|
|
@@ -987,28 +1002,29 @@ class L {
|
|
|
987
1002
|
}
|
|
988
1003
|
}
|
|
989
1004
|
const g = "alias:";
|
|
990
|
-
function
|
|
1005
|
+
function J(o) {
|
|
991
1006
|
return !!o && o.trim().toLowerCase().startsWith(g);
|
|
992
1007
|
}
|
|
993
|
-
function
|
|
994
|
-
if (!
|
|
1008
|
+
function F(o) {
|
|
1009
|
+
if (!J(o))
|
|
995
1010
|
throw new Error(`Not a model alias reference: ${JSON.stringify(o)}`);
|
|
996
1011
|
return o.trim().slice(g.length).trim();
|
|
997
1012
|
}
|
|
998
|
-
function
|
|
1013
|
+
function K(o) {
|
|
999
1014
|
return g + o.trim();
|
|
1000
1015
|
}
|
|
1001
1016
|
export {
|
|
1002
1017
|
g as ALIAS_PREFIX,
|
|
1003
|
-
|
|
1018
|
+
f as AgentsApi,
|
|
1004
1019
|
l as ApiException,
|
|
1005
1020
|
w as ApiKeyAuthenticationProvider,
|
|
1006
|
-
|
|
1021
|
+
$ as BearerTokenAuthenticationProvider,
|
|
1007
1022
|
O as BillingClient,
|
|
1008
1023
|
U as ChannelsApi,
|
|
1009
1024
|
S as CredentialsApi,
|
|
1010
|
-
|
|
1011
|
-
A as
|
|
1025
|
+
M as DecisionsApi,
|
|
1026
|
+
A as FeatureTemplatesApi,
|
|
1027
|
+
T as FeaturesApi,
|
|
1012
1028
|
z as HumanTasksApi,
|
|
1013
1029
|
v as KnowledgeBaseDocumentsApi,
|
|
1014
1030
|
k as KnowledgeBasesApi,
|
|
@@ -1016,8 +1032,8 @@ export {
|
|
|
1016
1032
|
q as MissionsApi,
|
|
1017
1033
|
H as ModelAliasesApi,
|
|
1018
1034
|
N as NotificationsApi,
|
|
1019
|
-
|
|
1020
|
-
|
|
1035
|
+
L as PersonaSdk,
|
|
1036
|
+
b as ProjectsApi,
|
|
1021
1037
|
B as ProvidersApi,
|
|
1022
1038
|
I as ServicePricesApi,
|
|
1023
1039
|
j as SessionsApi,
|
|
@@ -1026,8 +1042,8 @@ export {
|
|
|
1026
1042
|
D as ValuesApi,
|
|
1027
1043
|
G as WorkflowExecutionsApi,
|
|
1028
1044
|
x as WorkflowsApi,
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1045
|
+
F as aliasNameFromRef,
|
|
1046
|
+
K as aliasRef,
|
|
1047
|
+
J as isAliasRef
|
|
1032
1048
|
};
|
|
1033
1049
|
//# sourceMappingURL=bundle.es.js.map
|